1 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
3 * savedir.h (fdsavedir): New decl.
4 * savedir.c (fdsavedir, savedirstream): New functions; the latter
5 contains most of the former guts of savedir.
6 (savedir): Use savedirstream.
9 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
11 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
12 coreutils no longer futzes with rounding modes.
14 2005-11-14 Jim Meyering <jim@meyering.net>
16 * mkstemp-safer.c: Include <config.h>, required for possible
17 replacement of mkstemp.
19 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
21 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
23 (gethrxtime) [! (HAVE_NANOUPTIME
24 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
25 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
26 our own approximation.
28 2005-11-10 Simon Josefsson <jas@extundo.com>
30 * readline.c: Remove EOL.
32 2005-11-08 Eric Blake <ebb9@byu.net>
34 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
36 2005-11-08 Eric Blake <ebb9@byu.net>
38 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
40 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
42 Fix porting problem reported by Theodoros V. Kalamatianos.
43 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
44 Don't assume that futimes failing means we must fail.
46 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
48 * getcwd.c (__getcwd): Don't assume that system calls after readdir
49 leave errno alone. Problem reported by Dmitry V. Levin.
51 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
53 * savedir.c (savedir): Don't assume that xrealloc etc. leave
54 errno alone. Problem reported by Frederic Jolliton.
56 2005-10-28 Simon Josefsson <jas@extundo.com>
58 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
59 "restrict" keywords, as per POSIX. Protect the function
60 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
61 Don't use K&R prototypes. Check the sprintf return values.
62 Re-define EAFNOSUPPORT if not present. Indent.
64 * md5.h, md5.c: Simplify buffer handling visavi alignment,
65 suggested by Bruno Haible <bruno@clisp.org>.
67 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
69 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
71 * gc-libgcrypt.c: Add MD2 (which is not available through
74 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
76 * md2.h, md2.c: New files.
78 2005-10-24 Simon Josefsson <jas@extundo.com>
80 * md4.h: Shrink buffer size, now that we changed the type.
82 2005-10-22 Simon Josefsson <jas@extundo.com>
84 * arcfour.h, arcfour.c: Use fixed size indices in the
85 arcfour_context struct (simplify test vector testing in GNU
88 2005-10-22 Simon Josefsson <jas@extundo.com>
90 * md4.h, md4.c: Simplify buffer handling visavi alignment,
91 suggested by Bruno Haible <bruno@clisp.org>.
93 2005-10-22 Simon Josefsson <jas@extundo.com>
95 * crc.h: Include stddef.h, for size_t.
97 2005-10-21 Simon Josefsson <jas@extundo.com>
99 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
100 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
102 2005-10-21 Simon Josefsson <jas@extundo.com>
104 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
107 2005-10-21 Simon Josefsson <jas@extundo.com>
109 * gc-gnulib.c: Support ARCTWO in CBC mode.
111 2005-10-21 Simon Josefsson <jas@extundo.com>
113 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
116 * hmac-sha1.c (hmac_sha1): Likewise.
118 * crc.c (crc32_update): Actually use crc parameter, suggested by
119 Bruno Haible <bruno@clisp.org>.
121 * crc.h: Include stdint.h directly, suggested by Bruno Haible
124 2005-10-21 Simon Josefsson <jas@extundo.com>
126 * des.h, des.c: New files.
128 * gc-gnulib.c: Support DES.c
130 2005-10-21 Simon Josefsson <jas@extundo.com>
132 * arctwo.h, arctwo.c: New files.
134 * gc-gnulib.c: Support ARCTWO.
136 2005-10-21 Simon Josefsson <jas@extundo.com>
138 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
140 2005-10-19 Simon Josefsson <jas@extundo.com>
142 * gc-gnulib.c: Support ARCFOUR.
144 2005-10-19 Simon Josefsson <jas@extundo.com>
146 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
149 * gc.h: Add ECB enum type.
151 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
153 2005-10-19 Simon Josefsson <jas@extundo.com>
155 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
157 2005-10-18 Simon Josefsson <jas@extundo.com>
159 * md4.h, md4.c: New files, based on md5.?.
161 2005-10-17 Simon Josefsson <jas@extundo.com>
163 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
165 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
167 2005-10-17 Simon Josefsson <jas@extundo.com>
169 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
171 2005-10-17 Simon Josefsson <jas@extundo.com>
173 * gc.h, gc-libgcrypt.c: Add ciphers.
175 2005-10-17 Simon Josefsson <jas@extundo.com>
177 * sha1.c: Use uint32_t instead of md5_uint32.t
179 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
182 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
184 * md5.h: Use stdint.h and uint32_t. Doc fix.
186 2005-10-15 Simon Josefsson <jas@extundo.com>
188 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
190 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
192 2005-10-14 Simon Josefsson <jas@extundo.com>
194 * arcfour.h, arcfour.c: New files.
196 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
198 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
199 include <wchar.h>; no longer needed.
201 2005-10-14 Jakub Jelinek <jakub@redhat.com>
202 and Ulrich Drepper <drepper@redhat.com>
205 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
206 instead of inline stream orientation test and two separate
207 function calls. Pay no attention to USE_IN_LIBIO.
209 2005-10-14 Roland McGrath <roland@redhat.com>
211 Import from libc. [BZ #1331]
212 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
214 Reported by Matej Vela <vela@debian.org>.
216 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
218 * mkdir-p.c (make_dir_parents): Don't report an error if an
219 intermediate directory is in a read-only file system. Problem
220 reported by Eric Blake.
222 2005-10-13 Simon Josefsson <jas@extundo.com>
224 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
225 Move memory allocation outside of loop.
227 2005-10-12 Simon Josefsson <jas@extundo.com>
229 * gc-pbkdf2-sha1.c: New file.
231 * gc.h: Add gc_pbkdf2_sha1 prototype.
233 2005-10-12 Simon Josefsson <jas@extundo.com>
235 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
236 suggested by Bruno Haible <bruno@clisp.org>.
238 2005-10-12 Simon Josefsson <jas@extundo.com>
240 * gc-libgcrypt.c (gc_hmac_sha1): New function.
242 * gc-gnulib.c (gc_hmac_sha1): New function.
244 2005-10-12 Simon Josefsson <jas@extundo.com>
246 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
248 2005-10-12 Simon Josefsson <jas@extundo.com>
250 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
251 GC_USE_HMAC_MD5, respectively.
253 * gc-libgcrypt.c (gc_md5): Fix assert call.
256 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
258 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
260 * gc-gnulib.c (gc_hash_buffer): Ditto.
262 2005-10-11 Bruno Haible <bruno@clisp.org>
264 * c-strcasestr.h: New file, from GNU gettext.
265 * c-strcasestr.c: New file, from GNU gettext.
267 2005-10-11 Bruno Haible <bruno@clisp.org>
269 * c-strcase.h: New file, from GNU gettext.
270 * c-strcasecmp.c: New file, from GNU gettext.
271 * c-strncasecmp.c: New file, from GNU gettext.
273 2005-10-11 Simon Josefsson <jas@extundo.com>
275 * crc.h, crc.c: New files.
277 * gc.h (gc_hash_buffer): Add doc.
279 2005-10-08 Simon Josefsson <jas@extundo.com>
281 * gc.h: Add gc_hash and gc_hash_buffer.
283 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
285 * gc-libgcrypt.c (gc_hash_buffer): Add.
287 2005-10-11 Bruno Haible <bruno@clisp.org>
289 * strcasecmp.c: Include limits.h.
290 (strcasecmp): Avoid integer overflow on exotic platforms.
291 * strncasecmp.c: Include limits.h.
292 (strncasecmp): Avoid integer overflow on exotic platforms.
293 Reported by Paul Eggert.
295 2005-10-06 Simon Josefsson <jas@extundo.com>
297 * hmac-md5.c: New file.
301 2005-10-06 Simon Josefsson <jas@extundo.com>
303 * memxor.c (memxor): Avoid casts and warnings.
305 2005-10-05 Derek Price <derek@ximbiot.com>
307 * getdelim.c (SIZE_MAX): New macro, if not already defined.
309 2005-10-05 Simon Josefsson <jas@extundo.com>
311 * memxor.c (memxor): Fix compiler error.
313 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
314 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
316 * memxor.h, memxor.c: New files.
318 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
319 we assume all systems have it, suggested by Jim Meyering
320 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
321 any systems lack sys/socket.h; mingw32 is known to lack it, but we
322 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
325 2005-10-04 Bruno Haible <bruno@clisp.org>
327 * verify.h (verify_true): Provide alternative definition for C++.
329 2005-10-04 Simon Josefsson <jas@extundo.com>
331 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
332 D. Baushke" <mdb@gnu.org>.
334 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
336 * getdelim.c: Include getdelim.h first. Include <limits.h>.
337 (SSIZE_MAX): New macro, if not already defined.
338 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
341 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
343 * exclude.c: Include verify.h.
344 (verify): Remove. All callers changed to use verify.h's version.
345 * strtoimax.c: Likewise.
346 * utimecmp.c: Likewis.e
349 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
350 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
351 * .cvsignore: Add fts.h, search.h, t-fpending.
352 * settime.c (settime): Fix { typo in previous patch. Also, don't
353 bother returning ENOSYS if settimeofday or stime fails; just let
354 them return whatever errno they want to return.
355 * utimens.c: Include unistd.h, for dup2.
356 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
357 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
359 2005-10-02 Jim Meyering <jim@meyering.net>
362 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
363 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
364 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
365 Remove AT_FDCWD test.
366 Do not consume the fd unless successful.
367 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
368 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
369 block, so that we don't even try to compile it if settimeofday is
370 available. This works around a compilation failure on OSF1 V5.1,
371 due to stime requiring a `long int*' while tv_sec is `int'.
373 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
375 * getdelim.c (getdelim): Remove unused variables.
377 2005-10-01 Simon Josefsson <jas@extundo.com>
379 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
380 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
381 AI_* and EAI_* definitions. Protect function declarations.
383 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
385 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
386 so that the code works even with ancient cpp. Portability problem
387 with GCC 2.7.2.1 reported by Thomas M.Ott.
389 2005-09-27 Jim Meyering <jim@meyering.net>
391 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
393 * intprops.h (signed_type_or_expr__): Define.
394 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
397 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
399 * verify.h (verify_expr): Remove, replacing with:
400 (verify_true): New macro that returns true instead of void.
401 (verify_type__): Remove.
402 (verify): Use verify_true rather than verify_type__.
404 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
406 * utimens.c (ENOSYS): Define if not already defined.
407 (futimens): Support having a null PATH if the file descriptor
410 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
412 (__attribute): Define to empty unless GCC 3.1 or later.
413 This works around a core dump on OpenBSD 3.4, which has GCC
414 2.95.3, which dumps core when given __attribute__(()). It also
415 simplifies other tests, since we really don't want to bother with
416 worrying about which ancient version of GCC supported what.
417 Original problem reported by Yoann Vandoorselaere, with part of
418 the fix suggested by Derek Price.
420 2005-09-24 Jim Meyering <jim@meyering.net>
422 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
423 so we can once again use a positive bitfield width of 1 -- now we
424 don't have to explain why we were using a bitfield width of 2.
426 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
428 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
429 Problem reported by Eric Blake.
430 (getaddrinfo): Initialize se so that it's not garbage.
431 Redo internal storage allocation so that it doesn't make unportable
432 assumptions about alignment.
435 * utimens.c (futimens): Use futimesat if available.
436 Prefer it to futimes since it doesn't have the futimes bug.
438 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
439 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
440 Instead, declare a function that returns a pointer to an array,
441 and use verify_type__ to declare the size of the array.
442 Problem and germ of a solution reported by Bruno Haible.
443 (verify_type__): Use 2, not 1, for bitfield size, to avoid
444 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
446 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
450 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
452 * argmatch.h: Include verify.h
453 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
454 (ARGMATCH_ASSERT): Remove; unused.
455 * canonicalize.c: Assume STDC_HEADERS.
456 * exclude.c: Include "strcase.h".
457 * regex_internal.h [!defined _LIBC]: Likewise.
458 * getusershell.c: Include stdio--.h rather than stdio.h
460 (getusershell): Call fopen, not fopen_safer.
461 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
462 Do not include unistd-safer.h.
463 (save_cwd): Don't call fd_safer; no longer needed
464 now that we include fcntl--.h.
466 * getdate.y (relative_time): New type.
467 (RELATIVE_TIME_0): New constant.
468 (parser_control): Use relative_time instead of doing it ourselves.
469 (%union): Add new relative_time rel member.
470 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
472 (relunit, relunit_snumber): Now of type rel.
473 (zone, rel, relunit, get_date): Adjust to above changes.
475 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
476 Do not include unistd-safer.h.
477 (getloadavg): Don't call fd_safer; no longer needed
478 now that we include fcntl--.h.
480 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
481 (make_dir_parents): Treat ENOSYS like EEXIST.
483 Improve quality of diagnostics on restore_cwd failure.
484 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
485 (make_dir_parents): Last arg is now int * (for errno), not bool *.
486 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
487 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
488 each time through the loop. Do not diagnose restore_cwd failure;
489 that is the caller's job (and perhaps the caller does not care).
491 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
492 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
493 If the file already exists but is not a directory, don't bother
494 to try to make its parents.
495 Close potential file descriptor leak if we can't chdir("/") (!).
496 Don't always return true if chdir($PWD) fails; return true only
497 if the requested action was done successfully (except for the
499 Don't log final directory unless we actually made it.
500 Refactor to avoid duplicate code to fix up permissions.
501 Don't attempt to fix up parent permissions if chdir($PWD) fails.
503 * strftime.c (my_strftime): Rewrite the previous change slightly,
504 to make it a bit faster and (I hope) clearer.
505 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
506 Fix bug in formats like %2N.
508 * verify.h: New file.
510 2005-09-22 Jim Meyering <jim@meyering.net>
514 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
516 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
517 the .tm_year member, since otherwise gcc-4.0 would now warn about
518 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
520 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
521 order to avoid an unsuppressible warning from gcc on 64-bit systems.
523 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
524 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
525 when run in a time zone for which daylight savings time is in effect
526 for the starting date.
528 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
529 stop us from restricting permissions of just-created absolute-named
531 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
532 to restore initial working directory.
533 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
534 to tell caller if/when we change the working directory and are
535 unable to return to the initial one.
536 * mkdir-p.h (make_dir_parents): Update prototype.
537 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
538 `return false'. This fixes a bug introduced on 2004-07-30.
540 * openat.c (fdopendir): Be sure to close the supplied
541 file descriptor before returning. This makes our replacement
542 implementation a little closer to Solaris's, where fdopendir
543 ties the file descriptor to the returned DIR* pointer.
544 * openat.c (unlinkat): New function.
545 * openat.h (unlinkat): Add prototype.
546 * openat-die.c (openat_save_fail): Rename from openat_save_die.
547 (openat_restore_fail): Rename from openat_restore_die.
548 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
550 Provide an alternative to exiting immediately upon save_cwd or
551 restore_cwd failure. Now, an application can arrange e.g.,
552 to perform a longjump in that case.
553 * openat.c: Include dirname.h.
554 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
555 (rpl_openat, fdopendir, fstatat): Call openat_save_die
556 and openat_restore_die rather than calling error directly.
557 Don't include "error.h" or "exitfail.h"; they're no longer needed.
559 * openat-die.c (openat_save_die, openat_restore_die): New file.
560 * openat.h (openat_save_die, openat_restore_die): Declare and define.
562 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
563 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
564 int utc, int nanoseconds);
566 date should not have to allocate a megabyte of virtual memory to
567 handle a format argument like +%1048575T. When implemented with
568 strftime, it must allocate such a buffer, use strftime to fill it
569 in, print it, then free it.
570 With fprintftime, it simply prints everything and exits.
571 With no need for memory allocation, that's one fewer way to fail.
572 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
573 optional field width, not before, so we accept %9:z, not %:9z.
574 (my_strftime): Be sure to use L_('x') for literals.
576 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
577 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
578 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
579 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
580 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
581 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
582 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
583 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
584 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
586 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
587 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
588 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
589 and don't include <sys/file.h>).
591 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
595 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
596 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
597 [!LDAV_DONE]: Avoid unused variable warning.
599 2005-09-21 Bruno Haible <bruno@clisp.org>
601 * unicodeio.h (unicode_to_mb): New declaration.
603 2005-09-20 Derek Price <derek@ximbiot.com>
605 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
607 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
609 Use a consistent style for including <config.h>.
610 * __fpending.c, acl.c, argmatch.c,
611 argp-help.c, argp-parse.c,
612 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
613 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
614 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
615 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
616 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
617 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
618 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
619 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
620 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
621 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
622 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
623 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
624 modechange.c, mountlist.c, open-safer.c, physmem.c,
625 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
626 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
627 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
628 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
629 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
630 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
631 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
632 userspec.c, utimecmp.c, version-etc-fsf.c,
633 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
634 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
635 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
636 Standardize inclusion of config.h.
637 * __fpending.h, dirfd.h, getdate.h, human.h,
638 inttostr.h: Removed inclusion of config.h from header files.
639 * inttostr.c: Adjusted in-tree users.
640 * timespec.h: Remove superfluous warning to include config.h.
641 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
642 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
643 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
644 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
646 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
648 * stat-time.h: New file.
649 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
650 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
652 (timespec_cmp): New function.
653 * utimecmp.c: Include stat-time.h.
654 (SYSCALL_RESOLUTION): Depend on whether various struct stat
655 members exist, not on the obsolescent ST_MTIM_NSEC.
656 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
658 2005-09-15 Derek Price <derek@ximbiot.com>
659 Paul Eggert <eggert@cs.ucla.edu>
661 * regcomp.c, regexec.c, regex_internal.c: Back out previous
662 changes, consolidating in...
663 * regex_internal.h: ...this file.
665 2005-09-15 Derek Price <derek@ximbiot.com>
667 * regex_internal.h: Blank `pure' for GNUC < 3.
668 * regex_internal.c: Ditto, using this...
669 (__GNUC_PREREQ): ...new macro.
670 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
671 (__GNUC_PREREQ): ...this new macro.
673 * strstr.h: Include string.h. Define strstr as a macro here.
675 2005-09-13 Derek Price <derek@ximbiot.com>
677 * canon-host.c (canon_host_r): Set *cherror on memory allocation
679 Reported by Jim Meyering <jim@meyering.net>.
681 2005-09-13 Jim Meyering <jim@meyering.net>
683 * canon-host.c: Filter through gnu indent and reword comments slightly.
684 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
686 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
688 * lib/base64.c: Typo.
689 (base64_encode): Put b64str in initialized data section.
691 2005-09-12 Derek Price <derek@ximbiot.com>
693 Return usable errors from canon-host.
694 * canon-host.h: New file.
695 * canon-host.c (canon_host): Wrap...
696 (canon_host_r): ...this new function, which now relies exclusively on
698 (ch_strerror): New function.
699 (last_cherror): New global.
700 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
701 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
703 (freeaddrinfo): Free ai->ai_canonname when set.
705 2005-09-12 Derek Price <derek@ximbiot.com>
706 Paul Eggert <eggert@cs.ucla.edu>
708 * glob-libc.h: Renamed from glob_.h. The new version is
709 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
710 protecting things that should be done only in gnulib contexts.
711 * glob_.h: New file, containing only the glob things needed for
713 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
714 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
715 (glob, globfree, glob_pattern_p): Now defined simply in terms of
716 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
717 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
718 and to respect the namespace rules better.
720 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
722 Merge glibc and coreutils changes into gnulib, plus a few
724 * md5.c: Use #error rather than a string.
725 (CYCLIC): New macro, from glibc source. Use it instead of rol.
726 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
727 (__attribute__): Define to empty for non recent-GCC.
728 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
729 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
730 Renamed from their non-__ counterparts, with new macros replacing
731 them if not _LIBC. Add __THROW attribute.
733 (struct md5_ctx): Align buffer if using GCC.
734 * sha1.h (struct sha1_ctx): Likewise.
735 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
736 The old name was backwards.
737 (NOTSWAP): Remove; not used.
738 (rol): New macro, moved here from md5.h.
739 (sha1_process_block): Remove a FIXME that doesn't make sense.
741 2005-09-12 Derek Price <derek@ximbiot.com>
743 * gai_strerror.c: Include config.h when available. Include
744 getaddrinfo.h before other headers to test interface.
745 Reported by Larry Jones <lawrence.jones@ugs.com>.
747 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
749 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
750 definitions, since that's the preferred style in glibc.
751 Fix a minor spacing issue, and update copyright notice to match glibc's.
753 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
755 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
757 2005-09-06 Simon Josefsson <jas@extundo.com>
759 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
760 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
762 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
764 Change bitset word type from unsigned int to unsigned long int,
765 as this has better performance on typical 64-bit hosts.
766 Port bitset code to hosts with unusual word sizes.
767 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
768 (build_collating_symbol):
769 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
770 argument is a bitset. This is merely a style issue, but it makes
771 it clearer that an entire array is expected.
772 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
773 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
774 Port to the case where bitset_word is not the same as unsigned int.
775 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
776 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
778 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
779 (build_trtable, group_nodes_into_DFAstates):
781 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
782 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
783 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
784 * regexec.c (group_nodes_into_DFAstates): Likewise.
785 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
786 * regcomp.c (optimize_subexps, lower_subexp):
787 Work even if bitset_word has holes in its bitwise representation.
788 * regex_internal.h (BITSET_WORD_BITS): Likewise.
789 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
791 * regex_internal.c (re_string_reconstruct):
792 Don't assume UCHAR_MAX == 255.
793 * regex_internal.h (bitset_set_all): Likewise.
794 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
796 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
797 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
799 (BITSET_WORD_MAX): New macro.
800 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
801 (bitset_set_all, bitset_copy): Now inline functions, not macros.
802 (bitset_empty, bitset_copy):
803 Prefer sizeof (bitset) to multiplying it out ourselves.
804 (bitset_not_merge): Remove; unused.
805 (bitset_contain): Return bool, not unsigned int with one bit on.
807 * regexec.c (build_trtable): Don't assume bitset has no stricter
808 alignment than re_node_set; do this by defining a new internal
809 type struct dests_alloc and using it to allocate memory.
811 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
813 Check for arithmetic overflow when calculating sizes, to prevent
814 some buffer-overflow issues. These patches are conservative, in the
815 sense that when I couldn't determine whether an overflow was possible,
816 I inserted a run-time check.
817 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
818 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
819 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
820 (re_xnrealloc, re_x2nrealloc): New inline functions.
821 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
822 (build_equiv_class, build_charclass): Check for arithmetic overflow
823 in size expression calculations.
824 * lib/regex_internal.c (re_string_realloc_buffers):
825 (build_wcs_upper_buffer, re_node_set_add_intersect):
826 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
827 (re_dfa_add_node, register_state): Likewise.
828 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
829 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
830 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
831 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
833 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
835 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
836 to avoid a collision with bits/local_lim.h in glibc.
837 All uses changed. Problem reported by Dmitry V. Levin in
838 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
840 * regex_internal.c (build_wcs_upper_buffer): Fix portability
841 bugs in int versus size_t comparisons.
842 (re_string_context_at): Fix bug where the code assumed that
845 Use bool where appropriate.
846 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
848 (calc_eclosure_iter): Likewise, for ROOT arg.
849 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
850 (build_charclass_op): Likewise, for NON_MATCH arg.
851 * regex_internal.c (re_string_allocate, re_string_construct):
852 (re_string_construct_common): Likewise, for ICASE arg.
853 * regexec.c (re_search_2_stub, re_search_stub):
854 Likewise, for RET_LEN arg.
855 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
856 (set_regs): Likewise, for FL_BACKTRACK arg.
857 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
858 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
859 (calc_eclosure_iter, parse_bracket_exp):
860 Use bool for internal variables that are booleans.
861 * regexec.c (re_search_internal, check_matching, proceed_next_node):
862 (set_regs, build_sifted_states, sift_states_bkref):
863 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
864 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
865 (find_collation_sequence_value):
867 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
868 (re_node_set_compare):
869 Return bool, not int. All callers changed.
870 * regexec.c (check_halt_node_context, check_dst_limits):
871 (build_trtable, check_node_accept): Likewise.
872 * regex_internal.h: Include stdbool.h.
874 Fix bugs uncovered when converting to bool.
875 * regcomp.c (calc_eclosure_iter): Check for storage allocation
876 failure instead of charging ahead blindly.
877 * regex_internal.c (register_state): Likewise.
878 * regexec.c (re_search_2_stub): Use simpler method than boolean
879 for freeing internal storage.
880 (group_nodes_into_DFA_states): Use unsigned int, not int, for
881 bitset pieces used as boolean, to avoid undefined behavior
882 on hosts that do int overflow checking.
884 2005-08-31 Derek Price <derek@ximbiot.com>
886 * getdelim.c (getdelim): Return EOF on EOF.
887 Reported by Larry Jones <lawrence.jones@ugs.com>.
889 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
891 * regex_internal.c (re_string_reconstruct): Don't assume buffer
892 lengths fit in regoff_t; this isn't true if regoff_t is the same
894 * regex.c (re_search_internal): 5th arg is LAST_START
895 (= START + RANGE) instead of RANGE. This avoids overflow
896 problems when regoff_t is the same width as size_t.
898 (re_search_2_stub): Check for overflow when adding the
899 sizes of the two strings.
900 (re_search_stub): Check for overflow when adding START
901 to RANGE; if it occurs, substitute the extreme value.
903 2005-08-31 Jim Meyering <jim@meyering.net>
905 * regcomp.c (search_duplicated_node): Make first pointer arg
907 * regex_internal.c (create_ci_newstate, create_cd_newstate):
908 (register_state): Likewise.
909 * regexec.c (search_cur_bkref_entry, check_dst_limits):
910 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
911 (group_nodes_into_DFAstates): Likewise.
913 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
915 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
916 old glibc regex code mishandles strings longer than 2**31 bytes.
917 This patch fixes this when the regex code is used in gnulib
918 (i.e., outside glibc).
920 This patch should not affect the use of the regex code inside
921 glibc. No doubt this problem also needs to be handled for glibc
922 as well, but the result will be an incompatible change to the
923 glibc ABI, and the old ABI will have to be supported too. That
924 can be the the subject for another patch.
926 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
927 governing whether the rest of this patch is active. By default,
928 the macro is disabled and the patch has no effect.
929 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
930 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
931 (struct re_pattern_buffer, re_search, re_search_2, re_match):
932 (re_match_2, re_set_registers): Use the new types.
933 * regex_internal.h (Idx, re_hashval_t): New types.
934 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
936 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
937 (re_string_context_at, bin_tree_t, re_dfastate_t):
938 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
939 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
940 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
941 (re_string_char_size_at, re_string_wchar_at):
942 (re_string_elem_size_at):
943 Use the new types and macros to port to 64-bit hosts.
944 Use unsigned types for internal values, so that the code
945 mostly works even for arrays larger than SSIZE_MAX.
946 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
947 (search_duplicated_node, calc_eclosure_iter, fetch_number):
948 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
949 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
950 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
951 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
952 (calc_inveclosure, parse_dup_op, build_range_exp):
953 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
954 (fetch_number, create_token_tree, mark_opt_subexp):
956 * regex_internal.c (re_string_construct_common, create_ci_newstate):
957 (create_cd_newstate, re_string_allocate, re_string_construct):
958 (re_string_realloc_buffers, build_wcs_upper_buffer):
959 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
960 (re_string_reconstruct, re_string_peek_byte_case):
961 (re_string_fetch_byte_case, re_string_context_at):
962 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
963 (re_node_set_init_copy, re_node_set_add_intersect):
964 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
965 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
966 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
967 (re_acquire_state, re_acquire_state_context, register_state):
969 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
970 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
971 (re_search_internal, re_search_2_stub, re_search_stub)
972 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
973 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
974 (update_cur_sifted_state, check_dst_limits):
975 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
976 (check_subexp_limits, sift_states_bkref, merge_state_array):
977 (check_subexp_matching_top, get_subexp, get_subexp_sub):
978 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
979 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
980 (expand_bkref_cache, check_node_accept_bytes):
981 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
982 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
983 (acquire_init_state_context, check_halt_node_context):
984 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
985 (sift_states_backward, clean_state_log_if_needed):
986 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
987 (find_recover_state, transit_state_sb, transit_state_mb):
988 (transit_state_bkref, build_trtable, match_ctx_clean):
990 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
991 to work around an assumption that REG_MISSING is negative.
993 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
994 (seek_collating_symbol_entry) [defined _LIBC]:
995 (lookup_collation_sequence_value) [defined _LIBC]:
996 (build_range_exp, build_collating_symbol) [defined _LIBC]:
997 Use prototypes rather than old-style function definitions.
998 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
999 (transit_state_sb) [0]:
1000 (find_collation_sequence_value) [defined _LIBC]: Likewise.
1002 * regexec.c (re_search_internal): Simplify update of rm_so and
1005 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
1006 (optimize_subexps, lower_subexp):
1007 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
1008 since the signed shift might overflow. Use 1u<<31 instead.
1009 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
1010 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1013 * regcomp.c (optimize_subexps, lower_subexp):
1014 Use CHAR_BIT rather than 8, for clarity.
1015 * regexec.c (check_dst_limits_calc_pos_1):
1016 (check_subexp_matching_top): Likewise.
1017 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
1018 have to worry about portability issues when shifting it left.
1019 Remove no-longer-needed test for table_size > 0.
1020 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
1021 in a word, as the resulting behavior is undefined.
1022 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
1023 in one case, a <= should have been an <, and in another case the
1024 whole test was missing.
1025 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
1026 the standard name CHAR_BIT.
1027 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
1028 this is not true on one's complement and signed-magnitude hosts.
1030 * regex_internal.h (re_sub_match_top_t): Remove unused member
1032 (struct re_dfa_t): Remove unused member states_alloc.
1033 * regcomp.c (init_dfa): Don't initialize unused members.
1035 2005-08-31 Bruno Haible <bruno@clisp.org>
1037 * strstr.c: Include <stddef.h>, for NULL.
1038 * strcasestr.c: Likewise.
1039 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
1041 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
1043 * iconvme.h: Add prototype for iconv_alloc.
1045 2005-08-29 Simon Josefsson <jas@extundo.com>
1047 * iconvme.c: Fix errno.
1049 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
1051 * iconvme.c: Split iconv_string into iconv_alloc.
1053 2005-08-27 Jim Meyering <jim@meyering.net>
1055 * fopen-safer.c: Merge minor changes from coreutils.
1056 * dup-safer.c: Likewise.
1057 * fd-safer.c: Likewise.
1059 Merge from coreutils.
1060 * stdio--.h: New file.
1061 * stdlib--.h: New file.
1062 * mkstemp-safer.c: New file.
1064 GNU tar needs these.
1065 * pipe-safer.c: New file.
1066 * creat-safer.c: New file.
1067 * fcntl--.h (creat): Define to creat_safer.
1068 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
1069 * unistd--.h (pipe): Define to pipe_safer.
1070 * unistd-safer.h: Declare pipe_safer.
1072 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
1074 * regex_internal.h: Remove all references to
1075 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
1077 (bitset_not, bitset_merge, bitset_not_merge):
1078 (bitset_mask, re_string_allocate, re_string_construct):
1079 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
1080 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
1081 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
1082 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
1083 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1084 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1085 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
1086 (re_acquire_state_context):
1087 Remove unnecessary forward decls.
1088 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
1089 Put __attribute at function definition,
1090 now that the function decl has been removed.
1091 * lib/regex_internal.c (re_string_peek_byte_case):
1092 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
1095 2005-08-26 Simon Josefsson <jas@extundo.com>
1097 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
1098 Haible <bruno@clisp.org>.
1100 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1102 * regexec.c (set_regs): Don't alloca with an unbounded size.
1104 alloca modernization/simplification for regex.
1105 * regex.c: Remove portability cruft for alloca. This no longer
1106 needs to be at the start of the file, and can be moved into
1107 regex_internal.h and simplified.
1108 * regex_internal.h: Include <alloca.h>.
1109 (__libc_use_alloca) [!defined _LIBC]: New macro.
1110 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
1111 now works outside glibc.
1113 2005-08-24 Simon Josefsson <jas@extundo.com>
1115 * getpass.c: Add WIN32 implementation. Conditionalize use of
1116 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
1117 GLIBC specific code.
1119 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1121 Make regex safe for g++. This fixes one real bug (an "err"
1122 that should have been "*err"). g++ problem reported by
1124 * regex_internal.h (re_calloc): New macro, consistent with
1125 re_malloc etc. All callers of calloc changed to use re_calloc.
1126 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
1127 not int. All callers changed.
1128 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
1129 just use an array of size MB_LEN_MAX.
1130 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
1131 (find_recover_state): Change "err" to "*err"; this fixes what
1132 appears to be a real bug.
1133 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
1136 2005-08-25 Jim Meyering <jim@meyering.net>
1138 * open-safer.c: Include <config.h>.
1139 Otherwise, we'd lose LARGEFILE support in any file using
1142 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
1144 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
1145 * regex.h (regerror): Likewise.
1147 * regex.c: Do not include <sys/types.h>, as POSIX no longer
1148 requires this. (The code never needed it.)
1150 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
1151 All uses of recently-renamed identifiers changed to use the new,
1152 POSIX-compliant names. The code will build and run just fine
1153 without these changes, but it's better to eat our own dog food
1154 and use the standard-conforming names.
1156 * regex.h: Fix a multitude of POSIX name space violations.
1157 These changes have an effect only for programs that define
1158 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
1159 do not change anything for programs compiled in the normal way.
1160 Also, there is no effect on the ABI.
1162 (_REGEX_SOURCE): New macro.
1163 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
1164 defined and _GNU_SOURCE is not; this fixes a name space violation.
1166 Rename the following macros to obey POSIX requirements.
1167 The old names are still visible as macros if _REGEX_SOURCE is defined.
1168 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
1169 RE_BACKSLASH_ESCAPE_IN_LISTS.
1170 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
1171 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
1172 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
1173 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
1174 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
1175 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
1176 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
1177 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
1178 (REG_INTERVALS): renamed from RE_INTERVALS.
1179 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
1180 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
1181 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
1182 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
1183 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
1184 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
1185 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
1186 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
1187 RE_UNMATCHED_RIGHT_PAREN_ORD.
1188 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
1189 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
1190 (REG_DEBUG): renamed from RE_DEBUG.
1191 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
1192 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
1193 unusual, since we can't clash with the POSIX REG_ICASE.
1194 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
1195 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
1196 (REG_NO_SUB): renamed from RE_NO_SUB.
1197 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
1198 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
1199 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
1200 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
1201 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
1202 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
1203 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
1204 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
1205 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
1206 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
1207 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
1208 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
1209 RE_SYNTAX_POSIX_MINIMAL_BASIC.
1210 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
1211 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
1212 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
1213 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
1214 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
1215 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
1216 (REG_FIXED): Renamed from REGS_FIXED.
1217 (REG_NREGS): Renamed from RE_NREGS.
1219 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
1220 of other REG_* macros, since POSIX says the user is allowed to
1221 #undef these macros selectively.
1223 (reg_errcode_t): Update comment stating what other tables need
1226 Rename the following enum values to obey POSIX requirements.
1227 The old names are still visible as macros.
1228 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
1229 is not defined, since GNU is supposed to be a superset of POSIX as
1230 much as possible, and since we want reg_errcode_t to be a signed
1231 type for implementation consistency.
1232 (_REG_NOERROR): Renamed from REG_NOERROR.
1233 (_REG_NOMATCH): Renamed from REG_NOMATCH.
1234 (_REG_BADPAT): Renamed from REG_BADPAT.
1235 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
1236 (_REG_ECTYPE): Renamed from REG_ECTYPE.
1237 (_REG_EESCAPE): Renamed from REG_EESCAPE.
1238 (_REG_ESUBREG): Renamed from REG_ESUBREG.
1239 (_REG_EBRACK): Renamed from REG_EBRACK.
1240 (_REG_EPAREN): Renamed from REG_EPAREN.
1241 (_REG_EBRACE): Renamed from REG_EBRACE.
1242 (_REG_BADBR): Renamed from REG_BADBR.
1243 (_REG_ERANGE): Renamed from REG_ERANGE.
1244 (_REG_ESPACE): Renamed from REG_ESPACE.
1245 (_REG_BADRPT): Renamed from REG_BADRPT.
1246 (_REG_EEND): Renamed from REG_EEND.
1247 (_REG_ESIZE): Renamed from REG_ESIZE.
1248 (_REG_ERPAREN): Renamed from REG_ERPAREN.
1249 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
1250 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
1251 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
1252 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
1254 (_REG_RE_NAME, _REG_RM_NAME): New macros.
1255 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
1256 changed. But support the old name if the new one is not defined
1257 and if _REGEX_SOURCE.
1259 Change the following member names in struct re_pattern_buffer.
1260 The old names are still supported if !_REGEX_SOURCE.
1261 The new names are always supported, regardless of _REGEX_SOURCE.
1262 (re_buffer): Renamed from buffer.
1263 (re_allocated): Renamed from allocated.
1264 (re_used): Renamed from used.
1265 (re_syntax): Renamed from syntax.
1266 (re_fastmap): Renamed from fastmap.
1267 (re_translate): Renamed from translate.
1268 (re_can_be_null): Renamed from can_be_null.
1269 (re_regs_allocated): Renamed from regs_allocated.
1270 (re_fastmap_accurate): Renamed from fastmap_accurate.
1271 (re_no_sub): Renamed from no_sub.
1272 (re_not_bol): Renamed from not_bol.
1273 (re_not_eol): Renamed from not_eol.
1274 (re_newline_anchor): Renamed from newline_anchor.
1276 Change the following member names in struct re_registers.
1277 The old names are still supported if !_REGEX_SOURCE.
1278 The new names are always supported, regardless of _REGEX_SOURCE.
1279 (rm_num_regs): Renamed from num_regs.
1280 (rm_start): Renamed from start.
1281 (rm_end): Renamed from end.
1283 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
1284 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
1285 Prepend __ to parameter names.
1287 Undo yesterday's changes.
1289 2005-08-24 Jim Meyering <jim@meyering.net>
1291 Sync from coreutils.
1292 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
1294 2005-08-21 Bruno Haible <bruno@clisp.org>
1296 * lock.h: Add multiple inclusion guard.
1297 * tls.h: Add multiple inclusion guard.
1299 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
1301 * regex.h (REG_NOSYS)
1302 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
1303 Define, since POSIX requires it as of 2001.
1304 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
1305 New private symbol, used to keep the enum signed in all cases.
1306 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
1307 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
1309 * regex_internal.c (re_string_skip_chars, register_state):
1311 Remove forward decls; no longer needed now that we use prototypes.
1312 * regexec.c (acquire_init_state_context, check_halt_node_context):
1313 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
1314 (clean_state_log_if_needed): Likewise.
1316 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1318 Fix problems reported by Sam Steingold in
1319 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
1320 * regexec.c (sift_states_bkref): Fix portability bug: the code
1321 assumed that reg_errcode_t is a signed type, which is not
1322 necessarily true if _XOPEN_SOURCE is not defined.
1323 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
1324 some compilers warn about it otherwise.
1326 2005-08-20 Jim Meyering <jim@meyering.net>
1328 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
1329 of unused local, dfa.
1331 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1333 * regcomp.c (create_initial_state): Remove duplicate decl.
1334 (init_word_char, create_initial_state, duplicate_node_closure):
1335 (fetch_token, peek_token_bracket, build_range_exp):
1336 (build_collating_symbol): Remove forward decls; no longer needed
1337 now that we use prototypes.
1340 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
1341 (re_compile_fastmap_iter, regcomp, regerror, regfree):
1342 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
1343 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
1344 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
1345 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
1346 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
1347 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
1348 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
1349 (build_range_exp, build_collating_symbol, parse_bracket_exp):
1350 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
1351 (build_charclass, build_charclass_op, fetch_number, create_tree):
1352 (create_token_tree, mark_opt_subexp, duplicate_tree):
1353 Use prototypes rather than old-style definitions.
1356 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
1357 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
1358 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1359 (re_string_reconstruct, re_string_peek_byte_case):
1360 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
1361 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1362 (re_node_set_init_copy, re_node_set_add_intersect):
1363 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1364 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1365 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1366 (re_acquire_state, re_acquire_state_context, register_state):
1367 (create_ci_newstate, create_cd_newstate, free_state):
1369 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
1370 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
1371 (re_search_internal, prune_impossible_nodes):
1372 (acquire_init_state_context, check_matching, static):
1373 (check_halt_node_context, check_halt_state_context, proceed_next_node):
1374 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
1375 (update_regs, sift_states_backward, build_sifted_states):
1376 (clean_state_log_if_needed, merge_state_array):
1377 (update_cur_sifted_state, add_epsilon_src_nodes):
1378 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
1379 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
1380 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
1381 (find_recover_state, check_subexp_matching_top, transit_state_mb):
1382 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
1383 (check_arrival, check_arrival_add_next_nodes):
1384 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1385 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1386 (check_node_accept_bytes, check_node_accept, extend_buffers):
1387 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
1388 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
1393 (re_string_allocate, re_string_construct, re_string_reconstruct):
1394 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
1395 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
1396 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
1397 (re_string_context_at, re_string_peek_byte_case):
1398 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
1399 is defined, since we now use prototypes always.
1401 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
1402 C89 or better. All uses removed.
1404 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1406 * regex_internal.c (re_acquire_state, re_acquire_state_context)
1407 [defined lint]: Suppress bogus uninitialized-variable warnings.
1409 * regcomp.c (duplicate_node): Return new index, not an error code,
1410 and let the caller return REG_ESPACE if out of space. This
1411 removes an uninitialied-variable warning with GCC 4.0.1, and also
1412 avoids taking the address of a local variable. All callers
1415 2005-08-19 Jim Meyering <jim@meyering.net>
1417 * regexec.c (proceed_next_node): Redo local variables to
1418 avoid GCC shadowing warnings.
1420 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1422 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
1423 (re_node_set_insert_last, re_dfa_add_node):
1424 Rename local variables to avoid GCC shadowing warnings.
1426 2005-08-18 Bruno Haible <bruno@clisp.org>
1428 * strstr.c (strstr): Fix return value in multibyte case.
1429 * strcasestr.c (strcasestr): Likewise.
1431 2005-08-17 Jim Meyering <jim@meyering.net>
1433 Make the %s format (seconds since the epoch) work for a negative
1434 number and when used with a zero-padded field width, e.g. %015s.
1436 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1437 label so that it precedes the code to set `digits'. Otherwise,
1438 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
1439 print `00-22'. Now, it prints `-0022', as it should.
1441 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
1443 * regex.h: Remove useless space-before-tab. From coreutils.
1445 2005-08-17 Bruno Haible <bruno@clisp.org>
1447 * strcasestr.h: New file.
1448 * strcasestr.c: New file.
1450 2005-08-17 Bruno Haible <bruno@clisp.org>
1452 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
1453 * strstr.c: Completely rewritten, with multibyte locale support.
1455 2005-08-17 Bruno Haible <bruno@clisp.org>
1457 * strcasecmp.c: Use mbuiter.h.
1459 2005-08-17 Bruno Haible <bruno@clisp.org>
1461 * mbuiter.h: New file.
1463 2005-08-16 Bruno Haible <bruno@clisp.org>
1465 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
1467 (mbi_avail, mbi_advance): Let the iteration end before the terminating
1468 NUL byte, not after it.
1470 2005-08-16 Bruno Haible <bruno@clisp.org>
1472 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
1473 the valid ones. Makes the comparison operations transitive:
1474 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
1475 * strcasecmp.c (strcasecmp): Use mb_casecmp.
1477 2005-08-16 Bruno Haible <bruno@clisp.org>
1479 * strcase.h (strcasecmp): Add note in comments.
1480 * strncasecmp.c: Use code from strcasecmp.c.
1481 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
1482 (strcasecmp): Work correctly in multibyte locales.
1484 2005-08-16 Bruno Haible <bruno@clisp.org>
1486 * strnlen1.h: New file.
1487 * strnlen1.c: New file.
1489 2005-08-16 Bruno Haible <bruno@clisp.org>
1491 * mbfile.h: New file.
1493 2005-08-16 Bruno Haible <bruno@clisp.org>
1495 * mbiter.h: New file.
1497 2005-08-16 Bruno Haible <bruno@clisp.org>
1499 * mbchar.h: New file.
1500 * mbchar.c: New file.
1502 2005-08-16 Bruno Haible <bruno@clisp.org>
1504 * tls.h: New file, from GNU gettext.
1505 * tls.c: New file, from GNU gettext.
1507 2005-08-15 Bruno Haible <bruno@clisp.org>
1509 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
1512 2005-08-14 Jim Meyering <jim@meyering.net>
1514 Sync from coreutils.
1516 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
1517 Use the hash-table-based cycle-detection code not just when
1518 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
1519 Reported by James Youngman in
1520 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
1521 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
1522 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
1523 This lets us compile with -DFTS_DEBUG, once again.
1524 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
1525 * fts.c (fd_safer): Remove decl.
1526 Include fcntl--.h rather than unistd-safer.h
1527 (fts_safe_changedir): Don't call fd_safer; no longer needed
1528 now that we include fcntl--.h.
1530 2005-08-11 Simon Josefsson <jas@extundo.com>
1532 * readline.h, readline.c: New file.
1534 2005-08-11 Bruno Haible <bruno@clisp.org>
1536 * strnlen.h (strnlen): Change parameter name to match comment.
1538 2005-08-10 Simon Josefsson <jas@extundo.com>
1540 * strndup.c: Use strnlen.h.
1542 * strnlen.h: New file.
1544 2005-08-02 Simon Josefsson <jas@extundo.com>
1546 * getline.h, getline.c: Rewrite.
1548 * getdelim.h, getdelim.c: New files, ported from glibc.
1550 2005-07-31 Bruno Haible <bruno@clisp.org>
1552 * lock.h (gl_lock_initializer): New macro.
1553 (gl_lock_define_initialized): Use it.
1554 (gl_rwlock_initializer): New macro.
1555 (gl_rwlock_define_initialized): Use it.
1556 (gl_recursive_lock_initializer): New macro.
1557 (gl_recursive_lock_define_initialized): Use it.
1559 2005-07-26 Bruno Haible <bruno@clisp.org>
1561 * lock.h: Update from GNU gettext.
1562 * lock.c: Update from GNU gettext.
1564 2005-07-18 Bruno Haible <bruno@clisp.org>
1566 * lock.h (gl_once_t): New type.
1567 (gl_once_define, gl_once): New macros.
1568 * lock.c (fresh_once): New variable.
1569 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
1572 2005-07-18 Simon Josefsson <jas@extundo.com>
1574 * check-version.c (check_version): Accept identical versions too.
1576 2005-07-18 Bruno Haible <bruno@clisp.org>
1578 * lock.h: New file, from GNU gettext.
1579 * lock.c: New file, from GNU gettext.
1581 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
1583 * quotearg.c: Add translator comment suggested by Bruno Haible,
1584 with a minor change.
1586 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
1588 * version-etc-fsf.c (version_etc_copyright): Parameterize the
1589 copyright symbol and the year.
1590 * version-etc.c (COPYRIGHT_YEAR): New constant.
1591 (version_etc_va): Use parameterized copyright notice.
1592 Reword to conform to the current GNU coding standards.
1594 2005-07-11 Simon Josefsson <jas@extundo.com>
1596 * size_max.h: New file.
1598 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
1600 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
1603 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
1604 and Paul Eggert <eggert@cs.ucla.edu>
1606 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
1607 in wint_t, not wchar_t. Remove now-unnecessary cast.
1609 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
1611 * regex.c, regex.h: Sync from libc.
1612 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
1613 New files, synced from libc, except that regex_internal.h
1614 currently has a small porting fix.
1616 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
1618 Remove the dependency of the strftime module on the tzset module.
1619 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
1620 Copy the input structure, to work around some of the bug with
1621 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
1622 Solaris releases, you should also use the tzset module, but we won't
1623 require it as a dependency any more since we don't want LGPLed code
1624 to depend on GPLed code.
1626 2005-07-02 Jim Meyering <jim@meyering.net>
1628 * backupfile.c (backup_args): Change a `0' to NULL.
1630 2005-07-01 Jim Meyering <jim@meyering.net>
1632 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1633 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
1634 * save-cwd.c, tempname.c:
1635 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1636 and don't include <sys/file.h>).
1638 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
1640 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
1641 declares only 'struct timespec;' (!).
1643 2005-06-29 Jim Meyering <jim@meyering.net>
1645 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
1646 type name. Use the variable name instead.
1647 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
1649 2005-06-28 Simon Josefsson <jas@extundo.com>
1651 * check-version.h, check-version.c: New files.
1653 2005-06-28 Simon Josefsson <jas@extundo.com>
1655 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
1656 collision with global variable. Better indentation. Don't
1657 increment buffer pointer beyond buffer end. Based on comments
1658 from Paul Eggert <eggert@cs.ucla.edu>.
1662 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
1664 * canon-host.c (canon-host): Append trailing "," to 0 in
1665 initializer of struct addrinfo, as an indication that we don't
1666 care how many members the structure has.
1668 2005-06-24 Derek Price <derek@ximbiot.com>
1669 and Bruno Haible <bruno@clisp.org>
1671 Remove stat module & update lstat.
1672 * stat.c: Remove this file...
1673 (slash_aware_lstat): ...moving this content and its support...
1674 * lstat.c (rpl_lstat): ...into here.
1675 * lstat.h: New file.
1677 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
1679 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
1680 (ranged_convert): Don't save conversion in a temporary struct.
1681 This causes a warning with GCC 4.0.0, and anyway in the typical
1682 case it's not worth the extra 100 bytes or so of code.
1683 (ranged_convert, __mktime_internal): When calling a function via a
1684 pointer P, use P () rather than (*P) (), as we now assume C89 or
1687 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
1689 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
1690 "who -r" failed to give output. Problem reported by Tim Waugh.
1692 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
1693 (xcalloc): Use it to avoid needless tests.
1694 Problem reported by Jim Meyering.
1696 2005-06-16 Jim Meyering <jim@meyering.net>
1698 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
1699 when either N or S is zero.
1701 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1703 * argp.h (__option_is_short): Check upper limit of
1704 __key. Isprint() requires its argument to have the value
1705 of an unsigned char or EOF.
1707 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
1709 * fnmatch.c (fnmatch): If there is an encoding error in a
1710 multibyte string or pattern, fall back on unibyte matching.
1711 Problem reported by James Youngman.
1713 2005-06-08 Bruno Haible <bruno@clisp.org>
1715 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
1718 2005-06-08 Bruno Haible <bruno@clisp.org>
1720 * csharpcomp.h: New file, from GNU gettext.
1721 * csharpcomp.c: New file, from GNU gettext.
1722 * csharpcomp.sh.in: New file, from GNU gettext.
1724 2005-06-07 Derek Price <derek@ximbiot.com>
1727 * glob_.h: Indent nested #ifdef.
1729 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
1731 Sync from coreutils.
1732 Use "file name" when talking about file names, instead of "filename"
1733 or "path", as per the GNU coding standards.
1734 * mkdir-p.c: Renamed from makepath.c.
1735 (make_dir_parents): Renamed from make_path. All callers changed.
1736 * mkdir-p.h: Likewise. All includers changed.
1737 * filenamecat.c: Renamed from path-concat.c.
1738 (file_name_concat): Renamed from path_concat. All callers changed.
1739 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
1740 * filenamecat.h: Likewise. All includers changed.
1741 * acl.c: Don't use "path" or "filename" to mean "file name"
1742 in comments or local variable names.
1743 * basename.c: Likewise.
1744 * canonicalize.c, canonicalize.h: Likewise.
1745 * dirname.c, dirname.h: Likewise.
1746 * euidaccess.c: Likewise.
1747 * exclude.c: Likewise
1748 * fnmatch_.h, fnmatch_loop.c: Likewise.
1749 * fsusage.c, fsuage.h: Likewise.
1750 * fts.c, fts_.h: Likewise.
1751 * getcwd.c: Likewise.
1752 * getloadavg.c: Likewise.
1753 * mkstemp.c: Likewise.
1754 * mountlist.c, mountlist.h: Likewise.
1755 * openat.c, openat.h: Likewise.
1756 * readlink-stub.c: Likewise.
1757 * readutmp.c, readutmp.h: Likewise.
1758 * rename.c: Likewise.
1759 * rmdir.c: Likewise.
1761 * savedir.c: Likewise.
1762 * stripslash.c: Likewise.
1763 * tempname.c: Likewise.
1764 * xreadlink.c: Likewise.
1765 * exclude.c (excluded_file_name): Renamed from excluded_filename.
1767 * exclude.h: Likewise.
1769 * euidaccess.c (getuid, getgid, getuid, getegid)
1770 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1771 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
1772 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1773 * pathmax.h: Include <limits.h> unconditionally, since other
1774 files have been getting away with it for years (MORE/BSD 4.3
1776 * userspec.c (getpwnam, getgrnam, getgrgid)
1777 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1779 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
1780 Define to 256, not 255, as per modern POSIX.
1782 2005-06-01 Bruno Haible <bruno@clisp.org>
1784 * csharpexec.h: New file, from GNU gettext.
1785 * csharpexec.c: New file, from GNU gettext.
1786 * csharpexec.sh.in: New file, from GNU gettext.
1788 2005-05-31 Derek Price <derek@ximbiot.com>
1789 Paul Eggert <eggert@cs.ucla.edu>
1792 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
1794 2005-05-29 Derek Price <derek@ximbiot.com>
1795 Paul Eggert <eggert@cs.ucla.edu>
1797 * glob_.h, glob.c: New files.
1799 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
1801 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
1803 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
1804 the configuration hassle isn't worth it.
1805 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
1806 (LONGEST_MODIFIER, PRIuMAX): Remove.
1808 2005-05-27 Bruno Haible <bruno@clisp.org>
1810 * getlogin_r.h: Remove second include of <stddef.h>.
1812 2005-05-25 Bruno Haible <bruno@clisp.org>
1813 Derek Price <derek@ximbiot.com>
1815 * getlogin_r.h: Simplify API documentation.
1817 2005-05-25 Derek Price <derek@ximbiot.com>
1818 Paul Eggert <eggert@cs.ucla.edu>
1820 * getlogin_r.c, getlogin_r.h: New files.
1822 2005-05-22 Bruno Haible <bruno@clisp.org>
1824 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
1825 Also include <sys/param.h> if it defines MIN, MAX.
1826 Based on a patch by Derek Price <derek@ximbiot.com>.
1828 2005-05-22 Bruno Haible <bruno@clisp.org>
1830 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
1831 (INT64_MIN): Fix definition.
1832 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1834 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
1835 NEED_SIGNED_INT_TYPES.
1837 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
1838 HAVE_SYSTEM_INTTYPES.
1840 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
1842 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
1843 so that unistd-safer.h (GPL'ed code) need not be included.
1845 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
1848 * fts.c: Don't include "cycle-check.h" or "hash.h".
1849 (setup_dir, free_dir): New functions.
1850 (enter_dir, leave_dir): Define trivial
1851 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
1852 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
1853 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
1854 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
1855 Move to fts-cycle.c.
1856 (fts_open): Use setup_dir.
1857 (fts_close): Use free_dir.
1858 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
1859 This adds a label and some gotos, but the alternatives were messier.
1860 Check for memory allocation failure when entering a dir.
1861 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
1862 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
1863 (FTS): New member fts_cycle, that is a union that contains the
1864 old active_dir_ht and cycle_state. All uses changed to mention
1865 fts_cycle.ht and fts_cycle.state.
1866 * fts-cycle.c: New file, containing GPL'ed code migrated out of
1867 fts.c, with the following changes:
1868 (setup_dir, free_dir): New functions.
1869 (enter_dir): Now returns bool. Return true if successful, false
1870 if memory exhausted. All callers changed.
1871 Do not bother partly cleaning up on
1872 memory allocation failure; that is free_dir's job.
1873 However, free ad if hash_insert fails, to avoid memory leak.
1874 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
1875 fts->fts_options to see which union member to use.
1877 2005-05-20 Jim Meyering <jim@meyering.net>
1879 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
1880 Now a macro, to pacify GCC.
1882 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
1884 * chown.c (rpl_chown): Return -1 on failure.
1886 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
1888 * canonicalize.c: Include canonicalize.h first, to test interface.
1889 Include <stddef.h> unconditionally, since we assume C89 now.
1890 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
1891 * fts.c: Include fts_.h first, to check interface.
1892 Do not include intprops.h; no longer needed.
1893 Include cycle-check.h and hash.h, since fts_.h no longer does.
1894 Remove unnecessary casts of closedir to void.
1895 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
1896 decide whether to decrement nlinks.
1897 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
1898 (FTS): Use struct hash_table * instead of Hash_table, so that
1899 we no longer need to include hash.h here.
1901 2005-05-17 Jim Meyering <jim@meyering.net>
1903 * fts.c, fts_.h: New files, from coreutils.
1905 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
1907 Sync from coreutils.
1908 * unlinkdir.c, unlinkdir.h: New files.
1909 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
1910 regex.h, unlocked-io.h, xtime.h:
1911 White space changes only.
1912 * makepath.c (make_path): Port to hosts where leading "//" is special.
1913 * yesno.c: Include getline.h, not ctype.h.
1914 (yesno): Don't remove leading white space; POSIX doesn't allow it.
1915 Use getline to remove arbitrary restriction on response length.
1917 2005-05-13 Bruno Haible <bruno@clisp.org>
1919 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
1920 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
1921 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
1922 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
1923 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
1924 Add support for 64-bit integers in the MSVC compiler.
1926 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
1928 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
1929 Change the initial comment to refer to GPL, not LGPL.
1930 gnulib-tool will change it to LGPL as needed.
1932 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
1933 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
1934 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
1935 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
1936 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
1937 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
1938 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
1939 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
1940 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
1941 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
1942 concatpath.c, config.charset, copy-file.c, copy-file.h,
1943 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
1944 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
1945 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
1946 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
1947 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
1948 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
1949 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
1950 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
1951 full-read.c, full-read.h, full-write.c, full-write.h,
1952 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
1953 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
1954 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
1955 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
1956 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
1957 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
1958 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
1959 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
1960 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
1961 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
1962 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
1963 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
1964 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
1965 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
1966 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
1967 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
1968 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
1969 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
1970 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
1971 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
1972 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
1973 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
1974 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
1975 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
1976 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
1977 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
1978 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
1979 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
1980 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
1981 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
1982 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
1983 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
1984 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
1985 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
1986 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
1987 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
1988 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
1989 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
1990 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
1991 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
1992 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
1993 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
1994 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
1995 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
1996 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
1997 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
1998 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
1999 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
2000 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
2001 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
2002 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
2003 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
2004 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
2005 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
2006 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
2007 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
2008 Update FSF postal mail address.
2010 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2012 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
2013 specified in ai_socktype. Fix invalid ai_protocol
2014 check. ai_protocol is usually set to 0 or depending on
2015 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
2016 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
2017 ai_socktype / ai_protocol in the returned addrinfo structure.
2019 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2020 Bruno Haible <bruno@clisp.org>
2022 * inet_ntop.h: New file.
2023 * inet_ntop.c: New file, from glibc with modifications.
2025 2005-05-08 Jim Meyering <jim@meyering.net>
2027 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
2029 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
2031 Merge from coreutils. Among other things,
2032 add bulletproofing for cases where stdin, stdout, or stderr are closed.
2033 * fd-safer.c: New file.
2034 * fcntl-safer.h, open-safer.c: Remove.
2035 * chdir-long.c: Fix comment "fetish" -> "coreutils".
2036 * dup-safer.c: Include unistd-safer.h first.
2037 Don't include errno.h.
2038 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
2039 * file-type.h: Don't assume invoker included sys/stat.h first.
2040 * file-type.c: Rely on file-type.h change.
2041 * getloadavg.c: Include unistd-safer.h.
2042 (getloadavg): Use safer open.
2043 * getusershell.c: Include "stdio-safer.h".
2044 (getusershell): Use safer fopen.
2045 * long-options.c (long_options): Use NULL rather than 0.
2046 * modechange.h (mode_free): Remove; all callers changed to invoke
2048 * modechange.c: Likewise.
2049 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
2050 (MODE_DONE): New constant.
2051 (struct mode_change): Remove 'next' member.
2052 (make_node_op_equals): New function; like the old one of the
2053 same name, except it allocates an array.
2054 (mode_compile, mode_create_from_ref): Use it.
2055 (mode_compile): Allocate result as an array, not a linked list.
2056 Parse octal string ourself, so that we catch mistakes like "+0".
2057 (mode_adjust): Arg is an array, not a linked list.
2058 * modechange.c: Include stat-macros.h, xalloc.h.
2059 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
2060 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
2061 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
2062 Remove. This is now stat-macros.h's job.
2063 (talloc): Remove. All callers replaced by xalloc, so that
2064 our invokers don't have to worry about reporting memory failures.
2065 (make_node_op_equals): Remove.
2066 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2068 (struct mode_change): Moved here from modechange.h.
2069 (mode_append_entry): Remove.
2070 (mode_compile): Remove MASKED_OPS arg, since it encouraged
2071 apps to have incorrect behavior. Use simpler algorithm for head
2072 and tail. Don't futz with umask; that's now the job of mode_adjust.
2073 Detect more invalid usages rather than having somewhat-random behavior.
2074 Don't insert an "a=" action, as that leads to incorrect behavior.
2075 (mode_compile, mode_create_from_ref): Return NULL on error instead
2076 of an enum, since now there's only one way to have an error. All
2078 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
2079 at the correct time. Simplify calculation of "+u" and its ilk.
2080 Don't mishandle "+X".
2081 (mode_free): Remove "register" and localize decls.
2082 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2083 (struct mode_change): Move to modechange.c; callers don't
2084 need to see this stuff.
2085 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
2086 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
2087 (mode_change, mode_adjust): Reflect the new signatures noted above.
2088 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
2089 that might redefine system include files.
2090 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
2091 (my_usleep): Use NULL rather than (void *) 0.
2092 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
2093 Use siginterrupt to specify that system calls should be interrupted.
2094 (rpl_nanosleep): Move initialization of suspended closer to call of
2096 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
2097 * readutmp.c: Likewise. Include signal.h, stdbool.h.
2098 (desirable_utmp_entry): New function.
2099 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
2100 using x2nrealloc, to simplify logic.
2101 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
2102 size calculation. Do not assume utmp file is a regular file.
2103 * readutmp.h (UT_PID): Moved here from ../src/who.c.
2104 (READ_UTMP_CHECK_PIDS): New constant.
2105 * save-cwd.c: Include unistd-safer.h.
2106 (save_cwd): Use fd_safer.
2107 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
2108 [!_LIBC] Include "stat-macros.h" instead.
2109 * unistd-safer.h (fd_safer): New decl.
2111 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
2113 * byteswap_.h: New file.
2115 2005-04-25 Albert Chin <china@thewrittenword.com>
2117 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
2120 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
2122 * getdate.y (zone): Allow relunit_snumber after tZONE, so
2123 that "UTC +1 second" continues to work. Problem reported
2125 (relunit_snumber): New rule.
2128 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
2130 * getdate.y (universal_time_zone_table): New constant.
2131 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
2132 universal_time_zone_table.
2133 (lookup_zone): Prefer universal_time_zone_table to
2134 local_time_zone_table, so that "GMT" time stamps are allowed in
2135 London during the summer. Problem reported by Ian Abbott.
2137 2005-04-12 Jim Meyering <jim@meyering.net>
2139 * human.c (humblock): Set *options even when returning due to
2140 xstrtoumax conversion failure. Thanks to a used-uninitialized
2143 2005-04-09 Jim Meyering <jim@meyering.net>
2145 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
2146 -Wuninitialized: initialize tm0.tm_year.
2148 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
2150 * getdate.y (parser_control): rels_seen is now a boolean, not a
2151 count, since there's no maximum. All uses changed.
2152 Add member dsts_seen.
2153 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
2155 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
2156 Use pc_rels_seen to decide whther a date is absolute.
2158 * getdate.y (number): Don't overwrite year.
2159 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
2162 2005-04-02 Simon Josefsson <jas@extundo.com>
2164 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
2165 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
2167 2005-03-27 Jim Meyering <jim@meyering.net>
2169 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
2171 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
2173 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
2174 "one's complement" -> "ones' complement" in comment, as per Knuth.
2175 "value of type" -> "type or expression" in comment.
2176 * mktime.c, strftime.c: Propagate intprops.h comment nits.
2178 2005-03-26 Jim Meyering <jim@meyering.net>
2181 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
2182 Correct typos: s/or/of/.
2184 2005-03-23 Jim Meyering <jim@meyering.net>
2186 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
2188 2005-03-21 Jim Meyering <jim@meyering.net>
2190 Changes imported from coreutils.
2192 * cycle-check.c: Don't include xalloc.h.
2194 * path-concat.c: Don't include assert.h.
2195 (path_concat): Remove assertion that would have triggered
2196 for ABASE starting with more than one slash.
2197 Reported by Andreas Schwab.
2199 * path-concat.c (path_concat): Set *BASE_IN_RESULT
2200 properly when ABASE is an absolute file name.
2201 Correct the description of this function.
2203 Add an assertion and a test driver.
2204 This fixes a bug introduced on 2004-07-02.
2205 Andreas Schwab reported the resulting failure of cp --parents:
2206 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
2208 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
2210 * strftime.c (my_strftime): If the underlying strftime returns 0
2211 (which shouldn't happen), generate nothing instead of returning 0
2212 immediately, so that nstrftime (NULL, ...) doesn't return 0.
2214 2005-03-16 Bruno Haible <bruno@clisp.org>
2216 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
2218 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
2220 * strftime.c (my_strftime): Prepend space to format so that we can
2221 reliably distinguish strftime failure from empty output on POSIX
2224 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
2226 * iconvme.c (SIZE_MAX): New macro, if not already defined.
2227 (iconv_string): Don't guess a size-zero buffer, as that might cause
2228 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
2229 result would be 'too large', where 'too large' is (heuristically)
2230 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
2231 overflow concerns. This will prevent some unwanted malloc failures
2232 when the inputs are very large.
2234 2005-03-15 Bruno Haible <bruno@clisp.org>
2236 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
2239 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
2242 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
2244 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
2246 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
2247 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
2249 * strtol.c: Likewise.
2251 2005-03-14 Simon Josefsson <jas@extundo.com>
2253 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
2256 2005-03-14 Jim Meyering <jim@meyering.net>
2258 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
2259 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
2260 to be nonzero so that we (and caller) can detect the difference
2261 between a valid zero-length expansion and an error return, even
2262 when the underlying strftime fails before writing anything into
2265 2005-03-10 Jim Meyering <jim@meyering.net>
2267 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
2268 so that this module works on systems without fchdir.
2270 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
2272 Factor int-properties macros into a single file, except for
2273 glibc-related files.
2274 * intprops.h: New file.
2275 * getloadavg.c: Include it instead of limits.h.
2276 (INT_STRLEN_BOUND): Remove.
2277 * human.c: Include intprops.h.
2278 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2279 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2280 * inttostr.h: Include intprops.h instead of limits.h.
2281 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2282 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2283 for consistency with intprops.h.
2284 (time_t_is_integer, twos_complement_arithmetic): Use them.
2285 * sig2str.h: Include <signal.h>, intprops.h.
2286 (INT_STRLEN_BOUND): Remove.
2287 * strftime.c (TYPE_SIGNED): Remove.
2288 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2289 * strtol.c: Adjust comments to match intprops.h.
2290 * userspec.c: Include intprops.h.
2291 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2292 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2293 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2294 instead of rolling our own expressions.
2295 * xstrtol.c: Include xstrtol.h first, to test interface.
2297 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
2299 (my_strftime): Do not mishandle years close to INT_MAX, by doing
2300 the right thing even if adding 1900 would overflow. Similarly
2301 for tm_mon + 1 and tm_yday + 1.
2302 Make %Y always equivalent to %C%y, and similarly for %G and %g.
2303 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2304 (DO_SIGNED_NUMBER): New macro.
2305 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2307 2005-03-07 Bruno Haible <bruno@clisp.org>
2309 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
2311 2005-03-03 Derek R. Price <derek@ximbiot.com>
2312 Bruno Haible <bruno@clisp.org>
2314 * pagealign_alloc.h: New file.
2315 * pagealign_alloc.c: New file.
2317 2005-01-28 Bruno Haible <bruno@clisp.org>
2319 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
2322 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
2324 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2325 The workaround isn't strictly needed for POSIX conformance, and
2326 it's too much of a pain to configure and maintain. We'll ask
2327 people to fix their kernels instead.
2328 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2329 (NANOSLEEP_BUG_WORKAROUND): Remove.
2330 (xnanosleep): Remove the workaround.
2332 2005-02-12 Bruno Haible <bruno@clisp.org>
2334 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
2336 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
2338 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2339 * timespec.h (gettime): Return void, since it always
2340 succeeds now. All uses changed.
2341 * gettime.c (gettime) Likewise.
2342 [HAVE_NANOTIME]: Prefer nanotime.
2343 Assume gettimeofday succeeds, as POSIX requires.
2344 Assime time () succeeds, since other code already does.
2345 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2346 (timespec_subtract): Remove.
2347 (NANOSLEEP_BUG_WORKAROUND): New constant.
2348 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2349 things considerably. Use it only on GNU/Linux hosts, since the
2350 workaround shouldn't be needed elsewhere.
2352 2005-02-24 Bruno Haible <bruno@clisp.org>
2354 * gettext.h: Update from GNU gettext 0.14.2.
2356 2005-02-24 Bruno Haible <bruno@clisp.org>
2358 * localcharset.c: Update from GNU gettext 0.14.2.
2359 * config.charset: Update from GNU gettext 0.14.2.
2361 2005-02-22 Simon Josefsson <jas@extundo.com>
2363 * iconvme.h, iconvme.c: New files, from libc.
2365 2005-02-20 Neil Conway <neilc@samurai.com>
2367 * xgethostname.c (xgethostname): Check for ENOMEM, which is
2368 returned by OSX/Darwin if the specified buffer is not large
2369 enough for the hostname.
2371 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
2373 * memrchr.h: New file.
2374 * chdir-long.c: Include it.
2375 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
2376 Don't bother including stddef.h.
2378 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2380 * argp-help.c (__argp_help): Create a fake struct argp_state and
2381 pass it to _help, otherwise the latter coredumps trying to
2382 dereference state.root_argp.
2384 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
2386 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2388 Include <sys/types.h>, for dev_t.
2389 (ME_DUMMY, ME_REMOTE): Move from here....
2390 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2391 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
2393 Include mountlist.h first, to test the interface.
2395 2005-01-29 Bruno Haible <bruno@clisp.org>
2397 * progname.c (program_name): Initialize.
2398 Needed when linking statically on MacOS X.
2400 2005-01-28 Bruno Haible <bruno@clisp.org>
2402 * javacomp.sh.in: New file, from GNU gettext.
2403 * javacomp.h: New file, from GNU gettext.
2404 * javacomp.c: New file, from GNU gettext.
2406 2005-01-26 Bruno Haible <bruno@clisp.org>
2408 * javaexec.sh.in: New file, from GNU gettext.
2409 * javaexec.h: New file, from GNU gettext.
2410 * javaexec.c: New file, from GNU gettext.
2412 2005-01-26 Simon Josefsson <jas@extundo.com>
2414 * gai_strerror.c: Use GPL in header.
2416 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2418 * argp-help.c (hol_entry_help): Avoid using non-constant
2419 initializers for struct pentry_state.
2420 (__argp_error): Check return value of __asprintf
2421 (__argp_failure): Translate error message
2423 * argp-parse.c: Removed braces around the expansion of N_()
2425 2005-01-21 Jim Meyering <jim@meyering.net>
2427 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2428 same value as for Solaris 9.
2430 * chdir-long.c (chdir_long): Rewrite to remove limitation on
2431 component length. This included changing the parameter to be
2432 of type `char *' rather than `char const *'.
2433 * chdir-long.h (chdir_long): Update prototype.
2435 * openat.c (fdopendir, fstatat): New functions.
2436 * openat.h: Include headers required for use of DIR and struct stat.
2437 [AT_SYMLINK_NOFOLLOW]: Define.
2438 (fdopendir, fstatat): Add prototypes.
2440 2005-01-21 Bruno Haible <bruno@clisp.org>
2442 * classpath.h: New file, from GNU gettext.
2443 * classpath.c: New file, from GNU gettext.
2445 2005-01-20 Simon Josefsson <jas@extundo.com>
2447 * version-etc-fsf.c: New file, with version_etc_copyright.
2448 * version-etc.c: Remove version_etc_copyright.
2449 * version-etc.h (version_etc_copyright): Use [] instead of * in
2450 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
2452 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
2454 * save-cwd.c (save_cwd): Remove code to support the case
2455 where fchdir is missing or flaky.
2457 2005-01-20 Simon Josefsson <jas@extundo.com>
2459 * base64.h (isbase64): Add.
2461 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
2462 using a unsigned prototype, don't inline.
2463 (base64_decode): Use it.
2465 2005-01-19 Bruno Haible <bruno@clisp.org>
2467 * sh-quote.h: New file, from GNU gettext.
2468 * sh-quote.c: New file, from GNU gettext.
2470 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
2472 Merge changes from coreutils, as described below in several
2473 changelogs dated today.
2475 * save-cwd.c: Include "save-cwd.h" before other include files.
2476 (O_DIRECTORY): Remove; not needed here, since "." must be
2477 a directory. All uses removed.
2478 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
2479 universal on Suns, and we also need to test for IRIX.
2480 Revamp code to use 'if' rather than '#if'.
2481 Avoid unnecessary comparison of cwd->desc to 0.
2483 * utimens.c (futimens): Robustify the previous patch, by checking
2484 for known valid error numbers rather than observed invalid ones.
2486 2005-01-18 Jim Meyering <jim@meyering.net>
2488 * version-etc.c (version_etc_copyright): Update copyright date.
2490 * utimens.c (futimens): Account for the fact that futimes
2491 can also fail with errno == ENOSYS or errno == ENOENT.
2492 Patch from Dmitry V. Levin.
2494 Change the name of the robust chdir function from chdir to chdir_long.
2495 * save-cwd.c: Include chdir-long.h rather than chdir.h.
2496 (restore_cwd): Use chdir_long, not chdir.
2497 * chdir-long.c: Renamed from chdir.c.
2498 * chdir-long.h: Renamed from chdir.h.
2499 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
2502 2005-01-18 Bob Proulx <bob@proulx.com>
2504 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
2505 offsetof() macro construct to avoid compile failure with native HP-UX
2506 11.0 ANSI C compiler.
2508 2005-01-06 Bruno Haible <bruno@clisp.org>
2510 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
2511 because stpncpy.m4 takes care of it.
2513 2004-01-24 Bruno Haible <bruno@clisp.org>
2515 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
2517 2003-10-09 Bruno Haible <bruno@clisp.org>
2519 * progreloc.c: Include xalloc.h instead of xmalloc.h.
2521 2005-01-06 Bruno Haible <bruno@clisp.org>
2523 * fwriteerror.h (fwriteerror): Change specification to include fclose.
2524 * fwriteerror.c: Include <stdbool.h>.
2525 (fwriteerror): At the end, close the file stream. Record whether
2526 stdout was already closed.
2528 2004-05-27 Bruno Haible <bruno@clisp.org>
2530 * execute.c (environ): Declare if needed.
2531 * pipe.c (environ): Likewise.
2532 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
2534 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
2536 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
2537 definitions to be after all include files, to avoid collisions.
2538 Problem reported by Bob Proulx.
2540 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
2542 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
2543 not needed. This removes a dependency on the gettext module.
2544 [defined _LIBC]: Do not include <libintl.h>; not needed.
2546 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
2548 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
2551 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
2553 * argp-parse.c: Include <stddef.h>.
2554 (alignof, alignto): New macros.
2555 (parser_init): Don't assume that void * is aligned sufficiently
2558 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
2559 need to extend the stack.
2560 (YYINITDEPTH): New macro, so that the initial stack isn't overly
2563 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2565 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
2567 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
2569 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
2570 Remove now-obsolete comment about AIX.
2571 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
2572 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
2573 (YYMAXDEPTH): New macro.
2575 2004-12-18 Bruno Haible <bruno@clisp.org>
2577 * fatal-signal.c (fatal_signals): Make non-const.
2578 (init_fatal_signals): New function.
2579 (uninstall_handlers, install_handlers): Ignore signals that were set to
2581 (at_fatal_signal): Call init_fatal_signals.
2582 (init_fatal_signal_set): Likewise. Ignore signals that were set to
2584 Reported by Paul Eggert.
2586 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2588 * getdate.y (textint): New member "negative".
2589 (time_zone_hhmm): New function.
2590 Expect 14 shift-reduce conflicts, not 13.
2591 (o_colon_minutes): New rule.
2592 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
2593 (yylex): Set the "negative" member of signed numbers.
2595 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
2597 Changes imported from coreutils.
2598 * hard-locale.c: Assume <locale.h> exists.
2600 (GLIBC_VERSION): New macro.
2601 (hard_locale): Assume setlocale exists.
2602 Rewrite to avoid #ifdef.
2603 Use strdup rather than malloc + strcpy.
2604 * human.c: Assume <locale.h> exists.
2605 (human_readable): Assume localeconv exists.
2607 2004-12-01 Jakub Jelinek <jakub@redhat.com>
2609 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
2610 convert T2, not T. (Imported from libc.)
2612 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
2614 * getcwd.c (is_ENAMETOOLONG): New macro.
2615 (__getcwd.c): Don't restore errno; glibc doesn't.
2616 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
2617 first, falling back to our code only if its results look suspicious.
2618 Ensure that the resulting buffer is only as large as necessary.
2620 * readutmp.c: Include readutmp.h first.
2621 Include <errno.h>, since readutmp.h no longer does that.
2622 * readutmp.h: Don't include <errno.h>,
2623 <sys/param.h>, <time.h>; not needed to establish interface.
2624 (errno): Remove decl.
2625 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
2626 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
2627 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
2629 2004-11-28 Simon Josefsson <jas@extundo.com>
2631 * base64.h, base64.c: New file.
2633 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
2635 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
2637 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
2639 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
2640 HP's ANSI C compiler.
2641 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
2642 Declaring int functions causes warnings on some modern systems and
2643 shouldn't be needed to compile on ancient ones.
2644 * same.c (MIN) [defined MIN]: Don't define, since it's already
2647 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
2648 with the following changes.
2649 (__set_errno): Parenthesize properly.
2650 Include <stdbool.h>.
2651 (MIN, MAX, MATCHING_INO): New macros.
2652 (__getcwd): Define with prototype, not K&R form.
2653 Use heuristics to allocate default buffer on stack if possible.
2654 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
2655 behavior, and to avoid the PATH_MAX limit when computing
2657 Use MATCHING_INO to compare inode number to file.
2658 Check for arithmetic overflow in size calculations.
2659 Fix bug in reallocation of dot array that caused getcwd to fail
2660 on directories nested deeper than 75.
2661 Be more careful about saving errno on error.
2662 Do not use realloc; use only free+malloc, as this is a bit
2663 more flexible and avoids a needless copy operation.
2664 Do not inspect st_dev and st_ino for symbolic links; POSIX
2665 doesn't specify the latter.
2666 Check for closedir errors.
2667 Avoid needless casts.
2668 Use "#ifdef weak_alias" around weak_alias, to be like other
2670 The following changes to getcwd.c have effect only when used in
2671 gnulib; they have no effect inside glibc proper.
2672 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
2673 as alloca isn't used.
2674 (alloca, __alloca): Likewise.
2675 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
2676 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2677 unconditionally, as gnulib assumes C89 or better.
2678 Do not include <sys/param.h>.
2679 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
2680 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
2682 (NULL) [!defined NULL]: Remove; we assume C89 or better.
2683 Include <dirent.h> in a way that is compatible with modern Autoconf.
2684 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
2685 New macros, if not already defined.
2686 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
2687 Use "_LIBC", not "defined _LIBC", for consistency.
2688 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
2690 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
2691 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
2692 * xgetcwd.c: David MacKenzie's old code was removed, so give
2693 credit only to Jim Meyering and adjust the copyright dates.
2694 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
2695 <stdlib.h>, <unistd.h>, "pathmax.h".
2696 Instead, include "xgetcwd.h" (first) and "getcwd.h".
2697 (INITIAL_BUFFER_SIZE): Remove.
2698 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
2700 2004-11-23 Jim Meyering <jim@meyering.net>
2702 * getopt_.h: Remove trailing blanks.
2704 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
2706 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
2707 (futimens): New function, which uses futimes if available.
2708 (futimens, utimens): Support timespec==NULL, with same semantics
2709 as utime and utimens.
2710 * utimens.h (futimens): New decl.
2712 2004-11-23 Jim Meyering <jim@meyering.net>
2714 * __fpending.c: Add comment.
2716 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2718 * getopt_.h: Re-addition of __getopt_argv_const caused
2719 redefinition warnings. To avoid them, include the defines
2720 in `#if !defined __need_getopt ... #endif'. The only place
2721 where __getopt_argv_const is used is in definitions
2722 of getopt_long and getopt_long_only below, which are as well
2723 protected by `#ifndef __need_getopt'.
2724 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
2725 __need_getopt after including <stdio.h> and <unistd.h> These
2726 headers might have defined it.
2728 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
2730 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
2732 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
2733 optopt): Use them instead of invoking ## directly; otherwise, the
2734 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
2736 2004-11-19 Bruno Haible <bruno@clisp.org>
2738 * strtok_r.c: Move comments from here...
2739 * strtok_r.h: ... to here.
2741 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
2743 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
2744 might fail. Problem reported by Yoann Vandoorselaere.
2745 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
2746 that mishandle size_t overflow.
2748 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
2750 * canon-host.c: Include "strdup.h".
2751 (canon_host): Use getaddrinfo if available, so that IPv6 works.
2752 Use strdup instead of malloc/strcpy to duplicate strings.
2754 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
2755 (human_space_before_unit): New constant.
2756 * human.c (human_readable): Support it.
2758 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
2759 (xgetcwd): Set errno correctly when failing.
2760 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
2761 the failure is actually due to a PATH_MAX problem.
2763 Further getopt changes to make it more likely that glibc will
2764 buy the changes back.
2765 * getopt.c (POSIXLY_CORRECT): New constant.
2766 (getopt): Use it, so to preserve glibc semantic
2767 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
2768 when compiling for libc.
2769 * getopt_.h (__getopt_argv_const): Bring it back.
2770 (getopt_long, getopt_long_only): Use it.
2772 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
2773 New arg POSIXLY_CORRECT. All callers changed.
2774 (getopt): Argv is now char * const *, as per standard.
2775 (_getopt_internal_r, _getopt_internal): Argv is now char **,
2776 not char *__getopt_argv_const *.
2777 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2778 _getopt_long_only_r): Likewise.
2779 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
2780 * getopt_int.h (_getopt_internal, _getopt_internal_r,
2781 _getopt_long_r, _getopt_long_only_r): Likewise.
2782 * getopt_.h (__getopt_argv_const): Remove.
2783 (getopt): Argv is now char * const *, as per standard.
2785 * getdate.y (tORDINAL): New token.
2786 (day, relunit): Allow it for relative times.
2787 (relative_time_table): Use tORDINAL for ordinals.
2789 2004-11-15 Jim Meyering <jim@meyering.net>
2791 * closeout.c: Include "__fpending.h" once again.
2792 Include <stdbool.h>.
2793 (close_stdout): Don't fail just because stdout was closed initially,
2794 since some programs don't write to stdout in the normal course of
2795 operation (other than --version and --help), and we don't want this
2796 function to make e.g. `touch file >&-' fail.
2797 But do fail if it was closed and someone has tried to write to it.
2798 E.g., `printf foo >&-' must fail.
2800 2004-11-11 Simon Josefsson <jas@extundo.com>
2802 * strtok_r.h, strtok_r.c: New file.
2804 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
2806 * getopt_.h (__getopt_argv_const): New macro, to be used so that
2807 we can stop lying to compilers about the constness of argv when we
2808 are compiled outside glibc.
2809 (getopt, getopt_long, getopt_long_only): Use it.
2810 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
2812 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2813 _getopt_long_only_r): Likewise.
2814 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
2815 _getopt_long_only_r): Likewise.
2817 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
2818 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
2819 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
2820 the other external symbols.
2821 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
2822 declaration, since the above renaming now works around collisions.
2824 2004-11-11 Jim Meyering <jim@meyering.net>
2826 * linebreak.c: Remove trailing blanks.
2827 * alloca_.h: Likewise.
2828 * acosl.c: Likewise.
2829 * euidaccess.c: Likewise.
2830 * allocsa.h: Likewise.
2832 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
2834 * mktime.c (SHR): New macro, which is a portable
2835 substitute for >> that should work even on Crays.
2836 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
2837 Problem reported by Mark D. Baushke in
2838 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
2839 * getdate.y (SHR): Likewise.
2841 * strftime.c (SHR): Likewise.
2843 * quotearg.c (struct quoting_options): Use unsigned int for
2844 quote_these_too, so that right shifts are well defined. All uses
2847 2004-11-10 Simon Josefsson <jas@extundo.com>
2849 * getaddrinfo.h, getaddrinfo.c: New files.
2851 2004-11-10 Jim Meyering <jim@meyering.net>
2853 Ensure that no close failure goes unreported.
2854 * closeout.c (close_stdout): Always close stdout. I.e., don't
2855 return early when it seems there's nothing to flush.
2856 Don't include __fpending.h.
2858 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
2860 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
2862 2004-11-05 Bruno Haible <bruno@clisp.org>
2864 * readlink.c: Include stddef.h, needed for size_t on Woe32.
2865 Reported by Mark D. Baushke <mdb@cvshome.org>.
2867 2004-11-04 Bruno Haible <bruno@clisp.org>
2869 2004-09-11 Bruno Haible <bruno@clisp.org>
2870 * allocsa.valgrind: New file.
2871 2004-02-06 Bruno Haible <bruno@clisp.org>
2872 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
2873 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
2874 Reported by Christopher Seip <chris.seip@hp.com>.
2876 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
2878 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
2879 with errno == ERANGE if the buffer is too small.
2880 Problem reported by Mark D. Baushke.
2882 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
2884 * xreadlink.c (MAXSIZE): New macro.
2885 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
2886 size does not exceed MAXSIZE. Avoid cast.
2887 As suggested by Mark D. Baushke in
2888 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
2889 if readlink fails with buffer size just under MAXSIZE, try again
2892 2004-11-02 Derek R. Price <derek@ximbiot.com>
2893 and Paul Eggert <eggert@cs.ucla.edu>
2895 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
2896 (get_date): Overparenthesize to avoid GCC warning.
2898 2004-11-02 Bruno Haible <bruno@clisp.org>
2900 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
2901 function returns void.
2903 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
2905 * getpass.c (fflush_unlocked, flockfile, funlockfile)
2906 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
2909 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
2911 * getdate.y: Add support for TZ="foo" within a date string.
2912 Fix some bugs near time_t boundaries. Reject dates with
2913 out-of-range components, e.g., "Sept 31".
2914 Include <stdlib.h>, "setenv.h", "xalloc.h".
2915 (ISDIGIT_LOCALE): Remove; unused.
2916 Note that the TZ and time functions used here are not reentrant.
2917 (mktime_ok, get_tz): New functions.
2918 (TZBUFSIZE): New constant.
2919 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
2920 This requires that we sometimes generate our own TZ="XXX..." setting.
2922 2004-10-27 Derek R. Price <derek@ximbiot.com>
2924 * mktime.c (not_equal_tm): Remove redundant check.
2926 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
2928 * getdate.y: Use Bison 1.875 features, and some minor
2929 code cleanups. This change does not affect semantics.
2930 Don't include <stdlib.h>; no longer needed.
2931 Don't include unlocked-io.h; only the "#if TEST" code uses
2932 stdio, and performance isn't crucial there.
2933 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
2934 Bison 1.875 features as described below.
2935 All uses of "PC." replaced by "pc->".
2936 (YYSTYPE): Add a forward declaration.
2937 (yylex, yyerror): Use full prototypes in forward decls.
2938 Use "%pure-parser" rather than obsolescent "%pure_parser".
2939 Use %parse-param and %lex-param instead of obsolescent
2940 YYPARSE_PARAM and YYLEX_PARAM.
2941 (meridian_table, month_and_day_table, time_units_table,
2942 relative_time_table, time_zone_table, military_table,
2943 lookup_zone, lookup_word, get_date):
2944 Use NULL instead of 0 where appropriate.
2945 (to_hour): Avoid abort (), to avoid a dependency on
2947 (yyerror, yylex): Now accepts parser_control * arg.
2948 (main) [TEST]: Use '\0' rather than 0 for char.
2950 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
2952 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
2953 It's now the caller's responsibility to handle the case where
2954 !HAVE_GETPAGESIZE && !defined getpagesize.
2956 * mktime.c (leapyear): Arg is long int, not int.
2958 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
2960 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
2962 2004-10-12 Simon Josefsson <jas@extundo.com>
2964 * getpass.c (fflush_unlocked, flockfile, funlockfile)
2965 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
2968 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
2970 * vsnprintf.h: New file.
2971 * vsnprintf.c: New file.
2973 2004-10-07 Bruno Haible <bruno@clisp.org>
2975 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
2976 into the provided buffer.
2978 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
2980 * diacrit.c, diacrit.h: Add GPL notice.
2982 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
2983 * atanl.c (atanl): Keep the code as similar to glibc as possible.
2984 * logl.c (logl): Keep the code as similar to glibc as possible.
2985 This avoids a potential constant-folding bug.
2987 2004-10-05 Bruno Haible <bruno@clisp.org>
2989 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
2991 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2993 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
2994 * xmalloc.c (xmemdup): Likewise.
2995 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
2996 XFREE): Remove these long-obsolescent macros.
2997 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
2998 * xstrdup.c: Remove.
3000 * regex.c (re_comp): Cast gettext return value to char *,
3001 Problem reported by Martin Neitzel via Mark D. Baushke.
3003 2004-10-04 Simon Josefsson <jas@extundo.com>
3005 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
3006 '#ifdef USE_UNLOCKED_IO'.
3008 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
3010 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
3011 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
3012 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
3013 regex.c, sha1.c, version-etc.c, yesno.c:
3014 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
3015 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
3016 the includer's responsibility.
3018 Sync from coreutils.
3020 * modechange.c (mode_compile): Don't decrement a pointer that
3021 points to the start of a string, as the C Standard says the
3022 resulting behavior is undefined.
3024 * backupfile.h (enum backuptype): Rename none -> no_backups,
3025 simple -> simple_backups, numbered_existing ->
3026 numbered_existing_backups, numbered -> numbered_backups
3027 to avoid shadowing problems. All uses changed.
3028 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
3029 * backupfile.c (check_extension, numbered_backup):
3030 Rename locals to avoid shadowing 'basename'.
3031 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
3034 * .cppi-disable: Add getopt_.h, getopt_int.h.
3035 * .cvsignore: Add getopt.h.
3037 2004-10-04 Simon Josefsson <jas@extundo.com>
3039 * memmem.h: New file.
3040 * memmem.c: New file, taken from glibc.
3042 2004-10-02 Jim Meyering <jim@meyering.net>
3044 * dirfd.h, getpagesize.h: Add copyright notice.
3046 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
3048 * snprintf.c: Remove comments as to why each header is needed.
3050 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
3052 * strsep.h: New file.
3053 * strsep.c: New file.
3055 2004-10-01 Simon Josefsson <jas@extundo.com>
3057 * snprintf.c (snprintf): Handle size==0.
3059 2004-10-01 Simon Josefsson <jas@extundo.com>
3060 Bruno Haible <bruno@clisp.org>
3062 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
3063 (snprintf): Declare 'args'.
3065 2004-09-30 Simon Josefsson <jas@extundo.com>
3067 * snprintf.h, snprintf.c: New files.
3069 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3071 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
3072 (hol_entry_help): Never translate an empty string.
3073 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
3074 * argp.h (OPTION_NO_TRANS): New option.
3076 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
3078 * xvasprintf.c: Include xalloc.h.
3079 (xvasprintf): Use xalloc_die, not xmalloc_die.
3081 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
3083 * dummy.c: Change copyright notice to FSF, and license to GPL.
3085 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
3087 * argp-pvh.c (argp_program_version_hook): Provide initial value.
3088 Problem reported by Bruno Haible in:
3089 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
3091 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
3093 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
3094 in case some system header has #define'd it. Problem reported by
3095 Soeren D. Schulze in
3096 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
3098 2004-09-08 Bruno Haible <bruno@clisp.org>
3100 * stdint_.h: New file, taken from GNU clisp.
3102 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
3104 * xvasprintf.h: New file.
3105 * xvasprintf.c: New file.
3106 * xasprintf.c: New file.
3108 2004-09-08 Bruno Haible <bruno@clisp.org>
3110 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
3112 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
3114 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
3116 Import from coreutils.
3117 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
3118 strings on unbounded length. alloca's performance benefits aren't
3119 that important here.
3121 (parse_with_separator): New function, with most of the internals
3122 of the old parse_user_spec. Allow user to omit both user and group,
3123 for compatibility with FreeBSD.
3124 Clone only the user name, not the entire spec.
3125 Do not set *uid, *gid unless entirely successful.
3126 Avoid memory leak in some failing cases.
3127 Fix regression for USER.GROUP reported by Dmitry V. Levin in
3128 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
3129 (parse_user_spec): Rewrite to use parse_with_separator.
3131 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
3133 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
3134 its complicated substitute.
3135 * argp-help.c: Include <errno.h>, for program_invocation_short_name
3136 and program_invocation_name.
3137 (__argp_basename) [!_LIBC]: Remove; the only use was
3138 replaced by its body.
3139 (__argp_short_program_name): Change condition from
3140 !defined __argp_short_program_name to
3141 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
3142 to match argp-namefrob.h.
3143 (__argp_failure): Don't assume strerror_r returns char *.
3144 * argp-parse.c (N_): Define unconditionally.
3145 (argp_default_options): Fill out initializers with 0 to avoid
3148 2004-08-12 Simon Josefsson <jas@extundo.com>
3150 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
3151 * getopt_.h: Renamed from getopt.h.
3153 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
3155 Merge from coreutils.
3157 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
3158 wmemchr or wmemcpy. Problem reported by Robert Dahlem
3159 for Reliant Unix 5.43.
3161 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
3162 (union fooround): Use uintmax_t, not long int.
3163 The rest is a merge from libc:
3164 [defined _LIBC]: Include <shlib-compat.h>.
3165 (_obstack) [defined _LIBC]: Remove after 2.3.4.
3167 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
3169 * strverscmp.c: Convert to UTF-8.
3171 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
3173 * obstack.h (obstack_empty_p):
3174 Don't assume that chunk->contents is suitably aligned.
3175 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
3176 Likewise. Problem reported by Benno in
3177 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
3179 * chown.c (rpl_chown): Work even if the file is writeable but not
3180 readable. This could be improved further but it'd take some work.
3182 2004-08-08 Simon Josefsson <jas@extundo.com>
3184 * xgethostname.c: Don't include error.h (not used).
3187 * getpass.c: Include getpass.h first.
3189 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
3191 * xalloc-die.c: New files.
3192 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
3194 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
3195 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
3196 (_, N_, xalloc_die): Move to xalloc-die.c.
3197 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
3198 so that we needn't mess with xalloc_msg_memory_exhausted.
3200 * sha1.h: Renamed from sha.h.
3201 (SHA1_H): Renamed from _SHA_H.
3202 (sha1_ctx): Renamed from sha_ctx.
3203 (sha1_init_ctx): Renamed from sha_init_ctx.
3204 (sha1_process_block): Renamed from sha_process_block.
3205 (sha1_process_bytes): Renamed from sha_process_bytes.
3206 (sha1_finish_ctx): Renamed from sha_finish_ctx.
3207 (sha1_read_ctx): Renamed from sha_read_ctx.
3208 (sha1_stream): Renamed from sha_stream.
3209 (sha1_buffer): Renamed from sha_buffer.
3210 * sha1.c: Likewise; renamed from sha.c.
3211 Do not include <sys/types.h>.
3212 Include <stddef.h> rather than <stdlib.h>.
3214 2004-08-08 Bruno Haible <bruno@clisp.org>
3216 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
3217 FILESYSTEM_PREFIX_LEN.
3218 * progreloc.c: Likewise.
3219 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
3221 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
3224 * argp-help.c (make_hol, hol_append): Don't assume that
3225 SIZE_MAX is a valid preprocessor constant.
3226 (__argp_basename): Change from "#ifndef _LIBC"
3227 to "#ifndef __argp_short_program_name", so that
3228 we don't compile these functions for tar.
3230 More merges from coreutils.
3231 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
3232 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
3234 * addext.c: Remove; no longer needed.
3235 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
3236 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
3237 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
3238 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
3239 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
3240 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
3241 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
3242 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
3243 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
3244 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
3245 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
3246 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
3247 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
3248 Import changes from coreutils.
3250 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
3252 Merge from coreutils.
3254 * .gdb-history: Remove; this doesn't belong here.
3256 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
3257 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
3258 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
3260 * dirname.h: Include <stdbool.h>.
3261 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
3262 for consistency with POSIX terminology. All uses changed.
3263 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
3264 (strip_trailing_slashes): Use bool for booleans.
3265 * stripslash.c (strip_trailing_slashes): Likewise.
3267 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
3268 sometimes returns a positive errno value even when it succeeds.
3269 (print_errno_message) [!LIBC]: Fall back on strerror if
3272 * path-concat.c (mempcpy): Don't define if a system header defines it.
3273 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
3274 (longest_relative_suffix): New function.
3275 (path_concat): Use it. Assume first argument is not NULL.
3276 Port to DOS. Omit redundant separators.
3277 Report an error instead of returning NULL.
3278 Use mempcpy instead of memcpy.
3279 (xpath_concat): Remove: not declared or used.
3281 * same.h: Include <stdbool.h>
3282 (same_name): Return bool, not int.
3283 * same.c (same_name): Likewise.
3284 (errno): Don't declare; we assume C89 or better now.
3286 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
3287 if not already defined.
3289 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
3290 * dup-safer.c (errno): Likewise.
3292 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
3294 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
3297 2004-08-03 Simon Josefsson <jas@extundo.com>
3299 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
3300 * progname.h: Don't include stdbool.h.
3302 2004-08-02 Simon Josefsson <jas@extundo.com>
3304 * getsubopt.h: New file, with comments from Bruno Haible.
3305 * getsubopt.c: New file, from glibc, but slightly modified based on
3306 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
3308 2004-08-01 Simon Josefsson <jas@extundo.com>
3310 * xgetdomainname.c: Include stdlib.h, for free().
3312 2004-07-16 Simon Josefsson <jas@extundo.com>
3314 * dummy.c: New file.
3316 2004-07-16 Bruno Haible <bruno@clisp.org>
3318 * backupfile.h: Add extern "C" for C++.
3319 * closeout.h: Likewise.
3320 * copy-file.h: Likewise.
3321 * findprog.h: Likewise.
3322 * full-write.h: Likewise.
3323 * pathname.h: Likewise.
3324 * progname.h: Likewise.
3325 * stpcpy.h: Likewise.
3326 * stpncpy.h: Likewise.
3327 * strcase.h: Likewise.
3328 * strstr.h: Likewise.
3329 * xalloc.h: Likewise.
3331 * mbswidth.h: Add extern "C" for C++.
3332 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
3334 2004-07-09 Simon Josefsson <jas@extundo.com>
3336 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
3337 failed without this.)
3339 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
3341 * fchown-stub.c: New file.
3343 2004-06-24 Jim Meyering <jim@meyering.net>
3345 * obstack.h (obstack_base): Cast to (void *), per documentation.
3347 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
3349 * argz.c, argz_.h: New files, which are autoupdated from libtool.
3351 2004-06-01 Jim Meyering <jim@meyering.net>
3353 * calloc.c: New file.
3355 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
3357 * getdate.y (yylex): Allow space between sign and number.
3358 Problem reported by Dan Jacobson.
3360 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
3361 and Jim Meyering <jim@meyering.net>
3363 Merge from coreutils CVS.
3365 * stat-macros.h: New file, with contents from file-type.h
3366 and coreutils' system.h.
3367 * file-type.c: Include "stat-macros.h".
3368 * file-type.h (file_type): Move all macro definitions to new file,
3371 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
3372 Wrap old code with this conditional.
3373 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
3374 function that does not dereference symlinks.
3375 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
3377 * xreadlink.c: Include xreadlink.h first, to catch .h file
3378 dependency problems.
3379 (xreadlink): Accept new arg SIZE, for efficiency.
3380 All decls and uses changed.
3381 * xreadlink.h: Include <stddef.h>, for size_t.
3383 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
3384 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
3386 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
3388 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
3390 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
3391 macros to be defined.
3392 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
3393 the allocator returns NULL because the requested size is zero.
3395 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3397 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
3398 var. Add comment explaining why libc still defines it. This
3399 merges the following patch from glibc:
3400 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
3402 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
3404 * obstack.c (_obstack): Remove unused variable. It hasn't been
3405 present in glibc since revision 1.1 of this file.
3406 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
3407 obstack_alignment_mask, obstack_alloc, obstack_base,
3408 obstack_blank, obstack_blank_fast, obstack_chunk_size,
3409 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
3410 obstack_grow0, obstack_init, obstack_int_grow,
3411 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
3412 obstack_next_free, obstack_object_size, obstack_ptr_grow,
3413 obstack_ptr_grow_fast, obstack_room): Remove declarations of
3414 nonexistent functions.
3416 2004-05-17 Derek R. Price <derek@ximbiot.com>
3417 Paul Eggert <eggert@cs.ucla.edu>
3419 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
3421 2004-05-14 Bruno Haible <bruno@clisp.org>
3423 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
3424 that consists of a '.' followed by an empty digit string.
3425 Patch by Tor Lillqvist <tml@iki.fi>.
3427 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
3429 Port obstack to the AS/400, where pointers are 16 bytes wide and
3430 you cannot cast an integer to a valid pointer. This patch is
3431 currently waiting to be integrated into glibc; see
3432 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
3434 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
3435 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
3436 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
3437 (struct obstack): temp member is now a union of a pointer and
3438 an integer, instead of an integer. All integer uses changed.
3439 This does not affect the physical layout of struct obstack,
3440 except on hosts (like the AS/400) where the size or alignment of
3441 void * is greater than that of ptrdiff_t.
3442 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
3443 __STDC__)]: Store temporary in pointer member of union, not
3445 * obstack.c: Include <stddef.h>, for offsetof.
3446 (struct fooalign): Remove; it doesn't need a name.
3447 (union fooround): Change double to long double, and add void *.
3448 (DEFAULT_ALIGNMENT): Use offsetof to compute.
3449 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
3450 not a macro. Hence the values are always int; so remove all
3451 casts-to-int in uses.
3453 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
3454 Derek Price <derek@ximbiot.com>
3456 * alloca.c: Include <alloca.h>, to get our interface.
3457 * alloca_.h: Use __alloca on AIX, so that we don't have to
3458 include <alloca.h> first. Use C89 prototype for alloca; this
3459 requires including <stddef.h> for size_t. Use extern "C" if C++.
3460 Use #elif for simplicity, since we can assume C89 now.
3461 Don't try to source the system alloca.h since it will not be found
3462 and to prevent recursively including its replacement.
3463 * fnmatch.c: Include <alloca.h> instead of opencoding.
3464 * regex.c: Likewise.
3466 2004-05-16 Derek Price <derek@ximbiot.com>
3467 Paul Eggert <eggert@cs.ucla.edu>
3469 getline cleanup. This changes the getndelim2 API: both order of
3470 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
3473 * getline.c: Don't include stddef.h or stdio.h, since our
3474 interface does that.
3475 (getline): Always use getdelim, so that we don't have two
3476 copies of this code.
3477 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
3479 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
3480 (GETNDELIM2_MAXIMUM): New macro.
3481 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
3482 instead of the old practice of delim2==0. All callers changed.
3483 Return -1 on overflow, instead of returning junk.
3484 Do not set *linesize unless allocation succeeds.
3485 * getndelim2.h: Do not include stddef.h; no longer needed, now
3486 that we include sys/types.h.
3487 * getnline.h: Likewise.
3488 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
3489 (getndelim2): Reorder arguments.
3490 * getnline.c (getnline, getndelim):
3491 Don't discard the NMAX argument.
3492 (getnline): Invoke getndelim, to avoid code duplication.
3493 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
3494 of (size_t) -1 by callers of the getnline family.
3496 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3498 * nanosleep.c (suspended): Change its type from int to
3499 sig_atomic_t volatile.
3500 (first_call): Make it private to rpl_nanosleep, and have it
3501 be zero initially as that's a bit faster.
3502 (my_usleep): Round up fractional times instead of truncating them,
3503 as this is the usual meaning for 'sleep'.
3505 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3507 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3508 (ENOSYS): Define if not defined.
3509 (settime): Fall back on stime if it exists and settimeofday fails.
3510 But don't bother with fallbacks if a method fails with errno == EPERM.
3512 2004-05-11 Jim Meyering <jim@meyering.net>
3514 Prior to this change, the save_cwd caller required read access to the
3515 current directory on most systems (ones with the fchdir function).
3517 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
3518 fails, try write-only, and finally, resort to using xgetcwd.
3520 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
3522 * obstack.c, obstack.h: Import changes from libc.
3524 2004-04-28 Bruno Haible <bruno@clisp.org>
3526 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
3527 implicitly appends .exe to executables.
3528 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
3529 accepts Windows pathnames.
3530 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3531 Cygwin like Windows, since it now accepts Windows pathnames.
3532 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3533 Cygwin like Windows, since it now accepts Windows pathnames.
3534 Reported by Derek Robert Price <derek@ximbiot.com>.
3536 2004-04-20 Jim Meyering <jim@meyering.net>
3538 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
3540 2004-04-20 Jim Meyering <jim@meyering.net>
3541 Bruno Haible <bruno@clisp.org>
3543 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
3544 memory when realloc fails.
3546 2004-04-18 Jim Meyering <jim@meyering.net>
3548 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
3549 don't leak memory and do call END_UTMP_ENT.
3551 2004-04-11 Paul Eggert <eggert@twinsun.com>
3553 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
3554 (CHAR_BIT): Remove, since we assume C89.
3555 Include <stdint.h> if available, as per current Autoconf CVS advice.
3557 2004-03-30 Paul Eggert <eggert@twinsun.com>
3559 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
3560 not bool, to be more consistent with Unix conventions.
3561 Suggested by Bruno Haible.
3563 Merge from coreutils.
3565 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
3568 * getdate.h: Include stdbool.h, and timespec.h instead of
3569 the usual <time.h> dance.
3570 (get_date): Change signature to support fractional time stamps.
3571 All callers changed.
3572 * getdate.y: Include "getdate.h" first, as we can now
3573 assume C89 and don't need to worry about 'const'.
3574 Similarly, include "unlocked-io.h" near start, not in middle.
3576 (textint.value): Use long int rather than int.
3577 (textint.digits): Use size_t rather than int.
3578 (BILLION, LOG10_BILLION): New constants.
3579 (parser_control): New member rel_ns. Members day_ordinal,
3580 time_zone, month, day, hour, minutes, rel_year, rel_month,
3581 rel_day, rel_hour, rel_minutes, rel_seconds
3582 are now long int, not int. Member seconds is now struct timespec,
3583 not int. New member timespec_seen. Members dates_seen, days_seen,
3584 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
3586 (%union.intval): Now long int, not int.
3587 New member timespec.
3588 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
3589 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
3590 (spec): Now is a timespec or an item list.
3591 (timespec, items): New nonterminals.
3592 (time, rel, relunit, number, get_date):
3593 Add support for fractional seconds.
3594 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
3595 (gmtime, localtime, mktime): Remove decls; not needed with C89.
3596 (to_hour): First arg is now long int, not int.
3597 (to_year): Returns long int, not int.
3598 Don't treat year -70 like 70.
3599 (tm_diff): Returns long int, not int.
3600 (lookup_word): Use bool instead of int when appropriate.
3601 (yylex): Use size_t for count, not int.
3602 Detect overflow when parsing large integer constants.
3603 Add support for fractions.
3604 (get_date): Make pointers 'const' if possible.
3605 Use more-portable code to detect integer overflow.
3606 (main) [TEST]: Adjust to above changes. Test for localtime failure.
3607 Don't use ctime; it's not reliable if the year has >4 digits.
3609 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
3610 This is for compatibility with BSD.
3612 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
3613 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
3614 From coreutils' system.h.
3616 * userspec.c: Don't include "posixver.h".
3617 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
3618 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
3619 compatible extension. Simplify code by removing a boolean int
3620 that was always nonzero if a string was nonnull.
3622 2004-03-30 Jim Meyering <jim@meyering.net>
3624 Merge from coreutils.
3626 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
3628 * readtokens.c (readtoken): Don't leak 64 bytes when reading
3629 an empty input stream.
3631 * readtokens.c: Include <stdbool.h>.
3632 (readtoken): Use `size_t' rather than int/long.
3633 All callers adjusted.
3634 Use `bool' rather than `int' where appropriate.
3635 Use memset rather than an explicit loop.
3636 Use x2nrealloc rather than xrealloc.
3637 Allow the use of `\0' as a delimiter.
3638 (readtokens): Likewise.
3639 * readtokens.h (readtoken, readtokens): Update prototypes.
3641 2004-03-30 Bruno Haible <bruno@clisp.org>
3643 * getloadavg.c (getloadavg): Don't assume setlocale returns
3646 2004-03-29 Paul Eggert <eggert@twinsun.com>
3648 Merge changes to getloadavg.c from coreutils and Emacs.
3650 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
3651 Define to an expression, not to the empty string.
3652 Include cloexec.h and xalloc.h.
3653 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
3654 Use set_cloexec_flag rather than rolling our own.
3655 * cloexec.c, cloexec.h: New files.
3657 2004-03-18 Paul Eggert <eggert@twinsun.com>
3659 * getopt.h: Sync with libc CVS.
3661 2004-03-18 Paul Eggert <eggert@twinsun.com>
3662 Bruno Haible <bruno@clisp.org>
3664 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
3665 not on all platforms that have <wchar.h>.
3666 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
3668 2004-03-09 Paul Eggert <eggert@twinsun.com>
3670 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
3672 * getopt_int.h: New file, also synced from libc.
3674 2004-03-07 Paul Eggert <eggert@twinsun.com>
3676 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
3677 '#if' expressions. Unlike the code it replaces, it does not
3678 depend on (defined _SC_PAGESIZE). However, it does depend on
3679 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
3680 first reported by Jason Andrade in
3681 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
3683 2004-01-18 Simon Josefsson <jas@extundo.com>
3685 * strdup.h: New file.
3686 * strdup.c: Include it.
3687 * path-concat.c: Include strdup.h. Drop strdup declaration.
3688 * userspec.c: Include strdup.h. Drop strdup declaration.
3690 2004-02-06 Karl Berry <karl@gnu.org>
3692 * config.charset: update from gettext 0.14.1.
3694 2004-02-05 Paul Eggert <eggert@twinsun.com>
3696 Add comments and code, prompted by suggestions from Bruno Haible
3698 * quotearg.h (quotearg_alloc): New decl. Improve the comments
3699 describing the enum quoting_style values.
3700 * quotearg.c (quotearg_alloc): New function.
3701 (quotearg_buffer_restyled): Treat lone { and } as special.
3702 Treat = as special. Work around bug with older shells
3703 that "see" a '\' that is really the 2nd byte of a multibyte char.
3704 Quote empty string with shell_quoting_style.
3706 2004-02-03 Bruno Haible <bruno@clisp.org>
3708 * pipe.h: New file, from GNU gettext.
3709 * pipe.c: New file, from GNU gettext.
3711 2004-01-27 Bruno Haible <bruno@clisp.org>
3713 * execute.h: New file, from GNU gettext.
3714 * execute.c: New file, from GNU gettext.
3715 * w32spawn.h: New file, from GNU gettext.
3717 2004-01-23 Paul Eggert <eggert@twinsun.com>
3719 Exit-status fix from coreutils.
3721 Use exit_failure consistently in place of EXIT_FAILURE,
3722 so that program exit statuses are consistent on failure.
3724 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
3725 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
3726 * argmatch.h: Comment fix to match the above.
3727 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
3728 Now a macro referring to exit_failure, instead of a separate
3729 variable. Include "exitfail.h" to get it.
3730 * xstrtol.h: Include "exitfail.h".
3731 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
3733 * long-options.c (parse_long_options): Use prototype
3734 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
3737 2004-01-21 Jim Meyering <jim@meyering.net>
3739 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
3740 so as not to conflict with a different-sized __mktime_internal
3741 function in GNU libc.
3742 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
3743 Problem building statically-linked `ls' reported by Michael Brunnbauer.
3745 2004-01-18 Paul Eggert <eggert@twinsun.com>
3747 Merge from diffutils.
3749 * file-type.c (file_type): Add typed memory objects.
3750 * file-type.h (S_TYPEISTMO): New macro.
3752 * c-stack.h (c_stack_action): Remove argv argument.
3753 * c-stack.c (c_stack_action): Likewise. All uses changed.
3754 (die): Don't calculate message unless segv_action returns.
3755 (get_stack_location, min_address_from_argv, max_address_from_argv,
3756 volatile stack_base, volatile_stack_size): Remove.
3757 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
3758 that every segmentation violation is a stack overflow. (Ouch!)
3759 See Debian bug 136249 (still outstanding) for more info about why
3760 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
3762 2003-11-30 Bruno Haible <bruno@clisp.org>
3764 Safer stack allocation.
3765 * setenv.c: Include allocsa.h.
3766 (alloca): Remove fallback definition.
3767 (freea): Remove macro.
3768 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
3771 2003-10-17 Bruno Haible <bruno@clisp.org>
3773 * binary-io.h: Avoid warnings on Cygwin.
3775 2003-12-28 Bruno Haible <bruno@clisp.org>
3777 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
3778 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
3780 2003-11-28 Bruno Haible <bruno@clisp.org>
3782 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
3784 2003-11-27 Bruno Haible <bruno@clisp.org>
3786 * wait-process.c: On Windows, include windows.h. Needed on mingw.
3788 2003-11-17 Bruno Haible <bruno@clisp.org>
3790 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
3792 2003-11-24 Bruno Haible <bruno@clisp.org>
3794 * xallocsa.h: New file, from GNU gettext.
3795 * xallocsa.c: New file, from GNU gettext.
3797 2003-11-24 Bruno Haible <bruno@clisp.org>
3799 * allocsa.h: New file, from GNU gettext.
3800 * allocsa.c: New file, from GNU gettext.
3802 2003-11-24 Bruno Haible <bruno@clisp.org>
3804 * eealloc.h: New file.
3806 2004-01-15 Jim Meyering <jim@meyering.net>
3808 Merge from coreutils.
3810 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
3811 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
3812 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
3814 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
3815 optional configure-time default.
3817 * version-etc.c (version_etc_copyright): Update copyright date.
3819 * xreadlink.c (xreadlink): Correct outdated comment.
3821 2004-01-15 Paul Eggert <eggert@twinsun.com>
3823 Merge from coreutils.
3825 * posixver.c: Include posixver.h.
3827 * same.c: Include <stdbool.h>, <limits.h>.
3828 (_POSIX_NAME_MAX): Define if not defined.
3830 (same_name): If file names are silently truncated, report
3831 that the file names are the same if they are the same after
3832 the silent truncation.
3834 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
3835 conversion function.
3836 * xstrtod.c (xstrtod): Likewise. All callers changed to
3837 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
3840 2004-01-14 Paul Eggert <eggert@twinsun.com>
3842 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
3843 with like-named macro in fnmatch.c.
3844 (EXT): Use an internal constant instead.
3846 Merge fnmatch patches from glibc.
3847 * fnmatch.c (mbsinit): Remove define.
3848 Add libc_hidden_ver (__fnmatch, fnmatch).
3849 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
3850 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
3852 2003-12-14 Karl Berry <karl@gnu.org>
3854 * config.charset: update from gettext-runtime.
3856 2003-12-03 Paul Eggert <eggert@twinsun.com>
3858 * getgroups.c (getgroups): xmalloc takes one argument, not two.
3859 Bug reported by Alfred M. Szmidt.
3861 2003-11-29 Karl Berry <karl@gnu.org>
3863 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
3865 2003-11-23 Paul Eggert <eggert@twinsun.com>
3866 Bruno Haible <bruno@clisp.org>
3868 * printf-parse.h: Don't include sys/types.h.
3869 (ARG_NONE): New macro.
3870 (char_directive): Change type of *arg_index fields to size_t.
3871 * printf-parse.c: Don't include sys/types.h.
3872 (SSIZE_MAX): Remove macro.
3873 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
3874 Remove unnecessary overflow check.
3875 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
3878 2003-11-24 Paul Eggert <eggert@twinsun.com>
3880 * alloca.c: Remove dependency on xalloc module.
3881 (xalloc_die): Remove.
3882 (memory_full) [!defined emacs]: New macro.
3883 [!defined emacs]: Don't include xalloc.h.
3884 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
3885 address arithmetic overflows. Change datatypes a bit to avoid
3888 2003-11-22 Jim Meyering <jim@meyering.net>
3890 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
3892 2003-11-17 Bruno Haible <bruno@clisp.org>
3894 * vasnprintf.c (alloca): Remove fallback definition.
3895 (freea): Remove definition.
3896 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
3897 Reported by Paul Eggert.
3899 2003-11-17 Jim Meyering <jim@meyering.net>
3901 On systems without utime and without a utimes function capable of
3902 dealing with a NULL struct utimbuf* argument, this utime replacement
3903 could -- in unusual circumstances -- leak a file descriptor.
3904 * utime.c: Include <unistd.h> and <errno.h>.
3905 (utime_null): Be sure to close `fd' and to preserve errno.
3906 Reported by Geoff Collyer via Arnold Robbins.
3908 2003-11-16 Paul Eggert <eggert@twinsun.com>
3909 Bruno Haible <bruno@clisp.org>
3911 Protect against address arithmetic overflow.
3912 * printf-args.h: Include stddef.h.
3913 (arguments): Change type of field 'count' to size_t.
3914 * printf-args.c (printf_fetchargs): Use size_t instead of
3915 'unsigned int' where appropriate.
3916 * printf-parse.h: Include sys/types.h.
3917 (char_directive): Change type of *arg_index fields to ssize_t.
3918 (char_directives): Change type of fields 'count', max_*_length to
3920 * printf-parse.c: Include sys/types.h and xsize.h.
3921 (SSIZE_MAX): Define fallback value.
3922 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
3923 instead of 'int' where appropriate. Check a_allocated, d_allocated
3924 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
3925 * vasnprintf.c: Include xsize.h.
3926 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
3927 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
3928 overflow. Avoid wraparound when converting a width or precision from
3931 2003-11-16 Bruno Haible <bruno@clisp.org>
3933 Update from GNU gettext.
3934 * printf-parse.c: Generalize to it can be compiled for wide strings.
3935 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
3936 * vasnprintf.c: Generalize to it can be compiled for wide strings.
3937 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
3938 SNPRINTF): New macros.
3939 Don't include <alloca.h> if the file is used inside libintl.
3940 (local_wcslen): New function, for Solaris 2.5.1.
3941 (VASNPRINTF): Use it instead of wcslen.
3943 2003-11-16 Bruno Haible <bruno@clisp.org>
3945 * xsize.h (xmax): New function.
3946 (xsum, xsum3, xsum4): Declare as "pure" functions.
3948 2003-11-12 Paul Eggert <eggert@twinsun.com>
3950 * xalloc.h: Do not include <limits.h> or <stdint.h>.
3951 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
3952 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
3953 heuristic is just as accurate as far as we know, and it removes a
3954 dependency on size_max.m4 and ptrdiff_max.m4.
3956 2003-11-12 Paul Eggert <eggert@twinsun.com>
3958 * xstrtol.c (__xstrtol): Remove "break" immediately after
3959 "return", to pacify some unknown compiler. Problem reported
3962 2003-11-11 Bruno Haible <bruno@clisp.org>
3964 * xsize.h (SIZE_MAX): Remove fallback definition.
3965 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
3968 2003-11-10 Paul Eggert <eggert@twinsun.com>
3970 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
3971 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
3972 rejected some allocations of exactly SIZE_MAX - 2 bytes.
3974 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
3975 not (size_t) -1, since it's defined here.
3977 2003-11-06 Paul Eggert <eggert@twinsun.com>
3979 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
3980 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
3981 Reject sizes of exactly SIZE_MAX bytes.
3982 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
3983 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
3985 2003-11-05 Bruno Haible <bruno@clisp.org>
3987 * xsize.h: Include limits.h, to avoid a possible collision with
3988 SIZE_MAX defined in <limits.h> on Solaris.
3990 2003-11-04 Bruno Haible <bruno@clisp.org>
3992 * xsize.h: New file.
3993 * linebreak.c: Include xsize.h.
3994 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
3995 argument for overflow.
3996 Suggested by Paul Eggert.
3998 2003-10-31 Bruno Haible <bruno@clisp.org>
4000 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
4001 to avoid (extremely rare) race condition.
4002 Suggested by Paul Eggert.
4004 2003-11-03 Jim Meyering <jim@meyering.net>
4006 * userspec.c: Include "userspec.h".
4007 * userspec.h: New file.
4009 2003-10-31 Paul Eggert <eggert@twinsun.com>
4011 * mountlist.h (struct mount_entry.me_type_malloced): New member.
4012 * mountlist.c (SIZE_MAX): Define if not defined already.
4013 (read_filesystem_list): Set and use me_type_malloced.
4014 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
4015 whatever the type happens to be), for brevity and consistency.
4016 Check for size calculation overflow on Alphas running OSF/1.
4018 2003-10-31 Jim Meyering <jim@meyering.net>
4020 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
4022 * linebuffer.c: Include <string.h> for declaration of memset.
4024 2003-10-30 Paul Eggert <eggert@twinsun.com>
4025 Bruno Haible <bruno@clisp.org>
4027 * vasprintf.c: Include <limits.h>, <stdlib.h>.
4028 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
4030 2003-10-29 Paul Eggert <eggert@twinsun.com>
4032 * xalloc.h (xalloc_oversized): Now a macro, not a function,
4033 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
4035 * quotearg.c (quotearg_n_options): Use it.
4036 * group-member.c: Include <stdbool.h>.
4037 (free_group_info): Arg is now const *; don't free arg.
4038 (get_group_info): Now returns bool and accepts struct group_info *,
4039 rather than returning a malloc'ed struct group_info *.
4040 All uses changed. Check for overflow in internal size calculation.
4042 * getusershell.c (readname): Simplify the code by using x2nrealloc
4043 rather than xmalloc/xrealloc.
4044 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
4045 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
4046 conformance bug: the old code used a pointer after freeing the
4047 storage that it addressed.
4048 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
4049 rather than doing it by hand.
4050 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
4051 the buffer preserved. Use free and xmalloc instead.
4052 * quotearg.c (quotearg_n_options): Likewise.
4053 Use a simpler test for size overflow. Don't use xalloc_oversized
4054 because unsigned int might be wider than size_t (!); this suggests
4055 that we should switch from unsigned int to size_t for slot numbers.
4057 2003-10-27 Bruno Haible <bruno@clisp.org>
4059 * stdbool_.h: Better support for BeOS.
4061 2003-10-27 Paul Eggert <eggert@twinsun.com>
4063 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
4064 to allocate the returned structure. Do not allocate a subarray,
4065 as x2nrealloc will do that.
4066 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
4067 instead of xnrealloc.
4068 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
4070 2003-10-26 Paul Eggert <eggert@twinsun.com>
4072 * xalloc.h (xalloc_oversized): New static inline function, for
4073 callers that want to do their own size-overflow checking. Include
4074 <stdbool.h>, since xalloc_oversized returns bool.
4075 * xalloc.c (array_size_overflow): Remove. All callers changed
4076 to use xalloc_oversized.
4078 Add two functions x2realloc, x2nrealloc, for programs that grow
4079 arrays dynamically by doubling their sizes.
4080 * xalloc.h (x2realloc, x2nrealloc): New decls.
4081 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
4084 Port to C99 semantics for 'inline' of external functions.
4085 Bug reported by Bruno Haible.
4086 * xmalloc.c (xnmalloc_inline): New static inline function,
4087 with the old contents of xnmalloc.
4088 (xnmalloc, xmalloc): Use it.
4089 (xnrealloc_inline): New static inline function,
4090 with the old contents of xnrealloc.
4091 (xnrealloc, xrealloc): Use it.
4093 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
4095 2003-10-25 Paul Eggert <eggert@twinsun.com>
4097 Fix several address-calculation bugs in the hash modules,
4098 plus some minor code cleanup.
4100 * hash.h: Include <stdbool.h>, for bool.
4101 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
4102 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
4103 hash_get_n_entries, hash_get_max_bucket_length,
4104 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
4105 hash_rehash): Use size_t rather than unsigned.
4106 * hash.c (struct hash_table, hash_get_n_buckets,
4107 hash_get_n_buckets_used, hash_get_n_entries,
4108 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
4109 hash_get_entries, hash_do_for_each, hash_string, is_prime,
4110 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
4112 (SIZE_MAX): Define if not defined.
4113 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
4114 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
4116 Use const * when possible.
4117 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
4118 (check_tuning): Fix bug: if tuning parameters were very close to
4119 0 or 1, rounding errors could have caused subscript violations.
4120 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
4121 (hash_initialize): Add 'fail:' label
4122 to free table and return NULL, and use it to simplify code.
4123 Use calloc rather than clearing the storage ourself.
4124 (hash_initialize, hash_rehash): Check for arithmetic overflow in
4125 buffer size calculations.
4126 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
4127 Include <stddef.h>, for size_t.
4128 * hash-pjw.c (hash_pjw): Likewise.
4129 Switch to method described by Bruno Haible.
4130 Include <limits.h>, for CHAR_BIT.
4131 (SIZE_BITS): New macro.
4133 2003-10-21 Paul Eggert <eggert@twinsun.com>
4135 * getndelim2.c (getndelim2): When size calculation overflows,
4136 ceiling the allocation at NMAX bytes rather than silently
4137 discarding input bytes before NMAX is reached. This makes
4138 a difference only if NMAX exceeds SIZE_MAX / 2.
4140 * obstack.c: Merge from glibc.
4141 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
4142 Add libc_hidden_def (_obstack_newchunk).
4143 (_obstack_free) [! defined _LIBC]: Remove.
4144 [defined _LIBC]: Make a strong alias from obstack_free, rather than
4145 a clone of the function body.
4146 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
4147 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
4149 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
4150 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
4153 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
4154 (obstack_ptr_grow_fast, obstack_int_grow_fast):
4155 Don't use lvalue casts, as GCC plans to remove support for them
4156 in GCC 3.5. Reported by Joseph S. Myers. This bug
4157 was also present in the non-GCC version, indicating that this
4158 code had always been buggy and had never been widely used.
4159 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
4160 Use the fast variant of each macro, rather than copying the
4161 definiens of the fast variant; that way, we'll be more likely to
4162 catch future bugs in the fast variants.
4164 2003-10-20 Bruno Haible <bruno@clisp.org>
4166 * wait-process.h: New file, from GNU gettext.
4167 * wait-process.c: New file, from GNU gettext.
4169 2003-10-19 Jim Meyering <jim@meyering.net>
4171 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
4173 2003-10-16 Paul Eggert <eggert@twinsun.com>
4175 * getgroups.c: Include <errno.h>, <stdlib.h>.
4176 (getgroups): First arg is int, not size_t.
4177 Don't let 'free' mangle errno.
4179 2003-10-16 Jim Meyering <jim@meyering.net>
4181 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
4183 2003-10-15 Paul Eggert <eggert@twinsun.com>
4185 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
4187 (new_exclude, add_exclude_file): Initial size no longer needs to
4189 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
4190 our own address arithmetic overflow checking.
4192 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
4193 (fnmatch): Do not alloca more than 2000 wide characters;
4194 instead, use malloc for large buffers.
4195 Check for address arithmetic overflow, and return -1
4196 with errno set to ENOMEM in that case.
4197 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
4198 (NEW_PATTERN): Do not alloca more than 8000 bytes;
4199 instead, return -1. Check for address arithmetic overflow.
4201 2003-10-14 Paul Eggert <eggert@twinsun.com>
4203 Handle invalid suffixes and overflow independently, so that
4204 callers can treat them independently as needed. Fix some bugs in
4205 suffix handling, e.g., "100k@" was not diagnosed as an invalid
4206 suffix for a human-readable blocksize. The major caller-visible
4207 change is the addition of a new
4208 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
4209 that both overflow and suffix chars were found.
4211 * human.c (humblock): Don't check separately for invalid suffix
4212 char; that is xstrtoumax's job (now that its bug is fixed).
4213 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
4214 INTMAX_MAX]: New macros.
4215 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
4216 TYPE_MAXIMUM): New macros.
4217 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
4218 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
4219 if overflow occurs, as it's what __strtol does and it's more useful
4221 (__xstrtol): If __strtol reports some error other than ERANGE,
4222 reflect it to the caller as LONGINT_INVALID. If it reports
4223 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
4224 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
4225 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
4227 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
4228 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
4229 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
4230 [defined UINTMAX_MAX]: New macros.
4232 2003-10-14 Bruno Haible <bruno@clisp.org>
4234 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
4235 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
4236 Also use volatile where needed.
4238 2003-10-12 Paul Eggert <eggert@twinsun.com>
4240 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
4241 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
4242 and define in terms of the other primitives.
4243 * xmalloc.c: Include stdbool.h; do not include exit.h.
4244 (SIZE_MAX): Define if not already defined.
4245 (array_size_overflow): New function.
4246 (xalloc_die): Abort instead of exiting if 'error' returns.
4247 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
4248 (xmalloc, xrealloc): Use them.
4249 (xcalloc): Check for address arithmetic overflow.
4250 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
4251 a bit faster than strcpy.
4253 2003-10-08 Paul Eggert <eggert@twinsun.com>
4255 Merge getpass from libc, plus a few fixes.
4257 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
4258 Include <stdbool.h>.
4259 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
4260 __fsetlocking to empty.
4261 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
4262 do include <bits/libc-lock.h>.
4263 Do not include <fcntl.h>; not needed.
4264 [_LIBC]: Include <wchar.h>.
4265 (NOTCANCEL_MODE): New macro.
4266 (flockfile, funlockfile) [_LIBC]: New macros.
4267 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
4268 [!_LIBC]: New macros.
4269 (call_fclose): New function.
4270 (getpass): Use it. Save tty stream separately; this simplifies the
4271 code and makes it more reliable if stdin happens to equal stdout.
4272 Invoke __fsetlocking on tty.
4273 Handle thread cancellation if needed.
4274 Namespace cleanup (use __tcgetattr, __getline).
4275 Use bool for Booleans.
4276 [USE_IN_LIBIO]: Handle wide streams.
4277 [!_LIBC]: Unconditionally do the fseek, since we don't know what
4278 stream might go where.
4280 * unlocked-io.h: Include <stdio.h>, so that the caller
4281 doesn't have to include <stdio.h> before us.
4282 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4283 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4284 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4285 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4286 if not declared, so that we can use getpass.c code from libc without
4288 (flockfile, ftrylockfile, funlockfile): New macros.
4290 2003-10-06 Bruno Haible <bruno@clisp.org>
4292 * version-etc-2.h: Remove file.
4293 * version-etc-2.c: Remove file.
4295 2003-09-25 Jim Meyering <jim@meyering.net>
4296 Bruno Haible <bruno@clisp.org>
4298 This lets translators provide better translations for the
4299 "Written by ..." part of --version output.
4300 * version-etc.h: Include stdarg.h.
4301 (version_etc_copyright): Declare as readonly.
4302 (version_etc): Make this function variadic with a NULL-terminated list
4303 of author name strings.
4304 (version_etc_va): New declaration.
4305 * version-etc.c: Include stdarg.h, stdlib.h.
4306 (version_etc_copyright): Declare as readonly.
4307 (version_etc_va): New function. Provide a different translatable string
4308 for each possible number of authors < 10. Abbreviate when there are 10
4310 (version_etc): Make this function variadic. Call version_etc_va.
4311 Suggestion from Gary V. Vaughan.
4313 * long-options.h (parse_long_options): Change prototype: the authors
4314 string is moved to the end and becomes variadic.
4315 * long-options.c: Include stdarg.h.
4316 (parse_long_options): Make this function variadic, too.
4317 Call version_etc_va, not version_etc.
4319 2003-10-06 Bruno Haible <bruno@clisp.org>
4321 * fatal-signal.h: New file, from GNU gettext.
4322 * fatal-signal.c: New file, from GNU gettext.
4324 2003-10-04 Karl Berry <karl@gnu.org>
4326 * argp*: update from libc.
4328 2003-10-01 Larry Jones <lawrence.jones@eds.com>
4330 * getpass.c (getpass): Use a no-op fseek when switching from input to
4331 output mode on the same stream.
4333 2003-09-29 Paul Eggert <eggert@twinsun.com>
4335 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4336 Fix arg typo in previous patch.
4338 2003-09-28 Jim Meyering <jim@meyering.net>
4340 * error.c: Correct cpp indentation.
4342 2003-09-27 Paul Eggert <eggert@twinsun.com>
4344 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
4345 Omit the special code that used __typeof__, since we worry that
4346 it could be more trouble than it's worth. See:
4347 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
4348 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
4352 2003-09-26 Jim Meyering <jim@meyering.net>
4354 * error.c (error_tail): Move some declarations
4355 into inner scope where the local variables are used.
4357 2003-09-26 Bruno Haible <bruno@clisp.org>
4359 * stpncpy.h (gnu_stpncpy): New declaration.
4360 (stpncpy): Define as alias for gnu_stpncpy.
4361 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
4363 2003-09-26 Paul Eggert <eggert@twinsun.com>
4365 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
4366 (error_tail): Do not loop, reallocating temporary buffer, since
4367 the output cannot contain more wide characters than the input
4368 contains bytes, the size must be big enough already. This avoids
4369 one potential size overflow calculation. Check for size overflow
4370 when calculating temporary buffer size. Free temporary buffer
4371 when done, if it was allocated with malloc; this plugs a memory
4372 leak. Remove casts from void * to pointers, that are no longer
4373 needed now that we're assuming C89 or better.
4375 Merge error changes from glibc.
4377 * error.c, error.h: Update copyright notice header to match glibc.
4378 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
4379 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
4380 Disable cancellation while printing error.
4381 * error.h: Prepend __ to parameter names.
4383 2003-09-25 Karl Berry <karl@gnu.org>
4385 * argp-fmtstream.c, argp-help.c: update from libc.
4387 2003-09-25 Bruno Haible <bruno@clisp.org>
4389 * version-etc-2.h: New file, from version-etc.h with modifications.
4390 * version-etc-2.c: New file, from version-etc.c with modifications.
4392 2003-09-25 Simon Josefsson <jas@extundo.com>
4394 * xgetdomainname.h: New file.
4395 * xgetdomainname.c: New file.
4397 2003-09-25 Simon Josefsson <jas@extundo.com>
4398 Bruno Haible <bruno@clisp.org>
4400 * getdomainname.h: New file.
4401 * getdomainname.c: New file.
4403 2003-09-24 Paul Eggert <eggert@twinsun.com>
4405 * linebuffer.c (freebuffer): Don't free the argument, just
4406 the buffer associated with the argument. Bug reported by
4409 2003-09-19 Karl Berry <karl@gnu.org>
4411 * argp.h: update from libc.
4413 2003-09-16 Paul Eggert <eggert@twinsun.com>
4415 * linebuffer.c (readlinebuffer): Return NULL immediately upon
4416 input error, instead of returning NULL the next time we are called
4417 (and therefore losing track of errno).
4419 2003-09-15 Paul Eggert <eggert@twinsun.com>
4421 * getndelim2.c (getndelim2): Don't trash errno when a read
4422 fails, so that the caller gets the proper errno.
4424 * readutmp.c (read_utmp): Likewise.
4425 Check for fstat error. Close stream and free storage
4428 2003-09-14 Bruno Haible <bruno@clisp.org>
4430 * fwriteerror.h: New file.
4431 * fwriteerror.c: New file.
4433 2003-09-14 Jim Meyering <jim@meyering.net>
4435 * getloadavg.c: Correct cpp indentation.
4436 * strdup.c: Likewise.
4437 * vasnprintf.c: Likewise.
4439 2003-09-12 Paul Eggert <eggert@twinsun.com>
4441 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
4442 * obstack.c [!defined _LIBC]: Likewise.
4443 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4444 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4445 * exitfail.c: Don't include stdlib.h; no longer needed.
4447 More changes to assume C89 or better.
4449 * error.c (error_tail): Assume vprintf.
4451 * argmatch.c (getenv): Remove decl.
4452 * progreloc.c (get_full_program_name): Define via prototype.
4453 * setenv.c (clearenv): Likewise.
4454 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
4456 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
4457 (malloc, memcpy): Remove decls.
4458 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
4459 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
4460 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4461 (memcpy): Remove macro.
4462 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
4463 (__P): Remove. All uses removed.
4464 (PTR): Remove. All uses changed to void *.
4465 (CHAR_BIT, NULL): Remove.
4466 (spaces, zeros, memset_space, memset_zero)
4467 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
4469 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
4470 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
4471 Define with prototype.
4472 Remove now-unnecessary prototype decl.
4473 (extra_args_spec): Assume ANSI C. All uses changed.
4474 (extra_args_spec_iso): Remove.
4475 (my_strftime, emacs_strftimeu): Define via prototype.
4476 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
4478 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
4479 * strtoimax.c: Include <stdlib.h> unconditionally.
4480 (strtoul, strtol): Remove decls.
4481 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
4483 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4484 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
4485 (LOCALE_PARAM_PROTO): New macro.
4486 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
4487 (INTERNAL (strtol), strtol): Define with a prototype.
4488 (PARAMS): Remove. All uses removed.
4489 * tempname.c: Include <string.h> unconditionally.
4490 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
4491 * xgethostname.c (main): Define with a prototype.
4492 * xmalloc.c: Include "xalloc.h" first, to check interface.
4493 Include <stdlib.h> unconditionally.
4494 (calloc, malloc, realloc, free): Remove decls.
4495 * xstrtod.c: Include "xstrtod.h" first, to check interface.
4496 Include <stdlib.h> unconditionally. Sort include file names.
4498 (xstrtod): Define with a prototype.
4499 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
4500 (strtol, strtoul): Remove decls.
4502 2003-09-11 Paul Eggert <eggert@twinsun.com>
4504 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
4505 Include <stdlib.h>, <string.h> unconditionally.
4506 Remove now-unnecessary cast to char *.
4507 * strnlen.c: Include <string.h> unconditionally.
4508 * yesno.c (yesno): Define with a prototype.
4510 2003-09-10 Bruno Haible <bruno@clisp.org>
4512 * strcspn.c: Include <string.h> unconditionally.
4513 * strpbrk.c: Include <string.h> unconditionally.
4514 * strstr.c: Include <string.h> unconditionally.
4515 * unicodeio.c: Include <string.h> unconditionally.
4516 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
4517 * unsetenv.c: Likewise.
4518 * xreadlink.c: Include <stdlib.h> unconditionally.
4519 * yesno.c: Include <stdlib.h> unconditionally.
4520 (rpmatch): Add prototype.
4522 2003-09-10 Jim Meyering <jim@meyering.net>
4524 * error.c: Correct indentation of cpp directives.
4526 2003-09-09 Paul Eggert <eggert@twinsun.com>
4530 * acosl.c (main): Use a prototype.
4531 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
4534 * getloadavg.c (getloadavg, main): Define via prototypes.
4536 * getopt.h (struct option.name): Assume C89, and use 'const'.
4537 (getopt, etopt_long, getopt_long_only, _getopt_internal)
4538 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
4540 * getopt.c (const): Remove macro.
4541 Include <string.h> unconditionally.
4542 (my_index): Remove; all uses changed to strchr.
4543 (strlen): Remove decl.
4544 (exchange): Remove forward decl; no longer needed.
4545 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
4546 Define with prototype.
4547 * getopt1.c (const): Remove macro.
4548 (getopt_long, getopt_long_only, main): Define with prototype.
4550 * getugroups.c: Include <string.h> unconditionally.
4552 * getusershell.c: Include <stdlib.h> unconditionally.
4553 (getusershell, setusershell, endusershell, readname, main):
4554 Define with prototypes.
4556 * group-member.c: Include group-member.h first.
4557 Include <stdlib.h> unconditionally.
4559 * hard-locale.c: Include hard-locale.h first.
4560 Include <stdlib.h>, <string.h> unconditionally.
4562 * hash.c (free, malloc): Remove decls.
4563 Include <stdlib.h> unconditionally.
4565 * human.c: Include <stdlib.h>, <string.h> unconditionally.
4566 (getenv): Do not declare.
4568 * idcache.c: Include <string.h> unconditionally.
4570 * long-options.c: Include long-options.h first, to test interface.
4571 Include <stdlib.h> unconditionally.
4573 * makepath.c: Include makepath.h first, to test interface.
4574 Include <stdlib.h> and <string.h> unconditionally.
4576 * linebuffer.c: Include <stdlib.h>.
4577 (free): Remove decl.
4579 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
4580 rpl_malloc returns void *, not char *.
4581 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
4583 * md5.h: Include <limits.h> unconditionally.
4584 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
4585 (__P): Remove; all uses removed.
4586 * md5.c: Include "md5.h" first.
4587 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
4588 md5_buffer, md5_process_bytes, md5_process_block):
4589 Define with prototypes.
4590 * sha.h (__P): Remove all uses. (It wasn't defined??)
4591 * sha.c: Include "sha.h" first.
4592 Include <stdlib.h>, <string.h> unconditionally.
4594 * memchr.c (__ptr_t): Remove; all uses changed to void *.
4595 * memcmp.c (__ptr_t): Likewise.
4596 * memrchr.c (__ptr_t): Likewise.
4597 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
4598 Include <string.h> unconditionally.
4599 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
4600 * memchr.c: Include <stdlib.h> unconditionally.
4601 * memchr.c (LONG_MAX): Remove.
4602 * memrchr.c (LONG_MAX): Likewise.
4603 * memchr.c (__memchr): Define via a prototype.
4604 * memrchr.c (__memrchr): Likewise.
4605 * memcmp.c (__P): Remove, and remove all uses.
4606 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
4607 Remove forward decls; no longer needed.
4608 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
4609 Use types required by C89 in prototype.
4611 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
4612 * savedir.c: Likewise.
4613 * mkdir.c (free): Remove decl.
4614 * rmdir.c (rmdir): Define with a prototype.
4615 * savedir.c: Include savedir.h first, to test interface.
4617 * mktime.c (STDC_HEADERS): Remove.
4618 Include <stdlib.h>, <string.h> unconditionally.
4620 * modechange.c: Include <stdlib.h> unconditionally.
4621 (malloc): Remove decl.
4623 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
4624 (free): Remove decl.
4626 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
4627 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
4628 (This type really should be intptr_t, but that's a C99ism.)
4629 (_obstack_memcpy): Remove: all uses changed to memcpy.
4630 Include <string.h> unconditionally.
4631 (struct obstack): Assume __STDC__ for types of members
4632 chunkfun, freefun, extra_arg.
4633 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
4634 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
4635 obstack_begin, obstack_specify_allocation,
4636 obstack_specify_allocation_with_arg, obstack_chunkfun,
4637 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
4638 Remove unprototyped decls and the macros that use them.
4639 * obstack.c (POINTER): Remove. All uses changed to void *.
4640 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
4641 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
4642 (defined __STDC__ && __STDC__)]:
4643 Remove nonprototyped code.
4644 Include <stdlib.h> unconditionally.
4645 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
4646 _obstack_allocated_p, _obstack_free, obstack_free,
4647 _obstack_memory_used, print_and_abort):
4648 Define using prototypes.
4649 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
4650 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
4651 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
4652 obstack_next_free, obstack_object_size, obstack_room) [0]:
4653 Remove unused, unprototyped code.
4655 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
4657 * physmem.c (physmem_total, physmem_available, main): Define
4660 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
4661 (main): Define with a prototype.
4663 * posixver.c (getenv): Remove decl.
4665 * putenv.c (malloc): Returns void *, not char *.
4666 Include <string.h> unconditionally.
4667 (strchr, memcpy, NULL): Do not define.
4669 * readtokens.c: Include readtokens.h first, to test interface.
4670 Include <stdlib.h>, <string.h> unconditionally.
4671 (init_tokenbuffer): Define with a prototype.
4673 * regex.c (PARAMS): Remove. All uses removed.
4674 All uses of _RE_ARGS removed, too.
4675 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4677 (bzero): Assume memset exists.
4678 (memcmp, memcpy, NULL): Remove.
4679 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
4680 char, or assignments to local vars of type signed char.
4681 (init_syntax_once, PREFIX(extract_number_and_incr),
4682 PREFIX(print_partial_compiled_pattern),
4683 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
4684 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
4685 PREFIX(regex_grow_registers), PREFIX(regex_compile),
4686 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
4687 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
4688 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
4689 wcs_compile_range, byte_compile_range, truncate_wchar,
4690 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
4691 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
4692 count_mbs_length, wcs_re_match_2_internal,
4693 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
4694 PREFIX(alt_match_null_string_p),
4695 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
4696 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
4697 regfree, PREFIX(extract_number)): Define with prototype. Remove
4698 now-unnecessary declaration, if any.
4699 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
4701 Remove now-unnecessary casts among pointer types.
4702 * regex.h (_RE_ARGS): Remove. All uses removed.
4704 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
4705 (free): Remove decl.
4707 * rpmatch.c: Include <stdlib.h> unconditionally.
4709 * same.c: Include <stdlib.h>, <string.h> unconditionally.
4710 (free): Remove decl.
4712 * save-cwd.c: Include <stdlib.h> unconditionally.
4713 * xgetcwd.c: Likewise.
4715 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
4716 (free): Remove decl.
4718 * strchrnul.c (strchrnul): Define with a prototype.
4719 Fix bug: c_in was not converted to char before searching.
4721 The following changes are not K&R related:
4723 * group-member.h: Include <sys/types.h>, so that this file is
4725 * makepath.h: Likewise.
4727 * getusershell.c (readname, default_index, line_size, readname):
4728 Use size_t, not int, for sizes.
4729 (readname): If the size overflows, report an error instead of
4732 2003-09-09 Derek Robert Price <derek@ximbiot.com>
4734 * getndelim2.c: Assume stdlib.h per the C89 spec.
4736 2003-09-08 Paul Eggert <eggert@twinsun.com>
4738 Assume C89 or better; remove K&R cruft.
4739 A few of these changes were first proposed by Derek Robert Price
4740 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
4742 * addext.c: Include <string.h> unconditionally.
4743 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
4744 Don't declare getenv or malloc.
4746 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
4747 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
4749 (find_stack_direction, alloca): Use prototypes.
4751 * atexit.c (atexit): Define using a prototype.
4753 * basename.c, dirname.c, stripslash.c:
4754 Include <string.h> unconditionally.
4756 * bcopy.c: Include <stddef.h>.
4757 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
4759 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
4761 * error.h (error, error_at_line, error_print_progname)
4762 [! (defined (__STDC__) && __STDC__)]: Remove decls.
4763 * error.c: Include error.h first, to check interface.
4764 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4765 (VA_START): Remove; all uses changeed to va_start.
4766 (exit, strerror): Remove decls.
4767 (error_print_progname): Prototype uncondionally.
4768 Don't include <errno.h>; no longer needed.
4769 (private_strerror): Remove.
4770 (error_tail): Always define.
4771 (error, error_at_line): Assume C89 or better; always use prototypes.
4772 * fatal.c: Include "fatal.h" first, to test interface.
4773 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4774 (VA_START): Remove; all uses changed to va_start.
4775 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
4777 (exit): Remove decl.
4778 (fatal): Prototype unconditionally. Assume va_start works.
4779 Abort at end, to pacify gcc.
4781 * euidaccess.c (main): Define with a prototype.
4783 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
4785 * exitfail.c: Include <stdlib.h> unconditionally.
4787 * fnmatch_.h (__P): Remove. All uses changed to assume
4789 * fnmatch.c: Include fnmatch.h first, to test interface.
4790 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
4791 (getenv): Remove decl.
4792 (fnmatch): Define using a prototype.
4793 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
4794 (FCT): Define using a prototype.
4796 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
4798 * gethostname.c: Include <stddef.h>.
4799 (gethostname): Define with prototype. Length is size_t, not int.
4801 2003-09-08 Paul Eggert <eggert@twinsun.com>
4803 * getversion.c: Remove; was migrated to backupfile.c in 1997.
4804 getversion.c should have been removed then, but was accidentally
4807 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
4808 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
4810 2003-09-07 Paul Eggert <eggert@twinsun.com>
4812 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
4813 copy_tm_result. Bug reported by Simon Josefsson in
4814 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
4816 2003-09-06 Paul Eggert <eggert@twinsun.com>
4818 * time_r.c, time_r.h: New files.
4820 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
4822 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
4823 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
4825 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
4827 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
4828 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
4831 * timegm.c: Switch to glibc implementation, with the following changes:
4832 [defined HAVE_CONFIG_H]: Include <config.h>.
4833 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
4834 (__mktime_internal) [!defined _LIBC]: New decl.
4835 (__gmtime_r) [!defined _LIBC]: New macro and function.
4836 (timegm): Use a prototype, since gnulib assumes C89.
4837 Do not bother declaring tmp to be const, as it's not really usefu.
4838 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
4839 (timegm): Declare only if HAVE_DECL_TIMEGM.
4841 2003-09-03 Paul Eggert <eggert@twinsun.com>
4843 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
4844 Bug reported by Lute Kamstra in
4845 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
4847 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
4848 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
4849 course with correspondingly smaller numbers for tomorrow and
4850 yesterday. From Tadayoshi Funaba. Originally installed into
4851 sh-utils on 1999-08-07, but the patch got lost (I guess during the
4854 2003-08-31 Simon Josefsson <jas@extundo.com>
4856 * timegm.h: New file.
4857 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
4859 2003-08-31 Karl Berry <karl@gnu.org>
4861 * argp.h: update from libc.
4863 2003-08-28 Bruno Haible <bruno@clisp.org>
4865 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
4866 warning on QNX, which defines O_BINARY to 000000.
4868 2003-08-24 Bruno Haible <bruno@clisp.org>
4870 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
4871 MSVC7 <stdio.h> is included later.
4873 2003-08-20 Bruno Haible <bruno@clisp.org>
4875 * progname.h: New file, from GNU gettext.
4876 * progname.c: New file, from GNU gettext.
4877 * progreloc.c: New file, from GNU gettext.
4879 2003-08-19 Bruno Haible <bruno@clisp.org>
4881 * xstrdup.c: Assume <string.h> exists.
4883 2003-08-18 Jim Meyering <jim@meyering.net>
4885 * setenv.h: Indent nested cpp directive.
4886 * vasnprintf.c: Remove trailing blanks.
4888 2003-08-17 Simon Josefsson <jas@extundo.com>
4889 Bruno Haible <bruno@clisp.org>
4891 * xstrndup.h: New file.
4892 * xstrndup.c: New file.
4894 2003-08-17 Bruno Haible <bruno@clisp.org>
4896 * strndup.h: New file.
4898 2003-08-16 Paul Eggert <eggert@twinsun.com>
4900 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
4901 space, undoing this 2003-08-12 change:
4902 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
4904 2003-08-16 Jim Meyering <jim@meyering.net>
4906 Merge from coreutils.
4907 * xstrtoimax.c: #else #if -> #elif.
4908 * xstrtoumax.c: Likewise.
4910 2003-08-15 Paul Eggert <eggert@twinsun.com>
4912 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
4913 rather than tab, after '#' in shell-script copyright notices.
4914 Suggested by Bruno Haible.
4916 2003-08-15 Jim Meyering <jim@meyering.net>
4917 and Paul Eggert <eggert@twinsun.com>
4919 Merge from coreutils.
4920 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
4921 member but strut utmpx does not. Needed for AIX 4.3.3.
4922 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
4924 2003-08-15 Jim Meyering <jim@meyering.net>
4926 Merge from coreutils.
4927 * xgethostname.c: Include <stdlib.h>.
4928 (xghostname): Don't exit for anything other than memory-related
4929 failure; just return NULL.
4930 * userspec.c: Include "posixver.h".
4931 (parse_user_spec): Accept `.' as a separator only
4932 in pre-POSIX-200112 mode.
4933 * strtoimax.c: Use #elif rather than #else #if.
4934 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
4935 Remove function, now that we can rely on a working tzset function.
4936 [!_LIBC]: Ensure that the required autoconf test has been run.
4937 [!defined _NL_CURRENT && HAVE_STRFTIME]:
4938 Use underlying_strftime for %r.
4939 * sha.c: Merge in some clean-up and optimization changes from glibc.
4940 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
4941 Ensure that it is a multiple of 64.
4942 Rearrange loop exit tests so as to avoid performing an
4943 additional fread after encountering an error or EOF.
4944 * realloc.c: Update copyright date.
4946 2003-08-14 Jim Meyering <jim@meyering.net>
4948 Merge from coreutils.
4949 * obstack.h: Whitespace changes.
4950 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
4951 and xcalloc return values.
4952 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
4953 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
4954 hang on OSF/1 5.1 for DIR on both local and remote file systems.
4955 Reported by (and fix confirmed by) Nelson H. F. Beebe.
4956 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4958 Use mntctl's return value to drive the entry-processing loop, since
4959 we can't rely on the value of the vmt_length member in the last
4960 entry. On some systems doing so could result in exhausting
4961 virtual memory. Based in part on a patch from Mike Jetzer.
4963 2003-08-14 Jim Meyering <jim@meyering.net>
4964 and Paul Eggert <eggert@twinsun.com>
4966 Merges from coreutils, plus other fixes.
4967 * physmem.c: Merge in portability changes from gcc/libiberty
4968 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
4969 for credits and details. Thanks to Kaveh Ghazi for helping
4970 to keep these files in sync.
4971 (ARRAY_SIZE): Define it.
4972 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
4973 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
4974 (memcasecmp): Don't assume size_t fits in unsigned int.
4975 Remove casts and duplicate code.
4976 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
4977 (memcpy): Remove definition.
4978 Merge in some clean-up and optimization changes from glibc.
4979 [BLOCKSIZE]: Move definition to top of file.
4980 Ensure that it is a multiple of 64.
4981 Rearrange loop exit tests so as to avoid performing an
4982 additional fread after encountering an error or EOF.
4983 * md5.h (md5_uintptr): Define.
4984 * makepath.c (CLEANUP_CWD): Report an error if we failed to
4985 return to the initial working directory. Preserve errno
4987 * idcache.c: Include "xalloc.h".
4988 (xmalloc, xrealloc): Remove decls.
4989 (getuser): Remove casts no longer required in C89.
4990 * human.c: Include stdio.h, for sprintf.
4991 * group-member.c: Include "xalloc.h".
4992 (xmalloc, xrealloc): Remove decls.
4993 (get_group_info): Remove casts no longer required in C89.
4994 * getusershell.c (readname): Remove casts no longer required in C89.
4995 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
4996 * getline.c: Whitespace fix, from coreutils.
4998 2003-08-13 Paul Eggert <eggert@twinsun.com>
5000 * exclude.c: Include <ctype.h>
5001 (IN_CTYPE_DOMAIN): New macro.
5003 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
5006 * argp-help.c, argp-parse.c, config.charset, getopt.h:
5007 Undo previous (whitespace-only) change.
5009 2003-08-12 Paul Eggert <eggert@twinsun.com>
5011 * argp-help.c, argp-parse.c, config.charset, getopt.h:
5012 Normalize leading white space and remove trailing white space.
5013 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
5014 notice, as per ../config/srclist-update.
5016 Merge from coreutils.
5017 * euidaccess.h: New file.
5018 * euidaccess.c: Include it.
5019 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
5020 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
5021 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
5023 2003-08-11 Bruno Haible <bruno@clisp.org>
5025 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
5026 (vasnprintf): Use it instead of wcslen.
5028 2003-08-11 Bruno Haible <bruno@clisp.org>
5030 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
5031 value to ensure that _Bool promotes to int. Use #define for _Bool when
5032 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
5034 2003-08-10 Karl Berry <karl@gnu.org>
5036 * regex.h: update from libc (whitespace fix).
5038 2003-08-09 Paul Eggert <eggert@twinsun.com>
5040 Merge some files from coreutils. These changes were
5041 originally made by Jim Meyering.
5042 * acl.c: Include <sys/types.h> before <sys/stat.h>;
5043 many older Unixes require this.
5044 * alloca.c (alloca): Remove cast to argument of free;
5045 no longer needed in C89.
5046 * alloca_.h, regex.h: Fix white space to match
5047 what GNU indent does.
5049 2003-08-05 Paul Eggert <eggert@twinsun.com>
5051 * bumpalloc.h: Remove.
5053 2003-08-04 Paul Eggert <eggert@twinsun.com>
5055 * getloadavg.c: Change copyright notice and spacing to conform to
5058 Merge from coreutils.
5059 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
5061 * getdate.y (date): Also accept dates like May-23-2003; suggestion
5062 from Karl Berry, implemented by Jim Meyering.
5063 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
5064 from Dmitry V. Levin.
5065 Remove anachronistic cast of xrealloc.
5066 * fnmatch_.h (__const): Remove. Use 'const'.
5067 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
5068 type. Otherwise, it wouldn't compile with at least /bin/cc on
5069 ymp-cray-unicos9.0.2.X.
5070 Combine two mostly-identical uses of alloca into one.
5071 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
5073 2003-08-04 Dave Love <d.love@dl.ac.uk>
5077 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
5078 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
5079 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
5080 obsolete NLIST_NAME_UNION.
5081 [__GNU__]: Undef BSD and FSCALE.
5082 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
5084 2003-08-03 Paul Eggert <eggert@twinsun.com>
5086 * stdbool_.h (_Bool): Make it signed char, instead of
5087 an enum type, so that it's guaranteed to promote to int. See:
5088 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
5090 2003-07-31 Paul Eggert <eggert@twinsun.com>
5092 * strerror.c: Include config.h, limits.h. Declare sprintf.
5093 (strerror): Don't assume that a printable int fits in 14 bytes.
5095 2003-07-24 Derek Robert Price <derek@ximbiot.com>
5096 Bruno Haible <bruno@clisp.org>
5098 * getline.h (getline, getdelim): Change return type to ssize_t.
5099 * getline.c (getline, getdelim): Likewise.
5100 Remove _GNU_SOURCE define; now it's defined in config.h through
5103 2003-07-22 Paul Eggert <eggert@twinsun.com>
5105 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
5106 over-parenthesization in macros.
5108 Sync with coreutils.
5110 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
5113 Use `exit_failure' for xalloc and xmemcoll instead of their own
5114 private exit-failure variables.
5115 * xalloc.h (xalloc_exit_failure): Remove.
5116 * xmalloc.c: Likewise. Include exitfail.h.
5117 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
5118 * xmemcoll.h (xmemcoll_exit_failure): Remove.
5119 * xmemcoll.c: Likewise. Include exitfail.h.
5120 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
5122 2003-07-18 Paul Eggert <eggert@twinsun.com>
5124 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
5125 * closeout.c: Likewise. Include "closeout.h" right after config.h,
5126 to test that it can stand by itself. Include "exitfail.h".
5127 Clients should set exit_failure instead.
5128 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
5130 2003-07-18 Andreas Schwab <schwab@suse.de>
5132 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
5134 2003-07-18 Bruno Haible <bruno@clisp.org>
5136 * getndelim2.h: New file.
5137 * getndelim2.c: Make into a module of its own. Include config.h,
5139 (getndelim2): Make non-static. Change return type to ssize_t.
5140 * getline.h: Change argument names.
5141 * getline.c: Include getndelim2.h instead of getndelim2.c.
5142 * getnline.c: Include getndelim2.h.
5144 2003-07-17 Bruno Haible <bruno@clisp.org>
5146 * Makefile.am: Remove file.
5147 * Makefile.in: Remove file.
5149 2003-07-17 Bruno Haible <bruno@clisp.org>
5151 * getnline.h: New file.
5152 * getnline.c: New file.
5153 * getndelim2.c: New file, extracted from getline.c.
5154 (getndelim2): Renamed from getdelim2, with added nmax argument.
5155 * getline.c: Include getndelim2.c.
5156 (getdelim2): Moved out to getndelim2.c.
5157 (getline, getdelim): Update.
5159 2003-07-15 <karl@gnu.org>
5161 * vasnprintf.c: update from gettext.
5163 2003-07-15 Jim Meyering <jim@meyering.net>
5165 * makepath.c (make_path): Enclose diagnostic in _(...).
5167 2003-07-14 Paul Eggert <eggert@twinsun.com>
5169 * asnprintf.c, asprintf.c, config.charset, gettext.h,
5170 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
5171 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
5172 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
5173 vasprintf.c, vasprintf.h: Regenerate. These files are now being
5174 updated automatically by ../config/srclist-update. This changes
5175 their license from LPGL to GPL.
5177 2003-07-14 Jim Meyering <jim@meyering.net>
5179 Don't emit diagnostics. Let callers do that.
5180 * save-cwd.c: Don't include "error.h".
5181 (save_cwd): Don't call error. Ensure that errno is valid
5182 when returning nonzero.
5184 * save-cwd.h (restore_cwd): Update prototype.
5185 * save-cwd.c (restore_cwd): Remove two parameters.
5186 Simplify. Don't call error upon failure. Let callers do that.
5187 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
5188 when auditing is enabled. But don't bother updating the #if.
5190 2003-07-14 Simon Josefsson <jas@extundo.com>
5192 * mempcpy.h: New file.
5193 * mempcpy.c: New file.
5195 2003-07-14 Paul Eggert <eggert@twinsun.com>
5197 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
5198 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
5199 unicodeio.c, unicodeio.h, unlocked-io.h:
5200 Switch from LGPL to GPL.
5202 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
5204 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
5205 it breaks C++ compilation.
5206 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
5208 2003-07-10 Jim Meyering <jim@meyering.net>
5210 * vasnprintf.c: Remove trailing blanks.
5211 Make cpp indentation consistent.
5213 2003-07-09 Paul Eggert <eggert@twinsun.com>
5215 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
5216 posixver.c, strftime.c, strnlen.c, strverscmp.c:
5217 Switch from LGPL to GPL.
5219 2003-07-07 Paul Eggert <eggert@twinsun.com>
5221 * mktime.c: Fix some boundary cases and remove need for floating point.
5223 Issue a compile-time diagnostic if time_t is floating point, or if
5224 two's complement arithmetic is not in effect, or if arithmetic
5225 right shift does not propagate the sign. These assumptions were
5226 all in the original code but they weren't checked.
5228 (TIME_T_MIDPOINT, verify): New macros.
5229 (__isleap): Remove; it has integer overflow problems.
5230 (leapyear): New function, without those problems.
5231 (ydhms_tm_diff): Remove; splitting into two parts.
5232 (ydhms_diff): New function, containing the arithmetic part of
5233 the old ydhms_tm_diff function. Issue a compile-time
5234 diagnostic if we are not using C99 integer division.
5235 Avoid casts when possible.
5236 (guess_time_tm): New function, containing the checking part of
5237 the old ydhms_tm_diff function. Return the new value, rather than
5238 the difference between it and the old. Accept a new argument T
5239 so that *T specifies the old value. Check for overflow in the result.
5241 (__mktime_internal): Use a time_t offset, not a long int offset.
5242 This undoes the 2003-06-04 change, which is no longer needed now
5243 that we have better overflow checking.
5244 (localtime_offset): Likewise.
5246 (__mktime_internal): Avoid harmful overflow on hosts where time_t
5247 and long are 64-bit but int is only 32-bit.
5248 (ydhms_diff): Use long int to store year1 and yday1.
5249 Issue a compile-time diagnostic if long int is not wide enough.
5251 (__mktime_internal): Use long int to store adjusted year and yday.
5252 Use plain C rather than preprocessor commands, if that doesn't
5254 Check for overflow (and try to repair) after each probe
5255 rather than checking only at the very end. This avoids some bugs
5256 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
5257 does not equal GMT offset at maximum time).
5258 Use integer to check for overflow rather than floating point; this
5259 is more portable to non-IEEE hosts, and is a tad faster.
5260 When we detect that we are oscillating between two values,
5261 don't check whether tm_isdst has the requested value, since
5262 we already know the answer. When tm_isdst has the wrong value,
5263 use a different heuristic to find the right one, based on the
5264 extreme values actually observed in practice in tz2003a,
5265 rather than the (overly optimistic) "previous 3 calendar quarters".
5267 (not_equal_tm, print_tm, check_result): Use "const T" rather than
5268 "T const" to accommodate glibc style.
5269 (check_result): Use less-confusing report format. "long" -> "long int.
5271 Don't loop if the iteration overflows time_t.
5272 Allow a negative step in the iteration.
5274 2003-07-01 Paul Eggert <eggert@twinsun.com>
5276 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5277 having it depend on HAVE_SYS_TYPES_H.
5279 2003-06-25 Bruno Haible <bruno@clisp.org>
5281 * readlink.c: New file.
5283 2003-06-20 Bruno Haible <bruno@clisp.org>
5285 Assume C89, so PARAMS isn't needed.
5286 * unicodeio.h (PARAMS): Remove.
5287 * unicodeio.c: Don't use PARAMS.
5289 2003-06-18 Jim Meyering <jim@meyering.net>
5291 Merge changes from coreutils.
5292 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5293 Remove explicit declarations of xmalloc and realloc.
5295 (read_utmp): Remove anachronistic cast of xmalloc.
5297 2003-06-17 Paul Eggert <eggert@twinsun.com>
5299 Assume C89, so PARAMS isn't needed.
5300 * backupfile.h (PARAMS): Remove. All uses removed.
5301 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5302 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5303 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5304 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5305 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5306 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5307 xstrtol.h: Likewise.
5308 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
5309 same.h, strverscmp.h: Do not include config.h; no longer needed.
5310 Anyway, config.h should always be included before any other file.
5312 2003-06-11 Simon Josefsson <jas@extundo.com>
5314 * sysexit_.h: New file.
5316 2003-05-20 Derek Price <derek@ximbiot.com>
5318 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5320 2003-06-10 Simon Josefsson <jas@extundo.com>
5322 * strchrnul.h: New file.
5323 * strchrnul.c: New file.
5325 2003-06-10 Simon Josefsson <jas@extundo.com>
5327 * argp.h: New file, from glibc.
5328 * argp-ba.c: New file, from glibc.
5329 * argp-eexst.c: New file, from glibc.
5330 * argp-fmtstream.c: New file, from glibc.
5331 * argp-fmtstream.h: New file, from glibc.
5332 * argp-fs-xinl.c: New file, from glibc.
5333 * argp-help.c: New file, from glibc.
5334 * argp-namefrob.h: New file, from glibc.
5335 * argp-parse.c: New file, from glibc.
5336 * argp-pv.c: New file, from glibc.
5337 * argp-pvh.c: New file, from glibc.
5338 * argp-xinl.c: New file, from glibc.
5340 2003-06-07 Jim Meyering <jim@meyering.net>
5342 * readtokens.h: Put `Free Software Foundation, Inc.'
5343 in place of my name in the copyright comment.
5344 Remove definition and uses of __P.
5347 * stat.c: Don't declare xmalloc explicitly.
5348 Instead, include "xalloc.h".
5349 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
5350 xrealloc, and xcalloc return values.
5351 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
5353 * xgetcwd.h: Remove definition/uses of PARAMS.
5355 2003-06-06 Jim Meyering <jim@meyering.net>
5357 * stdbool_.h: Renamed from stdbool.h.in.
5359 2003-06-06 Jim Meyering <jim@meyering.net>
5361 Merge from coreutils.
5362 * same.c: (same_name): Declare *_basename locals to be `const'.
5363 Consolidate declarations and initializations of *_base* locals.
5365 Merge from coreutils.
5366 This avoids a core dump on systems without GNU putenv,
5367 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5368 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5369 (unsetenv): New static function, from GNU libc.
5370 (rpl_putenv): Use it.
5372 * modechange.c: Remove trailing blanks.
5374 Merge from coreutils.
5375 * fsusage.c: Remove declaration of statfs.
5376 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5378 * posixtm.c: Include <stdbool.h> unconditionally.
5380 2003-06-05 Paul Eggert <eggert@twinsun.com>
5382 * mktime.c (__mktime_internal): When resolving a tm_isdst
5383 mismatch, look in future quarters as well as past. This fixes a
5384 bug when processing fall-backwards gaps immediately after a long
5385 period of daylight-saving time.
5387 * mktime.c: Assume freestanding C89 or better.
5388 (HAVE_LIMITS_H): Remove. Assume it's 1.
5389 (__P): Remove; not used.
5390 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5391 (mktime, not_equal_tm, print_tm, check_result,
5392 main): Use prototypes. Use const * where appropriate.
5393 (main): Fix typo in testing code that uncovered by above changes.
5394 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5396 2003-06-04 Paul Eggert <eggert@twinsun.com>
5398 * mktime.c: Fix Debian bug 177940
5399 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
5400 (localtime_offset): Now long int, not time_t, because we want it
5401 to be guaranteed to be signed. All uses changed.
5402 (__mktime_internal): If overflow would occur when adding offset,
5405 Merge 'human' changes from coreutils. Rewrite to support
5406 locale-specific notations like thousands separators.
5407 * human.c: Simplify authorship notice.
5408 Include human.h immediately after config.h.
5409 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
5410 <limits.h>: Do not include, since human.h does.
5411 (SIZE_MAX, UINTMAX_MAX): New macros.
5412 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
5413 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
5414 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
5415 (power_letter): Renamed from suffixes.
5416 (generate_suffix_backwards): Remove.
5417 (adjust_value): Now takes int style (because of human.h changes)
5418 and long double value (for greater precision on some platforms).
5419 (group_number): New function.
5420 (human_readable): Use it. Use integer options, not enum.
5421 Put the options before the sizes in the arg list.
5422 Support all the new options.
5423 The old human_readable function has been removed;
5424 use inttostr.h instead.
5425 (human_readable, default_block_size, humblock):
5426 Use uintmax_t, not int, for block sizes.
5427 (human_readable_inexact, block_size_types): Remove.
5428 (block_size_opts): New constant.
5429 (human_options): Renamed from human_block_size, with new signature
5430 that allows block sizes up to UINTMAX_MAX. All callers changed.
5431 * human.h: Add copyright and authorship notice.
5432 Include <limits.h> and <stdbool.h> unconditionally.
5433 (PARAMS): Remove. All uses removed.
5434 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
5435 (enum human_inexact_style): Remove tag; now a nameless enum.
5436 (human_floor, human_ceiling, human_round_to_even): Now have
5437 values 2, 0, 1 rather than -1, 1, 0.
5438 (human_group_digits, human_suppress_point_zero, human_autoscale,
5439 human_base_1024, human_SI, human_B): New constants.
5440 (human_readable_inexact, human_block_size): Remove.
5441 (human_readable): Size args are now uintmax_t, not int.
5442 (human_options): New decl.
5444 * exclude.c: (new_exclude, add_exclude): Remove casts that are
5445 unnecessary now that we assume C89 or better. This change
5446 imported from coreutils.
5448 * mktime.c (__mktime_internal): Do not reject negative timestamps
5449 arbitrarily. This is the same patch as 2003-05-28, but it got lost
5450 in the 2003-05-30 sync from glibc.
5452 .h files should stand alone, but we shouldn't include <sys/types.h>
5453 if we can get away with just <stddef.h>.
5455 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
5456 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
5457 rather than <sys/types.h>, as we merely need size_t.
5458 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
5460 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
5461 Include <stdio.h>, to get FILE.
5462 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
5463 memcasecmp.h has included <stddef.h> and all we need is size_t.
5464 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5465 our interface, instead of including <sys/types.h>
5467 2003-06-02 Paul Eggert <eggert@twinsun.com>
5470 Fix some minor time-related bugs with POSIX time arguments.
5471 Some valid time stamps were being rejected (notably -1, and
5472 time stamps before 1900 on 64-bit hosts). And some invalid
5473 time stamps were being accepted, e.g. September 31.
5475 * posixtm.h (posixtime): Return bool instead of time_t, so
5476 that we can return (time_t) -1 successfully.
5477 * posixtm.c: Likewise.
5478 [HAVE_STDBOOL_H]: Include <stdbool.h>.
5479 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
5480 (t): Remove static var.
5481 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
5482 of static var. All uses changed.
5483 (year): Do not reject years before 1900; they can occur with
5485 (posix_time_parse): Do not check for out-of-range components;
5486 that is now the caller's responsibility, since our checks were
5487 only approximations.
5488 (posixtime): Use mktime to check for out-of-range components,
5489 since it knows them exactly.
5490 If mktime returns (time_t) -1, check whether an error actually occurred
5491 by invoking localtime on -1.
5492 (main) [TEST_POSIXTIME]: Check for input data errors, and report
5493 posixtime failures better.
5494 Improve the test data (in comments only).
5496 2003-05-30 <karl@gnu.org>
5498 * mktime.c: update from libc.
5500 2003-05-30 Bruno Haible <bruno@clisp.org>
5502 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
5503 * localcharset.h: Likewise.
5504 * localcharset.c: Likewise.
5506 2003-05-28 Paul Eggert <eggert@twinsun.com>
5508 Assume the headers required for C89 freestanding compilers.
5509 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
5510 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
5511 without checking for HAVE_LIMITS_H.
5512 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
5513 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
5515 * fatal.c: Include <stdarg.h> without checking for __STDC__.
5516 * exclude.c: Include <stdbool.h> unconditionally.
5517 * tempname.c: Include <stddef.h> unconditionally.
5518 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
5519 * modechange.c, rpmatch.c (NULL): Don't define, since
5520 <stddef.h> does that.
5521 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
5522 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
5523 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
5524 * xstrtol.c: Likewise.
5525 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
5526 * savedir.c: Include <stddef.h> instead of defining NULL.
5528 * addext.c (addext): Use assignment rather than cast, to avoid
5529 warnings on some platforms.
5531 * mktime.c (__mktime_internal): Do not reject negative timestamps
5534 2003-05-10 Bruno Haible <bruno@clisp.org>
5536 * linebreak.c (iconv_string_length): Don't return -1 just because the
5537 string is longer than 4 KB.
5539 2003-05-12 Jim Meyering <jim@meyering.net>
5541 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
5542 the space-padded-by-default conversion specifiers, %e, %k, %l.
5544 2003-05-03 Bruno Haible <bruno@clisp.org>
5546 Upgrade to Unicode-4.0.
5547 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
5548 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
5549 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
5550 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
5551 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
5552 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
5553 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
5554 Change width of U+E0100..U+E01EF from 1 to 0.
5556 2003-04-25 Bruno Haible <bruno@clisp.org>
5558 * copy-file.c: Include <stddef.h>, for size_t.
5560 2003-04-25 Jim Meyering <jim@meyering.net>
5562 * copy-file.c (copy_file_preserving): Declare buf_size to be
5563 of type size_t, not int.
5565 2003-04-11 Jim Meyering <jim@meyering.net>
5567 Merge changes from Coreutils.
5569 2003-03-22 Jim Meyering <jim@meyering.net>
5571 * strftime.c (widen): Cast alloca return value to proper type.
5573 2003-01-19 Ulrich Drepper <drepper@redhat.com>
5576 * strftime.c (my_strftime): Handle very large width
5577 specifications for numeric values correctly. Improve checks for
5580 2003-01-19 Jim Meyering <jim@meyering.net>
5582 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
5583 (nl_get_alt_digit) [! defined my_strftime]: Define.
5584 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
5585 _nl_get_alt_digit and _nl_get_walt_digit.
5587 * strftime.c (my_strftime): Merge in locale-related changes from libc.
5588 These changes have no effect outside of _LIBC.
5590 2003-04-10 Bruno Haible <bruno@clisp.org>
5592 * findprog.h: New file, from GNU gettext.
5593 * findprog.c: New file, from GNU gettext.
5595 2003-04-05 Jim Meyering <jim@meyering.net>
5597 Merge changes from Coreutils.
5599 * exclude.h (PARAMS): Remove definition and uses.
5600 * exclude.c: Remove uses of `PARAMS'.
5602 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
5603 Add test-cases for DOS filenames. Declare program_name.
5604 (main): Set up program_name. Patch by Rich Dawe.
5606 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5608 Use mntctl's return value to drive the entry-processing loop, since
5609 we can't rely on the value of the vmt_length member in the last
5610 entry. On some systems doing so could result in exhausting
5611 virtual memory. Based in part on a patch from Mike Jetzer.
5613 2003-04-04 Bruno Haible <bruno@clisp.org>
5615 * linebreak.h: New file, from GNU gettext.
5616 * linebreak.c: New file, from GNU gettext with slight modifications.
5617 * lbrkprop.h: New file, from GNU gettext.
5619 2003-04-03 Bruno Haible <bruno@clisp.org>
5621 * utf8-ucs4.h: New file, from GNU gettext.
5622 * utf16-ucs4.h: New file, from GNU gettext.
5623 * ucs4-utf8.h: New file, from GNU gettext.
5624 * ucs4-utf16.h: New file, from GNU gettext.
5626 2003-04-02 Bruno Haible <bruno@clisp.org>
5628 * binary-io.h: New file, from GNU gettext.
5630 2003-04-01 Bruno Haible <bruno@clisp.org>
5632 * pathname.h: New file, from GNU gettext.
5633 * concatpath.c: New file, from GNU gettext.
5635 2003-03-30 Bruno Haible <bruno@clisp.org>
5637 * copy-file.c (copy_file_preserving): Don't set owner if the function
5638 chown() doesn't exist.
5640 2003-03-28 Bruno Haible <bruno@clisp.org>
5642 * copy-file.h: New file, from GNU gettext.
5643 * copy-file.c: New file, from GNU gettext.
5645 2003-03-18 Jim Meyering <jim@meyering.net>
5647 * quote.c (quote_n): Fix typo in comment.
5649 2003-03-14 Jim Meyering <jim@meyering.net>
5651 Merge changes from Coreutils.
5652 * obstack.h (obstack_object_size): Declare temporary, __o,
5653 to be const, in order to avoid warnings.
5654 (obstack_room): Likewise.
5655 (obstack_empty_p): Likewise.
5657 2003-03-13 Paul Eggert <eggert@twinsun.com>
5659 Merge changes from Bison.
5660 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
5661 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5662 when compiling Bison 1.875's `bitset bset = obstack_alloc
5663 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
5664 * hash.c: Include <stdbool.h> unconditionally.
5666 2003-03-09 Paul Eggert <eggert@twinsun.com>
5668 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
5669 Reported by Bruce Becker; see:
5670 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
5672 2003-03-03 Paul Eggert <eggert@twinsun.com>
5673 Bruno Haible <bruno@clisp.org>
5675 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
5676 Reported by John Hughes, see
5677 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
5679 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
5681 * poll_.h: New file.
5684 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
5686 * mathl.h: New file.
5687 * acosl.c: New file.
5688 * asinl.c: New file.
5689 * atanl.c: New file.
5690 * ceill.c: New file.
5693 * floorl.c: New file.
5694 * frexpl.c: New file.
5695 * ldexpl.c: New file.
5697 * sincosl.c: New file.
5699 * sqrtl.c: New file.
5701 * trigl.c: New file.
5702 * trigl.h: New file.
5704 2003-02-17 Bruno Haible <bruno@clisp.org>
5706 * mkdtemp.h: New file, from GNU gettext.
5707 * mkdtemp.c: New file, from GNU gettext.
5709 2003-01-31 Bruno Haible <bruno@clisp.org>
5711 * rename.c: #undef rename before defining rpl_rename.
5712 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
5714 2003-01-30 Bruno Haible <bruno@clisp.org>
5716 * printf-args.h: New file, from GNU gettext.
5717 * printf-args.c: New file, from GNU gettext.
5718 * printf-parse.h: New file, from GNU gettext.
5719 * printf-parse.c: New file, from GNU gettext.
5720 * vasnprintf.h: New file, from GNU gettext.
5721 * vasnprintf.c: New file, from GNU gettext.
5722 * asnprintf.c: New file, from GNU gettext.
5723 * vasprintf.h: New file, from GNU gettext with modifications.
5724 * vasprintf.c: New file, from GNU gettext.
5725 * asprintf.c: New file, from GNU gettext.
5727 2003-01-29 Bruno Haible <bruno@clisp.org>
5729 * stpncpy.h: New file, from GNU gettext with modifications.
5730 * stpncpy.c: New file, from GNU gettext with modifications.
5732 2003-01-28 Bruno Haible <bruno@clisp.org>
5734 * c-ctype.h: New file, from GNU gettext, with changes suggested by
5736 * c-ctype.c: New file, from GNU gettext, with changes suggested by
5739 2003-01-27 Bruno Haible <bruno@clisp.org>
5741 * xsetenv.h: New file, from GNU gettext.
5742 * xsetenv.c: New file, from GNU gettext.
5744 2003-01-23 Bruno Haible <bruno@clisp.org>
5746 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
5748 2003-01-22 Bruno Haible <bruno@clisp.org>
5750 * exit.h: New file, from GNU gettext.
5752 2003-01-11 Bruno Haible <bruno@clisp.org>
5754 * stpcpy.h (stpcpy): Use ANSI C function declarations.
5755 * strcase.h (strcasecmp, strncasecmp): Likewise.
5757 2003-01-14 Jim Meyering <jim@meyering.net>
5759 * same.c (same_name): Tweak a comment.
5761 2003-01-11 Bruno Haible <bruno@clisp.org>
5763 * same.c (same_name): Reorder tests so as to avoid calling stat()
5764 when a string comparison is sufficient.
5766 2003-01-11 Bruno Haible <bruno@clisp.org>
5768 * readtokens.c (readtoken): Cast character to 'unsigned char', not
5771 2003-01-11 Bruno Haible <bruno@clisp.org>
5773 * hash-pjw.c: Add comment about low quality of this function.
5775 2003-01-12 Paul Eggert <eggert@twinsun.com>
5777 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
5778 to avoid collisions with libcurses and libreadline.
5780 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
5781 * getstr.h, getstr.c: Remove.
5782 * getline.c: Include "getline.h", to check interface.
5783 Move body of old getstr.c here: this defines MIN_CHUNK and
5784 declares getdelim2, which is renamed from getstr.
5785 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
5787 * linebuffer.c (readlinebuffer): Renamed from readline.
5789 * linebuffer.h: Likewise.
5790 (readline): Remove backward-compatibility macro.
5792 2003-01-12 Jim Meyering <jim@meyering.net>
5794 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
5796 2003-01-10 Bruno Haible <bruno@clisp.org>
5798 * alloca_.h: New file.
5799 * getdate.y: Unconditionally include alloca.h.
5800 * makepath.c: Likewise.
5801 * setenv.c: Likewise.
5802 * userspec.c: Likewise.
5804 2003-01-09 Bruno Haible <bruno@clisp.org>
5806 * stdbool.h.in: New file.
5808 2003-01-08 Bruno Haible <bruno@clisp.org>
5810 * safe-read.c: Include specification header first, to ensure its
5812 * full-write.c: Likewise.
5814 2003-01-08 Jim Meyering <jim@meyering.net>
5816 * full-write.c: Undefine and define-away `const' after inclusion
5817 of errno.h, not before. Suggestion from Bruno Haible.
5819 2003-01-07 Jim Meyering <jim@meyering.net>
5821 * full-write.c: Rework so that it may serve to define full_read, too.
5822 * full-read.c: Simply #define FULL_READ and include full-write.c.
5824 2003-01-06 Jim Meyering <jim@meyering.net>
5826 * version-etc.c: Update year in translatable copyright string.
5828 2002-12-25 Bruno Haible <bruno@clisp.org>
5830 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
5831 * xstrtol.h: Likewise.
5832 * xstrtoimax.c: Likewise.
5833 * xstrtoumax.c: Likewise.
5834 * human.h: Likewise.
5836 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
5837 on systems that have <inttypes.h> but not <stdint.h>.
5839 2002-12-31 Paul Eggert <eggert@twinsun.com>
5841 * memcoll.c (memcoll): Fall back on a simple algorithm using
5842 memcmp if strcoll doesn't work.
5844 2002-12-23 Bruno Haible <bruno@clisp.org>
5846 * localcharset.h: New file.
5847 * localcharset.c: Include it.
5848 * unicodeio.c: Likewise.
5850 2002-12-22 Bruno Haible <bruno@clisp.org>
5852 * utime.c (utime_null): No need to call ftruncate if the file was
5855 2002-12-23 Bruno Haible <bruno@clisp.org>
5857 * memcoll.c (STRCOLL): New macro.
5860 2002-12-22 Bruno Haible <bruno@clisp.org>
5862 * getstr.h (getstr): Define, to avoid clash with libcurses.
5863 * linebuffer.h (readline): Define, to avoid clash with libreadline.
5865 2002-12-22 Bruno Haible <bruno@clisp.org>
5867 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
5869 2002-12-23 Bruno Haible <bruno@clisp.org>
5871 * getline.h: Include <stddef.h>, for size_t.
5873 * unicodeio.h: Include <stddef.h>, for size_t.
5874 * unicodeio.c: Don't include <stddef.h>.
5876 2002-12-17 Bruno Haible <bruno@clisp.org>
5878 * canon-host.c (strdup): Remove unused declaration.
5880 * fsusage.c: Include full_read.h.
5881 (get_fs_usage): Use full_read instead of safe_read.
5883 * utime.c (utime_null): Use SAFE_READ_ERROR.
5885 2002-12-11 Bruno Haible <bruno@clisp.org>
5887 * setenv.h: Rewritten to cope with systems that have setenv() but not
5889 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
5892 2002-12-11 Bruno Haible <bruno@clisp.org>
5894 * setenv.c (alloca): Fall back to malloc.
5896 (setenv): Use freea() to free memory allocated with alloca().
5898 2002-11-13 Bruno Haible <bruno@clisp.org>
5900 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
5901 function declarations.
5902 * unsetenv.c (unsetenv): Likewise.
5904 2002-03-04 Bruno Haible <bruno@clisp.org>
5906 Portability to AIX 4.3.3.
5907 * unsetenv.c: New file, extracted from setenv.c.
5908 * setenv.c: Move the unsetenv() function to unsetenv.c.
5910 2001-12-20 Bruno Haible <bruno@clisp.org>
5912 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
5913 use malloc instead. For SunOS 4.
5915 2001-12-11 Bruno Haible <bruno@clisp.org>
5917 * setenv.c: Declare alloca.
5918 (compar_fn_t): New typedef.
5919 (KNOWN_VALUE, STORE_VALUE): Use it.
5921 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
5924 2002-12-10 Paul Eggert <eggert@twinsun.com>
5926 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
5927 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
5928 Choose values that are less likely to collide with system fnmatch
5930 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
5931 defined (e.g., a pure POSIX system).
5932 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
5933 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
5935 2002-12-06 Jim Meyering <jim@meyering.net>
5937 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
5939 Merge in changes from libc's misc/error.c, in preparation
5940 for the merge of gnulib's changes back into libc.
5942 * error.c (_): Define only if not already defined.
5943 Move definition to follow all #include directives.
5944 Include unlocked-io.h only if !_LIBC.
5945 [_LIBC]: Include <libio/libioP.h>.
5946 [USE_IN_LIBIO]: Include <libio/iolibio.h>
5947 (fflush): Tweak definition to use INTUSE.
5950 2002-12-05 Paul Eggert <eggert@twinsun.com>
5952 * alloca.c [defined emacs]: Include "lisp.h".
5953 (xalloc_die) [defined emacs]: New macro.
5954 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
5955 [! defined emacs]: Include <xalloc.h>.
5956 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
5957 (pointer): Typedef to POINTER_TYPE *.
5958 (malloc): Remove decl; we now always use xmalloc.
5959 (alloca): Use old-style definition, since Emacs needs this.
5960 Check for arithmetic overflow when computing combined size.
5962 2002-12-04 Paul Eggert <eggert@twinsun.com>
5964 Do not generate unlocked-io.h automatically, since it's easier to
5965 maintain it by hand.
5967 * unlocked-io.h: New file, from GNU diffutils,
5968 but with proper copyright notice and attribution.
5970 * Makefile.am: Add copyright notice.
5971 (libfetish_a_SOURCES): Add unlocked-io.h.
5972 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
5973 (DISTCLEANFILES, io_functions): Remove macros.
5974 (EXTRA_DIST): Remove gen_uio.
5975 (unlocked-io.h): Remove rule.
5977 2002-12-04 Jim Meyering <jim@meyering.net>
5979 Reflect the fact that stat.c and lstat.c are no longer generated.
5980 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
5981 (DISTCLEANFILES): Likewise.
5982 (EXTRA_DIST): Likewise.
5983 (all_local): Don't depend on stat.c or lstat.c.
5984 (stat.c, lstat.c): Remove rules.
5985 (EXTRA_DIST): Remove xstat.in.
5987 * xstat.in: Remove file. Contents moved into stat.c.
5988 * stat.c: New file. Contents mostly from xstat.in.
5989 * stat.c: Rework so that it may serve to define rpl_lstat, too.
5990 * lstat.c: New file. Simply #define LSTAT and include stat.c.
5992 * safe-read.c: Rework so that it may serve to define safe_write, too.
5993 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
5995 2002-12-03 Jim Meyering <jim@meyering.net>
5997 * safe-read.c, safe-write.c: Change variable names and comments, but
5998 not semantics, to minimize the differences between these two files.
5999 (safe_read): Change comment to mention SAFE_READ_ERROR.
6001 * safe-read.c (IS_EINTR): Define.
6002 (safe_read): Use IS_EINTR in place of in-function cpp directives.
6004 2002-12-02 Bruno Haible <bruno@clisp.org>
6006 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
6007 Define, taken from safe-read.c.
6008 (INT_MAX): Provide fallback.
6009 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
6010 * safe-write.h (SAFE_WRITE_ERROR): Define.
6012 * safe-read.c (EINTR): Remove definition.
6013 (safe_read): Don't use EINTR if it is absent.
6015 2002-12-02 Jim Meyering <jim@meyering.net>
6017 * safe-read.c (EINTR): Define.
6018 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6019 (INT_MAX): Provide fallback.
6020 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
6022 * safe-read.h (SAFE_READ_ERROR): Define.
6024 2002-12-01 Jim Meyering <jim@meyering.net>
6026 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
6027 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
6029 2002-11-27 Paul Eggert <eggert@twinsun.com>
6031 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6032 hash_rehash): Replace `if (limit <= value) abort ();' with
6033 `if (! (value < limit)) abort ();', for readability.
6035 2002-11-26 <karl@gnu.org>
6037 * strdup.c: copy from libc again, with jim's ok.
6038 * .cppi-disable: re-add strdup.c
6040 2002-11-25 <karl@gnu.org>
6042 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
6043 instead of "strtol.c".
6045 2002-11-25 Jim Meyering <jim@meyering.net>
6047 * mktime.c: Sync from libc, now that it has the latest fix.
6049 2002-11-24 <karl@gnu.org>
6051 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
6052 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
6054 2002-11-24 Jim Meyering <jim@meyering.net>
6056 Update from coreutils:
6058 * mktime.c: Merge in changes from libc.
6060 Avoid a link-time failure on some Linux systems.
6061 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
6062 (__mon_yday): Declare with the STATIC attribute.
6063 (__mktime_internal): Likewise.
6064 Based on a report from Greg Schafer.
6066 2002-11-23 Jim Meyering <jim@meyering.net>
6068 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
6069 Use `unsigned', not `int', as type of index.
6071 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
6073 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
6075 2002-11-22 Paul Eggert <eggert@twinsun.com>
6077 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
6078 hint that one should use `if (! x) abort ();' rather than `assert
6079 (x);', and anyway it's one less thing to worry about configuring.
6080 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6081 hash_rehash, hash_insert): Use abort rather than assert.
6083 2002-11-22 Paul Eggert <eggert@twinsun.com>
6085 * quotearg.h: Allow multiple inclusion by surrounding with
6086 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
6087 so that we can be included first.
6088 (PARAMS): Remove; we now assume C89 or later. All uses removed.
6089 * quotearg.c: Include quotearg.h immediately after config.h.
6090 No need to include stddef.h or sys/types.h any more.
6091 Surround local include files with "", not "<>".
6092 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
6093 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
6094 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
6095 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
6096 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
6097 (ISPRINT): Remove; no longer needed now that we assume C89.
6099 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
6102 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
6103 quotearg_char): Use SIZE_MAX rather than
6104 (size_t) -1 when we are talking about "infinity".
6106 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
6108 2002-11-22 Bruno Haible <bruno@clisp.org>
6110 * safe-read.h: Assume C89. Add comments.
6111 (safe_read): Change return type to size_t.
6112 * safe-read.c (safe_read): Change return type to size_t. Handle byte
6113 counts > SSIZE_MAX correctly.
6114 * safe-write.h: New file.
6115 * safe-write.c: New file.
6116 * full-read.h: New file.
6117 * full-read.c: New file.
6118 * full-write.h: Assume C89. Add comments.
6119 * full-write.c: Include safe-write.h.
6120 (full_write): Rewritten to use safe_write.
6121 Suggested by Jim Meyering and Paul Eggert.
6123 2002-11-21 Bruno Haible <bruno@clisp.org>
6125 Remove case insensitive option matching.
6126 * argmatch.h (argcasematch): Remove declaration.
6127 (ARGCASEMATCH): Remove macro.
6128 (__xargmatch_internal): Remove case_sensitive argument.
6129 (XARGMATCH): Update.
6130 (XARGCASEMATCH): Remove macro.
6131 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
6132 case_sensitive argument.
6133 (argcasematch): Remove function.
6134 (__xargmatch_internal): Remove case_sensitive argument.
6135 (main): Use XARGMATCH instead of XARGCASEMATCH.
6137 * xmalloc.c: Change compile-time error message. Add comment about
6138 required autoconf version.
6140 2002-11-21 Jim Meyering <jim@meyering.net>
6142 * strdup.c (strdup): Tweak comment and initial #if/#include.
6144 Merge in changes from the coreutils.
6146 2002-09-25 Paul Eggert <eggert@twinsun.com>
6147 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
6148 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
6149 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
6150 int. Work more efficiently if X is the same width as uintmax_t.
6151 Do not compare X to -1, to avoid bogus compiler warning.
6152 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
6153 Don't assume that f_frsize and f_bsize are the same type.
6155 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
6158 * makepath.c (make_path): Restore umask *before* creating the final
6160 (make_path): Minor reformatting.
6162 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
6163 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
6165 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
6166 ones. At least on GNU/Linux systems, `auto' means something else.
6169 2002-11-20 Paul Eggert <eggert@twinsun.com>
6171 Merge argmatch cleanups from Bison. Assume C89.
6173 * argmatch.c: Include config.h here, not in argmatch.h.
6174 Include stdlib.h, for EXIT_FAILURE.
6175 Always include <string.h>, since we assume C89.
6176 (EXIT_FAILURE): Remove pre-C89 bug workaround.
6177 * argmatch.h: Do not include <config.h> or <sys/types.h>.
6178 Include <stddef.h> instead, since it's all we need for size_t.
6179 (PARAMS): Remove. All uses removed.
6180 (ARRAY_CARDINALITY): Do not bother to #undef.
6181 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
6182 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6183 Remove unnecessary parentheses.
6184 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6185 Insert necessary parentheses.
6186 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
6187 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
6189 2002-11-19 Bruno Haible <bruno@clisp.org>
6191 * mbswidth.c: Include mbswidth.h right at the beginning.
6192 * mbswidth.h: Include <stddef.h>, for size_t.
6194 * mbswidth.h (PARAMS): Remove macro.
6195 (mbswidth, mbsnwidth): Use ANSI C function declarations.
6196 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
6198 * gcd.h (PARAMS): Remove macro.
6199 (gcd): Use ANSI C function declarations.
6200 * gcd.c (gcd): Likewise.
6202 2002-11-15 Bruno Haible <bruno@clisp.org>
6204 * strcspn.c: Include <stddef.h>.
6205 (strcspn): Use ANSI C function declaration. Change return type to
6207 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
6208 (strpbrk): Use NULL.
6209 * strpbrk.h (PARAMS): Remove macro.
6210 (strpbrk): Use ANSI C function declaration.
6211 * strstr.c: Don't include <sys/types.h>.
6212 * strstr.h (PARAMS): Remove macro.
6213 (strstr): Use ANSI C function declarations.
6215 2002-11-06 Bruno Haible <bruno@clisp.org>
6217 * gcd.h (gcd): Change argument type to 'unsigned long'.
6218 * gcd.c (gcd): Likewise.
6220 2002-11-05 Bruno Haible <bruno@clisp.org>
6222 * gcd.h: New file, from gettext-0.11.5.
6223 * gcd.c: New file, from gettext-0.11.5.
6225 2002-11-05 Bruno Haible <bruno@clisp.org>
6227 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6228 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6229 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6230 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6232 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6233 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6235 * closeout.c: Include gettext.h instead of <libintl.h>.
6236 * human.c: Include gettext.h instead of <libintl.h>.
6237 * quotearg.c: Include gettext.h instead of <libintl.h>.
6238 * rpmatch.c: Include gettext.h instead of <libintl.h>.
6239 * unicodeio.c: Include gettext.h instead of <libintl.h>.
6240 * userspec.c: Include gettext.h instead of <libintl.h>.
6241 * version-etc.c: Include gettext.h instead of <libintl.h>.
6242 * xmalloc.c: Include gettext.h instead of <libintl.h>.
6243 (textdomain): Remove definition.
6244 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
6246 * long-options.c: Remove include of <libintl.h> and definition of _.
6247 * same.c: Remove include of <libintl.h> and definition of _.
6249 2002-11-04 Bruno Haible <bruno@clisp.org>
6251 * stpcpy.h: New file, from GNU gettext-0.11.5.
6252 * strcase.h: New file, from GNU gettext-0.11.5.
6253 * strpbrk.h: New file, from GNU gettext-0.11.5.
6254 * strstr.h: New file, from GNU gettext-0.11.5.
6255 * xgetcwd.h: New file, from GNU gettext-0.11.5.
6257 2002-05-09 Bruno Haible <bruno@clisp.org>
6259 * config.charset: Update for newest glibc. Add canonical names
6260 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
6262 2002-05-09 Bruno Haible <bruno@clisp.org>
6264 * localcharset.c (get_charset_aliases): Add more Windows specific
6267 2002-05-08 Owen Taylor <otaylor@redhat.com>
6269 * config.charset: A few additions for Solaris.
6271 2001-12-05 Bruno Haible <bruno@clisp.org>
6273 * localcharset.c (locale_charset): Don't return an empty string.
6275 2001-10-23 Bruno Haible <haible@clisp.cons.org>
6277 * config.charset: msdos in uk_UA uses CP1125.
6279 2001-08-05 Bruno Haible <haible@clisp.cons.org>
6281 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
6282 * localcharset.c (locale_charset): Declare as extern "C".
6284 2002-02-15 Bruno Haible <bruno@clisp.org>
6286 * config.charset [msdosdjgpp]: For Russian, use CP866.
6288 2002-02-11 Bruno Haible <bruno@clisp.org>
6290 * config.charset: Add support for NetBSD.
6292 2002-09-25 <karl@gnu.org>
6294 * strdup.c: copy from libc/string (via ../config/srclist*).
6295 * getopt*: copy from libc/posix.
6296 * gettext.h: copy from gettext.
6297 * .cppi-disable: add strdup.c, gettext.h.
6299 2002-07-01 Jim Meyering <meyering@lucent.com>
6301 * c-stack.c: Include sys/time.h.
6302 From Volker Borchert.
6304 2002-06-11 Paul Eggert <eggert@twinsun.com>
6306 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6307 New macro. Use it uniformly instead of
6308 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6309 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6310 reported by Vin Shelton.
6312 2002-06-22 Jim Meyering <meyering@lucent.com>
6314 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6315 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6317 2002-06-22 Paul Eggert <eggert@twinsun.com>
6319 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6320 Do not assume SA_SIGINFO behavior.
6321 Bug reported by Jim Meyering on NetBSD 1.5.2.
6323 2002-06-22 Jim Meyering <meyering@lucent.com>
6325 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6327 * exitfail.c, exitfail.h: Likewise.
6328 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6330 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6332 (EXTRA_DIST): Add fnmatch_loop.c.
6333 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6335 * fnmatch_loop.c: New file, from diffutils-2.8.2.
6336 * fnmatch.c: Update from diffutils-2.8.2.
6337 * fnmatch_.h: New file. From diffutils-2.8.2.
6338 * fnmatch.h: Remove file.
6340 2002-06-18 Paul Eggert <eggert@twinsun.com>
6342 * file-type.h: Report an error if neither S_ISREG nor
6343 S_IFREG is defined, instead of using a test specific to glibc
6344 2.2. This should be safe, since POSIX requires S_ISREG and
6345 Unix Version 7 had S_IFREG. We don't need to check for
6346 <sys/types.h> since we don't use any symbols that it defines.
6348 2002-06-15 Jim Meyering <meyering@lucent.com>
6350 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6351 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6352 have been included before this file.
6354 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
6356 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6357 so that each temporary file name is unique and valid in the first
6358 8 characters, for operation under DOS.
6360 2002-06-15 Jim Meyering <meyering@lucent.com>
6362 Work even with DJGPP 2.03, which lacks support for symlinks.
6364 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6366 * lchown.c (S_ISLNK): Likewise.
6368 2002-06-14 Jim Meyering <meyering@lucent.com>
6370 * file-type.h: Use the version from diffutils-2.8.2.
6371 * file-type.c: Likewise.
6373 2002-05-27 Jim Meyering <meyering@lucent.com>
6375 Fix a problem seen only on nonconforming systems whereby ls.c's
6376 use of localtime, and then of gettimeofday would cause trouble:
6377 the localtime call used to initialize rpl_gettimeofday's save
6378 mechanism would clobber ls's current local time information so
6379 that in any long listing the first file would always be listed
6380 with date 1970-01-01. Analysis by Volker Borchert.
6382 * gettimeofday.c (localtime): Undefine.
6383 (rpl_localtime): New function.
6385 2002-05-22 Jim Meyering <meyering@lucent.com>
6387 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6388 * file-type.h: New file.
6389 * file-type.c (file_type): New file/function. Extracted from diffutils.
6391 2002-04-29 Paul Eggert <eggert@twinsun.com>
6393 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6395 2002-04-28 Paul Eggert <eggert@twinsun.com>
6397 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6398 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
6399 of 127, since 64 is the largest conceivable number for ancient
6401 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6403 2002-04-28 Jim Meyering <meyering@lucent.com>
6405 * sig2str.c (WTERMSIG): Remove definition (unused).
6407 2002-04-28 Paul Eggert <eggert@twinsun.com>
6409 * sig2str.h, sig2str.c: New files.
6410 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6412 2002-04-24 Jim Meyering <meyering@lucent.com>
6414 * gettext.h: New file, from Gettext.
6415 * Makefile.am (INCLUDES): Remove -I../intl.
6416 (libfetish_a_SOURCES): Add gettext.h.
6418 2002-04-16 Jim Meyering <meyering@lucent.com>
6420 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6421 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6422 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6424 2002-04-12 Jim Meyering <meyering@lucent.com>
6426 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6428 2002-03-10 Jim Meyering <meyering@lucent.com>
6430 * makepath.c (make_path): Remove a comma from a diagnostic.
6431 Suggestion from Santiago Vila.
6433 2002-03-08 Jim Meyering <meyering@lucent.com>
6435 * rename.c: Mention that this wrapper is needed also on
6436 mips-dec-ultrix4.4 systems.
6438 2002-03-02 Jim Meyering <meyering@lucent.com>
6440 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6441 not HAVE_CLOCK_SETTIME.
6443 2002-02-27 Paul Eggert <eggert@twinsun.com>
6445 * nanosleep.h: Rename to....
6446 * timespec.h: New name for nanosleep.h. All uses changed.
6448 * gettime.c: New file.
6449 * settime.c: New file.
6452 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6453 timespec.h. Remove nanosleep.h.
6455 2002-02-25 Paul Eggert <eggert@twinsun.com>
6457 * acl.c, acl.h: New files.
6458 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6460 2002-02-24 Jim Meyering <meyering@lucent.com>
6462 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6463 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6464 cause trouble. Reported by Nelson Beebe.
6466 2002-02-23 Paul Eggert <eggert@twinsun.com>
6468 * path-concat.c (xpath_concat): Reorder code to pacify
6469 compilers that don't know that xalloc_die never returns.
6471 2002-02-20 Jim Meyering <meyering@lucent.com>
6473 * getdate.c: Regenerate using bison-1.33.
6475 2002-02-15 Paul Eggert <eggert@twinsun.com>
6477 * posixver.c, posixver.h: New files.
6478 * Makefile.am (libfetish_a_SOURCES): Add them.
6480 2002-02-02 Paul Eggert <eggert@twinsun.com>
6481 Bruno Haible <bruno@clisp.org>
6483 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6484 (fwrite_success_callback): New declaration.
6485 * unicodeio.c (unicode_to_mb): New function, extracted from
6486 print_unicode_char. Call failure callback instead of error.
6487 (fwrite_success_callback): New function.
6488 (exit_failure_callback): New function.
6489 (fallback_failure_callback): New function.
6490 (print_unicode_char): Call unicode_to_mb.
6492 2002-01-26 Jim Meyering <meyering@lucent.com>
6494 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6496 2002-01-22 Jim Meyering <meyering@lucent.com>
6498 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6499 Otherwise, some versions of automake would omit the rule that makes
6500 Makefile from Makefile.in.
6502 2001-01-21 Paul Eggert <eggert@twinsun.com>
6504 * xmemcoll.h, xmemcoll.c: New files.
6505 * Makefile.am (libfetish_a_SOURCES): Add them.
6506 * memcoll.c: Include errno.h, and declare errno if not defined.
6507 (memcoll): Set errno to zero if there is no error.
6509 * quotearg.c (quotearg_buffer_restyled):
6510 Fix bug with quoting buffers containing NUL when backslashing escapes.
6511 This bug was exposed by the other changes in this patch.
6512 (quotearg_n_options): New arg ARGSIZE.
6513 All callers changed.
6514 (quoting_options_from_style): New function.
6515 (quotearg_n_style): Use it.
6516 (quotearg_n_style_mem): New function.
6518 * quotearg.h (quotearg_n_style_mem): New function.
6520 2002-01-16 Jim Meyering <meyering@lucent.com>
6522 * getdate.y: Add three semicolons, each just before a closing brace.
6523 Bison (as of version 1.31) no longer papers over that mistake.
6525 2002-02-14 Paul Eggert <eggert@twinsun.com>
6527 * backupfile.c (ISDIGIT): Comment fix.
6528 * getdate.y (ISDIGIT): Likewise.
6529 * posixtm.c (ISDIGIT, year): Likewise.
6530 * strverscmp.c (ISDIGIT): Likewise.
6531 * userspec.c (ISDIGIT): Likewise.
6533 2002-01-05 Jim Meyering <meyering@lucent.com>
6535 * version-etc.c (version_etc_copyright): Update copyright year.
6537 2001-01-19 Paul Eggert <eggert@twinsun.com>
6539 * closeout.c (close_stdout_status): If ferror (stdout), do
6540 not silently exit merely because the output buffer happens to
6541 have nothing pending.
6543 2001-12-18 Paul Eggert <eggert@twinsun.com>
6545 See the big note in ../ChangeLog.
6546 * human.c (suffixes): Prefer K to k for 1024.
6547 (generate_suffix_backwards): New function.
6548 (human_readable_inexact): Use it.
6549 * xstrtol.c (__xstrtol): If there is no number but there
6550 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
6551 Accept 'K' as well as 'k'.
6553 2001-12-15 Jim Meyering <meyering@lucent.com>
6555 * regex.h (__restrict_arr): Update from libc.
6557 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
6558 as `remote' if the name starts with `//'. Suggested by Michael Stone.
6561 2001-12-10 Jim Meyering <meyering@lucent.com>
6563 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
6564 Instead, include "xalloc.h".
6565 (initbuffer): Don't cast xmalloc return value to char*.
6566 (readline): Reword comment.
6567 Don't cast xrealloc return value to char*
6570 2001-12-09 Jim Meyering <meyering@lucent.com>
6572 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
6573 `signed and unsigned type in conditional expression'.
6574 * posixtm.c (posix_time_parse): Likewise.
6576 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
6578 * readtokens.c (readtoken): Declare an index to be of type unsigned
6579 to avoid a pedantic warning.
6581 * getstr.c: Don't include assert.h.
6582 (getstr): Remove warning-evoking assertions.
6583 Return -1 if offset parameter is out of bounds.
6584 Change the type of a local from int to size_t.
6586 * strftime.c (my_strftime_localtime_r): Include this function
6587 definition in the `#if ! HAVE_TM_GMTOFF' block.
6589 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
6590 Include xalloc.h instead.
6592 2001-12-02 Jim Meyering <meyering@lucent.com>
6594 * tempname.c: Don't declare getenv, thus reverting the change of
6595 2001-11-18. It's no longer necessary, now that stdlib.h is always
6598 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
6599 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
6601 2001-11-30 Akim Demaille <akim@epita.fr>
6603 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
6604 before being defined.
6606 2001-11-27 Paul Eggert <eggert@twinsun.com>
6608 * quotearg.h (quotearg_n, quotearg_n_style):
6609 First arg is int, not unsigned.
6610 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
6611 (SIZE_MAX, UINT_MAX): New macros.
6612 (quotearg_n_options): Abort if N is negative.
6613 Avoid overflow check on hosts where size_t is 64 bits and int
6614 is 32 bits, as overflow is impossible there.
6615 Fix off-by-one typo that caused unnecessary reallocation.
6617 2001-11-27 Jim Meyering <meyering@lucent.com>
6619 * tempname.c: Merge with version from libc.
6620 * regex.c: Likewise.
6622 * tempname.c: Include stdlib.h unconditionally. On some old systems
6623 for which STDC_HEADERS is 0, it was not included, resulting in a
6624 warning about an integer-to-pointer conversion problem with getenv.
6625 Reported by Volker Borchert.
6627 2001-11-26 Jim Meyering <meyering@lucent.com>
6629 * gtod.h: Remove file.
6630 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
6631 * gettimeofday.c: Don't include gtod.h.
6632 (GTOD_init): Remove function.
6633 (rpl_gettimeofday): Do its job here instead, rather than aborting.
6634 Suggestion from Volker Borchert.
6636 2001-11-23 Jim Meyering <meyering@lucent.com>
6638 * hash.h (struct hash_table): Don't define here. Merely declare it.
6639 * hash.c (struct hash_table): Define it here instead.
6641 2001-11-22 Jim Meyering <meyering@lucent.com>
6643 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
6645 2001-11-18 Paul Eggert <eggert@twinsun.com>
6647 * tempname.c (TMP_MAX): Remove; no longer needed.
6648 (TEMPORARIES): New macro.
6649 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
6650 removes an artificial limitation (e.g. HP-UX 10.20, where
6653 2001-11-18 Jim Meyering <meyering@lucent.com>
6655 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
6658 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
6659 files will be created before anything else.
6661 2001-11-17 Jim Meyering <meyering@lucent.com>
6663 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
6664 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
6665 rather than group writable. Patch by Juan F. Codagnone.
6667 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
6668 Instead, include "xalloc.h".
6670 * mountlist.c: Include unlocked-io.h after all system headers.
6671 Remove explicit declarations of xmalloc, xrealloc,
6672 and xstrdup. Instead, include "xalloc.h".
6674 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
6675 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
6676 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
6678 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
6679 Reported by Padraig Brady.
6681 * mkstemp.c: #undef mkstemp.
6683 (rpl_mkstemp): Rename from mkstemp.
6686 2001-11-16 Jim Meyering <meyering@lucent.com>
6688 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
6689 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
6690 determine the amount of total physical memory, use pstat_getstatic.
6691 HPUX-11 doesn't define _SC_PHYS_PAGES.
6692 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
6693 If sysconf couldn't be used to determine the amount of available
6694 physical memory, use both pstat_getstatic and pstat_getdynamic.
6695 Based on a patch from Bob Proulx.
6697 2001-11-05 Jim Meyering <meyering@lucent.com>
6699 * xstat.in (slash_aware_lstat): Correct a misleading comment.
6701 2001-11-03 Jim Meyering <meyering@lucent.com>
6703 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
6704 in argmatch_to_argument call.
6706 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
6709 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
6710 e.g., a fault due to an attempt to free a NULL pointer.
6712 2001-11-01 Jim Meyering <meyering@lucent.com>
6714 * dirfd.c, dirfd.h: New files.
6715 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
6717 * hash.c (hash_print) [TESTING]: Clean up.
6719 2001-10-22 Paul Eggert <eggert@twinsun.com>
6721 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
6722 to avoid a warning if -Wall.
6724 2001-10-21 Paul Eggert <eggert@twinsun.com>
6726 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
6728 2001-10-21 Jim Meyering <meyering@lucent.com>
6730 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
6731 this code would end up calling gettext even in packages built
6733 * getopt.c (_): Likewise.
6734 * regex.c (_): Likewise.
6736 2001-10-20 Paul Eggert <eggert@twinsun.com>
6738 * error.c (strerror_r): Do not declare unless !_LIBC.
6739 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
6740 Use strerror_r that is only a macro, even if it is not a function.
6741 (strerror): Check for HAVE_DECL_STRERROR before declaring.
6742 (private_strerror): Use prototypes, not old-style function definition.
6743 (print_errno_message): New function.
6744 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
6746 (error_tail, error, error_at_line): Use it.
6748 2001-10-11 Jim Meyering <meyering@lucent.com>
6750 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
6751 and quote_n (1, ... to avoid clobbering a buffer.
6753 2001-10-05 Jim Meyering <meyering@lucent.com>
6755 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
6756 * hash-pjw.c: New file (factored out of fileutils' remove.c).
6757 * hash-pjw.h: New file.
6759 2001-09-30 Jim Meyering <meyering@lucent.com>
6761 * mountlist.c [MOUNTED_GETFSSTAT]:
6762 Include <sys/ucred.h>, for Apple Darwin.
6763 Include sys/mount.h and sys/fs_types.h only if available.
6765 (read_filesystem_list): Use FS_TYPE.
6767 2001-09-29 Paul Eggert <eggert@twinsun.com>
6769 * exclude.c (excluded_filename): 0 -> false, since it's
6772 2001-09-28 Paul Eggert <eggert@twinsun.com>
6774 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
6775 #defines strtoimax. Also treat the other strto* functions
6778 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
6779 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
6780 (strtoimax, strtoumax): Do not declare if already defined as a macro.
6782 2001-09-26 Jim Meyering <meyering@lucent.com>
6784 Most macros in unlocked-io.h had the wrong number of arguments.
6785 * gen-uio: New script.
6786 (USE_UNLOCKED_IO): Define to 1 if not already defined.
6787 * unlocked-io.hin: Remove file.
6788 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
6789 rather than trying to embed it here.
6790 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
6791 Reported by Padraig Brady.
6793 2001-09-25 Volker Borchert <bt@teknon.de>
6795 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
6797 2001-09-23 Jim Meyering <meyering@lucent.com>
6799 * mountlist.c: Remove useless parentheses in #if directives.
6800 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
6801 the deprecated MOUNTED symbol is no longer defined in mntent.h.
6803 2001-09-22 Jim Meyering <meyering@lucent.com>
6805 * localcharset.c: Update from latest gettext.
6806 * config.charset: Likewise.
6808 2001-09-20 Jim Meyering <meyering@lucent.com>
6810 * xstrtol.c (strtoimax): Guard declaration with
6811 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
6812 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
6813 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
6814 (strtoumax): Likewise, for completeness (it wasn't necessary).
6816 2001-09-06 Paul Eggert <eggert@twinsun.com>
6818 * strtoimax.c (HAVE_LONG_LONG):
6819 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
6820 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
6821 to work around bug in IBM C compiler.
6823 2001-09-16 Jim Meyering <meyering@lucent.com>
6825 * mkdir.c: New file.
6827 2001-09-04 Paul Eggert <eggert@twinsun.com>
6829 * xgetcwd.c: Revert some of the previous change; intead,
6830 fix the HAVE_GETCWD_NULL code to behave more like the
6831 !HAVE_GETCWD_NULL code used to.
6834 (xgetcwd): Do not return NULL when memory is exhausted; instead,
6837 2001-09-04 Paul Eggert <eggert@twinsun.com>
6839 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
6840 Use ssize_t, not int, to store result of readlink.
6841 Check for ssize_t overflow as well as size_t overflow,
6842 as POSIX says the result of readlink is implementation-defined
6843 when ssize_t overflows.
6844 Remove unnecessary cast to char*.
6845 Use free+malloc instead of realloc, as the storage doesn't need
6846 to be preserved and it's clearer and can be more efficient that way.
6847 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
6848 * xreadlink.h (xreadlink): Update prototype.
6850 2001-09-03 Paul Eggert <eggert@twinsun.com>
6852 * exclude.c (fnmatch_no_wildcards): Fix confusion between
6853 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
6854 spotted by Jim Meyering.
6856 2001-09-03 Jim Meyering <meyering@lucent.com>
6858 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
6860 2001-09-03 Paul Eggert <eggert@twinsun.com>
6862 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
6863 like the HAVE_GETCWD_NULL code.
6864 Include pathmax.h if not HAVE_GETCWD.
6865 Do not include xalloc.h.
6866 (INITIAL_BUFFER_SIZE): New symbol.
6867 Do not use xmalloc / xrealloc, since the caller is responsible for
6868 handling errors. Preserve errno around `free' during failure.
6869 Do not overrun buffer when using getwd.
6871 2001-09-03 Paul Eggert <eggert@twinsun.com>
6873 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
6874 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
6876 2001-09-02 Jim Meyering <meyering@lucent.com>
6878 * error.c: Update from GNU libc.
6880 2001-09-01 Jim Meyering <meyering@lucent.com>
6882 * xreadlink.c: New file.
6883 * xreadlink.h: New file.
6884 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
6886 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
6887 doesn't conflict with sparc Solaris 7's definition in
6888 /usr/include/sys/int_types.h.
6890 * exclude.c: Use `""', not `<>' to #include non-system header files.
6891 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
6892 and strncasecmp as r-values. Unixware didn't have declarations.
6894 2001-08-31 Jim Meyering <meyering@lucent.com>
6896 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
6897 Use an initial, malloc'd, buffer of length 128 rather than
6898 a statically allocated one of length 1024.
6900 2001-08-30 Paul Eggert <eggert@twinsun.com>
6902 * xgetcwd.c: Don't include pathmax.h.
6903 Include stdlib.h and unistd.h if available.
6905 (xmalloc, xstrdup, free): Remove decls.
6906 (xgetcwd): Don't assume sizes fit in unsigned.
6907 Check for overflow when computing sizes.
6908 Simplify reallocation code.
6910 2001-08-28 Paul Eggert <eggert@twinsun.com>
6912 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
6914 * strtoimax.c: Renamed from strtoxmax.c, removing the
6917 Also, make the following further changes to make this file's
6918 configuration more similar to that of strtol.c:
6919 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
6920 (strtoumax, uintmax_t, strtoull, strtol): Remove.
6921 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
6922 (strtoimax): Renamed from strtoumax. All uses of unsigned values
6923 changed to signed values.
6925 And make the following changes as well:
6926 Fix copyright notice, as 1999 was missing.
6927 (verify): New macro.
6928 (strtoimax): Check sizes at compile-time, not run-time.
6929 Prefer strtol to strtoll if both work.
6930 (main): Remove; it was not that useful and was a pain to maintain.
6932 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
6934 2001-08-30 Paul Eggert <eggert@twinsun.com>
6936 * savedir.c (savedir): Remove size parameter, as POSIX says that
6937 a directory's st_size can have an arbitrary value, so the old
6938 usage could waste an arbitrary amount of memory. All uses
6940 * savedir.h: Update prototype.
6942 2001-08-30 Paul Eggert <eggert@twinsun.com>
6944 * xstrtol.c (strtoimax): New decl.
6946 2001-08-28 Paul Eggert <eggert@twinsun.com>
6948 * xstrtol.h: Add copyright notice.
6949 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
6950 LONGINT_INVALID_SUFFIX_CHAR.
6952 2001-08-30 Paul Eggert <eggert@twinsun.com>
6954 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
6957 2001-08-30 Paul Eggert <eggert@twinsun.com>
6959 * hash.c: Remove '2001' from copyright notice.
6961 2001-08-30 Paul Eggert <eggert@twinsun.com>
6963 * full-write.h: New file.
6964 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
6965 * full-write.c: Correct credits, as cccp.c no longer
6966 exists and anyway it was so heavily changed from the old cccp
6967 code as to be unrecognizable. Include full-write.h.
6968 (full_write) Return size_t, with short writes meaning failure.
6969 All callers changed. This fixes a bug with large buffers
6971 * utime.c: Include full-write.h.
6973 2001-08-30 Paul Eggert <eggert@twinsun.com>
6975 Merge 'exclude' changes from tar 1.13.22.
6976 This fixes one or two unlikely storage allocation overflow bugs,
6977 but doesn't change user-visible behavior otherwise.
6979 2001-08-30 Paul Eggert <eggert@twinsun.com>
6981 * exclude.c (bool): Declare, perhaps by including stdbool.h.
6982 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
6983 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
6984 Include if available.
6985 (<xalloc.h>): Include
6986 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
6987 (verify): New macro. Use it to verify that EXCLUDE macros do not
6988 collide with FNM macros.
6989 (struct patopts): New struct.
6990 (struct exclude): Use it, as exclude patterns now come with options.
6991 (new_exclude): Support above changes.
6992 (new_exclude, add_exclude_file):
6993 Initial size must now be a power of two to simplify overflow checking.
6994 (free_exclude, fnmatch_no_wildcards): New function.
6995 (excluded_filename): No longer requires options arg, as the options
6996 are determined by add_exclude. Now returns bool, not int.
6997 (excluded_filename, add_exclude):
6998 Add support for the fancy new exclusion options.
6999 (add_exclude, add_exclude_file): Now takes int options arg.
7000 Check for arithmetic overflow when computing sizes.
7001 (add_exclude_file): xrealloc might modify errno, so don't
7002 realloc until after errno might be used.
7004 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
7006 (free_exclude): New decl.
7007 (add_exclude, add_exclude_file): Now takes int options arg.
7008 (excluded_filename): No longer requires options arg, as the options
7009 are determined by add_exclude. Now returns bool, not int.
7011 2001-08-30 Paul Eggert <eggert@twinsun.com>
7013 * alloca.c (alloca): Arg is of type size_t, not unsigned.
7015 2001-08-27 Jim Meyering <meyering@lucent.com>
7017 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
7019 * version-etc.c (N_): Remove definition.
7020 Revert most of last change.
7021 Instead, simply don't mark the `Copyright...' string for translation.
7022 Based on advice from Paul Eggert.
7024 * strtoxmax.c: Tweak comment.
7026 2001-08-26 Jim Meyering <meyering@lucent.com>
7028 * version-etc.c (version_etc_copyright_fmt): Replace literal year
7029 of copyright with `%s' so translators don't get an untranslated
7031 (COPYRIGHT_YEAR): Define.
7032 (version_etc): Use fprintf rather than fputs.
7033 Suggestion from Ulrich Drepper.
7035 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
7037 * strtoll.c: New file, from GNU libc.
7038 * xstrtoimax.c: New file.
7040 * xstrtol.h: Add xstrtoimax.
7041 * strtoumax.c: New file. Simply include "strtoumax.c".
7042 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
7044 * strtoumax.c: Factor to work both for unsigned and signed types, ...
7045 * strtoxmax.c: ... then renamed to this.
7047 2001-08-13 Paul Eggert <eggert@twinsun.com>
7049 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
7050 Port to Solaris 8, where 'sed' requires a space after the 'r'
7051 command, and where sh dislikes "$/". Clean up the spacing a bit.
7052 Redirect output to $tmp just once.
7054 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
7056 * addext.c (<errno.h>): Include.
7057 (errno): Declare if not defined.
7058 (addext): Work correctly when pathconf returns -1 and leaves
7059 errno alone because there is no limit. Also, work even if
7060 pathconf returns a value greater than SIZE_MAX.
7062 2001-08-12 Jim Meyering <meyering@lucent.com>
7064 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
7065 Simply `return getcwd (NULL, 0);'.
7066 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
7067 Use 1300 as initial value for length, not PATH_MAX.
7069 * pathmax.h: Clean up cpp syntax.
7071 2001-08-12 Jim Meyering <meyering@lucent.com>
7073 * gettimeofday.c: New file.
7075 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
7077 2001-08-04 Jim Meyering <meyering@lucent.com>
7079 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
7080 to get in sync with glibc.
7082 2001-08-03 Paul Eggert <eggert@twinsun.com>
7084 The following changes are from gettext 0.10.39 as maintained by
7087 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
7088 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
7089 with inverted sense. All uses changed.
7091 * mbswidth.c: Don't include <limits.h>.
7092 Include <stdlib.h> and <string.h> unconditionally.
7093 (iswcntrl, mbsinit, ISCNTRL): New macros.
7094 (mbsnwidth): Use K&R style function declarations.
7095 Don't bother checking for MB_LEN_MAX == 1, since the compiler
7096 can optimize it when MB_CUR_MAX == 1.
7097 The width of control characters is zero, not 1.
7099 2001-07-15 Jim Meyering <meyering@lucent.com>
7101 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
7102 (BUILT_SOURCES): Add unlocked-io.h.
7103 (io_functions): Define.
7104 (unlocked-io.h): New rule.
7105 (DISTCLEANFILES): Add unlocked-io.h.
7106 (all-local): Depend on unlocked-io.h, to ensure it is created.
7108 * unlocked-io.hin: New file
7110 * regex.c: Update from glibc.
7112 2001-07-05 Jim Meyering <meyering@lucent.com>
7114 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
7116 (libfetish_a_SOURCES): Put all .h files here instead.
7117 Remove a thus-exposed (better checks in automake) duplicate and
7118 two unnecessary .h files.
7120 2001-06-11 Jim Meyering <meyering@lucent.com>
7122 * regex.c: Update from GNU libc.
7124 2001-05-27 Jim Meyering <meyering@lucent.com>
7126 * readutmp.h (UT_TYPE): Define.
7128 2001-05-24 Jim Meyering <meyering@lucent.com>
7130 * argmatch.c: Include "quote.h".
7131 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
7132 quote function. Reported by Göran Uddeborg.
7134 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
7136 * dirname.c (dir_name): Compute append_dot using path, not newpath
7137 which is not yet declared.
7139 2001-05-11 Paul Eggert <eggert@twinsun.com>
7141 * Makefile.am (libfetish_a_SOURCES):
7142 Add strftime.c, since we now compile it on all hosts.
7144 * strftime.c (my_strftime):
7145 Define to nstrftime if emacs, but only if my_strftime is not defined.
7146 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
7147 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
7148 Add one more extra argument: a nanoseconds value.
7151 (my_strftime function): Add %N format.
7152 (emacs_strftimeu): Renamed from emacs_strftime,
7153 with extra ut argument.
7155 2001-05-11 Paul Eggert <eggert@twinsun.com>
7157 dirname code cleanup. base_name now behaves more compatibly
7158 with POSIX basename when given file names that have trailing
7159 slashes, and similarly for dir_name. Add new primitives
7160 base_len and dir_len. Put the directory-name-related decls
7163 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
7164 * backupfile.c (base_name): Likewise.
7165 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
7166 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
7167 * makepath.c (strip_trailing_slashes): Likewise.
7168 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
7170 * rename.c (strip_trailing_slashes): Likewise.
7171 * same.c (base_name): Likewise.
7172 * stripslash.c (ISSLASH): Likewise.
7174 * addext.c: Include <dirname.h> after size_t is defined.
7175 * backupfile.c: Likewise.
7177 * addext.c (addext): Use base_len to trim redundant
7178 trailing slashes instead of doing it ourselves.
7179 But do not trim the last slash if it is not redundant.
7181 * backupfile.c (find_backup_file_name,
7182 max_backup_version): Use base_len instead of rolling it ourselves.
7183 Handle the case of "" and (on DOS) "C:" correctly.
7185 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
7186 Include <string.h>, <dirname.h>.
7187 (base_name): Allow file names ending in slashes, other than names
7188 that are all slashes. In this case, return the basename followed
7189 by the slashes. This is more general, and can be used in places
7190 where the original base_name purposely had an assertion failure.
7191 (base_len): New function.
7193 * dirname.c: Include <string.h> instead of <stdlib.h>.
7194 Do not include <assert.h>; no longer needed.
7196 (memrchr): Remove decl.
7197 (dir_name_r): Remove.
7198 (dir_len): Renamed from dirlen. All callers changed.
7199 Rewrite in terms of base_name, for simplicity and consistency.
7200 (dir_name): Never return NULL. All callers changed.
7201 Do not include <stdlib.h> in test program; no longer needed.
7202 return 0; is fine for test program.
7204 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
7206 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
7208 * path-concat.c (path_concat): Use base_len to compute
7209 base length, not strlen; this means we cannot rely on memcpy
7212 * same.c (STREQ): Remove.
7213 (same_name): Handle the case where the basename ends in trailing '/'.
7215 * stripslash.c (strip_trailing_slashes): Return nonzero if
7216 a slash was stripped. Do not strip the last slash after a
7219 2001-04-08 Jim Meyering <meyering@lucent.com>
7221 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
7222 recomputed; that's necessary when the offset spans a DST transition.
7223 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
7225 2001-04-02 Jim Meyering <meyering@lucent.com>
7227 * regex.h, regex.c: Update from GNU libc.
7229 2001-03-19 Paul Eggert <eggert@twinsun.com>
7231 * version-etc.c (version_etc_copyright): Update to 2001.
7233 2001-03-16 Paul Eggert <eggert@twinsun.com>
7235 * tempname.c (uint64_t): Define to uintmax_t if
7236 not defined, and if UINT64_MAX is not defined.
7237 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
7238 Reported by John David Anglin.
7240 2001-03-10 Bruno Haible <haible@clisp.cons.org>
7242 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
7243 alias if codeset is empty.
7244 * config.charset (BeOS): Use wildcard syntax.
7246 2001-03-13 Jim Meyering <meyering@lucent.com>
7248 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
7249 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
7252 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7254 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
7256 * unicodeio.c (print_unicode_char): Simplify accordingly.
7258 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7260 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
7261 support for DOS/DJGPP.
7263 2001-02-28 Paul Eggert <eggert@twinsun.com>
7265 * Makefile.am (libfetish_a_SOURCES):
7266 Add dup-safer.c, fopen-safer.c.
7267 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
7269 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
7271 2001-02-25 Paul Eggert <eggert@twinsun.com>
7273 The mkstemp replacement is taken from glibc 2.2.2, with some
7274 portability fixes for use outside glibc, as follows:
7276 * tempname.c (struct_stat64): New macro.
7277 (direxists, __gen_tempname): Use it.
7278 This avoids a portability problem with Solaris 8.
7280 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7281 (<stddef.h>, <stdint.h>, <string.h>):
7282 Include only if STDC_HEADERS || _LIBC.
7283 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7284 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7285 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7286 (__set_errno): Define this macro if <errno.h> doesn't.
7287 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7288 Define these macros if <stdio.h> doesn't.
7289 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7290 Define these macros if <sys/stat.h>
7291 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7292 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7293 __xstat64): Define if not _LIBC.
7294 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7295 (__gen_tempname): Invoke gettimeofday only if
7296 HAVE_GETTIMEOFDAY || _LIBC;
7297 otherwise, fall back on plain "time".
7298 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7300 * mkstemp.c (__GT_FILE): Define to zero if not defined.
7302 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7304 2001-02-17 Jim Meyering <meyering@lucent.com>
7306 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
7307 around included file name.
7309 * strnlen.c (__strnlen): Merge in a change from GNU libc.
7311 * strftime.c: Update from GNU libc (the only changes were to comments).
7313 2001-02-13 Bruno Haible <haible@clisp.cons.org>
7315 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7317 2001-02-17 Paul Eggert <eggert@twinsun.com>
7319 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7320 Remove workaround macros for hosts that have mbrtowc but not
7321 mbstate_t, as we now insist on proper declarations for both
7322 before using mbrtowc.
7324 2001-02-17 Jim Meyering <meyering@lucent.com>
7326 * regex.c: Update from libc.
7328 2001-02-16 Paul Eggert <eggert@twinsun.com>
7330 * alloca.c (malloc): Undef before defining, since stdlib.h
7331 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
7332 Reported by Mark Hounschell via Paul Eggert.
7334 2001-01-30 Bruno Haible <haible@clisp.cons.org>
7336 * config.charset: Update for FreeBSD 4.2.
7338 2001-01-26 Jim Meyering <meyering@lucent.com>
7340 * quotearg.c: Include stddef.h.
7341 * quote.c: Include stddef.h.
7342 Reported by Axel Kittenberger.
7344 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7345 line in double quotes so that it evokes a better diagnostic.
7346 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7347 Reported by Axel Kittenberger.
7349 2001-01-15 Bruno Haible <haible@clisp.cons.org>
7351 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7352 to avoid a warning. Add back 'const' to inptr.
7354 2001-01-16 Jim Meyering <meyering@lucent.com>
7356 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7359 2001-01-14 Jim Meyering <meyering@lucent.com>
7361 * rename.c: New file. From Volker Borchert.
7362 Include stdlib.h, string.h or strings.h, and xalloc.h.
7363 Use strip_trailing_slashes rather than open-coding it.
7365 2001-01-03 Paul Eggert <eggert@twinsun.com>
7367 * strftime.c: Sync with glibc time/strftime.c 1.81.
7369 2001-01-03 Jim Meyering <meyering@lucent.com>
7371 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7372 local `inptr' to avoid warning with some system declarations of iconv.
7374 2000-12-29 Paul Eggert <eggert@twinsun.com>
7376 * modechange.c: Do not assume that mode_t uses the
7377 traditional octal encoding. E.g. "chmod 1 FOO" should set
7378 the other-execute bit of FOO even if S_IXOTH != 1.
7380 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7381 WOTH, XOTH, ALLM): New macros.
7382 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7383 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7385 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7386 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7388 No need to use uintmax_t; unsigned long is long enough.
7389 Don't bother to get suffix since we don't use it.
7391 2000-12-24 Jim Meyering <meyering@lucent.com>
7393 * hash.c (is_prime): Return explicit boolean values.
7394 (hash_get_first): Return NULL to appease Irix5.6's 89.
7395 Reported by Nelson Beebe.
7397 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7399 * localcharset.c (locale_charset): Add support for Win32.
7401 2000-12-18 Paul Eggert <eggert@twinsun.com>
7403 * physmem.h, physmem.c: New files.
7405 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7406 (noinst_HEADERS): Add physmem.h.
7408 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7409 't' for compatibility with Solaris 8 sort.
7411 2000-12-18 Bruno Haible <haible@clisp.cons.org>
7413 * config.charset: Add support for BeOS.
7415 2000-12-16 Jim Meyering <meyering@lucent.com>
7417 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7418 SHELLS_FILE to a file name that's useful on djgpp systems.
7420 (ADDITIONAL_DEFAULT_SHELLS): Define.
7421 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7422 Based mostly on a patch from Prashant TR.
7424 2000-12-16 Jim Meyering <meyering@lucent.com>
7426 This bug had a serious impact on chown: `chown N:M FILE' (for integer
7427 N and M) would have treated it like `chown N:N FILE'.
7429 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7431 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7433 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7434 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7435 to the list of canonical encodings. Rename EUC-CN to GB2312.
7437 2000-12-08 Andreas Schwab <schwab@suse.de>
7439 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7440 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7442 2000-12-07 Jim Meyering <meyering@lucent.com>
7444 * stripslash.c (ISSLASH): Define.
7445 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7448 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7449 (dir_name_r): Declare this function as static.
7450 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7451 manifest itself on a name containing a mix of slashes and
7453 Make this function work with names starting with a DOS-style
7454 drive letter and colon prefix.
7455 (dir_name): Append `.' if necessary.
7456 Based mostly on patches from Prashant TR and Eli Zaretskii.
7458 * dirname.h (dir_name_r): Remove prototype.
7460 2000-12-05 Jim Meyering <meyering@lucent.com>
7462 * dirname.c (dir_name_r): Add `const' in a few local declarations.
7464 2000-12-04 Jim Meyering <meyering@lucent.com>
7466 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7467 Also include memory.h, stdlib.h, unistd.h if appropriate.
7468 Reported by Andreas Jaeger (conflicting declaration of malloc).
7470 2000-12-02 Jim Meyering <meyering@lucent.com>
7472 * closeout.h: Make idempotent, to avoid some obscure warnings.
7474 2000-12-01 Paul Eggert <eggert@twinsun.com>
7476 * memrchr.c: Include <config.h> before any system include file.
7478 2000-11-29 Paul Eggert <eggert@twinsun.com>
7480 * dirname.c (dir_name_r): Fix typo: int -> size_t.
7482 2000-11-26 Jim Meyering <meyering@lucent.com>
7484 * memcoll.c: Include sys/types.h. From Werner Almesberger.
7486 2000-11-22 Paul Eggert <eggert@twinsun.com>
7488 * strftime.c (my_strftime): Do not invoke mbrlen with a
7489 size of (size_t) -1; it's not portable.
7491 2000-11-17 Akim Demaille <akim@epita.fr>
7493 * obstack.h: Formatting changes.
7494 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7495 prevent type checking.
7496 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7497 cast the value to (void *): assigning a `foo *' to a `void *'
7499 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7501 2000-11-17 Jim Meyering <meyering@lucent.com>
7503 * strstr.c: Update from GNU libc.
7505 2000-11-16 Jim Meyering <meyering@lucent.com>
7507 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7509 2000-11-11 Jim Meyering <meyering@lucent.com>
7511 * error.c: Add a couple #includes, merging from GNU libc version.
7513 2000-11-10 Jim Meyering <meyering@lucent.com>
7515 * obstack.h: Update from GNU libc.
7516 * obstack.c: Likewise.
7518 2000-11-06 Paul Eggert <eggert@twinsun.com>
7520 * getusershell.c (setusershell): Use rewind rather than
7521 fseek/fseeko, to avoid configuration hassles with fseeko.
7522 Don't bother opening SHELLS_FILE if shellstream is NULL;
7525 2000-11-05 Jim Meyering <meyering@lucent.com>
7527 * makepath.h (make_dir): Declare.
7528 * makepath.c (make_dir): Remove `static' attribute.
7531 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
7533 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
7534 last one in a bucket, advance to the next bucket.
7536 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
7538 * fnmatch.c: Do not comment out all the code if we are using
7539 the GNU C library, because in some cases we are replacing buggy
7540 code in the GNU C library itself.
7542 2000-10-30 Paul Eggert <eggert@twinsun.com>
7544 * error.h, getline.h, modechange.h:
7545 Remove "2000" from Copyright line, as the file hasn't been
7546 changed this year other than in the copyright notice.
7548 * xalloc.h: Add "2000" to Copyright line, as this file
7549 was changed this year.
7551 2000-10-30 Paul Eggert <eggert@twinsun.com>
7553 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
7554 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
7555 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
7557 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
7559 * regex.h (__restrict_arr): Move definition out of #ifndef block.
7560 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
7561 doesn't define __restrict_arr.
7563 2000-10-29 Jim Meyering <meyering@lucent.com>
7565 * xstat.in: Fix grammar in comment.
7567 2000-10-28 Jim Meyering <meyering@lucent.com>
7569 * memchr.c: Update from libc.
7570 Adjust for portability:
7571 [HAVE_STDLIB_H]: Include stdlib.h.
7572 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
7573 Undef __memchr, too.
7574 [!weak_alias]: Define __memchr to memchr.
7576 * regex.c: Update from libc.
7577 * regex.h: Likewise.
7578 * getopt1.c: Likewise.
7579 * memcmp.c: Likewise.
7581 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
7582 Avoid using fseek, when possible -- it's broken by design.
7583 Patch by Ulrich Drepper.
7585 2000-10-26 Jim Meyering <meyering@lucent.com>
7587 * strftime.c: Update from libc.
7589 2000-10-25 Jim Meyering <meyering@lucent.com>
7591 * obstack.c: Update from libc.
7593 2000-10-23 Jim Meyering <meyering@lucent.com>
7595 * hard-locale.c (hard_locale): Revert last change -- it was simply
7596 wrong. That set_locale call must not have any side effects.
7599 2000-10-22 Jim Meyering <meyering@lucent.com>
7601 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
7602 [CYCLIC]: Remove now-unused definition.
7604 * save-cwd.c (O_DIRECTORY): Define, if needed.
7605 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
7606 Suggestion from Ulrich Drepper.
7608 2000-10-21 Jim Meyering <meyering@lucent.com>
7610 * dirname.c (dir_name_r): New function, factored out of dir_name.
7611 (dir_name): Use dir_name_r.
7612 * dirname.h (dir_name_r): Declare it.
7614 2000-10-21 Jim Meyering <meyering@lucent.com>
7616 * dirname.c (memrchr): Declare if necessary.
7617 (dir_name): Remove the restriction that there be no
7618 trailing slashes. Now, this code skips past them, effectively
7620 [TEST_DIRNAME] (main): New unit tests.
7622 * memrchr.c: New file from GNU libc.
7623 Undef __memrchr, too.
7624 [!weak_alias]: Define __memrchr to memrchr.
7625 Guard weak_alias use with `#ifdef weak_alias'.
7627 2000-10-17 Jim Meyering <meyering@lucent.com>
7629 * quote.h (PARAMS): Define and use.
7630 Reported by Akim Demaille.
7632 * getopt.c: Update from libc.
7634 2000-10-16 Jim Meyering <meyering@lucent.com>
7636 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
7639 2000-09-25 Jim Meyering <meyering@lucent.com>
7641 * md5.h (rol): Define (from GnuPG).
7643 * sha.c: Give credit (GnuPG) where due.
7644 (M): Use rol rather than open-coding it.
7645 Add a FIXME comment.
7647 2000-09-21 Jim Meyering <meyering@lucent.com>
7649 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
7650 Reported by Michael Stone.
7652 2000-09-20 Jim Meyering <meyering@lucent.com>
7654 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
7655 (noinst_HEADERS): Add sha.h.
7656 Based on code from Scott G. Miller and from GnuPG.
7658 2000-09-15 Jim Meyering <meyering@lucent.com>
7660 * regex.c: Update from libc.
7662 2000-09-10 Jim Meyering <meyering@lucent.com>
7664 * getopt.c (_getopt_internal): Update from glibc.
7666 2000-09-09 Jim Meyering <meyering@lucent.com>
7668 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
7669 think it should be used as a general replacement for isascii.
7670 * fnmatch.c: Likewise.
7671 * mbswidth.c: Likewise
7672 * regex.c: Likewise.
7675 * userspec.c: Include sys/param.h and limits.h.
7677 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7678 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
7679 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
7680 UID, GID. Check range.
7682 2000-09-06 Jim Meyering <meyering@lucent.com>
7684 * getopt.c (_getopt_internal): Update from glibc.
7686 2000-08-30 Jim Meyering <meyering@lucent.com>
7688 * strftime.c: Merge in changes from GNU libc.
7690 2000-08-26 Jim Meyering <meyering@lucent.com>
7692 * closeout.c: Include "__fpending.h".
7693 (close_stdout_status): Return right away if there's nothing to flush.
7695 * Makefile.am (noinst_HEADERS): Add __fpending.h.
7696 * __fpending.c: New file.
7697 * __fpending.h: New file.
7699 2000-08-07 Paul Eggert <eggert@twinsun.com>
7701 Standardize on "memory exhausted" instead of "Memory exhausted"
7702 or "virtual memory exhausted".
7703 * obstack.c (print_and_abort): Use "memory exhausted", not
7704 "virtual memory exhausted".
7705 * same.c (same_name): Invoke xalloc_die instead of printing
7707 * userspec.c (parse_user_spec): Likewise.
7708 * bumpalloc.h: comment fix
7709 * same.c, userspec.c: Include xalloc.h.
7711 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
7712 not char *const and pointing to a constant array.
7713 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
7714 (xrealloc): Comment fix.
7716 * userspec.c (parse_user_spec):
7717 Don't translate a message until just before returning,
7718 to avoid unnecessary translation.
7720 2000-08-07 Jim Meyering <meyering@lucent.com>
7722 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
7723 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
7724 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
7725 getgroups.c, gethostname.c, getopt.h, group-member.c,
7726 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
7727 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
7728 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
7729 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
7730 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
7731 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
7732 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
7733 yesno.c: Back out Copyright date changes for each file with no change
7734 this year. This eases coordination with other programs using the same
7735 source code modules. From Paul Eggert.
7737 2000-08-03 Greg McGary <greg@mcgary.org>
7739 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
7740 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
7741 (EXTEND_BUFFER): Use them.
7743 2000-08-01 Jim Meyering <meyering@lucent.com>
7745 * dirname.c (ISSLASH): Define.
7746 (BACKSLASH_IS_PATH_SEPARATOR): Define.
7747 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
7748 both `\' and `/' may be use as path separators.
7749 Based on a patch from Prashant TR.
7751 2000-07-31 Paul Eggert <eggert@twinsun.com>
7753 * quotearg.c (quotearg_n_options): Don't make the initial
7754 slot vector a constant, since it might get modified.
7756 2000-07-31 Jim Meyering <meyering@lucent.com>
7758 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
7759 * obstack.c (print_and_abort): Likewise.
7761 2000-07-30 Paul Eggert <eggert@twinsun.com>
7763 * quotearg.c (quotearg_n_options): Preallocate a slot 0
7764 buffer, so that the caller can always quote one small
7765 component of a "memory exhausted" message in slot 0.
7766 From a suggestion by Jim Meyering.
7768 2000-07-30 Jim Meyering <meyering@lucent.com>
7770 * makepath.c (make_path): Quote the other instance, too.
7772 * quotearg.c (N_STATIC_SLOTVECS): Define.
7773 (STATIC_BUF_SIZE): Define.
7774 (quotearg_n_options): Use only statically allocated storage when
7775 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
7776 than STATIC_BUF_SIZE.
7778 2000-07-29 Jim Meyering <meyering@lucent.com>
7780 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
7781 * dirname.c (dir_name): Likewise.
7783 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
7785 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
7786 (dir_name): Assert that there are no trailing slashes.
7788 2000-07-18 Bruno Haible <haible@clisp.cons.org>
7790 * mbswidth.h (mbswidth): Add a flags argument.
7791 (mbswidth): New declaration.
7792 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
7793 * mbswidth.c (mbswidth): Add a flags argument.
7794 (mbsnwidth): New function.
7796 2000-07-24 Jim Meyering <meyering@lucent.com>
7798 * mbswidth.c: Remove useless #else. From Bruno Haible.
7800 2000-07-23 Paul Eggert <eggert@twinsun.com>
7802 * mbswidth.c (_XOPEN_SOURCE):
7803 Don't define; this causes problems on Solaris 7.
7804 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
7806 2000-07-23 Paul Eggert <eggert@twinsun.com>
7809 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
7810 so that mbstate_t is always defined.
7812 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
7813 be 1 in at least one GCC installation, and this configuration
7814 error is likely to be common. Ignoring MB_LEN_MAX hurts
7815 performance on hosts that have mbrtowc but have only unibyte
7816 locales, but I assume these hosts are rare.
7818 2000-07-23 Paul Eggert <eggert@twinsun.com>
7820 * quotearg.c: Streamline by invoking multibyte code only if needed.
7821 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
7822 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
7823 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
7824 invoke multibyte primitives.
7826 2000-07-23 Jim Meyering <meyering@lucent.com>
7828 * basename.c (base_name): Add an assertion.
7830 2000-07-15 Bruno Haible <clisp.cons.org>
7832 * quotearg.c: When the system forces us to redefine mbstate_t,
7833 shadow its mbsinit function.
7835 2000-07-16 Bruno Haible <haible@clisp.cons.org>
7837 * mbswidth.h: New file.
7838 * mbswidth.c: New file.
7839 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
7840 (noinst_HEADERS): Add mbswidth.h.
7842 2000-07-17 Bruno Haible <haible@clisp.cons.org>
7844 * config.charset: Add support for FreeBSD. Improve support for HP-UX
7847 2000-07-15 Jim Meyering <meyering@lucent.com>
7849 * makepath.c: Include quote.h.
7850 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
7851 corresponding argument in a `quote (...)' call.
7852 Give better diagnostics.
7854 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
7855 (noinst_HEADERS): Add quote.h.
7857 * quote.c (quote, quote_n): New file. Two functions taken verbatim
7858 from tar's src/misc.c.
7859 * quote.h: New file. Prototypes for same.
7861 2000-07-10 Paul Eggert <eggert@twinsun.com>
7863 From a suggestion by Bruno Haible.
7864 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
7865 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
7866 to decide whether to define the BeOS workaround macro;
7867 this adjusts to the change to AC_MBSTATE_T.
7869 2000-07-13 Paul Eggert <eggert@twinsun.com>
7871 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
7873 * quotearg.c (quoting_style_args, quoting_style_vals,
7874 quotearg_buffer_restyled): Add support for
7875 clocale_quoting_style. Undo previous change to
7876 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
7877 and "{RIGHT QUOTATION MARK}" msgids.
7879 2000-07-05 Paul Eggert <eggert@twinsun.com>
7881 The old behavior of quoting `like this' doesn't look good with
7882 newer, ISO-style fonts. See:
7883 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
7885 Instead, quote "like this" by default. Let the translator
7886 tailor the locale-specific quoting behavior by providing
7887 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
7889 * quotearg.c (N_): New macro.
7890 (gettext_default): New function.
7891 (quotearg_buffer_restyled): Use
7892 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
7893 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
7895 2000-07-09 Jim Meyering <meyering@lucent.com>
7897 * Most files: Update copyright dates to include 2000.
7899 2000-07-08 Jim Meyering <meyering@lucent.com>
7901 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
7903 (xgethostname): Remove now-unnecessary #ifdef.
7904 Move declaration of `err' into loop where it's used.
7906 2000-07-05 Bruno Haible <haible@clisp.cons.org>
7908 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
7909 by allocating a larger buffer. Test the gethostname return value for
7910 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
7911 returns an error and ENAMETOOLONG isn't defined.
7913 2000-07-05 Paul Eggert <eggert@twinsun.com>
7914 and Bruno Haible <haible@clisp.cons.org>
7916 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
7918 2000-07-05 Bruno Haible <haible@clisp.cons.org>
7920 * quotearg.c (struct quoting_options): Simplify quote_these_too
7923 2000-07-03 Jim Meyering <meyering@lucent.com>
7925 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
7926 Reported by Bruno Haible.
7928 2000-07-04 Jim Meyering <meyering@lucent.com>
7930 * quotearg.c: Make inclusion of <wchar.h> independent of whether
7931 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
7934 2000-07-03 Paul Eggert <eggert@twinsun.com>
7935 and Bruno Haible <haible@clisp.cons.org>
7937 * quotearg.c (mbrtowc):
7938 Assign to *pwc, and return 1 only if result is nonzero.
7939 (iswprint): Use ISPRINT when substituting our own mbrtowc.
7941 2000-07-03 Jim Meyering <meyering@lucent.com>
7943 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
7944 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
7947 2000-07-02 Jim Meyering <meyering@lucent.com>
7949 * quotearg.c (mbstate_t): Don't define here.
7951 2000-07-02 Jim Meyering <meyering@lucent.com>
7953 * nanosleep.c (SIGCONT): Define if not already defined.
7955 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7957 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
7958 per change in ../m4/ls-mntd-fs.m4.
7959 (read_filesystem_list): Ignore symbolic links.
7961 2000-06-29 Jim Meyering <meyering@lucent.com>
7963 * same.c: Include <string.h> or <strings.h>, as appropriate,
7964 for declaration of strcmp.
7966 * long-options.c: Include <stdlib.h>, for declaration of exit.
7968 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
7969 Avoid warning by casting result to `char *' to remove `const'.
7971 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7973 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
7975 2000-06-26 Paul Eggert <eggert@twinsun.com>
7977 savedir now sets errno on failure and invokes xmalloc to get memory.
7978 Fix a couple of other minor bugs while we're at it.
7980 * savedir.c (<unistd.h>): Do not include; there's no need.
7981 (NAMLEN): Remove macro.
7982 (malloc, realloc): Remove decls.
7984 ("xalloc.h"): Include.
7985 (NAME_SIZE_DEFAULT): New macro.
7986 (savedir): Use xmalloc / xrealloc to allocate memory.
7987 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
7988 Skip "" directory entries.
7989 Use strlen to calculate directory entry length, since the old method
7990 is rarely used these days and isn't worth supporting.
7991 Don't use a pointer after freeing it.
7992 Check for integer overflow when calculating allocation size.
7993 Use memcpy to copy entries, instead of stpcpy.
7994 Set errno properly when returning NULL.
7995 Check for readdir error.
7997 2000-06-26 Jim Meyering <meyering@lucent.com>
7999 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
8001 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8003 * getusershell.c (xmalloc, xrealloc): Remove functions.
8005 Don't include <stdlib.h>. Don't declare malloc, realloc.
8007 2000-06-23 Bruno Haible <haible@clisp.cons.org>
8009 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
8011 2000-06-24 Jim Meyering <meyering@lucent.com>
8013 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
8015 2000-06-21 Jim Meyering <meyering@lucent.com>
8017 * getpass.c: New file, from Bruno Haible. Required for BeOS.
8019 2000-06-19 Paul Eggert <eggert@twinsun.com>
8021 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
8022 (mbrtowc, mbstate_t): Define substitutes if
8023 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
8024 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
8025 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
8027 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8029 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
8030 than 1024, return a memory chunk of least possible size, instead
8031 of size PATH_MAX + 2. In the loop, increment the size proportionally.
8032 Use free/xmalloc instead of xrealloc to avoid copying for very long
8035 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8037 * canon-host.c (canon_host): Use malloc and memcpy to copy an
8038 address, not strdup. Include <stdlib.h> and don't declare free().
8040 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8042 * path-concat.c (path_concat): Don't access dir[-1] if dir is
8045 2000-06-21 Jim Meyering <meyering@lucent.com>
8047 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
8048 (noinst_HEADERS): Add getstr.h.
8050 * getline.c (getstr): Move into a separate file.
8051 * getstr.c (getstr): New file, extracted from getline.c, with
8052 the following changes: new parameter, delim2; both delim[12]
8053 parameters have type `int', not `char'. The latter would lose
8054 with 8-bit delimiters.
8055 * getstr.h: New file.
8057 2000-06-19 Jim Meyering <meyering@lucent.com>
8059 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
8061 2000-06-18 Jim Meyering <meyering@lucent.com>
8063 * mkdir.c: Remove file, due mainly to copyright incompatibility.
8064 Besides, these days every porting target provides a mkdir function.
8066 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
8067 (this snippet comes from src/system.h).
8069 2000-06-15 Paul Eggert <eggert@twinsun.com>
8071 * human.c (adjust_value): New function.
8072 (human_readable_inexact): Apply rounding style even when
8073 printing approximate values.
8075 2000-06-14 Paul Eggert <eggert@twinsun.com>
8077 * human.c (human_readable_inexact): Allow an input block
8078 size that is not a multiple of the output block size, and vice versa.
8079 Reported by Piergiorgio Sartor.
8081 2000-06-14 Paul Eggert <eggert@twinsun.com>
8083 * getdate.y (get_date): Apply relative times after time
8084 zone indicator, not before. Reported by Todd A. Jacobs.
8086 2000-06-13 Jim Meyering <meyering@lucent.com>
8088 * Makefile.am (all-local): Depend on lstat.c and stat.c.
8090 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
8092 2000-06-12 Paul Eggert <eggert@twinsun.com>
8094 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
8096 2000-06-04 Paul Eggert <eggert@twinsun.com>
8098 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
8100 2000-06-04 Jim Meyering <meyering@lucent.com>
8102 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
8103 SunOS 4.1.4 for which gid_t is an unsigned type.
8105 2000-06-03 Jim Meyering <meyering@lucent.com>
8107 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
8109 2000-05-26 Bruno Haible <haible@clisp.cons.org>
8111 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
8112 newer, don't install charset.alias.
8113 * config.charset: Change the Linux/glibc rules so they become empty
8114 on glibc-2.1 or newer.
8116 2000-06-02 Jim Meyering <meyering@lucent.com>
8118 * mountlist.c: Back out last change. Instead, do this...
8119 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
8120 member using the same `ignore'-testing code.
8121 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
8125 2000-05-29 Jim Meyering <meyering@lucent.com>
8127 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
8128 with the `ignore' attribute. Based on a patch from Mark D. Roth.
8130 2000-05-22 Jim Meyering <meyering@lucent.com>
8132 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
8134 2000-05-18 Jim Meyering <meyering@lucent.com>
8136 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
8137 back, too, since it may have been modified by allocate_entry.
8138 (hash_delete): Rewrite to use neither the assignment operator
8139 nor the comma operator in an if-expression.
8141 2000-05-15 Paul Eggert <eggert@twinsun.com>
8144 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
8145 Remove; no longer needed.
8146 "quotearg.h": Add include.
8147 (file_name): Do not bother to explicitly initialize to NULL; it's less
8148 efficient on some hosts.
8149 (close_stdout_status): Remove test as to whether stdout was already
8150 closed; it breaks for the case "echo x | sort >&-".
8151 Quote file name colons.
8152 Do not assume that _("write error") lacks format strings.
8154 2000-05-15 Jim Meyering <meyering@lucent.com>
8156 * version-etc.c (version_etc_copyright): Update the copyright string
8157 used in all --version output.
8159 2000-05-14 Jim Meyering <meyering@lucent.com>
8161 * closeout.c (close_stdout_set_file_name): New function.
8162 (close_stdout_status): Use new file-scoped global.
8163 Return right away if fstat says the stdout file descriptor is invalid.
8164 * closeout.h (close_stdout_set_file_name): Declare.
8166 2000-05-10 Jim Meyering <meyering@lucent.com>
8168 * closeout.c [default_exit_status]: New file-scoped variable.
8169 (close_stdout_set_status): New function.
8170 * closeout.h (close_stdout_set_status): Declare.
8172 2000-05-08 Jim Meyering <meyering@lucent.com>
8174 * long-options.c: Don't include closeout.h.
8175 (parse_long_options): Don't call close_stdout for --version.
8177 2000-05-06 Jim Meyering <meyering@lucent.com>
8179 * strnlen.c: Undefine __strnlen and strnlen.
8180 [!weak_alias]: Define __strnlen to strnlen.
8182 * atexit.c: New file, from libiberty.
8184 2000-05-06 Jim Meyering <meyering@lucent.com>
8186 * closeout.c (close_stdout_status): Also check for errors on the
8189 2000-05-05 Bruno Haible <haible@clisp.cons.org>
8191 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
8192 instead of xmalloc, xrealloc, path_concat.
8193 (locale_charset): Treat empty environment variables as absent.
8194 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
8196 2000-05-04 Jim Meyering <meyering@lucent.com>
8198 * getopt.c: Update from glibc.
8199 * obstack.c: Likewise.
8200 * obstack.h: Likewise.
8201 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
8203 * regex.h: Likewise.
8204 * strndup.c: Likewise.
8205 * strnlen.c: New file, from glibc.
8207 2000-05-01 Jim Meyering <meyering@lucent.com>
8209 * full-write.c (full_write): Remove `FIXME' part of comment.
8211 2000-04-29 Jim Meyering <meyering@lucent.com>
8213 * path-concat.c: Declare strdup only if it's not defined.
8214 * canon-host.c: Likewise.
8216 2000-04-28 Jim Meyering <meyering@lucent.com>
8218 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
8219 redefinition warning on some systems (HPUX). Otherwise, regex.h is
8220 included first, then limits.h is included by locale.h by libintl.h.
8221 From John David Anglin.
8223 2000-04-25 Jim Meyering <meyering@lucent.com>
8225 * makepath.c (S_IRWXUGO): Define.
8226 (make_path): Always perform explicit chmod if MODE specifies any
8227 of the `special' permission bits. Prompted by a bug report against
8228 install from Mate Wierdl and Joost van Baal.
8230 2000-04-18 Jim Meyering <meyering@lucent.com>
8234 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
8235 getpagesize. For BeOS. Based on a patch from Bruno Haible.
8237 2000-04-17 Jim Meyering <meyering@lucent.com>
8239 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
8240 the definition of it to rpl_strftime also defined-away the system's
8243 2000-04-15 Jim Meyering <meyering@lucent.com>
8245 Use `C' to denote so-called `contiguous' files, the same way
8247 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
8248 (ftypelet): Use S_ISCTG.
8249 From Michael Deutschmann.
8251 2000-04-14 Jim Meyering <meyering@lucent.com>
8253 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
8255 2000-04-08 Jim Meyering <meyering@lucent.com>
8257 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
8258 names don't conflict. Reported by Eli Zaretskii.
8260 2000-03-28 Bruno Haible <haible@clisp.cons.org>
8262 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
8263 bug. Deal with the different error behavior of Irix iconv.
8265 2000-04-07 Jim Meyering <meyering@lucent.com>
8267 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
8268 to work around system header problems on AIX 3.2.5. From Bruno Haible.
8270 2000-04-05 Jim Meyering <meyering@lucent.com>
8272 Portability tweaks required for ultrix4.3.
8273 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8274 * readutmp.c: Include sys/types.h before sys/stat.h.
8275 * canon-host.c: Declare strdup.
8276 * path-concat.c: Likewise.
8277 From John David Anglin.
8279 2000-04-04 Jim Meyering <meyering@lucent.com>
8281 Be more DOS 8.3-friendly.
8282 * ref-add.sin: Renamed from ref-add.sed.in.
8283 * ref-del.sin: Renamed from ref-del.sed.in.
8284 * Makefile.am: Reflect renaming.
8285 Reported by Eli Zaretskii.
8287 Use a temporary file name that won't clash with `charset.alias'
8288 in the DOS 8.3 name space.
8289 * Makefile.am (charset_tmp): Define.
8290 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8291 (uninstall-local): Likewise.
8292 Reported by Eli Zaretskii.
8294 2000-03-29 Paul Eggert <eggert@twinsun.com>
8296 * time/strftime.c (my_strftime): Make sure we call the system
8297 strftime, not ourselves, when invoking the underlying strftime.
8299 2000-03-24 Jim Meyering <meyering@lucent.com>
8301 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8302 (charset_alias): Define.
8303 (install-exec-local): Factor out common code.
8304 (uninstall-local): Split lines longer than 80.
8305 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8307 (.sed.in.sed): New rule. Don't redirect directly to $@.
8308 (CLEANFILES): Add ref-add.sed and ref-del.sed.
8310 2000-03-19 Bruno Haible <haible@clisp.cons.org>
8312 * config.charset: Output a line containing "Packages using this file".
8313 * ref-add.sed.in, ref-del.sed.in: New files.
8314 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8315 ref-del.sed): New rules.
8317 2000-03-17 Jim Meyering <meyering@lucent.com>
8319 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8320 Otherwise, include <strings.h>
8322 2000-03-17 Bruno Haible <haible@clisp.cons.org>
8324 * unicodeio.c (utf8_wctomb): New function.
8325 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8326 format instead of in UCS-4 with platform dependent endianness.
8328 2000-03-07 Paul Eggert <eggert@twinsun.com>
8330 * savedir.c (savedir): Work even if directory size is
8331 negative; this can happen with some screwy NFS configurations.
8333 2000-03-06 Jim Meyering <meyering@lucent.com>
8335 * localcharset.c (get_charset_aliases): Don't try to free file_name
8336 if it's NULL (because we ran out of memory). From Bruno Haible.
8338 2000-03-05 Jim Meyering <meyering@lucent.com>
8340 * localcharset.c ("path-concat.h"): Include.
8341 (get_charset_aliases): Use path_concat instead of ANSI string
8344 * unicodeio.h (PARAMS): Define.
8345 Use it to guard prototype.
8347 2000-03-04 Jim Meyering <meyering@lucent.com>
8349 * Makefile.am (install-exec-local): Create $(libdir) before installing
8351 (uninstall-local): Uncomment this rule so `make distcheck' works
8354 * unicodeio.c (<errno.h>): Include it.
8355 (errno): Declare if not defined.
8357 * localcharset.c: Add Bruno's comment justifying use of volatile.
8359 * config.charset: New version, incorporating remarks from a linux
8360 i18n mailing list. From Bruno Haible.
8362 2000-03-02 Jim Meyering <meyering@lucent.com>
8364 * Makefile.am (EXTRA_DIST): Add config.charset.
8366 2000-03-01 Jim Meyering <meyering@lucent.com>
8368 * localcharset.c: Guard some #includes with `#if HAVE_...'.
8369 * unicodeio.c: Likewise.
8371 2000-02-02 Bruno Haible <haible@clisp.cons.org>
8373 * config.charset: New file.
8374 * localcharset.c: New file.
8375 * unicodeio.h, unicodeio.c: New files.
8376 * Makefile.am (DEFS): Add -DLIBDIR=...
8377 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8378 (noinst_HEADERS): Add unicodeio.h.
8379 (all-local, install-exec-local, charset.alias): New targets.
8381 2000-02-28 Paul Eggert <eggert@twinsun.com>
8383 * quotearg.c (ALERT_CHAR): New macro.
8384 (quotearg_buffer_restyled): Use it.
8386 2000-02-27 Jim Meyering <meyering@lucent.com>
8388 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8389 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8391 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8392 not `#if STDC_HEADERS'.
8393 Declare malloc if needed.
8395 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8396 now that autoconf always defines the HAVE_DECL_ symbols.
8397 * human.c: Likewise.
8399 * strtoumax.c: Likewise.
8401 * backupfile.c: Arrange for cpp to fail if the configure-time
8402 declaration check was not run.
8404 * human.c: Likewise.
8406 * strtoumax.c: Likewise.
8408 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8409 then first look up the entire `.'-containing string as a login name.
8411 2000-02-18 Paul Eggert <eggert@twinsun.com>
8413 * getdate.y: Handle two-digit years with leading zeros correctly.
8414 (textint): New typedef.
8415 (parser_control): Member year changed from int to textint.
8417 (YYSTYPE): Removed; replaced by %union with int and textint members.
8418 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8419 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8420 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8421 (tSNUMBER, tUNUMBER): Now of type <textintval>.
8422 (date, number, to_year): Use width of number in digits, not its value,
8423 to determine whether it's a 2-digit year, or a 2-digit time.
8424 (yylex): Store number of digits of numeric tokens.
8425 Reported by John Kendall.
8427 (parser_control): Changed from struct parser_control to typedef (for
8428 consistency). All uses changed.
8430 (tID): Removed; not used.
8431 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8433 2000-02-14 Paul Eggert <eggert@twinsun.com>
8435 * getpagesize.h (getpagesize): Port to VMS for Alpha;
8436 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8438 2000-02-12 Jim Meyering <meyering@lucent.com>
8440 * userspec.c (ISDIGIT): Define it.
8441 (isdigit): Remove definition.
8442 (is_number): Use ISDIGIT, not isdigit.
8443 <libintl.h>: Include.
8445 (parse_user_spec): Mark translatable strings.
8447 2000-02-10 Jim Meyering <meyering@lucent.com>
8449 With these changes, nanosleep.[ch] are finally enough like the other
8450 lib/* replacement files to compile on a few more losing systems.
8452 * nanosleep.h: Don't include config.h.
8453 Remove prototype from declaration of nanosleep.
8454 (PARAMS): Remove now-unneeded definition.
8455 * nanosleep.c: #undef nanosleep.
8456 (rpl_nanosleep): Rename from nanosleep.
8458 2000-02-03 Jim Meyering <meyering@lucent.com>
8460 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8461 rather than with `#if HAVE_UTMPNAME'.
8463 2000-02-01 Jim Meyering <meyering@lucent.com>
8465 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
8467 2000-01-31 Jim Meyering <meyering@lucent.com>
8469 * nanosleep.h (nanosleep): Guard declaration with
8470 `#if ! HAVE_DECL_NANOSLEEP'.
8471 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8472 the declaration in that vendor's sys/timers.h.
8473 Reported by Christian Krackowizer.
8475 * quotearg.c (ISASCII): Add #undef and move definition to follow
8476 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8477 (ISPRINT): Likewise.
8478 Reported by Tom Tromey.
8480 2000-01-30 Jim Meyering <meyering@lucent.com>
8482 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8483 uses of ->ut_name. The latter doesn't work with new Linux header files
8484 where only utmpx.ut_user is declared.
8486 * readutmp.h (UT_USER): Define.
8488 2000-01-23 Jim Meyering <meyering@lucent.com>
8490 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8493 2000-01-22 Jim Meyering <meyering@lucent.com>
8495 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8496 [! HAVE_DECL_STRTOULL]: Declare strtoull.
8497 Required for some AIX systems. Reported by Christian Krackowizer.
8498 [TESTING] (main): New function.
8500 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
8501 * dirname.c (dir_name): Support for DOS-style file names with drive
8504 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8506 * strverscmp.c (ISDIGIT): Define.
8507 (strverscmp): Use ISDIGIT, not isdigit.
8509 2000-01-17 Paul Eggert <eggert@twinsun.com>
8511 * nanosleep.c (nanosleep):
8512 Don't use SA_INTERRUPT to decide whether to call sigaction, as
8513 POSIX.1 doesn't require SA_INTERRUPT and some systems
8514 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
8515 it's been part of POSIX.1 since day 1 (in 1988).
8517 2000-01-17 Jim Meyering <meyering@lucent.com>
8519 * interlock: Remove unused file. Reported by François Pinard.
8521 2000-01-16 Paul Eggert <eggert@twinsun.com>
8523 * quotearg.c (quotearg_buffer_restyled): Do not quote
8524 alert, backslash, formfeed, and vertical tab unnecessarily in
8525 shell quoting style.
8528 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
8529 Free Software Foundation, Inc.
8530 Copying and distribution of this file, with or without modification,
8531 are permitted provided the copyright notice and this notice are preserved.