1 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
3 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
5 (gethrxtime) [! (HAVE_NANOUPTIME
6 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
7 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
10 2005-11-10 Simon Josefsson <jas@extundo.com>
12 * readline.c: Remove EOL.
14 2005-11-08 Eric Blake <ebb9@byu.net>
16 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
18 2005-11-08 Eric Blake <ebb9@byu.net>
20 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
22 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
24 Fix porting problem reported by Theodoros V. Kalamatianos.
25 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
26 Don't assume that futimes failing means we must fail.
28 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
30 * getcwd.c (__getcwd): Don't assume that system calls after readdir
31 leave errno alone. Problem reported by Dmitry V. Levin.
33 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
35 * savedir.c (savedir): Don't assume that xrealloc etc. leave
36 errno alone. Problem reported by Frederic Jolliton.
38 2005-10-28 Simon Josefsson <jas@extundo.com>
40 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
41 "restrict" keywords, as per POSIX. Protect the function
42 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
43 Don't use K&R prototypes. Check the sprintf return values.
44 Re-define EAFNOSUPPORT if not present. Indent.
46 * md5.h, md5.c: Simplify buffer handling visavi alignment,
47 suggested by Bruno Haible <bruno@clisp.org>.
49 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
51 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
53 * gc-libgcrypt.c: Add MD2 (which is not available through
56 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
58 * md2.h, md2.c: New files.
60 2005-10-24 Simon Josefsson <jas@extundo.com>
62 * md4.h: Shrink buffer size, now that we changed the type.
64 2005-10-22 Simon Josefsson <jas@extundo.com>
66 * arcfour.h, arcfour.c: Use fixed size indices in the
67 arcfour_context struct (simplify test vector testing in GNU
70 2005-10-22 Simon Josefsson <jas@extundo.com>
72 * md4.h, md4.c: Simplify buffer handling visavi alignment,
73 suggested by Bruno Haible <bruno@clisp.org>.
75 2005-10-22 Simon Josefsson <jas@extundo.com>
77 * crc.h: Include stddef.h, for size_t.
79 2005-10-21 Simon Josefsson <jas@extundo.com>
81 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
82 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
84 2005-10-21 Simon Josefsson <jas@extundo.com>
86 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
89 2005-10-21 Simon Josefsson <jas@extundo.com>
91 * gc-gnulib.c: Support ARCTWO in CBC mode.
93 2005-10-21 Simon Josefsson <jas@extundo.com>
95 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
98 * hmac-sha1.c (hmac_sha1): Likewise.
100 * crc.c (crc32_update): Actually use crc parameter, suggested by
101 Bruno Haible <bruno@clisp.org>.
103 * crc.h: Include stdint.h directly, suggested by Bruno Haible
106 2005-10-21 Simon Josefsson <jas@extundo.com>
108 * des.h, des.c: New files.
110 * gc-gnulib.c: Support DES.c
112 2005-10-21 Simon Josefsson <jas@extundo.com>
114 * arctwo.h, arctwo.c: New files.
116 * gc-gnulib.c: Support ARCTWO.
118 2005-10-21 Simon Josefsson <jas@extundo.com>
120 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
122 2005-10-19 Simon Josefsson <jas@extundo.com>
124 * gc-gnulib.c: Support ARCFOUR.
126 2005-10-19 Simon Josefsson <jas@extundo.com>
128 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
131 * gc.h: Add ECB enum type.
133 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
135 2005-10-19 Simon Josefsson <jas@extundo.com>
137 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
139 2005-10-18 Simon Josefsson <jas@extundo.com>
141 * md4.h, md4.c: New files, based on md5.?.
143 2005-10-17 Simon Josefsson <jas@extundo.com>
145 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
147 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
149 2005-10-17 Simon Josefsson <jas@extundo.com>
151 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
153 2005-10-17 Simon Josefsson <jas@extundo.com>
155 * gc.h, gc-libgcrypt.c: Add ciphers.
157 2005-10-17 Simon Josefsson <jas@extundo.com>
159 * sha1.c: Use uint32_t instead of md5_uint32.t
161 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
164 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
166 * md5.h: Use stdint.h and uint32_t. Doc fix.
168 2005-10-15 Simon Josefsson <jas@extundo.com>
170 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
172 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
174 2005-10-14 Simon Josefsson <jas@extundo.com>
176 * arcfour.h, arcfour.c: New files.
178 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
180 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
181 include <wchar.h>; no longer needed.
183 2005-10-14 Jakub Jelinek <jakub@redhat.com>
184 and Ulrich Drepper <drepper@redhat.com>
187 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
188 instead of inline stream orientation test and two separate
189 function calls. Pay no attention to USE_IN_LIBIO.
191 2005-10-14 Roland McGrath <roland@redhat.com>
193 Import from libc. [BZ #1331]
194 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
196 Reported by Matej Vela <vela@debian.org>.
198 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
200 * mkdir-p.c (make_dir_parents): Don't report an error if an
201 intermediate directory is in a read-only file system. Problem
202 reported by Eric Blake.
204 2005-10-13 Simon Josefsson <jas@extundo.com>
206 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
207 Move memory allocation outside of loop.
209 2005-10-12 Simon Josefsson <jas@extundo.com>
211 * gc-pbkdf2-sha1.c: New file.
213 * gc.h: Add gc_pbkdf2_sha1 prototype.
215 2005-10-12 Simon Josefsson <jas@extundo.com>
217 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
218 suggested by Bruno Haible <bruno@clisp.org>.
220 2005-10-12 Simon Josefsson <jas@extundo.com>
222 * gc-libgcrypt.c (gc_hmac_sha1): New function.
224 * gc-gnulib.c (gc_hmac_sha1): New function.
226 2005-10-12 Simon Josefsson <jas@extundo.com>
228 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
230 2005-10-12 Simon Josefsson <jas@extundo.com>
232 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
233 GC_USE_HMAC_MD5, respectively.
235 * gc-libgcrypt.c (gc_md5): Fix assert call.
238 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
240 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
242 * gc-gnulib.c (gc_hash_buffer): Ditto.
244 2005-10-11 Bruno Haible <bruno@clisp.org>
246 * c-strcasestr.h: New file, from GNU gettext.
247 * c-strcasestr.c: New file, from GNU gettext.
249 2005-10-11 Bruno Haible <bruno@clisp.org>
251 * c-strcase.h: New file, from GNU gettext.
252 * c-strcasecmp.c: New file, from GNU gettext.
253 * c-strncasecmp.c: New file, from GNU gettext.
255 2005-10-11 Simon Josefsson <jas@extundo.com>
257 * crc.h, crc.c: New files.
259 * gc.h (gc_hash_buffer): Add doc.
261 2005-10-08 Simon Josefsson <jas@extundo.com>
263 * gc.h: Add gc_hash and gc_hash_buffer.
265 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
267 * gc-libgcrypt.c (gc_hash_buffer): Add.
269 2005-10-11 Bruno Haible <bruno@clisp.org>
271 * strcasecmp.c: Include limits.h.
272 (strcasecmp): Avoid integer overflow on exotic platforms.
273 * strncasecmp.c: Include limits.h.
274 (strncasecmp): Avoid integer overflow on exotic platforms.
275 Reported by Paul Eggert.
277 2005-10-06 Simon Josefsson <jas@extundo.com>
279 * hmac-md5.c: New file.
283 2005-10-06 Simon Josefsson <jas@extundo.com>
285 * memxor.c (memxor): Avoid casts and warnings.
287 2005-10-05 Derek Price <derek@ximbiot.com>
289 * getdelim.c (SIZE_MAX): New macro, if not already defined.
291 2005-10-05 Simon Josefsson <jas@extundo.com>
293 * memxor.c (memxor): Fix compiler error.
295 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
296 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
298 * memxor.h, memxor.c: New files.
300 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
301 we assume all systems have it, suggested by Jim Meyering
302 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
303 any systems lack sys/socket.h; mingw32 is known to lack it, but we
304 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
307 2005-10-04 Bruno Haible <bruno@clisp.org>
309 * verify.h (verify_true): Provide alternative definition for C++.
311 2005-10-04 Simon Josefsson <jas@extundo.com>
313 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
314 D. Baushke" <mdb@gnu.org>.
316 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
318 * getdelim.c: Include getdelim.h first. Include <limits.h>.
319 (SSIZE_MAX): New macro, if not already defined.
320 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
323 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
325 * exclude.c: Include verify.h.
326 (verify): Remove. All callers changed to use verify.h's version.
327 * strtoimax.c: Likewise.
328 * utimecmp.c: Likewis.e
331 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
332 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
333 * .cvsignore: Add fts.h, search.h, t-fpending.
334 * settime.c (settime): Fix { typo in previous patch. Also, don't
335 bother returning ENOSYS if settimeofday or stime fails; just let
336 them return whatever errno they want to return.
337 * utimens.c: Include unistd.h, for dup2.
338 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
339 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
341 2005-10-02 Jim Meyering <jim@meyering.net>
344 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
345 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
346 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
347 Remove AT_FDCWD test.
348 Do not consume the fd unless successful.
349 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
350 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
351 block, so that we don't even try to compile it if settimeofday is
352 available. This works around a compilation failure on OSF1 V5.1,
353 due to stime requiring a `long int*' while tv_sec is `int'.
355 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
357 * getdelim.c (getdelim): Remove unused variables.
359 2005-10-01 Simon Josefsson <jas@extundo.com>
361 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
362 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
363 AI_* and EAI_* definitions. Protect function declarations.
365 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
367 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
368 so that the code works even with ancient cpp. Portability problem
369 with GCC 2.7.2.1 reported by Thomas M.Ott.
371 2005-09-27 Jim Meyering <jim@meyering.net>
373 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
375 * intprops.h (signed_type_or_expr__): Define.
376 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
379 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
381 * verify.h (verify_expr): Remove, replacing with:
382 (verify_true): New macro that returns true instead of void.
383 (verify_type__): Remove.
384 (verify): Use verify_true rather than verify_type__.
386 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
388 * utimens.c (ENOSYS): Define if not already defined.
389 (futimens): Support having a null PATH if the file descriptor
392 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
394 (__attribute): Define to empty unless GCC 3.1 or later.
395 This works around a core dump on OpenBSD 3.4, which has GCC
396 2.95.3, which dumps core when given __attribute__(()). It also
397 simplifies other tests, since we really don't want to bother with
398 worrying about which ancient version of GCC supported what.
399 Original problem reported by Yoann Vandoorselaere, with part of
400 the fix suggested by Derek Price.
402 2005-09-24 Jim Meyering <jim@meyering.net>
404 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
405 so we can once again use a positive bitfield width of 1 -- now we
406 don't have to explain why we were using a bitfield width of 2.
408 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
410 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
411 Problem reported by Eric Blake.
412 (getaddrinfo): Initialize se so that it's not garbage.
413 Redo internal storage allocation so that it doesn't make unportable
414 assumptions about alignment.
417 * utimens.c (futimens): Use futimesat if available.
418 Prefer it to futimes since it doesn't have the futimes bug.
420 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
421 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
422 Instead, declare a function that returns a pointer to an array,
423 and use verify_type__ to declare the size of the array.
424 Problem and germ of a solution reported by Bruno Haible.
425 (verify_type__): Use 2, not 1, for bitfield size, to avoid
426 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
428 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
432 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
434 * argmatch.h: Include verify.h
435 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
436 (ARGMATCH_ASSERT): Remove; unused.
437 * canonicalize.c: Assume STDC_HEADERS.
438 * exclude.c: Include "strcase.h".
439 * regex_internal.h [!defined _LIBC]: Likewise.
440 * getusershell.c: Include stdio--.h rather than stdio.h
442 (getusershell): Call fopen, not fopen_safer.
443 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
444 Do not include unistd-safer.h.
445 (save_cwd): Don't call fd_safer; no longer needed
446 now that we include fcntl--.h.
448 * getdate.y (relative_time): New type.
449 (RELATIVE_TIME_0): New constant.
450 (parser_control): Use relative_time instead of doing it ourselves.
451 (%union): Add new relative_time rel member.
452 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
454 (relunit, relunit_snumber): Now of type rel.
455 (zone, rel, relunit, get_date): Adjust to above changes.
457 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
458 Do not include unistd-safer.h.
459 (getloadavg): Don't call fd_safer; no longer needed
460 now that we include fcntl--.h.
462 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
463 (make_dir_parents): Treat ENOSYS like EEXIST.
465 Improve quality of diagnostics on restore_cwd failure.
466 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
467 (make_dir_parents): Last arg is now int * (for errno), not bool *.
468 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
469 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
470 each time through the loop. Do not diagnose restore_cwd failure;
471 that is the caller's job (and perhaps the caller does not care).
473 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
474 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
475 If the file already exists but is not a directory, don't bother
476 to try to make its parents.
477 Close potential file descriptor leak if we can't chdir("/") (!).
478 Don't always return true if chdir($PWD) fails; return true only
479 if the requested action was done successfully (except for the
481 Don't log final directory unless we actually made it.
482 Refactor to avoid duplicate code to fix up permissions.
483 Don't attempt to fix up parent permissions if chdir($PWD) fails.
485 * strftime.c (my_strftime): Rewrite the previous change slightly,
486 to make it a bit faster and (I hope) clearer.
487 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
488 Fix bug in formats like %2N.
490 * verify.h: New file.
492 2005-09-22 Jim Meyering <jim@meyering.net>
496 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
498 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
499 the .tm_year member, since otherwise gcc-4.0 would now warn about
500 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
502 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
503 order to avoid an unsuppressible warning from gcc on 64-bit systems.
505 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
506 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
507 when run in a time zone for which daylight savings time is in effect
508 for the starting date.
510 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
511 stop us from restricting permissions of just-created absolute-named
513 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
514 to restore initial working directory.
515 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
516 to tell caller if/when we change the working directory and are
517 unable to return to the initial one.
518 * mkdir-p.h (make_dir_parents): Update prototype.
519 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
520 `return false'. This fixes a bug introduced on 2004-07-30.
522 * openat.c (fdopendir): Be sure to close the supplied
523 file descriptor before returning. This makes our replacement
524 implementation a little closer to Solaris's, where fdopendir
525 ties the file descriptor to the returned DIR* pointer.
526 * openat.c (unlinkat): New function.
527 * openat.h (unlinkat): Add prototype.
528 * openat-die.c (openat_save_fail): Rename from openat_save_die.
529 (openat_restore_fail): Rename from openat_restore_die.
530 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
532 Provide an alternative to exiting immediately upon save_cwd or
533 restore_cwd failure. Now, an application can arrange e.g.,
534 to perform a longjump in that case.
535 * openat.c: Include dirname.h.
536 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
537 (rpl_openat, fdopendir, fstatat): Call openat_save_die
538 and openat_restore_die rather than calling error directly.
539 Don't include "error.h" or "exitfail.h"; they're no longer needed.
541 * openat-die.c (openat_save_die, openat_restore_die): New file.
542 * openat.h (openat_save_die, openat_restore_die): Declare and define.
544 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
545 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
546 int utc, int nanoseconds);
548 date should not have to allocate a megabyte of virtual memory to
549 handle a format argument like +%1048575T. When implemented with
550 strftime, it must allocate such a buffer, use strftime to fill it
551 in, print it, then free it.
552 With fprintftime, it simply prints everything and exits.
553 With no need for memory allocation, that's one fewer way to fail.
554 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
555 optional field width, not before, so we accept %9:z, not %:9z.
556 (my_strftime): Be sure to use L_('x') for literals.
558 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
559 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
560 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
561 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
562 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
563 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
564 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
565 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
566 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
568 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
569 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
570 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
571 and don't include <sys/file.h>).
573 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
577 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
578 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
579 [!LDAV_DONE]: Avoid unused variable warning.
581 2005-09-21 Bruno Haible <bruno@clisp.org>
583 * unicodeio.h (unicode_to_mb): New declaration.
585 2005-09-20 Derek Price <derek@ximbiot.com>
587 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
589 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
591 Use a consistent style for including <config.h>.
592 * __fpending.c, acl.c, argmatch.c,
593 argp-help.c, argp-parse.c,
594 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
595 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
596 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
597 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
598 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
599 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
600 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
601 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
602 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
603 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
604 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
605 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
606 modechange.c, mountlist.c, open-safer.c, physmem.c,
607 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
608 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
609 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
610 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
611 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
612 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
613 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
614 userspec.c, utimecmp.c, version-etc-fsf.c,
615 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
616 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
617 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
618 Standardize inclusion of config.h.
619 * __fpending.h, dirfd.h, getdate.h, human.h,
620 inttostr.h: Removed inclusion of config.h from header files.
621 * inttostr.c: Adjusted in-tree users.
622 * timespec.h: Remove superfluous warning to include config.h.
623 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
624 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
625 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
626 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
628 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
630 * stat-time.h: New file.
631 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
632 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
634 (timespec_cmp): New function.
635 * utimecmp.c: Include stat-time.h.
636 (SYSCALL_RESOLUTION): Depend on whether various struct stat
637 members exist, not on the obsolescent ST_MTIM_NSEC.
638 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
640 2005-09-15 Derek Price <derek@ximbiot.com>
641 Paul Eggert <eggert@cs.ucla.edu>
643 * regcomp.c, regexec.c, regex_internal.c: Back out previous
644 changes, consolidating in...
645 * regex_internal.h: ...this file.
647 2005-09-15 Derek Price <derek@ximbiot.com>
649 * regex_internal.h: Blank `pure' for GNUC < 3.
650 * regex_internal.c: Ditto, using this...
651 (__GNUC_PREREQ): ...new macro.
652 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
653 (__GNUC_PREREQ): ...this new macro.
655 * strstr.h: Include string.h. Define strstr as a macro here.
657 2005-09-13 Derek Price <derek@ximbiot.com>
659 * canon-host.c (canon_host_r): Set *cherror on memory allocation
661 Reported by Jim Meyering <jim@meyering.net>.
663 2005-09-13 Jim Meyering <jim@meyering.net>
665 * canon-host.c: Filter through gnu indent and reword comments slightly.
666 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
668 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
670 * lib/base64.c: Typo.
671 (base64_encode): Put b64str in initialized data section.
673 2005-09-12 Derek Price <derek@ximbiot.com>
675 Return usable errors from canon-host.
676 * canon-host.h: New file.
677 * canon-host.c (canon_host): Wrap...
678 (canon_host_r): ...this new function, which now relies exclusively on
680 (ch_strerror): New function.
681 (last_cherror): New global.
682 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
683 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
685 (freeaddrinfo): Free ai->ai_canonname when set.
687 2005-09-12 Derek Price <derek@ximbiot.com>
688 Paul Eggert <eggert@cs.ucla.edu>
690 * glob-libc.h: Renamed from glob_.h. The new version is
691 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
692 protecting things that should be done only in gnulib contexts.
693 * glob_.h: New file, containing only the glob things needed for
695 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
696 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
697 (glob, globfree, glob_pattern_p): Now defined simply in terms of
698 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
699 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
700 and to respect the namespace rules better.
702 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
704 Merge glibc and coreutils changes into gnulib, plus a few
706 * md5.c: Use #error rather than a string.
707 (CYCLIC): New macro, from glibc source. Use it instead of rol.
708 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
709 (__attribute__): Define to empty for non recent-GCC.
710 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
711 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
712 Renamed from their non-__ counterparts, with new macros replacing
713 them if not _LIBC. Add __THROW attribute.
715 (struct md5_ctx): Align buffer if using GCC.
716 * sha1.h (struct sha1_ctx): Likewise.
717 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
718 The old name was backwards.
719 (NOTSWAP): Remove; not used.
720 (rol): New macro, moved here from md5.h.
721 (sha1_process_block): Remove a FIXME that doesn't make sense.
723 2005-09-12 Derek Price <derek@ximbiot.com>
725 * gai_strerror.c: Include config.h when available. Include
726 getaddrinfo.h before other headers to test interface.
727 Reported by Larry Jones <lawrence.jones@ugs.com>.
729 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
731 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
732 definitions, since that's the preferred style in glibc.
733 Fix a minor spacing issue, and update copyright notice to match glibc's.
735 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
737 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
739 2005-09-06 Simon Josefsson <jas@extundo.com>
741 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
742 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
744 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
746 Change bitset word type from unsigned int to unsigned long int,
747 as this has better performance on typical 64-bit hosts.
748 Port bitset code to hosts with unusual word sizes.
749 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
750 (build_collating_symbol):
751 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
752 argument is a bitset. This is merely a style issue, but it makes
753 it clearer that an entire array is expected.
754 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
755 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
756 Port to the case where bitset_word is not the same as unsigned int.
757 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
758 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
760 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
761 (build_trtable, group_nodes_into_DFAstates):
763 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
764 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
765 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
766 * regexec.c (group_nodes_into_DFAstates): Likewise.
767 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
768 * regcomp.c (optimize_subexps, lower_subexp):
769 Work even if bitset_word has holes in its bitwise representation.
770 * regex_internal.h (BITSET_WORD_BITS): Likewise.
771 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
773 * regex_internal.c (re_string_reconstruct):
774 Don't assume UCHAR_MAX == 255.
775 * regex_internal.h (bitset_set_all): Likewise.
776 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
778 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
779 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
781 (BITSET_WORD_MAX): New macro.
782 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
783 (bitset_set_all, bitset_copy): Now inline functions, not macros.
784 (bitset_empty, bitset_copy):
785 Prefer sizeof (bitset) to multiplying it out ourselves.
786 (bitset_not_merge): Remove; unused.
787 (bitset_contain): Return bool, not unsigned int with one bit on.
789 * regexec.c (build_trtable): Don't assume bitset has no stricter
790 alignment than re_node_set; do this by defining a new internal
791 type struct dests_alloc and using it to allocate memory.
793 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
795 Check for arithmetic overflow when calculating sizes, to prevent
796 some buffer-overflow issues. These patches are conservative, in the
797 sense that when I couldn't determine whether an overflow was possible,
798 I inserted a run-time check.
799 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
800 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
801 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
802 (re_xnrealloc, re_x2nrealloc): New inline functions.
803 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
804 (build_equiv_class, build_charclass): Check for arithmetic overflow
805 in size expression calculations.
806 * lib/regex_internal.c (re_string_realloc_buffers):
807 (build_wcs_upper_buffer, re_node_set_add_intersect):
808 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
809 (re_dfa_add_node, register_state): Likewise.
810 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
811 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
812 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
813 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
815 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
817 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
818 to avoid a collision with bits/local_lim.h in glibc.
819 All uses changed. Problem reported by Dmitry V. Levin in
820 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
822 * regex_internal.c (build_wcs_upper_buffer): Fix portability
823 bugs in int versus size_t comparisons.
824 (re_string_context_at): Fix bug where the code assumed that
827 Use bool where appropriate.
828 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
830 (calc_eclosure_iter): Likewise, for ROOT arg.
831 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
832 (build_charclass_op): Likewise, for NON_MATCH arg.
833 * regex_internal.c (re_string_allocate, re_string_construct):
834 (re_string_construct_common): Likewise, for ICASE arg.
835 * regexec.c (re_search_2_stub, re_search_stub):
836 Likewise, for RET_LEN arg.
837 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
838 (set_regs): Likewise, for FL_BACKTRACK arg.
839 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
840 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
841 (calc_eclosure_iter, parse_bracket_exp):
842 Use bool for internal variables that are booleans.
843 * regexec.c (re_search_internal, check_matching, proceed_next_node):
844 (set_regs, build_sifted_states, sift_states_bkref):
845 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
846 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
847 (find_collation_sequence_value):
849 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
850 (re_node_set_compare):
851 Return bool, not int. All callers changed.
852 * regexec.c (check_halt_node_context, check_dst_limits):
853 (build_trtable, check_node_accept): Likewise.
854 * regex_internal.h: Include stdbool.h.
856 Fix bugs uncovered when converting to bool.
857 * regcomp.c (calc_eclosure_iter): Check for storage allocation
858 failure instead of charging ahead blindly.
859 * regex_internal.c (register_state): Likewise.
860 * regexec.c (re_search_2_stub): Use simpler method than boolean
861 for freeing internal storage.
862 (group_nodes_into_DFA_states): Use unsigned int, not int, for
863 bitset pieces used as boolean, to avoid undefined behavior
864 on hosts that do int overflow checking.
866 2005-08-31 Derek Price <derek@ximbiot.com>
868 * getdelim.c (getdelim): Return EOF on EOF.
869 Reported by Larry Jones <lawrence.jones@ugs.com>.
871 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
873 * regex_internal.c (re_string_reconstruct): Don't assume buffer
874 lengths fit in regoff_t; this isn't true if regoff_t is the same
876 * regex.c (re_search_internal): 5th arg is LAST_START
877 (= START + RANGE) instead of RANGE. This avoids overflow
878 problems when regoff_t is the same width as size_t.
880 (re_search_2_stub): Check for overflow when adding the
881 sizes of the two strings.
882 (re_search_stub): Check for overflow when adding START
883 to RANGE; if it occurs, substitute the extreme value.
885 2005-08-31 Jim Meyering <jim@meyering.net>
887 * regcomp.c (search_duplicated_node): Make first pointer arg
889 * regex_internal.c (create_ci_newstate, create_cd_newstate):
890 (register_state): Likewise.
891 * regexec.c (search_cur_bkref_entry, check_dst_limits):
892 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
893 (group_nodes_into_DFAstates): Likewise.
895 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
897 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
898 old glibc regex code mishandles strings longer than 2**31 bytes.
899 This patch fixes this when the regex code is used in gnulib
900 (i.e., outside glibc).
902 This patch should not affect the use of the regex code inside
903 glibc. No doubt this problem also needs to be handled for glibc
904 as well, but the result will be an incompatible change to the
905 glibc ABI, and the old ABI will have to be supported too. That
906 can be the the subject for another patch.
908 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
909 governing whether the rest of this patch is active. By default,
910 the macro is disabled and the patch has no effect.
911 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
912 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
913 (struct re_pattern_buffer, re_search, re_search_2, re_match):
914 (re_match_2, re_set_registers): Use the new types.
915 * regex_internal.h (Idx, re_hashval_t): New types.
916 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
918 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
919 (re_string_context_at, bin_tree_t, re_dfastate_t):
920 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
921 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
922 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
923 (re_string_char_size_at, re_string_wchar_at):
924 (re_string_elem_size_at):
925 Use the new types and macros to port to 64-bit hosts.
926 Use unsigned types for internal values, so that the code
927 mostly works even for arrays larger than SSIZE_MAX.
928 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
929 (search_duplicated_node, calc_eclosure_iter, fetch_number):
930 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
931 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
932 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
933 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
934 (calc_inveclosure, parse_dup_op, build_range_exp):
935 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
936 (fetch_number, create_token_tree, mark_opt_subexp):
938 * regex_internal.c (re_string_construct_common, create_ci_newstate):
939 (create_cd_newstate, re_string_allocate, re_string_construct):
940 (re_string_realloc_buffers, build_wcs_upper_buffer):
941 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
942 (re_string_reconstruct, re_string_peek_byte_case):
943 (re_string_fetch_byte_case, re_string_context_at):
944 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
945 (re_node_set_init_copy, re_node_set_add_intersect):
946 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
947 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
948 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
949 (re_acquire_state, re_acquire_state_context, register_state):
951 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
952 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
953 (re_search_internal, re_search_2_stub, re_search_stub)
954 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
955 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
956 (update_cur_sifted_state, check_dst_limits):
957 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
958 (check_subexp_limits, sift_states_bkref, merge_state_array):
959 (check_subexp_matching_top, get_subexp, get_subexp_sub):
960 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
961 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
962 (expand_bkref_cache, check_node_accept_bytes):
963 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
964 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
965 (acquire_init_state_context, check_halt_node_context):
966 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
967 (sift_states_backward, clean_state_log_if_needed):
968 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
969 (find_recover_state, transit_state_sb, transit_state_mb):
970 (transit_state_bkref, build_trtable, match_ctx_clean):
972 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
973 to work around an assumption that REG_MISSING is negative.
975 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
976 (seek_collating_symbol_entry) [defined _LIBC]:
977 (lookup_collation_sequence_value) [defined _LIBC]:
978 (build_range_exp, build_collating_symbol) [defined _LIBC]:
979 Use prototypes rather than old-style function definitions.
980 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
981 (transit_state_sb) [0]:
982 (find_collation_sequence_value) [defined _LIBC]: Likewise.
984 * regexec.c (re_search_internal): Simplify update of rm_so and
987 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
988 (optimize_subexps, lower_subexp):
989 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
990 since the signed shift might overflow. Use 1u<<31 instead.
991 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
992 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
995 * regcomp.c (optimize_subexps, lower_subexp):
996 Use CHAR_BIT rather than 8, for clarity.
997 * regexec.c (check_dst_limits_calc_pos_1):
998 (check_subexp_matching_top): Likewise.
999 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
1000 have to worry about portability issues when shifting it left.
1001 Remove no-longer-needed test for table_size > 0.
1002 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
1003 in a word, as the resulting behavior is undefined.
1004 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
1005 in one case, a <= should have been an <, and in another case the
1006 whole test was missing.
1007 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
1008 the standard name CHAR_BIT.
1009 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
1010 this is not true on one's complement and signed-magnitude hosts.
1012 * regex_internal.h (re_sub_match_top_t): Remove unused member
1014 (struct re_dfa_t): Remove unused member states_alloc.
1015 * regcomp.c (init_dfa): Don't initialize unused members.
1017 2005-08-31 Bruno Haible <bruno@clisp.org>
1019 * strstr.c: Include <stddef.h>, for NULL.
1020 * strcasestr.c: Likewise.
1021 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
1023 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
1025 * iconvme.h: Add prototype for iconv_alloc.
1027 2005-08-29 Simon Josefsson <jas@extundo.com>
1029 * iconvme.c: Fix errno.
1031 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
1033 * iconvme.c: Split iconv_string into iconv_alloc.
1035 2005-08-27 Jim Meyering <jim@meyering.net>
1037 * fopen-safer.c: Merge minor changes from coreutils.
1038 * dup-safer.c: Likewise.
1039 * fd-safer.c: Likewise.
1041 Merge from coreutils.
1042 * stdio--.h: New file.
1043 * stdlib--.h: New file.
1044 * mkstemp-safer.c: New file.
1046 GNU tar needs these.
1047 * pipe-safer.c: New file.
1048 * creat-safer.c: New file.
1049 * fcntl--.h (creat): Define to creat_safer.
1050 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
1051 * unistd--.h (pipe): Define to pipe_safer.
1052 * unistd-safer.h: Declare pipe_safer.
1054 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
1056 * regex_internal.h: Remove all references to
1057 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
1059 (bitset_not, bitset_merge, bitset_not_merge):
1060 (bitset_mask, re_string_allocate, re_string_construct):
1061 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
1062 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
1063 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
1064 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
1065 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1066 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1067 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
1068 (re_acquire_state_context):
1069 Remove unnecessary forward decls.
1070 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
1071 Put __attribute at function definition,
1072 now that the function decl has been removed.
1073 * lib/regex_internal.c (re_string_peek_byte_case):
1074 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
1077 2005-08-26 Simon Josefsson <jas@extundo.com>
1079 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
1080 Haible <bruno@clisp.org>.
1082 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1084 * regexec.c (set_regs): Don't alloca with an unbounded size.
1086 alloca modernization/simplification for regex.
1087 * regex.c: Remove portability cruft for alloca. This no longer
1088 needs to be at the start of the file, and can be moved into
1089 regex_internal.h and simplified.
1090 * regex_internal.h: Include <alloca.h>.
1091 (__libc_use_alloca) [!defined _LIBC]: New macro.
1092 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
1093 now works outside glibc.
1095 2005-08-24 Simon Josefsson <jas@extundo.com>
1097 * getpass.c: Add WIN32 implementation. Conditionalize use of
1098 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
1099 GLIBC specific code.
1101 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1103 Make regex safe for g++. This fixes one real bug (an "err"
1104 that should have been "*err"). g++ problem reported by
1106 * regex_internal.h (re_calloc): New macro, consistent with
1107 re_malloc etc. All callers of calloc changed to use re_calloc.
1108 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
1109 not int. All callers changed.
1110 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
1111 just use an array of size MB_LEN_MAX.
1112 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
1113 (find_recover_state): Change "err" to "*err"; this fixes what
1114 appears to be a real bug.
1115 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
1118 2005-08-25 Jim Meyering <jim@meyering.net>
1120 * open-safer.c: Include <config.h>.
1121 Otherwise, we'd lose LARGEFILE support in any file using
1124 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
1126 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
1127 * regex.h (regerror): Likewise.
1129 * regex.c: Do not include <sys/types.h>, as POSIX no longer
1130 requires this. (The code never needed it.)
1132 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
1133 All uses of recently-renamed identifiers changed to use the new,
1134 POSIX-compliant names. The code will build and run just fine
1135 without these changes, but it's better to eat our own dog food
1136 and use the standard-conforming names.
1138 * regex.h: Fix a multitude of POSIX name space violations.
1139 These changes have an effect only for programs that define
1140 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
1141 do not change anything for programs compiled in the normal way.
1142 Also, there is no effect on the ABI.
1144 (_REGEX_SOURCE): New macro.
1145 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
1146 defined and _GNU_SOURCE is not; this fixes a name space violation.
1148 Rename the following macros to obey POSIX requirements.
1149 The old names are still visible as macros if _REGEX_SOURCE is defined.
1150 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
1151 RE_BACKSLASH_ESCAPE_IN_LISTS.
1152 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
1153 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
1154 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
1155 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
1156 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
1157 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
1158 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
1159 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
1160 (REG_INTERVALS): renamed from RE_INTERVALS.
1161 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
1162 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
1163 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
1164 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
1165 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
1166 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
1167 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
1168 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
1169 RE_UNMATCHED_RIGHT_PAREN_ORD.
1170 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
1171 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
1172 (REG_DEBUG): renamed from RE_DEBUG.
1173 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
1174 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
1175 unusual, since we can't clash with the POSIX REG_ICASE.
1176 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
1177 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
1178 (REG_NO_SUB): renamed from RE_NO_SUB.
1179 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
1180 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
1181 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
1182 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
1183 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
1184 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
1185 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
1186 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
1187 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
1188 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
1189 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
1190 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
1191 RE_SYNTAX_POSIX_MINIMAL_BASIC.
1192 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
1193 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
1194 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
1195 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
1196 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
1197 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
1198 (REG_FIXED): Renamed from REGS_FIXED.
1199 (REG_NREGS): Renamed from RE_NREGS.
1201 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
1202 of other REG_* macros, since POSIX says the user is allowed to
1203 #undef these macros selectively.
1205 (reg_errcode_t): Update comment stating what other tables need
1208 Rename the following enum values to obey POSIX requirements.
1209 The old names are still visible as macros.
1210 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
1211 is not defined, since GNU is supposed to be a superset of POSIX as
1212 much as possible, and since we want reg_errcode_t to be a signed
1213 type for implementation consistency.
1214 (_REG_NOERROR): Renamed from REG_NOERROR.
1215 (_REG_NOMATCH): Renamed from REG_NOMATCH.
1216 (_REG_BADPAT): Renamed from REG_BADPAT.
1217 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
1218 (_REG_ECTYPE): Renamed from REG_ECTYPE.
1219 (_REG_EESCAPE): Renamed from REG_EESCAPE.
1220 (_REG_ESUBREG): Renamed from REG_ESUBREG.
1221 (_REG_EBRACK): Renamed from REG_EBRACK.
1222 (_REG_EPAREN): Renamed from REG_EPAREN.
1223 (_REG_EBRACE): Renamed from REG_EBRACE.
1224 (_REG_BADBR): Renamed from REG_BADBR.
1225 (_REG_ERANGE): Renamed from REG_ERANGE.
1226 (_REG_ESPACE): Renamed from REG_ESPACE.
1227 (_REG_BADRPT): Renamed from REG_BADRPT.
1228 (_REG_EEND): Renamed from REG_EEND.
1229 (_REG_ESIZE): Renamed from REG_ESIZE.
1230 (_REG_ERPAREN): Renamed from REG_ERPAREN.
1231 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
1232 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
1233 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
1234 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
1236 (_REG_RE_NAME, _REG_RM_NAME): New macros.
1237 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
1238 changed. But support the old name if the new one is not defined
1239 and if _REGEX_SOURCE.
1241 Change the following member names in struct re_pattern_buffer.
1242 The old names are still supported if !_REGEX_SOURCE.
1243 The new names are always supported, regardless of _REGEX_SOURCE.
1244 (re_buffer): Renamed from buffer.
1245 (re_allocated): Renamed from allocated.
1246 (re_used): Renamed from used.
1247 (re_syntax): Renamed from syntax.
1248 (re_fastmap): Renamed from fastmap.
1249 (re_translate): Renamed from translate.
1250 (re_can_be_null): Renamed from can_be_null.
1251 (re_regs_allocated): Renamed from regs_allocated.
1252 (re_fastmap_accurate): Renamed from fastmap_accurate.
1253 (re_no_sub): Renamed from no_sub.
1254 (re_not_bol): Renamed from not_bol.
1255 (re_not_eol): Renamed from not_eol.
1256 (re_newline_anchor): Renamed from newline_anchor.
1258 Change the following member names in struct re_registers.
1259 The old names are still supported if !_REGEX_SOURCE.
1260 The new names are always supported, regardless of _REGEX_SOURCE.
1261 (rm_num_regs): Renamed from num_regs.
1262 (rm_start): Renamed from start.
1263 (rm_end): Renamed from end.
1265 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
1266 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
1267 Prepend __ to parameter names.
1269 Undo yesterday's changes.
1271 2005-08-24 Jim Meyering <jim@meyering.net>
1273 Sync from coreutils.
1274 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
1276 2005-08-21 Bruno Haible <bruno@clisp.org>
1278 * lock.h: Add multiple inclusion guard.
1279 * tls.h: Add multiple inclusion guard.
1281 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
1283 * regex.h (REG_NOSYS)
1284 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
1285 Define, since POSIX requires it as of 2001.
1286 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
1287 New private symbol, used to keep the enum signed in all cases.
1288 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
1289 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
1291 * regex_internal.c (re_string_skip_chars, register_state):
1293 Remove forward decls; no longer needed now that we use prototypes.
1294 * regexec.c (acquire_init_state_context, check_halt_node_context):
1295 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
1296 (clean_state_log_if_needed): Likewise.
1298 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1300 Fix problems reported by Sam Steingold in
1301 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
1302 * regexec.c (sift_states_bkref): Fix portability bug: the code
1303 assumed that reg_errcode_t is a signed type, which is not
1304 necessarily true if _XOPEN_SOURCE is not defined.
1305 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
1306 some compilers warn about it otherwise.
1308 2005-08-20 Jim Meyering <jim@meyering.net>
1310 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
1311 of unused local, dfa.
1313 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1315 * regcomp.c (create_initial_state): Remove duplicate decl.
1316 (init_word_char, create_initial_state, duplicate_node_closure):
1317 (fetch_token, peek_token_bracket, build_range_exp):
1318 (build_collating_symbol): Remove forward decls; no longer needed
1319 now that we use prototypes.
1322 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
1323 (re_compile_fastmap_iter, regcomp, regerror, regfree):
1324 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
1325 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
1326 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
1327 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
1328 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
1329 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
1330 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
1331 (build_range_exp, build_collating_symbol, parse_bracket_exp):
1332 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
1333 (build_charclass, build_charclass_op, fetch_number, create_tree):
1334 (create_token_tree, mark_opt_subexp, duplicate_tree):
1335 Use prototypes rather than old-style definitions.
1338 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
1339 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
1340 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1341 (re_string_reconstruct, re_string_peek_byte_case):
1342 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
1343 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1344 (re_node_set_init_copy, re_node_set_add_intersect):
1345 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1346 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1347 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1348 (re_acquire_state, re_acquire_state_context, register_state):
1349 (create_ci_newstate, create_cd_newstate, free_state):
1351 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
1352 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
1353 (re_search_internal, prune_impossible_nodes):
1354 (acquire_init_state_context, check_matching, static):
1355 (check_halt_node_context, check_halt_state_context, proceed_next_node):
1356 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
1357 (update_regs, sift_states_backward, build_sifted_states):
1358 (clean_state_log_if_needed, merge_state_array):
1359 (update_cur_sifted_state, add_epsilon_src_nodes):
1360 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
1361 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
1362 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
1363 (find_recover_state, check_subexp_matching_top, transit_state_mb):
1364 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
1365 (check_arrival, check_arrival_add_next_nodes):
1366 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1367 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1368 (check_node_accept_bytes, check_node_accept, extend_buffers):
1369 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
1370 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
1375 (re_string_allocate, re_string_construct, re_string_reconstruct):
1376 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
1377 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
1378 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
1379 (re_string_context_at, re_string_peek_byte_case):
1380 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
1381 is defined, since we now use prototypes always.
1383 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
1384 C89 or better. All uses removed.
1386 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1388 * regex_internal.c (re_acquire_state, re_acquire_state_context)
1389 [defined lint]: Suppress bogus uninitialized-variable warnings.
1391 * regcomp.c (duplicate_node): Return new index, not an error code,
1392 and let the caller return REG_ESPACE if out of space. This
1393 removes an uninitialied-variable warning with GCC 4.0.1, and also
1394 avoids taking the address of a local variable. All callers
1397 2005-08-19 Jim Meyering <jim@meyering.net>
1399 * regexec.c (proceed_next_node): Redo local variables to
1400 avoid GCC shadowing warnings.
1402 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1404 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
1405 (re_node_set_insert_last, re_dfa_add_node):
1406 Rename local variables to avoid GCC shadowing warnings.
1408 2005-08-18 Bruno Haible <bruno@clisp.org>
1410 * strstr.c (strstr): Fix return value in multibyte case.
1411 * strcasestr.c (strcasestr): Likewise.
1413 2005-08-17 Jim Meyering <jim@meyering.net>
1415 Make the %s format (seconds since the epoch) work for a negative
1416 number and when used with a zero-padded field width, e.g. %015s.
1418 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1419 label so that it precedes the code to set `digits'. Otherwise,
1420 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
1421 print `00-22'. Now, it prints `-0022', as it should.
1423 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
1425 * regex.h: Remove useless space-before-tab. From coreutils.
1427 2005-08-17 Bruno Haible <bruno@clisp.org>
1429 * strcasestr.h: New file.
1430 * strcasestr.c: New file.
1432 2005-08-17 Bruno Haible <bruno@clisp.org>
1434 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
1435 * strstr.c: Completely rewritten, with multibyte locale support.
1437 2005-08-17 Bruno Haible <bruno@clisp.org>
1439 * strcasecmp.c: Use mbuiter.h.
1441 2005-08-17 Bruno Haible <bruno@clisp.org>
1443 * mbuiter.h: New file.
1445 2005-08-16 Bruno Haible <bruno@clisp.org>
1447 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
1449 (mbi_avail, mbi_advance): Let the iteration end before the terminating
1450 NUL byte, not after it.
1452 2005-08-16 Bruno Haible <bruno@clisp.org>
1454 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
1455 the valid ones. Makes the comparison operations transitive:
1456 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
1457 * strcasecmp.c (strcasecmp): Use mb_casecmp.
1459 2005-08-16 Bruno Haible <bruno@clisp.org>
1461 * strcase.h (strcasecmp): Add note in comments.
1462 * strncasecmp.c: Use code from strcasecmp.c.
1463 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
1464 (strcasecmp): Work correctly in multibyte locales.
1466 2005-08-16 Bruno Haible <bruno@clisp.org>
1468 * strnlen1.h: New file.
1469 * strnlen1.c: New file.
1471 2005-08-16 Bruno Haible <bruno@clisp.org>
1473 * mbfile.h: New file.
1475 2005-08-16 Bruno Haible <bruno@clisp.org>
1477 * mbiter.h: New file.
1479 2005-08-16 Bruno Haible <bruno@clisp.org>
1481 * mbchar.h: New file.
1482 * mbchar.c: New file.
1484 2005-08-16 Bruno Haible <bruno@clisp.org>
1486 * tls.h: New file, from GNU gettext.
1487 * tls.c: New file, from GNU gettext.
1489 2005-08-15 Bruno Haible <bruno@clisp.org>
1491 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
1494 2005-08-14 Jim Meyering <jim@meyering.net>
1496 Sync from coreutils.
1498 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
1499 Use the hash-table-based cycle-detection code not just when
1500 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
1501 Reported by James Youngman in
1502 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
1503 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
1504 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
1505 This lets us compile with -DFTS_DEBUG, once again.
1506 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
1507 * fts.c (fd_safer): Remove decl.
1508 Include fcntl--.h rather than unistd-safer.h
1509 (fts_safe_changedir): Don't call fd_safer; no longer needed
1510 now that we include fcntl--.h.
1512 2005-08-11 Simon Josefsson <jas@extundo.com>
1514 * readline.h, readline.c: New file.
1516 2005-08-11 Bruno Haible <bruno@clisp.org>
1518 * strnlen.h (strnlen): Change parameter name to match comment.
1520 2005-08-10 Simon Josefsson <jas@extundo.com>
1522 * strndup.c: Use strnlen.h.
1524 * strnlen.h: New file.
1526 2005-08-02 Simon Josefsson <jas@extundo.com>
1528 * getline.h, getline.c: Rewrite.
1530 * getdelim.h, getdelim.c: New files, ported from glibc.
1532 2005-07-31 Bruno Haible <bruno@clisp.org>
1534 * lock.h (gl_lock_initializer): New macro.
1535 (gl_lock_define_initialized): Use it.
1536 (gl_rwlock_initializer): New macro.
1537 (gl_rwlock_define_initialized): Use it.
1538 (gl_recursive_lock_initializer): New macro.
1539 (gl_recursive_lock_define_initialized): Use it.
1541 2005-07-26 Bruno Haible <bruno@clisp.org>
1543 * lock.h: Update from GNU gettext.
1544 * lock.c: Update from GNU gettext.
1546 2005-07-18 Bruno Haible <bruno@clisp.org>
1548 * lock.h (gl_once_t): New type.
1549 (gl_once_define, gl_once): New macros.
1550 * lock.c (fresh_once): New variable.
1551 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
1554 2005-07-18 Simon Josefsson <jas@extundo.com>
1556 * check-version.c (check_version): Accept identical versions too.
1558 2005-07-18 Bruno Haible <bruno@clisp.org>
1560 * lock.h: New file, from GNU gettext.
1561 * lock.c: New file, from GNU gettext.
1563 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
1565 * quotearg.c: Add translator comment suggested by Bruno Haible,
1566 with a minor change.
1568 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
1570 * version-etc-fsf.c (version_etc_copyright): Parameterize the
1571 copyright symbol and the year.
1572 * version-etc.c (COPYRIGHT_YEAR): New constant.
1573 (version_etc_va): Use parameterized copyright notice.
1574 Reword to conform to the current GNU coding standards.
1576 2005-07-11 Simon Josefsson <jas@extundo.com>
1578 * size_max.h: New file.
1580 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
1582 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
1585 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
1586 and Paul Eggert <eggert@cs.ucla.edu>
1588 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
1589 in wint_t, not wchar_t. Remove now-unnecessary cast.
1591 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
1593 * regex.c, regex.h: Sync from libc.
1594 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
1595 New files, synced from libc, except that regex_internal.h
1596 currently has a small porting fix.
1598 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
1600 Remove the dependency of the strftime module on the tzset module.
1601 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
1602 Copy the input structure, to work around some of the bug with
1603 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
1604 Solaris releases, you should also use the tzset module, but we won't
1605 require it as a dependency any more since we don't want LGPLed code
1606 to depend on GPLed code.
1608 2005-07-02 Jim Meyering <jim@meyering.net>
1610 * backupfile.c (backup_args): Change a `0' to NULL.
1612 2005-07-01 Jim Meyering <jim@meyering.net>
1614 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1615 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
1616 * save-cwd.c, tempname.c:
1617 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1618 and don't include <sys/file.h>).
1620 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
1622 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
1623 declares only 'struct timespec;' (!).
1625 2005-06-29 Jim Meyering <jim@meyering.net>
1627 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
1628 type name. Use the variable name instead.
1629 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
1631 2005-06-28 Simon Josefsson <jas@extundo.com>
1633 * check-version.h, check-version.c: New files.
1635 2005-06-28 Simon Josefsson <jas@extundo.com>
1637 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
1638 collision with global variable. Better indentation. Don't
1639 increment buffer pointer beyond buffer end. Based on comments
1640 from Paul Eggert <eggert@cs.ucla.edu>.
1644 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
1646 * canon-host.c (canon-host): Append trailing "," to 0 in
1647 initializer of struct addrinfo, as an indication that we don't
1648 care how many members the structure has.
1650 2005-06-24 Derek Price <derek@ximbiot.com>
1651 and Bruno Haible <bruno@clisp.org>
1653 Remove stat module & update lstat.
1654 * stat.c: Remove this file...
1655 (slash_aware_lstat): ...moving this content and its support...
1656 * lstat.c (rpl_lstat): ...into here.
1657 * lstat.h: New file.
1659 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
1661 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
1662 (ranged_convert): Don't save conversion in a temporary struct.
1663 This causes a warning with GCC 4.0.0, and anyway in the typical
1664 case it's not worth the extra 100 bytes or so of code.
1665 (ranged_convert, __mktime_internal): When calling a function via a
1666 pointer P, use P () rather than (*P) (), as we now assume C89 or
1669 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
1671 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
1672 "who -r" failed to give output. Problem reported by Tim Waugh.
1674 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
1675 (xcalloc): Use it to avoid needless tests.
1676 Problem reported by Jim Meyering.
1678 2005-06-16 Jim Meyering <jim@meyering.net>
1680 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
1681 when either N or S is zero.
1683 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1685 * argp.h (__option_is_short): Check upper limit of
1686 __key. Isprint() requires its argument to have the value
1687 of an unsigned char or EOF.
1689 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
1691 * fnmatch.c (fnmatch): If there is an encoding error in a
1692 multibyte string or pattern, fall back on unibyte matching.
1693 Problem reported by James Youngman.
1695 2005-06-08 Bruno Haible <bruno@clisp.org>
1697 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
1700 2005-06-08 Bruno Haible <bruno@clisp.org>
1702 * csharpcomp.h: New file, from GNU gettext.
1703 * csharpcomp.c: New file, from GNU gettext.
1704 * csharpcomp.sh.in: New file, from GNU gettext.
1706 2005-06-07 Derek Price <derek@ximbiot.com>
1709 * glob_.h: Indent nested #ifdef.
1711 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
1713 Sync from coreutils.
1714 Use "file name" when talking about file names, instead of "filename"
1715 or "path", as per the GNU coding standards.
1716 * mkdir-p.c: Renamed from makepath.c.
1717 (make_dir_parents): Renamed from make_path. All callers changed.
1718 * mkdir-p.h: Likewise. All includers changed.
1719 * filenamecat.c: Renamed from path-concat.c.
1720 (file_name_concat): Renamed from path_concat. All callers changed.
1721 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
1722 * filenamecat.h: Likewise. All includers changed.
1723 * acl.c: Don't use "path" or "filename" to mean "file name"
1724 in comments or local variable names.
1725 * basename.c: Likewise.
1726 * canonicalize.c, canonicalize.h: Likewise.
1727 * dirname.c, dirname.h: Likewise.
1728 * euidaccess.c: Likewise.
1729 * exclude.c: Likewise
1730 * fnmatch_.h, fnmatch_loop.c: Likewise.
1731 * fsusage.c, fsuage.h: Likewise.
1732 * fts.c, fts_.h: Likewise.
1733 * getcwd.c: Likewise.
1734 * getloadavg.c: Likewise.
1735 * mkstemp.c: Likewise.
1736 * mountlist.c, mountlist.h: Likewise.
1737 * openat.c, openat.h: Likewise.
1738 * readlink-stub.c: Likewise.
1739 * readutmp.c, readutmp.h: Likewise.
1740 * rename.c: Likewise.
1741 * rmdir.c: Likewise.
1743 * savedir.c: Likewise.
1744 * stripslash.c: Likewise.
1745 * tempname.c: Likewise.
1746 * xreadlink.c: Likewise.
1747 * exclude.c (excluded_file_name): Renamed from excluded_filename.
1749 * exclude.h: Likewise.
1751 * euidaccess.c (getuid, getgid, getuid, getegid)
1752 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1753 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
1754 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1755 * pathmax.h: Include <limits.h> unconditionally, since other
1756 files have been getting away with it for years (MORE/BSD 4.3
1758 * userspec.c (getpwnam, getgrnam, getgrgid)
1759 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1761 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
1762 Define to 256, not 255, as per modern POSIX.
1764 2005-06-01 Bruno Haible <bruno@clisp.org>
1766 * csharpexec.h: New file, from GNU gettext.
1767 * csharpexec.c: New file, from GNU gettext.
1768 * csharpexec.sh.in: New file, from GNU gettext.
1770 2005-05-31 Derek Price <derek@ximbiot.com>
1771 Paul Eggert <eggert@cs.ucla.edu>
1774 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
1776 2005-05-29 Derek Price <derek@ximbiot.com>
1777 Paul Eggert <eggert@cs.ucla.edu>
1779 * glob_.h, glob.c: New files.
1781 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
1783 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
1785 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
1786 the configuration hassle isn't worth it.
1787 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
1788 (LONGEST_MODIFIER, PRIuMAX): Remove.
1790 2005-05-27 Bruno Haible <bruno@clisp.org>
1792 * getlogin_r.h: Remove second include of <stddef.h>.
1794 2005-05-25 Bruno Haible <bruno@clisp.org>
1795 Derek Price <derek@ximbiot.com>
1797 * getlogin_r.h: Simplify API documentation.
1799 2005-05-25 Derek Price <derek@ximbiot.com>
1800 Paul Eggert <eggert@cs.ucla.edu>
1802 * getlogin_r.c, getlogin_r.h: New files.
1804 2005-05-22 Bruno Haible <bruno@clisp.org>
1806 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
1807 Also include <sys/param.h> if it defines MIN, MAX.
1808 Based on a patch by Derek Price <derek@ximbiot.com>.
1810 2005-05-22 Bruno Haible <bruno@clisp.org>
1812 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
1813 (INT64_MIN): Fix definition.
1814 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1816 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
1817 NEED_SIGNED_INT_TYPES.
1819 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
1820 HAVE_SYSTEM_INTTYPES.
1822 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
1824 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
1825 so that unistd-safer.h (GPL'ed code) need not be included.
1827 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
1830 * fts.c: Don't include "cycle-check.h" or "hash.h".
1831 (setup_dir, free_dir): New functions.
1832 (enter_dir, leave_dir): Define trivial
1833 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
1834 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
1835 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
1836 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
1837 Move to fts-cycle.c.
1838 (fts_open): Use setup_dir.
1839 (fts_close): Use free_dir.
1840 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
1841 This adds a label and some gotos, but the alternatives were messier.
1842 Check for memory allocation failure when entering a dir.
1843 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
1844 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
1845 (FTS): New member fts_cycle, that is a union that contains the
1846 old active_dir_ht and cycle_state. All uses changed to mention
1847 fts_cycle.ht and fts_cycle.state.
1848 * fts-cycle.c: New file, containing GPL'ed code migrated out of
1849 fts.c, with the following changes:
1850 (setup_dir, free_dir): New functions.
1851 (enter_dir): Now returns bool. Return true if successful, false
1852 if memory exhausted. All callers changed.
1853 Do not bother partly cleaning up on
1854 memory allocation failure; that is free_dir's job.
1855 However, free ad if hash_insert fails, to avoid memory leak.
1856 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
1857 fts->fts_options to see which union member to use.
1859 2005-05-20 Jim Meyering <jim@meyering.net>
1861 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
1862 Now a macro, to pacify GCC.
1864 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
1866 * chown.c (rpl_chown): Return -1 on failure.
1868 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
1870 * canonicalize.c: Include canonicalize.h first, to test interface.
1871 Include <stddef.h> unconditionally, since we assume C89 now.
1872 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
1873 * fts.c: Include fts_.h first, to check interface.
1874 Do not include intprops.h; no longer needed.
1875 Include cycle-check.h and hash.h, since fts_.h no longer does.
1876 Remove unnecessary casts of closedir to void.
1877 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
1878 decide whether to decrement nlinks.
1879 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
1880 (FTS): Use struct hash_table * instead of Hash_table, so that
1881 we no longer need to include hash.h here.
1883 2005-05-17 Jim Meyering <jim@meyering.net>
1885 * fts.c, fts_.h: New files, from coreutils.
1887 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
1889 Sync from coreutils.
1890 * unlinkdir.c, unlinkdir.h: New files.
1891 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
1892 regex.h, unlocked-io.h, xtime.h:
1893 White space changes only.
1894 * makepath.c (make_path): Port to hosts where leading "//" is special.
1895 * yesno.c: Include getline.h, not ctype.h.
1896 (yesno): Don't remove leading white space; POSIX doesn't allow it.
1897 Use getline to remove arbitrary restriction on response length.
1899 2005-05-13 Bruno Haible <bruno@clisp.org>
1901 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
1902 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
1903 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
1904 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
1905 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
1906 Add support for 64-bit integers in the MSVC compiler.
1908 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
1910 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
1911 Change the initial comment to refer to GPL, not LGPL.
1912 gnulib-tool will change it to LGPL as needed.
1914 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
1915 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
1916 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
1917 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
1918 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
1919 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
1920 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
1921 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
1922 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
1923 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
1924 concatpath.c, config.charset, copy-file.c, copy-file.h,
1925 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
1926 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
1927 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
1928 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
1929 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
1930 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
1931 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
1932 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
1933 full-read.c, full-read.h, full-write.c, full-write.h,
1934 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
1935 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
1936 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
1937 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
1938 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
1939 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
1940 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
1941 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
1942 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
1943 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
1944 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
1945 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
1946 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
1947 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
1948 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
1949 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
1950 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
1951 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
1952 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
1953 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
1954 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
1955 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
1956 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
1957 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
1958 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
1959 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
1960 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
1961 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
1962 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
1963 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
1964 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
1965 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
1966 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
1967 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
1968 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
1969 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
1970 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
1971 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
1972 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
1973 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
1974 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
1975 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
1976 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
1977 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
1978 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
1979 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
1980 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
1981 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
1982 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
1983 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
1984 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
1985 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
1986 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
1987 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
1988 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
1989 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
1990 Update FSF postal mail address.
1992 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1994 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
1995 specified in ai_socktype. Fix invalid ai_protocol
1996 check. ai_protocol is usually set to 0 or depending on
1997 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
1998 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
1999 ai_socktype / ai_protocol in the returned addrinfo structure.
2001 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2002 Bruno Haible <bruno@clisp.org>
2004 * inet_ntop.h: New file.
2005 * inet_ntop.c: New file, from glibc with modifications.
2007 2005-05-08 Jim Meyering <jim@meyering.net>
2009 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
2011 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
2013 Merge from coreutils. Among other things,
2014 add bulletproofing for cases where stdin, stdout, or stderr are closed.
2015 * fd-safer.c: New file.
2016 * fcntl-safer.h, open-safer.c: Remove.
2017 * chdir-long.c: Fix comment "fetish" -> "coreutils".
2018 * dup-safer.c: Include unistd-safer.h first.
2019 Don't include errno.h.
2020 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
2021 * file-type.h: Don't assume invoker included sys/stat.h first.
2022 * file-type.c: Rely on file-type.h change.
2023 * getloadavg.c: Include unistd-safer.h.
2024 (getloadavg): Use safer open.
2025 * getusershell.c: Include "stdio-safer.h".
2026 (getusershell): Use safer fopen.
2027 * long-options.c (long_options): Use NULL rather than 0.
2028 * modechange.h (mode_free): Remove; all callers changed to invoke
2030 * modechange.c: Likewise.
2031 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
2032 (MODE_DONE): New constant.
2033 (struct mode_change): Remove 'next' member.
2034 (make_node_op_equals): New function; like the old one of the
2035 same name, except it allocates an array.
2036 (mode_compile, mode_create_from_ref): Use it.
2037 (mode_compile): Allocate result as an array, not a linked list.
2038 Parse octal string ourself, so that we catch mistakes like "+0".
2039 (mode_adjust): Arg is an array, not a linked list.
2040 * modechange.c: Include stat-macros.h, xalloc.h.
2041 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
2042 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
2043 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
2044 Remove. This is now stat-macros.h's job.
2045 (talloc): Remove. All callers replaced by xalloc, so that
2046 our invokers don't have to worry about reporting memory failures.
2047 (make_node_op_equals): Remove.
2048 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2050 (struct mode_change): Moved here from modechange.h.
2051 (mode_append_entry): Remove.
2052 (mode_compile): Remove MASKED_OPS arg, since it encouraged
2053 apps to have incorrect behavior. Use simpler algorithm for head
2054 and tail. Don't futz with umask; that's now the job of mode_adjust.
2055 Detect more invalid usages rather than having somewhat-random behavior.
2056 Don't insert an "a=" action, as that leads to incorrect behavior.
2057 (mode_compile, mode_create_from_ref): Return NULL on error instead
2058 of an enum, since now there's only one way to have an error. All
2060 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
2061 at the correct time. Simplify calculation of "+u" and its ilk.
2062 Don't mishandle "+X".
2063 (mode_free): Remove "register" and localize decls.
2064 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2065 (struct mode_change): Move to modechange.c; callers don't
2066 need to see this stuff.
2067 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
2068 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
2069 (mode_change, mode_adjust): Reflect the new signatures noted above.
2070 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
2071 that might redefine system include files.
2072 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
2073 (my_usleep): Use NULL rather than (void *) 0.
2074 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
2075 Use siginterrupt to specify that system calls should be interrupted.
2076 (rpl_nanosleep): Move initialization of suspended closer to call of
2078 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
2079 * readutmp.c: Likewise. Include signal.h, stdbool.h.
2080 (desirable_utmp_entry): New function.
2081 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
2082 using x2nrealloc, to simplify logic.
2083 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
2084 size calculation. Do not assume utmp file is a regular file.
2085 * readutmp.h (UT_PID): Moved here from ../src/who.c.
2086 (READ_UTMP_CHECK_PIDS): New constant.
2087 * save-cwd.c: Include unistd-safer.h.
2088 (save_cwd): Use fd_safer.
2089 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
2090 [!_LIBC] Include "stat-macros.h" instead.
2091 * unistd-safer.h (fd_safer): New decl.
2093 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
2095 * byteswap_.h: New file.
2097 2005-04-25 Albert Chin <china@thewrittenword.com>
2099 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
2102 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
2104 * getdate.y (zone): Allow relunit_snumber after tZONE, so
2105 that "UTC +1 second" continues to work. Problem reported
2107 (relunit_snumber): New rule.
2110 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
2112 * getdate.y (universal_time_zone_table): New constant.
2113 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
2114 universal_time_zone_table.
2115 (lookup_zone): Prefer universal_time_zone_table to
2116 local_time_zone_table, so that "GMT" time stamps are allowed in
2117 London during the summer. Problem reported by Ian Abbott.
2119 2005-04-12 Jim Meyering <jim@meyering.net>
2121 * human.c (humblock): Set *options even when returning due to
2122 xstrtoumax conversion failure. Thanks to a used-uninitialized
2125 2005-04-09 Jim Meyering <jim@meyering.net>
2127 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
2128 -Wuninitialized: initialize tm0.tm_year.
2130 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
2132 * getdate.y (parser_control): rels_seen is now a boolean, not a
2133 count, since there's no maximum. All uses changed.
2134 Add member dsts_seen.
2135 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
2137 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
2138 Use pc_rels_seen to decide whther a date is absolute.
2140 * getdate.y (number): Don't overwrite year.
2141 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
2144 2005-04-02 Simon Josefsson <jas@extundo.com>
2146 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
2147 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
2149 2005-03-27 Jim Meyering <jim@meyering.net>
2151 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
2153 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
2155 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
2156 "one's complement" -> "ones' complement" in comment, as per Knuth.
2157 "value of type" -> "type or expression" in comment.
2158 * mktime.c, strftime.c: Propagate intprops.h comment nits.
2160 2005-03-26 Jim Meyering <jim@meyering.net>
2163 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
2164 Correct typos: s/or/of/.
2166 2005-03-23 Jim Meyering <jim@meyering.net>
2168 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
2170 2005-03-21 Jim Meyering <jim@meyering.net>
2172 Changes imported from coreutils.
2174 * cycle-check.c: Don't include xalloc.h.
2176 * path-concat.c: Don't include assert.h.
2177 (path_concat): Remove assertion that would have triggered
2178 for ABASE starting with more than one slash.
2179 Reported by Andreas Schwab.
2181 * path-concat.c (path_concat): Set *BASE_IN_RESULT
2182 properly when ABASE is an absolute file name.
2183 Correct the description of this function.
2185 Add an assertion and a test driver.
2186 This fixes a bug introduced on 2004-07-02.
2187 Andreas Schwab reported the resulting failure of cp --parents:
2188 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
2190 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
2192 * strftime.c (my_strftime): If the underlying strftime returns 0
2193 (which shouldn't happen), generate nothing instead of returning 0
2194 immediately, so that nstrftime (NULL, ...) doesn't return 0.
2196 2005-03-16 Bruno Haible <bruno@clisp.org>
2198 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
2200 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
2202 * strftime.c (my_strftime): Prepend space to format so that we can
2203 reliably distinguish strftime failure from empty output on POSIX
2206 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
2208 * iconvme.c (SIZE_MAX): New macro, if not already defined.
2209 (iconv_string): Don't guess a size-zero buffer, as that might cause
2210 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
2211 result would be 'too large', where 'too large' is (heuristically)
2212 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
2213 overflow concerns. This will prevent some unwanted malloc failures
2214 when the inputs are very large.
2216 2005-03-15 Bruno Haible <bruno@clisp.org>
2218 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
2221 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
2224 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
2226 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
2228 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
2229 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
2231 * strtol.c: Likewise.
2233 2005-03-14 Simon Josefsson <jas@extundo.com>
2235 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
2238 2005-03-14 Jim Meyering <jim@meyering.net>
2240 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
2241 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
2242 to be nonzero so that we (and caller) can detect the difference
2243 between a valid zero-length expansion and an error return, even
2244 when the underlying strftime fails before writing anything into
2247 2005-03-10 Jim Meyering <jim@meyering.net>
2249 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
2250 so that this module works on systems without fchdir.
2252 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
2254 Factor int-properties macros into a single file, except for
2255 glibc-related files.
2256 * intprops.h: New file.
2257 * getloadavg.c: Include it instead of limits.h.
2258 (INT_STRLEN_BOUND): Remove.
2259 * human.c: Include intprops.h.
2260 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2261 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2262 * inttostr.h: Include intprops.h instead of limits.h.
2263 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2264 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2265 for consistency with intprops.h.
2266 (time_t_is_integer, twos_complement_arithmetic): Use them.
2267 * sig2str.h: Include <signal.h>, intprops.h.
2268 (INT_STRLEN_BOUND): Remove.
2269 * strftime.c (TYPE_SIGNED): Remove.
2270 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2271 * strtol.c: Adjust comments to match intprops.h.
2272 * userspec.c: Include intprops.h.
2273 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2274 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2275 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2276 instead of rolling our own expressions.
2277 * xstrtol.c: Include xstrtol.h first, to test interface.
2279 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
2281 (my_strftime): Do not mishandle years close to INT_MAX, by doing
2282 the right thing even if adding 1900 would overflow. Similarly
2283 for tm_mon + 1 and tm_yday + 1.
2284 Make %Y always equivalent to %C%y, and similarly for %G and %g.
2285 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2286 (DO_SIGNED_NUMBER): New macro.
2287 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2289 2005-03-07 Bruno Haible <bruno@clisp.org>
2291 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
2293 2005-03-03 Derek R. Price <derek@ximbiot.com>
2294 Bruno Haible <bruno@clisp.org>
2296 * pagealign_alloc.h: New file.
2297 * pagealign_alloc.c: New file.
2299 2005-01-28 Bruno Haible <bruno@clisp.org>
2301 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
2304 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
2306 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2307 The workaround isn't strictly needed for POSIX conformance, and
2308 it's too much of a pain to configure and maintain. We'll ask
2309 people to fix their kernels instead.
2310 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2311 (NANOSLEEP_BUG_WORKAROUND): Remove.
2312 (xnanosleep): Remove the workaround.
2314 2005-02-12 Bruno Haible <bruno@clisp.org>
2316 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
2318 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
2320 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2321 * timespec.h (gettime): Return void, since it always
2322 succeeds now. All uses changed.
2323 * gettime.c (gettime) Likewise.
2324 [HAVE_NANOTIME]: Prefer nanotime.
2325 Assume gettimeofday succeeds, as POSIX requires.
2326 Assime time () succeeds, since other code already does.
2327 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2328 (timespec_subtract): Remove.
2329 (NANOSLEEP_BUG_WORKAROUND): New constant.
2330 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2331 things considerably. Use it only on GNU/Linux hosts, since the
2332 workaround shouldn't be needed elsewhere.
2334 2005-02-24 Bruno Haible <bruno@clisp.org>
2336 * gettext.h: Update from GNU gettext 0.14.2.
2338 2005-02-24 Bruno Haible <bruno@clisp.org>
2340 * localcharset.c: Update from GNU gettext 0.14.2.
2341 * config.charset: Update from GNU gettext 0.14.2.
2343 2005-02-22 Simon Josefsson <jas@extundo.com>
2345 * iconvme.h, iconvme.c: New files, from libc.
2347 2005-02-20 Neil Conway <neilc@samurai.com>
2349 * xgethostname.c (xgethostname): Check for ENOMEM, which is
2350 returned by OSX/Darwin if the specified buffer is not large
2351 enough for the hostname.
2353 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
2355 * memrchr.h: New file.
2356 * chdir-long.c: Include it.
2357 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
2358 Don't bother including stddef.h.
2360 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2362 * argp-help.c (__argp_help): Create a fake struct argp_state and
2363 pass it to _help, otherwise the latter coredumps trying to
2364 dereference state.root_argp.
2366 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
2368 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2370 Include <sys/types.h>, for dev_t.
2371 (ME_DUMMY, ME_REMOTE): Move from here....
2372 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2373 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
2375 Include mountlist.h first, to test the interface.
2377 2005-01-29 Bruno Haible <bruno@clisp.org>
2379 * progname.c (program_name): Initialize.
2380 Needed when linking statically on MacOS X.
2382 2005-01-28 Bruno Haible <bruno@clisp.org>
2384 * javacomp.sh.in: New file, from GNU gettext.
2385 * javacomp.h: New file, from GNU gettext.
2386 * javacomp.c: New file, from GNU gettext.
2388 2005-01-26 Bruno Haible <bruno@clisp.org>
2390 * javaexec.sh.in: New file, from GNU gettext.
2391 * javaexec.h: New file, from GNU gettext.
2392 * javaexec.c: New file, from GNU gettext.
2394 2005-01-26 Simon Josefsson <jas@extundo.com>
2396 * gai_strerror.c: Use GPL in header.
2398 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2400 * argp-help.c (hol_entry_help): Avoid using non-constant
2401 initializers for struct pentry_state.
2402 (__argp_error): Check return value of __asprintf
2403 (__argp_failure): Translate error message
2405 * argp-parse.c: Removed braces around the expansion of N_()
2407 2005-01-21 Jim Meyering <jim@meyering.net>
2409 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2410 same value as for Solaris 9.
2412 * chdir-long.c (chdir_long): Rewrite to remove limitation on
2413 component length. This included changing the parameter to be
2414 of type `char *' rather than `char const *'.
2415 * chdir-long.h (chdir_long): Update prototype.
2417 * openat.c (fdopendir, fstatat): New functions.
2418 * openat.h: Include headers required for use of DIR and struct stat.
2419 [AT_SYMLINK_NOFOLLOW]: Define.
2420 (fdopendir, fstatat): Add prototypes.
2422 2005-01-21 Bruno Haible <bruno@clisp.org>
2424 * classpath.h: New file, from GNU gettext.
2425 * classpath.c: New file, from GNU gettext.
2427 2005-01-20 Simon Josefsson <jas@extundo.com>
2429 * version-etc-fsf.c: New file, with version_etc_copyright.
2430 * version-etc.c: Remove version_etc_copyright.
2431 * version-etc.h (version_etc_copyright): Use [] instead of * in
2432 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
2434 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
2436 * save-cwd.c (save_cwd): Remove code to support the case
2437 where fchdir is missing or flaky.
2439 2005-01-20 Simon Josefsson <jas@extundo.com>
2441 * base64.h (isbase64): Add.
2443 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
2444 using a unsigned prototype, don't inline.
2445 (base64_decode): Use it.
2447 2005-01-19 Bruno Haible <bruno@clisp.org>
2449 * sh-quote.h: New file, from GNU gettext.
2450 * sh-quote.c: New file, from GNU gettext.
2452 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
2454 Merge changes from coreutils, as described below in several
2455 changelogs dated today.
2457 * save-cwd.c: Include "save-cwd.h" before other include files.
2458 (O_DIRECTORY): Remove; not needed here, since "." must be
2459 a directory. All uses removed.
2460 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
2461 universal on Suns, and we also need to test for IRIX.
2462 Revamp code to use 'if' rather than '#if'.
2463 Avoid unnecessary comparison of cwd->desc to 0.
2465 * utimens.c (futimens): Robustify the previous patch, by checking
2466 for known valid error numbers rather than observed invalid ones.
2468 2005-01-18 Jim Meyering <jim@meyering.net>
2470 * version-etc.c (version_etc_copyright): Update copyright date.
2472 * utimens.c (futimens): Account for the fact that futimes
2473 can also fail with errno == ENOSYS or errno == ENOENT.
2474 Patch from Dmitry V. Levin.
2476 Change the name of the robust chdir function from chdir to chdir_long.
2477 * save-cwd.c: Include chdir-long.h rather than chdir.h.
2478 (restore_cwd): Use chdir_long, not chdir.
2479 * chdir-long.c: Renamed from chdir.c.
2480 * chdir-long.h: Renamed from chdir.h.
2481 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
2484 2005-01-18 Bob Proulx <bob@proulx.com>
2486 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
2487 offsetof() macro construct to avoid compile failure with native HP-UX
2488 11.0 ANSI C compiler.
2490 2005-01-06 Bruno Haible <bruno@clisp.org>
2492 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
2493 because stpncpy.m4 takes care of it.
2495 2004-01-24 Bruno Haible <bruno@clisp.org>
2497 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
2499 2003-10-09 Bruno Haible <bruno@clisp.org>
2501 * progreloc.c: Include xalloc.h instead of xmalloc.h.
2503 2005-01-06 Bruno Haible <bruno@clisp.org>
2505 * fwriteerror.h (fwriteerror): Change specification to include fclose.
2506 * fwriteerror.c: Include <stdbool.h>.
2507 (fwriteerror): At the end, close the file stream. Record whether
2508 stdout was already closed.
2510 2004-05-27 Bruno Haible <bruno@clisp.org>
2512 * execute.c (environ): Declare if needed.
2513 * pipe.c (environ): Likewise.
2514 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
2516 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
2518 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
2519 definitions to be after all include files, to avoid collisions.
2520 Problem reported by Bob Proulx.
2522 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
2524 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
2525 not needed. This removes a dependency on the gettext module.
2526 [defined _LIBC]: Do not include <libintl.h>; not needed.
2528 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
2530 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
2533 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
2535 * argp-parse.c: Include <stddef.h>.
2536 (alignof, alignto): New macros.
2537 (parser_init): Don't assume that void * is aligned sufficiently
2540 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
2541 need to extend the stack.
2542 (YYINITDEPTH): New macro, so that the initial stack isn't overly
2545 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2547 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
2549 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
2551 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
2552 Remove now-obsolete comment about AIX.
2553 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
2554 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
2555 (YYMAXDEPTH): New macro.
2557 2004-12-18 Bruno Haible <bruno@clisp.org>
2559 * fatal-signal.c (fatal_signals): Make non-const.
2560 (init_fatal_signals): New function.
2561 (uninstall_handlers, install_handlers): Ignore signals that were set to
2563 (at_fatal_signal): Call init_fatal_signals.
2564 (init_fatal_signal_set): Likewise. Ignore signals that were set to
2566 Reported by Paul Eggert.
2568 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2570 * getdate.y (textint): New member "negative".
2571 (time_zone_hhmm): New function.
2572 Expect 14 shift-reduce conflicts, not 13.
2573 (o_colon_minutes): New rule.
2574 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
2575 (yylex): Set the "negative" member of signed numbers.
2577 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
2579 Changes imported from coreutils.
2580 * hard-locale.c: Assume <locale.h> exists.
2582 (GLIBC_VERSION): New macro.
2583 (hard_locale): Assume setlocale exists.
2584 Rewrite to avoid #ifdef.
2585 Use strdup rather than malloc + strcpy.
2586 * human.c: Assume <locale.h> exists.
2587 (human_readable): Assume localeconv exists.
2589 2004-12-01 Jakub Jelinek <jakub@redhat.com>
2591 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
2592 convert T2, not T. (Imported from libc.)
2594 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
2596 * getcwd.c (is_ENAMETOOLONG): New macro.
2597 (__getcwd.c): Don't restore errno; glibc doesn't.
2598 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
2599 first, falling back to our code only if its results look suspicious.
2600 Ensure that the resulting buffer is only as large as necessary.
2602 * readutmp.c: Include readutmp.h first.
2603 Include <errno.h>, since readutmp.h no longer does that.
2604 * readutmp.h: Don't include <errno.h>,
2605 <sys/param.h>, <time.h>; not needed to establish interface.
2606 (errno): Remove decl.
2607 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
2608 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
2609 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
2611 2004-11-28 Simon Josefsson <jas@extundo.com>
2613 * base64.h, base64.c: New file.
2615 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
2617 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
2619 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
2621 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
2622 HP's ANSI C compiler.
2623 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
2624 Declaring int functions causes warnings on some modern systems and
2625 shouldn't be needed to compile on ancient ones.
2626 * same.c (MIN) [defined MIN]: Don't define, since it's already
2629 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
2630 with the following changes.
2631 (__set_errno): Parenthesize properly.
2632 Include <stdbool.h>.
2633 (MIN, MAX, MATCHING_INO): New macros.
2634 (__getcwd): Define with prototype, not K&R form.
2635 Use heuristics to allocate default buffer on stack if possible.
2636 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
2637 behavior, and to avoid the PATH_MAX limit when computing
2639 Use MATCHING_INO to compare inode number to file.
2640 Check for arithmetic overflow in size calculations.
2641 Fix bug in reallocation of dot array that caused getcwd to fail
2642 on directories nested deeper than 75.
2643 Be more careful about saving errno on error.
2644 Do not use realloc; use only free+malloc, as this is a bit
2645 more flexible and avoids a needless copy operation.
2646 Do not inspect st_dev and st_ino for symbolic links; POSIX
2647 doesn't specify the latter.
2648 Check for closedir errors.
2649 Avoid needless casts.
2650 Use "#ifdef weak_alias" around weak_alias, to be like other
2652 The following changes to getcwd.c have effect only when used in
2653 gnulib; they have no effect inside glibc proper.
2654 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
2655 as alloca isn't used.
2656 (alloca, __alloca): Likewise.
2657 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
2658 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2659 unconditionally, as gnulib assumes C89 or better.
2660 Do not include <sys/param.h>.
2661 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
2662 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
2664 (NULL) [!defined NULL]: Remove; we assume C89 or better.
2665 Include <dirent.h> in a way that is compatible with modern Autoconf.
2666 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
2667 New macros, if not already defined.
2668 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
2669 Use "_LIBC", not "defined _LIBC", for consistency.
2670 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
2672 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
2673 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
2674 * xgetcwd.c: David MacKenzie's old code was removed, so give
2675 credit only to Jim Meyering and adjust the copyright dates.
2676 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
2677 <stdlib.h>, <unistd.h>, "pathmax.h".
2678 Instead, include "xgetcwd.h" (first) and "getcwd.h".
2679 (INITIAL_BUFFER_SIZE): Remove.
2680 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
2682 2004-11-23 Jim Meyering <jim@meyering.net>
2684 * getopt_.h: Remove trailing blanks.
2686 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
2688 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
2689 (futimens): New function, which uses futimes if available.
2690 (futimens, utimens): Support timespec==NULL, with same semantics
2691 as utime and utimens.
2692 * utimens.h (futimens): New decl.
2694 2004-11-23 Jim Meyering <jim@meyering.net>
2696 * __fpending.c: Add comment.
2698 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2700 * getopt_.h: Re-addition of __getopt_argv_const caused
2701 redefinition warnings. To avoid them, include the defines
2702 in `#if !defined __need_getopt ... #endif'. The only place
2703 where __getopt_argv_const is used is in definitions
2704 of getopt_long and getopt_long_only below, which are as well
2705 protected by `#ifndef __need_getopt'.
2706 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
2707 __need_getopt after including <stdio.h> and <unistd.h> These
2708 headers might have defined it.
2710 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
2712 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
2714 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
2715 optopt): Use them instead of invoking ## directly; otherwise, the
2716 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
2718 2004-11-19 Bruno Haible <bruno@clisp.org>
2720 * strtok_r.c: Move comments from here...
2721 * strtok_r.h: ... to here.
2723 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
2725 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
2726 might fail. Problem reported by Yoann Vandoorselaere.
2727 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
2728 that mishandle size_t overflow.
2730 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
2732 * canon-host.c: Include "strdup.h".
2733 (canon_host): Use getaddrinfo if available, so that IPv6 works.
2734 Use strdup instead of malloc/strcpy to duplicate strings.
2736 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
2737 (human_space_before_unit): New constant.
2738 * human.c (human_readable): Support it.
2740 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
2741 (xgetcwd): Set errno correctly when failing.
2742 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
2743 the failure is actually due to a PATH_MAX problem.
2745 Further getopt changes to make it more likely that glibc will
2746 buy the changes back.
2747 * getopt.c (POSIXLY_CORRECT): New constant.
2748 (getopt): Use it, so to preserve glibc semantic
2749 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
2750 when compiling for libc.
2751 * getopt_.h (__getopt_argv_const): Bring it back.
2752 (getopt_long, getopt_long_only): Use it.
2754 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
2755 New arg POSIXLY_CORRECT. All callers changed.
2756 (getopt): Argv is now char * const *, as per standard.
2757 (_getopt_internal_r, _getopt_internal): Argv is now char **,
2758 not char *__getopt_argv_const *.
2759 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2760 _getopt_long_only_r): Likewise.
2761 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
2762 * getopt_int.h (_getopt_internal, _getopt_internal_r,
2763 _getopt_long_r, _getopt_long_only_r): Likewise.
2764 * getopt_.h (__getopt_argv_const): Remove.
2765 (getopt): Argv is now char * const *, as per standard.
2767 * getdate.y (tORDINAL): New token.
2768 (day, relunit): Allow it for relative times.
2769 (relative_time_table): Use tORDINAL for ordinals.
2771 2004-11-15 Jim Meyering <jim@meyering.net>
2773 * closeout.c: Include "__fpending.h" once again.
2774 Include <stdbool.h>.
2775 (close_stdout): Don't fail just because stdout was closed initially,
2776 since some programs don't write to stdout in the normal course of
2777 operation (other than --version and --help), and we don't want this
2778 function to make e.g. `touch file >&-' fail.
2779 But do fail if it was closed and someone has tried to write to it.
2780 E.g., `printf foo >&-' must fail.
2782 2004-11-11 Simon Josefsson <jas@extundo.com>
2784 * strtok_r.h, strtok_r.c: New file.
2786 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
2788 * getopt_.h (__getopt_argv_const): New macro, to be used so that
2789 we can stop lying to compilers about the constness of argv when we
2790 are compiled outside glibc.
2791 (getopt, getopt_long, getopt_long_only): Use it.
2792 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
2794 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2795 _getopt_long_only_r): Likewise.
2796 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
2797 _getopt_long_only_r): Likewise.
2799 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
2800 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
2801 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
2802 the other external symbols.
2803 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
2804 declaration, since the above renaming now works around collisions.
2806 2004-11-11 Jim Meyering <jim@meyering.net>
2808 * linebreak.c: Remove trailing blanks.
2809 * alloca_.h: Likewise.
2810 * acosl.c: Likewise.
2811 * euidaccess.c: Likewise.
2812 * allocsa.h: Likewise.
2814 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
2816 * mktime.c (SHR): New macro, which is a portable
2817 substitute for >> that should work even on Crays.
2818 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
2819 Problem reported by Mark D. Baushke in
2820 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
2821 * getdate.y (SHR): Likewise.
2823 * strftime.c (SHR): Likewise.
2825 * quotearg.c (struct quoting_options): Use unsigned int for
2826 quote_these_too, so that right shifts are well defined. All uses
2829 2004-11-10 Simon Josefsson <jas@extundo.com>
2831 * getaddrinfo.h, getaddrinfo.c: New files.
2833 2004-11-10 Jim Meyering <jim@meyering.net>
2835 Ensure that no close failure goes unreported.
2836 * closeout.c (close_stdout): Always close stdout. I.e., don't
2837 return early when it seems there's nothing to flush.
2838 Don't include __fpending.h.
2840 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
2842 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
2844 2004-11-05 Bruno Haible <bruno@clisp.org>
2846 * readlink.c: Include stddef.h, needed for size_t on Woe32.
2847 Reported by Mark D. Baushke <mdb@cvshome.org>.
2849 2004-11-04 Bruno Haible <bruno@clisp.org>
2851 2004-09-11 Bruno Haible <bruno@clisp.org>
2852 * allocsa.valgrind: New file.
2853 2004-02-06 Bruno Haible <bruno@clisp.org>
2854 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
2855 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
2856 Reported by Christopher Seip <chris.seip@hp.com>.
2858 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
2860 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
2861 with errno == ERANGE if the buffer is too small.
2862 Problem reported by Mark D. Baushke.
2864 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
2866 * xreadlink.c (MAXSIZE): New macro.
2867 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
2868 size does not exceed MAXSIZE. Avoid cast.
2869 As suggested by Mark D. Baushke in
2870 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
2871 if readlink fails with buffer size just under MAXSIZE, try again
2874 2004-11-02 Derek R. Price <derek@ximbiot.com>
2875 and Paul Eggert <eggert@cs.ucla.edu>
2877 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
2878 (get_date): Overparenthesize to avoid GCC warning.
2880 2004-11-02 Bruno Haible <bruno@clisp.org>
2882 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
2883 function returns void.
2885 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
2887 * getpass.c (fflush_unlocked, flockfile, funlockfile)
2888 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
2891 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
2893 * getdate.y: Add support for TZ="foo" within a date string.
2894 Fix some bugs near time_t boundaries. Reject dates with
2895 out-of-range components, e.g., "Sept 31".
2896 Include <stdlib.h>, "setenv.h", "xalloc.h".
2897 (ISDIGIT_LOCALE): Remove; unused.
2898 Note that the TZ and time functions used here are not reentrant.
2899 (mktime_ok, get_tz): New functions.
2900 (TZBUFSIZE): New constant.
2901 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
2902 This requires that we sometimes generate our own TZ="XXX..." setting.
2904 2004-10-27 Derek R. Price <derek@ximbiot.com>
2906 * mktime.c (not_equal_tm): Remove redundant check.
2908 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
2910 * getdate.y: Use Bison 1.875 features, and some minor
2911 code cleanups. This change does not affect semantics.
2912 Don't include <stdlib.h>; no longer needed.
2913 Don't include unlocked-io.h; only the "#if TEST" code uses
2914 stdio, and performance isn't crucial there.
2915 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
2916 Bison 1.875 features as described below.
2917 All uses of "PC." replaced by "pc->".
2918 (YYSTYPE): Add a forward declaration.
2919 (yylex, yyerror): Use full prototypes in forward decls.
2920 Use "%pure-parser" rather than obsolescent "%pure_parser".
2921 Use %parse-param and %lex-param instead of obsolescent
2922 YYPARSE_PARAM and YYLEX_PARAM.
2923 (meridian_table, month_and_day_table, time_units_table,
2924 relative_time_table, time_zone_table, military_table,
2925 lookup_zone, lookup_word, get_date):
2926 Use NULL instead of 0 where appropriate.
2927 (to_hour): Avoid abort (), to avoid a dependency on
2929 (yyerror, yylex): Now accepts parser_control * arg.
2930 (main) [TEST]: Use '\0' rather than 0 for char.
2932 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
2934 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
2935 It's now the caller's responsibility to handle the case where
2936 !HAVE_GETPAGESIZE && !defined getpagesize.
2938 * mktime.c (leapyear): Arg is long int, not int.
2940 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
2942 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
2944 2004-10-12 Simon Josefsson <jas@extundo.com>
2946 * getpass.c (fflush_unlocked, flockfile, funlockfile)
2947 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
2950 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
2952 * vsnprintf.h: New file.
2953 * vsnprintf.c: New file.
2955 2004-10-07 Bruno Haible <bruno@clisp.org>
2957 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
2958 into the provided buffer.
2960 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
2962 * diacrit.c, diacrit.h: Add GPL notice.
2964 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
2965 * atanl.c (atanl): Keep the code as similar to glibc as possible.
2966 * logl.c (logl): Keep the code as similar to glibc as possible.
2967 This avoids a potential constant-folding bug.
2969 2004-10-05 Bruno Haible <bruno@clisp.org>
2971 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
2973 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2975 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
2976 * xmalloc.c (xmemdup): Likewise.
2977 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
2978 XFREE): Remove these long-obsolescent macros.
2979 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
2980 * xstrdup.c: Remove.
2982 * regex.c (re_comp): Cast gettext return value to char *,
2983 Problem reported by Martin Neitzel via Mark D. Baushke.
2985 2004-10-04 Simon Josefsson <jas@extundo.com>
2987 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
2988 '#ifdef USE_UNLOCKED_IO'.
2990 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2992 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
2993 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
2994 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
2995 regex.c, sha1.c, version-etc.c, yesno.c:
2996 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
2997 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
2998 the includer's responsibility.
3000 Sync from coreutils.
3002 * modechange.c (mode_compile): Don't decrement a pointer that
3003 points to the start of a string, as the C Standard says the
3004 resulting behavior is undefined.
3006 * backupfile.h (enum backuptype): Rename none -> no_backups,
3007 simple -> simple_backups, numbered_existing ->
3008 numbered_existing_backups, numbered -> numbered_backups
3009 to avoid shadowing problems. All uses changed.
3010 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
3011 * backupfile.c (check_extension, numbered_backup):
3012 Rename locals to avoid shadowing 'basename'.
3013 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
3016 * .cppi-disable: Add getopt_.h, getopt_int.h.
3017 * .cvsignore: Add getopt.h.
3019 2004-10-04 Simon Josefsson <jas@extundo.com>
3021 * memmem.h: New file.
3022 * memmem.c: New file, taken from glibc.
3024 2004-10-02 Jim Meyering <jim@meyering.net>
3026 * dirfd.h, getpagesize.h: Add copyright notice.
3028 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
3030 * snprintf.c: Remove comments as to why each header is needed.
3032 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
3034 * strsep.h: New file.
3035 * strsep.c: New file.
3037 2004-10-01 Simon Josefsson <jas@extundo.com>
3039 * snprintf.c (snprintf): Handle size==0.
3041 2004-10-01 Simon Josefsson <jas@extundo.com>
3042 Bruno Haible <bruno@clisp.org>
3044 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
3045 (snprintf): Declare 'args'.
3047 2004-09-30 Simon Josefsson <jas@extundo.com>
3049 * snprintf.h, snprintf.c: New files.
3051 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3053 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
3054 (hol_entry_help): Never translate an empty string.
3055 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
3056 * argp.h (OPTION_NO_TRANS): New option.
3058 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
3060 * xvasprintf.c: Include xalloc.h.
3061 (xvasprintf): Use xalloc_die, not xmalloc_die.
3063 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
3065 * dummy.c: Change copyright notice to FSF, and license to GPL.
3067 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
3069 * argp-pvh.c (argp_program_version_hook): Provide initial value.
3070 Problem reported by Bruno Haible in:
3071 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
3073 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
3075 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
3076 in case some system header has #define'd it. Problem reported by
3077 Soeren D. Schulze in
3078 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
3080 2004-09-08 Bruno Haible <bruno@clisp.org>
3082 * stdint_.h: New file, taken from GNU clisp.
3084 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
3086 * xvasprintf.h: New file.
3087 * xvasprintf.c: New file.
3088 * xasprintf.c: New file.
3090 2004-09-08 Bruno Haible <bruno@clisp.org>
3092 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
3094 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
3096 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
3098 Import from coreutils.
3099 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
3100 strings on unbounded length. alloca's performance benefits aren't
3101 that important here.
3103 (parse_with_separator): New function, with most of the internals
3104 of the old parse_user_spec. Allow user to omit both user and group,
3105 for compatibility with FreeBSD.
3106 Clone only the user name, not the entire spec.
3107 Do not set *uid, *gid unless entirely successful.
3108 Avoid memory leak in some failing cases.
3109 Fix regression for USER.GROUP reported by Dmitry V. Levin in
3110 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
3111 (parse_user_spec): Rewrite to use parse_with_separator.
3113 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
3115 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
3116 its complicated substitute.
3117 * argp-help.c: Include <errno.h>, for program_invocation_short_name
3118 and program_invocation_name.
3119 (__argp_basename) [!_LIBC]: Remove; the only use was
3120 replaced by its body.
3121 (__argp_short_program_name): Change condition from
3122 !defined __argp_short_program_name to
3123 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
3124 to match argp-namefrob.h.
3125 (__argp_failure): Don't assume strerror_r returns char *.
3126 * argp-parse.c (N_): Define unconditionally.
3127 (argp_default_options): Fill out initializers with 0 to avoid
3130 2004-08-12 Simon Josefsson <jas@extundo.com>
3132 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
3133 * getopt_.h: Renamed from getopt.h.
3135 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
3137 Merge from coreutils.
3139 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
3140 wmemchr or wmemcpy. Problem reported by Robert Dahlem
3141 for Reliant Unix 5.43.
3143 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
3144 (union fooround): Use uintmax_t, not long int.
3145 The rest is a merge from libc:
3146 [defined _LIBC]: Include <shlib-compat.h>.
3147 (_obstack) [defined _LIBC]: Remove after 2.3.4.
3149 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
3151 * strverscmp.c: Convert to UTF-8.
3153 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
3155 * obstack.h (obstack_empty_p):
3156 Don't assume that chunk->contents is suitably aligned.
3157 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
3158 Likewise. Problem reported by Benno in
3159 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
3161 * chown.c (rpl_chown): Work even if the file is writeable but not
3162 readable. This could be improved further but it'd take some work.
3164 2004-08-08 Simon Josefsson <jas@extundo.com>
3166 * xgethostname.c: Don't include error.h (not used).
3169 * getpass.c: Include getpass.h first.
3171 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
3173 * xalloc-die.c: New files.
3174 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
3176 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
3177 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
3178 (_, N_, xalloc_die): Move to xalloc-die.c.
3179 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
3180 so that we needn't mess with xalloc_msg_memory_exhausted.
3182 * sha1.h: Renamed from sha.h.
3183 (SHA1_H): Renamed from _SHA_H.
3184 (sha1_ctx): Renamed from sha_ctx.
3185 (sha1_init_ctx): Renamed from sha_init_ctx.
3186 (sha1_process_block): Renamed from sha_process_block.
3187 (sha1_process_bytes): Renamed from sha_process_bytes.
3188 (sha1_finish_ctx): Renamed from sha_finish_ctx.
3189 (sha1_read_ctx): Renamed from sha_read_ctx.
3190 (sha1_stream): Renamed from sha_stream.
3191 (sha1_buffer): Renamed from sha_buffer.
3192 * sha1.c: Likewise; renamed from sha.c.
3193 Do not include <sys/types.h>.
3194 Include <stddef.h> rather than <stdlib.h>.
3196 2004-08-08 Bruno Haible <bruno@clisp.org>
3198 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
3199 FILESYSTEM_PREFIX_LEN.
3200 * progreloc.c: Likewise.
3201 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
3203 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
3206 * argp-help.c (make_hol, hol_append): Don't assume that
3207 SIZE_MAX is a valid preprocessor constant.
3208 (__argp_basename): Change from "#ifndef _LIBC"
3209 to "#ifndef __argp_short_program_name", so that
3210 we don't compile these functions for tar.
3212 More merges from coreutils.
3213 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
3214 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
3216 * addext.c: Remove; no longer needed.
3217 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
3218 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
3219 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
3220 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
3221 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
3222 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
3223 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
3224 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
3225 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
3226 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
3227 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
3228 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
3229 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
3230 Import changes from coreutils.
3232 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
3234 Merge from coreutils.
3236 * .gdb-history: Remove; this doesn't belong here.
3238 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
3239 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
3240 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
3242 * dirname.h: Include <stdbool.h>.
3243 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
3244 for consistency with POSIX terminology. All uses changed.
3245 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
3246 (strip_trailing_slashes): Use bool for booleans.
3247 * stripslash.c (strip_trailing_slashes): Likewise.
3249 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
3250 sometimes returns a positive errno value even when it succeeds.
3251 (print_errno_message) [!LIBC]: Fall back on strerror if
3254 * path-concat.c (mempcpy): Don't define if a system header defines it.
3255 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
3256 (longest_relative_suffix): New function.
3257 (path_concat): Use it. Assume first argument is not NULL.
3258 Port to DOS. Omit redundant separators.
3259 Report an error instead of returning NULL.
3260 Use mempcpy instead of memcpy.
3261 (xpath_concat): Remove: not declared or used.
3263 * same.h: Include <stdbool.h>
3264 (same_name): Return bool, not int.
3265 * same.c (same_name): Likewise.
3266 (errno): Don't declare; we assume C89 or better now.
3268 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
3269 if not already defined.
3271 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
3272 * dup-safer.c (errno): Likewise.
3274 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
3276 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
3279 2004-08-03 Simon Josefsson <jas@extundo.com>
3281 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
3282 * progname.h: Don't include stdbool.h.
3284 2004-08-02 Simon Josefsson <jas@extundo.com>
3286 * getsubopt.h: New file, with comments from Bruno Haible.
3287 * getsubopt.c: New file, from glibc, but slightly modified based on
3288 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
3290 2004-08-01 Simon Josefsson <jas@extundo.com>
3292 * xgetdomainname.c: Include stdlib.h, for free().
3294 2004-07-16 Simon Josefsson <jas@extundo.com>
3296 * dummy.c: New file.
3298 2004-07-16 Bruno Haible <bruno@clisp.org>
3300 * backupfile.h: Add extern "C" for C++.
3301 * closeout.h: Likewise.
3302 * copy-file.h: Likewise.
3303 * findprog.h: Likewise.
3304 * full-write.h: Likewise.
3305 * pathname.h: Likewise.
3306 * progname.h: Likewise.
3307 * stpcpy.h: Likewise.
3308 * stpncpy.h: Likewise.
3309 * strcase.h: Likewise.
3310 * strstr.h: Likewise.
3311 * xalloc.h: Likewise.
3313 * mbswidth.h: Add extern "C" for C++.
3314 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
3316 2004-07-09 Simon Josefsson <jas@extundo.com>
3318 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
3319 failed without this.)
3321 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
3323 * fchown-stub.c: New file.
3325 2004-06-24 Jim Meyering <jim@meyering.net>
3327 * obstack.h (obstack_base): Cast to (void *), per documentation.
3329 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
3331 * argz.c, argz_.h: New files, which are autoupdated from libtool.
3333 2004-06-01 Jim Meyering <jim@meyering.net>
3335 * calloc.c: New file.
3337 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
3339 * getdate.y (yylex): Allow space between sign and number.
3340 Problem reported by Dan Jacobson.
3342 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
3343 and Jim Meyering <jim@meyering.net>
3345 Merge from coreutils CVS.
3347 * stat-macros.h: New file, with contents from file-type.h
3348 and coreutils' system.h.
3349 * file-type.c: Include "stat-macros.h".
3350 * file-type.h (file_type): Move all macro definitions to new file,
3353 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
3354 Wrap old code with this conditional.
3355 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
3356 function that does not dereference symlinks.
3357 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
3359 * xreadlink.c: Include xreadlink.h first, to catch .h file
3360 dependency problems.
3361 (xreadlink): Accept new arg SIZE, for efficiency.
3362 All decls and uses changed.
3363 * xreadlink.h: Include <stddef.h>, for size_t.
3365 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
3366 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
3368 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
3370 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
3372 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
3373 macros to be defined.
3374 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
3375 the allocator returns NULL because the requested size is zero.
3377 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3379 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
3380 var. Add comment explaining why libc still defines it. This
3381 merges the following patch from glibc:
3382 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
3384 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
3386 * obstack.c (_obstack): Remove unused variable. It hasn't been
3387 present in glibc since revision 1.1 of this file.
3388 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
3389 obstack_alignment_mask, obstack_alloc, obstack_base,
3390 obstack_blank, obstack_blank_fast, obstack_chunk_size,
3391 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
3392 obstack_grow0, obstack_init, obstack_int_grow,
3393 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
3394 obstack_next_free, obstack_object_size, obstack_ptr_grow,
3395 obstack_ptr_grow_fast, obstack_room): Remove declarations of
3396 nonexistent functions.
3398 2004-05-17 Derek R. Price <derek@ximbiot.com>
3399 Paul Eggert <eggert@cs.ucla.edu>
3401 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
3403 2004-05-14 Bruno Haible <bruno@clisp.org>
3405 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
3406 that consists of a '.' followed by an empty digit string.
3407 Patch by Tor Lillqvist <tml@iki.fi>.
3409 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
3411 Port obstack to the AS/400, where pointers are 16 bytes wide and
3412 you cannot cast an integer to a valid pointer. This patch is
3413 currently waiting to be integrated into glibc; see
3414 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
3416 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
3417 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
3418 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
3419 (struct obstack): temp member is now a union of a pointer and
3420 an integer, instead of an integer. All integer uses changed.
3421 This does not affect the physical layout of struct obstack,
3422 except on hosts (like the AS/400) where the size or alignment of
3423 void * is greater than that of ptrdiff_t.
3424 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
3425 __STDC__)]: Store temporary in pointer member of union, not
3427 * obstack.c: Include <stddef.h>, for offsetof.
3428 (struct fooalign): Remove; it doesn't need a name.
3429 (union fooround): Change double to long double, and add void *.
3430 (DEFAULT_ALIGNMENT): Use offsetof to compute.
3431 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
3432 not a macro. Hence the values are always int; so remove all
3433 casts-to-int in uses.
3435 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
3436 Derek Price <derek@ximbiot.com>
3438 * alloca.c: Include <alloca.h>, to get our interface.
3439 * alloca_.h: Use __alloca on AIX, so that we don't have to
3440 include <alloca.h> first. Use C89 prototype for alloca; this
3441 requires including <stddef.h> for size_t. Use extern "C" if C++.
3442 Use #elif for simplicity, since we can assume C89 now.
3443 Don't try to source the system alloca.h since it will not be found
3444 and to prevent recursively including its replacement.
3445 * fnmatch.c: Include <alloca.h> instead of opencoding.
3446 * regex.c: Likewise.
3448 2004-05-16 Derek Price <derek@ximbiot.com>
3449 Paul Eggert <eggert@cs.ucla.edu>
3451 getline cleanup. This changes the getndelim2 API: both order of
3452 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
3455 * getline.c: Don't include stddef.h or stdio.h, since our
3456 interface does that.
3457 (getline): Always use getdelim, so that we don't have two
3458 copies of this code.
3459 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
3461 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
3462 (GETNDELIM2_MAXIMUM): New macro.
3463 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
3464 instead of the old practice of delim2==0. All callers changed.
3465 Return -1 on overflow, instead of returning junk.
3466 Do not set *linesize unless allocation succeeds.
3467 * getndelim2.h: Do not include stddef.h; no longer needed, now
3468 that we include sys/types.h.
3469 * getnline.h: Likewise.
3470 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
3471 (getndelim2): Reorder arguments.
3472 * getnline.c (getnline, getndelim):
3473 Don't discard the NMAX argument.
3474 (getnline): Invoke getndelim, to avoid code duplication.
3475 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
3476 of (size_t) -1 by callers of the getnline family.
3478 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3480 * nanosleep.c (suspended): Change its type from int to
3481 sig_atomic_t volatile.
3482 (first_call): Make it private to rpl_nanosleep, and have it
3483 be zero initially as that's a bit faster.
3484 (my_usleep): Round up fractional times instead of truncating them,
3485 as this is the usual meaning for 'sleep'.
3487 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3489 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3490 (ENOSYS): Define if not defined.
3491 (settime): Fall back on stime if it exists and settimeofday fails.
3492 But don't bother with fallbacks if a method fails with errno == EPERM.
3494 2004-05-11 Jim Meyering <jim@meyering.net>
3496 Prior to this change, the save_cwd caller required read access to the
3497 current directory on most systems (ones with the fchdir function).
3499 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
3500 fails, try write-only, and finally, resort to using xgetcwd.
3502 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
3504 * obstack.c, obstack.h: Import changes from libc.
3506 2004-04-28 Bruno Haible <bruno@clisp.org>
3508 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
3509 implicitly appends .exe to executables.
3510 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
3511 accepts Windows pathnames.
3512 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3513 Cygwin like Windows, since it now accepts Windows pathnames.
3514 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3515 Cygwin like Windows, since it now accepts Windows pathnames.
3516 Reported by Derek Robert Price <derek@ximbiot.com>.
3518 2004-04-20 Jim Meyering <jim@meyering.net>
3520 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
3522 2004-04-20 Jim Meyering <jim@meyering.net>
3523 Bruno Haible <bruno@clisp.org>
3525 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
3526 memory when realloc fails.
3528 2004-04-18 Jim Meyering <jim@meyering.net>
3530 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
3531 don't leak memory and do call END_UTMP_ENT.
3533 2004-04-11 Paul Eggert <eggert@twinsun.com>
3535 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
3536 (CHAR_BIT): Remove, since we assume C89.
3537 Include <stdint.h> if available, as per current Autoconf CVS advice.
3539 2004-03-30 Paul Eggert <eggert@twinsun.com>
3541 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
3542 not bool, to be more consistent with Unix conventions.
3543 Suggested by Bruno Haible.
3545 Merge from coreutils.
3547 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
3550 * getdate.h: Include stdbool.h, and timespec.h instead of
3551 the usual <time.h> dance.
3552 (get_date): Change signature to support fractional time stamps.
3553 All callers changed.
3554 * getdate.y: Include "getdate.h" first, as we can now
3555 assume C89 and don't need to worry about 'const'.
3556 Similarly, include "unlocked-io.h" near start, not in middle.
3558 (textint.value): Use long int rather than int.
3559 (textint.digits): Use size_t rather than int.
3560 (BILLION, LOG10_BILLION): New constants.
3561 (parser_control): New member rel_ns. Members day_ordinal,
3562 time_zone, month, day, hour, minutes, rel_year, rel_month,
3563 rel_day, rel_hour, rel_minutes, rel_seconds
3564 are now long int, not int. Member seconds is now struct timespec,
3565 not int. New member timespec_seen. Members dates_seen, days_seen,
3566 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
3568 (%union.intval): Now long int, not int.
3569 New member timespec.
3570 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
3571 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
3572 (spec): Now is a timespec or an item list.
3573 (timespec, items): New nonterminals.
3574 (time, rel, relunit, number, get_date):
3575 Add support for fractional seconds.
3576 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
3577 (gmtime, localtime, mktime): Remove decls; not needed with C89.
3578 (to_hour): First arg is now long int, not int.
3579 (to_year): Returns long int, not int.
3580 Don't treat year -70 like 70.
3581 (tm_diff): Returns long int, not int.
3582 (lookup_word): Use bool instead of int when appropriate.
3583 (yylex): Use size_t for count, not int.
3584 Detect overflow when parsing large integer constants.
3585 Add support for fractions.
3586 (get_date): Make pointers 'const' if possible.
3587 Use more-portable code to detect integer overflow.
3588 (main) [TEST]: Adjust to above changes. Test for localtime failure.
3589 Don't use ctime; it's not reliable if the year has >4 digits.
3591 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
3592 This is for compatibility with BSD.
3594 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
3595 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
3596 From coreutils' system.h.
3598 * userspec.c: Don't include "posixver.h".
3599 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
3600 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
3601 compatible extension. Simplify code by removing a boolean int
3602 that was always nonzero if a string was nonnull.
3604 2004-03-30 Jim Meyering <jim@meyering.net>
3606 Merge from coreutils.
3608 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
3610 * readtokens.c (readtoken): Don't leak 64 bytes when reading
3611 an empty input stream.
3613 * readtokens.c: Include <stdbool.h>.
3614 (readtoken): Use `size_t' rather than int/long.
3615 All callers adjusted.
3616 Use `bool' rather than `int' where appropriate.
3617 Use memset rather than an explicit loop.
3618 Use x2nrealloc rather than xrealloc.
3619 Allow the use of `\0' as a delimiter.
3620 (readtokens): Likewise.
3621 * readtokens.h (readtoken, readtokens): Update prototypes.
3623 2004-03-30 Bruno Haible <bruno@clisp.org>
3625 * getloadavg.c (getloadavg): Don't assume setlocale returns
3628 2004-03-29 Paul Eggert <eggert@twinsun.com>
3630 Merge changes to getloadavg.c from coreutils and Emacs.
3632 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
3633 Define to an expression, not to the empty string.
3634 Include cloexec.h and xalloc.h.
3635 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
3636 Use set_cloexec_flag rather than rolling our own.
3637 * cloexec.c, cloexec.h: New files.
3639 2004-03-18 Paul Eggert <eggert@twinsun.com>
3641 * getopt.h: Sync with libc CVS.
3643 2004-03-18 Paul Eggert <eggert@twinsun.com>
3644 Bruno Haible <bruno@clisp.org>
3646 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
3647 not on all platforms that have <wchar.h>.
3648 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
3650 2004-03-09 Paul Eggert <eggert@twinsun.com>
3652 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
3654 * getopt_int.h: New file, also synced from libc.
3656 2004-03-07 Paul Eggert <eggert@twinsun.com>
3658 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
3659 '#if' expressions. Unlike the code it replaces, it does not
3660 depend on (defined _SC_PAGESIZE). However, it does depend on
3661 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
3662 first reported by Jason Andrade in
3663 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
3665 2004-01-18 Simon Josefsson <jas@extundo.com>
3667 * strdup.h: New file.
3668 * strdup.c: Include it.
3669 * path-concat.c: Include strdup.h. Drop strdup declaration.
3670 * userspec.c: Include strdup.h. Drop strdup declaration.
3672 2004-02-06 Karl Berry <karl@gnu.org>
3674 * config.charset: update from gettext 0.14.1.
3676 2004-02-05 Paul Eggert <eggert@twinsun.com>
3678 Add comments and code, prompted by suggestions from Bruno Haible
3680 * quotearg.h (quotearg_alloc): New decl. Improve the comments
3681 describing the enum quoting_style values.
3682 * quotearg.c (quotearg_alloc): New function.
3683 (quotearg_buffer_restyled): Treat lone { and } as special.
3684 Treat = as special. Work around bug with older shells
3685 that "see" a '\' that is really the 2nd byte of a multibyte char.
3686 Quote empty string with shell_quoting_style.
3688 2004-02-03 Bruno Haible <bruno@clisp.org>
3690 * pipe.h: New file, from GNU gettext.
3691 * pipe.c: New file, from GNU gettext.
3693 2004-01-27 Bruno Haible <bruno@clisp.org>
3695 * execute.h: New file, from GNU gettext.
3696 * execute.c: New file, from GNU gettext.
3697 * w32spawn.h: New file, from GNU gettext.
3699 2004-01-23 Paul Eggert <eggert@twinsun.com>
3701 Exit-status fix from coreutils.
3703 Use exit_failure consistently in place of EXIT_FAILURE,
3704 so that program exit statuses are consistent on failure.
3706 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
3707 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
3708 * argmatch.h: Comment fix to match the above.
3709 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
3710 Now a macro referring to exit_failure, instead of a separate
3711 variable. Include "exitfail.h" to get it.
3712 * xstrtol.h: Include "exitfail.h".
3713 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
3715 * long-options.c (parse_long_options): Use prototype
3716 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
3719 2004-01-21 Jim Meyering <jim@meyering.net>
3721 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
3722 so as not to conflict with a different-sized __mktime_internal
3723 function in GNU libc.
3724 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
3725 Problem building statically-linked `ls' reported by Michael Brunnbauer.
3727 2004-01-18 Paul Eggert <eggert@twinsun.com>
3729 Merge from diffutils.
3731 * file-type.c (file_type): Add typed memory objects.
3732 * file-type.h (S_TYPEISTMO): New macro.
3734 * c-stack.h (c_stack_action): Remove argv argument.
3735 * c-stack.c (c_stack_action): Likewise. All uses changed.
3736 (die): Don't calculate message unless segv_action returns.
3737 (get_stack_location, min_address_from_argv, max_address_from_argv,
3738 volatile stack_base, volatile_stack_size): Remove.
3739 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
3740 that every segmentation violation is a stack overflow. (Ouch!)
3741 See Debian bug 136249 (still outstanding) for more info about why
3742 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
3744 2003-11-30 Bruno Haible <bruno@clisp.org>
3746 Safer stack allocation.
3747 * setenv.c: Include allocsa.h.
3748 (alloca): Remove fallback definition.
3749 (freea): Remove macro.
3750 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
3753 2003-10-17 Bruno Haible <bruno@clisp.org>
3755 * binary-io.h: Avoid warnings on Cygwin.
3757 2003-12-28 Bruno Haible <bruno@clisp.org>
3759 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
3760 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
3762 2003-11-28 Bruno Haible <bruno@clisp.org>
3764 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
3766 2003-11-27 Bruno Haible <bruno@clisp.org>
3768 * wait-process.c: On Windows, include windows.h. Needed on mingw.
3770 2003-11-17 Bruno Haible <bruno@clisp.org>
3772 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
3774 2003-11-24 Bruno Haible <bruno@clisp.org>
3776 * xallocsa.h: New file, from GNU gettext.
3777 * xallocsa.c: New file, from GNU gettext.
3779 2003-11-24 Bruno Haible <bruno@clisp.org>
3781 * allocsa.h: New file, from GNU gettext.
3782 * allocsa.c: New file, from GNU gettext.
3784 2003-11-24 Bruno Haible <bruno@clisp.org>
3786 * eealloc.h: New file.
3788 2004-01-15 Jim Meyering <jim@meyering.net>
3790 Merge from coreutils.
3792 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
3793 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
3794 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
3796 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
3797 optional configure-time default.
3799 * version-etc.c (version_etc_copyright): Update copyright date.
3801 * xreadlink.c (xreadlink): Correct outdated comment.
3803 2004-01-15 Paul Eggert <eggert@twinsun.com>
3805 Merge from coreutils.
3807 * posixver.c: Include posixver.h.
3809 * same.c: Include <stdbool.h>, <limits.h>.
3810 (_POSIX_NAME_MAX): Define if not defined.
3812 (same_name): If file names are silently truncated, report
3813 that the file names are the same if they are the same after
3814 the silent truncation.
3816 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
3817 conversion function.
3818 * xstrtod.c (xstrtod): Likewise. All callers changed to
3819 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
3822 2004-01-14 Paul Eggert <eggert@twinsun.com>
3824 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
3825 with like-named macro in fnmatch.c.
3826 (EXT): Use an internal constant instead.
3828 Merge fnmatch patches from glibc.
3829 * fnmatch.c (mbsinit): Remove define.
3830 Add libc_hidden_ver (__fnmatch, fnmatch).
3831 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
3832 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
3834 2003-12-14 Karl Berry <karl@gnu.org>
3836 * config.charset: update from gettext-runtime.
3838 2003-12-03 Paul Eggert <eggert@twinsun.com>
3840 * getgroups.c (getgroups): xmalloc takes one argument, not two.
3841 Bug reported by Alfred M. Szmidt.
3843 2003-11-29 Karl Berry <karl@gnu.org>
3845 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
3847 2003-11-23 Paul Eggert <eggert@twinsun.com>
3848 Bruno Haible <bruno@clisp.org>
3850 * printf-parse.h: Don't include sys/types.h.
3851 (ARG_NONE): New macro.
3852 (char_directive): Change type of *arg_index fields to size_t.
3853 * printf-parse.c: Don't include sys/types.h.
3854 (SSIZE_MAX): Remove macro.
3855 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
3856 Remove unnecessary overflow check.
3857 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
3860 2003-11-24 Paul Eggert <eggert@twinsun.com>
3862 * alloca.c: Remove dependency on xalloc module.
3863 (xalloc_die): Remove.
3864 (memory_full) [!defined emacs]: New macro.
3865 [!defined emacs]: Don't include xalloc.h.
3866 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
3867 address arithmetic overflows. Change datatypes a bit to avoid
3870 2003-11-22 Jim Meyering <jim@meyering.net>
3872 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
3874 2003-11-17 Bruno Haible <bruno@clisp.org>
3876 * vasnprintf.c (alloca): Remove fallback definition.
3877 (freea): Remove definition.
3878 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
3879 Reported by Paul Eggert.
3881 2003-11-17 Jim Meyering <jim@meyering.net>
3883 On systems without utime and without a utimes function capable of
3884 dealing with a NULL struct utimbuf* argument, this utime replacement
3885 could -- in unusual circumstances -- leak a file descriptor.
3886 * utime.c: Include <unistd.h> and <errno.h>.
3887 (utime_null): Be sure to close `fd' and to preserve errno.
3888 Reported by Geoff Collyer via Arnold Robbins.
3890 2003-11-16 Paul Eggert <eggert@twinsun.com>
3891 Bruno Haible <bruno@clisp.org>
3893 Protect against address arithmetic overflow.
3894 * printf-args.h: Include stddef.h.
3895 (arguments): Change type of field 'count' to size_t.
3896 * printf-args.c (printf_fetchargs): Use size_t instead of
3897 'unsigned int' where appropriate.
3898 * printf-parse.h: Include sys/types.h.
3899 (char_directive): Change type of *arg_index fields to ssize_t.
3900 (char_directives): Change type of fields 'count', max_*_length to
3902 * printf-parse.c: Include sys/types.h and xsize.h.
3903 (SSIZE_MAX): Define fallback value.
3904 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
3905 instead of 'int' where appropriate. Check a_allocated, d_allocated
3906 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
3907 * vasnprintf.c: Include xsize.h.
3908 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
3909 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
3910 overflow. Avoid wraparound when converting a width or precision from
3913 2003-11-16 Bruno Haible <bruno@clisp.org>
3915 Update from GNU gettext.
3916 * printf-parse.c: Generalize to it can be compiled for wide strings.
3917 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
3918 * vasnprintf.c: Generalize to it can be compiled for wide strings.
3919 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
3920 SNPRINTF): New macros.
3921 Don't include <alloca.h> if the file is used inside libintl.
3922 (local_wcslen): New function, for Solaris 2.5.1.
3923 (VASNPRINTF): Use it instead of wcslen.
3925 2003-11-16 Bruno Haible <bruno@clisp.org>
3927 * xsize.h (xmax): New function.
3928 (xsum, xsum3, xsum4): Declare as "pure" functions.
3930 2003-11-12 Paul Eggert <eggert@twinsun.com>
3932 * xalloc.h: Do not include <limits.h> or <stdint.h>.
3933 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
3934 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
3935 heuristic is just as accurate as far as we know, and it removes a
3936 dependency on size_max.m4 and ptrdiff_max.m4.
3938 2003-11-12 Paul Eggert <eggert@twinsun.com>
3940 * xstrtol.c (__xstrtol): Remove "break" immediately after
3941 "return", to pacify some unknown compiler. Problem reported
3944 2003-11-11 Bruno Haible <bruno@clisp.org>
3946 * xsize.h (SIZE_MAX): Remove fallback definition.
3947 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
3950 2003-11-10 Paul Eggert <eggert@twinsun.com>
3952 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
3953 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
3954 rejected some allocations of exactly SIZE_MAX - 2 bytes.
3956 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
3957 not (size_t) -1, since it's defined here.
3959 2003-11-06 Paul Eggert <eggert@twinsun.com>
3961 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
3962 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
3963 Reject sizes of exactly SIZE_MAX bytes.
3964 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
3965 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
3967 2003-11-05 Bruno Haible <bruno@clisp.org>
3969 * xsize.h: Include limits.h, to avoid a possible collision with
3970 SIZE_MAX defined in <limits.h> on Solaris.
3972 2003-11-04 Bruno Haible <bruno@clisp.org>
3974 * xsize.h: New file.
3975 * linebreak.c: Include xsize.h.
3976 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
3977 argument for overflow.
3978 Suggested by Paul Eggert.
3980 2003-10-31 Bruno Haible <bruno@clisp.org>
3982 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
3983 to avoid (extremely rare) race condition.
3984 Suggested by Paul Eggert.
3986 2003-11-03 Jim Meyering <jim@meyering.net>
3988 * userspec.c: Include "userspec.h".
3989 * userspec.h: New file.
3991 2003-10-31 Paul Eggert <eggert@twinsun.com>
3993 * mountlist.h (struct mount_entry.me_type_malloced): New member.
3994 * mountlist.c (SIZE_MAX): Define if not defined already.
3995 (read_filesystem_list): Set and use me_type_malloced.
3996 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
3997 whatever the type happens to be), for brevity and consistency.
3998 Check for size calculation overflow on Alphas running OSF/1.
4000 2003-10-31 Jim Meyering <jim@meyering.net>
4002 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
4004 * linebuffer.c: Include <string.h> for declaration of memset.
4006 2003-10-30 Paul Eggert <eggert@twinsun.com>
4007 Bruno Haible <bruno@clisp.org>
4009 * vasprintf.c: Include <limits.h>, <stdlib.h>.
4010 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
4012 2003-10-29 Paul Eggert <eggert@twinsun.com>
4014 * xalloc.h (xalloc_oversized): Now a macro, not a function,
4015 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
4017 * quotearg.c (quotearg_n_options): Use it.
4018 * group-member.c: Include <stdbool.h>.
4019 (free_group_info): Arg is now const *; don't free arg.
4020 (get_group_info): Now returns bool and accepts struct group_info *,
4021 rather than returning a malloc'ed struct group_info *.
4022 All uses changed. Check for overflow in internal size calculation.
4024 * getusershell.c (readname): Simplify the code by using x2nrealloc
4025 rather than xmalloc/xrealloc.
4026 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
4027 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
4028 conformance bug: the old code used a pointer after freeing the
4029 storage that it addressed.
4030 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
4031 rather than doing it by hand.
4032 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
4033 the buffer preserved. Use free and xmalloc instead.
4034 * quotearg.c (quotearg_n_options): Likewise.
4035 Use a simpler test for size overflow. Don't use xalloc_oversized
4036 because unsigned int might be wider than size_t (!); this suggests
4037 that we should switch from unsigned int to size_t for slot numbers.
4039 2003-10-27 Bruno Haible <bruno@clisp.org>
4041 * stdbool_.h: Better support for BeOS.
4043 2003-10-27 Paul Eggert <eggert@twinsun.com>
4045 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
4046 to allocate the returned structure. Do not allocate a subarray,
4047 as x2nrealloc will do that.
4048 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
4049 instead of xnrealloc.
4050 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
4052 2003-10-26 Paul Eggert <eggert@twinsun.com>
4054 * xalloc.h (xalloc_oversized): New static inline function, for
4055 callers that want to do their own size-overflow checking. Include
4056 <stdbool.h>, since xalloc_oversized returns bool.
4057 * xalloc.c (array_size_overflow): Remove. All callers changed
4058 to use xalloc_oversized.
4060 Add two functions x2realloc, x2nrealloc, for programs that grow
4061 arrays dynamically by doubling their sizes.
4062 * xalloc.h (x2realloc, x2nrealloc): New decls.
4063 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
4066 Port to C99 semantics for 'inline' of external functions.
4067 Bug reported by Bruno Haible.
4068 * xmalloc.c (xnmalloc_inline): New static inline function,
4069 with the old contents of xnmalloc.
4070 (xnmalloc, xmalloc): Use it.
4071 (xnrealloc_inline): New static inline function,
4072 with the old contents of xnrealloc.
4073 (xnrealloc, xrealloc): Use it.
4075 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
4077 2003-10-25 Paul Eggert <eggert@twinsun.com>
4079 Fix several address-calculation bugs in the hash modules,
4080 plus some minor code cleanup.
4082 * hash.h: Include <stdbool.h>, for bool.
4083 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
4084 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
4085 hash_get_n_entries, hash_get_max_bucket_length,
4086 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
4087 hash_rehash): Use size_t rather than unsigned.
4088 * hash.c (struct hash_table, hash_get_n_buckets,
4089 hash_get_n_buckets_used, hash_get_n_entries,
4090 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
4091 hash_get_entries, hash_do_for_each, hash_string, is_prime,
4092 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
4094 (SIZE_MAX): Define if not defined.
4095 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
4096 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
4098 Use const * when possible.
4099 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
4100 (check_tuning): Fix bug: if tuning parameters were very close to
4101 0 or 1, rounding errors could have caused subscript violations.
4102 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
4103 (hash_initialize): Add 'fail:' label
4104 to free table and return NULL, and use it to simplify code.
4105 Use calloc rather than clearing the storage ourself.
4106 (hash_initialize, hash_rehash): Check for arithmetic overflow in
4107 buffer size calculations.
4108 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
4109 Include <stddef.h>, for size_t.
4110 * hash-pjw.c (hash_pjw): Likewise.
4111 Switch to method described by Bruno Haible.
4112 Include <limits.h>, for CHAR_BIT.
4113 (SIZE_BITS): New macro.
4115 2003-10-21 Paul Eggert <eggert@twinsun.com>
4117 * getndelim2.c (getndelim2): When size calculation overflows,
4118 ceiling the allocation at NMAX bytes rather than silently
4119 discarding input bytes before NMAX is reached. This makes
4120 a difference only if NMAX exceeds SIZE_MAX / 2.
4122 * obstack.c: Merge from glibc.
4123 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
4124 Add libc_hidden_def (_obstack_newchunk).
4125 (_obstack_free) [! defined _LIBC]: Remove.
4126 [defined _LIBC]: Make a strong alias from obstack_free, rather than
4127 a clone of the function body.
4128 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
4129 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
4131 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
4132 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
4135 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
4136 (obstack_ptr_grow_fast, obstack_int_grow_fast):
4137 Don't use lvalue casts, as GCC plans to remove support for them
4138 in GCC 3.5. Reported by Joseph S. Myers. This bug
4139 was also present in the non-GCC version, indicating that this
4140 code had always been buggy and had never been widely used.
4141 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
4142 Use the fast variant of each macro, rather than copying the
4143 definiens of the fast variant; that way, we'll be more likely to
4144 catch future bugs in the fast variants.
4146 2003-10-20 Bruno Haible <bruno@clisp.org>
4148 * wait-process.h: New file, from GNU gettext.
4149 * wait-process.c: New file, from GNU gettext.
4151 2003-10-19 Jim Meyering <jim@meyering.net>
4153 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
4155 2003-10-16 Paul Eggert <eggert@twinsun.com>
4157 * getgroups.c: Include <errno.h>, <stdlib.h>.
4158 (getgroups): First arg is int, not size_t.
4159 Don't let 'free' mangle errno.
4161 2003-10-16 Jim Meyering <jim@meyering.net>
4163 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
4165 2003-10-15 Paul Eggert <eggert@twinsun.com>
4167 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
4169 (new_exclude, add_exclude_file): Initial size no longer needs to
4171 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
4172 our own address arithmetic overflow checking.
4174 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
4175 (fnmatch): Do not alloca more than 2000 wide characters;
4176 instead, use malloc for large buffers.
4177 Check for address arithmetic overflow, and return -1
4178 with errno set to ENOMEM in that case.
4179 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
4180 (NEW_PATTERN): Do not alloca more than 8000 bytes;
4181 instead, return -1. Check for address arithmetic overflow.
4183 2003-10-14 Paul Eggert <eggert@twinsun.com>
4185 Handle invalid suffixes and overflow independently, so that
4186 callers can treat them independently as needed. Fix some bugs in
4187 suffix handling, e.g., "100k@" was not diagnosed as an invalid
4188 suffix for a human-readable blocksize. The major caller-visible
4189 change is the addition of a new
4190 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
4191 that both overflow and suffix chars were found.
4193 * human.c (humblock): Don't check separately for invalid suffix
4194 char; that is xstrtoumax's job (now that its bug is fixed).
4195 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
4196 INTMAX_MAX]: New macros.
4197 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
4198 TYPE_MAXIMUM): New macros.
4199 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
4200 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
4201 if overflow occurs, as it's what __strtol does and it's more useful
4203 (__xstrtol): If __strtol reports some error other than ERANGE,
4204 reflect it to the caller as LONGINT_INVALID. If it reports
4205 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
4206 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
4207 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
4209 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
4210 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
4211 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
4212 [defined UINTMAX_MAX]: New macros.
4214 2003-10-14 Bruno Haible <bruno@clisp.org>
4216 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
4217 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
4218 Also use volatile where needed.
4220 2003-10-12 Paul Eggert <eggert@twinsun.com>
4222 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
4223 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
4224 and define in terms of the other primitives.
4225 * xmalloc.c: Include stdbool.h; do not include exit.h.
4226 (SIZE_MAX): Define if not already defined.
4227 (array_size_overflow): New function.
4228 (xalloc_die): Abort instead of exiting if 'error' returns.
4229 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
4230 (xmalloc, xrealloc): Use them.
4231 (xcalloc): Check for address arithmetic overflow.
4232 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
4233 a bit faster than strcpy.
4235 2003-10-08 Paul Eggert <eggert@twinsun.com>
4237 Merge getpass from libc, plus a few fixes.
4239 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
4240 Include <stdbool.h>.
4241 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
4242 __fsetlocking to empty.
4243 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
4244 do include <bits/libc-lock.h>.
4245 Do not include <fcntl.h>; not needed.
4246 [_LIBC]: Include <wchar.h>.
4247 (NOTCANCEL_MODE): New macro.
4248 (flockfile, funlockfile) [_LIBC]: New macros.
4249 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
4250 [!_LIBC]: New macros.
4251 (call_fclose): New function.
4252 (getpass): Use it. Save tty stream separately; this simplifies the
4253 code and makes it more reliable if stdin happens to equal stdout.
4254 Invoke __fsetlocking on tty.
4255 Handle thread cancellation if needed.
4256 Namespace cleanup (use __tcgetattr, __getline).
4257 Use bool for Booleans.
4258 [USE_IN_LIBIO]: Handle wide streams.
4259 [!_LIBC]: Unconditionally do the fseek, since we don't know what
4260 stream might go where.
4262 * unlocked-io.h: Include <stdio.h>, so that the caller
4263 doesn't have to include <stdio.h> before us.
4264 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4265 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4266 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4267 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4268 if not declared, so that we can use getpass.c code from libc without
4270 (flockfile, ftrylockfile, funlockfile): New macros.
4272 2003-10-06 Bruno Haible <bruno@clisp.org>
4274 * version-etc-2.h: Remove file.
4275 * version-etc-2.c: Remove file.
4277 2003-09-25 Jim Meyering <jim@meyering.net>
4278 Bruno Haible <bruno@clisp.org>
4280 This lets translators provide better translations for the
4281 "Written by ..." part of --version output.
4282 * version-etc.h: Include stdarg.h.
4283 (version_etc_copyright): Declare as readonly.
4284 (version_etc): Make this function variadic with a NULL-terminated list
4285 of author name strings.
4286 (version_etc_va): New declaration.
4287 * version-etc.c: Include stdarg.h, stdlib.h.
4288 (version_etc_copyright): Declare as readonly.
4289 (version_etc_va): New function. Provide a different translatable string
4290 for each possible number of authors < 10. Abbreviate when there are 10
4292 (version_etc): Make this function variadic. Call version_etc_va.
4293 Suggestion from Gary V. Vaughan.
4295 * long-options.h (parse_long_options): Change prototype: the authors
4296 string is moved to the end and becomes variadic.
4297 * long-options.c: Include stdarg.h.
4298 (parse_long_options): Make this function variadic, too.
4299 Call version_etc_va, not version_etc.
4301 2003-10-06 Bruno Haible <bruno@clisp.org>
4303 * fatal-signal.h: New file, from GNU gettext.
4304 * fatal-signal.c: New file, from GNU gettext.
4306 2003-10-04 Karl Berry <karl@gnu.org>
4308 * argp*: update from libc.
4310 2003-10-01 Larry Jones <lawrence.jones@eds.com>
4312 * getpass.c (getpass): Use a no-op fseek when switching from input to
4313 output mode on the same stream.
4315 2003-09-29 Paul Eggert <eggert@twinsun.com>
4317 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4318 Fix arg typo in previous patch.
4320 2003-09-28 Jim Meyering <jim@meyering.net>
4322 * error.c: Correct cpp indentation.
4324 2003-09-27 Paul Eggert <eggert@twinsun.com>
4326 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
4327 Omit the special code that used __typeof__, since we worry that
4328 it could be more trouble than it's worth. See:
4329 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
4330 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
4334 2003-09-26 Jim Meyering <jim@meyering.net>
4336 * error.c (error_tail): Move some declarations
4337 into inner scope where the local variables are used.
4339 2003-09-26 Bruno Haible <bruno@clisp.org>
4341 * stpncpy.h (gnu_stpncpy): New declaration.
4342 (stpncpy): Define as alias for gnu_stpncpy.
4343 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
4345 2003-09-26 Paul Eggert <eggert@twinsun.com>
4347 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
4348 (error_tail): Do not loop, reallocating temporary buffer, since
4349 the output cannot contain more wide characters than the input
4350 contains bytes, the size must be big enough already. This avoids
4351 one potential size overflow calculation. Check for size overflow
4352 when calculating temporary buffer size. Free temporary buffer
4353 when done, if it was allocated with malloc; this plugs a memory
4354 leak. Remove casts from void * to pointers, that are no longer
4355 needed now that we're assuming C89 or better.
4357 Merge error changes from glibc.
4359 * error.c, error.h: Update copyright notice header to match glibc.
4360 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
4361 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
4362 Disable cancellation while printing error.
4363 * error.h: Prepend __ to parameter names.
4365 2003-09-25 Karl Berry <karl@gnu.org>
4367 * argp-fmtstream.c, argp-help.c: update from libc.
4369 2003-09-25 Bruno Haible <bruno@clisp.org>
4371 * version-etc-2.h: New file, from version-etc.h with modifications.
4372 * version-etc-2.c: New file, from version-etc.c with modifications.
4374 2003-09-25 Simon Josefsson <jas@extundo.com>
4376 * xgetdomainname.h: New file.
4377 * xgetdomainname.c: New file.
4379 2003-09-25 Simon Josefsson <jas@extundo.com>
4380 Bruno Haible <bruno@clisp.org>
4382 * getdomainname.h: New file.
4383 * getdomainname.c: New file.
4385 2003-09-24 Paul Eggert <eggert@twinsun.com>
4387 * linebuffer.c (freebuffer): Don't free the argument, just
4388 the buffer associated with the argument. Bug reported by
4391 2003-09-19 Karl Berry <karl@gnu.org>
4393 * argp.h: update from libc.
4395 2003-09-16 Paul Eggert <eggert@twinsun.com>
4397 * linebuffer.c (readlinebuffer): Return NULL immediately upon
4398 input error, instead of returning NULL the next time we are called
4399 (and therefore losing track of errno).
4401 2003-09-15 Paul Eggert <eggert@twinsun.com>
4403 * getndelim2.c (getndelim2): Don't trash errno when a read
4404 fails, so that the caller gets the proper errno.
4406 * readutmp.c (read_utmp): Likewise.
4407 Check for fstat error. Close stream and free storage
4410 2003-09-14 Bruno Haible <bruno@clisp.org>
4412 * fwriteerror.h: New file.
4413 * fwriteerror.c: New file.
4415 2003-09-14 Jim Meyering <jim@meyering.net>
4417 * getloadavg.c: Correct cpp indentation.
4418 * strdup.c: Likewise.
4419 * vasnprintf.c: Likewise.
4421 2003-09-12 Paul Eggert <eggert@twinsun.com>
4423 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
4424 * obstack.c [!defined _LIBC]: Likewise.
4425 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4426 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4427 * exitfail.c: Don't include stdlib.h; no longer needed.
4429 More changes to assume C89 or better.
4431 * error.c (error_tail): Assume vprintf.
4433 * argmatch.c (getenv): Remove decl.
4434 * progreloc.c (get_full_program_name): Define via prototype.
4435 * setenv.c (clearenv): Likewise.
4436 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
4438 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
4439 (malloc, memcpy): Remove decls.
4440 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
4441 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
4442 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4443 (memcpy): Remove macro.
4444 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
4445 (__P): Remove. All uses removed.
4446 (PTR): Remove. All uses changed to void *.
4447 (CHAR_BIT, NULL): Remove.
4448 (spaces, zeros, memset_space, memset_zero)
4449 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
4451 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
4452 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
4453 Define with prototype.
4454 Remove now-unnecessary prototype decl.
4455 (extra_args_spec): Assume ANSI C. All uses changed.
4456 (extra_args_spec_iso): Remove.
4457 (my_strftime, emacs_strftimeu): Define via prototype.
4458 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
4460 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
4461 * strtoimax.c: Include <stdlib.h> unconditionally.
4462 (strtoul, strtol): Remove decls.
4463 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
4465 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4466 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
4467 (LOCALE_PARAM_PROTO): New macro.
4468 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
4469 (INTERNAL (strtol), strtol): Define with a prototype.
4470 (PARAMS): Remove. All uses removed.
4471 * tempname.c: Include <string.h> unconditionally.
4472 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
4473 * xgethostname.c (main): Define with a prototype.
4474 * xmalloc.c: Include "xalloc.h" first, to check interface.
4475 Include <stdlib.h> unconditionally.
4476 (calloc, malloc, realloc, free): Remove decls.
4477 * xstrtod.c: Include "xstrtod.h" first, to check interface.
4478 Include <stdlib.h> unconditionally. Sort include file names.
4480 (xstrtod): Define with a prototype.
4481 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
4482 (strtol, strtoul): Remove decls.
4484 2003-09-11 Paul Eggert <eggert@twinsun.com>
4486 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
4487 Include <stdlib.h>, <string.h> unconditionally.
4488 Remove now-unnecessary cast to char *.
4489 * strnlen.c: Include <string.h> unconditionally.
4490 * yesno.c (yesno): Define with a prototype.
4492 2003-09-10 Bruno Haible <bruno@clisp.org>
4494 * strcspn.c: Include <string.h> unconditionally.
4495 * strpbrk.c: Include <string.h> unconditionally.
4496 * strstr.c: Include <string.h> unconditionally.
4497 * unicodeio.c: Include <string.h> unconditionally.
4498 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
4499 * unsetenv.c: Likewise.
4500 * xreadlink.c: Include <stdlib.h> unconditionally.
4501 * yesno.c: Include <stdlib.h> unconditionally.
4502 (rpmatch): Add prototype.
4504 2003-09-10 Jim Meyering <jim@meyering.net>
4506 * error.c: Correct indentation of cpp directives.
4508 2003-09-09 Paul Eggert <eggert@twinsun.com>
4512 * acosl.c (main): Use a prototype.
4513 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
4516 * getloadavg.c (getloadavg, main): Define via prototypes.
4518 * getopt.h (struct option.name): Assume C89, and use 'const'.
4519 (getopt, etopt_long, getopt_long_only, _getopt_internal)
4520 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
4522 * getopt.c (const): Remove macro.
4523 Include <string.h> unconditionally.
4524 (my_index): Remove; all uses changed to strchr.
4525 (strlen): Remove decl.
4526 (exchange): Remove forward decl; no longer needed.
4527 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
4528 Define with prototype.
4529 * getopt1.c (const): Remove macro.
4530 (getopt_long, getopt_long_only, main): Define with prototype.
4532 * getugroups.c: Include <string.h> unconditionally.
4534 * getusershell.c: Include <stdlib.h> unconditionally.
4535 (getusershell, setusershell, endusershell, readname, main):
4536 Define with prototypes.
4538 * group-member.c: Include group-member.h first.
4539 Include <stdlib.h> unconditionally.
4541 * hard-locale.c: Include hard-locale.h first.
4542 Include <stdlib.h>, <string.h> unconditionally.
4544 * hash.c (free, malloc): Remove decls.
4545 Include <stdlib.h> unconditionally.
4547 * human.c: Include <stdlib.h>, <string.h> unconditionally.
4548 (getenv): Do not declare.
4550 * idcache.c: Include <string.h> unconditionally.
4552 * long-options.c: Include long-options.h first, to test interface.
4553 Include <stdlib.h> unconditionally.
4555 * makepath.c: Include makepath.h first, to test interface.
4556 Include <stdlib.h> and <string.h> unconditionally.
4558 * linebuffer.c: Include <stdlib.h>.
4559 (free): Remove decl.
4561 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
4562 rpl_malloc returns void *, not char *.
4563 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
4565 * md5.h: Include <limits.h> unconditionally.
4566 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
4567 (__P): Remove; all uses removed.
4568 * md5.c: Include "md5.h" first.
4569 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
4570 md5_buffer, md5_process_bytes, md5_process_block):
4571 Define with prototypes.
4572 * sha.h (__P): Remove all uses. (It wasn't defined??)
4573 * sha.c: Include "sha.h" first.
4574 Include <stdlib.h>, <string.h> unconditionally.
4576 * memchr.c (__ptr_t): Remove; all uses changed to void *.
4577 * memcmp.c (__ptr_t): Likewise.
4578 * memrchr.c (__ptr_t): Likewise.
4579 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
4580 Include <string.h> unconditionally.
4581 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
4582 * memchr.c: Include <stdlib.h> unconditionally.
4583 * memchr.c (LONG_MAX): Remove.
4584 * memrchr.c (LONG_MAX): Likewise.
4585 * memchr.c (__memchr): Define via a prototype.
4586 * memrchr.c (__memrchr): Likewise.
4587 * memcmp.c (__P): Remove, and remove all uses.
4588 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
4589 Remove forward decls; no longer needed.
4590 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
4591 Use types required by C89 in prototype.
4593 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
4594 * savedir.c: Likewise.
4595 * mkdir.c (free): Remove decl.
4596 * rmdir.c (rmdir): Define with a prototype.
4597 * savedir.c: Include savedir.h first, to test interface.
4599 * mktime.c (STDC_HEADERS): Remove.
4600 Include <stdlib.h>, <string.h> unconditionally.
4602 * modechange.c: Include <stdlib.h> unconditionally.
4603 (malloc): Remove decl.
4605 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
4606 (free): Remove decl.
4608 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
4609 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
4610 (This type really should be intptr_t, but that's a C99ism.)
4611 (_obstack_memcpy): Remove: all uses changed to memcpy.
4612 Include <string.h> unconditionally.
4613 (struct obstack): Assume __STDC__ for types of members
4614 chunkfun, freefun, extra_arg.
4615 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
4616 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
4617 obstack_begin, obstack_specify_allocation,
4618 obstack_specify_allocation_with_arg, obstack_chunkfun,
4619 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
4620 Remove unprototyped decls and the macros that use them.
4621 * obstack.c (POINTER): Remove. All uses changed to void *.
4622 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
4623 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
4624 (defined __STDC__ && __STDC__)]:
4625 Remove nonprototyped code.
4626 Include <stdlib.h> unconditionally.
4627 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
4628 _obstack_allocated_p, _obstack_free, obstack_free,
4629 _obstack_memory_used, print_and_abort):
4630 Define using prototypes.
4631 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
4632 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
4633 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
4634 obstack_next_free, obstack_object_size, obstack_room) [0]:
4635 Remove unused, unprototyped code.
4637 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
4639 * physmem.c (physmem_total, physmem_available, main): Define
4642 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
4643 (main): Define with a prototype.
4645 * posixver.c (getenv): Remove decl.
4647 * putenv.c (malloc): Returns void *, not char *.
4648 Include <string.h> unconditionally.
4649 (strchr, memcpy, NULL): Do not define.
4651 * readtokens.c: Include readtokens.h first, to test interface.
4652 Include <stdlib.h>, <string.h> unconditionally.
4653 (init_tokenbuffer): Define with a prototype.
4655 * regex.c (PARAMS): Remove. All uses removed.
4656 All uses of _RE_ARGS removed, too.
4657 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4659 (bzero): Assume memset exists.
4660 (memcmp, memcpy, NULL): Remove.
4661 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
4662 char, or assignments to local vars of type signed char.
4663 (init_syntax_once, PREFIX(extract_number_and_incr),
4664 PREFIX(print_partial_compiled_pattern),
4665 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
4666 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
4667 PREFIX(regex_grow_registers), PREFIX(regex_compile),
4668 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
4669 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
4670 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
4671 wcs_compile_range, byte_compile_range, truncate_wchar,
4672 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
4673 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
4674 count_mbs_length, wcs_re_match_2_internal,
4675 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
4676 PREFIX(alt_match_null_string_p),
4677 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
4678 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
4679 regfree, PREFIX(extract_number)): Define with prototype. Remove
4680 now-unnecessary declaration, if any.
4681 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
4683 Remove now-unnecessary casts among pointer types.
4684 * regex.h (_RE_ARGS): Remove. All uses removed.
4686 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
4687 (free): Remove decl.
4689 * rpmatch.c: Include <stdlib.h> unconditionally.
4691 * same.c: Include <stdlib.h>, <string.h> unconditionally.
4692 (free): Remove decl.
4694 * save-cwd.c: Include <stdlib.h> unconditionally.
4695 * xgetcwd.c: Likewise.
4697 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
4698 (free): Remove decl.
4700 * strchrnul.c (strchrnul): Define with a prototype.
4701 Fix bug: c_in was not converted to char before searching.
4703 The following changes are not K&R related:
4705 * group-member.h: Include <sys/types.h>, so that this file is
4707 * makepath.h: Likewise.
4709 * getusershell.c (readname, default_index, line_size, readname):
4710 Use size_t, not int, for sizes.
4711 (readname): If the size overflows, report an error instead of
4714 2003-09-09 Derek Robert Price <derek@ximbiot.com>
4716 * getndelim2.c: Assume stdlib.h per the C89 spec.
4718 2003-09-08 Paul Eggert <eggert@twinsun.com>
4720 Assume C89 or better; remove K&R cruft.
4721 A few of these changes were first proposed by Derek Robert Price
4722 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
4724 * addext.c: Include <string.h> unconditionally.
4725 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
4726 Don't declare getenv or malloc.
4728 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
4729 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
4731 (find_stack_direction, alloca): Use prototypes.
4733 * atexit.c (atexit): Define using a prototype.
4735 * basename.c, dirname.c, stripslash.c:
4736 Include <string.h> unconditionally.
4738 * bcopy.c: Include <stddef.h>.
4739 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
4741 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
4743 * error.h (error, error_at_line, error_print_progname)
4744 [! (defined (__STDC__) && __STDC__)]: Remove decls.
4745 * error.c: Include error.h first, to check interface.
4746 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4747 (VA_START): Remove; all uses changeed to va_start.
4748 (exit, strerror): Remove decls.
4749 (error_print_progname): Prototype uncondionally.
4750 Don't include <errno.h>; no longer needed.
4751 (private_strerror): Remove.
4752 (error_tail): Always define.
4753 (error, error_at_line): Assume C89 or better; always use prototypes.
4754 * fatal.c: Include "fatal.h" first, to test interface.
4755 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4756 (VA_START): Remove; all uses changed to va_start.
4757 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
4759 (exit): Remove decl.
4760 (fatal): Prototype unconditionally. Assume va_start works.
4761 Abort at end, to pacify gcc.
4763 * euidaccess.c (main): Define with a prototype.
4765 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
4767 * exitfail.c: Include <stdlib.h> unconditionally.
4769 * fnmatch_.h (__P): Remove. All uses changed to assume
4771 * fnmatch.c: Include fnmatch.h first, to test interface.
4772 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
4773 (getenv): Remove decl.
4774 (fnmatch): Define using a prototype.
4775 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
4776 (FCT): Define using a prototype.
4778 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
4780 * gethostname.c: Include <stddef.h>.
4781 (gethostname): Define with prototype. Length is size_t, not int.
4783 2003-09-08 Paul Eggert <eggert@twinsun.com>
4785 * getversion.c: Remove; was migrated to backupfile.c in 1997.
4786 getversion.c should have been removed then, but was accidentally
4789 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
4790 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
4792 2003-09-07 Paul Eggert <eggert@twinsun.com>
4794 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
4795 copy_tm_result. Bug reported by Simon Josefsson in
4796 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
4798 2003-09-06 Paul Eggert <eggert@twinsun.com>
4800 * time_r.c, time_r.h: New files.
4802 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
4804 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
4805 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
4807 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
4809 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
4810 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
4813 * timegm.c: Switch to glibc implementation, with the following changes:
4814 [defined HAVE_CONFIG_H]: Include <config.h>.
4815 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
4816 (__mktime_internal) [!defined _LIBC]: New decl.
4817 (__gmtime_r) [!defined _LIBC]: New macro and function.
4818 (timegm): Use a prototype, since gnulib assumes C89.
4819 Do not bother declaring tmp to be const, as it's not really usefu.
4820 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
4821 (timegm): Declare only if HAVE_DECL_TIMEGM.
4823 2003-09-03 Paul Eggert <eggert@twinsun.com>
4825 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
4826 Bug reported by Lute Kamstra in
4827 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
4829 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
4830 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
4831 course with correspondingly smaller numbers for tomorrow and
4832 yesterday. From Tadayoshi Funaba. Originally installed into
4833 sh-utils on 1999-08-07, but the patch got lost (I guess during the
4836 2003-08-31 Simon Josefsson <jas@extundo.com>
4838 * timegm.h: New file.
4839 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
4841 2003-08-31 Karl Berry <karl@gnu.org>
4843 * argp.h: update from libc.
4845 2003-08-28 Bruno Haible <bruno@clisp.org>
4847 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
4848 warning on QNX, which defines O_BINARY to 000000.
4850 2003-08-24 Bruno Haible <bruno@clisp.org>
4852 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
4853 MSVC7 <stdio.h> is included later.
4855 2003-08-20 Bruno Haible <bruno@clisp.org>
4857 * progname.h: New file, from GNU gettext.
4858 * progname.c: New file, from GNU gettext.
4859 * progreloc.c: New file, from GNU gettext.
4861 2003-08-19 Bruno Haible <bruno@clisp.org>
4863 * xstrdup.c: Assume <string.h> exists.
4865 2003-08-18 Jim Meyering <jim@meyering.net>
4867 * setenv.h: Indent nested cpp directive.
4868 * vasnprintf.c: Remove trailing blanks.
4870 2003-08-17 Simon Josefsson <jas@extundo.com>
4871 Bruno Haible <bruno@clisp.org>
4873 * xstrndup.h: New file.
4874 * xstrndup.c: New file.
4876 2003-08-17 Bruno Haible <bruno@clisp.org>
4878 * strndup.h: New file.
4880 2003-08-16 Paul Eggert <eggert@twinsun.com>
4882 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
4883 space, undoing this 2003-08-12 change:
4884 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
4886 2003-08-16 Jim Meyering <jim@meyering.net>
4888 Merge from coreutils.
4889 * xstrtoimax.c: #else #if -> #elif.
4890 * xstrtoumax.c: Likewise.
4892 2003-08-15 Paul Eggert <eggert@twinsun.com>
4894 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
4895 rather than tab, after '#' in shell-script copyright notices.
4896 Suggested by Bruno Haible.
4898 2003-08-15 Jim Meyering <jim@meyering.net>
4899 and Paul Eggert <eggert@twinsun.com>
4901 Merge from coreutils.
4902 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
4903 member but strut utmpx does not. Needed for AIX 4.3.3.
4904 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
4906 2003-08-15 Jim Meyering <jim@meyering.net>
4908 Merge from coreutils.
4909 * xgethostname.c: Include <stdlib.h>.
4910 (xghostname): Don't exit for anything other than memory-related
4911 failure; just return NULL.
4912 * userspec.c: Include "posixver.h".
4913 (parse_user_spec): Accept `.' as a separator only
4914 in pre-POSIX-200112 mode.
4915 * strtoimax.c: Use #elif rather than #else #if.
4916 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
4917 Remove function, now that we can rely on a working tzset function.
4918 [!_LIBC]: Ensure that the required autoconf test has been run.
4919 [!defined _NL_CURRENT && HAVE_STRFTIME]:
4920 Use underlying_strftime for %r.
4921 * sha.c: Merge in some clean-up and optimization changes from glibc.
4922 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
4923 Ensure that it is a multiple of 64.
4924 Rearrange loop exit tests so as to avoid performing an
4925 additional fread after encountering an error or EOF.
4926 * realloc.c: Update copyright date.
4928 2003-08-14 Jim Meyering <jim@meyering.net>
4930 Merge from coreutils.
4931 * obstack.h: Whitespace changes.
4932 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
4933 and xcalloc return values.
4934 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
4935 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
4936 hang on OSF/1 5.1 for DIR on both local and remote file systems.
4937 Reported by (and fix confirmed by) Nelson H. F. Beebe.
4938 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4940 Use mntctl's return value to drive the entry-processing loop, since
4941 we can't rely on the value of the vmt_length member in the last
4942 entry. On some systems doing so could result in exhausting
4943 virtual memory. Based in part on a patch from Mike Jetzer.
4945 2003-08-14 Jim Meyering <jim@meyering.net>
4946 and Paul Eggert <eggert@twinsun.com>
4948 Merges from coreutils, plus other fixes.
4949 * physmem.c: Merge in portability changes from gcc/libiberty
4950 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
4951 for credits and details. Thanks to Kaveh Ghazi for helping
4952 to keep these files in sync.
4953 (ARRAY_SIZE): Define it.
4954 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
4955 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
4956 (memcasecmp): Don't assume size_t fits in unsigned int.
4957 Remove casts and duplicate code.
4958 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
4959 (memcpy): Remove definition.
4960 Merge in some clean-up and optimization changes from glibc.
4961 [BLOCKSIZE]: Move definition to top of file.
4962 Ensure that it is a multiple of 64.
4963 Rearrange loop exit tests so as to avoid performing an
4964 additional fread after encountering an error or EOF.
4965 * md5.h (md5_uintptr): Define.
4966 * makepath.c (CLEANUP_CWD): Report an error if we failed to
4967 return to the initial working directory. Preserve errno
4969 * idcache.c: Include "xalloc.h".
4970 (xmalloc, xrealloc): Remove decls.
4971 (getuser): Remove casts no longer required in C89.
4972 * human.c: Include stdio.h, for sprintf.
4973 * group-member.c: Include "xalloc.h".
4974 (xmalloc, xrealloc): Remove decls.
4975 (get_group_info): Remove casts no longer required in C89.
4976 * getusershell.c (readname): Remove casts no longer required in C89.
4977 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
4978 * getline.c: Whitespace fix, from coreutils.
4980 2003-08-13 Paul Eggert <eggert@twinsun.com>
4982 * exclude.c: Include <ctype.h>
4983 (IN_CTYPE_DOMAIN): New macro.
4985 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
4988 * argp-help.c, argp-parse.c, config.charset, getopt.h:
4989 Undo previous (whitespace-only) change.
4991 2003-08-12 Paul Eggert <eggert@twinsun.com>
4993 * argp-help.c, argp-parse.c, config.charset, getopt.h:
4994 Normalize leading white space and remove trailing white space.
4995 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
4996 notice, as per ../config/srclist-update.
4998 Merge from coreutils.
4999 * euidaccess.h: New file.
5000 * euidaccess.c: Include it.
5001 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
5002 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
5003 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
5005 2003-08-11 Bruno Haible <bruno@clisp.org>
5007 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
5008 (vasnprintf): Use it instead of wcslen.
5010 2003-08-11 Bruno Haible <bruno@clisp.org>
5012 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
5013 value to ensure that _Bool promotes to int. Use #define for _Bool when
5014 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
5016 2003-08-10 Karl Berry <karl@gnu.org>
5018 * regex.h: update from libc (whitespace fix).
5020 2003-08-09 Paul Eggert <eggert@twinsun.com>
5022 Merge some files from coreutils. These changes were
5023 originally made by Jim Meyering.
5024 * acl.c: Include <sys/types.h> before <sys/stat.h>;
5025 many older Unixes require this.
5026 * alloca.c (alloca): Remove cast to argument of free;
5027 no longer needed in C89.
5028 * alloca_.h, regex.h: Fix white space to match
5029 what GNU indent does.
5031 2003-08-05 Paul Eggert <eggert@twinsun.com>
5033 * bumpalloc.h: Remove.
5035 2003-08-04 Paul Eggert <eggert@twinsun.com>
5037 * getloadavg.c: Change copyright notice and spacing to conform to
5040 Merge from coreutils.
5041 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
5043 * getdate.y (date): Also accept dates like May-23-2003; suggestion
5044 from Karl Berry, implemented by Jim Meyering.
5045 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
5046 from Dmitry V. Levin.
5047 Remove anachronistic cast of xrealloc.
5048 * fnmatch_.h (__const): Remove. Use 'const'.
5049 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
5050 type. Otherwise, it wouldn't compile with at least /bin/cc on
5051 ymp-cray-unicos9.0.2.X.
5052 Combine two mostly-identical uses of alloca into one.
5053 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
5055 2003-08-04 Dave Love <d.love@dl.ac.uk>
5059 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
5060 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
5061 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
5062 obsolete NLIST_NAME_UNION.
5063 [__GNU__]: Undef BSD and FSCALE.
5064 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
5066 2003-08-03 Paul Eggert <eggert@twinsun.com>
5068 * stdbool_.h (_Bool): Make it signed char, instead of
5069 an enum type, so that it's guaranteed to promote to int. See:
5070 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
5072 2003-07-31 Paul Eggert <eggert@twinsun.com>
5074 * strerror.c: Include config.h, limits.h. Declare sprintf.
5075 (strerror): Don't assume that a printable int fits in 14 bytes.
5077 2003-07-24 Derek Robert Price <derek@ximbiot.com>
5078 Bruno Haible <bruno@clisp.org>
5080 * getline.h (getline, getdelim): Change return type to ssize_t.
5081 * getline.c (getline, getdelim): Likewise.
5082 Remove _GNU_SOURCE define; now it's defined in config.h through
5085 2003-07-22 Paul Eggert <eggert@twinsun.com>
5087 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
5088 over-parenthesization in macros.
5090 Sync with coreutils.
5092 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
5095 Use `exit_failure' for xalloc and xmemcoll instead of their own
5096 private exit-failure variables.
5097 * xalloc.h (xalloc_exit_failure): Remove.
5098 * xmalloc.c: Likewise. Include exitfail.h.
5099 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
5100 * xmemcoll.h (xmemcoll_exit_failure): Remove.
5101 * xmemcoll.c: Likewise. Include exitfail.h.
5102 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
5104 2003-07-18 Paul Eggert <eggert@twinsun.com>
5106 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
5107 * closeout.c: Likewise. Include "closeout.h" right after config.h,
5108 to test that it can stand by itself. Include "exitfail.h".
5109 Clients should set exit_failure instead.
5110 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
5112 2003-07-18 Andreas Schwab <schwab@suse.de>
5114 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
5116 2003-07-18 Bruno Haible <bruno@clisp.org>
5118 * getndelim2.h: New file.
5119 * getndelim2.c: Make into a module of its own. Include config.h,
5121 (getndelim2): Make non-static. Change return type to ssize_t.
5122 * getline.h: Change argument names.
5123 * getline.c: Include getndelim2.h instead of getndelim2.c.
5124 * getnline.c: Include getndelim2.h.
5126 2003-07-17 Bruno Haible <bruno@clisp.org>
5128 * Makefile.am: Remove file.
5129 * Makefile.in: Remove file.
5131 2003-07-17 Bruno Haible <bruno@clisp.org>
5133 * getnline.h: New file.
5134 * getnline.c: New file.
5135 * getndelim2.c: New file, extracted from getline.c.
5136 (getndelim2): Renamed from getdelim2, with added nmax argument.
5137 * getline.c: Include getndelim2.c.
5138 (getdelim2): Moved out to getndelim2.c.
5139 (getline, getdelim): Update.
5141 2003-07-15 <karl@gnu.org>
5143 * vasnprintf.c: update from gettext.
5145 2003-07-15 Jim Meyering <jim@meyering.net>
5147 * makepath.c (make_path): Enclose diagnostic in _(...).
5149 2003-07-14 Paul Eggert <eggert@twinsun.com>
5151 * asnprintf.c, asprintf.c, config.charset, gettext.h,
5152 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
5153 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
5154 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
5155 vasprintf.c, vasprintf.h: Regenerate. These files are now being
5156 updated automatically by ../config/srclist-update. This changes
5157 their license from LPGL to GPL.
5159 2003-07-14 Jim Meyering <jim@meyering.net>
5161 Don't emit diagnostics. Let callers do that.
5162 * save-cwd.c: Don't include "error.h".
5163 (save_cwd): Don't call error. Ensure that errno is valid
5164 when returning nonzero.
5166 * save-cwd.h (restore_cwd): Update prototype.
5167 * save-cwd.c (restore_cwd): Remove two parameters.
5168 Simplify. Don't call error upon failure. Let callers do that.
5169 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
5170 when auditing is enabled. But don't bother updating the #if.
5172 2003-07-14 Simon Josefsson <jas@extundo.com>
5174 * mempcpy.h: New file.
5175 * mempcpy.c: New file.
5177 2003-07-14 Paul Eggert <eggert@twinsun.com>
5179 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
5180 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
5181 unicodeio.c, unicodeio.h, unlocked-io.h:
5182 Switch from LGPL to GPL.
5184 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
5186 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
5187 it breaks C++ compilation.
5188 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
5190 2003-07-10 Jim Meyering <jim@meyering.net>
5192 * vasnprintf.c: Remove trailing blanks.
5193 Make cpp indentation consistent.
5195 2003-07-09 Paul Eggert <eggert@twinsun.com>
5197 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
5198 posixver.c, strftime.c, strnlen.c, strverscmp.c:
5199 Switch from LGPL to GPL.
5201 2003-07-07 Paul Eggert <eggert@twinsun.com>
5203 * mktime.c: Fix some boundary cases and remove need for floating point.
5205 Issue a compile-time diagnostic if time_t is floating point, or if
5206 two's complement arithmetic is not in effect, or if arithmetic
5207 right shift does not propagate the sign. These assumptions were
5208 all in the original code but they weren't checked.
5210 (TIME_T_MIDPOINT, verify): New macros.
5211 (__isleap): Remove; it has integer overflow problems.
5212 (leapyear): New function, without those problems.
5213 (ydhms_tm_diff): Remove; splitting into two parts.
5214 (ydhms_diff): New function, containing the arithmetic part of
5215 the old ydhms_tm_diff function. Issue a compile-time
5216 diagnostic if we are not using C99 integer division.
5217 Avoid casts when possible.
5218 (guess_time_tm): New function, containing the checking part of
5219 the old ydhms_tm_diff function. Return the new value, rather than
5220 the difference between it and the old. Accept a new argument T
5221 so that *T specifies the old value. Check for overflow in the result.
5223 (__mktime_internal): Use a time_t offset, not a long int offset.
5224 This undoes the 2003-06-04 change, which is no longer needed now
5225 that we have better overflow checking.
5226 (localtime_offset): Likewise.
5228 (__mktime_internal): Avoid harmful overflow on hosts where time_t
5229 and long are 64-bit but int is only 32-bit.
5230 (ydhms_diff): Use long int to store year1 and yday1.
5231 Issue a compile-time diagnostic if long int is not wide enough.
5233 (__mktime_internal): Use long int to store adjusted year and yday.
5234 Use plain C rather than preprocessor commands, if that doesn't
5236 Check for overflow (and try to repair) after each probe
5237 rather than checking only at the very end. This avoids some bugs
5238 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
5239 does not equal GMT offset at maximum time).
5240 Use integer to check for overflow rather than floating point; this
5241 is more portable to non-IEEE hosts, and is a tad faster.
5242 When we detect that we are oscillating between two values,
5243 don't check whether tm_isdst has the requested value, since
5244 we already know the answer. When tm_isdst has the wrong value,
5245 use a different heuristic to find the right one, based on the
5246 extreme values actually observed in practice in tz2003a,
5247 rather than the (overly optimistic) "previous 3 calendar quarters".
5249 (not_equal_tm, print_tm, check_result): Use "const T" rather than
5250 "T const" to accommodate glibc style.
5251 (check_result): Use less-confusing report format. "long" -> "long int.
5253 Don't loop if the iteration overflows time_t.
5254 Allow a negative step in the iteration.
5256 2003-07-01 Paul Eggert <eggert@twinsun.com>
5258 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5259 having it depend on HAVE_SYS_TYPES_H.
5261 2003-06-25 Bruno Haible <bruno@clisp.org>
5263 * readlink.c: New file.
5265 2003-06-20 Bruno Haible <bruno@clisp.org>
5267 Assume C89, so PARAMS isn't needed.
5268 * unicodeio.h (PARAMS): Remove.
5269 * unicodeio.c: Don't use PARAMS.
5271 2003-06-18 Jim Meyering <jim@meyering.net>
5273 Merge changes from coreutils.
5274 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5275 Remove explicit declarations of xmalloc and realloc.
5277 (read_utmp): Remove anachronistic cast of xmalloc.
5279 2003-06-17 Paul Eggert <eggert@twinsun.com>
5281 Assume C89, so PARAMS isn't needed.
5282 * backupfile.h (PARAMS): Remove. All uses removed.
5283 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5284 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5285 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5286 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5287 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5288 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5289 xstrtol.h: Likewise.
5290 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
5291 same.h, strverscmp.h: Do not include config.h; no longer needed.
5292 Anyway, config.h should always be included before any other file.
5294 2003-06-11 Simon Josefsson <jas@extundo.com>
5296 * sysexit_.h: New file.
5298 2003-05-20 Derek Price <derek@ximbiot.com>
5300 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5302 2003-06-10 Simon Josefsson <jas@extundo.com>
5304 * strchrnul.h: New file.
5305 * strchrnul.c: New file.
5307 2003-06-10 Simon Josefsson <jas@extundo.com>
5309 * argp.h: New file, from glibc.
5310 * argp-ba.c: New file, from glibc.
5311 * argp-eexst.c: New file, from glibc.
5312 * argp-fmtstream.c: New file, from glibc.
5313 * argp-fmtstream.h: New file, from glibc.
5314 * argp-fs-xinl.c: New file, from glibc.
5315 * argp-help.c: New file, from glibc.
5316 * argp-namefrob.h: New file, from glibc.
5317 * argp-parse.c: New file, from glibc.
5318 * argp-pv.c: New file, from glibc.
5319 * argp-pvh.c: New file, from glibc.
5320 * argp-xinl.c: New file, from glibc.
5322 2003-06-07 Jim Meyering <jim@meyering.net>
5324 * readtokens.h: Put `Free Software Foundation, Inc.'
5325 in place of my name in the copyright comment.
5326 Remove definition and uses of __P.
5329 * stat.c: Don't declare xmalloc explicitly.
5330 Instead, include "xalloc.h".
5331 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
5332 xrealloc, and xcalloc return values.
5333 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
5335 * xgetcwd.h: Remove definition/uses of PARAMS.
5337 2003-06-06 Jim Meyering <jim@meyering.net>
5339 * stdbool_.h: Renamed from stdbool.h.in.
5341 2003-06-06 Jim Meyering <jim@meyering.net>
5343 Merge from coreutils.
5344 * same.c: (same_name): Declare *_basename locals to be `const'.
5345 Consolidate declarations and initializations of *_base* locals.
5347 Merge from coreutils.
5348 This avoids a core dump on systems without GNU putenv,
5349 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5350 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5351 (unsetenv): New static function, from GNU libc.
5352 (rpl_putenv): Use it.
5354 * modechange.c: Remove trailing blanks.
5356 Merge from coreutils.
5357 * fsusage.c: Remove declaration of statfs.
5358 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5360 * posixtm.c: Include <stdbool.h> unconditionally.
5362 2003-06-05 Paul Eggert <eggert@twinsun.com>
5364 * mktime.c (__mktime_internal): When resolving a tm_isdst
5365 mismatch, look in future quarters as well as past. This fixes a
5366 bug when processing fall-backwards gaps immediately after a long
5367 period of daylight-saving time.
5369 * mktime.c: Assume freestanding C89 or better.
5370 (HAVE_LIMITS_H): Remove. Assume it's 1.
5371 (__P): Remove; not used.
5372 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5373 (mktime, not_equal_tm, print_tm, check_result,
5374 main): Use prototypes. Use const * where appropriate.
5375 (main): Fix typo in testing code that uncovered by above changes.
5376 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5378 2003-06-04 Paul Eggert <eggert@twinsun.com>
5380 * mktime.c: Fix Debian bug 177940
5381 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
5382 (localtime_offset): Now long int, not time_t, because we want it
5383 to be guaranteed to be signed. All uses changed.
5384 (__mktime_internal): If overflow would occur when adding offset,
5387 Merge 'human' changes from coreutils. Rewrite to support
5388 locale-specific notations like thousands separators.
5389 * human.c: Simplify authorship notice.
5390 Include human.h immediately after config.h.
5391 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
5392 <limits.h>: Do not include, since human.h does.
5393 (SIZE_MAX, UINTMAX_MAX): New macros.
5394 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
5395 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
5396 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
5397 (power_letter): Renamed from suffixes.
5398 (generate_suffix_backwards): Remove.
5399 (adjust_value): Now takes int style (because of human.h changes)
5400 and long double value (for greater precision on some platforms).
5401 (group_number): New function.
5402 (human_readable): Use it. Use integer options, not enum.
5403 Put the options before the sizes in the arg list.
5404 Support all the new options.
5405 The old human_readable function has been removed;
5406 use inttostr.h instead.
5407 (human_readable, default_block_size, humblock):
5408 Use uintmax_t, not int, for block sizes.
5409 (human_readable_inexact, block_size_types): Remove.
5410 (block_size_opts): New constant.
5411 (human_options): Renamed from human_block_size, with new signature
5412 that allows block sizes up to UINTMAX_MAX. All callers changed.
5413 * human.h: Add copyright and authorship notice.
5414 Include <limits.h> and <stdbool.h> unconditionally.
5415 (PARAMS): Remove. All uses removed.
5416 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
5417 (enum human_inexact_style): Remove tag; now a nameless enum.
5418 (human_floor, human_ceiling, human_round_to_even): Now have
5419 values 2, 0, 1 rather than -1, 1, 0.
5420 (human_group_digits, human_suppress_point_zero, human_autoscale,
5421 human_base_1024, human_SI, human_B): New constants.
5422 (human_readable_inexact, human_block_size): Remove.
5423 (human_readable): Size args are now uintmax_t, not int.
5424 (human_options): New decl.
5426 * exclude.c: (new_exclude, add_exclude): Remove casts that are
5427 unnecessary now that we assume C89 or better. This change
5428 imported from coreutils.
5430 * mktime.c (__mktime_internal): Do not reject negative timestamps
5431 arbitrarily. This is the same patch as 2003-05-28, but it got lost
5432 in the 2003-05-30 sync from glibc.
5434 .h files should stand alone, but we shouldn't include <sys/types.h>
5435 if we can get away with just <stddef.h>.
5437 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
5438 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
5439 rather than <sys/types.h>, as we merely need size_t.
5440 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
5442 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
5443 Include <stdio.h>, to get FILE.
5444 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
5445 memcasecmp.h has included <stddef.h> and all we need is size_t.
5446 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5447 our interface, instead of including <sys/types.h>
5449 2003-06-02 Paul Eggert <eggert@twinsun.com>
5452 Fix some minor time-related bugs with POSIX time arguments.
5453 Some valid time stamps were being rejected (notably -1, and
5454 time stamps before 1900 on 64-bit hosts). And some invalid
5455 time stamps were being accepted, e.g. September 31.
5457 * posixtm.h (posixtime): Return bool instead of time_t, so
5458 that we can return (time_t) -1 successfully.
5459 * posixtm.c: Likewise.
5460 [HAVE_STDBOOL_H]: Include <stdbool.h>.
5461 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
5462 (t): Remove static var.
5463 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
5464 of static var. All uses changed.
5465 (year): Do not reject years before 1900; they can occur with
5467 (posix_time_parse): Do not check for out-of-range components;
5468 that is now the caller's responsibility, since our checks were
5469 only approximations.
5470 (posixtime): Use mktime to check for out-of-range components,
5471 since it knows them exactly.
5472 If mktime returns (time_t) -1, check whether an error actually occurred
5473 by invoking localtime on -1.
5474 (main) [TEST_POSIXTIME]: Check for input data errors, and report
5475 posixtime failures better.
5476 Improve the test data (in comments only).
5478 2003-05-30 <karl@gnu.org>
5480 * mktime.c: update from libc.
5482 2003-05-30 Bruno Haible <bruno@clisp.org>
5484 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
5485 * localcharset.h: Likewise.
5486 * localcharset.c: Likewise.
5488 2003-05-28 Paul Eggert <eggert@twinsun.com>
5490 Assume the headers required for C89 freestanding compilers.
5491 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
5492 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
5493 without checking for HAVE_LIMITS_H.
5494 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
5495 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
5497 * fatal.c: Include <stdarg.h> without checking for __STDC__.
5498 * exclude.c: Include <stdbool.h> unconditionally.
5499 * tempname.c: Include <stddef.h> unconditionally.
5500 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
5501 * modechange.c, rpmatch.c (NULL): Don't define, since
5502 <stddef.h> does that.
5503 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
5504 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
5505 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
5506 * xstrtol.c: Likewise.
5507 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
5508 * savedir.c: Include <stddef.h> instead of defining NULL.
5510 * addext.c (addext): Use assignment rather than cast, to avoid
5511 warnings on some platforms.
5513 * mktime.c (__mktime_internal): Do not reject negative timestamps
5516 2003-05-10 Bruno Haible <bruno@clisp.org>
5518 * linebreak.c (iconv_string_length): Don't return -1 just because the
5519 string is longer than 4 KB.
5521 2003-05-12 Jim Meyering <jim@meyering.net>
5523 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
5524 the space-padded-by-default conversion specifiers, %e, %k, %l.
5526 2003-05-03 Bruno Haible <bruno@clisp.org>
5528 Upgrade to Unicode-4.0.
5529 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
5530 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
5531 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
5532 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
5533 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
5534 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
5535 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
5536 Change width of U+E0100..U+E01EF from 1 to 0.
5538 2003-04-25 Bruno Haible <bruno@clisp.org>
5540 * copy-file.c: Include <stddef.h>, for size_t.
5542 2003-04-25 Jim Meyering <jim@meyering.net>
5544 * copy-file.c (copy_file_preserving): Declare buf_size to be
5545 of type size_t, not int.
5547 2003-04-11 Jim Meyering <jim@meyering.net>
5549 Merge changes from Coreutils.
5551 2003-03-22 Jim Meyering <jim@meyering.net>
5553 * strftime.c (widen): Cast alloca return value to proper type.
5555 2003-01-19 Ulrich Drepper <drepper@redhat.com>
5558 * strftime.c (my_strftime): Handle very large width
5559 specifications for numeric values correctly. Improve checks for
5562 2003-01-19 Jim Meyering <jim@meyering.net>
5564 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
5565 (nl_get_alt_digit) [! defined my_strftime]: Define.
5566 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
5567 _nl_get_alt_digit and _nl_get_walt_digit.
5569 * strftime.c (my_strftime): Merge in locale-related changes from libc.
5570 These changes have no effect outside of _LIBC.
5572 2003-04-10 Bruno Haible <bruno@clisp.org>
5574 * findprog.h: New file, from GNU gettext.
5575 * findprog.c: New file, from GNU gettext.
5577 2003-04-05 Jim Meyering <jim@meyering.net>
5579 Merge changes from Coreutils.
5581 * exclude.h (PARAMS): Remove definition and uses.
5582 * exclude.c: Remove uses of `PARAMS'.
5584 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
5585 Add test-cases for DOS filenames. Declare program_name.
5586 (main): Set up program_name. Patch by Rich Dawe.
5588 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5590 Use mntctl's return value to drive the entry-processing loop, since
5591 we can't rely on the value of the vmt_length member in the last
5592 entry. On some systems doing so could result in exhausting
5593 virtual memory. Based in part on a patch from Mike Jetzer.
5595 2003-04-04 Bruno Haible <bruno@clisp.org>
5597 * linebreak.h: New file, from GNU gettext.
5598 * linebreak.c: New file, from GNU gettext with slight modifications.
5599 * lbrkprop.h: New file, from GNU gettext.
5601 2003-04-03 Bruno Haible <bruno@clisp.org>
5603 * utf8-ucs4.h: New file, from GNU gettext.
5604 * utf16-ucs4.h: New file, from GNU gettext.
5605 * ucs4-utf8.h: New file, from GNU gettext.
5606 * ucs4-utf16.h: New file, from GNU gettext.
5608 2003-04-02 Bruno Haible <bruno@clisp.org>
5610 * binary-io.h: New file, from GNU gettext.
5612 2003-04-01 Bruno Haible <bruno@clisp.org>
5614 * pathname.h: New file, from GNU gettext.
5615 * concatpath.c: New file, from GNU gettext.
5617 2003-03-30 Bruno Haible <bruno@clisp.org>
5619 * copy-file.c (copy_file_preserving): Don't set owner if the function
5620 chown() doesn't exist.
5622 2003-03-28 Bruno Haible <bruno@clisp.org>
5624 * copy-file.h: New file, from GNU gettext.
5625 * copy-file.c: New file, from GNU gettext.
5627 2003-03-18 Jim Meyering <jim@meyering.net>
5629 * quote.c (quote_n): Fix typo in comment.
5631 2003-03-14 Jim Meyering <jim@meyering.net>
5633 Merge changes from Coreutils.
5634 * obstack.h (obstack_object_size): Declare temporary, __o,
5635 to be const, in order to avoid warnings.
5636 (obstack_room): Likewise.
5637 (obstack_empty_p): Likewise.
5639 2003-03-13 Paul Eggert <eggert@twinsun.com>
5641 Merge changes from Bison.
5642 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
5643 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5644 when compiling Bison 1.875's `bitset bset = obstack_alloc
5645 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
5646 * hash.c: Include <stdbool.h> unconditionally.
5648 2003-03-09 Paul Eggert <eggert@twinsun.com>
5650 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
5651 Reported by Bruce Becker; see:
5652 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
5654 2003-03-03 Paul Eggert <eggert@twinsun.com>
5655 Bruno Haible <bruno@clisp.org>
5657 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
5658 Reported by John Hughes, see
5659 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
5661 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
5663 * poll_.h: New file.
5666 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
5668 * mathl.h: New file.
5669 * acosl.c: New file.
5670 * asinl.c: New file.
5671 * atanl.c: New file.
5672 * ceill.c: New file.
5675 * floorl.c: New file.
5676 * frexpl.c: New file.
5677 * ldexpl.c: New file.
5679 * sincosl.c: New file.
5681 * sqrtl.c: New file.
5683 * trigl.c: New file.
5684 * trigl.h: New file.
5686 2003-02-17 Bruno Haible <bruno@clisp.org>
5688 * mkdtemp.h: New file, from GNU gettext.
5689 * mkdtemp.c: New file, from GNU gettext.
5691 2003-01-31 Bruno Haible <bruno@clisp.org>
5693 * rename.c: #undef rename before defining rpl_rename.
5694 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
5696 2003-01-30 Bruno Haible <bruno@clisp.org>
5698 * printf-args.h: New file, from GNU gettext.
5699 * printf-args.c: New file, from GNU gettext.
5700 * printf-parse.h: New file, from GNU gettext.
5701 * printf-parse.c: New file, from GNU gettext.
5702 * vasnprintf.h: New file, from GNU gettext.
5703 * vasnprintf.c: New file, from GNU gettext.
5704 * asnprintf.c: New file, from GNU gettext.
5705 * vasprintf.h: New file, from GNU gettext with modifications.
5706 * vasprintf.c: New file, from GNU gettext.
5707 * asprintf.c: New file, from GNU gettext.
5709 2003-01-29 Bruno Haible <bruno@clisp.org>
5711 * stpncpy.h: New file, from GNU gettext with modifications.
5712 * stpncpy.c: New file, from GNU gettext with modifications.
5714 2003-01-28 Bruno Haible <bruno@clisp.org>
5716 * c-ctype.h: New file, from GNU gettext, with changes suggested by
5718 * c-ctype.c: New file, from GNU gettext, with changes suggested by
5721 2003-01-27 Bruno Haible <bruno@clisp.org>
5723 * xsetenv.h: New file, from GNU gettext.
5724 * xsetenv.c: New file, from GNU gettext.
5726 2003-01-23 Bruno Haible <bruno@clisp.org>
5728 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
5730 2003-01-22 Bruno Haible <bruno@clisp.org>
5732 * exit.h: New file, from GNU gettext.
5734 2003-01-11 Bruno Haible <bruno@clisp.org>
5736 * stpcpy.h (stpcpy): Use ANSI C function declarations.
5737 * strcase.h (strcasecmp, strncasecmp): Likewise.
5739 2003-01-14 Jim Meyering <jim@meyering.net>
5741 * same.c (same_name): Tweak a comment.
5743 2003-01-11 Bruno Haible <bruno@clisp.org>
5745 * same.c (same_name): Reorder tests so as to avoid calling stat()
5746 when a string comparison is sufficient.
5748 2003-01-11 Bruno Haible <bruno@clisp.org>
5750 * readtokens.c (readtoken): Cast character to 'unsigned char', not
5753 2003-01-11 Bruno Haible <bruno@clisp.org>
5755 * hash-pjw.c: Add comment about low quality of this function.
5757 2003-01-12 Paul Eggert <eggert@twinsun.com>
5759 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
5760 to avoid collisions with libcurses and libreadline.
5762 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
5763 * getstr.h, getstr.c: Remove.
5764 * getline.c: Include "getline.h", to check interface.
5765 Move body of old getstr.c here: this defines MIN_CHUNK and
5766 declares getdelim2, which is renamed from getstr.
5767 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
5769 * linebuffer.c (readlinebuffer): Renamed from readline.
5771 * linebuffer.h: Likewise.
5772 (readline): Remove backward-compatibility macro.
5774 2003-01-12 Jim Meyering <jim@meyering.net>
5776 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
5778 2003-01-10 Bruno Haible <bruno@clisp.org>
5780 * alloca_.h: New file.
5781 * getdate.y: Unconditionally include alloca.h.
5782 * makepath.c: Likewise.
5783 * setenv.c: Likewise.
5784 * userspec.c: Likewise.
5786 2003-01-09 Bruno Haible <bruno@clisp.org>
5788 * stdbool.h.in: New file.
5790 2003-01-08 Bruno Haible <bruno@clisp.org>
5792 * safe-read.c: Include specification header first, to ensure its
5794 * full-write.c: Likewise.
5796 2003-01-08 Jim Meyering <jim@meyering.net>
5798 * full-write.c: Undefine and define-away `const' after inclusion
5799 of errno.h, not before. Suggestion from Bruno Haible.
5801 2003-01-07 Jim Meyering <jim@meyering.net>
5803 * full-write.c: Rework so that it may serve to define full_read, too.
5804 * full-read.c: Simply #define FULL_READ and include full-write.c.
5806 2003-01-06 Jim Meyering <jim@meyering.net>
5808 * version-etc.c: Update year in translatable copyright string.
5810 2002-12-25 Bruno Haible <bruno@clisp.org>
5812 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
5813 * xstrtol.h: Likewise.
5814 * xstrtoimax.c: Likewise.
5815 * xstrtoumax.c: Likewise.
5816 * human.h: Likewise.
5818 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
5819 on systems that have <inttypes.h> but not <stdint.h>.
5821 2002-12-31 Paul Eggert <eggert@twinsun.com>
5823 * memcoll.c (memcoll): Fall back on a simple algorithm using
5824 memcmp if strcoll doesn't work.
5826 2002-12-23 Bruno Haible <bruno@clisp.org>
5828 * localcharset.h: New file.
5829 * localcharset.c: Include it.
5830 * unicodeio.c: Likewise.
5832 2002-12-22 Bruno Haible <bruno@clisp.org>
5834 * utime.c (utime_null): No need to call ftruncate if the file was
5837 2002-12-23 Bruno Haible <bruno@clisp.org>
5839 * memcoll.c (STRCOLL): New macro.
5842 2002-12-22 Bruno Haible <bruno@clisp.org>
5844 * getstr.h (getstr): Define, to avoid clash with libcurses.
5845 * linebuffer.h (readline): Define, to avoid clash with libreadline.
5847 2002-12-22 Bruno Haible <bruno@clisp.org>
5849 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
5851 2002-12-23 Bruno Haible <bruno@clisp.org>
5853 * getline.h: Include <stddef.h>, for size_t.
5855 * unicodeio.h: Include <stddef.h>, for size_t.
5856 * unicodeio.c: Don't include <stddef.h>.
5858 2002-12-17 Bruno Haible <bruno@clisp.org>
5860 * canon-host.c (strdup): Remove unused declaration.
5862 * fsusage.c: Include full_read.h.
5863 (get_fs_usage): Use full_read instead of safe_read.
5865 * utime.c (utime_null): Use SAFE_READ_ERROR.
5867 2002-12-11 Bruno Haible <bruno@clisp.org>
5869 * setenv.h: Rewritten to cope with systems that have setenv() but not
5871 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
5874 2002-12-11 Bruno Haible <bruno@clisp.org>
5876 * setenv.c (alloca): Fall back to malloc.
5878 (setenv): Use freea() to free memory allocated with alloca().
5880 2002-11-13 Bruno Haible <bruno@clisp.org>
5882 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
5883 function declarations.
5884 * unsetenv.c (unsetenv): Likewise.
5886 2002-03-04 Bruno Haible <bruno@clisp.org>
5888 Portability to AIX 4.3.3.
5889 * unsetenv.c: New file, extracted from setenv.c.
5890 * setenv.c: Move the unsetenv() function to unsetenv.c.
5892 2001-12-20 Bruno Haible <bruno@clisp.org>
5894 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
5895 use malloc instead. For SunOS 4.
5897 2001-12-11 Bruno Haible <bruno@clisp.org>
5899 * setenv.c: Declare alloca.
5900 (compar_fn_t): New typedef.
5901 (KNOWN_VALUE, STORE_VALUE): Use it.
5903 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
5906 2002-12-10 Paul Eggert <eggert@twinsun.com>
5908 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
5909 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
5910 Choose values that are less likely to collide with system fnmatch
5912 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
5913 defined (e.g., a pure POSIX system).
5914 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
5915 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
5917 2002-12-06 Jim Meyering <jim@meyering.net>
5919 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
5921 Merge in changes from libc's misc/error.c, in preparation
5922 for the merge of gnulib's changes back into libc.
5924 * error.c (_): Define only if not already defined.
5925 Move definition to follow all #include directives.
5926 Include unlocked-io.h only if !_LIBC.
5927 [_LIBC]: Include <libio/libioP.h>.
5928 [USE_IN_LIBIO]: Include <libio/iolibio.h>
5929 (fflush): Tweak definition to use INTUSE.
5932 2002-12-05 Paul Eggert <eggert@twinsun.com>
5934 * alloca.c [defined emacs]: Include "lisp.h".
5935 (xalloc_die) [defined emacs]: New macro.
5936 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
5937 [! defined emacs]: Include <xalloc.h>.
5938 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
5939 (pointer): Typedef to POINTER_TYPE *.
5940 (malloc): Remove decl; we now always use xmalloc.
5941 (alloca): Use old-style definition, since Emacs needs this.
5942 Check for arithmetic overflow when computing combined size.
5944 2002-12-04 Paul Eggert <eggert@twinsun.com>
5946 Do not generate unlocked-io.h automatically, since it's easier to
5947 maintain it by hand.
5949 * unlocked-io.h: New file, from GNU diffutils,
5950 but with proper copyright notice and attribution.
5952 * Makefile.am: Add copyright notice.
5953 (libfetish_a_SOURCES): Add unlocked-io.h.
5954 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
5955 (DISTCLEANFILES, io_functions): Remove macros.
5956 (EXTRA_DIST): Remove gen_uio.
5957 (unlocked-io.h): Remove rule.
5959 2002-12-04 Jim Meyering <jim@meyering.net>
5961 Reflect the fact that stat.c and lstat.c are no longer generated.
5962 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
5963 (DISTCLEANFILES): Likewise.
5964 (EXTRA_DIST): Likewise.
5965 (all_local): Don't depend on stat.c or lstat.c.
5966 (stat.c, lstat.c): Remove rules.
5967 (EXTRA_DIST): Remove xstat.in.
5969 * xstat.in: Remove file. Contents moved into stat.c.
5970 * stat.c: New file. Contents mostly from xstat.in.
5971 * stat.c: Rework so that it may serve to define rpl_lstat, too.
5972 * lstat.c: New file. Simply #define LSTAT and include stat.c.
5974 * safe-read.c: Rework so that it may serve to define safe_write, too.
5975 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
5977 2002-12-03 Jim Meyering <jim@meyering.net>
5979 * safe-read.c, safe-write.c: Change variable names and comments, but
5980 not semantics, to minimize the differences between these two files.
5981 (safe_read): Change comment to mention SAFE_READ_ERROR.
5983 * safe-read.c (IS_EINTR): Define.
5984 (safe_read): Use IS_EINTR in place of in-function cpp directives.
5986 2002-12-02 Bruno Haible <bruno@clisp.org>
5988 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
5989 Define, taken from safe-read.c.
5990 (INT_MAX): Provide fallback.
5991 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
5992 * safe-write.h (SAFE_WRITE_ERROR): Define.
5994 * safe-read.c (EINTR): Remove definition.
5995 (safe_read): Don't use EINTR if it is absent.
5997 2002-12-02 Jim Meyering <jim@meyering.net>
5999 * safe-read.c (EINTR): Define.
6000 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6001 (INT_MAX): Provide fallback.
6002 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
6004 * safe-read.h (SAFE_READ_ERROR): Define.
6006 2002-12-01 Jim Meyering <jim@meyering.net>
6008 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
6009 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
6011 2002-11-27 Paul Eggert <eggert@twinsun.com>
6013 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6014 hash_rehash): Replace `if (limit <= value) abort ();' with
6015 `if (! (value < limit)) abort ();', for readability.
6017 2002-11-26 <karl@gnu.org>
6019 * strdup.c: copy from libc again, with jim's ok.
6020 * .cppi-disable: re-add strdup.c
6022 2002-11-25 <karl@gnu.org>
6024 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
6025 instead of "strtol.c".
6027 2002-11-25 Jim Meyering <jim@meyering.net>
6029 * mktime.c: Sync from libc, now that it has the latest fix.
6031 2002-11-24 <karl@gnu.org>
6033 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
6034 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
6036 2002-11-24 Jim Meyering <jim@meyering.net>
6038 Update from coreutils:
6040 * mktime.c: Merge in changes from libc.
6042 Avoid a link-time failure on some Linux systems.
6043 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
6044 (__mon_yday): Declare with the STATIC attribute.
6045 (__mktime_internal): Likewise.
6046 Based on a report from Greg Schafer.
6048 2002-11-23 Jim Meyering <jim@meyering.net>
6050 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
6051 Use `unsigned', not `int', as type of index.
6053 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
6055 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
6057 2002-11-22 Paul Eggert <eggert@twinsun.com>
6059 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
6060 hint that one should use `if (! x) abort ();' rather than `assert
6061 (x);', and anyway it's one less thing to worry about configuring.
6062 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6063 hash_rehash, hash_insert): Use abort rather than assert.
6065 2002-11-22 Paul Eggert <eggert@twinsun.com>
6067 * quotearg.h: Allow multiple inclusion by surrounding with
6068 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
6069 so that we can be included first.
6070 (PARAMS): Remove; we now assume C89 or later. All uses removed.
6071 * quotearg.c: Include quotearg.h immediately after config.h.
6072 No need to include stddef.h or sys/types.h any more.
6073 Surround local include files with "", not "<>".
6074 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
6075 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
6076 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
6077 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
6078 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
6079 (ISPRINT): Remove; no longer needed now that we assume C89.
6081 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
6084 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
6085 quotearg_char): Use SIZE_MAX rather than
6086 (size_t) -1 when we are talking about "infinity".
6088 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
6090 2002-11-22 Bruno Haible <bruno@clisp.org>
6092 * safe-read.h: Assume C89. Add comments.
6093 (safe_read): Change return type to size_t.
6094 * safe-read.c (safe_read): Change return type to size_t. Handle byte
6095 counts > SSIZE_MAX correctly.
6096 * safe-write.h: New file.
6097 * safe-write.c: New file.
6098 * full-read.h: New file.
6099 * full-read.c: New file.
6100 * full-write.h: Assume C89. Add comments.
6101 * full-write.c: Include safe-write.h.
6102 (full_write): Rewritten to use safe_write.
6103 Suggested by Jim Meyering and Paul Eggert.
6105 2002-11-21 Bruno Haible <bruno@clisp.org>
6107 Remove case insensitive option matching.
6108 * argmatch.h (argcasematch): Remove declaration.
6109 (ARGCASEMATCH): Remove macro.
6110 (__xargmatch_internal): Remove case_sensitive argument.
6111 (XARGMATCH): Update.
6112 (XARGCASEMATCH): Remove macro.
6113 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
6114 case_sensitive argument.
6115 (argcasematch): Remove function.
6116 (__xargmatch_internal): Remove case_sensitive argument.
6117 (main): Use XARGMATCH instead of XARGCASEMATCH.
6119 * xmalloc.c: Change compile-time error message. Add comment about
6120 required autoconf version.
6122 2002-11-21 Jim Meyering <jim@meyering.net>
6124 * strdup.c (strdup): Tweak comment and initial #if/#include.
6126 Merge in changes from the coreutils.
6128 2002-09-25 Paul Eggert <eggert@twinsun.com>
6129 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
6130 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
6131 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
6132 int. Work more efficiently if X is the same width as uintmax_t.
6133 Do not compare X to -1, to avoid bogus compiler warning.
6134 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
6135 Don't assume that f_frsize and f_bsize are the same type.
6137 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
6140 * makepath.c (make_path): Restore umask *before* creating the final
6142 (make_path): Minor reformatting.
6144 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
6145 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
6147 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
6148 ones. At least on GNU/Linux systems, `auto' means something else.
6151 2002-11-20 Paul Eggert <eggert@twinsun.com>
6153 Merge argmatch cleanups from Bison. Assume C89.
6155 * argmatch.c: Include config.h here, not in argmatch.h.
6156 Include stdlib.h, for EXIT_FAILURE.
6157 Always include <string.h>, since we assume C89.
6158 (EXIT_FAILURE): Remove pre-C89 bug workaround.
6159 * argmatch.h: Do not include <config.h> or <sys/types.h>.
6160 Include <stddef.h> instead, since it's all we need for size_t.
6161 (PARAMS): Remove. All uses removed.
6162 (ARRAY_CARDINALITY): Do not bother to #undef.
6163 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
6164 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6165 Remove unnecessary parentheses.
6166 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6167 Insert necessary parentheses.
6168 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
6169 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
6171 2002-11-19 Bruno Haible <bruno@clisp.org>
6173 * mbswidth.c: Include mbswidth.h right at the beginning.
6174 * mbswidth.h: Include <stddef.h>, for size_t.
6176 * mbswidth.h (PARAMS): Remove macro.
6177 (mbswidth, mbsnwidth): Use ANSI C function declarations.
6178 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
6180 * gcd.h (PARAMS): Remove macro.
6181 (gcd): Use ANSI C function declarations.
6182 * gcd.c (gcd): Likewise.
6184 2002-11-15 Bruno Haible <bruno@clisp.org>
6186 * strcspn.c: Include <stddef.h>.
6187 (strcspn): Use ANSI C function declaration. Change return type to
6189 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
6190 (strpbrk): Use NULL.
6191 * strpbrk.h (PARAMS): Remove macro.
6192 (strpbrk): Use ANSI C function declaration.
6193 * strstr.c: Don't include <sys/types.h>.
6194 * strstr.h (PARAMS): Remove macro.
6195 (strstr): Use ANSI C function declarations.
6197 2002-11-06 Bruno Haible <bruno@clisp.org>
6199 * gcd.h (gcd): Change argument type to 'unsigned long'.
6200 * gcd.c (gcd): Likewise.
6202 2002-11-05 Bruno Haible <bruno@clisp.org>
6204 * gcd.h: New file, from gettext-0.11.5.
6205 * gcd.c: New file, from gettext-0.11.5.
6207 2002-11-05 Bruno Haible <bruno@clisp.org>
6209 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6210 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6211 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6212 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6214 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6215 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6217 * closeout.c: Include gettext.h instead of <libintl.h>.
6218 * human.c: Include gettext.h instead of <libintl.h>.
6219 * quotearg.c: Include gettext.h instead of <libintl.h>.
6220 * rpmatch.c: Include gettext.h instead of <libintl.h>.
6221 * unicodeio.c: Include gettext.h instead of <libintl.h>.
6222 * userspec.c: Include gettext.h instead of <libintl.h>.
6223 * version-etc.c: Include gettext.h instead of <libintl.h>.
6224 * xmalloc.c: Include gettext.h instead of <libintl.h>.
6225 (textdomain): Remove definition.
6226 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
6228 * long-options.c: Remove include of <libintl.h> and definition of _.
6229 * same.c: Remove include of <libintl.h> and definition of _.
6231 2002-11-04 Bruno Haible <bruno@clisp.org>
6233 * stpcpy.h: New file, from GNU gettext-0.11.5.
6234 * strcase.h: New file, from GNU gettext-0.11.5.
6235 * strpbrk.h: New file, from GNU gettext-0.11.5.
6236 * strstr.h: New file, from GNU gettext-0.11.5.
6237 * xgetcwd.h: New file, from GNU gettext-0.11.5.
6239 2002-05-09 Bruno Haible <bruno@clisp.org>
6241 * config.charset: Update for newest glibc. Add canonical names
6242 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
6244 2002-05-09 Bruno Haible <bruno@clisp.org>
6246 * localcharset.c (get_charset_aliases): Add more Windows specific
6249 2002-05-08 Owen Taylor <otaylor@redhat.com>
6251 * config.charset: A few additions for Solaris.
6253 2001-12-05 Bruno Haible <bruno@clisp.org>
6255 * localcharset.c (locale_charset): Don't return an empty string.
6257 2001-10-23 Bruno Haible <haible@clisp.cons.org>
6259 * config.charset: msdos in uk_UA uses CP1125.
6261 2001-08-05 Bruno Haible <haible@clisp.cons.org>
6263 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
6264 * localcharset.c (locale_charset): Declare as extern "C".
6266 2002-02-15 Bruno Haible <bruno@clisp.org>
6268 * config.charset [msdosdjgpp]: For Russian, use CP866.
6270 2002-02-11 Bruno Haible <bruno@clisp.org>
6272 * config.charset: Add support for NetBSD.
6274 2002-09-25 <karl@gnu.org>
6276 * strdup.c: copy from libc/string (via ../config/srclist*).
6277 * getopt*: copy from libc/posix.
6278 * gettext.h: copy from gettext.
6279 * .cppi-disable: add strdup.c, gettext.h.
6281 2002-07-01 Jim Meyering <meyering@lucent.com>
6283 * c-stack.c: Include sys/time.h.
6284 From Volker Borchert.
6286 2002-06-11 Paul Eggert <eggert@twinsun.com>
6288 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6289 New macro. Use it uniformly instead of
6290 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6291 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6292 reported by Vin Shelton.
6294 2002-06-22 Jim Meyering <meyering@lucent.com>
6296 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6297 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6299 2002-06-22 Paul Eggert <eggert@twinsun.com>
6301 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6302 Do not assume SA_SIGINFO behavior.
6303 Bug reported by Jim Meyering on NetBSD 1.5.2.
6305 2002-06-22 Jim Meyering <meyering@lucent.com>
6307 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6309 * exitfail.c, exitfail.h: Likewise.
6310 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6312 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6314 (EXTRA_DIST): Add fnmatch_loop.c.
6315 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6317 * fnmatch_loop.c: New file, from diffutils-2.8.2.
6318 * fnmatch.c: Update from diffutils-2.8.2.
6319 * fnmatch_.h: New file. From diffutils-2.8.2.
6320 * fnmatch.h: Remove file.
6322 2002-06-18 Paul Eggert <eggert@twinsun.com>
6324 * file-type.h: Report an error if neither S_ISREG nor
6325 S_IFREG is defined, instead of using a test specific to glibc
6326 2.2. This should be safe, since POSIX requires S_ISREG and
6327 Unix Version 7 had S_IFREG. We don't need to check for
6328 <sys/types.h> since we don't use any symbols that it defines.
6330 2002-06-15 Jim Meyering <meyering@lucent.com>
6332 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6333 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6334 have been included before this file.
6336 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
6338 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6339 so that each temporary file name is unique and valid in the first
6340 8 characters, for operation under DOS.
6342 2002-06-15 Jim Meyering <meyering@lucent.com>
6344 Work even with DJGPP 2.03, which lacks support for symlinks.
6346 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6348 * lchown.c (S_ISLNK): Likewise.
6350 2002-06-14 Jim Meyering <meyering@lucent.com>
6352 * file-type.h: Use the version from diffutils-2.8.2.
6353 * file-type.c: Likewise.
6355 2002-05-27 Jim Meyering <meyering@lucent.com>
6357 Fix a problem seen only on nonconforming systems whereby ls.c's
6358 use of localtime, and then of gettimeofday would cause trouble:
6359 the localtime call used to initialize rpl_gettimeofday's save
6360 mechanism would clobber ls's current local time information so
6361 that in any long listing the first file would always be listed
6362 with date 1970-01-01. Analysis by Volker Borchert.
6364 * gettimeofday.c (localtime): Undefine.
6365 (rpl_localtime): New function.
6367 2002-05-22 Jim Meyering <meyering@lucent.com>
6369 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6370 * file-type.h: New file.
6371 * file-type.c (file_type): New file/function. Extracted from diffutils.
6373 2002-04-29 Paul Eggert <eggert@twinsun.com>
6375 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6377 2002-04-28 Paul Eggert <eggert@twinsun.com>
6379 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6380 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
6381 of 127, since 64 is the largest conceivable number for ancient
6383 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6385 2002-04-28 Jim Meyering <meyering@lucent.com>
6387 * sig2str.c (WTERMSIG): Remove definition (unused).
6389 2002-04-28 Paul Eggert <eggert@twinsun.com>
6391 * sig2str.h, sig2str.c: New files.
6392 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6394 2002-04-24 Jim Meyering <meyering@lucent.com>
6396 * gettext.h: New file, from Gettext.
6397 * Makefile.am (INCLUDES): Remove -I../intl.
6398 (libfetish_a_SOURCES): Add gettext.h.
6400 2002-04-16 Jim Meyering <meyering@lucent.com>
6402 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6403 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6404 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6406 2002-04-12 Jim Meyering <meyering@lucent.com>
6408 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6410 2002-03-10 Jim Meyering <meyering@lucent.com>
6412 * makepath.c (make_path): Remove a comma from a diagnostic.
6413 Suggestion from Santiago Vila.
6415 2002-03-08 Jim Meyering <meyering@lucent.com>
6417 * rename.c: Mention that this wrapper is needed also on
6418 mips-dec-ultrix4.4 systems.
6420 2002-03-02 Jim Meyering <meyering@lucent.com>
6422 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6423 not HAVE_CLOCK_SETTIME.
6425 2002-02-27 Paul Eggert <eggert@twinsun.com>
6427 * nanosleep.h: Rename to....
6428 * timespec.h: New name for nanosleep.h. All uses changed.
6430 * gettime.c: New file.
6431 * settime.c: New file.
6434 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6435 timespec.h. Remove nanosleep.h.
6437 2002-02-25 Paul Eggert <eggert@twinsun.com>
6439 * acl.c, acl.h: New files.
6440 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6442 2002-02-24 Jim Meyering <meyering@lucent.com>
6444 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6445 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6446 cause trouble. Reported by Nelson Beebe.
6448 2002-02-23 Paul Eggert <eggert@twinsun.com>
6450 * path-concat.c (xpath_concat): Reorder code to pacify
6451 compilers that don't know that xalloc_die never returns.
6453 2002-02-20 Jim Meyering <meyering@lucent.com>
6455 * getdate.c: Regenerate using bison-1.33.
6457 2002-02-15 Paul Eggert <eggert@twinsun.com>
6459 * posixver.c, posixver.h: New files.
6460 * Makefile.am (libfetish_a_SOURCES): Add them.
6462 2002-02-02 Paul Eggert <eggert@twinsun.com>
6463 Bruno Haible <bruno@clisp.org>
6465 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6466 (fwrite_success_callback): New declaration.
6467 * unicodeio.c (unicode_to_mb): New function, extracted from
6468 print_unicode_char. Call failure callback instead of error.
6469 (fwrite_success_callback): New function.
6470 (exit_failure_callback): New function.
6471 (fallback_failure_callback): New function.
6472 (print_unicode_char): Call unicode_to_mb.
6474 2002-01-26 Jim Meyering <meyering@lucent.com>
6476 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6478 2002-01-22 Jim Meyering <meyering@lucent.com>
6480 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6481 Otherwise, some versions of automake would omit the rule that makes
6482 Makefile from Makefile.in.
6484 2001-01-21 Paul Eggert <eggert@twinsun.com>
6486 * xmemcoll.h, xmemcoll.c: New files.
6487 * Makefile.am (libfetish_a_SOURCES): Add them.
6488 * memcoll.c: Include errno.h, and declare errno if not defined.
6489 (memcoll): Set errno to zero if there is no error.
6491 * quotearg.c (quotearg_buffer_restyled):
6492 Fix bug with quoting buffers containing NUL when backslashing escapes.
6493 This bug was exposed by the other changes in this patch.
6494 (quotearg_n_options): New arg ARGSIZE.
6495 All callers changed.
6496 (quoting_options_from_style): New function.
6497 (quotearg_n_style): Use it.
6498 (quotearg_n_style_mem): New function.
6500 * quotearg.h (quotearg_n_style_mem): New function.
6502 2002-01-16 Jim Meyering <meyering@lucent.com>
6504 * getdate.y: Add three semicolons, each just before a closing brace.
6505 Bison (as of version 1.31) no longer papers over that mistake.
6507 2002-02-14 Paul Eggert <eggert@twinsun.com>
6509 * backupfile.c (ISDIGIT): Comment fix.
6510 * getdate.y (ISDIGIT): Likewise.
6511 * posixtm.c (ISDIGIT, year): Likewise.
6512 * strverscmp.c (ISDIGIT): Likewise.
6513 * userspec.c (ISDIGIT): Likewise.
6515 2002-01-05 Jim Meyering <meyering@lucent.com>
6517 * version-etc.c (version_etc_copyright): Update copyright year.
6519 2001-01-19 Paul Eggert <eggert@twinsun.com>
6521 * closeout.c (close_stdout_status): If ferror (stdout), do
6522 not silently exit merely because the output buffer happens to
6523 have nothing pending.
6525 2001-12-18 Paul Eggert <eggert@twinsun.com>
6527 See the big note in ../ChangeLog.
6528 * human.c (suffixes): Prefer K to k for 1024.
6529 (generate_suffix_backwards): New function.
6530 (human_readable_inexact): Use it.
6531 * xstrtol.c (__xstrtol): If there is no number but there
6532 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
6533 Accept 'K' as well as 'k'.
6535 2001-12-15 Jim Meyering <meyering@lucent.com>
6537 * regex.h (__restrict_arr): Update from libc.
6539 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
6540 as `remote' if the name starts with `//'. Suggested by Michael Stone.
6543 2001-12-10 Jim Meyering <meyering@lucent.com>
6545 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
6546 Instead, include "xalloc.h".
6547 (initbuffer): Don't cast xmalloc return value to char*.
6548 (readline): Reword comment.
6549 Don't cast xrealloc return value to char*
6552 2001-12-09 Jim Meyering <meyering@lucent.com>
6554 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
6555 `signed and unsigned type in conditional expression'.
6556 * posixtm.c (posix_time_parse): Likewise.
6558 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
6560 * readtokens.c (readtoken): Declare an index to be of type unsigned
6561 to avoid a pedantic warning.
6563 * getstr.c: Don't include assert.h.
6564 (getstr): Remove warning-evoking assertions.
6565 Return -1 if offset parameter is out of bounds.
6566 Change the type of a local from int to size_t.
6568 * strftime.c (my_strftime_localtime_r): Include this function
6569 definition in the `#if ! HAVE_TM_GMTOFF' block.
6571 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
6572 Include xalloc.h instead.
6574 2001-12-02 Jim Meyering <meyering@lucent.com>
6576 * tempname.c: Don't declare getenv, thus reverting the change of
6577 2001-11-18. It's no longer necessary, now that stdlib.h is always
6580 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
6581 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
6583 2001-11-30 Akim Demaille <akim@epita.fr>
6585 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
6586 before being defined.
6588 2001-11-27 Paul Eggert <eggert@twinsun.com>
6590 * quotearg.h (quotearg_n, quotearg_n_style):
6591 First arg is int, not unsigned.
6592 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
6593 (SIZE_MAX, UINT_MAX): New macros.
6594 (quotearg_n_options): Abort if N is negative.
6595 Avoid overflow check on hosts where size_t is 64 bits and int
6596 is 32 bits, as overflow is impossible there.
6597 Fix off-by-one typo that caused unnecessary reallocation.
6599 2001-11-27 Jim Meyering <meyering@lucent.com>
6601 * tempname.c: Merge with version from libc.
6602 * regex.c: Likewise.
6604 * tempname.c: Include stdlib.h unconditionally. On some old systems
6605 for which STDC_HEADERS is 0, it was not included, resulting in a
6606 warning about an integer-to-pointer conversion problem with getenv.
6607 Reported by Volker Borchert.
6609 2001-11-26 Jim Meyering <meyering@lucent.com>
6611 * gtod.h: Remove file.
6612 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
6613 * gettimeofday.c: Don't include gtod.h.
6614 (GTOD_init): Remove function.
6615 (rpl_gettimeofday): Do its job here instead, rather than aborting.
6616 Suggestion from Volker Borchert.
6618 2001-11-23 Jim Meyering <meyering@lucent.com>
6620 * hash.h (struct hash_table): Don't define here. Merely declare it.
6621 * hash.c (struct hash_table): Define it here instead.
6623 2001-11-22 Jim Meyering <meyering@lucent.com>
6625 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
6627 2001-11-18 Paul Eggert <eggert@twinsun.com>
6629 * tempname.c (TMP_MAX): Remove; no longer needed.
6630 (TEMPORARIES): New macro.
6631 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
6632 removes an artificial limitation (e.g. HP-UX 10.20, where
6635 2001-11-18 Jim Meyering <meyering@lucent.com>
6637 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
6640 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
6641 files will be created before anything else.
6643 2001-11-17 Jim Meyering <meyering@lucent.com>
6645 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
6646 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
6647 rather than group writable. Patch by Juan F. Codagnone.
6649 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
6650 Instead, include "xalloc.h".
6652 * mountlist.c: Include unlocked-io.h after all system headers.
6653 Remove explicit declarations of xmalloc, xrealloc,
6654 and xstrdup. Instead, include "xalloc.h".
6656 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
6657 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
6658 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
6660 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
6661 Reported by Padraig Brady.
6663 * mkstemp.c: #undef mkstemp.
6665 (rpl_mkstemp): Rename from mkstemp.
6668 2001-11-16 Jim Meyering <meyering@lucent.com>
6670 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
6671 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
6672 determine the amount of total physical memory, use pstat_getstatic.
6673 HPUX-11 doesn't define _SC_PHYS_PAGES.
6674 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
6675 If sysconf couldn't be used to determine the amount of available
6676 physical memory, use both pstat_getstatic and pstat_getdynamic.
6677 Based on a patch from Bob Proulx.
6679 2001-11-05 Jim Meyering <meyering@lucent.com>
6681 * xstat.in (slash_aware_lstat): Correct a misleading comment.
6683 2001-11-03 Jim Meyering <meyering@lucent.com>
6685 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
6686 in argmatch_to_argument call.
6688 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
6691 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
6692 e.g., a fault due to an attempt to free a NULL pointer.
6694 2001-11-01 Jim Meyering <meyering@lucent.com>
6696 * dirfd.c, dirfd.h: New files.
6697 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
6699 * hash.c (hash_print) [TESTING]: Clean up.
6701 2001-10-22 Paul Eggert <eggert@twinsun.com>
6703 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
6704 to avoid a warning if -Wall.
6706 2001-10-21 Paul Eggert <eggert@twinsun.com>
6708 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
6710 2001-10-21 Jim Meyering <meyering@lucent.com>
6712 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
6713 this code would end up calling gettext even in packages built
6715 * getopt.c (_): Likewise.
6716 * regex.c (_): Likewise.
6718 2001-10-20 Paul Eggert <eggert@twinsun.com>
6720 * error.c (strerror_r): Do not declare unless !_LIBC.
6721 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
6722 Use strerror_r that is only a macro, even if it is not a function.
6723 (strerror): Check for HAVE_DECL_STRERROR before declaring.
6724 (private_strerror): Use prototypes, not old-style function definition.
6725 (print_errno_message): New function.
6726 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
6728 (error_tail, error, error_at_line): Use it.
6730 2001-10-11 Jim Meyering <meyering@lucent.com>
6732 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
6733 and quote_n (1, ... to avoid clobbering a buffer.
6735 2001-10-05 Jim Meyering <meyering@lucent.com>
6737 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
6738 * hash-pjw.c: New file (factored out of fileutils' remove.c).
6739 * hash-pjw.h: New file.
6741 2001-09-30 Jim Meyering <meyering@lucent.com>
6743 * mountlist.c [MOUNTED_GETFSSTAT]:
6744 Include <sys/ucred.h>, for Apple Darwin.
6745 Include sys/mount.h and sys/fs_types.h only if available.
6747 (read_filesystem_list): Use FS_TYPE.
6749 2001-09-29 Paul Eggert <eggert@twinsun.com>
6751 * exclude.c (excluded_filename): 0 -> false, since it's
6754 2001-09-28 Paul Eggert <eggert@twinsun.com>
6756 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
6757 #defines strtoimax. Also treat the other strto* functions
6760 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
6761 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
6762 (strtoimax, strtoumax): Do not declare if already defined as a macro.
6764 2001-09-26 Jim Meyering <meyering@lucent.com>
6766 Most macros in unlocked-io.h had the wrong number of arguments.
6767 * gen-uio: New script.
6768 (USE_UNLOCKED_IO): Define to 1 if not already defined.
6769 * unlocked-io.hin: Remove file.
6770 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
6771 rather than trying to embed it here.
6772 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
6773 Reported by Padraig Brady.
6775 2001-09-25 Volker Borchert <bt@teknon.de>
6777 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
6779 2001-09-23 Jim Meyering <meyering@lucent.com>
6781 * mountlist.c: Remove useless parentheses in #if directives.
6782 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
6783 the deprecated MOUNTED symbol is no longer defined in mntent.h.
6785 2001-09-22 Jim Meyering <meyering@lucent.com>
6787 * localcharset.c: Update from latest gettext.
6788 * config.charset: Likewise.
6790 2001-09-20 Jim Meyering <meyering@lucent.com>
6792 * xstrtol.c (strtoimax): Guard declaration with
6793 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
6794 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
6795 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
6796 (strtoumax): Likewise, for completeness (it wasn't necessary).
6798 2001-09-06 Paul Eggert <eggert@twinsun.com>
6800 * strtoimax.c (HAVE_LONG_LONG):
6801 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
6802 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
6803 to work around bug in IBM C compiler.
6805 2001-09-16 Jim Meyering <meyering@lucent.com>
6807 * mkdir.c: New file.
6809 2001-09-04 Paul Eggert <eggert@twinsun.com>
6811 * xgetcwd.c: Revert some of the previous change; intead,
6812 fix the HAVE_GETCWD_NULL code to behave more like the
6813 !HAVE_GETCWD_NULL code used to.
6816 (xgetcwd): Do not return NULL when memory is exhausted; instead,
6819 2001-09-04 Paul Eggert <eggert@twinsun.com>
6821 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
6822 Use ssize_t, not int, to store result of readlink.
6823 Check for ssize_t overflow as well as size_t overflow,
6824 as POSIX says the result of readlink is implementation-defined
6825 when ssize_t overflows.
6826 Remove unnecessary cast to char*.
6827 Use free+malloc instead of realloc, as the storage doesn't need
6828 to be preserved and it's clearer and can be more efficient that way.
6829 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
6830 * xreadlink.h (xreadlink): Update prototype.
6832 2001-09-03 Paul Eggert <eggert@twinsun.com>
6834 * exclude.c (fnmatch_no_wildcards): Fix confusion between
6835 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
6836 spotted by Jim Meyering.
6838 2001-09-03 Jim Meyering <meyering@lucent.com>
6840 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
6842 2001-09-03 Paul Eggert <eggert@twinsun.com>
6844 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
6845 like the HAVE_GETCWD_NULL code.
6846 Include pathmax.h if not HAVE_GETCWD.
6847 Do not include xalloc.h.
6848 (INITIAL_BUFFER_SIZE): New symbol.
6849 Do not use xmalloc / xrealloc, since the caller is responsible for
6850 handling errors. Preserve errno around `free' during failure.
6851 Do not overrun buffer when using getwd.
6853 2001-09-03 Paul Eggert <eggert@twinsun.com>
6855 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
6856 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
6858 2001-09-02 Jim Meyering <meyering@lucent.com>
6860 * error.c: Update from GNU libc.
6862 2001-09-01 Jim Meyering <meyering@lucent.com>
6864 * xreadlink.c: New file.
6865 * xreadlink.h: New file.
6866 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
6868 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
6869 doesn't conflict with sparc Solaris 7's definition in
6870 /usr/include/sys/int_types.h.
6872 * exclude.c: Use `""', not `<>' to #include non-system header files.
6873 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
6874 and strncasecmp as r-values. Unixware didn't have declarations.
6876 2001-08-31 Jim Meyering <meyering@lucent.com>
6878 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
6879 Use an initial, malloc'd, buffer of length 128 rather than
6880 a statically allocated one of length 1024.
6882 2001-08-30 Paul Eggert <eggert@twinsun.com>
6884 * xgetcwd.c: Don't include pathmax.h.
6885 Include stdlib.h and unistd.h if available.
6887 (xmalloc, xstrdup, free): Remove decls.
6888 (xgetcwd): Don't assume sizes fit in unsigned.
6889 Check for overflow when computing sizes.
6890 Simplify reallocation code.
6892 2001-08-28 Paul Eggert <eggert@twinsun.com>
6894 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
6896 * strtoimax.c: Renamed from strtoxmax.c, removing the
6899 Also, make the following further changes to make this file's
6900 configuration more similar to that of strtol.c:
6901 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
6902 (strtoumax, uintmax_t, strtoull, strtol): Remove.
6903 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
6904 (strtoimax): Renamed from strtoumax. All uses of unsigned values
6905 changed to signed values.
6907 And make the following changes as well:
6908 Fix copyright notice, as 1999 was missing.
6909 (verify): New macro.
6910 (strtoimax): Check sizes at compile-time, not run-time.
6911 Prefer strtol to strtoll if both work.
6912 (main): Remove; it was not that useful and was a pain to maintain.
6914 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
6916 2001-08-30 Paul Eggert <eggert@twinsun.com>
6918 * savedir.c (savedir): Remove size parameter, as POSIX says that
6919 a directory's st_size can have an arbitrary value, so the old
6920 usage could waste an arbitrary amount of memory. All uses
6922 * savedir.h: Update prototype.
6924 2001-08-30 Paul Eggert <eggert@twinsun.com>
6926 * xstrtol.c (strtoimax): New decl.
6928 2001-08-28 Paul Eggert <eggert@twinsun.com>
6930 * xstrtol.h: Add copyright notice.
6931 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
6932 LONGINT_INVALID_SUFFIX_CHAR.
6934 2001-08-30 Paul Eggert <eggert@twinsun.com>
6936 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
6939 2001-08-30 Paul Eggert <eggert@twinsun.com>
6941 * hash.c: Remove '2001' from copyright notice.
6943 2001-08-30 Paul Eggert <eggert@twinsun.com>
6945 * full-write.h: New file.
6946 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
6947 * full-write.c: Correct credits, as cccp.c no longer
6948 exists and anyway it was so heavily changed from the old cccp
6949 code as to be unrecognizable. Include full-write.h.
6950 (full_write) Return size_t, with short writes meaning failure.
6951 All callers changed. This fixes a bug with large buffers
6953 * utime.c: Include full-write.h.
6955 2001-08-30 Paul Eggert <eggert@twinsun.com>
6957 Merge 'exclude' changes from tar 1.13.22.
6958 This fixes one or two unlikely storage allocation overflow bugs,
6959 but doesn't change user-visible behavior otherwise.
6961 2001-08-30 Paul Eggert <eggert@twinsun.com>
6963 * exclude.c (bool): Declare, perhaps by including stdbool.h.
6964 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
6965 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
6966 Include if available.
6967 (<xalloc.h>): Include
6968 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
6969 (verify): New macro. Use it to verify that EXCLUDE macros do not
6970 collide with FNM macros.
6971 (struct patopts): New struct.
6972 (struct exclude): Use it, as exclude patterns now come with options.
6973 (new_exclude): Support above changes.
6974 (new_exclude, add_exclude_file):
6975 Initial size must now be a power of two to simplify overflow checking.
6976 (free_exclude, fnmatch_no_wildcards): New function.
6977 (excluded_filename): No longer requires options arg, as the options
6978 are determined by add_exclude. Now returns bool, not int.
6979 (excluded_filename, add_exclude):
6980 Add support for the fancy new exclusion options.
6981 (add_exclude, add_exclude_file): Now takes int options arg.
6982 Check for arithmetic overflow when computing sizes.
6983 (add_exclude_file): xrealloc might modify errno, so don't
6984 realloc until after errno might be used.
6986 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
6988 (free_exclude): New decl.
6989 (add_exclude, add_exclude_file): Now takes int options arg.
6990 (excluded_filename): No longer requires options arg, as the options
6991 are determined by add_exclude. Now returns bool, not int.
6993 2001-08-30 Paul Eggert <eggert@twinsun.com>
6995 * alloca.c (alloca): Arg is of type size_t, not unsigned.
6997 2001-08-27 Jim Meyering <meyering@lucent.com>
6999 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
7001 * version-etc.c (N_): Remove definition.
7002 Revert most of last change.
7003 Instead, simply don't mark the `Copyright...' string for translation.
7004 Based on advice from Paul Eggert.
7006 * strtoxmax.c: Tweak comment.
7008 2001-08-26 Jim Meyering <meyering@lucent.com>
7010 * version-etc.c (version_etc_copyright_fmt): Replace literal year
7011 of copyright with `%s' so translators don't get an untranslated
7013 (COPYRIGHT_YEAR): Define.
7014 (version_etc): Use fprintf rather than fputs.
7015 Suggestion from Ulrich Drepper.
7017 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
7019 * strtoll.c: New file, from GNU libc.
7020 * xstrtoimax.c: New file.
7022 * xstrtol.h: Add xstrtoimax.
7023 * strtoumax.c: New file. Simply include "strtoumax.c".
7024 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
7026 * strtoumax.c: Factor to work both for unsigned and signed types, ...
7027 * strtoxmax.c: ... then renamed to this.
7029 2001-08-13 Paul Eggert <eggert@twinsun.com>
7031 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
7032 Port to Solaris 8, where 'sed' requires a space after the 'r'
7033 command, and where sh dislikes "$/". Clean up the spacing a bit.
7034 Redirect output to $tmp just once.
7036 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
7038 * addext.c (<errno.h>): Include.
7039 (errno): Declare if not defined.
7040 (addext): Work correctly when pathconf returns -1 and leaves
7041 errno alone because there is no limit. Also, work even if
7042 pathconf returns a value greater than SIZE_MAX.
7044 2001-08-12 Jim Meyering <meyering@lucent.com>
7046 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
7047 Simply `return getcwd (NULL, 0);'.
7048 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
7049 Use 1300 as initial value for length, not PATH_MAX.
7051 * pathmax.h: Clean up cpp syntax.
7053 2001-08-12 Jim Meyering <meyering@lucent.com>
7055 * gettimeofday.c: New file.
7057 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
7059 2001-08-04 Jim Meyering <meyering@lucent.com>
7061 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
7062 to get in sync with glibc.
7064 2001-08-03 Paul Eggert <eggert@twinsun.com>
7066 The following changes are from gettext 0.10.39 as maintained by
7069 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
7070 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
7071 with inverted sense. All uses changed.
7073 * mbswidth.c: Don't include <limits.h>.
7074 Include <stdlib.h> and <string.h> unconditionally.
7075 (iswcntrl, mbsinit, ISCNTRL): New macros.
7076 (mbsnwidth): Use K&R style function declarations.
7077 Don't bother checking for MB_LEN_MAX == 1, since the compiler
7078 can optimize it when MB_CUR_MAX == 1.
7079 The width of control characters is zero, not 1.
7081 2001-07-15 Jim Meyering <meyering@lucent.com>
7083 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
7084 (BUILT_SOURCES): Add unlocked-io.h.
7085 (io_functions): Define.
7086 (unlocked-io.h): New rule.
7087 (DISTCLEANFILES): Add unlocked-io.h.
7088 (all-local): Depend on unlocked-io.h, to ensure it is created.
7090 * unlocked-io.hin: New file
7092 * regex.c: Update from glibc.
7094 2001-07-05 Jim Meyering <meyering@lucent.com>
7096 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
7098 (libfetish_a_SOURCES): Put all .h files here instead.
7099 Remove a thus-exposed (better checks in automake) duplicate and
7100 two unnecessary .h files.
7102 2001-06-11 Jim Meyering <meyering@lucent.com>
7104 * regex.c: Update from GNU libc.
7106 2001-05-27 Jim Meyering <meyering@lucent.com>
7108 * readutmp.h (UT_TYPE): Define.
7110 2001-05-24 Jim Meyering <meyering@lucent.com>
7112 * argmatch.c: Include "quote.h".
7113 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
7114 quote function. Reported by Göran Uddeborg.
7116 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
7118 * dirname.c (dir_name): Compute append_dot using path, not newpath
7119 which is not yet declared.
7121 2001-05-11 Paul Eggert <eggert@twinsun.com>
7123 * Makefile.am (libfetish_a_SOURCES):
7124 Add strftime.c, since we now compile it on all hosts.
7126 * strftime.c (my_strftime):
7127 Define to nstrftime if emacs, but only if my_strftime is not defined.
7128 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
7129 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
7130 Add one more extra argument: a nanoseconds value.
7133 (my_strftime function): Add %N format.
7134 (emacs_strftimeu): Renamed from emacs_strftime,
7135 with extra ut argument.
7137 2001-05-11 Paul Eggert <eggert@twinsun.com>
7139 dirname code cleanup. base_name now behaves more compatibly
7140 with POSIX basename when given file names that have trailing
7141 slashes, and similarly for dir_name. Add new primitives
7142 base_len and dir_len. Put the directory-name-related decls
7145 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
7146 * backupfile.c (base_name): Likewise.
7147 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
7148 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
7149 * makepath.c (strip_trailing_slashes): Likewise.
7150 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
7152 * rename.c (strip_trailing_slashes): Likewise.
7153 * same.c (base_name): Likewise.
7154 * stripslash.c (ISSLASH): Likewise.
7156 * addext.c: Include <dirname.h> after size_t is defined.
7157 * backupfile.c: Likewise.
7159 * addext.c (addext): Use base_len to trim redundant
7160 trailing slashes instead of doing it ourselves.
7161 But do not trim the last slash if it is not redundant.
7163 * backupfile.c (find_backup_file_name,
7164 max_backup_version): Use base_len instead of rolling it ourselves.
7165 Handle the case of "" and (on DOS) "C:" correctly.
7167 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
7168 Include <string.h>, <dirname.h>.
7169 (base_name): Allow file names ending in slashes, other than names
7170 that are all slashes. In this case, return the basename followed
7171 by the slashes. This is more general, and can be used in places
7172 where the original base_name purposely had an assertion failure.
7173 (base_len): New function.
7175 * dirname.c: Include <string.h> instead of <stdlib.h>.
7176 Do not include <assert.h>; no longer needed.
7178 (memrchr): Remove decl.
7179 (dir_name_r): Remove.
7180 (dir_len): Renamed from dirlen. All callers changed.
7181 Rewrite in terms of base_name, for simplicity and consistency.
7182 (dir_name): Never return NULL. All callers changed.
7183 Do not include <stdlib.h> in test program; no longer needed.
7184 return 0; is fine for test program.
7186 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
7188 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
7190 * path-concat.c (path_concat): Use base_len to compute
7191 base length, not strlen; this means we cannot rely on memcpy
7194 * same.c (STREQ): Remove.
7195 (same_name): Handle the case where the basename ends in trailing '/'.
7197 * stripslash.c (strip_trailing_slashes): Return nonzero if
7198 a slash was stripped. Do not strip the last slash after a
7201 2001-04-08 Jim Meyering <meyering@lucent.com>
7203 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
7204 recomputed; that's necessary when the offset spans a DST transition.
7205 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
7207 2001-04-02 Jim Meyering <meyering@lucent.com>
7209 * regex.h, regex.c: Update from GNU libc.
7211 2001-03-19 Paul Eggert <eggert@twinsun.com>
7213 * version-etc.c (version_etc_copyright): Update to 2001.
7215 2001-03-16 Paul Eggert <eggert@twinsun.com>
7217 * tempname.c (uint64_t): Define to uintmax_t if
7218 not defined, and if UINT64_MAX is not defined.
7219 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
7220 Reported by John David Anglin.
7222 2001-03-10 Bruno Haible <haible@clisp.cons.org>
7224 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
7225 alias if codeset is empty.
7226 * config.charset (BeOS): Use wildcard syntax.
7228 2001-03-13 Jim Meyering <meyering@lucent.com>
7230 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
7231 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
7234 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7236 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
7238 * unicodeio.c (print_unicode_char): Simplify accordingly.
7240 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7242 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
7243 support for DOS/DJGPP.
7245 2001-02-28 Paul Eggert <eggert@twinsun.com>
7247 * Makefile.am (libfetish_a_SOURCES):
7248 Add dup-safer.c, fopen-safer.c.
7249 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
7251 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
7253 2001-02-25 Paul Eggert <eggert@twinsun.com>
7255 The mkstemp replacement is taken from glibc 2.2.2, with some
7256 portability fixes for use outside glibc, as follows:
7258 * tempname.c (struct_stat64): New macro.
7259 (direxists, __gen_tempname): Use it.
7260 This avoids a portability problem with Solaris 8.
7262 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7263 (<stddef.h>, <stdint.h>, <string.h>):
7264 Include only if STDC_HEADERS || _LIBC.
7265 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7266 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7267 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7268 (__set_errno): Define this macro if <errno.h> doesn't.
7269 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7270 Define these macros if <stdio.h> doesn't.
7271 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7272 Define these macros if <sys/stat.h>
7273 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7274 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7275 __xstat64): Define if not _LIBC.
7276 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7277 (__gen_tempname): Invoke gettimeofday only if
7278 HAVE_GETTIMEOFDAY || _LIBC;
7279 otherwise, fall back on plain "time".
7280 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7282 * mkstemp.c (__GT_FILE): Define to zero if not defined.
7284 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7286 2001-02-17 Jim Meyering <meyering@lucent.com>
7288 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
7289 around included file name.
7291 * strnlen.c (__strnlen): Merge in a change from GNU libc.
7293 * strftime.c: Update from GNU libc (the only changes were to comments).
7295 2001-02-13 Bruno Haible <haible@clisp.cons.org>
7297 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7299 2001-02-17 Paul Eggert <eggert@twinsun.com>
7301 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7302 Remove workaround macros for hosts that have mbrtowc but not
7303 mbstate_t, as we now insist on proper declarations for both
7304 before using mbrtowc.
7306 2001-02-17 Jim Meyering <meyering@lucent.com>
7308 * regex.c: Update from libc.
7310 2001-02-16 Paul Eggert <eggert@twinsun.com>
7312 * alloca.c (malloc): Undef before defining, since stdlib.h
7313 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
7314 Reported by Mark Hounschell via Paul Eggert.
7316 2001-01-30 Bruno Haible <haible@clisp.cons.org>
7318 * config.charset: Update for FreeBSD 4.2.
7320 2001-01-26 Jim Meyering <meyering@lucent.com>
7322 * quotearg.c: Include stddef.h.
7323 * quote.c: Include stddef.h.
7324 Reported by Axel Kittenberger.
7326 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7327 line in double quotes so that it evokes a better diagnostic.
7328 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7329 Reported by Axel Kittenberger.
7331 2001-01-15 Bruno Haible <haible@clisp.cons.org>
7333 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7334 to avoid a warning. Add back 'const' to inptr.
7336 2001-01-16 Jim Meyering <meyering@lucent.com>
7338 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7341 2001-01-14 Jim Meyering <meyering@lucent.com>
7343 * rename.c: New file. From Volker Borchert.
7344 Include stdlib.h, string.h or strings.h, and xalloc.h.
7345 Use strip_trailing_slashes rather than open-coding it.
7347 2001-01-03 Paul Eggert <eggert@twinsun.com>
7349 * strftime.c: Sync with glibc time/strftime.c 1.81.
7351 2001-01-03 Jim Meyering <meyering@lucent.com>
7353 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7354 local `inptr' to avoid warning with some system declarations of iconv.
7356 2000-12-29 Paul Eggert <eggert@twinsun.com>
7358 * modechange.c: Do not assume that mode_t uses the
7359 traditional octal encoding. E.g. "chmod 1 FOO" should set
7360 the other-execute bit of FOO even if S_IXOTH != 1.
7362 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7363 WOTH, XOTH, ALLM): New macros.
7364 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7365 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7367 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7368 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7370 No need to use uintmax_t; unsigned long is long enough.
7371 Don't bother to get suffix since we don't use it.
7373 2000-12-24 Jim Meyering <meyering@lucent.com>
7375 * hash.c (is_prime): Return explicit boolean values.
7376 (hash_get_first): Return NULL to appease Irix5.6's 89.
7377 Reported by Nelson Beebe.
7379 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7381 * localcharset.c (locale_charset): Add support for Win32.
7383 2000-12-18 Paul Eggert <eggert@twinsun.com>
7385 * physmem.h, physmem.c: New files.
7387 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7388 (noinst_HEADERS): Add physmem.h.
7390 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7391 't' for compatibility with Solaris 8 sort.
7393 2000-12-18 Bruno Haible <haible@clisp.cons.org>
7395 * config.charset: Add support for BeOS.
7397 2000-12-16 Jim Meyering <meyering@lucent.com>
7399 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7400 SHELLS_FILE to a file name that's useful on djgpp systems.
7402 (ADDITIONAL_DEFAULT_SHELLS): Define.
7403 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7404 Based mostly on a patch from Prashant TR.
7406 2000-12-16 Jim Meyering <meyering@lucent.com>
7408 This bug had a serious impact on chown: `chown N:M FILE' (for integer
7409 N and M) would have treated it like `chown N:N FILE'.
7411 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7413 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7415 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7416 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7417 to the list of canonical encodings. Rename EUC-CN to GB2312.
7419 2000-12-08 Andreas Schwab <schwab@suse.de>
7421 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7422 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7424 2000-12-07 Jim Meyering <meyering@lucent.com>
7426 * stripslash.c (ISSLASH): Define.
7427 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7430 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7431 (dir_name_r): Declare this function as static.
7432 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7433 manifest itself on a name containing a mix of slashes and
7435 Make this function work with names starting with a DOS-style
7436 drive letter and colon prefix.
7437 (dir_name): Append `.' if necessary.
7438 Based mostly on patches from Prashant TR and Eli Zaretskii.
7440 * dirname.h (dir_name_r): Remove prototype.
7442 2000-12-05 Jim Meyering <meyering@lucent.com>
7444 * dirname.c (dir_name_r): Add `const' in a few local declarations.
7446 2000-12-04 Jim Meyering <meyering@lucent.com>
7448 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7449 Also include memory.h, stdlib.h, unistd.h if appropriate.
7450 Reported by Andreas Jaeger (conflicting declaration of malloc).
7452 2000-12-02 Jim Meyering <meyering@lucent.com>
7454 * closeout.h: Make idempotent, to avoid some obscure warnings.
7456 2000-12-01 Paul Eggert <eggert@twinsun.com>
7458 * memrchr.c: Include <config.h> before any system include file.
7460 2000-11-29 Paul Eggert <eggert@twinsun.com>
7462 * dirname.c (dir_name_r): Fix typo: int -> size_t.
7464 2000-11-26 Jim Meyering <meyering@lucent.com>
7466 * memcoll.c: Include sys/types.h. From Werner Almesberger.
7468 2000-11-22 Paul Eggert <eggert@twinsun.com>
7470 * strftime.c (my_strftime): Do not invoke mbrlen with a
7471 size of (size_t) -1; it's not portable.
7473 2000-11-17 Akim Demaille <akim@epita.fr>
7475 * obstack.h: Formatting changes.
7476 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7477 prevent type checking.
7478 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7479 cast the value to (void *): assigning a `foo *' to a `void *'
7481 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7483 2000-11-17 Jim Meyering <meyering@lucent.com>
7485 * strstr.c: Update from GNU libc.
7487 2000-11-16 Jim Meyering <meyering@lucent.com>
7489 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7491 2000-11-11 Jim Meyering <meyering@lucent.com>
7493 * error.c: Add a couple #includes, merging from GNU libc version.
7495 2000-11-10 Jim Meyering <meyering@lucent.com>
7497 * obstack.h: Update from GNU libc.
7498 * obstack.c: Likewise.
7500 2000-11-06 Paul Eggert <eggert@twinsun.com>
7502 * getusershell.c (setusershell): Use rewind rather than
7503 fseek/fseeko, to avoid configuration hassles with fseeko.
7504 Don't bother opening SHELLS_FILE if shellstream is NULL;
7507 2000-11-05 Jim Meyering <meyering@lucent.com>
7509 * makepath.h (make_dir): Declare.
7510 * makepath.c (make_dir): Remove `static' attribute.
7513 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
7515 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
7516 last one in a bucket, advance to the next bucket.
7518 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
7520 * fnmatch.c: Do not comment out all the code if we are using
7521 the GNU C library, because in some cases we are replacing buggy
7522 code in the GNU C library itself.
7524 2000-10-30 Paul Eggert <eggert@twinsun.com>
7526 * error.h, getline.h, modechange.h:
7527 Remove "2000" from Copyright line, as the file hasn't been
7528 changed this year other than in the copyright notice.
7530 * xalloc.h: Add "2000" to Copyright line, as this file
7531 was changed this year.
7533 2000-10-30 Paul Eggert <eggert@twinsun.com>
7535 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
7536 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
7537 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
7539 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
7541 * regex.h (__restrict_arr): Move definition out of #ifndef block.
7542 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
7543 doesn't define __restrict_arr.
7545 2000-10-29 Jim Meyering <meyering@lucent.com>
7547 * xstat.in: Fix grammar in comment.
7549 2000-10-28 Jim Meyering <meyering@lucent.com>
7551 * memchr.c: Update from libc.
7552 Adjust for portability:
7553 [HAVE_STDLIB_H]: Include stdlib.h.
7554 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
7555 Undef __memchr, too.
7556 [!weak_alias]: Define __memchr to memchr.
7558 * regex.c: Update from libc.
7559 * regex.h: Likewise.
7560 * getopt1.c: Likewise.
7561 * memcmp.c: Likewise.
7563 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
7564 Avoid using fseek, when possible -- it's broken by design.
7565 Patch by Ulrich Drepper.
7567 2000-10-26 Jim Meyering <meyering@lucent.com>
7569 * strftime.c: Update from libc.
7571 2000-10-25 Jim Meyering <meyering@lucent.com>
7573 * obstack.c: Update from libc.
7575 2000-10-23 Jim Meyering <meyering@lucent.com>
7577 * hard-locale.c (hard_locale): Revert last change -- it was simply
7578 wrong. That set_locale call must not have any side effects.
7581 2000-10-22 Jim Meyering <meyering@lucent.com>
7583 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
7584 [CYCLIC]: Remove now-unused definition.
7586 * save-cwd.c (O_DIRECTORY): Define, if needed.
7587 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
7588 Suggestion from Ulrich Drepper.
7590 2000-10-21 Jim Meyering <meyering@lucent.com>
7592 * dirname.c (dir_name_r): New function, factored out of dir_name.
7593 (dir_name): Use dir_name_r.
7594 * dirname.h (dir_name_r): Declare it.
7596 2000-10-21 Jim Meyering <meyering@lucent.com>
7598 * dirname.c (memrchr): Declare if necessary.
7599 (dir_name): Remove the restriction that there be no
7600 trailing slashes. Now, this code skips past them, effectively
7602 [TEST_DIRNAME] (main): New unit tests.
7604 * memrchr.c: New file from GNU libc.
7605 Undef __memrchr, too.
7606 [!weak_alias]: Define __memrchr to memrchr.
7607 Guard weak_alias use with `#ifdef weak_alias'.
7609 2000-10-17 Jim Meyering <meyering@lucent.com>
7611 * quote.h (PARAMS): Define and use.
7612 Reported by Akim Demaille.
7614 * getopt.c: Update from libc.
7616 2000-10-16 Jim Meyering <meyering@lucent.com>
7618 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
7621 2000-09-25 Jim Meyering <meyering@lucent.com>
7623 * md5.h (rol): Define (from GnuPG).
7625 * sha.c: Give credit (GnuPG) where due.
7626 (M): Use rol rather than open-coding it.
7627 Add a FIXME comment.
7629 2000-09-21 Jim Meyering <meyering@lucent.com>
7631 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
7632 Reported by Michael Stone.
7634 2000-09-20 Jim Meyering <meyering@lucent.com>
7636 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
7637 (noinst_HEADERS): Add sha.h.
7638 Based on code from Scott G. Miller and from GnuPG.
7640 2000-09-15 Jim Meyering <meyering@lucent.com>
7642 * regex.c: Update from libc.
7644 2000-09-10 Jim Meyering <meyering@lucent.com>
7646 * getopt.c (_getopt_internal): Update from glibc.
7648 2000-09-09 Jim Meyering <meyering@lucent.com>
7650 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
7651 think it should be used as a general replacement for isascii.
7652 * fnmatch.c: Likewise.
7653 * mbswidth.c: Likewise
7654 * regex.c: Likewise.
7657 * userspec.c: Include sys/param.h and limits.h.
7659 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7660 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
7661 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
7662 UID, GID. Check range.
7664 2000-09-06 Jim Meyering <meyering@lucent.com>
7666 * getopt.c (_getopt_internal): Update from glibc.
7668 2000-08-30 Jim Meyering <meyering@lucent.com>
7670 * strftime.c: Merge in changes from GNU libc.
7672 2000-08-26 Jim Meyering <meyering@lucent.com>
7674 * closeout.c: Include "__fpending.h".
7675 (close_stdout_status): Return right away if there's nothing to flush.
7677 * Makefile.am (noinst_HEADERS): Add __fpending.h.
7678 * __fpending.c: New file.
7679 * __fpending.h: New file.
7681 2000-08-07 Paul Eggert <eggert@twinsun.com>
7683 Standardize on "memory exhausted" instead of "Memory exhausted"
7684 or "virtual memory exhausted".
7685 * obstack.c (print_and_abort): Use "memory exhausted", not
7686 "virtual memory exhausted".
7687 * same.c (same_name): Invoke xalloc_die instead of printing
7689 * userspec.c (parse_user_spec): Likewise.
7690 * bumpalloc.h: comment fix
7691 * same.c, userspec.c: Include xalloc.h.
7693 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
7694 not char *const and pointing to a constant array.
7695 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
7696 (xrealloc): Comment fix.
7698 * userspec.c (parse_user_spec):
7699 Don't translate a message until just before returning,
7700 to avoid unnecessary translation.
7702 2000-08-07 Jim Meyering <meyering@lucent.com>
7704 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
7705 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
7706 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
7707 getgroups.c, gethostname.c, getopt.h, group-member.c,
7708 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
7709 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
7710 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
7711 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
7712 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
7713 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
7714 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
7715 yesno.c: Back out Copyright date changes for each file with no change
7716 this year. This eases coordination with other programs using the same
7717 source code modules. From Paul Eggert.
7719 2000-08-03 Greg McGary <greg@mcgary.org>
7721 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
7722 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
7723 (EXTEND_BUFFER): Use them.
7725 2000-08-01 Jim Meyering <meyering@lucent.com>
7727 * dirname.c (ISSLASH): Define.
7728 (BACKSLASH_IS_PATH_SEPARATOR): Define.
7729 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
7730 both `\' and `/' may be use as path separators.
7731 Based on a patch from Prashant TR.
7733 2000-07-31 Paul Eggert <eggert@twinsun.com>
7735 * quotearg.c (quotearg_n_options): Don't make the initial
7736 slot vector a constant, since it might get modified.
7738 2000-07-31 Jim Meyering <meyering@lucent.com>
7740 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
7741 * obstack.c (print_and_abort): Likewise.
7743 2000-07-30 Paul Eggert <eggert@twinsun.com>
7745 * quotearg.c (quotearg_n_options): Preallocate a slot 0
7746 buffer, so that the caller can always quote one small
7747 component of a "memory exhausted" message in slot 0.
7748 From a suggestion by Jim Meyering.
7750 2000-07-30 Jim Meyering <meyering@lucent.com>
7752 * makepath.c (make_path): Quote the other instance, too.
7754 * quotearg.c (N_STATIC_SLOTVECS): Define.
7755 (STATIC_BUF_SIZE): Define.
7756 (quotearg_n_options): Use only statically allocated storage when
7757 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
7758 than STATIC_BUF_SIZE.
7760 2000-07-29 Jim Meyering <meyering@lucent.com>
7762 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
7763 * dirname.c (dir_name): Likewise.
7765 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
7767 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
7768 (dir_name): Assert that there are no trailing slashes.
7770 2000-07-18 Bruno Haible <haible@clisp.cons.org>
7772 * mbswidth.h (mbswidth): Add a flags argument.
7773 (mbswidth): New declaration.
7774 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
7775 * mbswidth.c (mbswidth): Add a flags argument.
7776 (mbsnwidth): New function.
7778 2000-07-24 Jim Meyering <meyering@lucent.com>
7780 * mbswidth.c: Remove useless #else. From Bruno Haible.
7782 2000-07-23 Paul Eggert <eggert@twinsun.com>
7784 * mbswidth.c (_XOPEN_SOURCE):
7785 Don't define; this causes problems on Solaris 7.
7786 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
7788 2000-07-23 Paul Eggert <eggert@twinsun.com>
7791 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
7792 so that mbstate_t is always defined.
7794 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
7795 be 1 in at least one GCC installation, and this configuration
7796 error is likely to be common. Ignoring MB_LEN_MAX hurts
7797 performance on hosts that have mbrtowc but have only unibyte
7798 locales, but I assume these hosts are rare.
7800 2000-07-23 Paul Eggert <eggert@twinsun.com>
7802 * quotearg.c: Streamline by invoking multibyte code only if needed.
7803 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
7804 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
7805 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
7806 invoke multibyte primitives.
7808 2000-07-23 Jim Meyering <meyering@lucent.com>
7810 * basename.c (base_name): Add an assertion.
7812 2000-07-15 Bruno Haible <clisp.cons.org>
7814 * quotearg.c: When the system forces us to redefine mbstate_t,
7815 shadow its mbsinit function.
7817 2000-07-16 Bruno Haible <haible@clisp.cons.org>
7819 * mbswidth.h: New file.
7820 * mbswidth.c: New file.
7821 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
7822 (noinst_HEADERS): Add mbswidth.h.
7824 2000-07-17 Bruno Haible <haible@clisp.cons.org>
7826 * config.charset: Add support for FreeBSD. Improve support for HP-UX
7829 2000-07-15 Jim Meyering <meyering@lucent.com>
7831 * makepath.c: Include quote.h.
7832 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
7833 corresponding argument in a `quote (...)' call.
7834 Give better diagnostics.
7836 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
7837 (noinst_HEADERS): Add quote.h.
7839 * quote.c (quote, quote_n): New file. Two functions taken verbatim
7840 from tar's src/misc.c.
7841 * quote.h: New file. Prototypes for same.
7843 2000-07-10 Paul Eggert <eggert@twinsun.com>
7845 From a suggestion by Bruno Haible.
7846 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
7847 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
7848 to decide whether to define the BeOS workaround macro;
7849 this adjusts to the change to AC_MBSTATE_T.
7851 2000-07-13 Paul Eggert <eggert@twinsun.com>
7853 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
7855 * quotearg.c (quoting_style_args, quoting_style_vals,
7856 quotearg_buffer_restyled): Add support for
7857 clocale_quoting_style. Undo previous change to
7858 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
7859 and "{RIGHT QUOTATION MARK}" msgids.
7861 2000-07-05 Paul Eggert <eggert@twinsun.com>
7863 The old behavior of quoting `like this' doesn't look good with
7864 newer, ISO-style fonts. See:
7865 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
7867 Instead, quote "like this" by default. Let the translator
7868 tailor the locale-specific quoting behavior by providing
7869 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
7871 * quotearg.c (N_): New macro.
7872 (gettext_default): New function.
7873 (quotearg_buffer_restyled): Use
7874 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
7875 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
7877 2000-07-09 Jim Meyering <meyering@lucent.com>
7879 * Most files: Update copyright dates to include 2000.
7881 2000-07-08 Jim Meyering <meyering@lucent.com>
7883 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
7885 (xgethostname): Remove now-unnecessary #ifdef.
7886 Move declaration of `err' into loop where it's used.
7888 2000-07-05 Bruno Haible <haible@clisp.cons.org>
7890 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
7891 by allocating a larger buffer. Test the gethostname return value for
7892 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
7893 returns an error and ENAMETOOLONG isn't defined.
7895 2000-07-05 Paul Eggert <eggert@twinsun.com>
7896 and Bruno Haible <haible@clisp.cons.org>
7898 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
7900 2000-07-05 Bruno Haible <haible@clisp.cons.org>
7902 * quotearg.c (struct quoting_options): Simplify quote_these_too
7905 2000-07-03 Jim Meyering <meyering@lucent.com>
7907 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
7908 Reported by Bruno Haible.
7910 2000-07-04 Jim Meyering <meyering@lucent.com>
7912 * quotearg.c: Make inclusion of <wchar.h> independent of whether
7913 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
7916 2000-07-03 Paul Eggert <eggert@twinsun.com>
7917 and Bruno Haible <haible@clisp.cons.org>
7919 * quotearg.c (mbrtowc):
7920 Assign to *pwc, and return 1 only if result is nonzero.
7921 (iswprint): Use ISPRINT when substituting our own mbrtowc.
7923 2000-07-03 Jim Meyering <meyering@lucent.com>
7925 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
7926 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
7929 2000-07-02 Jim Meyering <meyering@lucent.com>
7931 * quotearg.c (mbstate_t): Don't define here.
7933 2000-07-02 Jim Meyering <meyering@lucent.com>
7935 * nanosleep.c (SIGCONT): Define if not already defined.
7937 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7939 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
7940 per change in ../m4/ls-mntd-fs.m4.
7941 (read_filesystem_list): Ignore symbolic links.
7943 2000-06-29 Jim Meyering <meyering@lucent.com>
7945 * same.c: Include <string.h> or <strings.h>, as appropriate,
7946 for declaration of strcmp.
7948 * long-options.c: Include <stdlib.h>, for declaration of exit.
7950 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
7951 Avoid warning by casting result to `char *' to remove `const'.
7953 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7955 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
7957 2000-06-26 Paul Eggert <eggert@twinsun.com>
7959 savedir now sets errno on failure and invokes xmalloc to get memory.
7960 Fix a couple of other minor bugs while we're at it.
7962 * savedir.c (<unistd.h>): Do not include; there's no need.
7963 (NAMLEN): Remove macro.
7964 (malloc, realloc): Remove decls.
7966 ("xalloc.h"): Include.
7967 (NAME_SIZE_DEFAULT): New macro.
7968 (savedir): Use xmalloc / xrealloc to allocate memory.
7969 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
7970 Skip "" directory entries.
7971 Use strlen to calculate directory entry length, since the old method
7972 is rarely used these days and isn't worth supporting.
7973 Don't use a pointer after freeing it.
7974 Check for integer overflow when calculating allocation size.
7975 Use memcpy to copy entries, instead of stpcpy.
7976 Set errno properly when returning NULL.
7977 Check for readdir error.
7979 2000-06-26 Jim Meyering <meyering@lucent.com>
7981 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
7983 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7985 * getusershell.c (xmalloc, xrealloc): Remove functions.
7987 Don't include <stdlib.h>. Don't declare malloc, realloc.
7989 2000-06-23 Bruno Haible <haible@clisp.cons.org>
7991 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
7993 2000-06-24 Jim Meyering <meyering@lucent.com>
7995 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
7997 2000-06-21 Jim Meyering <meyering@lucent.com>
7999 * getpass.c: New file, from Bruno Haible. Required for BeOS.
8001 2000-06-19 Paul Eggert <eggert@twinsun.com>
8003 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
8004 (mbrtowc, mbstate_t): Define substitutes if
8005 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
8006 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
8007 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
8009 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8011 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
8012 than 1024, return a memory chunk of least possible size, instead
8013 of size PATH_MAX + 2. In the loop, increment the size proportionally.
8014 Use free/xmalloc instead of xrealloc to avoid copying for very long
8017 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8019 * canon-host.c (canon_host): Use malloc and memcpy to copy an
8020 address, not strdup. Include <stdlib.h> and don't declare free().
8022 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8024 * path-concat.c (path_concat): Don't access dir[-1] if dir is
8027 2000-06-21 Jim Meyering <meyering@lucent.com>
8029 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
8030 (noinst_HEADERS): Add getstr.h.
8032 * getline.c (getstr): Move into a separate file.
8033 * getstr.c (getstr): New file, extracted from getline.c, with
8034 the following changes: new parameter, delim2; both delim[12]
8035 parameters have type `int', not `char'. The latter would lose
8036 with 8-bit delimiters.
8037 * getstr.h: New file.
8039 2000-06-19 Jim Meyering <meyering@lucent.com>
8041 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
8043 2000-06-18 Jim Meyering <meyering@lucent.com>
8045 * mkdir.c: Remove file, due mainly to copyright incompatibility.
8046 Besides, these days every porting target provides a mkdir function.
8048 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
8049 (this snippet comes from src/system.h).
8051 2000-06-15 Paul Eggert <eggert@twinsun.com>
8053 * human.c (adjust_value): New function.
8054 (human_readable_inexact): Apply rounding style even when
8055 printing approximate values.
8057 2000-06-14 Paul Eggert <eggert@twinsun.com>
8059 * human.c (human_readable_inexact): Allow an input block
8060 size that is not a multiple of the output block size, and vice versa.
8061 Reported by Piergiorgio Sartor.
8063 2000-06-14 Paul Eggert <eggert@twinsun.com>
8065 * getdate.y (get_date): Apply relative times after time
8066 zone indicator, not before. Reported by Todd A. Jacobs.
8068 2000-06-13 Jim Meyering <meyering@lucent.com>
8070 * Makefile.am (all-local): Depend on lstat.c and stat.c.
8072 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
8074 2000-06-12 Paul Eggert <eggert@twinsun.com>
8076 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
8078 2000-06-04 Paul Eggert <eggert@twinsun.com>
8080 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
8082 2000-06-04 Jim Meyering <meyering@lucent.com>
8084 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
8085 SunOS 4.1.4 for which gid_t is an unsigned type.
8087 2000-06-03 Jim Meyering <meyering@lucent.com>
8089 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
8091 2000-05-26 Bruno Haible <haible@clisp.cons.org>
8093 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
8094 newer, don't install charset.alias.
8095 * config.charset: Change the Linux/glibc rules so they become empty
8096 on glibc-2.1 or newer.
8098 2000-06-02 Jim Meyering <meyering@lucent.com>
8100 * mountlist.c: Back out last change. Instead, do this...
8101 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
8102 member using the same `ignore'-testing code.
8103 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
8107 2000-05-29 Jim Meyering <meyering@lucent.com>
8109 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
8110 with the `ignore' attribute. Based on a patch from Mark D. Roth.
8112 2000-05-22 Jim Meyering <meyering@lucent.com>
8114 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
8116 2000-05-18 Jim Meyering <meyering@lucent.com>
8118 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
8119 back, too, since it may have been modified by allocate_entry.
8120 (hash_delete): Rewrite to use neither the assignment operator
8121 nor the comma operator in an if-expression.
8123 2000-05-15 Paul Eggert <eggert@twinsun.com>
8126 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
8127 Remove; no longer needed.
8128 "quotearg.h": Add include.
8129 (file_name): Do not bother to explicitly initialize to NULL; it's less
8130 efficient on some hosts.
8131 (close_stdout_status): Remove test as to whether stdout was already
8132 closed; it breaks for the case "echo x | sort >&-".
8133 Quote file name colons.
8134 Do not assume that _("write error") lacks format strings.
8136 2000-05-15 Jim Meyering <meyering@lucent.com>
8138 * version-etc.c (version_etc_copyright): Update the copyright string
8139 used in all --version output.
8141 2000-05-14 Jim Meyering <meyering@lucent.com>
8143 * closeout.c (close_stdout_set_file_name): New function.
8144 (close_stdout_status): Use new file-scoped global.
8145 Return right away if fstat says the stdout file descriptor is invalid.
8146 * closeout.h (close_stdout_set_file_name): Declare.
8148 2000-05-10 Jim Meyering <meyering@lucent.com>
8150 * closeout.c [default_exit_status]: New file-scoped variable.
8151 (close_stdout_set_status): New function.
8152 * closeout.h (close_stdout_set_status): Declare.
8154 2000-05-08 Jim Meyering <meyering@lucent.com>
8156 * long-options.c: Don't include closeout.h.
8157 (parse_long_options): Don't call close_stdout for --version.
8159 2000-05-06 Jim Meyering <meyering@lucent.com>
8161 * strnlen.c: Undefine __strnlen and strnlen.
8162 [!weak_alias]: Define __strnlen to strnlen.
8164 * atexit.c: New file, from libiberty.
8166 2000-05-06 Jim Meyering <meyering@lucent.com>
8168 * closeout.c (close_stdout_status): Also check for errors on the
8171 2000-05-05 Bruno Haible <haible@clisp.cons.org>
8173 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
8174 instead of xmalloc, xrealloc, path_concat.
8175 (locale_charset): Treat empty environment variables as absent.
8176 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
8178 2000-05-04 Jim Meyering <meyering@lucent.com>
8180 * getopt.c: Update from glibc.
8181 * obstack.c: Likewise.
8182 * obstack.h: Likewise.
8183 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
8185 * regex.h: Likewise.
8186 * strndup.c: Likewise.
8187 * strnlen.c: New file, from glibc.
8189 2000-05-01 Jim Meyering <meyering@lucent.com>
8191 * full-write.c (full_write): Remove `FIXME' part of comment.
8193 2000-04-29 Jim Meyering <meyering@lucent.com>
8195 * path-concat.c: Declare strdup only if it's not defined.
8196 * canon-host.c: Likewise.
8198 2000-04-28 Jim Meyering <meyering@lucent.com>
8200 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
8201 redefinition warning on some systems (HPUX). Otherwise, regex.h is
8202 included first, then limits.h is included by locale.h by libintl.h.
8203 From John David Anglin.
8205 2000-04-25 Jim Meyering <meyering@lucent.com>
8207 * makepath.c (S_IRWXUGO): Define.
8208 (make_path): Always perform explicit chmod if MODE specifies any
8209 of the `special' permission bits. Prompted by a bug report against
8210 install from Mate Wierdl and Joost van Baal.
8212 2000-04-18 Jim Meyering <meyering@lucent.com>
8216 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
8217 getpagesize. For BeOS. Based on a patch from Bruno Haible.
8219 2000-04-17 Jim Meyering <meyering@lucent.com>
8221 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
8222 the definition of it to rpl_strftime also defined-away the system's
8225 2000-04-15 Jim Meyering <meyering@lucent.com>
8227 Use `C' to denote so-called `contiguous' files, the same way
8229 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
8230 (ftypelet): Use S_ISCTG.
8231 From Michael Deutschmann.
8233 2000-04-14 Jim Meyering <meyering@lucent.com>
8235 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
8237 2000-04-08 Jim Meyering <meyering@lucent.com>
8239 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
8240 names don't conflict. Reported by Eli Zaretskii.
8242 2000-03-28 Bruno Haible <haible@clisp.cons.org>
8244 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
8245 bug. Deal with the different error behavior of Irix iconv.
8247 2000-04-07 Jim Meyering <meyering@lucent.com>
8249 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
8250 to work around system header problems on AIX 3.2.5. From Bruno Haible.
8252 2000-04-05 Jim Meyering <meyering@lucent.com>
8254 Portability tweaks required for ultrix4.3.
8255 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8256 * readutmp.c: Include sys/types.h before sys/stat.h.
8257 * canon-host.c: Declare strdup.
8258 * path-concat.c: Likewise.
8259 From John David Anglin.
8261 2000-04-04 Jim Meyering <meyering@lucent.com>
8263 Be more DOS 8.3-friendly.
8264 * ref-add.sin: Renamed from ref-add.sed.in.
8265 * ref-del.sin: Renamed from ref-del.sed.in.
8266 * Makefile.am: Reflect renaming.
8267 Reported by Eli Zaretskii.
8269 Use a temporary file name that won't clash with `charset.alias'
8270 in the DOS 8.3 name space.
8271 * Makefile.am (charset_tmp): Define.
8272 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8273 (uninstall-local): Likewise.
8274 Reported by Eli Zaretskii.
8276 2000-03-29 Paul Eggert <eggert@twinsun.com>
8278 * time/strftime.c (my_strftime): Make sure we call the system
8279 strftime, not ourselves, when invoking the underlying strftime.
8281 2000-03-24 Jim Meyering <meyering@lucent.com>
8283 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8284 (charset_alias): Define.
8285 (install-exec-local): Factor out common code.
8286 (uninstall-local): Split lines longer than 80.
8287 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8289 (.sed.in.sed): New rule. Don't redirect directly to $@.
8290 (CLEANFILES): Add ref-add.sed and ref-del.sed.
8292 2000-03-19 Bruno Haible <haible@clisp.cons.org>
8294 * config.charset: Output a line containing "Packages using this file".
8295 * ref-add.sed.in, ref-del.sed.in: New files.
8296 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8297 ref-del.sed): New rules.
8299 2000-03-17 Jim Meyering <meyering@lucent.com>
8301 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8302 Otherwise, include <strings.h>
8304 2000-03-17 Bruno Haible <haible@clisp.cons.org>
8306 * unicodeio.c (utf8_wctomb): New function.
8307 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8308 format instead of in UCS-4 with platform dependent endianness.
8310 2000-03-07 Paul Eggert <eggert@twinsun.com>
8312 * savedir.c (savedir): Work even if directory size is
8313 negative; this can happen with some screwy NFS configurations.
8315 2000-03-06 Jim Meyering <meyering@lucent.com>
8317 * localcharset.c (get_charset_aliases): Don't try to free file_name
8318 if it's NULL (because we ran out of memory). From Bruno Haible.
8320 2000-03-05 Jim Meyering <meyering@lucent.com>
8322 * localcharset.c ("path-concat.h"): Include.
8323 (get_charset_aliases): Use path_concat instead of ANSI string
8326 * unicodeio.h (PARAMS): Define.
8327 Use it to guard prototype.
8329 2000-03-04 Jim Meyering <meyering@lucent.com>
8331 * Makefile.am (install-exec-local): Create $(libdir) before installing
8333 (uninstall-local): Uncomment this rule so `make distcheck' works
8336 * unicodeio.c (<errno.h>): Include it.
8337 (errno): Declare if not defined.
8339 * localcharset.c: Add Bruno's comment justifying use of volatile.
8341 * config.charset: New version, incorporating remarks from a linux
8342 i18n mailing list. From Bruno Haible.
8344 2000-03-02 Jim Meyering <meyering@lucent.com>
8346 * Makefile.am (EXTRA_DIST): Add config.charset.
8348 2000-03-01 Jim Meyering <meyering@lucent.com>
8350 * localcharset.c: Guard some #includes with `#if HAVE_...'.
8351 * unicodeio.c: Likewise.
8353 2000-02-02 Bruno Haible <haible@clisp.cons.org>
8355 * config.charset: New file.
8356 * localcharset.c: New file.
8357 * unicodeio.h, unicodeio.c: New files.
8358 * Makefile.am (DEFS): Add -DLIBDIR=...
8359 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8360 (noinst_HEADERS): Add unicodeio.h.
8361 (all-local, install-exec-local, charset.alias): New targets.
8363 2000-02-28 Paul Eggert <eggert@twinsun.com>
8365 * quotearg.c (ALERT_CHAR): New macro.
8366 (quotearg_buffer_restyled): Use it.
8368 2000-02-27 Jim Meyering <meyering@lucent.com>
8370 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8371 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8373 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8374 not `#if STDC_HEADERS'.
8375 Declare malloc if needed.
8377 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8378 now that autoconf always defines the HAVE_DECL_ symbols.
8379 * human.c: Likewise.
8381 * strtoumax.c: Likewise.
8383 * backupfile.c: Arrange for cpp to fail if the configure-time
8384 declaration check was not run.
8386 * human.c: Likewise.
8388 * strtoumax.c: Likewise.
8390 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8391 then first look up the entire `.'-containing string as a login name.
8393 2000-02-18 Paul Eggert <eggert@twinsun.com>
8395 * getdate.y: Handle two-digit years with leading zeros correctly.
8396 (textint): New typedef.
8397 (parser_control): Member year changed from int to textint.
8399 (YYSTYPE): Removed; replaced by %union with int and textint members.
8400 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8401 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8402 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8403 (tSNUMBER, tUNUMBER): Now of type <textintval>.
8404 (date, number, to_year): Use width of number in digits, not its value,
8405 to determine whether it's a 2-digit year, or a 2-digit time.
8406 (yylex): Store number of digits of numeric tokens.
8407 Reported by John Kendall.
8409 (parser_control): Changed from struct parser_control to typedef (for
8410 consistency). All uses changed.
8412 (tID): Removed; not used.
8413 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8415 2000-02-14 Paul Eggert <eggert@twinsun.com>
8417 * getpagesize.h (getpagesize): Port to VMS for Alpha;
8418 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8420 2000-02-12 Jim Meyering <meyering@lucent.com>
8422 * userspec.c (ISDIGIT): Define it.
8423 (isdigit): Remove definition.
8424 (is_number): Use ISDIGIT, not isdigit.
8425 <libintl.h>: Include.
8427 (parse_user_spec): Mark translatable strings.
8429 2000-02-10 Jim Meyering <meyering@lucent.com>
8431 With these changes, nanosleep.[ch] are finally enough like the other
8432 lib/* replacement files to compile on a few more losing systems.
8434 * nanosleep.h: Don't include config.h.
8435 Remove prototype from declaration of nanosleep.
8436 (PARAMS): Remove now-unneeded definition.
8437 * nanosleep.c: #undef nanosleep.
8438 (rpl_nanosleep): Rename from nanosleep.
8440 2000-02-03 Jim Meyering <meyering@lucent.com>
8442 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8443 rather than with `#if HAVE_UTMPNAME'.
8445 2000-02-01 Jim Meyering <meyering@lucent.com>
8447 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
8449 2000-01-31 Jim Meyering <meyering@lucent.com>
8451 * nanosleep.h (nanosleep): Guard declaration with
8452 `#if ! HAVE_DECL_NANOSLEEP'.
8453 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8454 the declaration in that vendor's sys/timers.h.
8455 Reported by Christian Krackowizer.
8457 * quotearg.c (ISASCII): Add #undef and move definition to follow
8458 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8459 (ISPRINT): Likewise.
8460 Reported by Tom Tromey.
8462 2000-01-30 Jim Meyering <meyering@lucent.com>
8464 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8465 uses of ->ut_name. The latter doesn't work with new Linux header files
8466 where only utmpx.ut_user is declared.
8468 * readutmp.h (UT_USER): Define.
8470 2000-01-23 Jim Meyering <meyering@lucent.com>
8472 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8475 2000-01-22 Jim Meyering <meyering@lucent.com>
8477 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8478 [! HAVE_DECL_STRTOULL]: Declare strtoull.
8479 Required for some AIX systems. Reported by Christian Krackowizer.
8480 [TESTING] (main): New function.
8482 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
8483 * dirname.c (dir_name): Support for DOS-style file names with drive
8486 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8488 * strverscmp.c (ISDIGIT): Define.
8489 (strverscmp): Use ISDIGIT, not isdigit.
8491 2000-01-17 Paul Eggert <eggert@twinsun.com>
8493 * nanosleep.c (nanosleep):
8494 Don't use SA_INTERRUPT to decide whether to call sigaction, as
8495 POSIX.1 doesn't require SA_INTERRUPT and some systems
8496 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
8497 it's been part of POSIX.1 since day 1 (in 1988).
8499 2000-01-17 Jim Meyering <meyering@lucent.com>
8501 * interlock: Remove unused file. Reported by François Pinard.
8503 2000-01-16 Paul Eggert <eggert@twinsun.com>
8505 * quotearg.c (quotearg_buffer_restyled): Do not quote
8506 alert, backslash, formfeed, and vertical tab unnecessarily in
8507 shell quoting style.
8510 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
8511 Free Software Foundation, Inc.
8512 Copying and distribution of this file, with or without modification,
8513 are permitted provided the copyright notice and this notice are preserved.