1 2005-10-21 Simon Josefsson <jas@extundo.com>
3 * arctwo.h, arctwo.c: New files.
5 * gc-gnulib.c: Support ARCTWO.
7 2005-10-21 Simon Josefsson <jas@extundo.com>
9 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
11 2005-10-19 Simon Josefsson <jas@extundo.com>
13 * gc-gnulib.c: Support ARCFOUR.
15 2005-10-19 Simon Josefsson <jas@extundo.com>
17 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
20 * gc.h: Add ECB enum type.
22 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
24 2005-10-19 Simon Josefsson <jas@extundo.com>
26 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
28 2005-10-18 Simon Josefsson <jas@extundo.com>
30 * md4.h, md4.c: New files, based on md5.?.
32 2005-10-17 Simon Josefsson <jas@extundo.com>
34 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
36 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
38 2005-10-17 Simon Josefsson <jas@extundo.com>
40 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
42 2005-10-17 Simon Josefsson <jas@extundo.com>
44 * gc.h, gc-libgcrypt.c: Add ciphers.
46 2005-10-17 Simon Josefsson <jas@extundo.com>
48 * sha1.c: Use uint32_t instead of md5_uint32.t
50 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
53 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
55 * md5.h: Use stdint.h and uint32_t. Doc fix.
57 2005-10-15 Simon Josefsson <jas@extundo.com>
59 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
61 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
63 2005-10-14 Simon Josefsson <jas@extundo.com>
65 * arcfour.h, arcfour.c: New files.
67 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
69 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
70 include <wchar.h>; no longer needed.
72 2005-10-14 Jakub Jelinek <jakub@redhat.com>
73 and Ulrich Drepper <drepper@redhat.com>
76 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
77 instead of inline stream orientation test and two separate
78 function calls. Pay no attention to USE_IN_LIBIO.
80 2005-10-14 Roland McGrath <roland@redhat.com>
82 Import from libc. [BZ #1331]
83 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
85 Reported by Matej Vela <vela@debian.org>.
87 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
89 * mkdir-p.c (make_dir_parents): Don't report an error if an
90 intermediate directory is in a read-only file system. Problem
91 reported by Eric Blake.
93 2005-10-13 Simon Josefsson <jas@extundo.com>
95 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
96 Move memory allocation outside of loop.
98 2005-10-12 Simon Josefsson <jas@extundo.com>
100 * gc-pbkdf2-sha1.c: New file.
102 * gc.h: Add gc_pbkdf2_sha1 prototype.
104 2005-10-12 Simon Josefsson <jas@extundo.com>
106 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
107 suggested by Bruno Haible <bruno@clisp.org>.
109 2005-10-12 Simon Josefsson <jas@extundo.com>
111 * gc-libgcrypt.c (gc_hmac_sha1): New function.
113 * gc-gnulib.c (gc_hmac_sha1): New function.
115 2005-10-12 Simon Josefsson <jas@extundo.com>
117 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
119 2005-10-12 Simon Josefsson <jas@extundo.com>
121 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
122 GC_USE_HMAC_MD5, respectively.
124 * gc-libgcrypt.c (gc_md5): Fix assert call.
127 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
129 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
131 * gc-gnulib.c (gc_hash_buffer): Ditto.
133 2005-10-11 Bruno Haible <bruno@clisp.org>
135 * c-strcasestr.h: New file, from GNU gettext.
136 * c-strcasestr.c: New file, from GNU gettext.
138 2005-10-11 Bruno Haible <bruno@clisp.org>
140 * c-strcase.h: New file, from GNU gettext.
141 * c-strcasecmp.c: New file, from GNU gettext.
142 * c-strncasecmp.c: New file, from GNU gettext.
144 2005-10-11 Simon Josefsson <jas@extundo.com>
146 * crc.h, crc.c: New files.
148 * gc.h (gc_hash_buffer): Add doc.
150 2005-10-08 Simon Josefsson <jas@extundo.com>
152 * gc.h: Add gc_hash and gc_hash_buffer.
154 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
156 * gc-libgcrypt.c (gc_hash_buffer): Add.
158 2005-10-11 Bruno Haible <bruno@clisp.org>
160 * strcasecmp.c: Include limits.h.
161 (strcasecmp): Avoid integer overflow on exotic platforms.
162 * strncasecmp.c: Include limits.h.
163 (strncasecmp): Avoid integer overflow on exotic platforms.
164 Reported by Paul Eggert.
166 2005-10-06 Simon Josefsson <jas@extundo.com>
168 * hmac-md5.c: New file.
172 2005-10-06 Simon Josefsson <jas@extundo.com>
174 * memxor.c (memxor): Avoid casts and warnings.
176 2005-10-05 Derek Price <derek@ximbiot.com>
178 * getdelim.c (SIZE_MAX): New macro, if not already defined.
180 2005-10-05 Simon Josefsson <jas@extundo.com>
182 * memxor.c (memxor): Fix compiler error.
184 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
185 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
187 * memxor.h, memxor.c: New files.
189 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
190 we assume all systems have it, suggested by Jim Meyering
191 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
192 any systems lack sys/socket.h; mingw32 is known to lack it, but we
193 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
196 2005-10-04 Bruno Haible <bruno@clisp.org>
198 * verify.h (verify_true): Provide alternative definition for C++.
200 2005-10-04 Simon Josefsson <jas@extundo.com>
202 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
203 D. Baushke" <mdb@gnu.org>.
205 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
207 * getdelim.c: Include getdelim.h first. Include <limits.h>.
208 (SSIZE_MAX): New macro, if not already defined.
209 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
212 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
214 * exclude.c: Include verify.h.
215 (verify): Remove. All callers changed to use verify.h's version.
216 * strtoimax.c: Likewise.
217 * utimecmp.c: Likewis.e
220 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
221 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
222 * .cvsignore: Add fts.h, search.h, t-fpending.
223 * settime.c (settime): Fix { typo in previous patch. Also, don't
224 bother returning ENOSYS if settimeofday or stime fails; just let
225 them return whatever errno they want to return.
226 * utimens.c: Include unistd.h, for dup2.
227 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
228 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
230 2005-10-02 Jim Meyering <jim@meyering.net>
233 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
234 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
235 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
236 Remove AT_FDCWD test.
237 Do not consume the fd unless successful.
238 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
239 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
240 block, so that we don't even try to compile it if settimeofday is
241 available. This works around a compilation failure on OSF1 V5.1,
242 due to stime requiring a `long int*' while tv_sec is `int'.
244 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
246 * getdelim.c (getdelim): Remove unused variables.
248 2005-10-01 Simon Josefsson <jas@extundo.com>
250 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
251 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
252 AI_* and EAI_* definitions. Protect function declarations.
254 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
256 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
257 so that the code works even with ancient cpp. Portability problem
258 with GCC 2.7.2.1 reported by Thomas M.Ott.
260 2005-09-27 Jim Meyering <jim@meyering.net>
262 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
264 * intprops.h (signed_type_or_expr__): Define.
265 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
268 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
270 * verify.h (verify_expr): Remove, replacing with:
271 (verify_true): New macro that returns true instead of void.
272 (verify_type__): Remove.
273 (verify): Use verify_true rather than verify_type__.
275 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
277 * utimens.c (ENOSYS): Define if not already defined.
278 (futimens): Support having a null PATH if the file descriptor
281 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
283 (__attribute): Define to empty unless GCC 3.1 or later.
284 This works around a core dump on OpenBSD 3.4, which has GCC
285 2.95.3, which dumps core when given __attribute__(()). It also
286 simplifies other tests, since we really don't want to bother with
287 worrying about which ancient version of GCC supported what.
288 Original problem reported by Yoann Vandoorselaere, with part of
289 the fix suggested by Derek Price.
291 2005-09-24 Jim Meyering <jim@meyering.net>
293 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
294 so we can once again use a positive bitfield width of 1 -- now we
295 don't have to explain why we were using a bitfield width of 2.
297 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
299 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
300 Problem reported by Eric Blake.
301 (getaddrinfo): Initialize se so that it's not garbage.
302 Redo internal storage allocation so that it doesn't make unportable
303 assumptions about alignment.
306 * utimens.c (futimens): Use futimesat if available.
307 Prefer it to futimes since it doesn't have the futimes bug.
309 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
310 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
311 Instead, declare a function that returns a pointer to an array,
312 and use verify_type__ to declare the size of the array.
313 Problem and germ of a solution reported by Bruno Haible.
314 (verify_type__): Use 2, not 1, for bitfield size, to avoid
315 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
317 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
321 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
323 * argmatch.h: Include verify.h
324 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
325 (ARGMATCH_ASSERT): Remove; unused.
326 * canonicalize.c: Assume STDC_HEADERS.
327 * exclude.c: Include "strcase.h".
328 * regex_internal.h [!defined _LIBC]: Likewise.
329 * getusershell.c: Include stdio--.h rather than stdio.h
331 (getusershell): Call fopen, not fopen_safer.
332 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
333 Do not include unistd-safer.h.
334 (save_cwd): Don't call fd_safer; no longer needed
335 now that we include fcntl--.h.
337 * getdate.y (relative_time): New type.
338 (RELATIVE_TIME_0): New constant.
339 (parser_control): Use relative_time instead of doing it ourselves.
340 (%union): Add new relative_time rel member.
341 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
343 (relunit, relunit_snumber): Now of type rel.
344 (zone, rel, relunit, get_date): Adjust to above changes.
346 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
347 Do not include unistd-safer.h.
348 (getloadavg): Don't call fd_safer; no longer needed
349 now that we include fcntl--.h.
351 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
352 (make_dir_parents): Treat ENOSYS like EEXIST.
354 Improve quality of diagnostics on restore_cwd failure.
355 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
356 (make_dir_parents): Last arg is now int * (for errno), not bool *.
357 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
358 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
359 each time through the loop. Do not diagnose restore_cwd failure;
360 that is the caller's job (and perhaps the caller does not care).
362 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
363 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
364 If the file already exists but is not a directory, don't bother
365 to try to make its parents.
366 Close potential file descriptor leak if we can't chdir("/") (!).
367 Don't always return true if chdir($PWD) fails; return true only
368 if the requested action was done successfully (except for the
370 Don't log final directory unless we actually made it.
371 Refactor to avoid duplicate code to fix up permissions.
372 Don't attempt to fix up parent permissions if chdir($PWD) fails.
374 * strftime.c (my_strftime): Rewrite the previous change slightly,
375 to make it a bit faster and (I hope) clearer.
376 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
377 Fix bug in formats like %2N.
379 * verify.h: New file.
381 2005-09-22 Jim Meyering <jim@meyering.net>
385 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
387 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
388 the .tm_year member, since otherwise gcc-4.0 would now warn about
389 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
391 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
392 order to avoid an unsuppressible warning from gcc on 64-bit systems.
394 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
395 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
396 when run in a time zone for which daylight savings time is in effect
397 for the starting date.
399 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
400 stop us from restricting permissions of just-created absolute-named
402 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
403 to restore initial working directory.
404 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
405 to tell caller if/when we change the working directory and are
406 unable to return to the initial one.
407 * mkdir-p.h (make_dir_parents): Update prototype.
408 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
409 `return false'. This fixes a bug introduced on 2004-07-30.
411 * openat.c (fdopendir): Be sure to close the supplied
412 file descriptor before returning. This makes our replacement
413 implementation a little closer to Solaris's, where fdopendir
414 ties the file descriptor to the returned DIR* pointer.
415 * openat.c (unlinkat): New function.
416 * openat.h (unlinkat): Add prototype.
417 * openat-die.c (openat_save_fail): Rename from openat_save_die.
418 (openat_restore_fail): Rename from openat_restore_die.
419 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
421 Provide an alternative to exiting immediately upon save_cwd or
422 restore_cwd failure. Now, an application can arrange e.g.,
423 to perform a longjump in that case.
424 * openat.c: Include dirname.h.
425 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
426 (rpl_openat, fdopendir, fstatat): Call openat_save_die
427 and openat_restore_die rather than calling error directly.
428 Don't include "error.h" or "exitfail.h"; they're no longer needed.
430 * openat-die.c (openat_save_die, openat_restore_die): New file.
431 * openat.h (openat_save_die, openat_restore_die): Declare and define.
433 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
434 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
435 int utc, int nanoseconds);
437 date should not have to allocate a megabyte of virtual memory to
438 handle a format argument like +%1048575T. When implemented with
439 strftime, it must allocate such a buffer, use strftime to fill it
440 in, print it, then free it.
441 With fprintftime, it simply prints everything and exits.
442 With no need for memory allocation, that's one fewer way to fail.
443 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
444 optional field width, not before, so we accept %9:z, not %:9z.
445 (my_strftime): Be sure to use L_('x') for literals.
447 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
448 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
449 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
450 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
451 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
452 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
453 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
454 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
455 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
457 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
458 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
459 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
460 and don't include <sys/file.h>).
462 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
466 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
467 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
468 [!LDAV_DONE]: Avoid unused variable warning.
470 2005-09-21 Bruno Haible <bruno@clisp.org>
472 * unicodeio.h (unicode_to_mb): New declaration.
474 2005-09-20 Derek Price <derek@ximbiot.com>
476 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
478 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
480 Use a consistent style for including <config.h>.
481 * __fpending.c, acl.c, argmatch.c,
482 argp-help.c, argp-parse.c,
483 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
484 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
485 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
486 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
487 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
488 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
489 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
490 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
491 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
492 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
493 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
494 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
495 modechange.c, mountlist.c, open-safer.c, physmem.c,
496 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
497 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
498 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
499 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
500 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
501 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
502 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
503 userspec.c, utimecmp.c, version-etc-fsf.c,
504 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
505 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
506 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
507 Standardize inclusion of config.h.
508 * __fpending.h, dirfd.h, getdate.h, human.h,
509 inttostr.h: Removed inclusion of config.h from header files.
510 * inttostr.c: Adjusted in-tree users.
511 * timespec.h: Remove superfluous warning to include config.h.
512 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
513 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
514 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
515 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
517 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
519 * stat-time.h: New file.
520 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
521 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
523 (timespec_cmp): New function.
524 * utimecmp.c: Include stat-time.h.
525 (SYSCALL_RESOLUTION): Depend on whether various struct stat
526 members exist, not on the obsolescent ST_MTIM_NSEC.
527 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
529 2005-09-15 Derek Price <derek@ximbiot.com>
530 Paul Eggert <eggert@cs.ucla.edu>
532 * regcomp.c, regexec.c, regex_internal.c: Back out previous
533 changes, consolidating in...
534 * regex_internal.h: ...this file.
536 2005-09-15 Derek Price <derek@ximbiot.com>
538 * regex_internal.h: Blank `pure' for GNUC < 3.
539 * regex_internal.c: Ditto, using this...
540 (__GNUC_PREREQ): ...new macro.
541 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
542 (__GNUC_PREREQ): ...this new macro.
544 * strstr.h: Include string.h. Define strstr as a macro here.
546 2005-09-13 Derek Price <derek@ximbiot.com>
548 * canon-host.c (canon_host_r): Set *cherror on memory allocation
550 Reported by Jim Meyering <jim@meyering.net>.
552 2005-09-13 Jim Meyering <jim@meyering.net>
554 * canon-host.c: Filter through gnu indent and reword comments slightly.
555 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
557 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
559 * lib/base64.c: Typo.
560 (base64_encode): Put b64str in initialized data section.
562 2005-09-12 Derek Price <derek@ximbiot.com>
564 Return usable errors from canon-host.
565 * canon-host.h: New file.
566 * canon-host.c (canon_host): Wrap...
567 (canon_host_r): ...this new function, which now relies exclusively on
569 (ch_strerror): New function.
570 (last_cherror): New global.
571 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
572 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
574 (freeaddrinfo): Free ai->ai_canonname when set.
576 2005-09-12 Derek Price <derek@ximbiot.com>
577 Paul Eggert <eggert@cs.ucla.edu>
579 * glob-libc.h: Renamed from glob_.h. The new version is
580 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
581 protecting things that should be done only in gnulib contexts.
582 * glob_.h: New file, containing only the glob things needed for
584 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
585 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
586 (glob, globfree, glob_pattern_p): Now defined simply in terms of
587 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
588 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
589 and to respect the namespace rules better.
591 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
593 Merge glibc and coreutils changes into gnulib, plus a few
595 * md5.c: Use #error rather than a string.
596 (CYCLIC): New macro, from glibc source. Use it instead of rol.
597 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
598 (__attribute__): Define to empty for non recent-GCC.
599 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
600 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
601 Renamed from their non-__ counterparts, with new macros replacing
602 them if not _LIBC. Add __THROW attribute.
604 (struct md5_ctx): Align buffer if using GCC.
605 * sha1.h (struct sha1_ctx): Likewise.
606 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
607 The old name was backwards.
608 (NOTSWAP): Remove; not used.
609 (rol): New macro, moved here from md5.h.
610 (sha1_process_block): Remove a FIXME that doesn't make sense.
612 2005-09-12 Derek Price <derek@ximbiot.com>
614 * gai_strerror.c: Include config.h when available. Include
615 getaddrinfo.h before other headers to test interface.
616 Reported by Larry Jones <lawrence.jones@ugs.com>.
618 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
620 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
621 definitions, since that's the preferred style in glibc.
622 Fix a minor spacing issue, and update copyright notice to match glibc's.
624 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
626 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
628 2005-09-06 Simon Josefsson <jas@extundo.com>
630 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
631 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
633 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
635 Change bitset word type from unsigned int to unsigned long int,
636 as this has better performance on typical 64-bit hosts.
637 Port bitset code to hosts with unusual word sizes.
638 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
639 (build_collating_symbol):
640 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
641 argument is a bitset. This is merely a style issue, but it makes
642 it clearer that an entire array is expected.
643 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
644 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
645 Port to the case where bitset_word is not the same as unsigned int.
646 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
647 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
649 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
650 (build_trtable, group_nodes_into_DFAstates):
652 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
653 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
654 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
655 * regexec.c (group_nodes_into_DFAstates): Likewise.
656 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
657 * regcomp.c (optimize_subexps, lower_subexp):
658 Work even if bitset_word has holes in its bitwise representation.
659 * regex_internal.h (BITSET_WORD_BITS): Likewise.
660 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
662 * regex_internal.c (re_string_reconstruct):
663 Don't assume UCHAR_MAX == 255.
664 * regex_internal.h (bitset_set_all): Likewise.
665 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
667 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
668 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
670 (BITSET_WORD_MAX): New macro.
671 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
672 (bitset_set_all, bitset_copy): Now inline functions, not macros.
673 (bitset_empty, bitset_copy):
674 Prefer sizeof (bitset) to multiplying it out ourselves.
675 (bitset_not_merge): Remove; unused.
676 (bitset_contain): Return bool, not unsigned int with one bit on.
678 * regexec.c (build_trtable): Don't assume bitset has no stricter
679 alignment than re_node_set; do this by defining a new internal
680 type struct dests_alloc and using it to allocate memory.
682 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
684 Check for arithmetic overflow when calculating sizes, to prevent
685 some buffer-overflow issues. These patches are conservative, in the
686 sense that when I couldn't determine whether an overflow was possible,
687 I inserted a run-time check.
688 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
689 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
690 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
691 (re_xnrealloc, re_x2nrealloc): New inline functions.
692 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
693 (build_equiv_class, build_charclass): Check for arithmetic overflow
694 in size expression calculations.
695 * lib/regex_internal.c (re_string_realloc_buffers):
696 (build_wcs_upper_buffer, re_node_set_add_intersect):
697 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
698 (re_dfa_add_node, register_state): Likewise.
699 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
700 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
701 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
702 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
704 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
706 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
707 to avoid a collision with bits/local_lim.h in glibc.
708 All uses changed. Problem reported by Dmitry V. Levin in
709 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
711 * regex_internal.c (build_wcs_upper_buffer): Fix portability
712 bugs in int versus size_t comparisons.
713 (re_string_context_at): Fix bug where the code assumed that
716 Use bool where appropriate.
717 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
719 (calc_eclosure_iter): Likewise, for ROOT arg.
720 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
721 (build_charclass_op): Likewise, for NON_MATCH arg.
722 * regex_internal.c (re_string_allocate, re_string_construct):
723 (re_string_construct_common): Likewise, for ICASE arg.
724 * regexec.c (re_search_2_stub, re_search_stub):
725 Likewise, for RET_LEN arg.
726 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
727 (set_regs): Likewise, for FL_BACKTRACK arg.
728 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
729 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
730 (calc_eclosure_iter, parse_bracket_exp):
731 Use bool for internal variables that are booleans.
732 * regexec.c (re_search_internal, check_matching, proceed_next_node):
733 (set_regs, build_sifted_states, sift_states_bkref):
734 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
735 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
736 (find_collation_sequence_value):
738 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
739 (re_node_set_compare):
740 Return bool, not int. All callers changed.
741 * regexec.c (check_halt_node_context, check_dst_limits):
742 (build_trtable, check_node_accept): Likewise.
743 * regex_internal.h: Include stdbool.h.
745 Fix bugs uncovered when converting to bool.
746 * regcomp.c (calc_eclosure_iter): Check for storage allocation
747 failure instead of charging ahead blindly.
748 * regex_internal.c (register_state): Likewise.
749 * regexec.c (re_search_2_stub): Use simpler method than boolean
750 for freeing internal storage.
751 (group_nodes_into_DFA_states): Use unsigned int, not int, for
752 bitset pieces used as boolean, to avoid undefined behavior
753 on hosts that do int overflow checking.
755 2005-08-31 Derek Price <derek@ximbiot.com>
757 * getdelim.c (getdelim): Return EOF on EOF.
758 Reported by Larry Jones <lawrence.jones@ugs.com>.
760 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
762 * regex_internal.c (re_string_reconstruct): Don't assume buffer
763 lengths fit in regoff_t; this isn't true if regoff_t is the same
765 * regex.c (re_search_internal): 5th arg is LAST_START
766 (= START + RANGE) instead of RANGE. This avoids overflow
767 problems when regoff_t is the same width as size_t.
769 (re_search_2_stub): Check for overflow when adding the
770 sizes of the two strings.
771 (re_search_stub): Check for overflow when adding START
772 to RANGE; if it occurs, substitute the extreme value.
774 2005-08-31 Jim Meyering <jim@meyering.net>
776 * regcomp.c (search_duplicated_node): Make first pointer arg
778 * regex_internal.c (create_ci_newstate, create_cd_newstate):
779 (register_state): Likewise.
780 * regexec.c (search_cur_bkref_entry, check_dst_limits):
781 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
782 (group_nodes_into_DFAstates): Likewise.
784 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
786 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
787 old glibc regex code mishandles strings longer than 2**31 bytes.
788 This patch fixes this when the regex code is used in gnulib
789 (i.e., outside glibc).
791 This patch should not affect the use of the regex code inside
792 glibc. No doubt this problem also needs to be handled for glibc
793 as well, but the result will be an incompatible change to the
794 glibc ABI, and the old ABI will have to be supported too. That
795 can be the the subject for another patch.
797 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
798 governing whether the rest of this patch is active. By default,
799 the macro is disabled and the patch has no effect.
800 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
801 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
802 (struct re_pattern_buffer, re_search, re_search_2, re_match):
803 (re_match_2, re_set_registers): Use the new types.
804 * regex_internal.h (Idx, re_hashval_t): New types.
805 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
807 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
808 (re_string_context_at, bin_tree_t, re_dfastate_t):
809 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
810 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
811 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
812 (re_string_char_size_at, re_string_wchar_at):
813 (re_string_elem_size_at):
814 Use the new types and macros to port to 64-bit hosts.
815 Use unsigned types for internal values, so that the code
816 mostly works even for arrays larger than SSIZE_MAX.
817 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
818 (search_duplicated_node, calc_eclosure_iter, fetch_number):
819 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
820 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
821 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
822 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
823 (calc_inveclosure, parse_dup_op, build_range_exp):
824 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
825 (fetch_number, create_token_tree, mark_opt_subexp):
827 * regex_internal.c (re_string_construct_common, create_ci_newstate):
828 (create_cd_newstate, re_string_allocate, re_string_construct):
829 (re_string_realloc_buffers, build_wcs_upper_buffer):
830 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
831 (re_string_reconstruct, re_string_peek_byte_case):
832 (re_string_fetch_byte_case, re_string_context_at):
833 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
834 (re_node_set_init_copy, re_node_set_add_intersect):
835 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
836 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
837 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
838 (re_acquire_state, re_acquire_state_context, register_state):
840 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
841 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
842 (re_search_internal, re_search_2_stub, re_search_stub)
843 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
844 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
845 (update_cur_sifted_state, check_dst_limits):
846 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
847 (check_subexp_limits, sift_states_bkref, merge_state_array):
848 (check_subexp_matching_top, get_subexp, get_subexp_sub):
849 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
850 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
851 (expand_bkref_cache, check_node_accept_bytes):
852 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
853 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
854 (acquire_init_state_context, check_halt_node_context):
855 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
856 (sift_states_backward, clean_state_log_if_needed):
857 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
858 (find_recover_state, transit_state_sb, transit_state_mb):
859 (transit_state_bkref, build_trtable, match_ctx_clean):
861 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
862 to work around an assumption that REG_MISSING is negative.
864 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
865 (seek_collating_symbol_entry) [defined _LIBC]:
866 (lookup_collation_sequence_value) [defined _LIBC]:
867 (build_range_exp, build_collating_symbol) [defined _LIBC]:
868 Use prototypes rather than old-style function definitions.
869 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
870 (transit_state_sb) [0]:
871 (find_collation_sequence_value) [defined _LIBC]: Likewise.
873 * regexec.c (re_search_internal): Simplify update of rm_so and
876 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
877 (optimize_subexps, lower_subexp):
878 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
879 since the signed shift might overflow. Use 1u<<31 instead.
880 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
881 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
884 * regcomp.c (optimize_subexps, lower_subexp):
885 Use CHAR_BIT rather than 8, for clarity.
886 * regexec.c (check_dst_limits_calc_pos_1):
887 (check_subexp_matching_top): Likewise.
888 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
889 have to worry about portability issues when shifting it left.
890 Remove no-longer-needed test for table_size > 0.
891 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
892 in a word, as the resulting behavior is undefined.
893 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
894 in one case, a <= should have been an <, and in another case the
895 whole test was missing.
896 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
897 the standard name CHAR_BIT.
898 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
899 this is not true on one's complement and signed-magnitude hosts.
901 * regex_internal.h (re_sub_match_top_t): Remove unused member
903 (struct re_dfa_t): Remove unused member states_alloc.
904 * regcomp.c (init_dfa): Don't initialize unused members.
906 2005-08-31 Bruno Haible <bruno@clisp.org>
908 * strstr.c: Include <stddef.h>, for NULL.
909 * strcasestr.c: Likewise.
910 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
912 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
914 * iconvme.h: Add prototype for iconv_alloc.
916 2005-08-29 Simon Josefsson <jas@extundo.com>
918 * iconvme.c: Fix errno.
920 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
922 * iconvme.c: Split iconv_string into iconv_alloc.
924 2005-08-27 Jim Meyering <jim@meyering.net>
926 * fopen-safer.c: Merge minor changes from coreutils.
927 * dup-safer.c: Likewise.
928 * fd-safer.c: Likewise.
930 Merge from coreutils.
931 * stdio--.h: New file.
932 * stdlib--.h: New file.
933 * mkstemp-safer.c: New file.
936 * pipe-safer.c: New file.
937 * creat-safer.c: New file.
938 * fcntl--.h (creat): Define to creat_safer.
939 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
940 * unistd--.h (pipe): Define to pipe_safer.
941 * unistd-safer.h: Declare pipe_safer.
943 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
945 * regex_internal.h: Remove all references to
946 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
948 (bitset_not, bitset_merge, bitset_not_merge):
949 (bitset_mask, re_string_allocate, re_string_construct):
950 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
951 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
952 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
953 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
954 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
955 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
956 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
957 (re_acquire_state_context):
958 Remove unnecessary forward decls.
959 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
960 Put __attribute at function definition,
961 now that the function decl has been removed.
962 * lib/regex_internal.c (re_string_peek_byte_case):
963 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
966 2005-08-26 Simon Josefsson <jas@extundo.com>
968 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
969 Haible <bruno@clisp.org>.
971 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
973 * regexec.c (set_regs): Don't alloca with an unbounded size.
975 alloca modernization/simplification for regex.
976 * regex.c: Remove portability cruft for alloca. This no longer
977 needs to be at the start of the file, and can be moved into
978 regex_internal.h and simplified.
979 * regex_internal.h: Include <alloca.h>.
980 (__libc_use_alloca) [!defined _LIBC]: New macro.
981 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
982 now works outside glibc.
984 2005-08-24 Simon Josefsson <jas@extundo.com>
986 * getpass.c: Add WIN32 implementation. Conditionalize use of
987 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
990 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
992 Make regex safe for g++. This fixes one real bug (an "err"
993 that should have been "*err"). g++ problem reported by
995 * regex_internal.h (re_calloc): New macro, consistent with
996 re_malloc etc. All callers of calloc changed to use re_calloc.
997 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
998 not int. All callers changed.
999 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
1000 just use an array of size MB_LEN_MAX.
1001 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
1002 (find_recover_state): Change "err" to "*err"; this fixes what
1003 appears to be a real bug.
1004 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
1007 2005-08-25 Jim Meyering <jim@meyering.net>
1009 * open-safer.c: Include <config.h>.
1010 Otherwise, we'd lose LARGEFILE support in any file using
1013 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
1015 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
1016 * regex.h (regerror): Likewise.
1018 * regex.c: Do not include <sys/types.h>, as POSIX no longer
1019 requires this. (The code never needed it.)
1021 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
1022 All uses of recently-renamed identifiers changed to use the new,
1023 POSIX-compliant names. The code will build and run just fine
1024 without these changes, but it's better to eat our own dog food
1025 and use the standard-conforming names.
1027 * regex.h: Fix a multitude of POSIX name space violations.
1028 These changes have an effect only for programs that define
1029 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
1030 do not change anything for programs compiled in the normal way.
1031 Also, there is no effect on the ABI.
1033 (_REGEX_SOURCE): New macro.
1034 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
1035 defined and _GNU_SOURCE is not; this fixes a name space violation.
1037 Rename the following macros to obey POSIX requirements.
1038 The old names are still visible as macros if _REGEX_SOURCE is defined.
1039 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
1040 RE_BACKSLASH_ESCAPE_IN_LISTS.
1041 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
1042 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
1043 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
1044 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
1045 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
1046 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
1047 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
1048 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
1049 (REG_INTERVALS): renamed from RE_INTERVALS.
1050 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
1051 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
1052 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
1053 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
1054 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
1055 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
1056 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
1057 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
1058 RE_UNMATCHED_RIGHT_PAREN_ORD.
1059 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
1060 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
1061 (REG_DEBUG): renamed from RE_DEBUG.
1062 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
1063 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
1064 unusual, since we can't clash with the POSIX REG_ICASE.
1065 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
1066 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
1067 (REG_NO_SUB): renamed from RE_NO_SUB.
1068 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
1069 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
1070 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
1071 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
1072 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
1073 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
1074 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
1075 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
1076 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
1077 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
1078 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
1079 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
1080 RE_SYNTAX_POSIX_MINIMAL_BASIC.
1081 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
1082 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
1083 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
1084 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
1085 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
1086 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
1087 (REG_FIXED): Renamed from REGS_FIXED.
1088 (REG_NREGS): Renamed from RE_NREGS.
1090 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
1091 of other REG_* macros, since POSIX says the user is allowed to
1092 #undef these macros selectively.
1094 (reg_errcode_t): Update comment stating what other tables need
1097 Rename the following enum values to obey POSIX requirements.
1098 The old names are still visible as macros.
1099 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
1100 is not defined, since GNU is supposed to be a superset of POSIX as
1101 much as possible, and since we want reg_errcode_t to be a signed
1102 type for implementation consistency.
1103 (_REG_NOERROR): Renamed from REG_NOERROR.
1104 (_REG_NOMATCH): Renamed from REG_NOMATCH.
1105 (_REG_BADPAT): Renamed from REG_BADPAT.
1106 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
1107 (_REG_ECTYPE): Renamed from REG_ECTYPE.
1108 (_REG_EESCAPE): Renamed from REG_EESCAPE.
1109 (_REG_ESUBREG): Renamed from REG_ESUBREG.
1110 (_REG_EBRACK): Renamed from REG_EBRACK.
1111 (_REG_EPAREN): Renamed from REG_EPAREN.
1112 (_REG_EBRACE): Renamed from REG_EBRACE.
1113 (_REG_BADBR): Renamed from REG_BADBR.
1114 (_REG_ERANGE): Renamed from REG_ERANGE.
1115 (_REG_ESPACE): Renamed from REG_ESPACE.
1116 (_REG_BADRPT): Renamed from REG_BADRPT.
1117 (_REG_EEND): Renamed from REG_EEND.
1118 (_REG_ESIZE): Renamed from REG_ESIZE.
1119 (_REG_ERPAREN): Renamed from REG_ERPAREN.
1120 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
1121 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
1122 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
1123 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
1125 (_REG_RE_NAME, _REG_RM_NAME): New macros.
1126 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
1127 changed. But support the old name if the new one is not defined
1128 and if _REGEX_SOURCE.
1130 Change the following member names in struct re_pattern_buffer.
1131 The old names are still supported if !_REGEX_SOURCE.
1132 The new names are always supported, regardless of _REGEX_SOURCE.
1133 (re_buffer): Renamed from buffer.
1134 (re_allocated): Renamed from allocated.
1135 (re_used): Renamed from used.
1136 (re_syntax): Renamed from syntax.
1137 (re_fastmap): Renamed from fastmap.
1138 (re_translate): Renamed from translate.
1139 (re_can_be_null): Renamed from can_be_null.
1140 (re_regs_allocated): Renamed from regs_allocated.
1141 (re_fastmap_accurate): Renamed from fastmap_accurate.
1142 (re_no_sub): Renamed from no_sub.
1143 (re_not_bol): Renamed from not_bol.
1144 (re_not_eol): Renamed from not_eol.
1145 (re_newline_anchor): Renamed from newline_anchor.
1147 Change the following member names in struct re_registers.
1148 The old names are still supported if !_REGEX_SOURCE.
1149 The new names are always supported, regardless of _REGEX_SOURCE.
1150 (rm_num_regs): Renamed from num_regs.
1151 (rm_start): Renamed from start.
1152 (rm_end): Renamed from end.
1154 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
1155 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
1156 Prepend __ to parameter names.
1158 Undo yesterday's changes.
1160 2005-08-24 Jim Meyering <jim@meyering.net>
1162 Sync from coreutils.
1163 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
1165 2005-08-21 Bruno Haible <bruno@clisp.org>
1167 * lock.h: Add multiple inclusion guard.
1168 * tls.h: Add multiple inclusion guard.
1170 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
1172 * regex.h (REG_NOSYS)
1173 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
1174 Define, since POSIX requires it as of 2001.
1175 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
1176 New private symbol, used to keep the enum signed in all cases.
1177 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
1178 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
1180 * regex_internal.c (re_string_skip_chars, register_state):
1182 Remove forward decls; no longer needed now that we use prototypes.
1183 * regexec.c (acquire_init_state_context, check_halt_node_context):
1184 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
1185 (clean_state_log_if_needed): Likewise.
1187 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1189 Fix problems reported by Sam Steingold in
1190 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
1191 * regexec.c (sift_states_bkref): Fix portability bug: the code
1192 assumed that reg_errcode_t is a signed type, which is not
1193 necessarily true if _XOPEN_SOURCE is not defined.
1194 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
1195 some compilers warn about it otherwise.
1197 2005-08-20 Jim Meyering <jim@meyering.net>
1199 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
1200 of unused local, dfa.
1202 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1204 * regcomp.c (create_initial_state): Remove duplicate decl.
1205 (init_word_char, create_initial_state, duplicate_node_closure):
1206 (fetch_token, peek_token_bracket, build_range_exp):
1207 (build_collating_symbol): Remove forward decls; no longer needed
1208 now that we use prototypes.
1211 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
1212 (re_compile_fastmap_iter, regcomp, regerror, regfree):
1213 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
1214 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
1215 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
1216 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
1217 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
1218 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
1219 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
1220 (build_range_exp, build_collating_symbol, parse_bracket_exp):
1221 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
1222 (build_charclass, build_charclass_op, fetch_number, create_tree):
1223 (create_token_tree, mark_opt_subexp, duplicate_tree):
1224 Use prototypes rather than old-style definitions.
1227 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
1228 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
1229 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1230 (re_string_reconstruct, re_string_peek_byte_case):
1231 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
1232 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1233 (re_node_set_init_copy, re_node_set_add_intersect):
1234 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1235 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1236 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1237 (re_acquire_state, re_acquire_state_context, register_state):
1238 (create_ci_newstate, create_cd_newstate, free_state):
1240 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
1241 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
1242 (re_search_internal, prune_impossible_nodes):
1243 (acquire_init_state_context, check_matching, static):
1244 (check_halt_node_context, check_halt_state_context, proceed_next_node):
1245 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
1246 (update_regs, sift_states_backward, build_sifted_states):
1247 (clean_state_log_if_needed, merge_state_array):
1248 (update_cur_sifted_state, add_epsilon_src_nodes):
1249 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
1250 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
1251 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
1252 (find_recover_state, check_subexp_matching_top, transit_state_mb):
1253 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
1254 (check_arrival, check_arrival_add_next_nodes):
1255 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1256 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1257 (check_node_accept_bytes, check_node_accept, extend_buffers):
1258 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
1259 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
1264 (re_string_allocate, re_string_construct, re_string_reconstruct):
1265 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
1266 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
1267 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
1268 (re_string_context_at, re_string_peek_byte_case):
1269 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
1270 is defined, since we now use prototypes always.
1272 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
1273 C89 or better. All uses removed.
1275 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1277 * regex_internal.c (re_acquire_state, re_acquire_state_context)
1278 [defined lint]: Suppress bogus uninitialized-variable warnings.
1280 * regcomp.c (duplicate_node): Return new index, not an error code,
1281 and let the caller return REG_ESPACE if out of space. This
1282 removes an uninitialied-variable warning with GCC 4.0.1, and also
1283 avoids taking the address of a local variable. All callers
1286 2005-08-19 Jim Meyering <jim@meyering.net>
1288 * regexec.c (proceed_next_node): Redo local variables to
1289 avoid GCC shadowing warnings.
1291 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1293 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
1294 (re_node_set_insert_last, re_dfa_add_node):
1295 Rename local variables to avoid GCC shadowing warnings.
1297 2005-08-18 Bruno Haible <bruno@clisp.org>
1299 * strstr.c (strstr): Fix return value in multibyte case.
1300 * strcasestr.c (strcasestr): Likewise.
1302 2005-08-17 Jim Meyering <jim@meyering.net>
1304 Make the %s format (seconds since the epoch) work for a negative
1305 number and when used with a zero-padded field width, e.g. %015s.
1307 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1308 label so that it precedes the code to set `digits'. Otherwise,
1309 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
1310 print `00-22'. Now, it prints `-0022', as it should.
1312 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
1314 * regex.h: Remove useless space-before-tab. From coreutils.
1316 2005-08-17 Bruno Haible <bruno@clisp.org>
1318 * strcasestr.h: New file.
1319 * strcasestr.c: New file.
1321 2005-08-17 Bruno Haible <bruno@clisp.org>
1323 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
1324 * strstr.c: Completely rewritten, with multibyte locale support.
1326 2005-08-17 Bruno Haible <bruno@clisp.org>
1328 * strcasecmp.c: Use mbuiter.h.
1330 2005-08-17 Bruno Haible <bruno@clisp.org>
1332 * mbuiter.h: New file.
1334 2005-08-16 Bruno Haible <bruno@clisp.org>
1336 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
1338 (mbi_avail, mbi_advance): Let the iteration end before the terminating
1339 NUL byte, not after it.
1341 2005-08-16 Bruno Haible <bruno@clisp.org>
1343 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
1344 the valid ones. Makes the comparison operations transitive:
1345 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
1346 * strcasecmp.c (strcasecmp): Use mb_casecmp.
1348 2005-08-16 Bruno Haible <bruno@clisp.org>
1350 * strcase.h (strcasecmp): Add note in comments.
1351 * strncasecmp.c: Use code from strcasecmp.c.
1352 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
1353 (strcasecmp): Work correctly in multibyte locales.
1355 2005-08-16 Bruno Haible <bruno@clisp.org>
1357 * strnlen1.h: New file.
1358 * strnlen1.c: New file.
1360 2005-08-16 Bruno Haible <bruno@clisp.org>
1362 * mbfile.h: New file.
1364 2005-08-16 Bruno Haible <bruno@clisp.org>
1366 * mbiter.h: New file.
1368 2005-08-16 Bruno Haible <bruno@clisp.org>
1370 * mbchar.h: New file.
1371 * mbchar.c: New file.
1373 2005-08-16 Bruno Haible <bruno@clisp.org>
1375 * tls.h: New file, from GNU gettext.
1376 * tls.c: New file, from GNU gettext.
1378 2005-08-15 Bruno Haible <bruno@clisp.org>
1380 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
1383 2005-08-14 Jim Meyering <jim@meyering.net>
1385 Sync from coreutils.
1387 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
1388 Use the hash-table-based cycle-detection code not just when
1389 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
1390 Reported by James Youngman in
1391 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
1392 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
1393 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
1394 This lets us compile with -DFTS_DEBUG, once again.
1395 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
1396 * fts.c (fd_safer): Remove decl.
1397 Include fcntl--.h rather than unistd-safer.h
1398 (fts_safe_changedir): Don't call fd_safer; no longer needed
1399 now that we include fcntl--.h.
1401 2005-08-11 Simon Josefsson <jas@extundo.com>
1403 * readline.h, readline.c: New file.
1405 2005-08-11 Bruno Haible <bruno@clisp.org>
1407 * strnlen.h (strnlen): Change parameter name to match comment.
1409 2005-08-10 Simon Josefsson <jas@extundo.com>
1411 * strndup.c: Use strnlen.h.
1413 * strnlen.h: New file.
1415 2005-08-02 Simon Josefsson <jas@extundo.com>
1417 * getline.h, getline.c: Rewrite.
1419 * getdelim.h, getdelim.c: New files, ported from glibc.
1421 2005-07-31 Bruno Haible <bruno@clisp.org>
1423 * lock.h (gl_lock_initializer): New macro.
1424 (gl_lock_define_initialized): Use it.
1425 (gl_rwlock_initializer): New macro.
1426 (gl_rwlock_define_initialized): Use it.
1427 (gl_recursive_lock_initializer): New macro.
1428 (gl_recursive_lock_define_initialized): Use it.
1430 2005-07-26 Bruno Haible <bruno@clisp.org>
1432 * lock.h: Update from GNU gettext.
1433 * lock.c: Update from GNU gettext.
1435 2005-07-18 Bruno Haible <bruno@clisp.org>
1437 * lock.h (gl_once_t): New type.
1438 (gl_once_define, gl_once): New macros.
1439 * lock.c (fresh_once): New variable.
1440 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
1443 2005-07-18 Simon Josefsson <jas@extundo.com>
1445 * check-version.c (check_version): Accept identical versions too.
1447 2005-07-18 Bruno Haible <bruno@clisp.org>
1449 * lock.h: New file, from GNU gettext.
1450 * lock.c: New file, from GNU gettext.
1452 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
1454 * quotearg.c: Add translator comment suggested by Bruno Haible,
1455 with a minor change.
1457 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
1459 * version-etc-fsf.c (version_etc_copyright): Parameterize the
1460 copyright symbol and the year.
1461 * version-etc.c (COPYRIGHT_YEAR): New constant.
1462 (version_etc_va): Use parameterized copyright notice.
1463 Reword to conform to the current GNU coding standards.
1465 2005-07-11 Simon Josefsson <jas@extundo.com>
1467 * size_max.h: New file.
1469 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
1471 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
1474 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
1475 and Paul Eggert <eggert@cs.ucla.edu>
1477 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
1478 in wint_t, not wchar_t. Remove now-unnecessary cast.
1480 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
1482 * regex.c, regex.h: Sync from libc.
1483 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
1484 New files, synced from libc, except that regex_internal.h
1485 currently has a small porting fix.
1487 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
1489 Remove the dependency of the strftime module on the tzset module.
1490 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
1491 Copy the input structure, to work around some of the bug with
1492 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
1493 Solaris releases, you should also use the tzset module, but we won't
1494 require it as a dependency any more since we don't want LGPLed code
1495 to depend on GPLed code.
1497 2005-07-02 Jim Meyering <jim@meyering.net>
1499 * backupfile.c (backup_args): Change a `0' to NULL.
1501 2005-07-01 Jim Meyering <jim@meyering.net>
1503 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1504 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
1505 * save-cwd.c, tempname.c:
1506 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1507 and don't include <sys/file.h>).
1509 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
1511 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
1512 declares only 'struct timespec;' (!).
1514 2005-06-29 Jim Meyering <jim@meyering.net>
1516 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
1517 type name. Use the variable name instead.
1518 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
1520 2005-06-28 Simon Josefsson <jas@extundo.com>
1522 * check-version.h, check-version.c: New files.
1524 2005-06-28 Simon Josefsson <jas@extundo.com>
1526 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
1527 collision with global variable. Better indentation. Don't
1528 increment buffer pointer beyond buffer end. Based on comments
1529 from Paul Eggert <eggert@cs.ucla.edu>.
1533 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
1535 * canon-host.c (canon-host): Append trailing "," to 0 in
1536 initializer of struct addrinfo, as an indication that we don't
1537 care how many members the structure has.
1539 2005-06-24 Derek Price <derek@ximbiot.com>
1540 and Bruno Haible <bruno@clisp.org>
1542 Remove stat module & update lstat.
1543 * stat.c: Remove this file...
1544 (slash_aware_lstat): ...moving this content and its support...
1545 * lstat.c (rpl_lstat): ...into here.
1546 * lstat.h: New file.
1548 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
1550 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
1551 (ranged_convert): Don't save conversion in a temporary struct.
1552 This causes a warning with GCC 4.0.0, and anyway in the typical
1553 case it's not worth the extra 100 bytes or so of code.
1554 (ranged_convert, __mktime_internal): When calling a function via a
1555 pointer P, use P () rather than (*P) (), as we now assume C89 or
1558 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
1560 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
1561 "who -r" failed to give output. Problem reported by Tim Waugh.
1563 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
1564 (xcalloc): Use it to avoid needless tests.
1565 Problem reported by Jim Meyering.
1567 2005-06-16 Jim Meyering <jim@meyering.net>
1569 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
1570 when either N or S is zero.
1572 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1574 * argp.h (__option_is_short): Check upper limit of
1575 __key. Isprint() requires its argument to have the value
1576 of an unsigned char or EOF.
1578 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
1580 * fnmatch.c (fnmatch): If there is an encoding error in a
1581 multibyte string or pattern, fall back on unibyte matching.
1582 Problem reported by James Youngman.
1584 2005-06-08 Bruno Haible <bruno@clisp.org>
1586 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
1589 2005-06-08 Bruno Haible <bruno@clisp.org>
1591 * csharpcomp.h: New file, from GNU gettext.
1592 * csharpcomp.c: New file, from GNU gettext.
1593 * csharpcomp.sh.in: New file, from GNU gettext.
1595 2005-06-07 Derek Price <derek@ximbiot.com>
1598 * glob_.h: Indent nested #ifdef.
1600 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
1602 Sync from coreutils.
1603 Use "file name" when talking about file names, instead of "filename"
1604 or "path", as per the GNU coding standards.
1605 * mkdir-p.c: Renamed from makepath.c.
1606 (make_dir_parents): Renamed from make_path. All callers changed.
1607 * mkdir-p.h: Likewise. All includers changed.
1608 * filenamecat.c: Renamed from path-concat.c.
1609 (file_name_concat): Renamed from path_concat. All callers changed.
1610 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
1611 * filenamecat.h: Likewise. All includers changed.
1612 * acl.c: Don't use "path" or "filename" to mean "file name"
1613 in comments or local variable names.
1614 * basename.c: Likewise.
1615 * canonicalize.c, canonicalize.h: Likewise.
1616 * dirname.c, dirname.h: Likewise.
1617 * euidaccess.c: Likewise.
1618 * exclude.c: Likewise
1619 * fnmatch_.h, fnmatch_loop.c: Likewise.
1620 * fsusage.c, fsuage.h: Likewise.
1621 * fts.c, fts_.h: Likewise.
1622 * getcwd.c: Likewise.
1623 * getloadavg.c: Likewise.
1624 * mkstemp.c: Likewise.
1625 * mountlist.c, mountlist.h: Likewise.
1626 * openat.c, openat.h: Likewise.
1627 * readlink-stub.c: Likewise.
1628 * readutmp.c, readutmp.h: Likewise.
1629 * rename.c: Likewise.
1630 * rmdir.c: Likewise.
1632 * savedir.c: Likewise.
1633 * stripslash.c: Likewise.
1634 * tempname.c: Likewise.
1635 * xreadlink.c: Likewise.
1636 * exclude.c (excluded_file_name): Renamed from excluded_filename.
1638 * exclude.h: Likewise.
1640 * euidaccess.c (getuid, getgid, getuid, getegid)
1641 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1642 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
1643 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1644 * pathmax.h: Include <limits.h> unconditionally, since other
1645 files have been getting away with it for years (MORE/BSD 4.3
1647 * userspec.c (getpwnam, getgrnam, getgrgid)
1648 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1650 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
1651 Define to 256, not 255, as per modern POSIX.
1653 2005-06-01 Bruno Haible <bruno@clisp.org>
1655 * csharpexec.h: New file, from GNU gettext.
1656 * csharpexec.c: New file, from GNU gettext.
1657 * csharpexec.sh.in: New file, from GNU gettext.
1659 2005-05-31 Derek Price <derek@ximbiot.com>
1660 Paul Eggert <eggert@cs.ucla.edu>
1663 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
1665 2005-05-29 Derek Price <derek@ximbiot.com>
1666 Paul Eggert <eggert@cs.ucla.edu>
1668 * glob_.h, glob.c: New files.
1670 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
1672 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
1674 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
1675 the configuration hassle isn't worth it.
1676 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
1677 (LONGEST_MODIFIER, PRIuMAX): Remove.
1679 2005-05-27 Bruno Haible <bruno@clisp.org>
1681 * getlogin_r.h: Remove second include of <stddef.h>.
1683 2005-05-25 Bruno Haible <bruno@clisp.org>
1684 Derek Price <derek@ximbiot.com>
1686 * getlogin_r.h: Simplify API documentation.
1688 2005-05-25 Derek Price <derek@ximbiot.com>
1689 Paul Eggert <eggert@cs.ucla.edu>
1691 * getlogin_r.c, getlogin_r.h: New files.
1693 2005-05-22 Bruno Haible <bruno@clisp.org>
1695 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
1696 Also include <sys/param.h> if it defines MIN, MAX.
1697 Based on a patch by Derek Price <derek@ximbiot.com>.
1699 2005-05-22 Bruno Haible <bruno@clisp.org>
1701 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
1702 (INT64_MIN): Fix definition.
1703 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1705 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
1706 NEED_SIGNED_INT_TYPES.
1708 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
1709 HAVE_SYSTEM_INTTYPES.
1711 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
1713 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
1714 so that unistd-safer.h (GPL'ed code) need not be included.
1716 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
1719 * fts.c: Don't include "cycle-check.h" or "hash.h".
1720 (setup_dir, free_dir): New functions.
1721 (enter_dir, leave_dir): Define trivial
1722 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
1723 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
1724 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
1725 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
1726 Move to fts-cycle.c.
1727 (fts_open): Use setup_dir.
1728 (fts_close): Use free_dir.
1729 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
1730 This adds a label and some gotos, but the alternatives were messier.
1731 Check for memory allocation failure when entering a dir.
1732 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
1733 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
1734 (FTS): New member fts_cycle, that is a union that contains the
1735 old active_dir_ht and cycle_state. All uses changed to mention
1736 fts_cycle.ht and fts_cycle.state.
1737 * fts-cycle.c: New file, containing GPL'ed code migrated out of
1738 fts.c, with the following changes:
1739 (setup_dir, free_dir): New functions.
1740 (enter_dir): Now returns bool. Return true if successful, false
1741 if memory exhausted. All callers changed.
1742 Do not bother partly cleaning up on
1743 memory allocation failure; that is free_dir's job.
1744 However, free ad if hash_insert fails, to avoid memory leak.
1745 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
1746 fts->fts_options to see which union member to use.
1748 2005-05-20 Jim Meyering <jim@meyering.net>
1750 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
1751 Now a macro, to pacify GCC.
1753 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
1755 * chown.c (rpl_chown): Return -1 on failure.
1757 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
1759 * canonicalize.c: Include canonicalize.h first, to test interface.
1760 Include <stddef.h> unconditionally, since we assume C89 now.
1761 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
1762 * fts.c: Include fts_.h first, to check interface.
1763 Do not include intprops.h; no longer needed.
1764 Include cycle-check.h and hash.h, since fts_.h no longer does.
1765 Remove unnecessary casts of closedir to void.
1766 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
1767 decide whether to decrement nlinks.
1768 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
1769 (FTS): Use struct hash_table * instead of Hash_table, so that
1770 we no longer need to include hash.h here.
1772 2005-05-17 Jim Meyering <jim@meyering.net>
1774 * fts.c, fts_.h: New files, from coreutils.
1776 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
1778 Sync from coreutils.
1779 * unlinkdir.c, unlinkdir.h: New files.
1780 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
1781 regex.h, unlocked-io.h, xtime.h:
1782 White space changes only.
1783 * makepath.c (make_path): Port to hosts where leading "//" is special.
1784 * yesno.c: Include getline.h, not ctype.h.
1785 (yesno): Don't remove leading white space; POSIX doesn't allow it.
1786 Use getline to remove arbitrary restriction on response length.
1788 2005-05-13 Bruno Haible <bruno@clisp.org>
1790 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
1791 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
1792 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
1793 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
1794 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
1795 Add support for 64-bit integers in the MSVC compiler.
1797 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
1799 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
1800 Change the initial comment to refer to GPL, not LGPL.
1801 gnulib-tool will change it to LGPL as needed.
1803 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
1804 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
1805 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
1806 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
1807 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
1808 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
1809 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
1810 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
1811 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
1812 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
1813 concatpath.c, config.charset, copy-file.c, copy-file.h,
1814 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
1815 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
1816 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
1817 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
1818 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
1819 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
1820 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
1821 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
1822 full-read.c, full-read.h, full-write.c, full-write.h,
1823 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
1824 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
1825 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
1826 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
1827 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
1828 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
1829 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
1830 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
1831 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
1832 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
1833 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
1834 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
1835 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
1836 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
1837 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
1838 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
1839 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
1840 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
1841 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
1842 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
1843 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
1844 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
1845 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
1846 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
1847 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
1848 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
1849 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
1850 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
1851 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
1852 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
1853 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
1854 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
1855 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
1856 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
1857 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
1858 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
1859 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
1860 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
1861 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
1862 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
1863 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
1864 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
1865 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
1866 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
1867 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
1868 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
1869 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
1870 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
1871 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
1872 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
1873 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
1874 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
1875 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
1876 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
1877 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
1878 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
1879 Update FSF postal mail address.
1881 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1883 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
1884 specified in ai_socktype. Fix invalid ai_protocol
1885 check. ai_protocol is usually set to 0 or depending on
1886 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
1887 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
1888 ai_socktype / ai_protocol in the returned addrinfo structure.
1890 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1891 Bruno Haible <bruno@clisp.org>
1893 * inet_ntop.h: New file.
1894 * inet_ntop.c: New file, from glibc with modifications.
1896 2005-05-08 Jim Meyering <jim@meyering.net>
1898 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
1900 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
1902 Merge from coreutils. Among other things,
1903 add bulletproofing for cases where stdin, stdout, or stderr are closed.
1904 * fd-safer.c: New file.
1905 * fcntl-safer.h, open-safer.c: Remove.
1906 * chdir-long.c: Fix comment "fetish" -> "coreutils".
1907 * dup-safer.c: Include unistd-safer.h first.
1908 Don't include errno.h.
1909 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
1910 * file-type.h: Don't assume invoker included sys/stat.h first.
1911 * file-type.c: Rely on file-type.h change.
1912 * getloadavg.c: Include unistd-safer.h.
1913 (getloadavg): Use safer open.
1914 * getusershell.c: Include "stdio-safer.h".
1915 (getusershell): Use safer fopen.
1916 * long-options.c (long_options): Use NULL rather than 0.
1917 * modechange.h (mode_free): Remove; all callers changed to invoke
1919 * modechange.c: Likewise.
1920 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
1921 (MODE_DONE): New constant.
1922 (struct mode_change): Remove 'next' member.
1923 (make_node_op_equals): New function; like the old one of the
1924 same name, except it allocates an array.
1925 (mode_compile, mode_create_from_ref): Use it.
1926 (mode_compile): Allocate result as an array, not a linked list.
1927 Parse octal string ourself, so that we catch mistakes like "+0".
1928 (mode_adjust): Arg is an array, not a linked list.
1929 * modechange.c: Include stat-macros.h, xalloc.h.
1930 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
1931 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
1932 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
1933 Remove. This is now stat-macros.h's job.
1934 (talloc): Remove. All callers replaced by xalloc, so that
1935 our invokers don't have to worry about reporting memory failures.
1936 (make_node_op_equals): Remove.
1937 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
1939 (struct mode_change): Moved here from modechange.h.
1940 (mode_append_entry): Remove.
1941 (mode_compile): Remove MASKED_OPS arg, since it encouraged
1942 apps to have incorrect behavior. Use simpler algorithm for head
1943 and tail. Don't futz with umask; that's now the job of mode_adjust.
1944 Detect more invalid usages rather than having somewhat-random behavior.
1945 Don't insert an "a=" action, as that leads to incorrect behavior.
1946 (mode_compile, mode_create_from_ref): Return NULL on error instead
1947 of an enum, since now there's only one way to have an error. All
1949 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
1950 at the correct time. Simplify calculation of "+u" and its ilk.
1951 Don't mishandle "+X".
1952 (mode_free): Remove "register" and localize decls.
1953 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
1954 (struct mode_change): Move to modechange.c; callers don't
1955 need to see this stuff.
1956 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
1957 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
1958 (mode_change, mode_adjust): Reflect the new signatures noted above.
1959 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
1960 that might redefine system include files.
1961 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
1962 (my_usleep): Use NULL rather than (void *) 0.
1963 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
1964 Use siginterrupt to specify that system calls should be interrupted.
1965 (rpl_nanosleep): Move initialization of suspended closer to call of
1967 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
1968 * readutmp.c: Likewise. Include signal.h, stdbool.h.
1969 (desirable_utmp_entry): New function.
1970 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
1971 using x2nrealloc, to simplify logic.
1972 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
1973 size calculation. Do not assume utmp file is a regular file.
1974 * readutmp.h (UT_PID): Moved here from ../src/who.c.
1975 (READ_UTMP_CHECK_PIDS): New constant.
1976 * save-cwd.c: Include unistd-safer.h.
1977 (save_cwd): Use fd_safer.
1978 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
1979 [!_LIBC] Include "stat-macros.h" instead.
1980 * unistd-safer.h (fd_safer): New decl.
1982 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
1984 * byteswap_.h: New file.
1986 2005-04-25 Albert Chin <china@thewrittenword.com>
1988 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
1991 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
1993 * getdate.y (zone): Allow relunit_snumber after tZONE, so
1994 that "UTC +1 second" continues to work. Problem reported
1996 (relunit_snumber): New rule.
1999 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
2001 * getdate.y (universal_time_zone_table): New constant.
2002 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
2003 universal_time_zone_table.
2004 (lookup_zone): Prefer universal_time_zone_table to
2005 local_time_zone_table, so that "GMT" time stamps are allowed in
2006 London during the summer. Problem reported by Ian Abbott.
2008 2005-04-12 Jim Meyering <jim@meyering.net>
2010 * human.c (humblock): Set *options even when returning due to
2011 xstrtoumax conversion failure. Thanks to a used-uninitialized
2014 2005-04-09 Jim Meyering <jim@meyering.net>
2016 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
2017 -Wuninitialized: initialize tm0.tm_year.
2019 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
2021 * getdate.y (parser_control): rels_seen is now a boolean, not a
2022 count, since there's no maximum. All uses changed.
2023 Add member dsts_seen.
2024 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
2026 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
2027 Use pc_rels_seen to decide whther a date is absolute.
2029 * getdate.y (number): Don't overwrite year.
2030 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
2033 2005-04-02 Simon Josefsson <jas@extundo.com>
2035 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
2036 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
2038 2005-03-27 Jim Meyering <jim@meyering.net>
2040 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
2042 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
2044 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
2045 "one's complement" -> "ones' complement" in comment, as per Knuth.
2046 "value of type" -> "type or expression" in comment.
2047 * mktime.c, strftime.c: Propagate intprops.h comment nits.
2049 2005-03-26 Jim Meyering <jim@meyering.net>
2052 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
2053 Correct typos: s/or/of/.
2055 2005-03-23 Jim Meyering <jim@meyering.net>
2057 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
2059 2005-03-21 Jim Meyering <jim@meyering.net>
2061 Changes imported from coreutils.
2063 * cycle-check.c: Don't include xalloc.h.
2065 * path-concat.c: Don't include assert.h.
2066 (path_concat): Remove assertion that would have triggered
2067 for ABASE starting with more than one slash.
2068 Reported by Andreas Schwab.
2070 * path-concat.c (path_concat): Set *BASE_IN_RESULT
2071 properly when ABASE is an absolute file name.
2072 Correct the description of this function.
2074 Add an assertion and a test driver.
2075 This fixes a bug introduced on 2004-07-02.
2076 Andreas Schwab reported the resulting failure of cp --parents:
2077 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
2079 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
2081 * strftime.c (my_strftime): If the underlying strftime returns 0
2082 (which shouldn't happen), generate nothing instead of returning 0
2083 immediately, so that nstrftime (NULL, ...) doesn't return 0.
2085 2005-03-16 Bruno Haible <bruno@clisp.org>
2087 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
2089 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
2091 * strftime.c (my_strftime): Prepend space to format so that we can
2092 reliably distinguish strftime failure from empty output on POSIX
2095 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
2097 * iconvme.c (SIZE_MAX): New macro, if not already defined.
2098 (iconv_string): Don't guess a size-zero buffer, as that might cause
2099 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
2100 result would be 'too large', where 'too large' is (heuristically)
2101 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
2102 overflow concerns. This will prevent some unwanted malloc failures
2103 when the inputs are very large.
2105 2005-03-15 Bruno Haible <bruno@clisp.org>
2107 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
2110 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
2113 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
2115 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
2117 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
2118 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
2120 * strtol.c: Likewise.
2122 2005-03-14 Simon Josefsson <jas@extundo.com>
2124 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
2127 2005-03-14 Jim Meyering <jim@meyering.net>
2129 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
2130 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
2131 to be nonzero so that we (and caller) can detect the difference
2132 between a valid zero-length expansion and an error return, even
2133 when the underlying strftime fails before writing anything into
2136 2005-03-10 Jim Meyering <jim@meyering.net>
2138 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
2139 so that this module works on systems without fchdir.
2141 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
2143 Factor int-properties macros into a single file, except for
2144 glibc-related files.
2145 * intprops.h: New file.
2146 * getloadavg.c: Include it instead of limits.h.
2147 (INT_STRLEN_BOUND): Remove.
2148 * human.c: Include intprops.h.
2149 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2150 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2151 * inttostr.h: Include intprops.h instead of limits.h.
2152 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2153 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2154 for consistency with intprops.h.
2155 (time_t_is_integer, twos_complement_arithmetic): Use them.
2156 * sig2str.h: Include <signal.h>, intprops.h.
2157 (INT_STRLEN_BOUND): Remove.
2158 * strftime.c (TYPE_SIGNED): Remove.
2159 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2160 * strtol.c: Adjust comments to match intprops.h.
2161 * userspec.c: Include intprops.h.
2162 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2163 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2164 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2165 instead of rolling our own expressions.
2166 * xstrtol.c: Include xstrtol.h first, to test interface.
2168 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
2170 (my_strftime): Do not mishandle years close to INT_MAX, by doing
2171 the right thing even if adding 1900 would overflow. Similarly
2172 for tm_mon + 1 and tm_yday + 1.
2173 Make %Y always equivalent to %C%y, and similarly for %G and %g.
2174 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2175 (DO_SIGNED_NUMBER): New macro.
2176 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2178 2005-03-07 Bruno Haible <bruno@clisp.org>
2180 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
2182 2005-03-03 Derek R. Price <derek@ximbiot.com>
2183 Bruno Haible <bruno@clisp.org>
2185 * pagealign_alloc.h: New file.
2186 * pagealign_alloc.c: New file.
2188 2005-01-28 Bruno Haible <bruno@clisp.org>
2190 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
2193 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
2195 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2196 The workaround isn't strictly needed for POSIX conformance, and
2197 it's too much of a pain to configure and maintain. We'll ask
2198 people to fix their kernels instead.
2199 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2200 (NANOSLEEP_BUG_WORKAROUND): Remove.
2201 (xnanosleep): Remove the workaround.
2203 2005-02-12 Bruno Haible <bruno@clisp.org>
2205 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
2207 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
2209 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2210 * timespec.h (gettime): Return void, since it always
2211 succeeds now. All uses changed.
2212 * gettime.c (gettime) Likewise.
2213 [HAVE_NANOTIME]: Prefer nanotime.
2214 Assume gettimeofday succeeds, as POSIX requires.
2215 Assime time () succeeds, since other code already does.
2216 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2217 (timespec_subtract): Remove.
2218 (NANOSLEEP_BUG_WORKAROUND): New constant.
2219 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2220 things considerably. Use it only on GNU/Linux hosts, since the
2221 workaround shouldn't be needed elsewhere.
2223 2005-02-24 Bruno Haible <bruno@clisp.org>
2225 * gettext.h: Update from GNU gettext 0.14.2.
2227 2005-02-24 Bruno Haible <bruno@clisp.org>
2229 * localcharset.c: Update from GNU gettext 0.14.2.
2230 * config.charset: Update from GNU gettext 0.14.2.
2232 2005-02-22 Simon Josefsson <jas@extundo.com>
2234 * iconvme.h, iconvme.c: New files, from libc.
2236 2005-02-20 Neil Conway <neilc@samurai.com>
2238 * xgethostname.c (xgethostname): Check for ENOMEM, which is
2239 returned by OSX/Darwin if the specified buffer is not large
2240 enough for the hostname.
2242 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
2244 * memrchr.h: New file.
2245 * chdir-long.c: Include it.
2246 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
2247 Don't bother including stddef.h.
2249 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2251 * argp-help.c (__argp_help): Create a fake struct argp_state and
2252 pass it to _help, otherwise the latter coredumps trying to
2253 dereference state.root_argp.
2255 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
2257 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2259 Include <sys/types.h>, for dev_t.
2260 (ME_DUMMY, ME_REMOTE): Move from here....
2261 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2262 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
2264 Include mountlist.h first, to test the interface.
2266 2005-01-29 Bruno Haible <bruno@clisp.org>
2268 * progname.c (program_name): Initialize.
2269 Needed when linking statically on MacOS X.
2271 2005-01-28 Bruno Haible <bruno@clisp.org>
2273 * javacomp.sh.in: New file, from GNU gettext.
2274 * javacomp.h: New file, from GNU gettext.
2275 * javacomp.c: New file, from GNU gettext.
2277 2005-01-26 Bruno Haible <bruno@clisp.org>
2279 * javaexec.sh.in: New file, from GNU gettext.
2280 * javaexec.h: New file, from GNU gettext.
2281 * javaexec.c: New file, from GNU gettext.
2283 2005-01-26 Simon Josefsson <jas@extundo.com>
2285 * gai_strerror.c: Use GPL in header.
2287 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2289 * argp-help.c (hol_entry_help): Avoid using non-constant
2290 initializers for struct pentry_state.
2291 (__argp_error): Check return value of __asprintf
2292 (__argp_failure): Translate error message
2294 * argp-parse.c: Removed braces around the expansion of N_()
2296 2005-01-21 Jim Meyering <jim@meyering.net>
2298 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2299 same value as for Solaris 9.
2301 * chdir-long.c (chdir_long): Rewrite to remove limitation on
2302 component length. This included changing the parameter to be
2303 of type `char *' rather than `char const *'.
2304 * chdir-long.h (chdir_long): Update prototype.
2306 * openat.c (fdopendir, fstatat): New functions.
2307 * openat.h: Include headers required for use of DIR and struct stat.
2308 [AT_SYMLINK_NOFOLLOW]: Define.
2309 (fdopendir, fstatat): Add prototypes.
2311 2005-01-21 Bruno Haible <bruno@clisp.org>
2313 * classpath.h: New file, from GNU gettext.
2314 * classpath.c: New file, from GNU gettext.
2316 2005-01-20 Simon Josefsson <jas@extundo.com>
2318 * version-etc-fsf.c: New file, with version_etc_copyright.
2319 * version-etc.c: Remove version_etc_copyright.
2320 * version-etc.h (version_etc_copyright): Use [] instead of * in
2321 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
2323 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
2325 * save-cwd.c (save_cwd): Remove code to support the case
2326 where fchdir is missing or flaky.
2328 2005-01-20 Simon Josefsson <jas@extundo.com>
2330 * base64.h (isbase64): Add.
2332 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
2333 using a unsigned prototype, don't inline.
2334 (base64_decode): Use it.
2336 2005-01-19 Bruno Haible <bruno@clisp.org>
2338 * sh-quote.h: New file, from GNU gettext.
2339 * sh-quote.c: New file, from GNU gettext.
2341 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
2343 Merge changes from coreutils, as described below in several
2344 changelogs dated today.
2346 * save-cwd.c: Include "save-cwd.h" before other include files.
2347 (O_DIRECTORY): Remove; not needed here, since "." must be
2348 a directory. All uses removed.
2349 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
2350 universal on Suns, and we also need to test for IRIX.
2351 Revamp code to use 'if' rather than '#if'.
2352 Avoid unnecessary comparison of cwd->desc to 0.
2354 * utimens.c (futimens): Robustify the previous patch, by checking
2355 for known valid error numbers rather than observed invalid ones.
2357 2005-01-18 Jim Meyering <jim@meyering.net>
2359 * version-etc.c (version_etc_copyright): Update copyright date.
2361 * utimens.c (futimens): Account for the fact that futimes
2362 can also fail with errno == ENOSYS or errno == ENOENT.
2363 Patch from Dmitry V. Levin.
2365 Change the name of the robust chdir function from chdir to chdir_long.
2366 * save-cwd.c: Include chdir-long.h rather than chdir.h.
2367 (restore_cwd): Use chdir_long, not chdir.
2368 * chdir-long.c: Renamed from chdir.c.
2369 * chdir-long.h: Renamed from chdir.h.
2370 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
2373 2005-01-18 Bob Proulx <bob@proulx.com>
2375 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
2376 offsetof() macro construct to avoid compile failure with native HP-UX
2377 11.0 ANSI C compiler.
2379 2005-01-06 Bruno Haible <bruno@clisp.org>
2381 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
2382 because stpncpy.m4 takes care of it.
2384 2004-01-24 Bruno Haible <bruno@clisp.org>
2386 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
2388 2003-10-09 Bruno Haible <bruno@clisp.org>
2390 * progreloc.c: Include xalloc.h instead of xmalloc.h.
2392 2005-01-06 Bruno Haible <bruno@clisp.org>
2394 * fwriteerror.h (fwriteerror): Change specification to include fclose.
2395 * fwriteerror.c: Include <stdbool.h>.
2396 (fwriteerror): At the end, close the file stream. Record whether
2397 stdout was already closed.
2399 2004-05-27 Bruno Haible <bruno@clisp.org>
2401 * execute.c (environ): Declare if needed.
2402 * pipe.c (environ): Likewise.
2403 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
2405 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
2407 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
2408 definitions to be after all include files, to avoid collisions.
2409 Problem reported by Bob Proulx.
2411 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
2413 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
2414 not needed. This removes a dependency on the gettext module.
2415 [defined _LIBC]: Do not include <libintl.h>; not needed.
2417 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
2419 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
2422 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
2424 * argp-parse.c: Include <stddef.h>.
2425 (alignof, alignto): New macros.
2426 (parser_init): Don't assume that void * is aligned sufficiently
2429 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
2430 need to extend the stack.
2431 (YYINITDEPTH): New macro, so that the initial stack isn't overly
2434 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2436 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
2438 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
2440 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
2441 Remove now-obsolete comment about AIX.
2442 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
2443 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
2444 (YYMAXDEPTH): New macro.
2446 2004-12-18 Bruno Haible <bruno@clisp.org>
2448 * fatal-signal.c (fatal_signals): Make non-const.
2449 (init_fatal_signals): New function.
2450 (uninstall_handlers, install_handlers): Ignore signals that were set to
2452 (at_fatal_signal): Call init_fatal_signals.
2453 (init_fatal_signal_set): Likewise. Ignore signals that were set to
2455 Reported by Paul Eggert.
2457 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2459 * getdate.y (textint): New member "negative".
2460 (time_zone_hhmm): New function.
2461 Expect 14 shift-reduce conflicts, not 13.
2462 (o_colon_minutes): New rule.
2463 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
2464 (yylex): Set the "negative" member of signed numbers.
2466 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
2468 Changes imported from coreutils.
2469 * hard-locale.c: Assume <locale.h> exists.
2471 (GLIBC_VERSION): New macro.
2472 (hard_locale): Assume setlocale exists.
2473 Rewrite to avoid #ifdef.
2474 Use strdup rather than malloc + strcpy.
2475 * human.c: Assume <locale.h> exists.
2476 (human_readable): Assume localeconv exists.
2478 2004-12-01 Jakub Jelinek <jakub@redhat.com>
2480 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
2481 convert T2, not T. (Imported from libc.)
2483 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
2485 * getcwd.c (is_ENAMETOOLONG): New macro.
2486 (__getcwd.c): Don't restore errno; glibc doesn't.
2487 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
2488 first, falling back to our code only if its results look suspicious.
2489 Ensure that the resulting buffer is only as large as necessary.
2491 * readutmp.c: Include readutmp.h first.
2492 Include <errno.h>, since readutmp.h no longer does that.
2493 * readutmp.h: Don't include <errno.h>,
2494 <sys/param.h>, <time.h>; not needed to establish interface.
2495 (errno): Remove decl.
2496 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
2497 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
2498 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
2500 2004-11-28 Simon Josefsson <jas@extundo.com>
2502 * base64.h, base64.c: New file.
2504 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
2506 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
2508 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
2510 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
2511 HP's ANSI C compiler.
2512 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
2513 Declaring int functions causes warnings on some modern systems and
2514 shouldn't be needed to compile on ancient ones.
2515 * same.c (MIN) [defined MIN]: Don't define, since it's already
2518 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
2519 with the following changes.
2520 (__set_errno): Parenthesize properly.
2521 Include <stdbool.h>.
2522 (MIN, MAX, MATCHING_INO): New macros.
2523 (__getcwd): Define with prototype, not K&R form.
2524 Use heuristics to allocate default buffer on stack if possible.
2525 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
2526 behavior, and to avoid the PATH_MAX limit when computing
2528 Use MATCHING_INO to compare inode number to file.
2529 Check for arithmetic overflow in size calculations.
2530 Fix bug in reallocation of dot array that caused getcwd to fail
2531 on directories nested deeper than 75.
2532 Be more careful about saving errno on error.
2533 Do not use realloc; use only free+malloc, as this is a bit
2534 more flexible and avoids a needless copy operation.
2535 Do not inspect st_dev and st_ino for symbolic links; POSIX
2536 doesn't specify the latter.
2537 Check for closedir errors.
2538 Avoid needless casts.
2539 Use "#ifdef weak_alias" around weak_alias, to be like other
2541 The following changes to getcwd.c have effect only when used in
2542 gnulib; they have no effect inside glibc proper.
2543 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
2544 as alloca isn't used.
2545 (alloca, __alloca): Likewise.
2546 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
2547 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2548 unconditionally, as gnulib assumes C89 or better.
2549 Do not include <sys/param.h>.
2550 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
2551 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
2553 (NULL) [!defined NULL]: Remove; we assume C89 or better.
2554 Include <dirent.h> in a way that is compatible with modern Autoconf.
2555 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
2556 New macros, if not already defined.
2557 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
2558 Use "_LIBC", not "defined _LIBC", for consistency.
2559 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
2561 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
2562 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
2563 * xgetcwd.c: David MacKenzie's old code was removed, so give
2564 credit only to Jim Meyering and adjust the copyright dates.
2565 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
2566 <stdlib.h>, <unistd.h>, "pathmax.h".
2567 Instead, include "xgetcwd.h" (first) and "getcwd.h".
2568 (INITIAL_BUFFER_SIZE): Remove.
2569 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
2571 2004-11-23 Jim Meyering <jim@meyering.net>
2573 * getopt_.h: Remove trailing blanks.
2575 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
2577 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
2578 (futimens): New function, which uses futimes if available.
2579 (futimens, utimens): Support timespec==NULL, with same semantics
2580 as utime and utimens.
2581 * utimens.h (futimens): New decl.
2583 2004-11-23 Jim Meyering <jim@meyering.net>
2585 * __fpending.c: Add comment.
2587 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2589 * getopt_.h: Re-addition of __getopt_argv_const caused
2590 redefinition warnings. To avoid them, include the defines
2591 in `#if !defined __need_getopt ... #endif'. The only place
2592 where __getopt_argv_const is used is in definitions
2593 of getopt_long and getopt_long_only below, which are as well
2594 protected by `#ifndef __need_getopt'.
2595 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
2596 __need_getopt after including <stdio.h> and <unistd.h> These
2597 headers might have defined it.
2599 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
2601 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
2603 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
2604 optopt): Use them instead of invoking ## directly; otherwise, the
2605 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
2607 2004-11-19 Bruno Haible <bruno@clisp.org>
2609 * strtok_r.c: Move comments from here...
2610 * strtok_r.h: ... to here.
2612 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
2614 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
2615 might fail. Problem reported by Yoann Vandoorselaere.
2616 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
2617 that mishandle size_t overflow.
2619 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
2621 * canon-host.c: Include "strdup.h".
2622 (canon_host): Use getaddrinfo if available, so that IPv6 works.
2623 Use strdup instead of malloc/strcpy to duplicate strings.
2625 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
2626 (human_space_before_unit): New constant.
2627 * human.c (human_readable): Support it.
2629 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
2630 (xgetcwd): Set errno correctly when failing.
2631 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
2632 the failure is actually due to a PATH_MAX problem.
2634 Further getopt changes to make it more likely that glibc will
2635 buy the changes back.
2636 * getopt.c (POSIXLY_CORRECT): New constant.
2637 (getopt): Use it, so to preserve glibc semantic
2638 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
2639 when compiling for libc.
2640 * getopt_.h (__getopt_argv_const): Bring it back.
2641 (getopt_long, getopt_long_only): Use it.
2643 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
2644 New arg POSIXLY_CORRECT. All callers changed.
2645 (getopt): Argv is now char * const *, as per standard.
2646 (_getopt_internal_r, _getopt_internal): Argv is now char **,
2647 not char *__getopt_argv_const *.
2648 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2649 _getopt_long_only_r): Likewise.
2650 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
2651 * getopt_int.h (_getopt_internal, _getopt_internal_r,
2652 _getopt_long_r, _getopt_long_only_r): Likewise.
2653 * getopt_.h (__getopt_argv_const): Remove.
2654 (getopt): Argv is now char * const *, as per standard.
2656 * getdate.y (tORDINAL): New token.
2657 (day, relunit): Allow it for relative times.
2658 (relative_time_table): Use tORDINAL for ordinals.
2660 2004-11-15 Jim Meyering <jim@meyering.net>
2662 * closeout.c: Include "__fpending.h" once again.
2663 Include <stdbool.h>.
2664 (close_stdout): Don't fail just because stdout was closed initially,
2665 since some programs don't write to stdout in the normal course of
2666 operation (other than --version and --help), and we don't want this
2667 function to make e.g. `touch file >&-' fail.
2668 But do fail if it was closed and someone has tried to write to it.
2669 E.g., `printf foo >&-' must fail.
2671 2004-11-11 Simon Josefsson <jas@extundo.com>
2673 * strtok_r.h, strtok_r.c: New file.
2675 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
2677 * getopt_.h (__getopt_argv_const): New macro, to be used so that
2678 we can stop lying to compilers about the constness of argv when we
2679 are compiled outside glibc.
2680 (getopt, getopt_long, getopt_long_only): Use it.
2681 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
2683 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2684 _getopt_long_only_r): Likewise.
2685 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
2686 _getopt_long_only_r): Likewise.
2688 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
2689 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
2690 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
2691 the other external symbols.
2692 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
2693 declaration, since the above renaming now works around collisions.
2695 2004-11-11 Jim Meyering <jim@meyering.net>
2697 * linebreak.c: Remove trailing blanks.
2698 * alloca_.h: Likewise.
2699 * acosl.c: Likewise.
2700 * euidaccess.c: Likewise.
2701 * allocsa.h: Likewise.
2703 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
2705 * mktime.c (SHR): New macro, which is a portable
2706 substitute for >> that should work even on Crays.
2707 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
2708 Problem reported by Mark D. Baushke in
2709 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
2710 * getdate.y (SHR): Likewise.
2712 * strftime.c (SHR): Likewise.
2714 * quotearg.c (struct quoting_options): Use unsigned int for
2715 quote_these_too, so that right shifts are well defined. All uses
2718 2004-11-10 Simon Josefsson <jas@extundo.com>
2720 * getaddrinfo.h, getaddrinfo.c: New files.
2722 2004-11-10 Jim Meyering <jim@meyering.net>
2724 Ensure that no close failure goes unreported.
2725 * closeout.c (close_stdout): Always close stdout. I.e., don't
2726 return early when it seems there's nothing to flush.
2727 Don't include __fpending.h.
2729 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
2731 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
2733 2004-11-05 Bruno Haible <bruno@clisp.org>
2735 * readlink.c: Include stddef.h, needed for size_t on Woe32.
2736 Reported by Mark D. Baushke <mdb@cvshome.org>.
2738 2004-11-04 Bruno Haible <bruno@clisp.org>
2740 2004-09-11 Bruno Haible <bruno@clisp.org>
2741 * allocsa.valgrind: New file.
2742 2004-02-06 Bruno Haible <bruno@clisp.org>
2743 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
2744 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
2745 Reported by Christopher Seip <chris.seip@hp.com>.
2747 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
2749 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
2750 with errno == ERANGE if the buffer is too small.
2751 Problem reported by Mark D. Baushke.
2753 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
2755 * xreadlink.c (MAXSIZE): New macro.
2756 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
2757 size does not exceed MAXSIZE. Avoid cast.
2758 As suggested by Mark D. Baushke in
2759 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
2760 if readlink fails with buffer size just under MAXSIZE, try again
2763 2004-11-02 Derek R. Price <derek@ximbiot.com>
2764 and Paul Eggert <eggert@cs.ucla.edu>
2766 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
2767 (get_date): Overparenthesize to avoid GCC warning.
2769 2004-11-02 Bruno Haible <bruno@clisp.org>
2771 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
2772 function returns void.
2774 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
2776 * getpass.c (fflush_unlocked, flockfile, funlockfile)
2777 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
2780 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
2782 * getdate.y: Add support for TZ="foo" within a date string.
2783 Fix some bugs near time_t boundaries. Reject dates with
2784 out-of-range components, e.g., "Sept 31".
2785 Include <stdlib.h>, "setenv.h", "xalloc.h".
2786 (ISDIGIT_LOCALE): Remove; unused.
2787 Note that the TZ and time functions used here are not reentrant.
2788 (mktime_ok, get_tz): New functions.
2789 (TZBUFSIZE): New constant.
2790 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
2791 This requires that we sometimes generate our own TZ="XXX..." setting.
2793 2004-10-27 Derek R. Price <derek@ximbiot.com>
2795 * mktime.c (not_equal_tm): Remove redundant check.
2797 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
2799 * getdate.y: Use Bison 1.875 features, and some minor
2800 code cleanups. This change does not affect semantics.
2801 Don't include <stdlib.h>; no longer needed.
2802 Don't include unlocked-io.h; only the "#if TEST" code uses
2803 stdio, and performance isn't crucial there.
2804 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
2805 Bison 1.875 features as described below.
2806 All uses of "PC." replaced by "pc->".
2807 (YYSTYPE): Add a forward declaration.
2808 (yylex, yyerror): Use full prototypes in forward decls.
2809 Use "%pure-parser" rather than obsolescent "%pure_parser".
2810 Use %parse-param and %lex-param instead of obsolescent
2811 YYPARSE_PARAM and YYLEX_PARAM.
2812 (meridian_table, month_and_day_table, time_units_table,
2813 relative_time_table, time_zone_table, military_table,
2814 lookup_zone, lookup_word, get_date):
2815 Use NULL instead of 0 where appropriate.
2816 (to_hour): Avoid abort (), to avoid a dependency on
2818 (yyerror, yylex): Now accepts parser_control * arg.
2819 (main) [TEST]: Use '\0' rather than 0 for char.
2821 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
2823 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
2824 It's now the caller's responsibility to handle the case where
2825 !HAVE_GETPAGESIZE && !defined getpagesize.
2827 * mktime.c (leapyear): Arg is long int, not int.
2829 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
2831 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
2833 2004-10-12 Simon Josefsson <jas@extundo.com>
2835 * getpass.c (fflush_unlocked, flockfile, funlockfile)
2836 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
2839 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
2841 * vsnprintf.h: New file.
2842 * vsnprintf.c: New file.
2844 2004-10-07 Bruno Haible <bruno@clisp.org>
2846 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
2847 into the provided buffer.
2849 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
2851 * diacrit.c, diacrit.h: Add GPL notice.
2853 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
2854 * atanl.c (atanl): Keep the code as similar to glibc as possible.
2855 * logl.c (logl): Keep the code as similar to glibc as possible.
2856 This avoids a potential constant-folding bug.
2858 2004-10-05 Bruno Haible <bruno@clisp.org>
2860 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
2862 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2864 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
2865 * xmalloc.c (xmemdup): Likewise.
2866 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
2867 XFREE): Remove these long-obsolescent macros.
2868 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
2869 * xstrdup.c: Remove.
2871 * regex.c (re_comp): Cast gettext return value to char *,
2872 Problem reported by Martin Neitzel via Mark D. Baushke.
2874 2004-10-04 Simon Josefsson <jas@extundo.com>
2876 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
2877 '#ifdef USE_UNLOCKED_IO'.
2879 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2881 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
2882 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
2883 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
2884 regex.c, sha1.c, version-etc.c, yesno.c:
2885 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
2886 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
2887 the includer's responsibility.
2889 Sync from coreutils.
2891 * modechange.c (mode_compile): Don't decrement a pointer that
2892 points to the start of a string, as the C Standard says the
2893 resulting behavior is undefined.
2895 * backupfile.h (enum backuptype): Rename none -> no_backups,
2896 simple -> simple_backups, numbered_existing ->
2897 numbered_existing_backups, numbered -> numbered_backups
2898 to avoid shadowing problems. All uses changed.
2899 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
2900 * backupfile.c (check_extension, numbered_backup):
2901 Rename locals to avoid shadowing 'basename'.
2902 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
2905 * .cppi-disable: Add getopt_.h, getopt_int.h.
2906 * .cvsignore: Add getopt.h.
2908 2004-10-04 Simon Josefsson <jas@extundo.com>
2910 * memmem.h: New file.
2911 * memmem.c: New file, taken from glibc.
2913 2004-10-02 Jim Meyering <jim@meyering.net>
2915 * dirfd.h, getpagesize.h: Add copyright notice.
2917 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
2919 * snprintf.c: Remove comments as to why each header is needed.
2921 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
2923 * strsep.h: New file.
2924 * strsep.c: New file.
2926 2004-10-01 Simon Josefsson <jas@extundo.com>
2928 * snprintf.c (snprintf): Handle size==0.
2930 2004-10-01 Simon Josefsson <jas@extundo.com>
2931 Bruno Haible <bruno@clisp.org>
2933 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
2934 (snprintf): Declare 'args'.
2936 2004-09-30 Simon Josefsson <jas@extundo.com>
2938 * snprintf.h, snprintf.c: New files.
2940 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2942 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
2943 (hol_entry_help): Never translate an empty string.
2944 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
2945 * argp.h (OPTION_NO_TRANS): New option.
2947 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
2949 * xvasprintf.c: Include xalloc.h.
2950 (xvasprintf): Use xalloc_die, not xmalloc_die.
2952 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
2954 * dummy.c: Change copyright notice to FSF, and license to GPL.
2956 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
2958 * argp-pvh.c (argp_program_version_hook): Provide initial value.
2959 Problem reported by Bruno Haible in:
2960 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
2962 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
2964 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
2965 in case some system header has #define'd it. Problem reported by
2966 Soeren D. Schulze in
2967 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
2969 2004-09-08 Bruno Haible <bruno@clisp.org>
2971 * stdint_.h: New file, taken from GNU clisp.
2973 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
2975 * xvasprintf.h: New file.
2976 * xvasprintf.c: New file.
2977 * xasprintf.c: New file.
2979 2004-09-08 Bruno Haible <bruno@clisp.org>
2981 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
2983 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
2985 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
2987 Import from coreutils.
2988 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
2989 strings on unbounded length. alloca's performance benefits aren't
2990 that important here.
2992 (parse_with_separator): New function, with most of the internals
2993 of the old parse_user_spec. Allow user to omit both user and group,
2994 for compatibility with FreeBSD.
2995 Clone only the user name, not the entire spec.
2996 Do not set *uid, *gid unless entirely successful.
2997 Avoid memory leak in some failing cases.
2998 Fix regression for USER.GROUP reported by Dmitry V. Levin in
2999 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
3000 (parse_user_spec): Rewrite to use parse_with_separator.
3002 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
3004 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
3005 its complicated substitute.
3006 * argp-help.c: Include <errno.h>, for program_invocation_short_name
3007 and program_invocation_name.
3008 (__argp_basename) [!_LIBC]: Remove; the only use was
3009 replaced by its body.
3010 (__argp_short_program_name): Change condition from
3011 !defined __argp_short_program_name to
3012 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
3013 to match argp-namefrob.h.
3014 (__argp_failure): Don't assume strerror_r returns char *.
3015 * argp-parse.c (N_): Define unconditionally.
3016 (argp_default_options): Fill out initializers with 0 to avoid
3019 2004-08-12 Simon Josefsson <jas@extundo.com>
3021 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
3022 * getopt_.h: Renamed from getopt.h.
3024 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
3026 Merge from coreutils.
3028 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
3029 wmemchr or wmemcpy. Problem reported by Robert Dahlem
3030 for Reliant Unix 5.43.
3032 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
3033 (union fooround): Use uintmax_t, not long int.
3034 The rest is a merge from libc:
3035 [defined _LIBC]: Include <shlib-compat.h>.
3036 (_obstack) [defined _LIBC]: Remove after 2.3.4.
3038 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
3040 * strverscmp.c: Convert to UTF-8.
3042 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
3044 * obstack.h (obstack_empty_p):
3045 Don't assume that chunk->contents is suitably aligned.
3046 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
3047 Likewise. Problem reported by Benno in
3048 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
3050 * chown.c (rpl_chown): Work even if the file is writeable but not
3051 readable. This could be improved further but it'd take some work.
3053 2004-08-08 Simon Josefsson <jas@extundo.com>
3055 * xgethostname.c: Don't include error.h (not used).
3058 * getpass.c: Include getpass.h first.
3060 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
3062 * xalloc-die.c: New files.
3063 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
3065 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
3066 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
3067 (_, N_, xalloc_die): Move to xalloc-die.c.
3068 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
3069 so that we needn't mess with xalloc_msg_memory_exhausted.
3071 * sha1.h: Renamed from sha.h.
3072 (SHA1_H): Renamed from _SHA_H.
3073 (sha1_ctx): Renamed from sha_ctx.
3074 (sha1_init_ctx): Renamed from sha_init_ctx.
3075 (sha1_process_block): Renamed from sha_process_block.
3076 (sha1_process_bytes): Renamed from sha_process_bytes.
3077 (sha1_finish_ctx): Renamed from sha_finish_ctx.
3078 (sha1_read_ctx): Renamed from sha_read_ctx.
3079 (sha1_stream): Renamed from sha_stream.
3080 (sha1_buffer): Renamed from sha_buffer.
3081 * sha1.c: Likewise; renamed from sha.c.
3082 Do not include <sys/types.h>.
3083 Include <stddef.h> rather than <stdlib.h>.
3085 2004-08-08 Bruno Haible <bruno@clisp.org>
3087 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
3088 FILESYSTEM_PREFIX_LEN.
3089 * progreloc.c: Likewise.
3090 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
3092 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
3095 * argp-help.c (make_hol, hol_append): Don't assume that
3096 SIZE_MAX is a valid preprocessor constant.
3097 (__argp_basename): Change from "#ifndef _LIBC"
3098 to "#ifndef __argp_short_program_name", so that
3099 we don't compile these functions for tar.
3101 More merges from coreutils.
3102 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
3103 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
3105 * addext.c: Remove; no longer needed.
3106 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
3107 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
3108 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
3109 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
3110 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
3111 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
3112 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
3113 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
3114 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
3115 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
3116 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
3117 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
3118 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
3119 Import changes from coreutils.
3121 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
3123 Merge from coreutils.
3125 * .gdb-history: Remove; this doesn't belong here.
3127 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
3128 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
3129 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
3131 * dirname.h: Include <stdbool.h>.
3132 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
3133 for consistency with POSIX terminology. All uses changed.
3134 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
3135 (strip_trailing_slashes): Use bool for booleans.
3136 * stripslash.c (strip_trailing_slashes): Likewise.
3138 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
3139 sometimes returns a positive errno value even when it succeeds.
3140 (print_errno_message) [!LIBC]: Fall back on strerror if
3143 * path-concat.c (mempcpy): Don't define if a system header defines it.
3144 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
3145 (longest_relative_suffix): New function.
3146 (path_concat): Use it. Assume first argument is not NULL.
3147 Port to DOS. Omit redundant separators.
3148 Report an error instead of returning NULL.
3149 Use mempcpy instead of memcpy.
3150 (xpath_concat): Remove: not declared or used.
3152 * same.h: Include <stdbool.h>
3153 (same_name): Return bool, not int.
3154 * same.c (same_name): Likewise.
3155 (errno): Don't declare; we assume C89 or better now.
3157 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
3158 if not already defined.
3160 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
3161 * dup-safer.c (errno): Likewise.
3163 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
3165 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
3168 2004-08-03 Simon Josefsson <jas@extundo.com>
3170 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
3171 * progname.h: Don't include stdbool.h.
3173 2004-08-02 Simon Josefsson <jas@extundo.com>
3175 * getsubopt.h: New file, with comments from Bruno Haible.
3176 * getsubopt.c: New file, from glibc, but slightly modified based on
3177 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
3179 2004-08-01 Simon Josefsson <jas@extundo.com>
3181 * xgetdomainname.c: Include stdlib.h, for free().
3183 2004-07-16 Simon Josefsson <jas@extundo.com>
3185 * dummy.c: New file.
3187 2004-07-16 Bruno Haible <bruno@clisp.org>
3189 * backupfile.h: Add extern "C" for C++.
3190 * closeout.h: Likewise.
3191 * copy-file.h: Likewise.
3192 * findprog.h: Likewise.
3193 * full-write.h: Likewise.
3194 * pathname.h: Likewise.
3195 * progname.h: Likewise.
3196 * stpcpy.h: Likewise.
3197 * stpncpy.h: Likewise.
3198 * strcase.h: Likewise.
3199 * strstr.h: Likewise.
3200 * xalloc.h: Likewise.
3202 * mbswidth.h: Add extern "C" for C++.
3203 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
3205 2004-07-09 Simon Josefsson <jas@extundo.com>
3207 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
3208 failed without this.)
3210 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
3212 * fchown-stub.c: New file.
3214 2004-06-24 Jim Meyering <jim@meyering.net>
3216 * obstack.h (obstack_base): Cast to (void *), per documentation.
3218 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
3220 * argz.c, argz_.h: New files, which are autoupdated from libtool.
3222 2004-06-01 Jim Meyering <jim@meyering.net>
3224 * calloc.c: New file.
3226 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
3228 * getdate.y (yylex): Allow space between sign and number.
3229 Problem reported by Dan Jacobson.
3231 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
3232 and Jim Meyering <jim@meyering.net>
3234 Merge from coreutils CVS.
3236 * stat-macros.h: New file, with contents from file-type.h
3237 and coreutils' system.h.
3238 * file-type.c: Include "stat-macros.h".
3239 * file-type.h (file_type): Move all macro definitions to new file,
3242 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
3243 Wrap old code with this conditional.
3244 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
3245 function that does not dereference symlinks.
3246 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
3248 * xreadlink.c: Include xreadlink.h first, to catch .h file
3249 dependency problems.
3250 (xreadlink): Accept new arg SIZE, for efficiency.
3251 All decls and uses changed.
3252 * xreadlink.h: Include <stddef.h>, for size_t.
3254 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
3255 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
3257 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
3259 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
3261 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
3262 macros to be defined.
3263 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
3264 the allocator returns NULL because the requested size is zero.
3266 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3268 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
3269 var. Add comment explaining why libc still defines it. This
3270 merges the following patch from glibc:
3271 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
3273 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
3275 * obstack.c (_obstack): Remove unused variable. It hasn't been
3276 present in glibc since revision 1.1 of this file.
3277 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
3278 obstack_alignment_mask, obstack_alloc, obstack_base,
3279 obstack_blank, obstack_blank_fast, obstack_chunk_size,
3280 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
3281 obstack_grow0, obstack_init, obstack_int_grow,
3282 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
3283 obstack_next_free, obstack_object_size, obstack_ptr_grow,
3284 obstack_ptr_grow_fast, obstack_room): Remove declarations of
3285 nonexistent functions.
3287 2004-05-17 Derek R. Price <derek@ximbiot.com>
3288 Paul Eggert <eggert@cs.ucla.edu>
3290 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
3292 2004-05-14 Bruno Haible <bruno@clisp.org>
3294 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
3295 that consists of a '.' followed by an empty digit string.
3296 Patch by Tor Lillqvist <tml@iki.fi>.
3298 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
3300 Port obstack to the AS/400, where pointers are 16 bytes wide and
3301 you cannot cast an integer to a valid pointer. This patch is
3302 currently waiting to be integrated into glibc; see
3303 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
3305 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
3306 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
3307 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
3308 (struct obstack): temp member is now a union of a pointer and
3309 an integer, instead of an integer. All integer uses changed.
3310 This does not affect the physical layout of struct obstack,
3311 except on hosts (like the AS/400) where the size or alignment of
3312 void * is greater than that of ptrdiff_t.
3313 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
3314 __STDC__)]: Store temporary in pointer member of union, not
3316 * obstack.c: Include <stddef.h>, for offsetof.
3317 (struct fooalign): Remove; it doesn't need a name.
3318 (union fooround): Change double to long double, and add void *.
3319 (DEFAULT_ALIGNMENT): Use offsetof to compute.
3320 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
3321 not a macro. Hence the values are always int; so remove all
3322 casts-to-int in uses.
3324 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
3325 Derek Price <derek@ximbiot.com>
3327 * alloca.c: Include <alloca.h>, to get our interface.
3328 * alloca_.h: Use __alloca on AIX, so that we don't have to
3329 include <alloca.h> first. Use C89 prototype for alloca; this
3330 requires including <stddef.h> for size_t. Use extern "C" if C++.
3331 Use #elif for simplicity, since we can assume C89 now.
3332 Don't try to source the system alloca.h since it will not be found
3333 and to prevent recursively including its replacement.
3334 * fnmatch.c: Include <alloca.h> instead of opencoding.
3335 * regex.c: Likewise.
3337 2004-05-16 Derek Price <derek@ximbiot.com>
3338 Paul Eggert <eggert@cs.ucla.edu>
3340 getline cleanup. This changes the getndelim2 API: both order of
3341 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
3344 * getline.c: Don't include stddef.h or stdio.h, since our
3345 interface does that.
3346 (getline): Always use getdelim, so that we don't have two
3347 copies of this code.
3348 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
3350 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
3351 (GETNDELIM2_MAXIMUM): New macro.
3352 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
3353 instead of the old practice of delim2==0. All callers changed.
3354 Return -1 on overflow, instead of returning junk.
3355 Do not set *linesize unless allocation succeeds.
3356 * getndelim2.h: Do not include stddef.h; no longer needed, now
3357 that we include sys/types.h.
3358 * getnline.h: Likewise.
3359 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
3360 (getndelim2): Reorder arguments.
3361 * getnline.c (getnline, getndelim):
3362 Don't discard the NMAX argument.
3363 (getnline): Invoke getndelim, to avoid code duplication.
3364 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
3365 of (size_t) -1 by callers of the getnline family.
3367 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3369 * nanosleep.c (suspended): Change its type from int to
3370 sig_atomic_t volatile.
3371 (first_call): Make it private to rpl_nanosleep, and have it
3372 be zero initially as that's a bit faster.
3373 (my_usleep): Round up fractional times instead of truncating them,
3374 as this is the usual meaning for 'sleep'.
3376 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3378 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3379 (ENOSYS): Define if not defined.
3380 (settime): Fall back on stime if it exists and settimeofday fails.
3381 But don't bother with fallbacks if a method fails with errno == EPERM.
3383 2004-05-11 Jim Meyering <jim@meyering.net>
3385 Prior to this change, the save_cwd caller required read access to the
3386 current directory on most systems (ones with the fchdir function).
3388 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
3389 fails, try write-only, and finally, resort to using xgetcwd.
3391 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
3393 * obstack.c, obstack.h: Import changes from libc.
3395 2004-04-28 Bruno Haible <bruno@clisp.org>
3397 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
3398 implicitly appends .exe to executables.
3399 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
3400 accepts Windows pathnames.
3401 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3402 Cygwin like Windows, since it now accepts Windows pathnames.
3403 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3404 Cygwin like Windows, since it now accepts Windows pathnames.
3405 Reported by Derek Robert Price <derek@ximbiot.com>.
3407 2004-04-20 Jim Meyering <jim@meyering.net>
3409 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
3411 2004-04-20 Jim Meyering <jim@meyering.net>
3412 Bruno Haible <bruno@clisp.org>
3414 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
3415 memory when realloc fails.
3417 2004-04-18 Jim Meyering <jim@meyering.net>
3419 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
3420 don't leak memory and do call END_UTMP_ENT.
3422 2004-04-11 Paul Eggert <eggert@twinsun.com>
3424 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
3425 (CHAR_BIT): Remove, since we assume C89.
3426 Include <stdint.h> if available, as per current Autoconf CVS advice.
3428 2004-03-30 Paul Eggert <eggert@twinsun.com>
3430 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
3431 not bool, to be more consistent with Unix conventions.
3432 Suggested by Bruno Haible.
3434 Merge from coreutils.
3436 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
3439 * getdate.h: Include stdbool.h, and timespec.h instead of
3440 the usual <time.h> dance.
3441 (get_date): Change signature to support fractional time stamps.
3442 All callers changed.
3443 * getdate.y: Include "getdate.h" first, as we can now
3444 assume C89 and don't need to worry about 'const'.
3445 Similarly, include "unlocked-io.h" near start, not in middle.
3447 (textint.value): Use long int rather than int.
3448 (textint.digits): Use size_t rather than int.
3449 (BILLION, LOG10_BILLION): New constants.
3450 (parser_control): New member rel_ns. Members day_ordinal,
3451 time_zone, month, day, hour, minutes, rel_year, rel_month,
3452 rel_day, rel_hour, rel_minutes, rel_seconds
3453 are now long int, not int. Member seconds is now struct timespec,
3454 not int. New member timespec_seen. Members dates_seen, days_seen,
3455 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
3457 (%union.intval): Now long int, not int.
3458 New member timespec.
3459 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
3460 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
3461 (spec): Now is a timespec or an item list.
3462 (timespec, items): New nonterminals.
3463 (time, rel, relunit, number, get_date):
3464 Add support for fractional seconds.
3465 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
3466 (gmtime, localtime, mktime): Remove decls; not needed with C89.
3467 (to_hour): First arg is now long int, not int.
3468 (to_year): Returns long int, not int.
3469 Don't treat year -70 like 70.
3470 (tm_diff): Returns long int, not int.
3471 (lookup_word): Use bool instead of int when appropriate.
3472 (yylex): Use size_t for count, not int.
3473 Detect overflow when parsing large integer constants.
3474 Add support for fractions.
3475 (get_date): Make pointers 'const' if possible.
3476 Use more-portable code to detect integer overflow.
3477 (main) [TEST]: Adjust to above changes. Test for localtime failure.
3478 Don't use ctime; it's not reliable if the year has >4 digits.
3480 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
3481 This is for compatibility with BSD.
3483 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
3484 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
3485 From coreutils' system.h.
3487 * userspec.c: Don't include "posixver.h".
3488 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
3489 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
3490 compatible extension. Simplify code by removing a boolean int
3491 that was always nonzero if a string was nonnull.
3493 2004-03-30 Jim Meyering <jim@meyering.net>
3495 Merge from coreutils.
3497 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
3499 * readtokens.c (readtoken): Don't leak 64 bytes when reading
3500 an empty input stream.
3502 * readtokens.c: Include <stdbool.h>.
3503 (readtoken): Use `size_t' rather than int/long.
3504 All callers adjusted.
3505 Use `bool' rather than `int' where appropriate.
3506 Use memset rather than an explicit loop.
3507 Use x2nrealloc rather than xrealloc.
3508 Allow the use of `\0' as a delimiter.
3509 (readtokens): Likewise.
3510 * readtokens.h (readtoken, readtokens): Update prototypes.
3512 2004-03-30 Bruno Haible <bruno@clisp.org>
3514 * getloadavg.c (getloadavg): Don't assume setlocale returns
3517 2004-03-29 Paul Eggert <eggert@twinsun.com>
3519 Merge changes to getloadavg.c from coreutils and Emacs.
3521 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
3522 Define to an expression, not to the empty string.
3523 Include cloexec.h and xalloc.h.
3524 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
3525 Use set_cloexec_flag rather than rolling our own.
3526 * cloexec.c, cloexec.h: New files.
3528 2004-03-18 Paul Eggert <eggert@twinsun.com>
3530 * getopt.h: Sync with libc CVS.
3532 2004-03-18 Paul Eggert <eggert@twinsun.com>
3533 Bruno Haible <bruno@clisp.org>
3535 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
3536 not on all platforms that have <wchar.h>.
3537 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
3539 2004-03-09 Paul Eggert <eggert@twinsun.com>
3541 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
3543 * getopt_int.h: New file, also synced from libc.
3545 2004-03-07 Paul Eggert <eggert@twinsun.com>
3547 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
3548 '#if' expressions. Unlike the code it replaces, it does not
3549 depend on (defined _SC_PAGESIZE). However, it does depend on
3550 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
3551 first reported by Jason Andrade in
3552 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
3554 2004-01-18 Simon Josefsson <jas@extundo.com>
3556 * strdup.h: New file.
3557 * strdup.c: Include it.
3558 * path-concat.c: Include strdup.h. Drop strdup declaration.
3559 * userspec.c: Include strdup.h. Drop strdup declaration.
3561 2004-02-06 Karl Berry <karl@gnu.org>
3563 * config.charset: update from gettext 0.14.1.
3565 2004-02-05 Paul Eggert <eggert@twinsun.com>
3567 Add comments and code, prompted by suggestions from Bruno Haible
3569 * quotearg.h (quotearg_alloc): New decl. Improve the comments
3570 describing the enum quoting_style values.
3571 * quotearg.c (quotearg_alloc): New function.
3572 (quotearg_buffer_restyled): Treat lone { and } as special.
3573 Treat = as special. Work around bug with older shells
3574 that "see" a '\' that is really the 2nd byte of a multibyte char.
3575 Quote empty string with shell_quoting_style.
3577 2004-02-03 Bruno Haible <bruno@clisp.org>
3579 * pipe.h: New file, from GNU gettext.
3580 * pipe.c: New file, from GNU gettext.
3582 2004-01-27 Bruno Haible <bruno@clisp.org>
3584 * execute.h: New file, from GNU gettext.
3585 * execute.c: New file, from GNU gettext.
3586 * w32spawn.h: New file, from GNU gettext.
3588 2004-01-23 Paul Eggert <eggert@twinsun.com>
3590 Exit-status fix from coreutils.
3592 Use exit_failure consistently in place of EXIT_FAILURE,
3593 so that program exit statuses are consistent on failure.
3595 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
3596 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
3597 * argmatch.h: Comment fix to match the above.
3598 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
3599 Now a macro referring to exit_failure, instead of a separate
3600 variable. Include "exitfail.h" to get it.
3601 * xstrtol.h: Include "exitfail.h".
3602 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
3604 * long-options.c (parse_long_options): Use prototype
3605 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
3608 2004-01-21 Jim Meyering <jim@meyering.net>
3610 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
3611 so as not to conflict with a different-sized __mktime_internal
3612 function in GNU libc.
3613 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
3614 Problem building statically-linked `ls' reported by Michael Brunnbauer.
3616 2004-01-18 Paul Eggert <eggert@twinsun.com>
3618 Merge from diffutils.
3620 * file-type.c (file_type): Add typed memory objects.
3621 * file-type.h (S_TYPEISTMO): New macro.
3623 * c-stack.h (c_stack_action): Remove argv argument.
3624 * c-stack.c (c_stack_action): Likewise. All uses changed.
3625 (die): Don't calculate message unless segv_action returns.
3626 (get_stack_location, min_address_from_argv, max_address_from_argv,
3627 volatile stack_base, volatile_stack_size): Remove.
3628 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
3629 that every segmentation violation is a stack overflow. (Ouch!)
3630 See Debian bug 136249 (still outstanding) for more info about why
3631 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
3633 2003-11-30 Bruno Haible <bruno@clisp.org>
3635 Safer stack allocation.
3636 * setenv.c: Include allocsa.h.
3637 (alloca): Remove fallback definition.
3638 (freea): Remove macro.
3639 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
3642 2003-10-17 Bruno Haible <bruno@clisp.org>
3644 * binary-io.h: Avoid warnings on Cygwin.
3646 2003-12-28 Bruno Haible <bruno@clisp.org>
3648 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
3649 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
3651 2003-11-28 Bruno Haible <bruno@clisp.org>
3653 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
3655 2003-11-27 Bruno Haible <bruno@clisp.org>
3657 * wait-process.c: On Windows, include windows.h. Needed on mingw.
3659 2003-11-17 Bruno Haible <bruno@clisp.org>
3661 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
3663 2003-11-24 Bruno Haible <bruno@clisp.org>
3665 * xallocsa.h: New file, from GNU gettext.
3666 * xallocsa.c: New file, from GNU gettext.
3668 2003-11-24 Bruno Haible <bruno@clisp.org>
3670 * allocsa.h: New file, from GNU gettext.
3671 * allocsa.c: New file, from GNU gettext.
3673 2003-11-24 Bruno Haible <bruno@clisp.org>
3675 * eealloc.h: New file.
3677 2004-01-15 Jim Meyering <jim@meyering.net>
3679 Merge from coreutils.
3681 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
3682 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
3683 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
3685 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
3686 optional configure-time default.
3688 * version-etc.c (version_etc_copyright): Update copyright date.
3690 * xreadlink.c (xreadlink): Correct outdated comment.
3692 2004-01-15 Paul Eggert <eggert@twinsun.com>
3694 Merge from coreutils.
3696 * posixver.c: Include posixver.h.
3698 * same.c: Include <stdbool.h>, <limits.h>.
3699 (_POSIX_NAME_MAX): Define if not defined.
3701 (same_name): If file names are silently truncated, report
3702 that the file names are the same if they are the same after
3703 the silent truncation.
3705 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
3706 conversion function.
3707 * xstrtod.c (xstrtod): Likewise. All callers changed to
3708 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
3711 2004-01-14 Paul Eggert <eggert@twinsun.com>
3713 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
3714 with like-named macro in fnmatch.c.
3715 (EXT): Use an internal constant instead.
3717 Merge fnmatch patches from glibc.
3718 * fnmatch.c (mbsinit): Remove define.
3719 Add libc_hidden_ver (__fnmatch, fnmatch).
3720 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
3721 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
3723 2003-12-14 Karl Berry <karl@gnu.org>
3725 * config.charset: update from gettext-runtime.
3727 2003-12-03 Paul Eggert <eggert@twinsun.com>
3729 * getgroups.c (getgroups): xmalloc takes one argument, not two.
3730 Bug reported by Alfred M. Szmidt.
3732 2003-11-29 Karl Berry <karl@gnu.org>
3734 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
3736 2003-11-23 Paul Eggert <eggert@twinsun.com>
3737 Bruno Haible <bruno@clisp.org>
3739 * printf-parse.h: Don't include sys/types.h.
3740 (ARG_NONE): New macro.
3741 (char_directive): Change type of *arg_index fields to size_t.
3742 * printf-parse.c: Don't include sys/types.h.
3743 (SSIZE_MAX): Remove macro.
3744 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
3745 Remove unnecessary overflow check.
3746 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
3749 2003-11-24 Paul Eggert <eggert@twinsun.com>
3751 * alloca.c: Remove dependency on xalloc module.
3752 (xalloc_die): Remove.
3753 (memory_full) [!defined emacs]: New macro.
3754 [!defined emacs]: Don't include xalloc.h.
3755 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
3756 address arithmetic overflows. Change datatypes a bit to avoid
3759 2003-11-22 Jim Meyering <jim@meyering.net>
3761 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
3763 2003-11-17 Bruno Haible <bruno@clisp.org>
3765 * vasnprintf.c (alloca): Remove fallback definition.
3766 (freea): Remove definition.
3767 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
3768 Reported by Paul Eggert.
3770 2003-11-17 Jim Meyering <jim@meyering.net>
3772 On systems without utime and without a utimes function capable of
3773 dealing with a NULL struct utimbuf* argument, this utime replacement
3774 could -- in unusual circumstances -- leak a file descriptor.
3775 * utime.c: Include <unistd.h> and <errno.h>.
3776 (utime_null): Be sure to close `fd' and to preserve errno.
3777 Reported by Geoff Collyer via Arnold Robbins.
3779 2003-11-16 Paul Eggert <eggert@twinsun.com>
3780 Bruno Haible <bruno@clisp.org>
3782 Protect against address arithmetic overflow.
3783 * printf-args.h: Include stddef.h.
3784 (arguments): Change type of field 'count' to size_t.
3785 * printf-args.c (printf_fetchargs): Use size_t instead of
3786 'unsigned int' where appropriate.
3787 * printf-parse.h: Include sys/types.h.
3788 (char_directive): Change type of *arg_index fields to ssize_t.
3789 (char_directives): Change type of fields 'count', max_*_length to
3791 * printf-parse.c: Include sys/types.h and xsize.h.
3792 (SSIZE_MAX): Define fallback value.
3793 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
3794 instead of 'int' where appropriate. Check a_allocated, d_allocated
3795 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
3796 * vasnprintf.c: Include xsize.h.
3797 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
3798 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
3799 overflow. Avoid wraparound when converting a width or precision from
3802 2003-11-16 Bruno Haible <bruno@clisp.org>
3804 Update from GNU gettext.
3805 * printf-parse.c: Generalize to it can be compiled for wide strings.
3806 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
3807 * vasnprintf.c: Generalize to it can be compiled for wide strings.
3808 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
3809 SNPRINTF): New macros.
3810 Don't include <alloca.h> if the file is used inside libintl.
3811 (local_wcslen): New function, for Solaris 2.5.1.
3812 (VASNPRINTF): Use it instead of wcslen.
3814 2003-11-16 Bruno Haible <bruno@clisp.org>
3816 * xsize.h (xmax): New function.
3817 (xsum, xsum3, xsum4): Declare as "pure" functions.
3819 2003-11-12 Paul Eggert <eggert@twinsun.com>
3821 * xalloc.h: Do not include <limits.h> or <stdint.h>.
3822 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
3823 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
3824 heuristic is just as accurate as far as we know, and it removes a
3825 dependency on size_max.m4 and ptrdiff_max.m4.
3827 2003-11-12 Paul Eggert <eggert@twinsun.com>
3829 * xstrtol.c (__xstrtol): Remove "break" immediately after
3830 "return", to pacify some unknown compiler. Problem reported
3833 2003-11-11 Bruno Haible <bruno@clisp.org>
3835 * xsize.h (SIZE_MAX): Remove fallback definition.
3836 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
3839 2003-11-10 Paul Eggert <eggert@twinsun.com>
3841 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
3842 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
3843 rejected some allocations of exactly SIZE_MAX - 2 bytes.
3845 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
3846 not (size_t) -1, since it's defined here.
3848 2003-11-06 Paul Eggert <eggert@twinsun.com>
3850 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
3851 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
3852 Reject sizes of exactly SIZE_MAX bytes.
3853 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
3854 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
3856 2003-11-05 Bruno Haible <bruno@clisp.org>
3858 * xsize.h: Include limits.h, to avoid a possible collision with
3859 SIZE_MAX defined in <limits.h> on Solaris.
3861 2003-11-04 Bruno Haible <bruno@clisp.org>
3863 * xsize.h: New file.
3864 * linebreak.c: Include xsize.h.
3865 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
3866 argument for overflow.
3867 Suggested by Paul Eggert.
3869 2003-10-31 Bruno Haible <bruno@clisp.org>
3871 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
3872 to avoid (extremely rare) race condition.
3873 Suggested by Paul Eggert.
3875 2003-11-03 Jim Meyering <jim@meyering.net>
3877 * userspec.c: Include "userspec.h".
3878 * userspec.h: New file.
3880 2003-10-31 Paul Eggert <eggert@twinsun.com>
3882 * mountlist.h (struct mount_entry.me_type_malloced): New member.
3883 * mountlist.c (SIZE_MAX): Define if not defined already.
3884 (read_filesystem_list): Set and use me_type_malloced.
3885 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
3886 whatever the type happens to be), for brevity and consistency.
3887 Check for size calculation overflow on Alphas running OSF/1.
3889 2003-10-31 Jim Meyering <jim@meyering.net>
3891 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
3893 * linebuffer.c: Include <string.h> for declaration of memset.
3895 2003-10-30 Paul Eggert <eggert@twinsun.com>
3896 Bruno Haible <bruno@clisp.org>
3898 * vasprintf.c: Include <limits.h>, <stdlib.h>.
3899 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
3901 2003-10-29 Paul Eggert <eggert@twinsun.com>
3903 * xalloc.h (xalloc_oversized): Now a macro, not a function,
3904 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
3906 * quotearg.c (quotearg_n_options): Use it.
3907 * group-member.c: Include <stdbool.h>.
3908 (free_group_info): Arg is now const *; don't free arg.
3909 (get_group_info): Now returns bool and accepts struct group_info *,
3910 rather than returning a malloc'ed struct group_info *.
3911 All uses changed. Check for overflow in internal size calculation.
3913 * getusershell.c (readname): Simplify the code by using x2nrealloc
3914 rather than xmalloc/xrealloc.
3915 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
3916 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
3917 conformance bug: the old code used a pointer after freeing the
3918 storage that it addressed.
3919 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
3920 rather than doing it by hand.
3921 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
3922 the buffer preserved. Use free and xmalloc instead.
3923 * quotearg.c (quotearg_n_options): Likewise.
3924 Use a simpler test for size overflow. Don't use xalloc_oversized
3925 because unsigned int might be wider than size_t (!); this suggests
3926 that we should switch from unsigned int to size_t for slot numbers.
3928 2003-10-27 Bruno Haible <bruno@clisp.org>
3930 * stdbool_.h: Better support for BeOS.
3932 2003-10-27 Paul Eggert <eggert@twinsun.com>
3934 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
3935 to allocate the returned structure. Do not allocate a subarray,
3936 as x2nrealloc will do that.
3937 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
3938 instead of xnrealloc.
3939 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
3941 2003-10-26 Paul Eggert <eggert@twinsun.com>
3943 * xalloc.h (xalloc_oversized): New static inline function, for
3944 callers that want to do their own size-overflow checking. Include
3945 <stdbool.h>, since xalloc_oversized returns bool.
3946 * xalloc.c (array_size_overflow): Remove. All callers changed
3947 to use xalloc_oversized.
3949 Add two functions x2realloc, x2nrealloc, for programs that grow
3950 arrays dynamically by doubling their sizes.
3951 * xalloc.h (x2realloc, x2nrealloc): New decls.
3952 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
3955 Port to C99 semantics for 'inline' of external functions.
3956 Bug reported by Bruno Haible.
3957 * xmalloc.c (xnmalloc_inline): New static inline function,
3958 with the old contents of xnmalloc.
3959 (xnmalloc, xmalloc): Use it.
3960 (xnrealloc_inline): New static inline function,
3961 with the old contents of xnrealloc.
3962 (xnrealloc, xrealloc): Use it.
3964 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
3966 2003-10-25 Paul Eggert <eggert@twinsun.com>
3968 Fix several address-calculation bugs in the hash modules,
3969 plus some minor code cleanup.
3971 * hash.h: Include <stdbool.h>, for bool.
3972 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
3973 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
3974 hash_get_n_entries, hash_get_max_bucket_length,
3975 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
3976 hash_rehash): Use size_t rather than unsigned.
3977 * hash.c (struct hash_table, hash_get_n_buckets,
3978 hash_get_n_buckets_used, hash_get_n_entries,
3979 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
3980 hash_get_entries, hash_do_for_each, hash_string, is_prime,
3981 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
3983 (SIZE_MAX): Define if not defined.
3984 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
3985 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
3987 Use const * when possible.
3988 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
3989 (check_tuning): Fix bug: if tuning parameters were very close to
3990 0 or 1, rounding errors could have caused subscript violations.
3991 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
3992 (hash_initialize): Add 'fail:' label
3993 to free table and return NULL, and use it to simplify code.
3994 Use calloc rather than clearing the storage ourself.
3995 (hash_initialize, hash_rehash): Check for arithmetic overflow in
3996 buffer size calculations.
3997 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
3998 Include <stddef.h>, for size_t.
3999 * hash-pjw.c (hash_pjw): Likewise.
4000 Switch to method described by Bruno Haible.
4001 Include <limits.h>, for CHAR_BIT.
4002 (SIZE_BITS): New macro.
4004 2003-10-21 Paul Eggert <eggert@twinsun.com>
4006 * getndelim2.c (getndelim2): When size calculation overflows,
4007 ceiling the allocation at NMAX bytes rather than silently
4008 discarding input bytes before NMAX is reached. This makes
4009 a difference only if NMAX exceeds SIZE_MAX / 2.
4011 * obstack.c: Merge from glibc.
4012 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
4013 Add libc_hidden_def (_obstack_newchunk).
4014 (_obstack_free) [! defined _LIBC]: Remove.
4015 [defined _LIBC]: Make a strong alias from obstack_free, rather than
4016 a clone of the function body.
4017 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
4018 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
4020 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
4021 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
4024 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
4025 (obstack_ptr_grow_fast, obstack_int_grow_fast):
4026 Don't use lvalue casts, as GCC plans to remove support for them
4027 in GCC 3.5. Reported by Joseph S. Myers. This bug
4028 was also present in the non-GCC version, indicating that this
4029 code had always been buggy and had never been widely used.
4030 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
4031 Use the fast variant of each macro, rather than copying the
4032 definiens of the fast variant; that way, we'll be more likely to
4033 catch future bugs in the fast variants.
4035 2003-10-20 Bruno Haible <bruno@clisp.org>
4037 * wait-process.h: New file, from GNU gettext.
4038 * wait-process.c: New file, from GNU gettext.
4040 2003-10-19 Jim Meyering <jim@meyering.net>
4042 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
4044 2003-10-16 Paul Eggert <eggert@twinsun.com>
4046 * getgroups.c: Include <errno.h>, <stdlib.h>.
4047 (getgroups): First arg is int, not size_t.
4048 Don't let 'free' mangle errno.
4050 2003-10-16 Jim Meyering <jim@meyering.net>
4052 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
4054 2003-10-15 Paul Eggert <eggert@twinsun.com>
4056 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
4058 (new_exclude, add_exclude_file): Initial size no longer needs to
4060 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
4061 our own address arithmetic overflow checking.
4063 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
4064 (fnmatch): Do not alloca more than 2000 wide characters;
4065 instead, use malloc for large buffers.
4066 Check for address arithmetic overflow, and return -1
4067 with errno set to ENOMEM in that case.
4068 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
4069 (NEW_PATTERN): Do not alloca more than 8000 bytes;
4070 instead, return -1. Check for address arithmetic overflow.
4072 2003-10-14 Paul Eggert <eggert@twinsun.com>
4074 Handle invalid suffixes and overflow independently, so that
4075 callers can treat them independently as needed. Fix some bugs in
4076 suffix handling, e.g., "100k@" was not diagnosed as an invalid
4077 suffix for a human-readable blocksize. The major caller-visible
4078 change is the addition of a new
4079 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
4080 that both overflow and suffix chars were found.
4082 * human.c (humblock): Don't check separately for invalid suffix
4083 char; that is xstrtoumax's job (now that its bug is fixed).
4084 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
4085 INTMAX_MAX]: New macros.
4086 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
4087 TYPE_MAXIMUM): New macros.
4088 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
4089 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
4090 if overflow occurs, as it's what __strtol does and it's more useful
4092 (__xstrtol): If __strtol reports some error other than ERANGE,
4093 reflect it to the caller as LONGINT_INVALID. If it reports
4094 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
4095 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
4096 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
4098 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
4099 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
4100 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
4101 [defined UINTMAX_MAX]: New macros.
4103 2003-10-14 Bruno Haible <bruno@clisp.org>
4105 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
4106 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
4107 Also use volatile where needed.
4109 2003-10-12 Paul Eggert <eggert@twinsun.com>
4111 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
4112 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
4113 and define in terms of the other primitives.
4114 * xmalloc.c: Include stdbool.h; do not include exit.h.
4115 (SIZE_MAX): Define if not already defined.
4116 (array_size_overflow): New function.
4117 (xalloc_die): Abort instead of exiting if 'error' returns.
4118 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
4119 (xmalloc, xrealloc): Use them.
4120 (xcalloc): Check for address arithmetic overflow.
4121 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
4122 a bit faster than strcpy.
4124 2003-10-08 Paul Eggert <eggert@twinsun.com>
4126 Merge getpass from libc, plus a few fixes.
4128 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
4129 Include <stdbool.h>.
4130 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
4131 __fsetlocking to empty.
4132 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
4133 do include <bits/libc-lock.h>.
4134 Do not include <fcntl.h>; not needed.
4135 [_LIBC]: Include <wchar.h>.
4136 (NOTCANCEL_MODE): New macro.
4137 (flockfile, funlockfile) [_LIBC]: New macros.
4138 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
4139 [!_LIBC]: New macros.
4140 (call_fclose): New function.
4141 (getpass): Use it. Save tty stream separately; this simplifies the
4142 code and makes it more reliable if stdin happens to equal stdout.
4143 Invoke __fsetlocking on tty.
4144 Handle thread cancellation if needed.
4145 Namespace cleanup (use __tcgetattr, __getline).
4146 Use bool for Booleans.
4147 [USE_IN_LIBIO]: Handle wide streams.
4148 [!_LIBC]: Unconditionally do the fseek, since we don't know what
4149 stream might go where.
4151 * unlocked-io.h: Include <stdio.h>, so that the caller
4152 doesn't have to include <stdio.h> before us.
4153 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4154 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4155 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4156 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4157 if not declared, so that we can use getpass.c code from libc without
4159 (flockfile, ftrylockfile, funlockfile): New macros.
4161 2003-10-06 Bruno Haible <bruno@clisp.org>
4163 * version-etc-2.h: Remove file.
4164 * version-etc-2.c: Remove file.
4166 2003-09-25 Jim Meyering <jim@meyering.net>
4167 Bruno Haible <bruno@clisp.org>
4169 This lets translators provide better translations for the
4170 "Written by ..." part of --version output.
4171 * version-etc.h: Include stdarg.h.
4172 (version_etc_copyright): Declare as readonly.
4173 (version_etc): Make this function variadic with a NULL-terminated list
4174 of author name strings.
4175 (version_etc_va): New declaration.
4176 * version-etc.c: Include stdarg.h, stdlib.h.
4177 (version_etc_copyright): Declare as readonly.
4178 (version_etc_va): New function. Provide a different translatable string
4179 for each possible number of authors < 10. Abbreviate when there are 10
4181 (version_etc): Make this function variadic. Call version_etc_va.
4182 Suggestion from Gary V. Vaughan.
4184 * long-options.h (parse_long_options): Change prototype: the authors
4185 string is moved to the end and becomes variadic.
4186 * long-options.c: Include stdarg.h.
4187 (parse_long_options): Make this function variadic, too.
4188 Call version_etc_va, not version_etc.
4190 2003-10-06 Bruno Haible <bruno@clisp.org>
4192 * fatal-signal.h: New file, from GNU gettext.
4193 * fatal-signal.c: New file, from GNU gettext.
4195 2003-10-04 Karl Berry <karl@gnu.org>
4197 * argp*: update from libc.
4199 2003-10-01 Larry Jones <lawrence.jones@eds.com>
4201 * getpass.c (getpass): Use a no-op fseek when switching from input to
4202 output mode on the same stream.
4204 2003-09-29 Paul Eggert <eggert@twinsun.com>
4206 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4207 Fix arg typo in previous patch.
4209 2003-09-28 Jim Meyering <jim@meyering.net>
4211 * error.c: Correct cpp indentation.
4213 2003-09-27 Paul Eggert <eggert@twinsun.com>
4215 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
4216 Omit the special code that used __typeof__, since we worry that
4217 it could be more trouble than it's worth. See:
4218 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
4219 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
4223 2003-09-26 Jim Meyering <jim@meyering.net>
4225 * error.c (error_tail): Move some declarations
4226 into inner scope where the local variables are used.
4228 2003-09-26 Bruno Haible <bruno@clisp.org>
4230 * stpncpy.h (gnu_stpncpy): New declaration.
4231 (stpncpy): Define as alias for gnu_stpncpy.
4232 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
4234 2003-09-26 Paul Eggert <eggert@twinsun.com>
4236 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
4237 (error_tail): Do not loop, reallocating temporary buffer, since
4238 the output cannot contain more wide characters than the input
4239 contains bytes, the size must be big enough already. This avoids
4240 one potential size overflow calculation. Check for size overflow
4241 when calculating temporary buffer size. Free temporary buffer
4242 when done, if it was allocated with malloc; this plugs a memory
4243 leak. Remove casts from void * to pointers, that are no longer
4244 needed now that we're assuming C89 or better.
4246 Merge error changes from glibc.
4248 * error.c, error.h: Update copyright notice header to match glibc.
4249 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
4250 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
4251 Disable cancellation while printing error.
4252 * error.h: Prepend __ to parameter names.
4254 2003-09-25 Karl Berry <karl@gnu.org>
4256 * argp-fmtstream.c, argp-help.c: update from libc.
4258 2003-09-25 Bruno Haible <bruno@clisp.org>
4260 * version-etc-2.h: New file, from version-etc.h with modifications.
4261 * version-etc-2.c: New file, from version-etc.c with modifications.
4263 2003-09-25 Simon Josefsson <jas@extundo.com>
4265 * xgetdomainname.h: New file.
4266 * xgetdomainname.c: New file.
4268 2003-09-25 Simon Josefsson <jas@extundo.com>
4269 Bruno Haible <bruno@clisp.org>
4271 * getdomainname.h: New file.
4272 * getdomainname.c: New file.
4274 2003-09-24 Paul Eggert <eggert@twinsun.com>
4276 * linebuffer.c (freebuffer): Don't free the argument, just
4277 the buffer associated with the argument. Bug reported by
4280 2003-09-19 Karl Berry <karl@gnu.org>
4282 * argp.h: update from libc.
4284 2003-09-16 Paul Eggert <eggert@twinsun.com>
4286 * linebuffer.c (readlinebuffer): Return NULL immediately upon
4287 input error, instead of returning NULL the next time we are called
4288 (and therefore losing track of errno).
4290 2003-09-15 Paul Eggert <eggert@twinsun.com>
4292 * getndelim2.c (getndelim2): Don't trash errno when a read
4293 fails, so that the caller gets the proper errno.
4295 * readutmp.c (read_utmp): Likewise.
4296 Check for fstat error. Close stream and free storage
4299 2003-09-14 Bruno Haible <bruno@clisp.org>
4301 * fwriteerror.h: New file.
4302 * fwriteerror.c: New file.
4304 2003-09-14 Jim Meyering <jim@meyering.net>
4306 * getloadavg.c: Correct cpp indentation.
4307 * strdup.c: Likewise.
4308 * vasnprintf.c: Likewise.
4310 2003-09-12 Paul Eggert <eggert@twinsun.com>
4312 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
4313 * obstack.c [!defined _LIBC]: Likewise.
4314 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4315 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4316 * exitfail.c: Don't include stdlib.h; no longer needed.
4318 More changes to assume C89 or better.
4320 * error.c (error_tail): Assume vprintf.
4322 * argmatch.c (getenv): Remove decl.
4323 * progreloc.c (get_full_program_name): Define via prototype.
4324 * setenv.c (clearenv): Likewise.
4325 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
4327 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
4328 (malloc, memcpy): Remove decls.
4329 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
4330 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
4331 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4332 (memcpy): Remove macro.
4333 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
4334 (__P): Remove. All uses removed.
4335 (PTR): Remove. All uses changed to void *.
4336 (CHAR_BIT, NULL): Remove.
4337 (spaces, zeros, memset_space, memset_zero)
4338 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
4340 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
4341 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
4342 Define with prototype.
4343 Remove now-unnecessary prototype decl.
4344 (extra_args_spec): Assume ANSI C. All uses changed.
4345 (extra_args_spec_iso): Remove.
4346 (my_strftime, emacs_strftimeu): Define via prototype.
4347 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
4349 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
4350 * strtoimax.c: Include <stdlib.h> unconditionally.
4351 (strtoul, strtol): Remove decls.
4352 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
4354 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4355 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
4356 (LOCALE_PARAM_PROTO): New macro.
4357 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
4358 (INTERNAL (strtol), strtol): Define with a prototype.
4359 (PARAMS): Remove. All uses removed.
4360 * tempname.c: Include <string.h> unconditionally.
4361 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
4362 * xgethostname.c (main): Define with a prototype.
4363 * xmalloc.c: Include "xalloc.h" first, to check interface.
4364 Include <stdlib.h> unconditionally.
4365 (calloc, malloc, realloc, free): Remove decls.
4366 * xstrtod.c: Include "xstrtod.h" first, to check interface.
4367 Include <stdlib.h> unconditionally. Sort include file names.
4369 (xstrtod): Define with a prototype.
4370 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
4371 (strtol, strtoul): Remove decls.
4373 2003-09-11 Paul Eggert <eggert@twinsun.com>
4375 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
4376 Include <stdlib.h>, <string.h> unconditionally.
4377 Remove now-unnecessary cast to char *.
4378 * strnlen.c: Include <string.h> unconditionally.
4379 * yesno.c (yesno): Define with a prototype.
4381 2003-09-10 Bruno Haible <bruno@clisp.org>
4383 * strcspn.c: Include <string.h> unconditionally.
4384 * strpbrk.c: Include <string.h> unconditionally.
4385 * strstr.c: Include <string.h> unconditionally.
4386 * unicodeio.c: Include <string.h> unconditionally.
4387 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
4388 * unsetenv.c: Likewise.
4389 * xreadlink.c: Include <stdlib.h> unconditionally.
4390 * yesno.c: Include <stdlib.h> unconditionally.
4391 (rpmatch): Add prototype.
4393 2003-09-10 Jim Meyering <jim@meyering.net>
4395 * error.c: Correct indentation of cpp directives.
4397 2003-09-09 Paul Eggert <eggert@twinsun.com>
4401 * acosl.c (main): Use a prototype.
4402 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
4405 * getloadavg.c (getloadavg, main): Define via prototypes.
4407 * getopt.h (struct option.name): Assume C89, and use 'const'.
4408 (getopt, etopt_long, getopt_long_only, _getopt_internal)
4409 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
4411 * getopt.c (const): Remove macro.
4412 Include <string.h> unconditionally.
4413 (my_index): Remove; all uses changed to strchr.
4414 (strlen): Remove decl.
4415 (exchange): Remove forward decl; no longer needed.
4416 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
4417 Define with prototype.
4418 * getopt1.c (const): Remove macro.
4419 (getopt_long, getopt_long_only, main): Define with prototype.
4421 * getugroups.c: Include <string.h> unconditionally.
4423 * getusershell.c: Include <stdlib.h> unconditionally.
4424 (getusershell, setusershell, endusershell, readname, main):
4425 Define with prototypes.
4427 * group-member.c: Include group-member.h first.
4428 Include <stdlib.h> unconditionally.
4430 * hard-locale.c: Include hard-locale.h first.
4431 Include <stdlib.h>, <string.h> unconditionally.
4433 * hash.c (free, malloc): Remove decls.
4434 Include <stdlib.h> unconditionally.
4436 * human.c: Include <stdlib.h>, <string.h> unconditionally.
4437 (getenv): Do not declare.
4439 * idcache.c: Include <string.h> unconditionally.
4441 * long-options.c: Include long-options.h first, to test interface.
4442 Include <stdlib.h> unconditionally.
4444 * makepath.c: Include makepath.h first, to test interface.
4445 Include <stdlib.h> and <string.h> unconditionally.
4447 * linebuffer.c: Include <stdlib.h>.
4448 (free): Remove decl.
4450 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
4451 rpl_malloc returns void *, not char *.
4452 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
4454 * md5.h: Include <limits.h> unconditionally.
4455 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
4456 (__P): Remove; all uses removed.
4457 * md5.c: Include "md5.h" first.
4458 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
4459 md5_buffer, md5_process_bytes, md5_process_block):
4460 Define with prototypes.
4461 * sha.h (__P): Remove all uses. (It wasn't defined??)
4462 * sha.c: Include "sha.h" first.
4463 Include <stdlib.h>, <string.h> unconditionally.
4465 * memchr.c (__ptr_t): Remove; all uses changed to void *.
4466 * memcmp.c (__ptr_t): Likewise.
4467 * memrchr.c (__ptr_t): Likewise.
4468 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
4469 Include <string.h> unconditionally.
4470 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
4471 * memchr.c: Include <stdlib.h> unconditionally.
4472 * memchr.c (LONG_MAX): Remove.
4473 * memrchr.c (LONG_MAX): Likewise.
4474 * memchr.c (__memchr): Define via a prototype.
4475 * memrchr.c (__memrchr): Likewise.
4476 * memcmp.c (__P): Remove, and remove all uses.
4477 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
4478 Remove forward decls; no longer needed.
4479 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
4480 Use types required by C89 in prototype.
4482 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
4483 * savedir.c: Likewise.
4484 * mkdir.c (free): Remove decl.
4485 * rmdir.c (rmdir): Define with a prototype.
4486 * savedir.c: Include savedir.h first, to test interface.
4488 * mktime.c (STDC_HEADERS): Remove.
4489 Include <stdlib.h>, <string.h> unconditionally.
4491 * modechange.c: Include <stdlib.h> unconditionally.
4492 (malloc): Remove decl.
4494 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
4495 (free): Remove decl.
4497 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
4498 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
4499 (This type really should be intptr_t, but that's a C99ism.)
4500 (_obstack_memcpy): Remove: all uses changed to memcpy.
4501 Include <string.h> unconditionally.
4502 (struct obstack): Assume __STDC__ for types of members
4503 chunkfun, freefun, extra_arg.
4504 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
4505 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
4506 obstack_begin, obstack_specify_allocation,
4507 obstack_specify_allocation_with_arg, obstack_chunkfun,
4508 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
4509 Remove unprototyped decls and the macros that use them.
4510 * obstack.c (POINTER): Remove. All uses changed to void *.
4511 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
4512 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
4513 (defined __STDC__ && __STDC__)]:
4514 Remove nonprototyped code.
4515 Include <stdlib.h> unconditionally.
4516 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
4517 _obstack_allocated_p, _obstack_free, obstack_free,
4518 _obstack_memory_used, print_and_abort):
4519 Define using prototypes.
4520 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
4521 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
4522 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
4523 obstack_next_free, obstack_object_size, obstack_room) [0]:
4524 Remove unused, unprototyped code.
4526 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
4528 * physmem.c (physmem_total, physmem_available, main): Define
4531 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
4532 (main): Define with a prototype.
4534 * posixver.c (getenv): Remove decl.
4536 * putenv.c (malloc): Returns void *, not char *.
4537 Include <string.h> unconditionally.
4538 (strchr, memcpy, NULL): Do not define.
4540 * readtokens.c: Include readtokens.h first, to test interface.
4541 Include <stdlib.h>, <string.h> unconditionally.
4542 (init_tokenbuffer): Define with a prototype.
4544 * regex.c (PARAMS): Remove. All uses removed.
4545 All uses of _RE_ARGS removed, too.
4546 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4548 (bzero): Assume memset exists.
4549 (memcmp, memcpy, NULL): Remove.
4550 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
4551 char, or assignments to local vars of type signed char.
4552 (init_syntax_once, PREFIX(extract_number_and_incr),
4553 PREFIX(print_partial_compiled_pattern),
4554 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
4555 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
4556 PREFIX(regex_grow_registers), PREFIX(regex_compile),
4557 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
4558 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
4559 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
4560 wcs_compile_range, byte_compile_range, truncate_wchar,
4561 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
4562 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
4563 count_mbs_length, wcs_re_match_2_internal,
4564 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
4565 PREFIX(alt_match_null_string_p),
4566 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
4567 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
4568 regfree, PREFIX(extract_number)): Define with prototype. Remove
4569 now-unnecessary declaration, if any.
4570 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
4572 Remove now-unnecessary casts among pointer types.
4573 * regex.h (_RE_ARGS): Remove. All uses removed.
4575 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
4576 (free): Remove decl.
4578 * rpmatch.c: Include <stdlib.h> unconditionally.
4580 * same.c: Include <stdlib.h>, <string.h> unconditionally.
4581 (free): Remove decl.
4583 * save-cwd.c: Include <stdlib.h> unconditionally.
4584 * xgetcwd.c: Likewise.
4586 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
4587 (free): Remove decl.
4589 * strchrnul.c (strchrnul): Define with a prototype.
4590 Fix bug: c_in was not converted to char before searching.
4592 The following changes are not K&R related:
4594 * group-member.h: Include <sys/types.h>, so that this file is
4596 * makepath.h: Likewise.
4598 * getusershell.c (readname, default_index, line_size, readname):
4599 Use size_t, not int, for sizes.
4600 (readname): If the size overflows, report an error instead of
4603 2003-09-09 Derek Robert Price <derek@ximbiot.com>
4605 * getndelim2.c: Assume stdlib.h per the C89 spec.
4607 2003-09-08 Paul Eggert <eggert@twinsun.com>
4609 Assume C89 or better; remove K&R cruft.
4610 A few of these changes were first proposed by Derek Robert Price
4611 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
4613 * addext.c: Include <string.h> unconditionally.
4614 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
4615 Don't declare getenv or malloc.
4617 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
4618 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
4620 (find_stack_direction, alloca): Use prototypes.
4622 * atexit.c (atexit): Define using a prototype.
4624 * basename.c, dirname.c, stripslash.c:
4625 Include <string.h> unconditionally.
4627 * bcopy.c: Include <stddef.h>.
4628 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
4630 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
4632 * error.h (error, error_at_line, error_print_progname)
4633 [! (defined (__STDC__) && __STDC__)]: Remove decls.
4634 * error.c: Include error.h first, to check interface.
4635 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4636 (VA_START): Remove; all uses changeed to va_start.
4637 (exit, strerror): Remove decls.
4638 (error_print_progname): Prototype uncondionally.
4639 Don't include <errno.h>; no longer needed.
4640 (private_strerror): Remove.
4641 (error_tail): Always define.
4642 (error, error_at_line): Assume C89 or better; always use prototypes.
4643 * fatal.c: Include "fatal.h" first, to test interface.
4644 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4645 (VA_START): Remove; all uses changed to va_start.
4646 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
4648 (exit): Remove decl.
4649 (fatal): Prototype unconditionally. Assume va_start works.
4650 Abort at end, to pacify gcc.
4652 * euidaccess.c (main): Define with a prototype.
4654 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
4656 * exitfail.c: Include <stdlib.h> unconditionally.
4658 * fnmatch_.h (__P): Remove. All uses changed to assume
4660 * fnmatch.c: Include fnmatch.h first, to test interface.
4661 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
4662 (getenv): Remove decl.
4663 (fnmatch): Define using a prototype.
4664 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
4665 (FCT): Define using a prototype.
4667 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
4669 * gethostname.c: Include <stddef.h>.
4670 (gethostname): Define with prototype. Length is size_t, not int.
4672 2003-09-08 Paul Eggert <eggert@twinsun.com>
4674 * getversion.c: Remove; was migrated to backupfile.c in 1997.
4675 getversion.c should have been removed then, but was accidentally
4678 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
4679 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
4681 2003-09-07 Paul Eggert <eggert@twinsun.com>
4683 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
4684 copy_tm_result. Bug reported by Simon Josefsson in
4685 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
4687 2003-09-06 Paul Eggert <eggert@twinsun.com>
4689 * time_r.c, time_r.h: New files.
4691 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
4693 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
4694 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
4696 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
4698 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
4699 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
4702 * timegm.c: Switch to glibc implementation, with the following changes:
4703 [defined HAVE_CONFIG_H]: Include <config.h>.
4704 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
4705 (__mktime_internal) [!defined _LIBC]: New decl.
4706 (__gmtime_r) [!defined _LIBC]: New macro and function.
4707 (timegm): Use a prototype, since gnulib assumes C89.
4708 Do not bother declaring tmp to be const, as it's not really usefu.
4709 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
4710 (timegm): Declare only if HAVE_DECL_TIMEGM.
4712 2003-09-03 Paul Eggert <eggert@twinsun.com>
4714 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
4715 Bug reported by Lute Kamstra in
4716 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
4718 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
4719 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
4720 course with correspondingly smaller numbers for tomorrow and
4721 yesterday. From Tadayoshi Funaba. Originally installed into
4722 sh-utils on 1999-08-07, but the patch got lost (I guess during the
4725 2003-08-31 Simon Josefsson <jas@extundo.com>
4727 * timegm.h: New file.
4728 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
4730 2003-08-31 Karl Berry <karl@gnu.org>
4732 * argp.h: update from libc.
4734 2003-08-28 Bruno Haible <bruno@clisp.org>
4736 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
4737 warning on QNX, which defines O_BINARY to 000000.
4739 2003-08-24 Bruno Haible <bruno@clisp.org>
4741 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
4742 MSVC7 <stdio.h> is included later.
4744 2003-08-20 Bruno Haible <bruno@clisp.org>
4746 * progname.h: New file, from GNU gettext.
4747 * progname.c: New file, from GNU gettext.
4748 * progreloc.c: New file, from GNU gettext.
4750 2003-08-19 Bruno Haible <bruno@clisp.org>
4752 * xstrdup.c: Assume <string.h> exists.
4754 2003-08-18 Jim Meyering <jim@meyering.net>
4756 * setenv.h: Indent nested cpp directive.
4757 * vasnprintf.c: Remove trailing blanks.
4759 2003-08-17 Simon Josefsson <jas@extundo.com>
4760 Bruno Haible <bruno@clisp.org>
4762 * xstrndup.h: New file.
4763 * xstrndup.c: New file.
4765 2003-08-17 Bruno Haible <bruno@clisp.org>
4767 * strndup.h: New file.
4769 2003-08-16 Paul Eggert <eggert@twinsun.com>
4771 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
4772 space, undoing this 2003-08-12 change:
4773 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
4775 2003-08-16 Jim Meyering <jim@meyering.net>
4777 Merge from coreutils.
4778 * xstrtoimax.c: #else #if -> #elif.
4779 * xstrtoumax.c: Likewise.
4781 2003-08-15 Paul Eggert <eggert@twinsun.com>
4783 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
4784 rather than tab, after '#' in shell-script copyright notices.
4785 Suggested by Bruno Haible.
4787 2003-08-15 Jim Meyering <jim@meyering.net>
4788 and Paul Eggert <eggert@twinsun.com>
4790 Merge from coreutils.
4791 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
4792 member but strut utmpx does not. Needed for AIX 4.3.3.
4793 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
4795 2003-08-15 Jim Meyering <jim@meyering.net>
4797 Merge from coreutils.
4798 * xgethostname.c: Include <stdlib.h>.
4799 (xghostname): Don't exit for anything other than memory-related
4800 failure; just return NULL.
4801 * userspec.c: Include "posixver.h".
4802 (parse_user_spec): Accept `.' as a separator only
4803 in pre-POSIX-200112 mode.
4804 * strtoimax.c: Use #elif rather than #else #if.
4805 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
4806 Remove function, now that we can rely on a working tzset function.
4807 [!_LIBC]: Ensure that the required autoconf test has been run.
4808 [!defined _NL_CURRENT && HAVE_STRFTIME]:
4809 Use underlying_strftime for %r.
4810 * sha.c: Merge in some clean-up and optimization changes from glibc.
4811 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
4812 Ensure that it is a multiple of 64.
4813 Rearrange loop exit tests so as to avoid performing an
4814 additional fread after encountering an error or EOF.
4815 * realloc.c: Update copyright date.
4817 2003-08-14 Jim Meyering <jim@meyering.net>
4819 Merge from coreutils.
4820 * obstack.h: Whitespace changes.
4821 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
4822 and xcalloc return values.
4823 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
4824 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
4825 hang on OSF/1 5.1 for DIR on both local and remote file systems.
4826 Reported by (and fix confirmed by) Nelson H. F. Beebe.
4827 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4829 Use mntctl's return value to drive the entry-processing loop, since
4830 we can't rely on the value of the vmt_length member in the last
4831 entry. On some systems doing so could result in exhausting
4832 virtual memory. Based in part on a patch from Mike Jetzer.
4834 2003-08-14 Jim Meyering <jim@meyering.net>
4835 and Paul Eggert <eggert@twinsun.com>
4837 Merges from coreutils, plus other fixes.
4838 * physmem.c: Merge in portability changes from gcc/libiberty
4839 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
4840 for credits and details. Thanks to Kaveh Ghazi for helping
4841 to keep these files in sync.
4842 (ARRAY_SIZE): Define it.
4843 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
4844 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
4845 (memcasecmp): Don't assume size_t fits in unsigned int.
4846 Remove casts and duplicate code.
4847 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
4848 (memcpy): Remove definition.
4849 Merge in some clean-up and optimization changes from glibc.
4850 [BLOCKSIZE]: Move definition to top of file.
4851 Ensure that it is a multiple of 64.
4852 Rearrange loop exit tests so as to avoid performing an
4853 additional fread after encountering an error or EOF.
4854 * md5.h (md5_uintptr): Define.
4855 * makepath.c (CLEANUP_CWD): Report an error if we failed to
4856 return to the initial working directory. Preserve errno
4858 * idcache.c: Include "xalloc.h".
4859 (xmalloc, xrealloc): Remove decls.
4860 (getuser): Remove casts no longer required in C89.
4861 * human.c: Include stdio.h, for sprintf.
4862 * group-member.c: Include "xalloc.h".
4863 (xmalloc, xrealloc): Remove decls.
4864 (get_group_info): Remove casts no longer required in C89.
4865 * getusershell.c (readname): Remove casts no longer required in C89.
4866 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
4867 * getline.c: Whitespace fix, from coreutils.
4869 2003-08-13 Paul Eggert <eggert@twinsun.com>
4871 * exclude.c: Include <ctype.h>
4872 (IN_CTYPE_DOMAIN): New macro.
4874 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
4877 * argp-help.c, argp-parse.c, config.charset, getopt.h:
4878 Undo previous (whitespace-only) change.
4880 2003-08-12 Paul Eggert <eggert@twinsun.com>
4882 * argp-help.c, argp-parse.c, config.charset, getopt.h:
4883 Normalize leading white space and remove trailing white space.
4884 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
4885 notice, as per ../config/srclist-update.
4887 Merge from coreutils.
4888 * euidaccess.h: New file.
4889 * euidaccess.c: Include it.
4890 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
4891 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
4892 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
4894 2003-08-11 Bruno Haible <bruno@clisp.org>
4896 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
4897 (vasnprintf): Use it instead of wcslen.
4899 2003-08-11 Bruno Haible <bruno@clisp.org>
4901 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
4902 value to ensure that _Bool promotes to int. Use #define for _Bool when
4903 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
4905 2003-08-10 Karl Berry <karl@gnu.org>
4907 * regex.h: update from libc (whitespace fix).
4909 2003-08-09 Paul Eggert <eggert@twinsun.com>
4911 Merge some files from coreutils. These changes were
4912 originally made by Jim Meyering.
4913 * acl.c: Include <sys/types.h> before <sys/stat.h>;
4914 many older Unixes require this.
4915 * alloca.c (alloca): Remove cast to argument of free;
4916 no longer needed in C89.
4917 * alloca_.h, regex.h: Fix white space to match
4918 what GNU indent does.
4920 2003-08-05 Paul Eggert <eggert@twinsun.com>
4922 * bumpalloc.h: Remove.
4924 2003-08-04 Paul Eggert <eggert@twinsun.com>
4926 * getloadavg.c: Change copyright notice and spacing to conform to
4929 Merge from coreutils.
4930 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
4932 * getdate.y (date): Also accept dates like May-23-2003; suggestion
4933 from Karl Berry, implemented by Jim Meyering.
4934 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
4935 from Dmitry V. Levin.
4936 Remove anachronistic cast of xrealloc.
4937 * fnmatch_.h (__const): Remove. Use 'const'.
4938 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
4939 type. Otherwise, it wouldn't compile with at least /bin/cc on
4940 ymp-cray-unicos9.0.2.X.
4941 Combine two mostly-identical uses of alloca into one.
4942 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
4944 2003-08-04 Dave Love <d.love@dl.ac.uk>
4948 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
4949 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
4950 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
4951 obsolete NLIST_NAME_UNION.
4952 [__GNU__]: Undef BSD and FSCALE.
4953 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
4955 2003-08-03 Paul Eggert <eggert@twinsun.com>
4957 * stdbool_.h (_Bool): Make it signed char, instead of
4958 an enum type, so that it's guaranteed to promote to int. See:
4959 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
4961 2003-07-31 Paul Eggert <eggert@twinsun.com>
4963 * strerror.c: Include config.h, limits.h. Declare sprintf.
4964 (strerror): Don't assume that a printable int fits in 14 bytes.
4966 2003-07-24 Derek Robert Price <derek@ximbiot.com>
4967 Bruno Haible <bruno@clisp.org>
4969 * getline.h (getline, getdelim): Change return type to ssize_t.
4970 * getline.c (getline, getdelim): Likewise.
4971 Remove _GNU_SOURCE define; now it's defined in config.h through
4974 2003-07-22 Paul Eggert <eggert@twinsun.com>
4976 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
4977 over-parenthesization in macros.
4979 Sync with coreutils.
4981 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
4984 Use `exit_failure' for xalloc and xmemcoll instead of their own
4985 private exit-failure variables.
4986 * xalloc.h (xalloc_exit_failure): Remove.
4987 * xmalloc.c: Likewise. Include exitfail.h.
4988 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
4989 * xmemcoll.h (xmemcoll_exit_failure): Remove.
4990 * xmemcoll.c: Likewise. Include exitfail.h.
4991 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
4993 2003-07-18 Paul Eggert <eggert@twinsun.com>
4995 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
4996 * closeout.c: Likewise. Include "closeout.h" right after config.h,
4997 to test that it can stand by itself. Include "exitfail.h".
4998 Clients should set exit_failure instead.
4999 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
5001 2003-07-18 Andreas Schwab <schwab@suse.de>
5003 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
5005 2003-07-18 Bruno Haible <bruno@clisp.org>
5007 * getndelim2.h: New file.
5008 * getndelim2.c: Make into a module of its own. Include config.h,
5010 (getndelim2): Make non-static. Change return type to ssize_t.
5011 * getline.h: Change argument names.
5012 * getline.c: Include getndelim2.h instead of getndelim2.c.
5013 * getnline.c: Include getndelim2.h.
5015 2003-07-17 Bruno Haible <bruno@clisp.org>
5017 * Makefile.am: Remove file.
5018 * Makefile.in: Remove file.
5020 2003-07-17 Bruno Haible <bruno@clisp.org>
5022 * getnline.h: New file.
5023 * getnline.c: New file.
5024 * getndelim2.c: New file, extracted from getline.c.
5025 (getndelim2): Renamed from getdelim2, with added nmax argument.
5026 * getline.c: Include getndelim2.c.
5027 (getdelim2): Moved out to getndelim2.c.
5028 (getline, getdelim): Update.
5030 2003-07-15 <karl@gnu.org>
5032 * vasnprintf.c: update from gettext.
5034 2003-07-15 Jim Meyering <jim@meyering.net>
5036 * makepath.c (make_path): Enclose diagnostic in _(...).
5038 2003-07-14 Paul Eggert <eggert@twinsun.com>
5040 * asnprintf.c, asprintf.c, config.charset, gettext.h,
5041 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
5042 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
5043 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
5044 vasprintf.c, vasprintf.h: Regenerate. These files are now being
5045 updated automatically by ../config/srclist-update. This changes
5046 their license from LPGL to GPL.
5048 2003-07-14 Jim Meyering <jim@meyering.net>
5050 Don't emit diagnostics. Let callers do that.
5051 * save-cwd.c: Don't include "error.h".
5052 (save_cwd): Don't call error. Ensure that errno is valid
5053 when returning nonzero.
5055 * save-cwd.h (restore_cwd): Update prototype.
5056 * save-cwd.c (restore_cwd): Remove two parameters.
5057 Simplify. Don't call error upon failure. Let callers do that.
5058 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
5059 when auditing is enabled. But don't bother updating the #if.
5061 2003-07-14 Simon Josefsson <jas@extundo.com>
5063 * mempcpy.h: New file.
5064 * mempcpy.c: New file.
5066 2003-07-14 Paul Eggert <eggert@twinsun.com>
5068 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
5069 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
5070 unicodeio.c, unicodeio.h, unlocked-io.h:
5071 Switch from LGPL to GPL.
5073 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
5075 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
5076 it breaks C++ compilation.
5077 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
5079 2003-07-10 Jim Meyering <jim@meyering.net>
5081 * vasnprintf.c: Remove trailing blanks.
5082 Make cpp indentation consistent.
5084 2003-07-09 Paul Eggert <eggert@twinsun.com>
5086 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
5087 posixver.c, strftime.c, strnlen.c, strverscmp.c:
5088 Switch from LGPL to GPL.
5090 2003-07-07 Paul Eggert <eggert@twinsun.com>
5092 * mktime.c: Fix some boundary cases and remove need for floating point.
5094 Issue a compile-time diagnostic if time_t is floating point, or if
5095 two's complement arithmetic is not in effect, or if arithmetic
5096 right shift does not propagate the sign. These assumptions were
5097 all in the original code but they weren't checked.
5099 (TIME_T_MIDPOINT, verify): New macros.
5100 (__isleap): Remove; it has integer overflow problems.
5101 (leapyear): New function, without those problems.
5102 (ydhms_tm_diff): Remove; splitting into two parts.
5103 (ydhms_diff): New function, containing the arithmetic part of
5104 the old ydhms_tm_diff function. Issue a compile-time
5105 diagnostic if we are not using C99 integer division.
5106 Avoid casts when possible.
5107 (guess_time_tm): New function, containing the checking part of
5108 the old ydhms_tm_diff function. Return the new value, rather than
5109 the difference between it and the old. Accept a new argument T
5110 so that *T specifies the old value. Check for overflow in the result.
5112 (__mktime_internal): Use a time_t offset, not a long int offset.
5113 This undoes the 2003-06-04 change, which is no longer needed now
5114 that we have better overflow checking.
5115 (localtime_offset): Likewise.
5117 (__mktime_internal): Avoid harmful overflow on hosts where time_t
5118 and long are 64-bit but int is only 32-bit.
5119 (ydhms_diff): Use long int to store year1 and yday1.
5120 Issue a compile-time diagnostic if long int is not wide enough.
5122 (__mktime_internal): Use long int to store adjusted year and yday.
5123 Use plain C rather than preprocessor commands, if that doesn't
5125 Check for overflow (and try to repair) after each probe
5126 rather than checking only at the very end. This avoids some bugs
5127 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
5128 does not equal GMT offset at maximum time).
5129 Use integer to check for overflow rather than floating point; this
5130 is more portable to non-IEEE hosts, and is a tad faster.
5131 When we detect that we are oscillating between two values,
5132 don't check whether tm_isdst has the requested value, since
5133 we already know the answer. When tm_isdst has the wrong value,
5134 use a different heuristic to find the right one, based on the
5135 extreme values actually observed in practice in tz2003a,
5136 rather than the (overly optimistic) "previous 3 calendar quarters".
5138 (not_equal_tm, print_tm, check_result): Use "const T" rather than
5139 "T const" to accommodate glibc style.
5140 (check_result): Use less-confusing report format. "long" -> "long int.
5142 Don't loop if the iteration overflows time_t.
5143 Allow a negative step in the iteration.
5145 2003-07-01 Paul Eggert <eggert@twinsun.com>
5147 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5148 having it depend on HAVE_SYS_TYPES_H.
5150 2003-06-25 Bruno Haible <bruno@clisp.org>
5152 * readlink.c: New file.
5154 2003-06-20 Bruno Haible <bruno@clisp.org>
5156 Assume C89, so PARAMS isn't needed.
5157 * unicodeio.h (PARAMS): Remove.
5158 * unicodeio.c: Don't use PARAMS.
5160 2003-06-18 Jim Meyering <jim@meyering.net>
5162 Merge changes from coreutils.
5163 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5164 Remove explicit declarations of xmalloc and realloc.
5166 (read_utmp): Remove anachronistic cast of xmalloc.
5168 2003-06-17 Paul Eggert <eggert@twinsun.com>
5170 Assume C89, so PARAMS isn't needed.
5171 * backupfile.h (PARAMS): Remove. All uses removed.
5172 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5173 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5174 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5175 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5176 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5177 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5178 xstrtol.h: Likewise.
5179 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
5180 same.h, strverscmp.h: Do not include config.h; no longer needed.
5181 Anyway, config.h should always be included before any other file.
5183 2003-06-11 Simon Josefsson <jas@extundo.com>
5185 * sysexit_.h: New file.
5187 2003-05-20 Derek Price <derek@ximbiot.com>
5189 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5191 2003-06-10 Simon Josefsson <jas@extundo.com>
5193 * strchrnul.h: New file.
5194 * strchrnul.c: New file.
5196 2003-06-10 Simon Josefsson <jas@extundo.com>
5198 * argp.h: New file, from glibc.
5199 * argp-ba.c: New file, from glibc.
5200 * argp-eexst.c: New file, from glibc.
5201 * argp-fmtstream.c: New file, from glibc.
5202 * argp-fmtstream.h: New file, from glibc.
5203 * argp-fs-xinl.c: New file, from glibc.
5204 * argp-help.c: New file, from glibc.
5205 * argp-namefrob.h: New file, from glibc.
5206 * argp-parse.c: New file, from glibc.
5207 * argp-pv.c: New file, from glibc.
5208 * argp-pvh.c: New file, from glibc.
5209 * argp-xinl.c: New file, from glibc.
5211 2003-06-07 Jim Meyering <jim@meyering.net>
5213 * readtokens.h: Put `Free Software Foundation, Inc.'
5214 in place of my name in the copyright comment.
5215 Remove definition and uses of __P.
5218 * stat.c: Don't declare xmalloc explicitly.
5219 Instead, include "xalloc.h".
5220 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
5221 xrealloc, and xcalloc return values.
5222 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
5224 * xgetcwd.h: Remove definition/uses of PARAMS.
5226 2003-06-06 Jim Meyering <jim@meyering.net>
5228 * stdbool_.h: Renamed from stdbool.h.in.
5230 2003-06-06 Jim Meyering <jim@meyering.net>
5232 Merge from coreutils.
5233 * same.c: (same_name): Declare *_basename locals to be `const'.
5234 Consolidate declarations and initializations of *_base* locals.
5236 Merge from coreutils.
5237 This avoids a core dump on systems without GNU putenv,
5238 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5239 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5240 (unsetenv): New static function, from GNU libc.
5241 (rpl_putenv): Use it.
5243 * modechange.c: Remove trailing blanks.
5245 Merge from coreutils.
5246 * fsusage.c: Remove declaration of statfs.
5247 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5249 * posixtm.c: Include <stdbool.h> unconditionally.
5251 2003-06-05 Paul Eggert <eggert@twinsun.com>
5253 * mktime.c (__mktime_internal): When resolving a tm_isdst
5254 mismatch, look in future quarters as well as past. This fixes a
5255 bug when processing fall-backwards gaps immediately after a long
5256 period of daylight-saving time.
5258 * mktime.c: Assume freestanding C89 or better.
5259 (HAVE_LIMITS_H): Remove. Assume it's 1.
5260 (__P): Remove; not used.
5261 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5262 (mktime, not_equal_tm, print_tm, check_result,
5263 main): Use prototypes. Use const * where appropriate.
5264 (main): Fix typo in testing code that uncovered by above changes.
5265 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5267 2003-06-04 Paul Eggert <eggert@twinsun.com>
5269 * mktime.c: Fix Debian bug 177940
5270 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
5271 (localtime_offset): Now long int, not time_t, because we want it
5272 to be guaranteed to be signed. All uses changed.
5273 (__mktime_internal): If overflow would occur when adding offset,
5276 Merge 'human' changes from coreutils. Rewrite to support
5277 locale-specific notations like thousands separators.
5278 * human.c: Simplify authorship notice.
5279 Include human.h immediately after config.h.
5280 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
5281 <limits.h>: Do not include, since human.h does.
5282 (SIZE_MAX, UINTMAX_MAX): New macros.
5283 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
5284 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
5285 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
5286 (power_letter): Renamed from suffixes.
5287 (generate_suffix_backwards): Remove.
5288 (adjust_value): Now takes int style (because of human.h changes)
5289 and long double value (for greater precision on some platforms).
5290 (group_number): New function.
5291 (human_readable): Use it. Use integer options, not enum.
5292 Put the options before the sizes in the arg list.
5293 Support all the new options.
5294 The old human_readable function has been removed;
5295 use inttostr.h instead.
5296 (human_readable, default_block_size, humblock):
5297 Use uintmax_t, not int, for block sizes.
5298 (human_readable_inexact, block_size_types): Remove.
5299 (block_size_opts): New constant.
5300 (human_options): Renamed from human_block_size, with new signature
5301 that allows block sizes up to UINTMAX_MAX. All callers changed.
5302 * human.h: Add copyright and authorship notice.
5303 Include <limits.h> and <stdbool.h> unconditionally.
5304 (PARAMS): Remove. All uses removed.
5305 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
5306 (enum human_inexact_style): Remove tag; now a nameless enum.
5307 (human_floor, human_ceiling, human_round_to_even): Now have
5308 values 2, 0, 1 rather than -1, 1, 0.
5309 (human_group_digits, human_suppress_point_zero, human_autoscale,
5310 human_base_1024, human_SI, human_B): New constants.
5311 (human_readable_inexact, human_block_size): Remove.
5312 (human_readable): Size args are now uintmax_t, not int.
5313 (human_options): New decl.
5315 * exclude.c: (new_exclude, add_exclude): Remove casts that are
5316 unnecessary now that we assume C89 or better. This change
5317 imported from coreutils.
5319 * mktime.c (__mktime_internal): Do not reject negative timestamps
5320 arbitrarily. This is the same patch as 2003-05-28, but it got lost
5321 in the 2003-05-30 sync from glibc.
5323 .h files should stand alone, but we shouldn't include <sys/types.h>
5324 if we can get away with just <stddef.h>.
5326 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
5327 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
5328 rather than <sys/types.h>, as we merely need size_t.
5329 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
5331 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
5332 Include <stdio.h>, to get FILE.
5333 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
5334 memcasecmp.h has included <stddef.h> and all we need is size_t.
5335 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5336 our interface, instead of including <sys/types.h>
5338 2003-06-02 Paul Eggert <eggert@twinsun.com>
5341 Fix some minor time-related bugs with POSIX time arguments.
5342 Some valid time stamps were being rejected (notably -1, and
5343 time stamps before 1900 on 64-bit hosts). And some invalid
5344 time stamps were being accepted, e.g. September 31.
5346 * posixtm.h (posixtime): Return bool instead of time_t, so
5347 that we can return (time_t) -1 successfully.
5348 * posixtm.c: Likewise.
5349 [HAVE_STDBOOL_H]: Include <stdbool.h>.
5350 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
5351 (t): Remove static var.
5352 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
5353 of static var. All uses changed.
5354 (year): Do not reject years before 1900; they can occur with
5356 (posix_time_parse): Do not check for out-of-range components;
5357 that is now the caller's responsibility, since our checks were
5358 only approximations.
5359 (posixtime): Use mktime to check for out-of-range components,
5360 since it knows them exactly.
5361 If mktime returns (time_t) -1, check whether an error actually occurred
5362 by invoking localtime on -1.
5363 (main) [TEST_POSIXTIME]: Check for input data errors, and report
5364 posixtime failures better.
5365 Improve the test data (in comments only).
5367 2003-05-30 <karl@gnu.org>
5369 * mktime.c: update from libc.
5371 2003-05-30 Bruno Haible <bruno@clisp.org>
5373 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
5374 * localcharset.h: Likewise.
5375 * localcharset.c: Likewise.
5377 2003-05-28 Paul Eggert <eggert@twinsun.com>
5379 Assume the headers required for C89 freestanding compilers.
5380 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
5381 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
5382 without checking for HAVE_LIMITS_H.
5383 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
5384 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
5386 * fatal.c: Include <stdarg.h> without checking for __STDC__.
5387 * exclude.c: Include <stdbool.h> unconditionally.
5388 * tempname.c: Include <stddef.h> unconditionally.
5389 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
5390 * modechange.c, rpmatch.c (NULL): Don't define, since
5391 <stddef.h> does that.
5392 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
5393 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
5394 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
5395 * xstrtol.c: Likewise.
5396 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
5397 * savedir.c: Include <stddef.h> instead of defining NULL.
5399 * addext.c (addext): Use assignment rather than cast, to avoid
5400 warnings on some platforms.
5402 * mktime.c (__mktime_internal): Do not reject negative timestamps
5405 2003-05-10 Bruno Haible <bruno@clisp.org>
5407 * linebreak.c (iconv_string_length): Don't return -1 just because the
5408 string is longer than 4 KB.
5410 2003-05-12 Jim Meyering <jim@meyering.net>
5412 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
5413 the space-padded-by-default conversion specifiers, %e, %k, %l.
5415 2003-05-03 Bruno Haible <bruno@clisp.org>
5417 Upgrade to Unicode-4.0.
5418 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
5419 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
5420 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
5421 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
5422 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
5423 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
5424 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
5425 Change width of U+E0100..U+E01EF from 1 to 0.
5427 2003-04-25 Bruno Haible <bruno@clisp.org>
5429 * copy-file.c: Include <stddef.h>, for size_t.
5431 2003-04-25 Jim Meyering <jim@meyering.net>
5433 * copy-file.c (copy_file_preserving): Declare buf_size to be
5434 of type size_t, not int.
5436 2003-04-11 Jim Meyering <jim@meyering.net>
5438 Merge changes from Coreutils.
5440 2003-03-22 Jim Meyering <jim@meyering.net>
5442 * strftime.c (widen): Cast alloca return value to proper type.
5444 2003-01-19 Ulrich Drepper <drepper@redhat.com>
5447 * strftime.c (my_strftime): Handle very large width
5448 specifications for numeric values correctly. Improve checks for
5451 2003-01-19 Jim Meyering <jim@meyering.net>
5453 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
5454 (nl_get_alt_digit) [! defined my_strftime]: Define.
5455 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
5456 _nl_get_alt_digit and _nl_get_walt_digit.
5458 * strftime.c (my_strftime): Merge in locale-related changes from libc.
5459 These changes have no effect outside of _LIBC.
5461 2003-04-10 Bruno Haible <bruno@clisp.org>
5463 * findprog.h: New file, from GNU gettext.
5464 * findprog.c: New file, from GNU gettext.
5466 2003-04-05 Jim Meyering <jim@meyering.net>
5468 Merge changes from Coreutils.
5470 * exclude.h (PARAMS): Remove definition and uses.
5471 * exclude.c: Remove uses of `PARAMS'.
5473 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
5474 Add test-cases for DOS filenames. Declare program_name.
5475 (main): Set up program_name. Patch by Rich Dawe.
5477 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5479 Use mntctl's return value to drive the entry-processing loop, since
5480 we can't rely on the value of the vmt_length member in the last
5481 entry. On some systems doing so could result in exhausting
5482 virtual memory. Based in part on a patch from Mike Jetzer.
5484 2003-04-04 Bruno Haible <bruno@clisp.org>
5486 * linebreak.h: New file, from GNU gettext.
5487 * linebreak.c: New file, from GNU gettext with slight modifications.
5488 * lbrkprop.h: New file, from GNU gettext.
5490 2003-04-03 Bruno Haible <bruno@clisp.org>
5492 * utf8-ucs4.h: New file, from GNU gettext.
5493 * utf16-ucs4.h: New file, from GNU gettext.
5494 * ucs4-utf8.h: New file, from GNU gettext.
5495 * ucs4-utf16.h: New file, from GNU gettext.
5497 2003-04-02 Bruno Haible <bruno@clisp.org>
5499 * binary-io.h: New file, from GNU gettext.
5501 2003-04-01 Bruno Haible <bruno@clisp.org>
5503 * pathname.h: New file, from GNU gettext.
5504 * concatpath.c: New file, from GNU gettext.
5506 2003-03-30 Bruno Haible <bruno@clisp.org>
5508 * copy-file.c (copy_file_preserving): Don't set owner if the function
5509 chown() doesn't exist.
5511 2003-03-28 Bruno Haible <bruno@clisp.org>
5513 * copy-file.h: New file, from GNU gettext.
5514 * copy-file.c: New file, from GNU gettext.
5516 2003-03-18 Jim Meyering <jim@meyering.net>
5518 * quote.c (quote_n): Fix typo in comment.
5520 2003-03-14 Jim Meyering <jim@meyering.net>
5522 Merge changes from Coreutils.
5523 * obstack.h (obstack_object_size): Declare temporary, __o,
5524 to be const, in order to avoid warnings.
5525 (obstack_room): Likewise.
5526 (obstack_empty_p): Likewise.
5528 2003-03-13 Paul Eggert <eggert@twinsun.com>
5530 Merge changes from Bison.
5531 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
5532 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5533 when compiling Bison 1.875's `bitset bset = obstack_alloc
5534 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
5535 * hash.c: Include <stdbool.h> unconditionally.
5537 2003-03-09 Paul Eggert <eggert@twinsun.com>
5539 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
5540 Reported by Bruce Becker; see:
5541 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
5543 2003-03-03 Paul Eggert <eggert@twinsun.com>
5544 Bruno Haible <bruno@clisp.org>
5546 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
5547 Reported by John Hughes, see
5548 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
5550 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
5552 * poll_.h: New file.
5555 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
5557 * mathl.h: New file.
5558 * acosl.c: New file.
5559 * asinl.c: New file.
5560 * atanl.c: New file.
5561 * ceill.c: New file.
5564 * floorl.c: New file.
5565 * frexpl.c: New file.
5566 * ldexpl.c: New file.
5568 * sincosl.c: New file.
5570 * sqrtl.c: New file.
5572 * trigl.c: New file.
5573 * trigl.h: New file.
5575 2003-02-17 Bruno Haible <bruno@clisp.org>
5577 * mkdtemp.h: New file, from GNU gettext.
5578 * mkdtemp.c: New file, from GNU gettext.
5580 2003-01-31 Bruno Haible <bruno@clisp.org>
5582 * rename.c: #undef rename before defining rpl_rename.
5583 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
5585 2003-01-30 Bruno Haible <bruno@clisp.org>
5587 * printf-args.h: New file, from GNU gettext.
5588 * printf-args.c: New file, from GNU gettext.
5589 * printf-parse.h: New file, from GNU gettext.
5590 * printf-parse.c: New file, from GNU gettext.
5591 * vasnprintf.h: New file, from GNU gettext.
5592 * vasnprintf.c: New file, from GNU gettext.
5593 * asnprintf.c: New file, from GNU gettext.
5594 * vasprintf.h: New file, from GNU gettext with modifications.
5595 * vasprintf.c: New file, from GNU gettext.
5596 * asprintf.c: New file, from GNU gettext.
5598 2003-01-29 Bruno Haible <bruno@clisp.org>
5600 * stpncpy.h: New file, from GNU gettext with modifications.
5601 * stpncpy.c: New file, from GNU gettext with modifications.
5603 2003-01-28 Bruno Haible <bruno@clisp.org>
5605 * c-ctype.h: New file, from GNU gettext, with changes suggested by
5607 * c-ctype.c: New file, from GNU gettext, with changes suggested by
5610 2003-01-27 Bruno Haible <bruno@clisp.org>
5612 * xsetenv.h: New file, from GNU gettext.
5613 * xsetenv.c: New file, from GNU gettext.
5615 2003-01-23 Bruno Haible <bruno@clisp.org>
5617 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
5619 2003-01-22 Bruno Haible <bruno@clisp.org>
5621 * exit.h: New file, from GNU gettext.
5623 2003-01-11 Bruno Haible <bruno@clisp.org>
5625 * stpcpy.h (stpcpy): Use ANSI C function declarations.
5626 * strcase.h (strcasecmp, strncasecmp): Likewise.
5628 2003-01-14 Jim Meyering <jim@meyering.net>
5630 * same.c (same_name): Tweak a comment.
5632 2003-01-11 Bruno Haible <bruno@clisp.org>
5634 * same.c (same_name): Reorder tests so as to avoid calling stat()
5635 when a string comparison is sufficient.
5637 2003-01-11 Bruno Haible <bruno@clisp.org>
5639 * readtokens.c (readtoken): Cast character to 'unsigned char', not
5642 2003-01-11 Bruno Haible <bruno@clisp.org>
5644 * hash-pjw.c: Add comment about low quality of this function.
5646 2003-01-12 Paul Eggert <eggert@twinsun.com>
5648 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
5649 to avoid collisions with libcurses and libreadline.
5651 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
5652 * getstr.h, getstr.c: Remove.
5653 * getline.c: Include "getline.h", to check interface.
5654 Move body of old getstr.c here: this defines MIN_CHUNK and
5655 declares getdelim2, which is renamed from getstr.
5656 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
5658 * linebuffer.c (readlinebuffer): Renamed from readline.
5660 * linebuffer.h: Likewise.
5661 (readline): Remove backward-compatibility macro.
5663 2003-01-12 Jim Meyering <jim@meyering.net>
5665 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
5667 2003-01-10 Bruno Haible <bruno@clisp.org>
5669 * alloca_.h: New file.
5670 * getdate.y: Unconditionally include alloca.h.
5671 * makepath.c: Likewise.
5672 * setenv.c: Likewise.
5673 * userspec.c: Likewise.
5675 2003-01-09 Bruno Haible <bruno@clisp.org>
5677 * stdbool.h.in: New file.
5679 2003-01-08 Bruno Haible <bruno@clisp.org>
5681 * safe-read.c: Include specification header first, to ensure its
5683 * full-write.c: Likewise.
5685 2003-01-08 Jim Meyering <jim@meyering.net>
5687 * full-write.c: Undefine and define-away `const' after inclusion
5688 of errno.h, not before. Suggestion from Bruno Haible.
5690 2003-01-07 Jim Meyering <jim@meyering.net>
5692 * full-write.c: Rework so that it may serve to define full_read, too.
5693 * full-read.c: Simply #define FULL_READ and include full-write.c.
5695 2003-01-06 Jim Meyering <jim@meyering.net>
5697 * version-etc.c: Update year in translatable copyright string.
5699 2002-12-25 Bruno Haible <bruno@clisp.org>
5701 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
5702 * xstrtol.h: Likewise.
5703 * xstrtoimax.c: Likewise.
5704 * xstrtoumax.c: Likewise.
5705 * human.h: Likewise.
5707 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
5708 on systems that have <inttypes.h> but not <stdint.h>.
5710 2002-12-31 Paul Eggert <eggert@twinsun.com>
5712 * memcoll.c (memcoll): Fall back on a simple algorithm using
5713 memcmp if strcoll doesn't work.
5715 2002-12-23 Bruno Haible <bruno@clisp.org>
5717 * localcharset.h: New file.
5718 * localcharset.c: Include it.
5719 * unicodeio.c: Likewise.
5721 2002-12-22 Bruno Haible <bruno@clisp.org>
5723 * utime.c (utime_null): No need to call ftruncate if the file was
5726 2002-12-23 Bruno Haible <bruno@clisp.org>
5728 * memcoll.c (STRCOLL): New macro.
5731 2002-12-22 Bruno Haible <bruno@clisp.org>
5733 * getstr.h (getstr): Define, to avoid clash with libcurses.
5734 * linebuffer.h (readline): Define, to avoid clash with libreadline.
5736 2002-12-22 Bruno Haible <bruno@clisp.org>
5738 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
5740 2002-12-23 Bruno Haible <bruno@clisp.org>
5742 * getline.h: Include <stddef.h>, for size_t.
5744 * unicodeio.h: Include <stddef.h>, for size_t.
5745 * unicodeio.c: Don't include <stddef.h>.
5747 2002-12-17 Bruno Haible <bruno@clisp.org>
5749 * canon-host.c (strdup): Remove unused declaration.
5751 * fsusage.c: Include full_read.h.
5752 (get_fs_usage): Use full_read instead of safe_read.
5754 * utime.c (utime_null): Use SAFE_READ_ERROR.
5756 2002-12-11 Bruno Haible <bruno@clisp.org>
5758 * setenv.h: Rewritten to cope with systems that have setenv() but not
5760 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
5763 2002-12-11 Bruno Haible <bruno@clisp.org>
5765 * setenv.c (alloca): Fall back to malloc.
5767 (setenv): Use freea() to free memory allocated with alloca().
5769 2002-11-13 Bruno Haible <bruno@clisp.org>
5771 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
5772 function declarations.
5773 * unsetenv.c (unsetenv): Likewise.
5775 2002-03-04 Bruno Haible <bruno@clisp.org>
5777 Portability to AIX 4.3.3.
5778 * unsetenv.c: New file, extracted from setenv.c.
5779 * setenv.c: Move the unsetenv() function to unsetenv.c.
5781 2001-12-20 Bruno Haible <bruno@clisp.org>
5783 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
5784 use malloc instead. For SunOS 4.
5786 2001-12-11 Bruno Haible <bruno@clisp.org>
5788 * setenv.c: Declare alloca.
5789 (compar_fn_t): New typedef.
5790 (KNOWN_VALUE, STORE_VALUE): Use it.
5792 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
5795 2002-12-10 Paul Eggert <eggert@twinsun.com>
5797 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
5798 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
5799 Choose values that are less likely to collide with system fnmatch
5801 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
5802 defined (e.g., a pure POSIX system).
5803 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
5804 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
5806 2002-12-06 Jim Meyering <jim@meyering.net>
5808 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
5810 Merge in changes from libc's misc/error.c, in preparation
5811 for the merge of gnulib's changes back into libc.
5813 * error.c (_): Define only if not already defined.
5814 Move definition to follow all #include directives.
5815 Include unlocked-io.h only if !_LIBC.
5816 [_LIBC]: Include <libio/libioP.h>.
5817 [USE_IN_LIBIO]: Include <libio/iolibio.h>
5818 (fflush): Tweak definition to use INTUSE.
5821 2002-12-05 Paul Eggert <eggert@twinsun.com>
5823 * alloca.c [defined emacs]: Include "lisp.h".
5824 (xalloc_die) [defined emacs]: New macro.
5825 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
5826 [! defined emacs]: Include <xalloc.h>.
5827 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
5828 (pointer): Typedef to POINTER_TYPE *.
5829 (malloc): Remove decl; we now always use xmalloc.
5830 (alloca): Use old-style definition, since Emacs needs this.
5831 Check for arithmetic overflow when computing combined size.
5833 2002-12-04 Paul Eggert <eggert@twinsun.com>
5835 Do not generate unlocked-io.h automatically, since it's easier to
5836 maintain it by hand.
5838 * unlocked-io.h: New file, from GNU diffutils,
5839 but with proper copyright notice and attribution.
5841 * Makefile.am: Add copyright notice.
5842 (libfetish_a_SOURCES): Add unlocked-io.h.
5843 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
5844 (DISTCLEANFILES, io_functions): Remove macros.
5845 (EXTRA_DIST): Remove gen_uio.
5846 (unlocked-io.h): Remove rule.
5848 2002-12-04 Jim Meyering <jim@meyering.net>
5850 Reflect the fact that stat.c and lstat.c are no longer generated.
5851 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
5852 (DISTCLEANFILES): Likewise.
5853 (EXTRA_DIST): Likewise.
5854 (all_local): Don't depend on stat.c or lstat.c.
5855 (stat.c, lstat.c): Remove rules.
5856 (EXTRA_DIST): Remove xstat.in.
5858 * xstat.in: Remove file. Contents moved into stat.c.
5859 * stat.c: New file. Contents mostly from xstat.in.
5860 * stat.c: Rework so that it may serve to define rpl_lstat, too.
5861 * lstat.c: New file. Simply #define LSTAT and include stat.c.
5863 * safe-read.c: Rework so that it may serve to define safe_write, too.
5864 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
5866 2002-12-03 Jim Meyering <jim@meyering.net>
5868 * safe-read.c, safe-write.c: Change variable names and comments, but
5869 not semantics, to minimize the differences between these two files.
5870 (safe_read): Change comment to mention SAFE_READ_ERROR.
5872 * safe-read.c (IS_EINTR): Define.
5873 (safe_read): Use IS_EINTR in place of in-function cpp directives.
5875 2002-12-02 Bruno Haible <bruno@clisp.org>
5877 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
5878 Define, taken from safe-read.c.
5879 (INT_MAX): Provide fallback.
5880 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
5881 * safe-write.h (SAFE_WRITE_ERROR): Define.
5883 * safe-read.c (EINTR): Remove definition.
5884 (safe_read): Don't use EINTR if it is absent.
5886 2002-12-02 Jim Meyering <jim@meyering.net>
5888 * safe-read.c (EINTR): Define.
5889 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
5890 (INT_MAX): Provide fallback.
5891 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
5893 * safe-read.h (SAFE_READ_ERROR): Define.
5895 2002-12-01 Jim Meyering <jim@meyering.net>
5897 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
5898 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
5900 2002-11-27 Paul Eggert <eggert@twinsun.com>
5902 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
5903 hash_rehash): Replace `if (limit <= value) abort ();' with
5904 `if (! (value < limit)) abort ();', for readability.
5906 2002-11-26 <karl@gnu.org>
5908 * strdup.c: copy from libc again, with jim's ok.
5909 * .cppi-disable: re-add strdup.c
5911 2002-11-25 <karl@gnu.org>
5913 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
5914 instead of "strtol.c".
5916 2002-11-25 Jim Meyering <jim@meyering.net>
5918 * mktime.c: Sync from libc, now that it has the latest fix.
5920 2002-11-24 <karl@gnu.org>
5922 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
5923 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
5925 2002-11-24 Jim Meyering <jim@meyering.net>
5927 Update from coreutils:
5929 * mktime.c: Merge in changes from libc.
5931 Avoid a link-time failure on some Linux systems.
5932 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
5933 (__mon_yday): Declare with the STATIC attribute.
5934 (__mktime_internal): Likewise.
5935 Based on a report from Greg Schafer.
5937 2002-11-23 Jim Meyering <jim@meyering.net>
5939 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
5940 Use `unsigned', not `int', as type of index.
5942 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
5944 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
5946 2002-11-22 Paul Eggert <eggert@twinsun.com>
5948 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
5949 hint that one should use `if (! x) abort ();' rather than `assert
5950 (x);', and anyway it's one less thing to worry about configuring.
5951 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
5952 hash_rehash, hash_insert): Use abort rather than assert.
5954 2002-11-22 Paul Eggert <eggert@twinsun.com>
5956 * quotearg.h: Allow multiple inclusion by surrounding with
5957 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
5958 so that we can be included first.
5959 (PARAMS): Remove; we now assume C89 or later. All uses removed.
5960 * quotearg.c: Include quotearg.h immediately after config.h.
5961 No need to include stddef.h or sys/types.h any more.
5962 Surround local include files with "", not "<>".
5963 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
5964 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
5965 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
5966 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
5967 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
5968 (ISPRINT): Remove; no longer needed now that we assume C89.
5970 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
5973 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
5974 quotearg_char): Use SIZE_MAX rather than
5975 (size_t) -1 when we are talking about "infinity".
5977 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
5979 2002-11-22 Bruno Haible <bruno@clisp.org>
5981 * safe-read.h: Assume C89. Add comments.
5982 (safe_read): Change return type to size_t.
5983 * safe-read.c (safe_read): Change return type to size_t. Handle byte
5984 counts > SSIZE_MAX correctly.
5985 * safe-write.h: New file.
5986 * safe-write.c: New file.
5987 * full-read.h: New file.
5988 * full-read.c: New file.
5989 * full-write.h: Assume C89. Add comments.
5990 * full-write.c: Include safe-write.h.
5991 (full_write): Rewritten to use safe_write.
5992 Suggested by Jim Meyering and Paul Eggert.
5994 2002-11-21 Bruno Haible <bruno@clisp.org>
5996 Remove case insensitive option matching.
5997 * argmatch.h (argcasematch): Remove declaration.
5998 (ARGCASEMATCH): Remove macro.
5999 (__xargmatch_internal): Remove case_sensitive argument.
6000 (XARGMATCH): Update.
6001 (XARGCASEMATCH): Remove macro.
6002 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
6003 case_sensitive argument.
6004 (argcasematch): Remove function.
6005 (__xargmatch_internal): Remove case_sensitive argument.
6006 (main): Use XARGMATCH instead of XARGCASEMATCH.
6008 * xmalloc.c: Change compile-time error message. Add comment about
6009 required autoconf version.
6011 2002-11-21 Jim Meyering <jim@meyering.net>
6013 * strdup.c (strdup): Tweak comment and initial #if/#include.
6015 Merge in changes from the coreutils.
6017 2002-09-25 Paul Eggert <eggert@twinsun.com>
6018 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
6019 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
6020 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
6021 int. Work more efficiently if X is the same width as uintmax_t.
6022 Do not compare X to -1, to avoid bogus compiler warning.
6023 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
6024 Don't assume that f_frsize and f_bsize are the same type.
6026 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
6029 * makepath.c (make_path): Restore umask *before* creating the final
6031 (make_path): Minor reformatting.
6033 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
6034 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
6036 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
6037 ones. At least on GNU/Linux systems, `auto' means something else.
6040 2002-11-20 Paul Eggert <eggert@twinsun.com>
6042 Merge argmatch cleanups from Bison. Assume C89.
6044 * argmatch.c: Include config.h here, not in argmatch.h.
6045 Include stdlib.h, for EXIT_FAILURE.
6046 Always include <string.h>, since we assume C89.
6047 (EXIT_FAILURE): Remove pre-C89 bug workaround.
6048 * argmatch.h: Do not include <config.h> or <sys/types.h>.
6049 Include <stddef.h> instead, since it's all we need for size_t.
6050 (PARAMS): Remove. All uses removed.
6051 (ARRAY_CARDINALITY): Do not bother to #undef.
6052 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
6053 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6054 Remove unnecessary parentheses.
6055 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6056 Insert necessary parentheses.
6057 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
6058 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
6060 2002-11-19 Bruno Haible <bruno@clisp.org>
6062 * mbswidth.c: Include mbswidth.h right at the beginning.
6063 * mbswidth.h: Include <stddef.h>, for size_t.
6065 * mbswidth.h (PARAMS): Remove macro.
6066 (mbswidth, mbsnwidth): Use ANSI C function declarations.
6067 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
6069 * gcd.h (PARAMS): Remove macro.
6070 (gcd): Use ANSI C function declarations.
6071 * gcd.c (gcd): Likewise.
6073 2002-11-15 Bruno Haible <bruno@clisp.org>
6075 * strcspn.c: Include <stddef.h>.
6076 (strcspn): Use ANSI C function declaration. Change return type to
6078 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
6079 (strpbrk): Use NULL.
6080 * strpbrk.h (PARAMS): Remove macro.
6081 (strpbrk): Use ANSI C function declaration.
6082 * strstr.c: Don't include <sys/types.h>.
6083 * strstr.h (PARAMS): Remove macro.
6084 (strstr): Use ANSI C function declarations.
6086 2002-11-06 Bruno Haible <bruno@clisp.org>
6088 * gcd.h (gcd): Change argument type to 'unsigned long'.
6089 * gcd.c (gcd): Likewise.
6091 2002-11-05 Bruno Haible <bruno@clisp.org>
6093 * gcd.h: New file, from gettext-0.11.5.
6094 * gcd.c: New file, from gettext-0.11.5.
6096 2002-11-05 Bruno Haible <bruno@clisp.org>
6098 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6099 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6100 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6101 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6103 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6104 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6106 * closeout.c: Include gettext.h instead of <libintl.h>.
6107 * human.c: Include gettext.h instead of <libintl.h>.
6108 * quotearg.c: Include gettext.h instead of <libintl.h>.
6109 * rpmatch.c: Include gettext.h instead of <libintl.h>.
6110 * unicodeio.c: Include gettext.h instead of <libintl.h>.
6111 * userspec.c: Include gettext.h instead of <libintl.h>.
6112 * version-etc.c: Include gettext.h instead of <libintl.h>.
6113 * xmalloc.c: Include gettext.h instead of <libintl.h>.
6114 (textdomain): Remove definition.
6115 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
6117 * long-options.c: Remove include of <libintl.h> and definition of _.
6118 * same.c: Remove include of <libintl.h> and definition of _.
6120 2002-11-04 Bruno Haible <bruno@clisp.org>
6122 * stpcpy.h: New file, from GNU gettext-0.11.5.
6123 * strcase.h: New file, from GNU gettext-0.11.5.
6124 * strpbrk.h: New file, from GNU gettext-0.11.5.
6125 * strstr.h: New file, from GNU gettext-0.11.5.
6126 * xgetcwd.h: New file, from GNU gettext-0.11.5.
6128 2002-05-09 Bruno Haible <bruno@clisp.org>
6130 * config.charset: Update for newest glibc. Add canonical names
6131 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
6133 2002-05-09 Bruno Haible <bruno@clisp.org>
6135 * localcharset.c (get_charset_aliases): Add more Windows specific
6138 2002-05-08 Owen Taylor <otaylor@redhat.com>
6140 * config.charset: A few additions for Solaris.
6142 2001-12-05 Bruno Haible <bruno@clisp.org>
6144 * localcharset.c (locale_charset): Don't return an empty string.
6146 2001-10-23 Bruno Haible <haible@clisp.cons.org>
6148 * config.charset: msdos in uk_UA uses CP1125.
6150 2001-08-05 Bruno Haible <haible@clisp.cons.org>
6152 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
6153 * localcharset.c (locale_charset): Declare as extern "C".
6155 2002-02-15 Bruno Haible <bruno@clisp.org>
6157 * config.charset [msdosdjgpp]: For Russian, use CP866.
6159 2002-02-11 Bruno Haible <bruno@clisp.org>
6161 * config.charset: Add support for NetBSD.
6163 2002-09-25 <karl@gnu.org>
6165 * strdup.c: copy from libc/string (via ../config/srclist*).
6166 * getopt*: copy from libc/posix.
6167 * gettext.h: copy from gettext.
6168 * .cppi-disable: add strdup.c, gettext.h.
6170 2002-07-01 Jim Meyering <meyering@lucent.com>
6172 * c-stack.c: Include sys/time.h.
6173 From Volker Borchert.
6175 2002-06-11 Paul Eggert <eggert@twinsun.com>
6177 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6178 New macro. Use it uniformly instead of
6179 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6180 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6181 reported by Vin Shelton.
6183 2002-06-22 Jim Meyering <meyering@lucent.com>
6185 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6186 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6188 2002-06-22 Paul Eggert <eggert@twinsun.com>
6190 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6191 Do not assume SA_SIGINFO behavior.
6192 Bug reported by Jim Meyering on NetBSD 1.5.2.
6194 2002-06-22 Jim Meyering <meyering@lucent.com>
6196 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6198 * exitfail.c, exitfail.h: Likewise.
6199 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6201 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6203 (EXTRA_DIST): Add fnmatch_loop.c.
6204 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6206 * fnmatch_loop.c: New file, from diffutils-2.8.2.
6207 * fnmatch.c: Update from diffutils-2.8.2.
6208 * fnmatch_.h: New file. From diffutils-2.8.2.
6209 * fnmatch.h: Remove file.
6211 2002-06-18 Paul Eggert <eggert@twinsun.com>
6213 * file-type.h: Report an error if neither S_ISREG nor
6214 S_IFREG is defined, instead of using a test specific to glibc
6215 2.2. This should be safe, since POSIX requires S_ISREG and
6216 Unix Version 7 had S_IFREG. We don't need to check for
6217 <sys/types.h> since we don't use any symbols that it defines.
6219 2002-06-15 Jim Meyering <meyering@lucent.com>
6221 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6222 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6223 have been included before this file.
6225 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
6227 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6228 so that each temporary file name is unique and valid in the first
6229 8 characters, for operation under DOS.
6231 2002-06-15 Jim Meyering <meyering@lucent.com>
6233 Work even with DJGPP 2.03, which lacks support for symlinks.
6235 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6237 * lchown.c (S_ISLNK): Likewise.
6239 2002-06-14 Jim Meyering <meyering@lucent.com>
6241 * file-type.h: Use the version from diffutils-2.8.2.
6242 * file-type.c: Likewise.
6244 2002-05-27 Jim Meyering <meyering@lucent.com>
6246 Fix a problem seen only on nonconforming systems whereby ls.c's
6247 use of localtime, and then of gettimeofday would cause trouble:
6248 the localtime call used to initialize rpl_gettimeofday's save
6249 mechanism would clobber ls's current local time information so
6250 that in any long listing the first file would always be listed
6251 with date 1970-01-01. Analysis by Volker Borchert.
6253 * gettimeofday.c (localtime): Undefine.
6254 (rpl_localtime): New function.
6256 2002-05-22 Jim Meyering <meyering@lucent.com>
6258 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6259 * file-type.h: New file.
6260 * file-type.c (file_type): New file/function. Extracted from diffutils.
6262 2002-04-29 Paul Eggert <eggert@twinsun.com>
6264 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6266 2002-04-28 Paul Eggert <eggert@twinsun.com>
6268 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6269 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
6270 of 127, since 64 is the largest conceivable number for ancient
6272 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6274 2002-04-28 Jim Meyering <meyering@lucent.com>
6276 * sig2str.c (WTERMSIG): Remove definition (unused).
6278 2002-04-28 Paul Eggert <eggert@twinsun.com>
6280 * sig2str.h, sig2str.c: New files.
6281 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6283 2002-04-24 Jim Meyering <meyering@lucent.com>
6285 * gettext.h: New file, from Gettext.
6286 * Makefile.am (INCLUDES): Remove -I../intl.
6287 (libfetish_a_SOURCES): Add gettext.h.
6289 2002-04-16 Jim Meyering <meyering@lucent.com>
6291 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6292 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6293 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6295 2002-04-12 Jim Meyering <meyering@lucent.com>
6297 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6299 2002-03-10 Jim Meyering <meyering@lucent.com>
6301 * makepath.c (make_path): Remove a comma from a diagnostic.
6302 Suggestion from Santiago Vila.
6304 2002-03-08 Jim Meyering <meyering@lucent.com>
6306 * rename.c: Mention that this wrapper is needed also on
6307 mips-dec-ultrix4.4 systems.
6309 2002-03-02 Jim Meyering <meyering@lucent.com>
6311 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6312 not HAVE_CLOCK_SETTIME.
6314 2002-02-27 Paul Eggert <eggert@twinsun.com>
6316 * nanosleep.h: Rename to....
6317 * timespec.h: New name for nanosleep.h. All uses changed.
6319 * gettime.c: New file.
6320 * settime.c: New file.
6323 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6324 timespec.h. Remove nanosleep.h.
6326 2002-02-25 Paul Eggert <eggert@twinsun.com>
6328 * acl.c, acl.h: New files.
6329 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6331 2002-02-24 Jim Meyering <meyering@lucent.com>
6333 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6334 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6335 cause trouble. Reported by Nelson Beebe.
6337 2002-02-23 Paul Eggert <eggert@twinsun.com>
6339 * path-concat.c (xpath_concat): Reorder code to pacify
6340 compilers that don't know that xalloc_die never returns.
6342 2002-02-20 Jim Meyering <meyering@lucent.com>
6344 * getdate.c: Regenerate using bison-1.33.
6346 2002-02-15 Paul Eggert <eggert@twinsun.com>
6348 * posixver.c, posixver.h: New files.
6349 * Makefile.am (libfetish_a_SOURCES): Add them.
6351 2002-02-02 Paul Eggert <eggert@twinsun.com>
6352 Bruno Haible <bruno@clisp.org>
6354 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6355 (fwrite_success_callback): New declaration.
6356 * unicodeio.c (unicode_to_mb): New function, extracted from
6357 print_unicode_char. Call failure callback instead of error.
6358 (fwrite_success_callback): New function.
6359 (exit_failure_callback): New function.
6360 (fallback_failure_callback): New function.
6361 (print_unicode_char): Call unicode_to_mb.
6363 2002-01-26 Jim Meyering <meyering@lucent.com>
6365 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6367 2002-01-22 Jim Meyering <meyering@lucent.com>
6369 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6370 Otherwise, some versions of automake would omit the rule that makes
6371 Makefile from Makefile.in.
6373 2001-01-21 Paul Eggert <eggert@twinsun.com>
6375 * xmemcoll.h, xmemcoll.c: New files.
6376 * Makefile.am (libfetish_a_SOURCES): Add them.
6377 * memcoll.c: Include errno.h, and declare errno if not defined.
6378 (memcoll): Set errno to zero if there is no error.
6380 * quotearg.c (quotearg_buffer_restyled):
6381 Fix bug with quoting buffers containing NUL when backslashing escapes.
6382 This bug was exposed by the other changes in this patch.
6383 (quotearg_n_options): New arg ARGSIZE.
6384 All callers changed.
6385 (quoting_options_from_style): New function.
6386 (quotearg_n_style): Use it.
6387 (quotearg_n_style_mem): New function.
6389 * quotearg.h (quotearg_n_style_mem): New function.
6391 2002-01-16 Jim Meyering <meyering@lucent.com>
6393 * getdate.y: Add three semicolons, each just before a closing brace.
6394 Bison (as of version 1.31) no longer papers over that mistake.
6396 2002-02-14 Paul Eggert <eggert@twinsun.com>
6398 * backupfile.c (ISDIGIT): Comment fix.
6399 * getdate.y (ISDIGIT): Likewise.
6400 * posixtm.c (ISDIGIT, year): Likewise.
6401 * strverscmp.c (ISDIGIT): Likewise.
6402 * userspec.c (ISDIGIT): Likewise.
6404 2002-01-05 Jim Meyering <meyering@lucent.com>
6406 * version-etc.c (version_etc_copyright): Update copyright year.
6408 2001-01-19 Paul Eggert <eggert@twinsun.com>
6410 * closeout.c (close_stdout_status): If ferror (stdout), do
6411 not silently exit merely because the output buffer happens to
6412 have nothing pending.
6414 2001-12-18 Paul Eggert <eggert@twinsun.com>
6416 See the big note in ../ChangeLog.
6417 * human.c (suffixes): Prefer K to k for 1024.
6418 (generate_suffix_backwards): New function.
6419 (human_readable_inexact): Use it.
6420 * xstrtol.c (__xstrtol): If there is no number but there
6421 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
6422 Accept 'K' as well as 'k'.
6424 2001-12-15 Jim Meyering <meyering@lucent.com>
6426 * regex.h (__restrict_arr): Update from libc.
6428 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
6429 as `remote' if the name starts with `//'. Suggested by Michael Stone.
6432 2001-12-10 Jim Meyering <meyering@lucent.com>
6434 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
6435 Instead, include "xalloc.h".
6436 (initbuffer): Don't cast xmalloc return value to char*.
6437 (readline): Reword comment.
6438 Don't cast xrealloc return value to char*
6441 2001-12-09 Jim Meyering <meyering@lucent.com>
6443 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
6444 `signed and unsigned type in conditional expression'.
6445 * posixtm.c (posix_time_parse): Likewise.
6447 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
6449 * readtokens.c (readtoken): Declare an index to be of type unsigned
6450 to avoid a pedantic warning.
6452 * getstr.c: Don't include assert.h.
6453 (getstr): Remove warning-evoking assertions.
6454 Return -1 if offset parameter is out of bounds.
6455 Change the type of a local from int to size_t.
6457 * strftime.c (my_strftime_localtime_r): Include this function
6458 definition in the `#if ! HAVE_TM_GMTOFF' block.
6460 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
6461 Include xalloc.h instead.
6463 2001-12-02 Jim Meyering <meyering@lucent.com>
6465 * tempname.c: Don't declare getenv, thus reverting the change of
6466 2001-11-18. It's no longer necessary, now that stdlib.h is always
6469 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
6470 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
6472 2001-11-30 Akim Demaille <akim@epita.fr>
6474 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
6475 before being defined.
6477 2001-11-27 Paul Eggert <eggert@twinsun.com>
6479 * quotearg.h (quotearg_n, quotearg_n_style):
6480 First arg is int, not unsigned.
6481 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
6482 (SIZE_MAX, UINT_MAX): New macros.
6483 (quotearg_n_options): Abort if N is negative.
6484 Avoid overflow check on hosts where size_t is 64 bits and int
6485 is 32 bits, as overflow is impossible there.
6486 Fix off-by-one typo that caused unnecessary reallocation.
6488 2001-11-27 Jim Meyering <meyering@lucent.com>
6490 * tempname.c: Merge with version from libc.
6491 * regex.c: Likewise.
6493 * tempname.c: Include stdlib.h unconditionally. On some old systems
6494 for which STDC_HEADERS is 0, it was not included, resulting in a
6495 warning about an integer-to-pointer conversion problem with getenv.
6496 Reported by Volker Borchert.
6498 2001-11-26 Jim Meyering <meyering@lucent.com>
6500 * gtod.h: Remove file.
6501 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
6502 * gettimeofday.c: Don't include gtod.h.
6503 (GTOD_init): Remove function.
6504 (rpl_gettimeofday): Do its job here instead, rather than aborting.
6505 Suggestion from Volker Borchert.
6507 2001-11-23 Jim Meyering <meyering@lucent.com>
6509 * hash.h (struct hash_table): Don't define here. Merely declare it.
6510 * hash.c (struct hash_table): Define it here instead.
6512 2001-11-22 Jim Meyering <meyering@lucent.com>
6514 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
6516 2001-11-18 Paul Eggert <eggert@twinsun.com>
6518 * tempname.c (TMP_MAX): Remove; no longer needed.
6519 (TEMPORARIES): New macro.
6520 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
6521 removes an artificial limitation (e.g. HP-UX 10.20, where
6524 2001-11-18 Jim Meyering <meyering@lucent.com>
6526 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
6529 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
6530 files will be created before anything else.
6532 2001-11-17 Jim Meyering <meyering@lucent.com>
6534 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
6535 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
6536 rather than group writable. Patch by Juan F. Codagnone.
6538 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
6539 Instead, include "xalloc.h".
6541 * mountlist.c: Include unlocked-io.h after all system headers.
6542 Remove explicit declarations of xmalloc, xrealloc,
6543 and xstrdup. Instead, include "xalloc.h".
6545 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
6546 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
6547 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
6549 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
6550 Reported by Padraig Brady.
6552 * mkstemp.c: #undef mkstemp.
6554 (rpl_mkstemp): Rename from mkstemp.
6557 2001-11-16 Jim Meyering <meyering@lucent.com>
6559 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
6560 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
6561 determine the amount of total physical memory, use pstat_getstatic.
6562 HPUX-11 doesn't define _SC_PHYS_PAGES.
6563 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
6564 If sysconf couldn't be used to determine the amount of available
6565 physical memory, use both pstat_getstatic and pstat_getdynamic.
6566 Based on a patch from Bob Proulx.
6568 2001-11-05 Jim Meyering <meyering@lucent.com>
6570 * xstat.in (slash_aware_lstat): Correct a misleading comment.
6572 2001-11-03 Jim Meyering <meyering@lucent.com>
6574 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
6575 in argmatch_to_argument call.
6577 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
6580 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
6581 e.g., a fault due to an attempt to free a NULL pointer.
6583 2001-11-01 Jim Meyering <meyering@lucent.com>
6585 * dirfd.c, dirfd.h: New files.
6586 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
6588 * hash.c (hash_print) [TESTING]: Clean up.
6590 2001-10-22 Paul Eggert <eggert@twinsun.com>
6592 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
6593 to avoid a warning if -Wall.
6595 2001-10-21 Paul Eggert <eggert@twinsun.com>
6597 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
6599 2001-10-21 Jim Meyering <meyering@lucent.com>
6601 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
6602 this code would end up calling gettext even in packages built
6604 * getopt.c (_): Likewise.
6605 * regex.c (_): Likewise.
6607 2001-10-20 Paul Eggert <eggert@twinsun.com>
6609 * error.c (strerror_r): Do not declare unless !_LIBC.
6610 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
6611 Use strerror_r that is only a macro, even if it is not a function.
6612 (strerror): Check for HAVE_DECL_STRERROR before declaring.
6613 (private_strerror): Use prototypes, not old-style function definition.
6614 (print_errno_message): New function.
6615 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
6617 (error_tail, error, error_at_line): Use it.
6619 2001-10-11 Jim Meyering <meyering@lucent.com>
6621 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
6622 and quote_n (1, ... to avoid clobbering a buffer.
6624 2001-10-05 Jim Meyering <meyering@lucent.com>
6626 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
6627 * hash-pjw.c: New file (factored out of fileutils' remove.c).
6628 * hash-pjw.h: New file.
6630 2001-09-30 Jim Meyering <meyering@lucent.com>
6632 * mountlist.c [MOUNTED_GETFSSTAT]:
6633 Include <sys/ucred.h>, for Apple Darwin.
6634 Include sys/mount.h and sys/fs_types.h only if available.
6636 (read_filesystem_list): Use FS_TYPE.
6638 2001-09-29 Paul Eggert <eggert@twinsun.com>
6640 * exclude.c (excluded_filename): 0 -> false, since it's
6643 2001-09-28 Paul Eggert <eggert@twinsun.com>
6645 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
6646 #defines strtoimax. Also treat the other strto* functions
6649 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
6650 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
6651 (strtoimax, strtoumax): Do not declare if already defined as a macro.
6653 2001-09-26 Jim Meyering <meyering@lucent.com>
6655 Most macros in unlocked-io.h had the wrong number of arguments.
6656 * gen-uio: New script.
6657 (USE_UNLOCKED_IO): Define to 1 if not already defined.
6658 * unlocked-io.hin: Remove file.
6659 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
6660 rather than trying to embed it here.
6661 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
6662 Reported by Padraig Brady.
6664 2001-09-25 Volker Borchert <bt@teknon.de>
6666 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
6668 2001-09-23 Jim Meyering <meyering@lucent.com>
6670 * mountlist.c: Remove useless parentheses in #if directives.
6671 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
6672 the deprecated MOUNTED symbol is no longer defined in mntent.h.
6674 2001-09-22 Jim Meyering <meyering@lucent.com>
6676 * localcharset.c: Update from latest gettext.
6677 * config.charset: Likewise.
6679 2001-09-20 Jim Meyering <meyering@lucent.com>
6681 * xstrtol.c (strtoimax): Guard declaration with
6682 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
6683 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
6684 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
6685 (strtoumax): Likewise, for completeness (it wasn't necessary).
6687 2001-09-06 Paul Eggert <eggert@twinsun.com>
6689 * strtoimax.c (HAVE_LONG_LONG):
6690 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
6691 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
6692 to work around bug in IBM C compiler.
6694 2001-09-16 Jim Meyering <meyering@lucent.com>
6696 * mkdir.c: New file.
6698 2001-09-04 Paul Eggert <eggert@twinsun.com>
6700 * xgetcwd.c: Revert some of the previous change; intead,
6701 fix the HAVE_GETCWD_NULL code to behave more like the
6702 !HAVE_GETCWD_NULL code used to.
6705 (xgetcwd): Do not return NULL when memory is exhausted; instead,
6708 2001-09-04 Paul Eggert <eggert@twinsun.com>
6710 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
6711 Use ssize_t, not int, to store result of readlink.
6712 Check for ssize_t overflow as well as size_t overflow,
6713 as POSIX says the result of readlink is implementation-defined
6714 when ssize_t overflows.
6715 Remove unnecessary cast to char*.
6716 Use free+malloc instead of realloc, as the storage doesn't need
6717 to be preserved and it's clearer and can be more efficient that way.
6718 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
6719 * xreadlink.h (xreadlink): Update prototype.
6721 2001-09-03 Paul Eggert <eggert@twinsun.com>
6723 * exclude.c (fnmatch_no_wildcards): Fix confusion between
6724 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
6725 spotted by Jim Meyering.
6727 2001-09-03 Jim Meyering <meyering@lucent.com>
6729 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
6731 2001-09-03 Paul Eggert <eggert@twinsun.com>
6733 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
6734 like the HAVE_GETCWD_NULL code.
6735 Include pathmax.h if not HAVE_GETCWD.
6736 Do not include xalloc.h.
6737 (INITIAL_BUFFER_SIZE): New symbol.
6738 Do not use xmalloc / xrealloc, since the caller is responsible for
6739 handling errors. Preserve errno around `free' during failure.
6740 Do not overrun buffer when using getwd.
6742 2001-09-03 Paul Eggert <eggert@twinsun.com>
6744 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
6745 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
6747 2001-09-02 Jim Meyering <meyering@lucent.com>
6749 * error.c: Update from GNU libc.
6751 2001-09-01 Jim Meyering <meyering@lucent.com>
6753 * xreadlink.c: New file.
6754 * xreadlink.h: New file.
6755 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
6757 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
6758 doesn't conflict with sparc Solaris 7's definition in
6759 /usr/include/sys/int_types.h.
6761 * exclude.c: Use `""', not `<>' to #include non-system header files.
6762 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
6763 and strncasecmp as r-values. Unixware didn't have declarations.
6765 2001-08-31 Jim Meyering <meyering@lucent.com>
6767 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
6768 Use an initial, malloc'd, buffer of length 128 rather than
6769 a statically allocated one of length 1024.
6771 2001-08-30 Paul Eggert <eggert@twinsun.com>
6773 * xgetcwd.c: Don't include pathmax.h.
6774 Include stdlib.h and unistd.h if available.
6776 (xmalloc, xstrdup, free): Remove decls.
6777 (xgetcwd): Don't assume sizes fit in unsigned.
6778 Check for overflow when computing sizes.
6779 Simplify reallocation code.
6781 2001-08-28 Paul Eggert <eggert@twinsun.com>
6783 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
6785 * strtoimax.c: Renamed from strtoxmax.c, removing the
6788 Also, make the following further changes to make this file's
6789 configuration more similar to that of strtol.c:
6790 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
6791 (strtoumax, uintmax_t, strtoull, strtol): Remove.
6792 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
6793 (strtoimax): Renamed from strtoumax. All uses of unsigned values
6794 changed to signed values.
6796 And make the following changes as well:
6797 Fix copyright notice, as 1999 was missing.
6798 (verify): New macro.
6799 (strtoimax): Check sizes at compile-time, not run-time.
6800 Prefer strtol to strtoll if both work.
6801 (main): Remove; it was not that useful and was a pain to maintain.
6803 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
6805 2001-08-30 Paul Eggert <eggert@twinsun.com>
6807 * savedir.c (savedir): Remove size parameter, as POSIX says that
6808 a directory's st_size can have an arbitrary value, so the old
6809 usage could waste an arbitrary amount of memory. All uses
6811 * savedir.h: Update prototype.
6813 2001-08-30 Paul Eggert <eggert@twinsun.com>
6815 * xstrtol.c (strtoimax): New decl.
6817 2001-08-28 Paul Eggert <eggert@twinsun.com>
6819 * xstrtol.h: Add copyright notice.
6820 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
6821 LONGINT_INVALID_SUFFIX_CHAR.
6823 2001-08-30 Paul Eggert <eggert@twinsun.com>
6825 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
6828 2001-08-30 Paul Eggert <eggert@twinsun.com>
6830 * hash.c: Remove '2001' from copyright notice.
6832 2001-08-30 Paul Eggert <eggert@twinsun.com>
6834 * full-write.h: New file.
6835 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
6836 * full-write.c: Correct credits, as cccp.c no longer
6837 exists and anyway it was so heavily changed from the old cccp
6838 code as to be unrecognizable. Include full-write.h.
6839 (full_write) Return size_t, with short writes meaning failure.
6840 All callers changed. This fixes a bug with large buffers
6842 * utime.c: Include full-write.h.
6844 2001-08-30 Paul Eggert <eggert@twinsun.com>
6846 Merge 'exclude' changes from tar 1.13.22.
6847 This fixes one or two unlikely storage allocation overflow bugs,
6848 but doesn't change user-visible behavior otherwise.
6850 2001-08-30 Paul Eggert <eggert@twinsun.com>
6852 * exclude.c (bool): Declare, perhaps by including stdbool.h.
6853 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
6854 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
6855 Include if available.
6856 (<xalloc.h>): Include
6857 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
6858 (verify): New macro. Use it to verify that EXCLUDE macros do not
6859 collide with FNM macros.
6860 (struct patopts): New struct.
6861 (struct exclude): Use it, as exclude patterns now come with options.
6862 (new_exclude): Support above changes.
6863 (new_exclude, add_exclude_file):
6864 Initial size must now be a power of two to simplify overflow checking.
6865 (free_exclude, fnmatch_no_wildcards): New function.
6866 (excluded_filename): No longer requires options arg, as the options
6867 are determined by add_exclude. Now returns bool, not int.
6868 (excluded_filename, add_exclude):
6869 Add support for the fancy new exclusion options.
6870 (add_exclude, add_exclude_file): Now takes int options arg.
6871 Check for arithmetic overflow when computing sizes.
6872 (add_exclude_file): xrealloc might modify errno, so don't
6873 realloc until after errno might be used.
6875 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
6877 (free_exclude): New decl.
6878 (add_exclude, add_exclude_file): Now takes int options arg.
6879 (excluded_filename): No longer requires options arg, as the options
6880 are determined by add_exclude. Now returns bool, not int.
6882 2001-08-30 Paul Eggert <eggert@twinsun.com>
6884 * alloca.c (alloca): Arg is of type size_t, not unsigned.
6886 2001-08-27 Jim Meyering <meyering@lucent.com>
6888 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
6890 * version-etc.c (N_): Remove definition.
6891 Revert most of last change.
6892 Instead, simply don't mark the `Copyright...' string for translation.
6893 Based on advice from Paul Eggert.
6895 * strtoxmax.c: Tweak comment.
6897 2001-08-26 Jim Meyering <meyering@lucent.com>
6899 * version-etc.c (version_etc_copyright_fmt): Replace literal year
6900 of copyright with `%s' so translators don't get an untranslated
6902 (COPYRIGHT_YEAR): Define.
6903 (version_etc): Use fprintf rather than fputs.
6904 Suggestion from Ulrich Drepper.
6906 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
6908 * strtoll.c: New file, from GNU libc.
6909 * xstrtoimax.c: New file.
6911 * xstrtol.h: Add xstrtoimax.
6912 * strtoumax.c: New file. Simply include "strtoumax.c".
6913 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
6915 * strtoumax.c: Factor to work both for unsigned and signed types, ...
6916 * strtoxmax.c: ... then renamed to this.
6918 2001-08-13 Paul Eggert <eggert@twinsun.com>
6920 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
6921 Port to Solaris 8, where 'sed' requires a space after the 'r'
6922 command, and where sh dislikes "$/". Clean up the spacing a bit.
6923 Redirect output to $tmp just once.
6925 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
6927 * addext.c (<errno.h>): Include.
6928 (errno): Declare if not defined.
6929 (addext): Work correctly when pathconf returns -1 and leaves
6930 errno alone because there is no limit. Also, work even if
6931 pathconf returns a value greater than SIZE_MAX.
6933 2001-08-12 Jim Meyering <meyering@lucent.com>
6935 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
6936 Simply `return getcwd (NULL, 0);'.
6937 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
6938 Use 1300 as initial value for length, not PATH_MAX.
6940 * pathmax.h: Clean up cpp syntax.
6942 2001-08-12 Jim Meyering <meyering@lucent.com>
6944 * gettimeofday.c: New file.
6946 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
6948 2001-08-04 Jim Meyering <meyering@lucent.com>
6950 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
6951 to get in sync with glibc.
6953 2001-08-03 Paul Eggert <eggert@twinsun.com>
6955 The following changes are from gettext 0.10.39 as maintained by
6958 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
6959 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
6960 with inverted sense. All uses changed.
6962 * mbswidth.c: Don't include <limits.h>.
6963 Include <stdlib.h> and <string.h> unconditionally.
6964 (iswcntrl, mbsinit, ISCNTRL): New macros.
6965 (mbsnwidth): Use K&R style function declarations.
6966 Don't bother checking for MB_LEN_MAX == 1, since the compiler
6967 can optimize it when MB_CUR_MAX == 1.
6968 The width of control characters is zero, not 1.
6970 2001-07-15 Jim Meyering <meyering@lucent.com>
6972 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
6973 (BUILT_SOURCES): Add unlocked-io.h.
6974 (io_functions): Define.
6975 (unlocked-io.h): New rule.
6976 (DISTCLEANFILES): Add unlocked-io.h.
6977 (all-local): Depend on unlocked-io.h, to ensure it is created.
6979 * unlocked-io.hin: New file
6981 * regex.c: Update from glibc.
6983 2001-07-05 Jim Meyering <meyering@lucent.com>
6985 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
6987 (libfetish_a_SOURCES): Put all .h files here instead.
6988 Remove a thus-exposed (better checks in automake) duplicate and
6989 two unnecessary .h files.
6991 2001-06-11 Jim Meyering <meyering@lucent.com>
6993 * regex.c: Update from GNU libc.
6995 2001-05-27 Jim Meyering <meyering@lucent.com>
6997 * readutmp.h (UT_TYPE): Define.
6999 2001-05-24 Jim Meyering <meyering@lucent.com>
7001 * argmatch.c: Include "quote.h".
7002 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
7003 quote function. Reported by Göran Uddeborg.
7005 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
7007 * dirname.c (dir_name): Compute append_dot using path, not newpath
7008 which is not yet declared.
7010 2001-05-11 Paul Eggert <eggert@twinsun.com>
7012 * Makefile.am (libfetish_a_SOURCES):
7013 Add strftime.c, since we now compile it on all hosts.
7015 * strftime.c (my_strftime):
7016 Define to nstrftime if emacs, but only if my_strftime is not defined.
7017 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
7018 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
7019 Add one more extra argument: a nanoseconds value.
7022 (my_strftime function): Add %N format.
7023 (emacs_strftimeu): Renamed from emacs_strftime,
7024 with extra ut argument.
7026 2001-05-11 Paul Eggert <eggert@twinsun.com>
7028 dirname code cleanup. base_name now behaves more compatibly
7029 with POSIX basename when given file names that have trailing
7030 slashes, and similarly for dir_name. Add new primitives
7031 base_len and dir_len. Put the directory-name-related decls
7034 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
7035 * backupfile.c (base_name): Likewise.
7036 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
7037 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
7038 * makepath.c (strip_trailing_slashes): Likewise.
7039 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
7041 * rename.c (strip_trailing_slashes): Likewise.
7042 * same.c (base_name): Likewise.
7043 * stripslash.c (ISSLASH): Likewise.
7045 * addext.c: Include <dirname.h> after size_t is defined.
7046 * backupfile.c: Likewise.
7048 * addext.c (addext): Use base_len to trim redundant
7049 trailing slashes instead of doing it ourselves.
7050 But do not trim the last slash if it is not redundant.
7052 * backupfile.c (find_backup_file_name,
7053 max_backup_version): Use base_len instead of rolling it ourselves.
7054 Handle the case of "" and (on DOS) "C:" correctly.
7056 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
7057 Include <string.h>, <dirname.h>.
7058 (base_name): Allow file names ending in slashes, other than names
7059 that are all slashes. In this case, return the basename followed
7060 by the slashes. This is more general, and can be used in places
7061 where the original base_name purposely had an assertion failure.
7062 (base_len): New function.
7064 * dirname.c: Include <string.h> instead of <stdlib.h>.
7065 Do not include <assert.h>; no longer needed.
7067 (memrchr): Remove decl.
7068 (dir_name_r): Remove.
7069 (dir_len): Renamed from dirlen. All callers changed.
7070 Rewrite in terms of base_name, for simplicity and consistency.
7071 (dir_name): Never return NULL. All callers changed.
7072 Do not include <stdlib.h> in test program; no longer needed.
7073 return 0; is fine for test program.
7075 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
7077 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
7079 * path-concat.c (path_concat): Use base_len to compute
7080 base length, not strlen; this means we cannot rely on memcpy
7083 * same.c (STREQ): Remove.
7084 (same_name): Handle the case where the basename ends in trailing '/'.
7086 * stripslash.c (strip_trailing_slashes): Return nonzero if
7087 a slash was stripped. Do not strip the last slash after a
7090 2001-04-08 Jim Meyering <meyering@lucent.com>
7092 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
7093 recomputed; that's necessary when the offset spans a DST transition.
7094 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
7096 2001-04-02 Jim Meyering <meyering@lucent.com>
7098 * regex.h, regex.c: Update from GNU libc.
7100 2001-03-19 Paul Eggert <eggert@twinsun.com>
7102 * version-etc.c (version_etc_copyright): Update to 2001.
7104 2001-03-16 Paul Eggert <eggert@twinsun.com>
7106 * tempname.c (uint64_t): Define to uintmax_t if
7107 not defined, and if UINT64_MAX is not defined.
7108 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
7109 Reported by John David Anglin.
7111 2001-03-10 Bruno Haible <haible@clisp.cons.org>
7113 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
7114 alias if codeset is empty.
7115 * config.charset (BeOS): Use wildcard syntax.
7117 2001-03-13 Jim Meyering <meyering@lucent.com>
7119 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
7120 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
7123 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7125 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
7127 * unicodeio.c (print_unicode_char): Simplify accordingly.
7129 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7131 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
7132 support for DOS/DJGPP.
7134 2001-02-28 Paul Eggert <eggert@twinsun.com>
7136 * Makefile.am (libfetish_a_SOURCES):
7137 Add dup-safer.c, fopen-safer.c.
7138 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
7140 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
7142 2001-02-25 Paul Eggert <eggert@twinsun.com>
7144 The mkstemp replacement is taken from glibc 2.2.2, with some
7145 portability fixes for use outside glibc, as follows:
7147 * tempname.c (struct_stat64): New macro.
7148 (direxists, __gen_tempname): Use it.
7149 This avoids a portability problem with Solaris 8.
7151 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7152 (<stddef.h>, <stdint.h>, <string.h>):
7153 Include only if STDC_HEADERS || _LIBC.
7154 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7155 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7156 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7157 (__set_errno): Define this macro if <errno.h> doesn't.
7158 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7159 Define these macros if <stdio.h> doesn't.
7160 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7161 Define these macros if <sys/stat.h>
7162 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7163 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7164 __xstat64): Define if not _LIBC.
7165 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7166 (__gen_tempname): Invoke gettimeofday only if
7167 HAVE_GETTIMEOFDAY || _LIBC;
7168 otherwise, fall back on plain "time".
7169 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7171 * mkstemp.c (__GT_FILE): Define to zero if not defined.
7173 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7175 2001-02-17 Jim Meyering <meyering@lucent.com>
7177 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
7178 around included file name.
7180 * strnlen.c (__strnlen): Merge in a change from GNU libc.
7182 * strftime.c: Update from GNU libc (the only changes were to comments).
7184 2001-02-13 Bruno Haible <haible@clisp.cons.org>
7186 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7188 2001-02-17 Paul Eggert <eggert@twinsun.com>
7190 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7191 Remove workaround macros for hosts that have mbrtowc but not
7192 mbstate_t, as we now insist on proper declarations for both
7193 before using mbrtowc.
7195 2001-02-17 Jim Meyering <meyering@lucent.com>
7197 * regex.c: Update from libc.
7199 2001-02-16 Paul Eggert <eggert@twinsun.com>
7201 * alloca.c (malloc): Undef before defining, since stdlib.h
7202 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
7203 Reported by Mark Hounschell via Paul Eggert.
7205 2001-01-30 Bruno Haible <haible@clisp.cons.org>
7207 * config.charset: Update for FreeBSD 4.2.
7209 2001-01-26 Jim Meyering <meyering@lucent.com>
7211 * quotearg.c: Include stddef.h.
7212 * quote.c: Include stddef.h.
7213 Reported by Axel Kittenberger.
7215 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7216 line in double quotes so that it evokes a better diagnostic.
7217 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7218 Reported by Axel Kittenberger.
7220 2001-01-15 Bruno Haible <haible@clisp.cons.org>
7222 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7223 to avoid a warning. Add back 'const' to inptr.
7225 2001-01-16 Jim Meyering <meyering@lucent.com>
7227 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7230 2001-01-14 Jim Meyering <meyering@lucent.com>
7232 * rename.c: New file. From Volker Borchert.
7233 Include stdlib.h, string.h or strings.h, and xalloc.h.
7234 Use strip_trailing_slashes rather than open-coding it.
7236 2001-01-03 Paul Eggert <eggert@twinsun.com>
7238 * strftime.c: Sync with glibc time/strftime.c 1.81.
7240 2001-01-03 Jim Meyering <meyering@lucent.com>
7242 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7243 local `inptr' to avoid warning with some system declarations of iconv.
7245 2000-12-29 Paul Eggert <eggert@twinsun.com>
7247 * modechange.c: Do not assume that mode_t uses the
7248 traditional octal encoding. E.g. "chmod 1 FOO" should set
7249 the other-execute bit of FOO even if S_IXOTH != 1.
7251 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7252 WOTH, XOTH, ALLM): New macros.
7253 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7254 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7256 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7257 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7259 No need to use uintmax_t; unsigned long is long enough.
7260 Don't bother to get suffix since we don't use it.
7262 2000-12-24 Jim Meyering <meyering@lucent.com>
7264 * hash.c (is_prime): Return explicit boolean values.
7265 (hash_get_first): Return NULL to appease Irix5.6's 89.
7266 Reported by Nelson Beebe.
7268 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7270 * localcharset.c (locale_charset): Add support for Win32.
7272 2000-12-18 Paul Eggert <eggert@twinsun.com>
7274 * physmem.h, physmem.c: New files.
7276 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7277 (noinst_HEADERS): Add physmem.h.
7279 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7280 't' for compatibility with Solaris 8 sort.
7282 2000-12-18 Bruno Haible <haible@clisp.cons.org>
7284 * config.charset: Add support for BeOS.
7286 2000-12-16 Jim Meyering <meyering@lucent.com>
7288 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7289 SHELLS_FILE to a file name that's useful on djgpp systems.
7291 (ADDITIONAL_DEFAULT_SHELLS): Define.
7292 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7293 Based mostly on a patch from Prashant TR.
7295 2000-12-16 Jim Meyering <meyering@lucent.com>
7297 This bug had a serious impact on chown: `chown N:M FILE' (for integer
7298 N and M) would have treated it like `chown N:N FILE'.
7300 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7302 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7304 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7305 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7306 to the list of canonical encodings. Rename EUC-CN to GB2312.
7308 2000-12-08 Andreas Schwab <schwab@suse.de>
7310 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7311 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7313 2000-12-07 Jim Meyering <meyering@lucent.com>
7315 * stripslash.c (ISSLASH): Define.
7316 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7319 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7320 (dir_name_r): Declare this function as static.
7321 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7322 manifest itself on a name containing a mix of slashes and
7324 Make this function work with names starting with a DOS-style
7325 drive letter and colon prefix.
7326 (dir_name): Append `.' if necessary.
7327 Based mostly on patches from Prashant TR and Eli Zaretskii.
7329 * dirname.h (dir_name_r): Remove prototype.
7331 2000-12-05 Jim Meyering <meyering@lucent.com>
7333 * dirname.c (dir_name_r): Add `const' in a few local declarations.
7335 2000-12-04 Jim Meyering <meyering@lucent.com>
7337 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7338 Also include memory.h, stdlib.h, unistd.h if appropriate.
7339 Reported by Andreas Jaeger (conflicting declaration of malloc).
7341 2000-12-02 Jim Meyering <meyering@lucent.com>
7343 * closeout.h: Make idempotent, to avoid some obscure warnings.
7345 2000-12-01 Paul Eggert <eggert@twinsun.com>
7347 * memrchr.c: Include <config.h> before any system include file.
7349 2000-11-29 Paul Eggert <eggert@twinsun.com>
7351 * dirname.c (dir_name_r): Fix typo: int -> size_t.
7353 2000-11-26 Jim Meyering <meyering@lucent.com>
7355 * memcoll.c: Include sys/types.h. From Werner Almesberger.
7357 2000-11-22 Paul Eggert <eggert@twinsun.com>
7359 * strftime.c (my_strftime): Do not invoke mbrlen with a
7360 size of (size_t) -1; it's not portable.
7362 2000-11-17 Akim Demaille <akim@epita.fr>
7364 * obstack.h: Formatting changes.
7365 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7366 prevent type checking.
7367 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7368 cast the value to (void *): assigning a `foo *' to a `void *'
7370 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7372 2000-11-17 Jim Meyering <meyering@lucent.com>
7374 * strstr.c: Update from GNU libc.
7376 2000-11-16 Jim Meyering <meyering@lucent.com>
7378 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7380 2000-11-11 Jim Meyering <meyering@lucent.com>
7382 * error.c: Add a couple #includes, merging from GNU libc version.
7384 2000-11-10 Jim Meyering <meyering@lucent.com>
7386 * obstack.h: Update from GNU libc.
7387 * obstack.c: Likewise.
7389 2000-11-06 Paul Eggert <eggert@twinsun.com>
7391 * getusershell.c (setusershell): Use rewind rather than
7392 fseek/fseeko, to avoid configuration hassles with fseeko.
7393 Don't bother opening SHELLS_FILE if shellstream is NULL;
7396 2000-11-05 Jim Meyering <meyering@lucent.com>
7398 * makepath.h (make_dir): Declare.
7399 * makepath.c (make_dir): Remove `static' attribute.
7402 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
7404 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
7405 last one in a bucket, advance to the next bucket.
7407 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
7409 * fnmatch.c: Do not comment out all the code if we are using
7410 the GNU C library, because in some cases we are replacing buggy
7411 code in the GNU C library itself.
7413 2000-10-30 Paul Eggert <eggert@twinsun.com>
7415 * error.h, getline.h, modechange.h:
7416 Remove "2000" from Copyright line, as the file hasn't been
7417 changed this year other than in the copyright notice.
7419 * xalloc.h: Add "2000" to Copyright line, as this file
7420 was changed this year.
7422 2000-10-30 Paul Eggert <eggert@twinsun.com>
7424 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
7425 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
7426 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
7428 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
7430 * regex.h (__restrict_arr): Move definition out of #ifndef block.
7431 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
7432 doesn't define __restrict_arr.
7434 2000-10-29 Jim Meyering <meyering@lucent.com>
7436 * xstat.in: Fix grammar in comment.
7438 2000-10-28 Jim Meyering <meyering@lucent.com>
7440 * memchr.c: Update from libc.
7441 Adjust for portability:
7442 [HAVE_STDLIB_H]: Include stdlib.h.
7443 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
7444 Undef __memchr, too.
7445 [!weak_alias]: Define __memchr to memchr.
7447 * regex.c: Update from libc.
7448 * regex.h: Likewise.
7449 * getopt1.c: Likewise.
7450 * memcmp.c: Likewise.
7452 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
7453 Avoid using fseek, when possible -- it's broken by design.
7454 Patch by Ulrich Drepper.
7456 2000-10-26 Jim Meyering <meyering@lucent.com>
7458 * strftime.c: Update from libc.
7460 2000-10-25 Jim Meyering <meyering@lucent.com>
7462 * obstack.c: Update from libc.
7464 2000-10-23 Jim Meyering <meyering@lucent.com>
7466 * hard-locale.c (hard_locale): Revert last change -- it was simply
7467 wrong. That set_locale call must not have any side effects.
7470 2000-10-22 Jim Meyering <meyering@lucent.com>
7472 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
7473 [CYCLIC]: Remove now-unused definition.
7475 * save-cwd.c (O_DIRECTORY): Define, if needed.
7476 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
7477 Suggestion from Ulrich Drepper.
7479 2000-10-21 Jim Meyering <meyering@lucent.com>
7481 * dirname.c (dir_name_r): New function, factored out of dir_name.
7482 (dir_name): Use dir_name_r.
7483 * dirname.h (dir_name_r): Declare it.
7485 2000-10-21 Jim Meyering <meyering@lucent.com>
7487 * dirname.c (memrchr): Declare if necessary.
7488 (dir_name): Remove the restriction that there be no
7489 trailing slashes. Now, this code skips past them, effectively
7491 [TEST_DIRNAME] (main): New unit tests.
7493 * memrchr.c: New file from GNU libc.
7494 Undef __memrchr, too.
7495 [!weak_alias]: Define __memrchr to memrchr.
7496 Guard weak_alias use with `#ifdef weak_alias'.
7498 2000-10-17 Jim Meyering <meyering@lucent.com>
7500 * quote.h (PARAMS): Define and use.
7501 Reported by Akim Demaille.
7503 * getopt.c: Update from libc.
7505 2000-10-16 Jim Meyering <meyering@lucent.com>
7507 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
7510 2000-09-25 Jim Meyering <meyering@lucent.com>
7512 * md5.h (rol): Define (from GnuPG).
7514 * sha.c: Give credit (GnuPG) where due.
7515 (M): Use rol rather than open-coding it.
7516 Add a FIXME comment.
7518 2000-09-21 Jim Meyering <meyering@lucent.com>
7520 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
7521 Reported by Michael Stone.
7523 2000-09-20 Jim Meyering <meyering@lucent.com>
7525 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
7526 (noinst_HEADERS): Add sha.h.
7527 Based on code from Scott G. Miller and from GnuPG.
7529 2000-09-15 Jim Meyering <meyering@lucent.com>
7531 * regex.c: Update from libc.
7533 2000-09-10 Jim Meyering <meyering@lucent.com>
7535 * getopt.c (_getopt_internal): Update from glibc.
7537 2000-09-09 Jim Meyering <meyering@lucent.com>
7539 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
7540 think it should be used as a general replacement for isascii.
7541 * fnmatch.c: Likewise.
7542 * mbswidth.c: Likewise
7543 * regex.c: Likewise.
7546 * userspec.c: Include sys/param.h and limits.h.
7548 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7549 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
7550 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
7551 UID, GID. Check range.
7553 2000-09-06 Jim Meyering <meyering@lucent.com>
7555 * getopt.c (_getopt_internal): Update from glibc.
7557 2000-08-30 Jim Meyering <meyering@lucent.com>
7559 * strftime.c: Merge in changes from GNU libc.
7561 2000-08-26 Jim Meyering <meyering@lucent.com>
7563 * closeout.c: Include "__fpending.h".
7564 (close_stdout_status): Return right away if there's nothing to flush.
7566 * Makefile.am (noinst_HEADERS): Add __fpending.h.
7567 * __fpending.c: New file.
7568 * __fpending.h: New file.
7570 2000-08-07 Paul Eggert <eggert@twinsun.com>
7572 Standardize on "memory exhausted" instead of "Memory exhausted"
7573 or "virtual memory exhausted".
7574 * obstack.c (print_and_abort): Use "memory exhausted", not
7575 "virtual memory exhausted".
7576 * same.c (same_name): Invoke xalloc_die instead of printing
7578 * userspec.c (parse_user_spec): Likewise.
7579 * bumpalloc.h: comment fix
7580 * same.c, userspec.c: Include xalloc.h.
7582 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
7583 not char *const and pointing to a constant array.
7584 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
7585 (xrealloc): Comment fix.
7587 * userspec.c (parse_user_spec):
7588 Don't translate a message until just before returning,
7589 to avoid unnecessary translation.
7591 2000-08-07 Jim Meyering <meyering@lucent.com>
7593 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
7594 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
7595 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
7596 getgroups.c, gethostname.c, getopt.h, group-member.c,
7597 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
7598 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
7599 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
7600 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
7601 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
7602 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
7603 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
7604 yesno.c: Back out Copyright date changes for each file with no change
7605 this year. This eases coordination with other programs using the same
7606 source code modules. From Paul Eggert.
7608 2000-08-03 Greg McGary <greg@mcgary.org>
7610 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
7611 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
7612 (EXTEND_BUFFER): Use them.
7614 2000-08-01 Jim Meyering <meyering@lucent.com>
7616 * dirname.c (ISSLASH): Define.
7617 (BACKSLASH_IS_PATH_SEPARATOR): Define.
7618 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
7619 both `\' and `/' may be use as path separators.
7620 Based on a patch from Prashant TR.
7622 2000-07-31 Paul Eggert <eggert@twinsun.com>
7624 * quotearg.c (quotearg_n_options): Don't make the initial
7625 slot vector a constant, since it might get modified.
7627 2000-07-31 Jim Meyering <meyering@lucent.com>
7629 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
7630 * obstack.c (print_and_abort): Likewise.
7632 2000-07-30 Paul Eggert <eggert@twinsun.com>
7634 * quotearg.c (quotearg_n_options): Preallocate a slot 0
7635 buffer, so that the caller can always quote one small
7636 component of a "memory exhausted" message in slot 0.
7637 From a suggestion by Jim Meyering.
7639 2000-07-30 Jim Meyering <meyering@lucent.com>
7641 * makepath.c (make_path): Quote the other instance, too.
7643 * quotearg.c (N_STATIC_SLOTVECS): Define.
7644 (STATIC_BUF_SIZE): Define.
7645 (quotearg_n_options): Use only statically allocated storage when
7646 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
7647 than STATIC_BUF_SIZE.
7649 2000-07-29 Jim Meyering <meyering@lucent.com>
7651 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
7652 * dirname.c (dir_name): Likewise.
7654 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
7656 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
7657 (dir_name): Assert that there are no trailing slashes.
7659 2000-07-18 Bruno Haible <haible@clisp.cons.org>
7661 * mbswidth.h (mbswidth): Add a flags argument.
7662 (mbswidth): New declaration.
7663 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
7664 * mbswidth.c (mbswidth): Add a flags argument.
7665 (mbsnwidth): New function.
7667 2000-07-24 Jim Meyering <meyering@lucent.com>
7669 * mbswidth.c: Remove useless #else. From Bruno Haible.
7671 2000-07-23 Paul Eggert <eggert@twinsun.com>
7673 * mbswidth.c (_XOPEN_SOURCE):
7674 Don't define; this causes problems on Solaris 7.
7675 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
7677 2000-07-23 Paul Eggert <eggert@twinsun.com>
7680 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
7681 so that mbstate_t is always defined.
7683 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
7684 be 1 in at least one GCC installation, and this configuration
7685 error is likely to be common. Ignoring MB_LEN_MAX hurts
7686 performance on hosts that have mbrtowc but have only unibyte
7687 locales, but I assume these hosts are rare.
7689 2000-07-23 Paul Eggert <eggert@twinsun.com>
7691 * quotearg.c: Streamline by invoking multibyte code only if needed.
7692 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
7693 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
7694 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
7695 invoke multibyte primitives.
7697 2000-07-23 Jim Meyering <meyering@lucent.com>
7699 * basename.c (base_name): Add an assertion.
7701 2000-07-15 Bruno Haible <clisp.cons.org>
7703 * quotearg.c: When the system forces us to redefine mbstate_t,
7704 shadow its mbsinit function.
7706 2000-07-16 Bruno Haible <haible@clisp.cons.org>
7708 * mbswidth.h: New file.
7709 * mbswidth.c: New file.
7710 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
7711 (noinst_HEADERS): Add mbswidth.h.
7713 2000-07-17 Bruno Haible <haible@clisp.cons.org>
7715 * config.charset: Add support for FreeBSD. Improve support for HP-UX
7718 2000-07-15 Jim Meyering <meyering@lucent.com>
7720 * makepath.c: Include quote.h.
7721 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
7722 corresponding argument in a `quote (...)' call.
7723 Give better diagnostics.
7725 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
7726 (noinst_HEADERS): Add quote.h.
7728 * quote.c (quote, quote_n): New file. Two functions taken verbatim
7729 from tar's src/misc.c.
7730 * quote.h: New file. Prototypes for same.
7732 2000-07-10 Paul Eggert <eggert@twinsun.com>
7734 From a suggestion by Bruno Haible.
7735 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
7736 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
7737 to decide whether to define the BeOS workaround macro;
7738 this adjusts to the change to AC_MBSTATE_T.
7740 2000-07-13 Paul Eggert <eggert@twinsun.com>
7742 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
7744 * quotearg.c (quoting_style_args, quoting_style_vals,
7745 quotearg_buffer_restyled): Add support for
7746 clocale_quoting_style. Undo previous change to
7747 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
7748 and "{RIGHT QUOTATION MARK}" msgids.
7750 2000-07-05 Paul Eggert <eggert@twinsun.com>
7752 The old behavior of quoting `like this' doesn't look good with
7753 newer, ISO-style fonts. See:
7754 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
7756 Instead, quote "like this" by default. Let the translator
7757 tailor the locale-specific quoting behavior by providing
7758 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
7760 * quotearg.c (N_): New macro.
7761 (gettext_default): New function.
7762 (quotearg_buffer_restyled): Use
7763 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
7764 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
7766 2000-07-09 Jim Meyering <meyering@lucent.com>
7768 * Most files: Update copyright dates to include 2000.
7770 2000-07-08 Jim Meyering <meyering@lucent.com>
7772 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
7774 (xgethostname): Remove now-unnecessary #ifdef.
7775 Move declaration of `err' into loop where it's used.
7777 2000-07-05 Bruno Haible <haible@clisp.cons.org>
7779 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
7780 by allocating a larger buffer. Test the gethostname return value for
7781 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
7782 returns an error and ENAMETOOLONG isn't defined.
7784 2000-07-05 Paul Eggert <eggert@twinsun.com>
7785 and Bruno Haible <haible@clisp.cons.org>
7787 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
7789 2000-07-05 Bruno Haible <haible@clisp.cons.org>
7791 * quotearg.c (struct quoting_options): Simplify quote_these_too
7794 2000-07-03 Jim Meyering <meyering@lucent.com>
7796 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
7797 Reported by Bruno Haible.
7799 2000-07-04 Jim Meyering <meyering@lucent.com>
7801 * quotearg.c: Make inclusion of <wchar.h> independent of whether
7802 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
7805 2000-07-03 Paul Eggert <eggert@twinsun.com>
7806 and Bruno Haible <haible@clisp.cons.org>
7808 * quotearg.c (mbrtowc):
7809 Assign to *pwc, and return 1 only if result is nonzero.
7810 (iswprint): Use ISPRINT when substituting our own mbrtowc.
7812 2000-07-03 Jim Meyering <meyering@lucent.com>
7814 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
7815 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
7818 2000-07-02 Jim Meyering <meyering@lucent.com>
7820 * quotearg.c (mbstate_t): Don't define here.
7822 2000-07-02 Jim Meyering <meyering@lucent.com>
7824 * nanosleep.c (SIGCONT): Define if not already defined.
7826 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7828 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
7829 per change in ../m4/ls-mntd-fs.m4.
7830 (read_filesystem_list): Ignore symbolic links.
7832 2000-06-29 Jim Meyering <meyering@lucent.com>
7834 * same.c: Include <string.h> or <strings.h>, as appropriate,
7835 for declaration of strcmp.
7837 * long-options.c: Include <stdlib.h>, for declaration of exit.
7839 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
7840 Avoid warning by casting result to `char *' to remove `const'.
7842 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7844 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
7846 2000-06-26 Paul Eggert <eggert@twinsun.com>
7848 savedir now sets errno on failure and invokes xmalloc to get memory.
7849 Fix a couple of other minor bugs while we're at it.
7851 * savedir.c (<unistd.h>): Do not include; there's no need.
7852 (NAMLEN): Remove macro.
7853 (malloc, realloc): Remove decls.
7855 ("xalloc.h"): Include.
7856 (NAME_SIZE_DEFAULT): New macro.
7857 (savedir): Use xmalloc / xrealloc to allocate memory.
7858 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
7859 Skip "" directory entries.
7860 Use strlen to calculate directory entry length, since the old method
7861 is rarely used these days and isn't worth supporting.
7862 Don't use a pointer after freeing it.
7863 Check for integer overflow when calculating allocation size.
7864 Use memcpy to copy entries, instead of stpcpy.
7865 Set errno properly when returning NULL.
7866 Check for readdir error.
7868 2000-06-26 Jim Meyering <meyering@lucent.com>
7870 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
7872 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7874 * getusershell.c (xmalloc, xrealloc): Remove functions.
7876 Don't include <stdlib.h>. Don't declare malloc, realloc.
7878 2000-06-23 Bruno Haible <haible@clisp.cons.org>
7880 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
7882 2000-06-24 Jim Meyering <meyering@lucent.com>
7884 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
7886 2000-06-21 Jim Meyering <meyering@lucent.com>
7888 * getpass.c: New file, from Bruno Haible. Required for BeOS.
7890 2000-06-19 Paul Eggert <eggert@twinsun.com>
7892 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
7893 (mbrtowc, mbstate_t): Define substitutes if
7894 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
7895 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
7896 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
7898 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7900 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
7901 than 1024, return a memory chunk of least possible size, instead
7902 of size PATH_MAX + 2. In the loop, increment the size proportionally.
7903 Use free/xmalloc instead of xrealloc to avoid copying for very long
7906 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7908 * canon-host.c (canon_host): Use malloc and memcpy to copy an
7909 address, not strdup. Include <stdlib.h> and don't declare free().
7911 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7913 * path-concat.c (path_concat): Don't access dir[-1] if dir is
7916 2000-06-21 Jim Meyering <meyering@lucent.com>
7918 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
7919 (noinst_HEADERS): Add getstr.h.
7921 * getline.c (getstr): Move into a separate file.
7922 * getstr.c (getstr): New file, extracted from getline.c, with
7923 the following changes: new parameter, delim2; both delim[12]
7924 parameters have type `int', not `char'. The latter would lose
7925 with 8-bit delimiters.
7926 * getstr.h: New file.
7928 2000-06-19 Jim Meyering <meyering@lucent.com>
7930 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
7932 2000-06-18 Jim Meyering <meyering@lucent.com>
7934 * mkdir.c: Remove file, due mainly to copyright incompatibility.
7935 Besides, these days every porting target provides a mkdir function.
7937 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
7938 (this snippet comes from src/system.h).
7940 2000-06-15 Paul Eggert <eggert@twinsun.com>
7942 * human.c (adjust_value): New function.
7943 (human_readable_inexact): Apply rounding style even when
7944 printing approximate values.
7946 2000-06-14 Paul Eggert <eggert@twinsun.com>
7948 * human.c (human_readable_inexact): Allow an input block
7949 size that is not a multiple of the output block size, and vice versa.
7950 Reported by Piergiorgio Sartor.
7952 2000-06-14 Paul Eggert <eggert@twinsun.com>
7954 * getdate.y (get_date): Apply relative times after time
7955 zone indicator, not before. Reported by Todd A. Jacobs.
7957 2000-06-13 Jim Meyering <meyering@lucent.com>
7959 * Makefile.am (all-local): Depend on lstat.c and stat.c.
7961 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
7963 2000-06-12 Paul Eggert <eggert@twinsun.com>
7965 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
7967 2000-06-04 Paul Eggert <eggert@twinsun.com>
7969 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
7971 2000-06-04 Jim Meyering <meyering@lucent.com>
7973 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
7974 SunOS 4.1.4 for which gid_t is an unsigned type.
7976 2000-06-03 Jim Meyering <meyering@lucent.com>
7978 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
7980 2000-05-26 Bruno Haible <haible@clisp.cons.org>
7982 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
7983 newer, don't install charset.alias.
7984 * config.charset: Change the Linux/glibc rules so they become empty
7985 on glibc-2.1 or newer.
7987 2000-06-02 Jim Meyering <meyering@lucent.com>
7989 * mountlist.c: Back out last change. Instead, do this...
7990 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
7991 member using the same `ignore'-testing code.
7992 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
7996 2000-05-29 Jim Meyering <meyering@lucent.com>
7998 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
7999 with the `ignore' attribute. Based on a patch from Mark D. Roth.
8001 2000-05-22 Jim Meyering <meyering@lucent.com>
8003 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
8005 2000-05-18 Jim Meyering <meyering@lucent.com>
8007 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
8008 back, too, since it may have been modified by allocate_entry.
8009 (hash_delete): Rewrite to use neither the assignment operator
8010 nor the comma operator in an if-expression.
8012 2000-05-15 Paul Eggert <eggert@twinsun.com>
8015 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
8016 Remove; no longer needed.
8017 "quotearg.h": Add include.
8018 (file_name): Do not bother to explicitly initialize to NULL; it's less
8019 efficient on some hosts.
8020 (close_stdout_status): Remove test as to whether stdout was already
8021 closed; it breaks for the case "echo x | sort >&-".
8022 Quote file name colons.
8023 Do not assume that _("write error") lacks format strings.
8025 2000-05-15 Jim Meyering <meyering@lucent.com>
8027 * version-etc.c (version_etc_copyright): Update the copyright string
8028 used in all --version output.
8030 2000-05-14 Jim Meyering <meyering@lucent.com>
8032 * closeout.c (close_stdout_set_file_name): New function.
8033 (close_stdout_status): Use new file-scoped global.
8034 Return right away if fstat says the stdout file descriptor is invalid.
8035 * closeout.h (close_stdout_set_file_name): Declare.
8037 2000-05-10 Jim Meyering <meyering@lucent.com>
8039 * closeout.c [default_exit_status]: New file-scoped variable.
8040 (close_stdout_set_status): New function.
8041 * closeout.h (close_stdout_set_status): Declare.
8043 2000-05-08 Jim Meyering <meyering@lucent.com>
8045 * long-options.c: Don't include closeout.h.
8046 (parse_long_options): Don't call close_stdout for --version.
8048 2000-05-06 Jim Meyering <meyering@lucent.com>
8050 * strnlen.c: Undefine __strnlen and strnlen.
8051 [!weak_alias]: Define __strnlen to strnlen.
8053 * atexit.c: New file, from libiberty.
8055 2000-05-06 Jim Meyering <meyering@lucent.com>
8057 * closeout.c (close_stdout_status): Also check for errors on the
8060 2000-05-05 Bruno Haible <haible@clisp.cons.org>
8062 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
8063 instead of xmalloc, xrealloc, path_concat.
8064 (locale_charset): Treat empty environment variables as absent.
8065 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
8067 2000-05-04 Jim Meyering <meyering@lucent.com>
8069 * getopt.c: Update from glibc.
8070 * obstack.c: Likewise.
8071 * obstack.h: Likewise.
8072 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
8074 * regex.h: Likewise.
8075 * strndup.c: Likewise.
8076 * strnlen.c: New file, from glibc.
8078 2000-05-01 Jim Meyering <meyering@lucent.com>
8080 * full-write.c (full_write): Remove `FIXME' part of comment.
8082 2000-04-29 Jim Meyering <meyering@lucent.com>
8084 * path-concat.c: Declare strdup only if it's not defined.
8085 * canon-host.c: Likewise.
8087 2000-04-28 Jim Meyering <meyering@lucent.com>
8089 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
8090 redefinition warning on some systems (HPUX). Otherwise, regex.h is
8091 included first, then limits.h is included by locale.h by libintl.h.
8092 From John David Anglin.
8094 2000-04-25 Jim Meyering <meyering@lucent.com>
8096 * makepath.c (S_IRWXUGO): Define.
8097 (make_path): Always perform explicit chmod if MODE specifies any
8098 of the `special' permission bits. Prompted by a bug report against
8099 install from Mate Wierdl and Joost van Baal.
8101 2000-04-18 Jim Meyering <meyering@lucent.com>
8105 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
8106 getpagesize. For BeOS. Based on a patch from Bruno Haible.
8108 2000-04-17 Jim Meyering <meyering@lucent.com>
8110 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
8111 the definition of it to rpl_strftime also defined-away the system's
8114 2000-04-15 Jim Meyering <meyering@lucent.com>
8116 Use `C' to denote so-called `contiguous' files, the same way
8118 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
8119 (ftypelet): Use S_ISCTG.
8120 From Michael Deutschmann.
8122 2000-04-14 Jim Meyering <meyering@lucent.com>
8124 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
8126 2000-04-08 Jim Meyering <meyering@lucent.com>
8128 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
8129 names don't conflict. Reported by Eli Zaretskii.
8131 2000-03-28 Bruno Haible <haible@clisp.cons.org>
8133 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
8134 bug. Deal with the different error behavior of Irix iconv.
8136 2000-04-07 Jim Meyering <meyering@lucent.com>
8138 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
8139 to work around system header problems on AIX 3.2.5. From Bruno Haible.
8141 2000-04-05 Jim Meyering <meyering@lucent.com>
8143 Portability tweaks required for ultrix4.3.
8144 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8145 * readutmp.c: Include sys/types.h before sys/stat.h.
8146 * canon-host.c: Declare strdup.
8147 * path-concat.c: Likewise.
8148 From John David Anglin.
8150 2000-04-04 Jim Meyering <meyering@lucent.com>
8152 Be more DOS 8.3-friendly.
8153 * ref-add.sin: Renamed from ref-add.sed.in.
8154 * ref-del.sin: Renamed from ref-del.sed.in.
8155 * Makefile.am: Reflect renaming.
8156 Reported by Eli Zaretskii.
8158 Use a temporary file name that won't clash with `charset.alias'
8159 in the DOS 8.3 name space.
8160 * Makefile.am (charset_tmp): Define.
8161 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8162 (uninstall-local): Likewise.
8163 Reported by Eli Zaretskii.
8165 2000-03-29 Paul Eggert <eggert@twinsun.com>
8167 * time/strftime.c (my_strftime): Make sure we call the system
8168 strftime, not ourselves, when invoking the underlying strftime.
8170 2000-03-24 Jim Meyering <meyering@lucent.com>
8172 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8173 (charset_alias): Define.
8174 (install-exec-local): Factor out common code.
8175 (uninstall-local): Split lines longer than 80.
8176 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8178 (.sed.in.sed): New rule. Don't redirect directly to $@.
8179 (CLEANFILES): Add ref-add.sed and ref-del.sed.
8181 2000-03-19 Bruno Haible <haible@clisp.cons.org>
8183 * config.charset: Output a line containing "Packages using this file".
8184 * ref-add.sed.in, ref-del.sed.in: New files.
8185 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8186 ref-del.sed): New rules.
8188 2000-03-17 Jim Meyering <meyering@lucent.com>
8190 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8191 Otherwise, include <strings.h>
8193 2000-03-17 Bruno Haible <haible@clisp.cons.org>
8195 * unicodeio.c (utf8_wctomb): New function.
8196 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8197 format instead of in UCS-4 with platform dependent endianness.
8199 2000-03-07 Paul Eggert <eggert@twinsun.com>
8201 * savedir.c (savedir): Work even if directory size is
8202 negative; this can happen with some screwy NFS configurations.
8204 2000-03-06 Jim Meyering <meyering@lucent.com>
8206 * localcharset.c (get_charset_aliases): Don't try to free file_name
8207 if it's NULL (because we ran out of memory). From Bruno Haible.
8209 2000-03-05 Jim Meyering <meyering@lucent.com>
8211 * localcharset.c ("path-concat.h"): Include.
8212 (get_charset_aliases): Use path_concat instead of ANSI string
8215 * unicodeio.h (PARAMS): Define.
8216 Use it to guard prototype.
8218 2000-03-04 Jim Meyering <meyering@lucent.com>
8220 * Makefile.am (install-exec-local): Create $(libdir) before installing
8222 (uninstall-local): Uncomment this rule so `make distcheck' works
8225 * unicodeio.c (<errno.h>): Include it.
8226 (errno): Declare if not defined.
8228 * localcharset.c: Add Bruno's comment justifying use of volatile.
8230 * config.charset: New version, incorporating remarks from a linux
8231 i18n mailing list. From Bruno Haible.
8233 2000-03-02 Jim Meyering <meyering@lucent.com>
8235 * Makefile.am (EXTRA_DIST): Add config.charset.
8237 2000-03-01 Jim Meyering <meyering@lucent.com>
8239 * localcharset.c: Guard some #includes with `#if HAVE_...'.
8240 * unicodeio.c: Likewise.
8242 2000-02-02 Bruno Haible <haible@clisp.cons.org>
8244 * config.charset: New file.
8245 * localcharset.c: New file.
8246 * unicodeio.h, unicodeio.c: New files.
8247 * Makefile.am (DEFS): Add -DLIBDIR=...
8248 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8249 (noinst_HEADERS): Add unicodeio.h.
8250 (all-local, install-exec-local, charset.alias): New targets.
8252 2000-02-28 Paul Eggert <eggert@twinsun.com>
8254 * quotearg.c (ALERT_CHAR): New macro.
8255 (quotearg_buffer_restyled): Use it.
8257 2000-02-27 Jim Meyering <meyering@lucent.com>
8259 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8260 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8262 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8263 not `#if STDC_HEADERS'.
8264 Declare malloc if needed.
8266 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8267 now that autoconf always defines the HAVE_DECL_ symbols.
8268 * human.c: Likewise.
8270 * strtoumax.c: Likewise.
8272 * backupfile.c: Arrange for cpp to fail if the configure-time
8273 declaration check was not run.
8275 * human.c: Likewise.
8277 * strtoumax.c: Likewise.
8279 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8280 then first look up the entire `.'-containing string as a login name.
8282 2000-02-18 Paul Eggert <eggert@twinsun.com>
8284 * getdate.y: Handle two-digit years with leading zeros correctly.
8285 (textint): New typedef.
8286 (parser_control): Member year changed from int to textint.
8288 (YYSTYPE): Removed; replaced by %union with int and textint members.
8289 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8290 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8291 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8292 (tSNUMBER, tUNUMBER): Now of type <textintval>.
8293 (date, number, to_year): Use width of number in digits, not its value,
8294 to determine whether it's a 2-digit year, or a 2-digit time.
8295 (yylex): Store number of digits of numeric tokens.
8296 Reported by John Kendall.
8298 (parser_control): Changed from struct parser_control to typedef (for
8299 consistency). All uses changed.
8301 (tID): Removed; not used.
8302 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8304 2000-02-14 Paul Eggert <eggert@twinsun.com>
8306 * getpagesize.h (getpagesize): Port to VMS for Alpha;
8307 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8309 2000-02-12 Jim Meyering <meyering@lucent.com>
8311 * userspec.c (ISDIGIT): Define it.
8312 (isdigit): Remove definition.
8313 (is_number): Use ISDIGIT, not isdigit.
8314 <libintl.h>: Include.
8316 (parse_user_spec): Mark translatable strings.
8318 2000-02-10 Jim Meyering <meyering@lucent.com>
8320 With these changes, nanosleep.[ch] are finally enough like the other
8321 lib/* replacement files to compile on a few more losing systems.
8323 * nanosleep.h: Don't include config.h.
8324 Remove prototype from declaration of nanosleep.
8325 (PARAMS): Remove now-unneeded definition.
8326 * nanosleep.c: #undef nanosleep.
8327 (rpl_nanosleep): Rename from nanosleep.
8329 2000-02-03 Jim Meyering <meyering@lucent.com>
8331 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8332 rather than with `#if HAVE_UTMPNAME'.
8334 2000-02-01 Jim Meyering <meyering@lucent.com>
8336 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
8338 2000-01-31 Jim Meyering <meyering@lucent.com>
8340 * nanosleep.h (nanosleep): Guard declaration with
8341 `#if ! HAVE_DECL_NANOSLEEP'.
8342 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8343 the declaration in that vendor's sys/timers.h.
8344 Reported by Christian Krackowizer.
8346 * quotearg.c (ISASCII): Add #undef and move definition to follow
8347 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8348 (ISPRINT): Likewise.
8349 Reported by Tom Tromey.
8351 2000-01-30 Jim Meyering <meyering@lucent.com>
8353 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8354 uses of ->ut_name. The latter doesn't work with new Linux header files
8355 where only utmpx.ut_user is declared.
8357 * readutmp.h (UT_USER): Define.
8359 2000-01-23 Jim Meyering <meyering@lucent.com>
8361 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8364 2000-01-22 Jim Meyering <meyering@lucent.com>
8366 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8367 [! HAVE_DECL_STRTOULL]: Declare strtoull.
8368 Required for some AIX systems. Reported by Christian Krackowizer.
8369 [TESTING] (main): New function.
8371 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
8372 * dirname.c (dir_name): Support for DOS-style file names with drive
8375 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8377 * strverscmp.c (ISDIGIT): Define.
8378 (strverscmp): Use ISDIGIT, not isdigit.
8380 2000-01-17 Paul Eggert <eggert@twinsun.com>
8382 * nanosleep.c (nanosleep):
8383 Don't use SA_INTERRUPT to decide whether to call sigaction, as
8384 POSIX.1 doesn't require SA_INTERRUPT and some systems
8385 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
8386 it's been part of POSIX.1 since day 1 (in 1988).
8388 2000-01-17 Jim Meyering <meyering@lucent.com>
8390 * interlock: Remove unused file. Reported by François Pinard.
8392 2000-01-16 Paul Eggert <eggert@twinsun.com>
8394 * quotearg.c (quotearg_buffer_restyled): Do not quote
8395 alert, backslash, formfeed, and vertical tab unnecessarily in
8396 shell quoting style.
8399 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
8400 Free Software Foundation, Inc.
8401 Copying and distribution of this file, with or without modification,
8402 are permitted provided the copyright notice and this notice are preserved.