1 2005-10-12 Simon Josefsson <jas@extundo.com>
3 * gc-libgcrypt.c (gc_md5): Fix assert call.
6 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
8 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
10 * gc-gnulib.c (gc_hash_buffer): Ditto.
12 2005-10-11 Bruno Haible <bruno@clisp.org>
14 * c-strcasestr.h: New file, from GNU gettext.
15 * c-strcasestr.c: New file, from GNU gettext.
17 2005-10-11 Bruno Haible <bruno@clisp.org>
19 * c-strcase.h: New file, from GNU gettext.
20 * c-strcasecmp.c: New file, from GNU gettext.
21 * c-strncasecmp.c: New file, from GNU gettext.
23 2005-10-11 Simon Josefsson <jas@extundo.com>
25 * crc.h, crc.c: New files.
27 * gc.h (gc_hash_buffer): Add doc.
29 2005-10-08 Simon Josefsson <jas@extundo.com>
31 * gc.h: Add gc_hash and gc_hash_buffer.
33 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
35 * gc-libgcrypt.c (gc_hash_buffer): Add.
37 2005-10-11 Bruno Haible <bruno@clisp.org>
39 * strcasecmp.c: Include limits.h.
40 (strcasecmp): Avoid integer overflow on exotic platforms.
41 * strncasecmp.c: Include limits.h.
42 (strncasecmp): Avoid integer overflow on exotic platforms.
43 Reported by Paul Eggert.
45 2005-10-06 Simon Josefsson <jas@extundo.com>
47 * hmac-md5.c: New file.
51 2005-10-06 Simon Josefsson <jas@extundo.com>
53 * memxor.c (memxor): Avoid casts and warnings.
55 2005-10-05 Derek Price <derek@ximbiot.com>
57 * getdelim.c (SIZE_MAX): New macro, if not already defined.
59 2005-10-05 Simon Josefsson <jas@extundo.com>
61 * memxor.c (memxor): Fix compiler error.
63 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
64 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
66 * memxor.h, memxor.c: New files.
68 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
69 we assume all systems have it, suggested by Jim Meyering
70 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
71 any systems lack sys/socket.h; mingw32 is known to lack it, but we
72 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
75 2005-10-04 Bruno Haible <bruno@clisp.org>
77 * verify.h (verify_true): Provide alternative definition for C++.
79 2005-10-04 Simon Josefsson <jas@extundo.com>
81 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
82 D. Baushke" <mdb@gnu.org>.
84 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
86 * getdelim.c: Include getdelim.h first. Include <limits.h>.
87 (SSIZE_MAX): New macro, if not already defined.
88 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
91 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
93 * exclude.c: Include verify.h.
94 (verify): Remove. All callers changed to use verify.h's version.
95 * strtoimax.c: Likewise.
96 * utimecmp.c: Likewis.e
99 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
100 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
101 * .cvsignore: Add fts.h, search.h, t-fpending.
102 * settime.c (settime): Fix { typo in previous patch. Also, don't
103 bother returning ENOSYS if settimeofday or stime fails; just let
104 them return whatever errno they want to return.
105 * utimens.c: Include unistd.h, for dup2.
106 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
107 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
109 2005-10-02 Jim Meyering <jim@meyering.net>
112 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
113 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
114 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
115 Remove AT_FDCWD test.
116 Do not consume the fd unless successful.
117 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
118 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
119 block, so that we don't even try to compile it if settimeofday is
120 available. This works around a compilation failure on OSF1 V5.1,
121 due to stime requiring a `long int*' while tv_sec is `int'.
123 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
125 * getdelim.c (getdelim): Remove unused variables.
127 2005-10-01 Simon Josefsson <jas@extundo.com>
129 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
130 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
131 AI_* and EAI_* definitions. Protect function declarations.
133 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
135 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
136 so that the code works even with ancient cpp. Portability problem
137 with GCC 2.7.2.1 reported by Thomas M.Ott.
139 2005-09-27 Jim Meyering <jim@meyering.net>
141 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
143 * intprops.h (signed_type_or_expr__): Define.
144 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
147 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
149 * verify.h (verify_expr): Remove, replacing with:
150 (verify_true): New macro that returns true instead of void.
151 (verify_type__): Remove.
152 (verify): Use verify_true rather than verify_type__.
154 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
156 * utimens.c (ENOSYS): Define if not already defined.
157 (futimens): Support having a null PATH if the file descriptor
160 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
162 (__attribute): Define to empty unless GCC 3.1 or later.
163 This works around a core dump on OpenBSD 3.4, which has GCC
164 2.95.3, which dumps core when given __attribute__(()). It also
165 simplifies other tests, since we really don't want to bother with
166 worrying about which ancient version of GCC supported what.
167 Original problem reported by Yoann Vandoorselaere, with part of
168 the fix suggested by Derek Price.
170 2005-09-24 Jim Meyering <jim@meyering.net>
172 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
173 so we can once again use a positive bitfield width of 1 -- now we
174 don't have to explain why we were using a bitfield width of 2.
176 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
178 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
179 Problem reported by Eric Blake.
180 (getaddrinfo): Initialize se so that it's not garbage.
181 Redo internal storage allocation so that it doesn't make unportable
182 assumptions about alignment.
185 * utimens.c (futimens): Use futimesat if available.
186 Prefer it to futimes since it doesn't have the futimes bug.
188 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
189 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
190 Instead, declare a function that returns a pointer to an array,
191 and use verify_type__ to declare the size of the array.
192 Problem and germ of a solution reported by Bruno Haible.
193 (verify_type__): Use 2, not 1, for bitfield size, to avoid
194 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
196 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
200 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
202 * argmatch.h: Include verify.h
203 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
204 (ARGMATCH_ASSERT): Remove; unused.
205 * canonicalize.c: Assume STDC_HEADERS.
206 * exclude.c: Include "strcase.h".
207 * regex_internal.h [!defined _LIBC]: Likewise.
208 * getusershell.c: Include stdio--.h rather than stdio.h
210 (getusershell): Call fopen, not fopen_safer.
211 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
212 Do not include unistd-safer.h.
213 (save_cwd): Don't call fd_safer; no longer needed
214 now that we include fcntl--.h.
216 * getdate.y (relative_time): New type.
217 (RELATIVE_TIME_0): New constant.
218 (parser_control): Use relative_time instead of doing it ourselves.
219 (%union): Add new relative_time rel member.
220 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
222 (relunit, relunit_snumber): Now of type rel.
223 (zone, rel, relunit, get_date): Adjust to above changes.
225 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
226 Do not include unistd-safer.h.
227 (getloadavg): Don't call fd_safer; no longer needed
228 now that we include fcntl--.h.
230 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
231 (make_dir_parents): Treat ENOSYS like EEXIST.
233 Improve quality of diagnostics on restore_cwd failure.
234 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
235 (make_dir_parents): Last arg is now int * (for errno), not bool *.
236 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
237 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
238 each time through the loop. Do not diagnose restore_cwd failure;
239 that is the caller's job (and perhaps the caller does not care).
241 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
242 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
243 If the file already exists but is not a directory, don't bother
244 to try to make its parents.
245 Close potential file descriptor leak if we can't chdir("/") (!).
246 Don't always return true if chdir($PWD) fails; return true only
247 if the requested action was done successfully (except for the
249 Don't log final directory unless we actually made it.
250 Refactor to avoid duplicate code to fix up permissions.
251 Don't attempt to fix up parent permissions if chdir($PWD) fails.
253 * strftime.c (my_strftime): Rewrite the previous change slightly,
254 to make it a bit faster and (I hope) clearer.
255 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
256 Fix bug in formats like %2N.
258 * verify.h: New file.
260 2005-09-22 Jim Meyering <jim@meyering.net>
264 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
266 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
267 the .tm_year member, since otherwise gcc-4.0 would now warn about
268 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
270 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
271 order to avoid an unsuppressible warning from gcc on 64-bit systems.
273 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
274 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
275 when run in a time zone for which daylight savings time is in effect
276 for the starting date.
278 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
279 stop us from restricting permissions of just-created absolute-named
281 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
282 to restore initial working directory.
283 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
284 to tell caller if/when we change the working directory and are
285 unable to return to the initial one.
286 * mkdir-p.h (make_dir_parents): Update prototype.
287 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
288 `return false'. This fixes a bug introduced on 2004-07-30.
290 * openat.c (fdopendir): Be sure to close the supplied
291 file descriptor before returning. This makes our replacement
292 implementation a little closer to Solaris's, where fdopendir
293 ties the file descriptor to the returned DIR* pointer.
294 * openat.c (unlinkat): New function.
295 * openat.h (unlinkat): Add prototype.
296 * openat-die.c (openat_save_fail): Rename from openat_save_die.
297 (openat_restore_fail): Rename from openat_restore_die.
298 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
300 Provide an alternative to exiting immediately upon save_cwd or
301 restore_cwd failure. Now, an application can arrange e.g.,
302 to perform a longjump in that case.
303 * openat.c: Include dirname.h.
304 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
305 (rpl_openat, fdopendir, fstatat): Call openat_save_die
306 and openat_restore_die rather than calling error directly.
307 Don't include "error.h" or "exitfail.h"; they're no longer needed.
309 * openat-die.c (openat_save_die, openat_restore_die): New file.
310 * openat.h (openat_save_die, openat_restore_die): Declare and define.
312 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
313 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
314 int utc, int nanoseconds);
316 date should not have to allocate a megabyte of virtual memory to
317 handle a format argument like +%1048575T. When implemented with
318 strftime, it must allocate such a buffer, use strftime to fill it
319 in, print it, then free it.
320 With fprintftime, it simply prints everything and exits.
321 With no need for memory allocation, that's one fewer way to fail.
322 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
323 optional field width, not before, so we accept %9:z, not %:9z.
324 (my_strftime): Be sure to use L_('x') for literals.
326 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
327 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
328 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
329 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
330 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
331 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
332 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
333 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
334 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
336 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
337 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
338 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
339 and don't include <sys/file.h>).
341 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
345 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
346 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
347 [!LDAV_DONE]: Avoid unused variable warning.
349 2005-09-21 Bruno Haible <bruno@clisp.org>
351 * unicodeio.h (unicode_to_mb): New declaration.
353 2005-09-20 Derek Price <derek@ximbiot.com>
355 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
357 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
359 Use a consistent style for including <config.h>.
360 * __fpending.c, acl.c, argmatch.c,
361 argp-help.c, argp-parse.c,
362 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
363 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
364 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
365 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
366 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
367 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
368 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
369 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
370 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
371 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
372 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
373 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
374 modechange.c, mountlist.c, open-safer.c, physmem.c,
375 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
376 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
377 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
378 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
379 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
380 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
381 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
382 userspec.c, utimecmp.c, version-etc-fsf.c,
383 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
384 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
385 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
386 Standardize inclusion of config.h.
387 * __fpending.h, dirfd.h, getdate.h, human.h,
388 inttostr.h: Removed inclusion of config.h from header files.
389 * inttostr.c: Adjusted in-tree users.
390 * timespec.h: Remove superfluous warning to include config.h.
391 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
392 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
393 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
394 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
396 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
398 * stat-time.h: New file.
399 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
400 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
402 (timespec_cmp): New function.
403 * utimecmp.c: Include stat-time.h.
404 (SYSCALL_RESOLUTION): Depend on whether various struct stat
405 members exist, not on the obsolescent ST_MTIM_NSEC.
406 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
408 2005-09-15 Derek Price <derek@ximbiot.com>
409 Paul Eggert <eggert@cs.ucla.edu>
411 * regcomp.c, regexec.c, regex_internal.c: Back out previous
412 changes, consolidating in...
413 * regex_internal.h: ...this file.
415 2005-09-15 Derek Price <derek@ximbiot.com>
417 * regex_internal.h: Blank `pure' for GNUC < 3.
418 * regex_internal.c: Ditto, using this...
419 (__GNUC_PREREQ): ...new macro.
420 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
421 (__GNUC_PREREQ): ...this new macro.
423 * strstr.h: Include string.h. Define strstr as a macro here.
425 2005-09-13 Derek Price <derek@ximbiot.com>
427 * canon-host.c (canon_host_r): Set *cherror on memory allocation
429 Reported by Jim Meyering <jim@meyering.net>.
431 2005-09-13 Jim Meyering <jim@meyering.net>
433 * canon-host.c: Filter through gnu indent and reword comments slightly.
434 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
436 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
438 * lib/base64.c: Typo.
439 (base64_encode): Put b64str in initialized data section.
441 2005-09-12 Derek Price <derek@ximbiot.com>
443 Return usable errors from canon-host.
444 * canon-host.h: New file.
445 * canon-host.c (canon_host): Wrap...
446 (canon_host_r): ...this new function, which now relies exclusively on
448 (ch_strerror): New function.
449 (last_cherror): New global.
450 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
451 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
453 (freeaddrinfo): Free ai->ai_canonname when set.
455 2005-09-12 Derek Price <derek@ximbiot.com>
456 Paul Eggert <eggert@cs.ucla.edu>
458 * glob-libc.h: Renamed from glob_.h. The new version is
459 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
460 protecting things that should be done only in gnulib contexts.
461 * glob_.h: New file, containing only the glob things needed for
463 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
464 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
465 (glob, globfree, glob_pattern_p): Now defined simply in terms of
466 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
467 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
468 and to respect the namespace rules better.
470 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
472 Merge glibc and coreutils changes into gnulib, plus a few
474 * md5.c: Use #error rather than a string.
475 (CYCLIC): New macro, from glibc source. Use it instead of rol.
476 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
477 (__attribute__): Define to empty for non recent-GCC.
478 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
479 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
480 Renamed from their non-__ counterparts, with new macros replacing
481 them if not _LIBC. Add __THROW attribute.
483 (struct md5_ctx): Align buffer if using GCC.
484 * sha1.h (struct sha1_ctx): Likewise.
485 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
486 The old name was backwards.
487 (NOTSWAP): Remove; not used.
488 (rol): New macro, moved here from md5.h.
489 (sha1_process_block): Remove a FIXME that doesn't make sense.
491 2005-09-12 Derek Price <derek@ximbiot.com>
493 * gai_strerror.c: Include config.h when available. Include
494 getaddrinfo.h before other headers to test interface.
495 Reported by Larry Jones <lawrence.jones@ugs.com>.
497 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
499 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
500 definitions, since that's the preferred style in glibc.
501 Fix a minor spacing issue, and update copyright notice to match glibc's.
503 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
505 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
507 2005-09-06 Simon Josefsson <jas@extundo.com>
509 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
510 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
512 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
514 Change bitset word type from unsigned int to unsigned long int,
515 as this has better performance on typical 64-bit hosts.
516 Port bitset code to hosts with unusual word sizes.
517 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
518 (build_collating_symbol):
519 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
520 argument is a bitset. This is merely a style issue, but it makes
521 it clearer that an entire array is expected.
522 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
523 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
524 Port to the case where bitset_word is not the same as unsigned int.
525 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
526 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
528 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
529 (build_trtable, group_nodes_into_DFAstates):
531 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
532 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
533 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
534 * regexec.c (group_nodes_into_DFAstates): Likewise.
535 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
536 * regcomp.c (optimize_subexps, lower_subexp):
537 Work even if bitset_word has holes in its bitwise representation.
538 * regex_internal.h (BITSET_WORD_BITS): Likewise.
539 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
541 * regex_internal.c (re_string_reconstruct):
542 Don't assume UCHAR_MAX == 255.
543 * regex_internal.h (bitset_set_all): Likewise.
544 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
546 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
547 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
549 (BITSET_WORD_MAX): New macro.
550 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
551 (bitset_set_all, bitset_copy): Now inline functions, not macros.
552 (bitset_empty, bitset_copy):
553 Prefer sizeof (bitset) to multiplying it out ourselves.
554 (bitset_not_merge): Remove; unused.
555 (bitset_contain): Return bool, not unsigned int with one bit on.
557 * regexec.c (build_trtable): Don't assume bitset has no stricter
558 alignment than re_node_set; do this by defining a new internal
559 type struct dests_alloc and using it to allocate memory.
561 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
563 Check for arithmetic overflow when calculating sizes, to prevent
564 some buffer-overflow issues. These patches are conservative, in the
565 sense that when I couldn't determine whether an overflow was possible,
566 I inserted a run-time check.
567 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
568 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
569 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
570 (re_xnrealloc, re_x2nrealloc): New inline functions.
571 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
572 (build_equiv_class, build_charclass): Check for arithmetic overflow
573 in size expression calculations.
574 * lib/regex_internal.c (re_string_realloc_buffers):
575 (build_wcs_upper_buffer, re_node_set_add_intersect):
576 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
577 (re_dfa_add_node, register_state): Likewise.
578 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
579 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
580 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
581 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
583 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
585 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
586 to avoid a collision with bits/local_lim.h in glibc.
587 All uses changed. Problem reported by Dmitry V. Levin in
588 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
590 * regex_internal.c (build_wcs_upper_buffer): Fix portability
591 bugs in int versus size_t comparisons.
592 (re_string_context_at): Fix bug where the code assumed that
595 Use bool where appropriate.
596 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
598 (calc_eclosure_iter): Likewise, for ROOT arg.
599 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
600 (build_charclass_op): Likewise, for NON_MATCH arg.
601 * regex_internal.c (re_string_allocate, re_string_construct):
602 (re_string_construct_common): Likewise, for ICASE arg.
603 * regexec.c (re_search_2_stub, re_search_stub):
604 Likewise, for RET_LEN arg.
605 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
606 (set_regs): Likewise, for FL_BACKTRACK arg.
607 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
608 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
609 (calc_eclosure_iter, parse_bracket_exp):
610 Use bool for internal variables that are booleans.
611 * regexec.c (re_search_internal, check_matching, proceed_next_node):
612 (set_regs, build_sifted_states, sift_states_bkref):
613 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
614 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
615 (find_collation_sequence_value):
617 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
618 (re_node_set_compare):
619 Return bool, not int. All callers changed.
620 * regexec.c (check_halt_node_context, check_dst_limits):
621 (build_trtable, check_node_accept): Likewise.
622 * regex_internal.h: Include stdbool.h.
624 Fix bugs uncovered when converting to bool.
625 * regcomp.c (calc_eclosure_iter): Check for storage allocation
626 failure instead of charging ahead blindly.
627 * regex_internal.c (register_state): Likewise.
628 * regexec.c (re_search_2_stub): Use simpler method than boolean
629 for freeing internal storage.
630 (group_nodes_into_DFA_states): Use unsigned int, not int, for
631 bitset pieces used as boolean, to avoid undefined behavior
632 on hosts that do int overflow checking.
634 2005-08-31 Derek Price <derek@ximbiot.com>
636 * getdelim.c (getdelim): Return EOF on EOF.
637 Reported by Larry Jones <lawrence.jones@ugs.com>.
639 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
641 * regex_internal.c (re_string_reconstruct): Don't assume buffer
642 lengths fit in regoff_t; this isn't true if regoff_t is the same
644 * regex.c (re_search_internal): 5th arg is LAST_START
645 (= START + RANGE) instead of RANGE. This avoids overflow
646 problems when regoff_t is the same width as size_t.
648 (re_search_2_stub): Check for overflow when adding the
649 sizes of the two strings.
650 (re_search_stub): Check for overflow when adding START
651 to RANGE; if it occurs, substitute the extreme value.
653 2005-08-31 Jim Meyering <jim@meyering.net>
655 * regcomp.c (search_duplicated_node): Make first pointer arg
657 * regex_internal.c (create_ci_newstate, create_cd_newstate):
658 (register_state): Likewise.
659 * regexec.c (search_cur_bkref_entry, check_dst_limits):
660 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
661 (group_nodes_into_DFAstates): Likewise.
663 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
665 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
666 old glibc regex code mishandles strings longer than 2**31 bytes.
667 This patch fixes this when the regex code is used in gnulib
668 (i.e., outside glibc).
670 This patch should not affect the use of the regex code inside
671 glibc. No doubt this problem also needs to be handled for glibc
672 as well, but the result will be an incompatible change to the
673 glibc ABI, and the old ABI will have to be supported too. That
674 can be the the subject for another patch.
676 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
677 governing whether the rest of this patch is active. By default,
678 the macro is disabled and the patch has no effect.
679 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
680 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
681 (struct re_pattern_buffer, re_search, re_search_2, re_match):
682 (re_match_2, re_set_registers): Use the new types.
683 * regex_internal.h (Idx, re_hashval_t): New types.
684 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
686 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
687 (re_string_context_at, bin_tree_t, re_dfastate_t):
688 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
689 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
690 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
691 (re_string_char_size_at, re_string_wchar_at):
692 (re_string_elem_size_at):
693 Use the new types and macros to port to 64-bit hosts.
694 Use unsigned types for internal values, so that the code
695 mostly works even for arrays larger than SSIZE_MAX.
696 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
697 (search_duplicated_node, calc_eclosure_iter, fetch_number):
698 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
699 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
700 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
701 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
702 (calc_inveclosure, parse_dup_op, build_range_exp):
703 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
704 (fetch_number, create_token_tree, mark_opt_subexp):
706 * regex_internal.c (re_string_construct_common, create_ci_newstate):
707 (create_cd_newstate, re_string_allocate, re_string_construct):
708 (re_string_realloc_buffers, build_wcs_upper_buffer):
709 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
710 (re_string_reconstruct, re_string_peek_byte_case):
711 (re_string_fetch_byte_case, re_string_context_at):
712 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
713 (re_node_set_init_copy, re_node_set_add_intersect):
714 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
715 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
716 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
717 (re_acquire_state, re_acquire_state_context, register_state):
719 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
720 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
721 (re_search_internal, re_search_2_stub, re_search_stub)
722 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
723 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
724 (update_cur_sifted_state, check_dst_limits):
725 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
726 (check_subexp_limits, sift_states_bkref, merge_state_array):
727 (check_subexp_matching_top, get_subexp, get_subexp_sub):
728 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
729 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
730 (expand_bkref_cache, check_node_accept_bytes):
731 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
732 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
733 (acquire_init_state_context, check_halt_node_context):
734 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
735 (sift_states_backward, clean_state_log_if_needed):
736 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
737 (find_recover_state, transit_state_sb, transit_state_mb):
738 (transit_state_bkref, build_trtable, match_ctx_clean):
740 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
741 to work around an assumption that REG_MISSING is negative.
743 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
744 (seek_collating_symbol_entry) [defined _LIBC]:
745 (lookup_collation_sequence_value) [defined _LIBC]:
746 (build_range_exp, build_collating_symbol) [defined _LIBC]:
747 Use prototypes rather than old-style function definitions.
748 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
749 (transit_state_sb) [0]:
750 (find_collation_sequence_value) [defined _LIBC]: Likewise.
752 * regexec.c (re_search_internal): Simplify update of rm_so and
755 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
756 (optimize_subexps, lower_subexp):
757 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
758 since the signed shift might overflow. Use 1u<<31 instead.
759 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
760 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
763 * regcomp.c (optimize_subexps, lower_subexp):
764 Use CHAR_BIT rather than 8, for clarity.
765 * regexec.c (check_dst_limits_calc_pos_1):
766 (check_subexp_matching_top): Likewise.
767 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
768 have to worry about portability issues when shifting it left.
769 Remove no-longer-needed test for table_size > 0.
770 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
771 in a word, as the resulting behavior is undefined.
772 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
773 in one case, a <= should have been an <, and in another case the
774 whole test was missing.
775 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
776 the standard name CHAR_BIT.
777 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
778 this is not true on one's complement and signed-magnitude hosts.
780 * regex_internal.h (re_sub_match_top_t): Remove unused member
782 (struct re_dfa_t): Remove unused member states_alloc.
783 * regcomp.c (init_dfa): Don't initialize unused members.
785 2005-08-31 Bruno Haible <bruno@clisp.org>
787 * strstr.c: Include <stddef.h>, for NULL.
788 * strcasestr.c: Likewise.
789 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
791 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
793 * iconvme.h: Add prototype for iconv_alloc.
795 2005-08-29 Simon Josefsson <jas@extundo.com>
797 * iconvme.c: Fix errno.
799 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
801 * iconvme.c: Split iconv_string into iconv_alloc.
803 2005-08-27 Jim Meyering <jim@meyering.net>
805 * fopen-safer.c: Merge minor changes from coreutils.
806 * dup-safer.c: Likewise.
807 * fd-safer.c: Likewise.
809 Merge from coreutils.
810 * stdio--.h: New file.
811 * stdlib--.h: New file.
812 * mkstemp-safer.c: New file.
815 * pipe-safer.c: New file.
816 * creat-safer.c: New file.
817 * fcntl--.h (creat): Define to creat_safer.
818 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
819 * unistd--.h (pipe): Define to pipe_safer.
820 * unistd-safer.h: Declare pipe_safer.
822 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
824 * regex_internal.h: Remove all references to
825 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
827 (bitset_not, bitset_merge, bitset_not_merge):
828 (bitset_mask, re_string_allocate, re_string_construct):
829 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
830 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
831 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
832 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
833 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
834 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
835 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
836 (re_acquire_state_context):
837 Remove unnecessary forward decls.
838 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
839 Put __attribute at function definition,
840 now that the function decl has been removed.
841 * lib/regex_internal.c (re_string_peek_byte_case):
842 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
845 2005-08-26 Simon Josefsson <jas@extundo.com>
847 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
848 Haible <bruno@clisp.org>.
850 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
852 * regexec.c (set_regs): Don't alloca with an unbounded size.
854 alloca modernization/simplification for regex.
855 * regex.c: Remove portability cruft for alloca. This no longer
856 needs to be at the start of the file, and can be moved into
857 regex_internal.h and simplified.
858 * regex_internal.h: Include <alloca.h>.
859 (__libc_use_alloca) [!defined _LIBC]: New macro.
860 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
861 now works outside glibc.
863 2005-08-24 Simon Josefsson <jas@extundo.com>
865 * getpass.c: Add WIN32 implementation. Conditionalize use of
866 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
869 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
871 Make regex safe for g++. This fixes one real bug (an "err"
872 that should have been "*err"). g++ problem reported by
874 * regex_internal.h (re_calloc): New macro, consistent with
875 re_malloc etc. All callers of calloc changed to use re_calloc.
876 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
877 not int. All callers changed.
878 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
879 just use an array of size MB_LEN_MAX.
880 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
881 (find_recover_state): Change "err" to "*err"; this fixes what
882 appears to be a real bug.
883 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
886 2005-08-25 Jim Meyering <jim@meyering.net>
888 * open-safer.c: Include <config.h>.
889 Otherwise, we'd lose LARGEFILE support in any file using
892 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
894 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
895 * regex.h (regerror): Likewise.
897 * regex.c: Do not include <sys/types.h>, as POSIX no longer
898 requires this. (The code never needed it.)
900 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
901 All uses of recently-renamed identifiers changed to use the new,
902 POSIX-compliant names. The code will build and run just fine
903 without these changes, but it's better to eat our own dog food
904 and use the standard-conforming names.
906 * regex.h: Fix a multitude of POSIX name space violations.
907 These changes have an effect only for programs that define
908 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
909 do not change anything for programs compiled in the normal way.
910 Also, there is no effect on the ABI.
912 (_REGEX_SOURCE): New macro.
913 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
914 defined and _GNU_SOURCE is not; this fixes a name space violation.
916 Rename the following macros to obey POSIX requirements.
917 The old names are still visible as macros if _REGEX_SOURCE is defined.
918 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
919 RE_BACKSLASH_ESCAPE_IN_LISTS.
920 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
921 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
922 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
923 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
924 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
925 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
926 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
927 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
928 (REG_INTERVALS): renamed from RE_INTERVALS.
929 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
930 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
931 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
932 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
933 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
934 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
935 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
936 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
937 RE_UNMATCHED_RIGHT_PAREN_ORD.
938 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
939 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
940 (REG_DEBUG): renamed from RE_DEBUG.
941 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
942 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
943 unusual, since we can't clash with the POSIX REG_ICASE.
944 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
945 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
946 (REG_NO_SUB): renamed from RE_NO_SUB.
947 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
948 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
949 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
950 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
951 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
952 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
953 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
954 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
955 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
956 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
957 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
958 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
959 RE_SYNTAX_POSIX_MINIMAL_BASIC.
960 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
961 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
962 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
963 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
964 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
965 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
966 (REG_FIXED): Renamed from REGS_FIXED.
967 (REG_NREGS): Renamed from RE_NREGS.
969 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
970 of other REG_* macros, since POSIX says the user is allowed to
971 #undef these macros selectively.
973 (reg_errcode_t): Update comment stating what other tables need
976 Rename the following enum values to obey POSIX requirements.
977 The old names are still visible as macros.
978 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
979 is not defined, since GNU is supposed to be a superset of POSIX as
980 much as possible, and since we want reg_errcode_t to be a signed
981 type for implementation consistency.
982 (_REG_NOERROR): Renamed from REG_NOERROR.
983 (_REG_NOMATCH): Renamed from REG_NOMATCH.
984 (_REG_BADPAT): Renamed from REG_BADPAT.
985 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
986 (_REG_ECTYPE): Renamed from REG_ECTYPE.
987 (_REG_EESCAPE): Renamed from REG_EESCAPE.
988 (_REG_ESUBREG): Renamed from REG_ESUBREG.
989 (_REG_EBRACK): Renamed from REG_EBRACK.
990 (_REG_EPAREN): Renamed from REG_EPAREN.
991 (_REG_EBRACE): Renamed from REG_EBRACE.
992 (_REG_BADBR): Renamed from REG_BADBR.
993 (_REG_ERANGE): Renamed from REG_ERANGE.
994 (_REG_ESPACE): Renamed from REG_ESPACE.
995 (_REG_BADRPT): Renamed from REG_BADRPT.
996 (_REG_EEND): Renamed from REG_EEND.
997 (_REG_ESIZE): Renamed from REG_ESIZE.
998 (_REG_ERPAREN): Renamed from REG_ERPAREN.
999 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
1000 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
1001 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
1002 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
1004 (_REG_RE_NAME, _REG_RM_NAME): New macros.
1005 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
1006 changed. But support the old name if the new one is not defined
1007 and if _REGEX_SOURCE.
1009 Change the following member names in struct re_pattern_buffer.
1010 The old names are still supported if !_REGEX_SOURCE.
1011 The new names are always supported, regardless of _REGEX_SOURCE.
1012 (re_buffer): Renamed from buffer.
1013 (re_allocated): Renamed from allocated.
1014 (re_used): Renamed from used.
1015 (re_syntax): Renamed from syntax.
1016 (re_fastmap): Renamed from fastmap.
1017 (re_translate): Renamed from translate.
1018 (re_can_be_null): Renamed from can_be_null.
1019 (re_regs_allocated): Renamed from regs_allocated.
1020 (re_fastmap_accurate): Renamed from fastmap_accurate.
1021 (re_no_sub): Renamed from no_sub.
1022 (re_not_bol): Renamed from not_bol.
1023 (re_not_eol): Renamed from not_eol.
1024 (re_newline_anchor): Renamed from newline_anchor.
1026 Change the following member names in struct re_registers.
1027 The old names are still supported if !_REGEX_SOURCE.
1028 The new names are always supported, regardless of _REGEX_SOURCE.
1029 (rm_num_regs): Renamed from num_regs.
1030 (rm_start): Renamed from start.
1031 (rm_end): Renamed from end.
1033 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
1034 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
1035 Prepend __ to parameter names.
1037 Undo yesterday's changes.
1039 2005-08-24 Jim Meyering <jim@meyering.net>
1041 Sync from coreutils.
1042 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
1044 2005-08-21 Bruno Haible <bruno@clisp.org>
1046 * lock.h: Add multiple inclusion guard.
1047 * tls.h: Add multiple inclusion guard.
1049 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
1051 * regex.h (REG_NOSYS)
1052 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
1053 Define, since POSIX requires it as of 2001.
1054 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
1055 New private symbol, used to keep the enum signed in all cases.
1056 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
1057 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
1059 * regex_internal.c (re_string_skip_chars, register_state):
1061 Remove forward decls; no longer needed now that we use prototypes.
1062 * regexec.c (acquire_init_state_context, check_halt_node_context):
1063 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
1064 (clean_state_log_if_needed): Likewise.
1066 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1068 Fix problems reported by Sam Steingold in
1069 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
1070 * regexec.c (sift_states_bkref): Fix portability bug: the code
1071 assumed that reg_errcode_t is a signed type, which is not
1072 necessarily true if _XOPEN_SOURCE is not defined.
1073 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
1074 some compilers warn about it otherwise.
1076 2005-08-20 Jim Meyering <jim@meyering.net>
1078 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
1079 of unused local, dfa.
1081 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1083 * regcomp.c (create_initial_state): Remove duplicate decl.
1084 (init_word_char, create_initial_state, duplicate_node_closure):
1085 (fetch_token, peek_token_bracket, build_range_exp):
1086 (build_collating_symbol): Remove forward decls; no longer needed
1087 now that we use prototypes.
1090 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
1091 (re_compile_fastmap_iter, regcomp, regerror, regfree):
1092 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
1093 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
1094 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
1095 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
1096 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
1097 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
1098 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
1099 (build_range_exp, build_collating_symbol, parse_bracket_exp):
1100 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
1101 (build_charclass, build_charclass_op, fetch_number, create_tree):
1102 (create_token_tree, mark_opt_subexp, duplicate_tree):
1103 Use prototypes rather than old-style definitions.
1106 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
1107 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
1108 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1109 (re_string_reconstruct, re_string_peek_byte_case):
1110 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
1111 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1112 (re_node_set_init_copy, re_node_set_add_intersect):
1113 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1114 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1115 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1116 (re_acquire_state, re_acquire_state_context, register_state):
1117 (create_ci_newstate, create_cd_newstate, free_state):
1119 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
1120 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
1121 (re_search_internal, prune_impossible_nodes):
1122 (acquire_init_state_context, check_matching, static):
1123 (check_halt_node_context, check_halt_state_context, proceed_next_node):
1124 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
1125 (update_regs, sift_states_backward, build_sifted_states):
1126 (clean_state_log_if_needed, merge_state_array):
1127 (update_cur_sifted_state, add_epsilon_src_nodes):
1128 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
1129 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
1130 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
1131 (find_recover_state, check_subexp_matching_top, transit_state_mb):
1132 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
1133 (check_arrival, check_arrival_add_next_nodes):
1134 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1135 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1136 (check_node_accept_bytes, check_node_accept, extend_buffers):
1137 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
1138 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
1143 (re_string_allocate, re_string_construct, re_string_reconstruct):
1144 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
1145 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
1146 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
1147 (re_string_context_at, re_string_peek_byte_case):
1148 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
1149 is defined, since we now use prototypes always.
1151 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
1152 C89 or better. All uses removed.
1154 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1156 * regex_internal.c (re_acquire_state, re_acquire_state_context)
1157 [defined lint]: Suppress bogus uninitialized-variable warnings.
1159 * regcomp.c (duplicate_node): Return new index, not an error code,
1160 and let the caller return REG_ESPACE if out of space. This
1161 removes an uninitialied-variable warning with GCC 4.0.1, and also
1162 avoids taking the address of a local variable. All callers
1165 2005-08-19 Jim Meyering <jim@meyering.net>
1167 * regexec.c (proceed_next_node): Redo local variables to
1168 avoid GCC shadowing warnings.
1170 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1172 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
1173 (re_node_set_insert_last, re_dfa_add_node):
1174 Rename local variables to avoid GCC shadowing warnings.
1176 2005-08-18 Bruno Haible <bruno@clisp.org>
1178 * strstr.c (strstr): Fix return value in multibyte case.
1179 * strcasestr.c (strcasestr): Likewise.
1181 2005-08-17 Jim Meyering <jim@meyering.net>
1183 Make the %s format (seconds since the epoch) work for a negative
1184 number and when used with a zero-padded field width, e.g. %015s.
1186 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1187 label so that it precedes the code to set `digits'. Otherwise,
1188 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
1189 print `00-22'. Now, it prints `-0022', as it should.
1191 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
1193 * regex.h: Remove useless space-before-tab. From coreutils.
1195 2005-08-17 Bruno Haible <bruno@clisp.org>
1197 * strcasestr.h: New file.
1198 * strcasestr.c: New file.
1200 2005-08-17 Bruno Haible <bruno@clisp.org>
1202 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
1203 * strstr.c: Completely rewritten, with multibyte locale support.
1205 2005-08-17 Bruno Haible <bruno@clisp.org>
1207 * strcasecmp.c: Use mbuiter.h.
1209 2005-08-17 Bruno Haible <bruno@clisp.org>
1211 * mbuiter.h: New file.
1213 2005-08-16 Bruno Haible <bruno@clisp.org>
1215 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
1217 (mbi_avail, mbi_advance): Let the iteration end before the terminating
1218 NUL byte, not after it.
1220 2005-08-16 Bruno Haible <bruno@clisp.org>
1222 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
1223 the valid ones. Makes the comparison operations transitive:
1224 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
1225 * strcasecmp.c (strcasecmp): Use mb_casecmp.
1227 2005-08-16 Bruno Haible <bruno@clisp.org>
1229 * strcase.h (strcasecmp): Add note in comments.
1230 * strncasecmp.c: Use code from strcasecmp.c.
1231 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
1232 (strcasecmp): Work correctly in multibyte locales.
1234 2005-08-16 Bruno Haible <bruno@clisp.org>
1236 * strnlen1.h: New file.
1237 * strnlen1.c: New file.
1239 2005-08-16 Bruno Haible <bruno@clisp.org>
1241 * mbfile.h: New file.
1243 2005-08-16 Bruno Haible <bruno@clisp.org>
1245 * mbiter.h: New file.
1247 2005-08-16 Bruno Haible <bruno@clisp.org>
1249 * mbchar.h: New file.
1250 * mbchar.c: New file.
1252 2005-08-16 Bruno Haible <bruno@clisp.org>
1254 * tls.h: New file, from GNU gettext.
1255 * tls.c: New file, from GNU gettext.
1257 2005-08-15 Bruno Haible <bruno@clisp.org>
1259 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
1262 2005-08-14 Jim Meyering <jim@meyering.net>
1264 Sync from coreutils.
1266 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
1267 Use the hash-table-based cycle-detection code not just when
1268 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
1269 Reported by James Youngman in
1270 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
1271 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
1272 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
1273 This lets us compile with -DFTS_DEBUG, once again.
1274 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
1275 * fts.c (fd_safer): Remove decl.
1276 Include fcntl--.h rather than unistd-safer.h
1277 (fts_safe_changedir): Don't call fd_safer; no longer needed
1278 now that we include fcntl--.h.
1280 2005-08-11 Simon Josefsson <jas@extundo.com>
1282 * readline.h, readline.c: New file.
1284 2005-08-11 Bruno Haible <bruno@clisp.org>
1286 * strnlen.h (strnlen): Change parameter name to match comment.
1288 2005-08-10 Simon Josefsson <jas@extundo.com>
1290 * strndup.c: Use strnlen.h.
1292 * strnlen.h: New file.
1294 2005-08-02 Simon Josefsson <jas@extundo.com>
1296 * getline.h, getline.c: Rewrite.
1298 * getdelim.h, getdelim.c: New files, ported from glibc.
1300 2005-07-31 Bruno Haible <bruno@clisp.org>
1302 * lock.h (gl_lock_initializer): New macro.
1303 (gl_lock_define_initialized): Use it.
1304 (gl_rwlock_initializer): New macro.
1305 (gl_rwlock_define_initialized): Use it.
1306 (gl_recursive_lock_initializer): New macro.
1307 (gl_recursive_lock_define_initialized): Use it.
1309 2005-07-26 Bruno Haible <bruno@clisp.org>
1311 * lock.h: Update from GNU gettext.
1312 * lock.c: Update from GNU gettext.
1314 2005-07-18 Bruno Haible <bruno@clisp.org>
1316 * lock.h (gl_once_t): New type.
1317 (gl_once_define, gl_once): New macros.
1318 * lock.c (fresh_once): New variable.
1319 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
1322 2005-07-18 Simon Josefsson <jas@extundo.com>
1324 * check-version.c (check_version): Accept identical versions too.
1326 2005-07-18 Bruno Haible <bruno@clisp.org>
1328 * lock.h: New file, from GNU gettext.
1329 * lock.c: New file, from GNU gettext.
1331 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
1333 * quotearg.c: Add translator comment suggested by Bruno Haible,
1334 with a minor change.
1336 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
1338 * version-etc-fsf.c (version_etc_copyright): Parameterize the
1339 copyright symbol and the year.
1340 * version-etc.c (COPYRIGHT_YEAR): New constant.
1341 (version_etc_va): Use parameterized copyright notice.
1342 Reword to conform to the current GNU coding standards.
1344 2005-07-11 Simon Josefsson <jas@extundo.com>
1346 * size_max.h: New file.
1348 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
1350 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
1353 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
1354 and Paul Eggert <eggert@cs.ucla.edu>
1356 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
1357 in wint_t, not wchar_t. Remove now-unnecessary cast.
1359 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
1361 * regex.c, regex.h: Sync from libc.
1362 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
1363 New files, synced from libc, except that regex_internal.h
1364 currently has a small porting fix.
1366 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
1368 Remove the dependency of the strftime module on the tzset module.
1369 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
1370 Copy the input structure, to work around some of the bug with
1371 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
1372 Solaris releases, you should also use the tzset module, but we won't
1373 require it as a dependency any more since we don't want LGPLed code
1374 to depend on GPLed code.
1376 2005-07-02 Jim Meyering <jim@meyering.net>
1378 * backupfile.c (backup_args): Change a `0' to NULL.
1380 2005-07-01 Jim Meyering <jim@meyering.net>
1382 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1383 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
1384 * save-cwd.c, tempname.c:
1385 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1386 and don't include <sys/file.h>).
1388 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
1390 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
1391 declares only 'struct timespec;' (!).
1393 2005-06-29 Jim Meyering <jim@meyering.net>
1395 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
1396 type name. Use the variable name instead.
1397 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
1399 2005-06-28 Simon Josefsson <jas@extundo.com>
1401 * check-version.h, check-version.c: New files.
1403 2005-06-28 Simon Josefsson <jas@extundo.com>
1405 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
1406 collision with global variable. Better indentation. Don't
1407 increment buffer pointer beyond buffer end. Based on comments
1408 from Paul Eggert <eggert@cs.ucla.edu>.
1412 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
1414 * canon-host.c (canon-host): Append trailing "," to 0 in
1415 initializer of struct addrinfo, as an indication that we don't
1416 care how many members the structure has.
1418 2005-06-24 Derek Price <derek@ximbiot.com>
1419 and Bruno Haible <bruno@clisp.org>
1421 Remove stat module & update lstat.
1422 * stat.c: Remove this file...
1423 (slash_aware_lstat): ...moving this content and its support...
1424 * lstat.c (rpl_lstat): ...into here.
1425 * lstat.h: New file.
1427 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
1429 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
1430 (ranged_convert): Don't save conversion in a temporary struct.
1431 This causes a warning with GCC 4.0.0, and anyway in the typical
1432 case it's not worth the extra 100 bytes or so of code.
1433 (ranged_convert, __mktime_internal): When calling a function via a
1434 pointer P, use P () rather than (*P) (), as we now assume C89 or
1437 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
1439 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
1440 "who -r" failed to give output. Problem reported by Tim Waugh.
1442 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
1443 (xcalloc): Use it to avoid needless tests.
1444 Problem reported by Jim Meyering.
1446 2005-06-16 Jim Meyering <jim@meyering.net>
1448 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
1449 when either N or S is zero.
1451 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1453 * argp.h (__option_is_short): Check upper limit of
1454 __key. Isprint() requires its argument to have the value
1455 of an unsigned char or EOF.
1457 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
1459 * fnmatch.c (fnmatch): If there is an encoding error in a
1460 multibyte string or pattern, fall back on unibyte matching.
1461 Problem reported by James Youngman.
1463 2005-06-08 Bruno Haible <bruno@clisp.org>
1465 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
1468 2005-06-08 Bruno Haible <bruno@clisp.org>
1470 * csharpcomp.h: New file, from GNU gettext.
1471 * csharpcomp.c: New file, from GNU gettext.
1472 * csharpcomp.sh.in: New file, from GNU gettext.
1474 2005-06-07 Derek Price <derek@ximbiot.com>
1477 * glob_.h: Indent nested #ifdef.
1479 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
1481 Sync from coreutils.
1482 Use "file name" when talking about file names, instead of "filename"
1483 or "path", as per the GNU coding standards.
1484 * mkdir-p.c: Renamed from makepath.c.
1485 (make_dir_parents): Renamed from make_path. All callers changed.
1486 * mkdir-p.h: Likewise. All includers changed.
1487 * filenamecat.c: Renamed from path-concat.c.
1488 (file_name_concat): Renamed from path_concat. All callers changed.
1489 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
1490 * filenamecat.h: Likewise. All includers changed.
1491 * acl.c: Don't use "path" or "filename" to mean "file name"
1492 in comments or local variable names.
1493 * basename.c: Likewise.
1494 * canonicalize.c, canonicalize.h: Likewise.
1495 * dirname.c, dirname.h: Likewise.
1496 * euidaccess.c: Likewise.
1497 * exclude.c: Likewise
1498 * fnmatch_.h, fnmatch_loop.c: Likewise.
1499 * fsusage.c, fsuage.h: Likewise.
1500 * fts.c, fts_.h: Likewise.
1501 * getcwd.c: Likewise.
1502 * getloadavg.c: Likewise.
1503 * mkstemp.c: Likewise.
1504 * mountlist.c, mountlist.h: Likewise.
1505 * openat.c, openat.h: Likewise.
1506 * readlink-stub.c: Likewise.
1507 * readutmp.c, readutmp.h: Likewise.
1508 * rename.c: Likewise.
1509 * rmdir.c: Likewise.
1511 * savedir.c: Likewise.
1512 * stripslash.c: Likewise.
1513 * tempname.c: Likewise.
1514 * xreadlink.c: Likewise.
1515 * exclude.c (excluded_file_name): Renamed from excluded_filename.
1517 * exclude.h: Likewise.
1519 * euidaccess.c (getuid, getgid, getuid, getegid)
1520 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1521 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
1522 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1523 * pathmax.h: Include <limits.h> unconditionally, since other
1524 files have been getting away with it for years (MORE/BSD 4.3
1526 * userspec.c (getpwnam, getgrnam, getgrgid)
1527 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1529 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
1530 Define to 256, not 255, as per modern POSIX.
1532 2005-06-01 Bruno Haible <bruno@clisp.org>
1534 * csharpexec.h: New file, from GNU gettext.
1535 * csharpexec.c: New file, from GNU gettext.
1536 * csharpexec.sh.in: New file, from GNU gettext.
1538 2005-05-31 Derek Price <derek@ximbiot.com>
1539 Paul Eggert <eggert@cs.ucla.edu>
1542 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
1544 2005-05-29 Derek Price <derek@ximbiot.com>
1545 Paul Eggert <eggert@cs.ucla.edu>
1547 * glob_.h, glob.c: New files.
1549 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
1551 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
1553 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
1554 the configuration hassle isn't worth it.
1555 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
1556 (LONGEST_MODIFIER, PRIuMAX): Remove.
1558 2005-05-27 Bruno Haible <bruno@clisp.org>
1560 * getlogin_r.h: Remove second include of <stddef.h>.
1562 2005-05-25 Bruno Haible <bruno@clisp.org>
1563 Derek Price <derek@ximbiot.com>
1565 * getlogin_r.h: Simplify API documentation.
1567 2005-05-25 Derek Price <derek@ximbiot.com>
1568 Paul Eggert <eggert@cs.ucla.edu>
1570 * getlogin_r.c, getlogin_r.h: New files.
1572 2005-05-22 Bruno Haible <bruno@clisp.org>
1574 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
1575 Also include <sys/param.h> if it defines MIN, MAX.
1576 Based on a patch by Derek Price <derek@ximbiot.com>.
1578 2005-05-22 Bruno Haible <bruno@clisp.org>
1580 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
1581 (INT64_MIN): Fix definition.
1582 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1584 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
1585 NEED_SIGNED_INT_TYPES.
1587 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
1588 HAVE_SYSTEM_INTTYPES.
1590 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
1592 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
1593 so that unistd-safer.h (GPL'ed code) need not be included.
1595 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
1598 * fts.c: Don't include "cycle-check.h" or "hash.h".
1599 (setup_dir, free_dir): New functions.
1600 (enter_dir, leave_dir): Define trivial
1601 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
1602 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
1603 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
1604 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
1605 Move to fts-cycle.c.
1606 (fts_open): Use setup_dir.
1607 (fts_close): Use free_dir.
1608 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
1609 This adds a label and some gotos, but the alternatives were messier.
1610 Check for memory allocation failure when entering a dir.
1611 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
1612 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
1613 (FTS): New member fts_cycle, that is a union that contains the
1614 old active_dir_ht and cycle_state. All uses changed to mention
1615 fts_cycle.ht and fts_cycle.state.
1616 * fts-cycle.c: New file, containing GPL'ed code migrated out of
1617 fts.c, with the following changes:
1618 (setup_dir, free_dir): New functions.
1619 (enter_dir): Now returns bool. Return true if successful, false
1620 if memory exhausted. All callers changed.
1621 Do not bother partly cleaning up on
1622 memory allocation failure; that is free_dir's job.
1623 However, free ad if hash_insert fails, to avoid memory leak.
1624 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
1625 fts->fts_options to see which union member to use.
1627 2005-05-20 Jim Meyering <jim@meyering.net>
1629 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
1630 Now a macro, to pacify GCC.
1632 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
1634 * chown.c (rpl_chown): Return -1 on failure.
1636 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
1638 * canonicalize.c: Include canonicalize.h first, to test interface.
1639 Include <stddef.h> unconditionally, since we assume C89 now.
1640 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
1641 * fts.c: Include fts_.h first, to check interface.
1642 Do not include intprops.h; no longer needed.
1643 Include cycle-check.h and hash.h, since fts_.h no longer does.
1644 Remove unnecessary casts of closedir to void.
1645 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
1646 decide whether to decrement nlinks.
1647 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
1648 (FTS): Use struct hash_table * instead of Hash_table, so that
1649 we no longer need to include hash.h here.
1651 2005-05-17 Jim Meyering <jim@meyering.net>
1653 * fts.c, fts_.h: New files, from coreutils.
1655 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
1657 Sync from coreutils.
1658 * unlinkdir.c, unlinkdir.h: New files.
1659 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
1660 regex.h, unlocked-io.h, xtime.h:
1661 White space changes only.
1662 * makepath.c (make_path): Port to hosts where leading "//" is special.
1663 * yesno.c: Include getline.h, not ctype.h.
1664 (yesno): Don't remove leading white space; POSIX doesn't allow it.
1665 Use getline to remove arbitrary restriction on response length.
1667 2005-05-13 Bruno Haible <bruno@clisp.org>
1669 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
1670 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
1671 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
1672 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
1673 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
1674 Add support for 64-bit integers in the MSVC compiler.
1676 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
1678 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
1679 Change the initial comment to refer to GPL, not LGPL.
1680 gnulib-tool will change it to LGPL as needed.
1682 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
1683 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
1684 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
1685 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
1686 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
1687 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
1688 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
1689 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
1690 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
1691 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
1692 concatpath.c, config.charset, copy-file.c, copy-file.h,
1693 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
1694 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
1695 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
1696 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
1697 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
1698 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
1699 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
1700 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
1701 full-read.c, full-read.h, full-write.c, full-write.h,
1702 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
1703 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
1704 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
1705 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
1706 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
1707 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
1708 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
1709 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
1710 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
1711 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
1712 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
1713 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
1714 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
1715 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
1716 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
1717 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
1718 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
1719 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
1720 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
1721 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
1722 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
1723 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
1724 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
1725 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
1726 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
1727 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
1728 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
1729 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
1730 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
1731 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
1732 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
1733 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
1734 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
1735 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
1736 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
1737 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
1738 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
1739 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
1740 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
1741 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
1742 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
1743 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
1744 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
1745 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
1746 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
1747 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
1748 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
1749 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
1750 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
1751 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
1752 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
1753 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
1754 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
1755 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
1756 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
1757 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
1758 Update FSF postal mail address.
1760 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1762 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
1763 specified in ai_socktype. Fix invalid ai_protocol
1764 check. ai_protocol is usually set to 0 or depending on
1765 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
1766 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
1767 ai_socktype / ai_protocol in the returned addrinfo structure.
1769 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1770 Bruno Haible <bruno@clisp.org>
1772 * inet_ntop.h: New file.
1773 * inet_ntop.c: New file, from glibc with modifications.
1775 2005-05-08 Jim Meyering <jim@meyering.net>
1777 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
1779 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
1781 Merge from coreutils. Among other things,
1782 add bulletproofing for cases where stdin, stdout, or stderr are closed.
1783 * fd-safer.c: New file.
1784 * fcntl-safer.h, open-safer.c: Remove.
1785 * chdir-long.c: Fix comment "fetish" -> "coreutils".
1786 * dup-safer.c: Include unistd-safer.h first.
1787 Don't include errno.h.
1788 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
1789 * file-type.h: Don't assume invoker included sys/stat.h first.
1790 * file-type.c: Rely on file-type.h change.
1791 * getloadavg.c: Include unistd-safer.h.
1792 (getloadavg): Use safer open.
1793 * getusershell.c: Include "stdio-safer.h".
1794 (getusershell): Use safer fopen.
1795 * long-options.c (long_options): Use NULL rather than 0.
1796 * modechange.h (mode_free): Remove; all callers changed to invoke
1798 * modechange.c: Likewise.
1799 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
1800 (MODE_DONE): New constant.
1801 (struct mode_change): Remove 'next' member.
1802 (make_node_op_equals): New function; like the old one of the
1803 same name, except it allocates an array.
1804 (mode_compile, mode_create_from_ref): Use it.
1805 (mode_compile): Allocate result as an array, not a linked list.
1806 Parse octal string ourself, so that we catch mistakes like "+0".
1807 (mode_adjust): Arg is an array, not a linked list.
1808 * modechange.c: Include stat-macros.h, xalloc.h.
1809 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
1810 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
1811 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
1812 Remove. This is now stat-macros.h's job.
1813 (talloc): Remove. All callers replaced by xalloc, so that
1814 our invokers don't have to worry about reporting memory failures.
1815 (make_node_op_equals): Remove.
1816 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
1818 (struct mode_change): Moved here from modechange.h.
1819 (mode_append_entry): Remove.
1820 (mode_compile): Remove MASKED_OPS arg, since it encouraged
1821 apps to have incorrect behavior. Use simpler algorithm for head
1822 and tail. Don't futz with umask; that's now the job of mode_adjust.
1823 Detect more invalid usages rather than having somewhat-random behavior.
1824 Don't insert an "a=" action, as that leads to incorrect behavior.
1825 (mode_compile, mode_create_from_ref): Return NULL on error instead
1826 of an enum, since now there's only one way to have an error. All
1828 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
1829 at the correct time. Simplify calculation of "+u" and its ilk.
1830 Don't mishandle "+X".
1831 (mode_free): Remove "register" and localize decls.
1832 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
1833 (struct mode_change): Move to modechange.c; callers don't
1834 need to see this stuff.
1835 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
1836 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
1837 (mode_change, mode_adjust): Reflect the new signatures noted above.
1838 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
1839 that might redefine system include files.
1840 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
1841 (my_usleep): Use NULL rather than (void *) 0.
1842 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
1843 Use siginterrupt to specify that system calls should be interrupted.
1844 (rpl_nanosleep): Move initialization of suspended closer to call of
1846 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
1847 * readutmp.c: Likewise. Include signal.h, stdbool.h.
1848 (desirable_utmp_entry): New function.
1849 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
1850 using x2nrealloc, to simplify logic.
1851 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
1852 size calculation. Do not assume utmp file is a regular file.
1853 * readutmp.h (UT_PID): Moved here from ../src/who.c.
1854 (READ_UTMP_CHECK_PIDS): New constant.
1855 * save-cwd.c: Include unistd-safer.h.
1856 (save_cwd): Use fd_safer.
1857 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
1858 [!_LIBC] Include "stat-macros.h" instead.
1859 * unistd-safer.h (fd_safer): New decl.
1861 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
1863 * byteswap_.h: New file.
1865 2005-04-25 Albert Chin <china@thewrittenword.com>
1867 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
1870 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
1872 * getdate.y (zone): Allow relunit_snumber after tZONE, so
1873 that "UTC +1 second" continues to work. Problem reported
1875 (relunit_snumber): New rule.
1878 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
1880 * getdate.y (universal_time_zone_table): New constant.
1881 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
1882 universal_time_zone_table.
1883 (lookup_zone): Prefer universal_time_zone_table to
1884 local_time_zone_table, so that "GMT" time stamps are allowed in
1885 London during the summer. Problem reported by Ian Abbott.
1887 2005-04-12 Jim Meyering <jim@meyering.net>
1889 * human.c (humblock): Set *options even when returning due to
1890 xstrtoumax conversion failure. Thanks to a used-uninitialized
1893 2005-04-09 Jim Meyering <jim@meyering.net>
1895 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
1896 -Wuninitialized: initialize tm0.tm_year.
1898 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
1900 * getdate.y (parser_control): rels_seen is now a boolean, not a
1901 count, since there's no maximum. All uses changed.
1902 Add member dsts_seen.
1903 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
1905 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
1906 Use pc_rels_seen to decide whther a date is absolute.
1908 * getdate.y (number): Don't overwrite year.
1909 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
1912 2005-04-02 Simon Josefsson <jas@extundo.com>
1914 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
1915 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
1917 2005-03-27 Jim Meyering <jim@meyering.net>
1919 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
1921 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
1923 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
1924 "one's complement" -> "ones' complement" in comment, as per Knuth.
1925 "value of type" -> "type or expression" in comment.
1926 * mktime.c, strftime.c: Propagate intprops.h comment nits.
1928 2005-03-26 Jim Meyering <jim@meyering.net>
1931 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
1932 Correct typos: s/or/of/.
1934 2005-03-23 Jim Meyering <jim@meyering.net>
1936 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
1938 2005-03-21 Jim Meyering <jim@meyering.net>
1940 Changes imported from coreutils.
1942 * cycle-check.c: Don't include xalloc.h.
1944 * path-concat.c: Don't include assert.h.
1945 (path_concat): Remove assertion that would have triggered
1946 for ABASE starting with more than one slash.
1947 Reported by Andreas Schwab.
1949 * path-concat.c (path_concat): Set *BASE_IN_RESULT
1950 properly when ABASE is an absolute file name.
1951 Correct the description of this function.
1953 Add an assertion and a test driver.
1954 This fixes a bug introduced on 2004-07-02.
1955 Andreas Schwab reported the resulting failure of cp --parents:
1956 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
1958 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
1960 * strftime.c (my_strftime): If the underlying strftime returns 0
1961 (which shouldn't happen), generate nothing instead of returning 0
1962 immediately, so that nstrftime (NULL, ...) doesn't return 0.
1964 2005-03-16 Bruno Haible <bruno@clisp.org>
1966 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
1968 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
1970 * strftime.c (my_strftime): Prepend space to format so that we can
1971 reliably distinguish strftime failure from empty output on POSIX
1974 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
1976 * iconvme.c (SIZE_MAX): New macro, if not already defined.
1977 (iconv_string): Don't guess a size-zero buffer, as that might cause
1978 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
1979 result would be 'too large', where 'too large' is (heuristically)
1980 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
1981 overflow concerns. This will prevent some unwanted malloc failures
1982 when the inputs are very large.
1984 2005-03-15 Bruno Haible <bruno@clisp.org>
1986 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
1989 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
1992 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
1994 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
1996 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
1997 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
1999 * strtol.c: Likewise.
2001 2005-03-14 Simon Josefsson <jas@extundo.com>
2003 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
2006 2005-03-14 Jim Meyering <jim@meyering.net>
2008 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
2009 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
2010 to be nonzero so that we (and caller) can detect the difference
2011 between a valid zero-length expansion and an error return, even
2012 when the underlying strftime fails before writing anything into
2015 2005-03-10 Jim Meyering <jim@meyering.net>
2017 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
2018 so that this module works on systems without fchdir.
2020 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
2022 Factor int-properties macros into a single file, except for
2023 glibc-related files.
2024 * intprops.h: New file.
2025 * getloadavg.c: Include it instead of limits.h.
2026 (INT_STRLEN_BOUND): Remove.
2027 * human.c: Include intprops.h.
2028 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2029 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2030 * inttostr.h: Include intprops.h instead of limits.h.
2031 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2032 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2033 for consistency with intprops.h.
2034 (time_t_is_integer, twos_complement_arithmetic): Use them.
2035 * sig2str.h: Include <signal.h>, intprops.h.
2036 (INT_STRLEN_BOUND): Remove.
2037 * strftime.c (TYPE_SIGNED): Remove.
2038 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2039 * strtol.c: Adjust comments to match intprops.h.
2040 * userspec.c: Include intprops.h.
2041 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2042 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2043 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2044 instead of rolling our own expressions.
2045 * xstrtol.c: Include xstrtol.h first, to test interface.
2047 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
2049 (my_strftime): Do not mishandle years close to INT_MAX, by doing
2050 the right thing even if adding 1900 would overflow. Similarly
2051 for tm_mon + 1 and tm_yday + 1.
2052 Make %Y always equivalent to %C%y, and similarly for %G and %g.
2053 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2054 (DO_SIGNED_NUMBER): New macro.
2055 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2057 2005-03-07 Bruno Haible <bruno@clisp.org>
2059 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
2061 2005-03-03 Derek R. Price <derek@ximbiot.com>
2062 Bruno Haible <bruno@clisp.org>
2064 * pagealign_alloc.h: New file.
2065 * pagealign_alloc.c: New file.
2067 2005-01-28 Bruno Haible <bruno@clisp.org>
2069 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
2072 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
2074 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2075 The workaround isn't strictly needed for POSIX conformance, and
2076 it's too much of a pain to configure and maintain. We'll ask
2077 people to fix their kernels instead.
2078 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2079 (NANOSLEEP_BUG_WORKAROUND): Remove.
2080 (xnanosleep): Remove the workaround.
2082 2005-02-12 Bruno Haible <bruno@clisp.org>
2084 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
2086 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
2088 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2089 * timespec.h (gettime): Return void, since it always
2090 succeeds now. All uses changed.
2091 * gettime.c (gettime) Likewise.
2092 [HAVE_NANOTIME]: Prefer nanotime.
2093 Assume gettimeofday succeeds, as POSIX requires.
2094 Assime time () succeeds, since other code already does.
2095 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2096 (timespec_subtract): Remove.
2097 (NANOSLEEP_BUG_WORKAROUND): New constant.
2098 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2099 things considerably. Use it only on GNU/Linux hosts, since the
2100 workaround shouldn't be needed elsewhere.
2102 2005-02-24 Bruno Haible <bruno@clisp.org>
2104 * gettext.h: Update from GNU gettext 0.14.2.
2106 2005-02-24 Bruno Haible <bruno@clisp.org>
2108 * localcharset.c: Update from GNU gettext 0.14.2.
2109 * config.charset: Update from GNU gettext 0.14.2.
2111 2005-02-22 Simon Josefsson <jas@extundo.com>
2113 * iconvme.h, iconvme.c: New files, from libc.
2115 2005-02-20 Neil Conway <neilc@samurai.com>
2117 * xgethostname.c (xgethostname): Check for ENOMEM, which is
2118 returned by OSX/Darwin if the specified buffer is not large
2119 enough for the hostname.
2121 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
2123 * memrchr.h: New file.
2124 * chdir-long.c: Include it.
2125 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
2126 Don't bother including stddef.h.
2128 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2130 * argp-help.c (__argp_help): Create a fake struct argp_state and
2131 pass it to _help, otherwise the latter coredumps trying to
2132 dereference state.root_argp.
2134 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
2136 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2138 Include <sys/types.h>, for dev_t.
2139 (ME_DUMMY, ME_REMOTE): Move from here....
2140 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2141 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
2143 Include mountlist.h first, to test the interface.
2145 2005-01-29 Bruno Haible <bruno@clisp.org>
2147 * progname.c (program_name): Initialize.
2148 Needed when linking statically on MacOS X.
2150 2005-01-28 Bruno Haible <bruno@clisp.org>
2152 * javacomp.sh.in: New file, from GNU gettext.
2153 * javacomp.h: New file, from GNU gettext.
2154 * javacomp.c: New file, from GNU gettext.
2156 2005-01-26 Bruno Haible <bruno@clisp.org>
2158 * javaexec.sh.in: New file, from GNU gettext.
2159 * javaexec.h: New file, from GNU gettext.
2160 * javaexec.c: New file, from GNU gettext.
2162 2005-01-26 Simon Josefsson <jas@extundo.com>
2164 * gai_strerror.c: Use GPL in header.
2166 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2168 * argp-help.c (hol_entry_help): Avoid using non-constant
2169 initializers for struct pentry_state.
2170 (__argp_error): Check return value of __asprintf
2171 (__argp_failure): Translate error message
2173 * argp-parse.c: Removed braces around the expansion of N_()
2175 2005-01-21 Jim Meyering <jim@meyering.net>
2177 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2178 same value as for Solaris 9.
2180 * chdir-long.c (chdir_long): Rewrite to remove limitation on
2181 component length. This included changing the parameter to be
2182 of type `char *' rather than `char const *'.
2183 * chdir-long.h (chdir_long): Update prototype.
2185 * openat.c (fdopendir, fstatat): New functions.
2186 * openat.h: Include headers required for use of DIR and struct stat.
2187 [AT_SYMLINK_NOFOLLOW]: Define.
2188 (fdopendir, fstatat): Add prototypes.
2190 2005-01-21 Bruno Haible <bruno@clisp.org>
2192 * classpath.h: New file, from GNU gettext.
2193 * classpath.c: New file, from GNU gettext.
2195 2005-01-20 Simon Josefsson <jas@extundo.com>
2197 * version-etc-fsf.c: New file, with version_etc_copyright.
2198 * version-etc.c: Remove version_etc_copyright.
2199 * version-etc.h (version_etc_copyright): Use [] instead of * in
2200 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
2202 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
2204 * save-cwd.c (save_cwd): Remove code to support the case
2205 where fchdir is missing or flaky.
2207 2005-01-20 Simon Josefsson <jas@extundo.com>
2209 * base64.h (isbase64): Add.
2211 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
2212 using a unsigned prototype, don't inline.
2213 (base64_decode): Use it.
2215 2005-01-19 Bruno Haible <bruno@clisp.org>
2217 * sh-quote.h: New file, from GNU gettext.
2218 * sh-quote.c: New file, from GNU gettext.
2220 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
2222 Merge changes from coreutils, as described below in several
2223 changelogs dated today.
2225 * save-cwd.c: Include "save-cwd.h" before other include files.
2226 (O_DIRECTORY): Remove; not needed here, since "." must be
2227 a directory. All uses removed.
2228 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
2229 universal on Suns, and we also need to test for IRIX.
2230 Revamp code to use 'if' rather than '#if'.
2231 Avoid unnecessary comparison of cwd->desc to 0.
2233 * utimens.c (futimens): Robustify the previous patch, by checking
2234 for known valid error numbers rather than observed invalid ones.
2236 2005-01-18 Jim Meyering <jim@meyering.net>
2238 * version-etc.c (version_etc_copyright): Update copyright date.
2240 * utimens.c (futimens): Account for the fact that futimes
2241 can also fail with errno == ENOSYS or errno == ENOENT.
2242 Patch from Dmitry V. Levin.
2244 Change the name of the robust chdir function from chdir to chdir_long.
2245 * save-cwd.c: Include chdir-long.h rather than chdir.h.
2246 (restore_cwd): Use chdir_long, not chdir.
2247 * chdir-long.c: Renamed from chdir.c.
2248 * chdir-long.h: Renamed from chdir.h.
2249 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
2252 2005-01-18 Bob Proulx <bob@proulx.com>
2254 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
2255 offsetof() macro construct to avoid compile failure with native HP-UX
2256 11.0 ANSI C compiler.
2258 2005-01-06 Bruno Haible <bruno@clisp.org>
2260 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
2261 because stpncpy.m4 takes care of it.
2263 2004-01-24 Bruno Haible <bruno@clisp.org>
2265 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
2267 2003-10-09 Bruno Haible <bruno@clisp.org>
2269 * progreloc.c: Include xalloc.h instead of xmalloc.h.
2271 2005-01-06 Bruno Haible <bruno@clisp.org>
2273 * fwriteerror.h (fwriteerror): Change specification to include fclose.
2274 * fwriteerror.c: Include <stdbool.h>.
2275 (fwriteerror): At the end, close the file stream. Record whether
2276 stdout was already closed.
2278 2004-05-27 Bruno Haible <bruno@clisp.org>
2280 * execute.c (environ): Declare if needed.
2281 * pipe.c (environ): Likewise.
2282 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
2284 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
2286 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
2287 definitions to be after all include files, to avoid collisions.
2288 Problem reported by Bob Proulx.
2290 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
2292 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
2293 not needed. This removes a dependency on the gettext module.
2294 [defined _LIBC]: Do not include <libintl.h>; not needed.
2296 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
2298 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
2301 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
2303 * argp-parse.c: Include <stddef.h>.
2304 (alignof, alignto): New macros.
2305 (parser_init): Don't assume that void * is aligned sufficiently
2308 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
2309 need to extend the stack.
2310 (YYINITDEPTH): New macro, so that the initial stack isn't overly
2313 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2315 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
2317 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
2319 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
2320 Remove now-obsolete comment about AIX.
2321 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
2322 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
2323 (YYMAXDEPTH): New macro.
2325 2004-12-18 Bruno Haible <bruno@clisp.org>
2327 * fatal-signal.c (fatal_signals): Make non-const.
2328 (init_fatal_signals): New function.
2329 (uninstall_handlers, install_handlers): Ignore signals that were set to
2331 (at_fatal_signal): Call init_fatal_signals.
2332 (init_fatal_signal_set): Likewise. Ignore signals that were set to
2334 Reported by Paul Eggert.
2336 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2338 * getdate.y (textint): New member "negative".
2339 (time_zone_hhmm): New function.
2340 Expect 14 shift-reduce conflicts, not 13.
2341 (o_colon_minutes): New rule.
2342 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
2343 (yylex): Set the "negative" member of signed numbers.
2345 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
2347 Changes imported from coreutils.
2348 * hard-locale.c: Assume <locale.h> exists.
2350 (GLIBC_VERSION): New macro.
2351 (hard_locale): Assume setlocale exists.
2352 Rewrite to avoid #ifdef.
2353 Use strdup rather than malloc + strcpy.
2354 * human.c: Assume <locale.h> exists.
2355 (human_readable): Assume localeconv exists.
2357 2004-12-01 Jakub Jelinek <jakub@redhat.com>
2359 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
2360 convert T2, not T. (Imported from libc.)
2362 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
2364 * getcwd.c (is_ENAMETOOLONG): New macro.
2365 (__getcwd.c): Don't restore errno; glibc doesn't.
2366 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
2367 first, falling back to our code only if its results look suspicious.
2368 Ensure that the resulting buffer is only as large as necessary.
2370 * readutmp.c: Include readutmp.h first.
2371 Include <errno.h>, since readutmp.h no longer does that.
2372 * readutmp.h: Don't include <errno.h>,
2373 <sys/param.h>, <time.h>; not needed to establish interface.
2374 (errno): Remove decl.
2375 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
2376 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
2377 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
2379 2004-11-28 Simon Josefsson <jas@extundo.com>
2381 * base64.h, base64.c: New file.
2383 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
2385 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
2387 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
2389 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
2390 HP's ANSI C compiler.
2391 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
2392 Declaring int functions causes warnings on some modern systems and
2393 shouldn't be needed to compile on ancient ones.
2394 * same.c (MIN) [defined MIN]: Don't define, since it's already
2397 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
2398 with the following changes.
2399 (__set_errno): Parenthesize properly.
2400 Include <stdbool.h>.
2401 (MIN, MAX, MATCHING_INO): New macros.
2402 (__getcwd): Define with prototype, not K&R form.
2403 Use heuristics to allocate default buffer on stack if possible.
2404 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
2405 behavior, and to avoid the PATH_MAX limit when computing
2407 Use MATCHING_INO to compare inode number to file.
2408 Check for arithmetic overflow in size calculations.
2409 Fix bug in reallocation of dot array that caused getcwd to fail
2410 on directories nested deeper than 75.
2411 Be more careful about saving errno on error.
2412 Do not use realloc; use only free+malloc, as this is a bit
2413 more flexible and avoids a needless copy operation.
2414 Do not inspect st_dev and st_ino for symbolic links; POSIX
2415 doesn't specify the latter.
2416 Check for closedir errors.
2417 Avoid needless casts.
2418 Use "#ifdef weak_alias" around weak_alias, to be like other
2420 The following changes to getcwd.c have effect only when used in
2421 gnulib; they have no effect inside glibc proper.
2422 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
2423 as alloca isn't used.
2424 (alloca, __alloca): Likewise.
2425 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
2426 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2427 unconditionally, as gnulib assumes C89 or better.
2428 Do not include <sys/param.h>.
2429 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
2430 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
2432 (NULL) [!defined NULL]: Remove; we assume C89 or better.
2433 Include <dirent.h> in a way that is compatible with modern Autoconf.
2434 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
2435 New macros, if not already defined.
2436 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
2437 Use "_LIBC", not "defined _LIBC", for consistency.
2438 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
2440 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
2441 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
2442 * xgetcwd.c: David MacKenzie's old code was removed, so give
2443 credit only to Jim Meyering and adjust the copyright dates.
2444 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
2445 <stdlib.h>, <unistd.h>, "pathmax.h".
2446 Instead, include "xgetcwd.h" (first) and "getcwd.h".
2447 (INITIAL_BUFFER_SIZE): Remove.
2448 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
2450 2004-11-23 Jim Meyering <jim@meyering.net>
2452 * getopt_.h: Remove trailing blanks.
2454 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
2456 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
2457 (futimens): New function, which uses futimes if available.
2458 (futimens, utimens): Support timespec==NULL, with same semantics
2459 as utime and utimens.
2460 * utimens.h (futimens): New decl.
2462 2004-11-23 Jim Meyering <jim@meyering.net>
2464 * __fpending.c: Add comment.
2466 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2468 * getopt_.h: Re-addition of __getopt_argv_const caused
2469 redefinition warnings. To avoid them, include the defines
2470 in `#if !defined __need_getopt ... #endif'. The only place
2471 where __getopt_argv_const is used is in definitions
2472 of getopt_long and getopt_long_only below, which are as well
2473 protected by `#ifndef __need_getopt'.
2474 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
2475 __need_getopt after including <stdio.h> and <unistd.h> These
2476 headers might have defined it.
2478 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
2480 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
2482 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
2483 optopt): Use them instead of invoking ## directly; otherwise, the
2484 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
2486 2004-11-19 Bruno Haible <bruno@clisp.org>
2488 * strtok_r.c: Move comments from here...
2489 * strtok_r.h: ... to here.
2491 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
2493 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
2494 might fail. Problem reported by Yoann Vandoorselaere.
2495 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
2496 that mishandle size_t overflow.
2498 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
2500 * canon-host.c: Include "strdup.h".
2501 (canon_host): Use getaddrinfo if available, so that IPv6 works.
2502 Use strdup instead of malloc/strcpy to duplicate strings.
2504 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
2505 (human_space_before_unit): New constant.
2506 * human.c (human_readable): Support it.
2508 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
2509 (xgetcwd): Set errno correctly when failing.
2510 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
2511 the failure is actually due to a PATH_MAX problem.
2513 Further getopt changes to make it more likely that glibc will
2514 buy the changes back.
2515 * getopt.c (POSIXLY_CORRECT): New constant.
2516 (getopt): Use it, so to preserve glibc semantic
2517 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
2518 when compiling for libc.
2519 * getopt_.h (__getopt_argv_const): Bring it back.
2520 (getopt_long, getopt_long_only): Use it.
2522 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
2523 New arg POSIXLY_CORRECT. All callers changed.
2524 (getopt): Argv is now char * const *, as per standard.
2525 (_getopt_internal_r, _getopt_internal): Argv is now char **,
2526 not char *__getopt_argv_const *.
2527 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2528 _getopt_long_only_r): Likewise.
2529 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
2530 * getopt_int.h (_getopt_internal, _getopt_internal_r,
2531 _getopt_long_r, _getopt_long_only_r): Likewise.
2532 * getopt_.h (__getopt_argv_const): Remove.
2533 (getopt): Argv is now char * const *, as per standard.
2535 * getdate.y (tORDINAL): New token.
2536 (day, relunit): Allow it for relative times.
2537 (relative_time_table): Use tORDINAL for ordinals.
2539 2004-11-15 Jim Meyering <jim@meyering.net>
2541 * closeout.c: Include "__fpending.h" once again.
2542 Include <stdbool.h>.
2543 (close_stdout): Don't fail just because stdout was closed initially,
2544 since some programs don't write to stdout in the normal course of
2545 operation (other than --version and --help), and we don't want this
2546 function to make e.g. `touch file >&-' fail.
2547 But do fail if it was closed and someone has tried to write to it.
2548 E.g., `printf foo >&-' must fail.
2550 2004-11-11 Simon Josefsson <jas@extundo.com>
2552 * strtok_r.h, strtok_r.c: New file.
2554 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
2556 * getopt_.h (__getopt_argv_const): New macro, to be used so that
2557 we can stop lying to compilers about the constness of argv when we
2558 are compiled outside glibc.
2559 (getopt, getopt_long, getopt_long_only): Use it.
2560 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
2562 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2563 _getopt_long_only_r): Likewise.
2564 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
2565 _getopt_long_only_r): Likewise.
2567 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
2568 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
2569 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
2570 the other external symbols.
2571 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
2572 declaration, since the above renaming now works around collisions.
2574 2004-11-11 Jim Meyering <jim@meyering.net>
2576 * linebreak.c: Remove trailing blanks.
2577 * alloca_.h: Likewise.
2578 * acosl.c: Likewise.
2579 * euidaccess.c: Likewise.
2580 * allocsa.h: Likewise.
2582 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
2584 * mktime.c (SHR): New macro, which is a portable
2585 substitute for >> that should work even on Crays.
2586 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
2587 Problem reported by Mark D. Baushke in
2588 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
2589 * getdate.y (SHR): Likewise.
2591 * strftime.c (SHR): Likewise.
2593 * quotearg.c (struct quoting_options): Use unsigned int for
2594 quote_these_too, so that right shifts are well defined. All uses
2597 2004-11-10 Simon Josefsson <jas@extundo.com>
2599 * getaddrinfo.h, getaddrinfo.c: New files.
2601 2004-11-10 Jim Meyering <jim@meyering.net>
2603 Ensure that no close failure goes unreported.
2604 * closeout.c (close_stdout): Always close stdout. I.e., don't
2605 return early when it seems there's nothing to flush.
2606 Don't include __fpending.h.
2608 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
2610 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
2612 2004-11-05 Bruno Haible <bruno@clisp.org>
2614 * readlink.c: Include stddef.h, needed for size_t on Woe32.
2615 Reported by Mark D. Baushke <mdb@cvshome.org>.
2617 2004-11-04 Bruno Haible <bruno@clisp.org>
2619 2004-09-11 Bruno Haible <bruno@clisp.org>
2620 * allocsa.valgrind: New file.
2621 2004-02-06 Bruno Haible <bruno@clisp.org>
2622 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
2623 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
2624 Reported by Christopher Seip <chris.seip@hp.com>.
2626 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
2628 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
2629 with errno == ERANGE if the buffer is too small.
2630 Problem reported by Mark D. Baushke.
2632 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
2634 * xreadlink.c (MAXSIZE): New macro.
2635 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
2636 size does not exceed MAXSIZE. Avoid cast.
2637 As suggested by Mark D. Baushke in
2638 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
2639 if readlink fails with buffer size just under MAXSIZE, try again
2642 2004-11-02 Derek R. Price <derek@ximbiot.com>
2643 and Paul Eggert <eggert@cs.ucla.edu>
2645 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
2646 (get_date): Overparenthesize to avoid GCC warning.
2648 2004-11-02 Bruno Haible <bruno@clisp.org>
2650 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
2651 function returns void.
2653 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
2655 * getpass.c (fflush_unlocked, flockfile, funlockfile)
2656 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
2659 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
2661 * getdate.y: Add support for TZ="foo" within a date string.
2662 Fix some bugs near time_t boundaries. Reject dates with
2663 out-of-range components, e.g., "Sept 31".
2664 Include <stdlib.h>, "setenv.h", "xalloc.h".
2665 (ISDIGIT_LOCALE): Remove; unused.
2666 Note that the TZ and time functions used here are not reentrant.
2667 (mktime_ok, get_tz): New functions.
2668 (TZBUFSIZE): New constant.
2669 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
2670 This requires that we sometimes generate our own TZ="XXX..." setting.
2672 2004-10-27 Derek R. Price <derek@ximbiot.com>
2674 * mktime.c (not_equal_tm): Remove redundant check.
2676 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
2678 * getdate.y: Use Bison 1.875 features, and some minor
2679 code cleanups. This change does not affect semantics.
2680 Don't include <stdlib.h>; no longer needed.
2681 Don't include unlocked-io.h; only the "#if TEST" code uses
2682 stdio, and performance isn't crucial there.
2683 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
2684 Bison 1.875 features as described below.
2685 All uses of "PC." replaced by "pc->".
2686 (YYSTYPE): Add a forward declaration.
2687 (yylex, yyerror): Use full prototypes in forward decls.
2688 Use "%pure-parser" rather than obsolescent "%pure_parser".
2689 Use %parse-param and %lex-param instead of obsolescent
2690 YYPARSE_PARAM and YYLEX_PARAM.
2691 (meridian_table, month_and_day_table, time_units_table,
2692 relative_time_table, time_zone_table, military_table,
2693 lookup_zone, lookup_word, get_date):
2694 Use NULL instead of 0 where appropriate.
2695 (to_hour): Avoid abort (), to avoid a dependency on
2697 (yyerror, yylex): Now accepts parser_control * arg.
2698 (main) [TEST]: Use '\0' rather than 0 for char.
2700 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
2702 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
2703 It's now the caller's responsibility to handle the case where
2704 !HAVE_GETPAGESIZE && !defined getpagesize.
2706 * mktime.c (leapyear): Arg is long int, not int.
2708 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
2710 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
2712 2004-10-12 Simon Josefsson <jas@extundo.com>
2714 * getpass.c (fflush_unlocked, flockfile, funlockfile)
2715 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
2718 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
2720 * vsnprintf.h: New file.
2721 * vsnprintf.c: New file.
2723 2004-10-07 Bruno Haible <bruno@clisp.org>
2725 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
2726 into the provided buffer.
2728 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
2730 * diacrit.c, diacrit.h: Add GPL notice.
2732 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
2733 * atanl.c (atanl): Keep the code as similar to glibc as possible.
2734 * logl.c (logl): Keep the code as similar to glibc as possible.
2735 This avoids a potential constant-folding bug.
2737 2004-10-05 Bruno Haible <bruno@clisp.org>
2739 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
2741 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2743 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
2744 * xmalloc.c (xmemdup): Likewise.
2745 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
2746 XFREE): Remove these long-obsolescent macros.
2747 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
2748 * xstrdup.c: Remove.
2750 * regex.c (re_comp): Cast gettext return value to char *,
2751 Problem reported by Martin Neitzel via Mark D. Baushke.
2753 2004-10-04 Simon Josefsson <jas@extundo.com>
2755 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
2756 '#ifdef USE_UNLOCKED_IO'.
2758 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2760 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
2761 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
2762 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
2763 regex.c, sha1.c, version-etc.c, yesno.c:
2764 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
2765 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
2766 the includer's responsibility.
2768 Sync from coreutils.
2770 * modechange.c (mode_compile): Don't decrement a pointer that
2771 points to the start of a string, as the C Standard says the
2772 resulting behavior is undefined.
2774 * backupfile.h (enum backuptype): Rename none -> no_backups,
2775 simple -> simple_backups, numbered_existing ->
2776 numbered_existing_backups, numbered -> numbered_backups
2777 to avoid shadowing problems. All uses changed.
2778 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
2779 * backupfile.c (check_extension, numbered_backup):
2780 Rename locals to avoid shadowing 'basename'.
2781 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
2784 * .cppi-disable: Add getopt_.h, getopt_int.h.
2785 * .cvsignore: Add getopt.h.
2787 2004-10-04 Simon Josefsson <jas@extundo.com>
2789 * memmem.h: New file.
2790 * memmem.c: New file, taken from glibc.
2792 2004-10-02 Jim Meyering <jim@meyering.net>
2794 * dirfd.h, getpagesize.h: Add copyright notice.
2796 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
2798 * snprintf.c: Remove comments as to why each header is needed.
2800 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
2802 * strsep.h: New file.
2803 * strsep.c: New file.
2805 2004-10-01 Simon Josefsson <jas@extundo.com>
2807 * snprintf.c (snprintf): Handle size==0.
2809 2004-10-01 Simon Josefsson <jas@extundo.com>
2810 Bruno Haible <bruno@clisp.org>
2812 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
2813 (snprintf): Declare 'args'.
2815 2004-09-30 Simon Josefsson <jas@extundo.com>
2817 * snprintf.h, snprintf.c: New files.
2819 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2821 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
2822 (hol_entry_help): Never translate an empty string.
2823 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
2824 * argp.h (OPTION_NO_TRANS): New option.
2826 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
2828 * xvasprintf.c: Include xalloc.h.
2829 (xvasprintf): Use xalloc_die, not xmalloc_die.
2831 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
2833 * dummy.c: Change copyright notice to FSF, and license to GPL.
2835 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
2837 * argp-pvh.c (argp_program_version_hook): Provide initial value.
2838 Problem reported by Bruno Haible in:
2839 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
2841 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
2843 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
2844 in case some system header has #define'd it. Problem reported by
2845 Soeren D. Schulze in
2846 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
2848 2004-09-08 Bruno Haible <bruno@clisp.org>
2850 * stdint_.h: New file, taken from GNU clisp.
2852 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
2854 * xvasprintf.h: New file.
2855 * xvasprintf.c: New file.
2856 * xasprintf.c: New file.
2858 2004-09-08 Bruno Haible <bruno@clisp.org>
2860 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
2862 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
2864 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
2866 Import from coreutils.
2867 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
2868 strings on unbounded length. alloca's performance benefits aren't
2869 that important here.
2871 (parse_with_separator): New function, with most of the internals
2872 of the old parse_user_spec. Allow user to omit both user and group,
2873 for compatibility with FreeBSD.
2874 Clone only the user name, not the entire spec.
2875 Do not set *uid, *gid unless entirely successful.
2876 Avoid memory leak in some failing cases.
2877 Fix regression for USER.GROUP reported by Dmitry V. Levin in
2878 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
2879 (parse_user_spec): Rewrite to use parse_with_separator.
2881 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
2883 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
2884 its complicated substitute.
2885 * argp-help.c: Include <errno.h>, for program_invocation_short_name
2886 and program_invocation_name.
2887 (__argp_basename) [!_LIBC]: Remove; the only use was
2888 replaced by its body.
2889 (__argp_short_program_name): Change condition from
2890 !defined __argp_short_program_name to
2891 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
2892 to match argp-namefrob.h.
2893 (__argp_failure): Don't assume strerror_r returns char *.
2894 * argp-parse.c (N_): Define unconditionally.
2895 (argp_default_options): Fill out initializers with 0 to avoid
2898 2004-08-12 Simon Josefsson <jas@extundo.com>
2900 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
2901 * getopt_.h: Renamed from getopt.h.
2903 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
2905 Merge from coreutils.
2907 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
2908 wmemchr or wmemcpy. Problem reported by Robert Dahlem
2909 for Reliant Unix 5.43.
2911 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
2912 (union fooround): Use uintmax_t, not long int.
2913 The rest is a merge from libc:
2914 [defined _LIBC]: Include <shlib-compat.h>.
2915 (_obstack) [defined _LIBC]: Remove after 2.3.4.
2917 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
2919 * strverscmp.c: Convert to UTF-8.
2921 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
2923 * obstack.h (obstack_empty_p):
2924 Don't assume that chunk->contents is suitably aligned.
2925 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
2926 Likewise. Problem reported by Benno in
2927 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
2929 * chown.c (rpl_chown): Work even if the file is writeable but not
2930 readable. This could be improved further but it'd take some work.
2932 2004-08-08 Simon Josefsson <jas@extundo.com>
2934 * xgethostname.c: Don't include error.h (not used).
2937 * getpass.c: Include getpass.h first.
2939 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
2941 * xalloc-die.c: New files.
2942 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
2944 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
2945 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
2946 (_, N_, xalloc_die): Move to xalloc-die.c.
2947 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
2948 so that we needn't mess with xalloc_msg_memory_exhausted.
2950 * sha1.h: Renamed from sha.h.
2951 (SHA1_H): Renamed from _SHA_H.
2952 (sha1_ctx): Renamed from sha_ctx.
2953 (sha1_init_ctx): Renamed from sha_init_ctx.
2954 (sha1_process_block): Renamed from sha_process_block.
2955 (sha1_process_bytes): Renamed from sha_process_bytes.
2956 (sha1_finish_ctx): Renamed from sha_finish_ctx.
2957 (sha1_read_ctx): Renamed from sha_read_ctx.
2958 (sha1_stream): Renamed from sha_stream.
2959 (sha1_buffer): Renamed from sha_buffer.
2960 * sha1.c: Likewise; renamed from sha.c.
2961 Do not include <sys/types.h>.
2962 Include <stddef.h> rather than <stdlib.h>.
2964 2004-08-08 Bruno Haible <bruno@clisp.org>
2966 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
2967 FILESYSTEM_PREFIX_LEN.
2968 * progreloc.c: Likewise.
2969 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
2971 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
2974 * argp-help.c (make_hol, hol_append): Don't assume that
2975 SIZE_MAX is a valid preprocessor constant.
2976 (__argp_basename): Change from "#ifndef _LIBC"
2977 to "#ifndef __argp_short_program_name", so that
2978 we don't compile these functions for tar.
2980 More merges from coreutils.
2981 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
2982 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
2984 * addext.c: Remove; no longer needed.
2985 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
2986 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
2987 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
2988 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
2989 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
2990 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
2991 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
2992 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
2993 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
2994 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
2995 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
2996 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
2997 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
2998 Import changes from coreutils.
3000 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
3002 Merge from coreutils.
3004 * .gdb-history: Remove; this doesn't belong here.
3006 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
3007 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
3008 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
3010 * dirname.h: Include <stdbool.h>.
3011 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
3012 for consistency with POSIX terminology. All uses changed.
3013 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
3014 (strip_trailing_slashes): Use bool for booleans.
3015 * stripslash.c (strip_trailing_slashes): Likewise.
3017 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
3018 sometimes returns a positive errno value even when it succeeds.
3019 (print_errno_message) [!LIBC]: Fall back on strerror if
3022 * path-concat.c (mempcpy): Don't define if a system header defines it.
3023 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
3024 (longest_relative_suffix): New function.
3025 (path_concat): Use it. Assume first argument is not NULL.
3026 Port to DOS. Omit redundant separators.
3027 Report an error instead of returning NULL.
3028 Use mempcpy instead of memcpy.
3029 (xpath_concat): Remove: not declared or used.
3031 * same.h: Include <stdbool.h>
3032 (same_name): Return bool, not int.
3033 * same.c (same_name): Likewise.
3034 (errno): Don't declare; we assume C89 or better now.
3036 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
3037 if not already defined.
3039 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
3040 * dup-safer.c (errno): Likewise.
3042 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
3044 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
3047 2004-08-03 Simon Josefsson <jas@extundo.com>
3049 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
3050 * progname.h: Don't include stdbool.h.
3052 2004-08-02 Simon Josefsson <jas@extundo.com>
3054 * getsubopt.h: New file, with comments from Bruno Haible.
3055 * getsubopt.c: New file, from glibc, but slightly modified based on
3056 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
3058 2004-08-01 Simon Josefsson <jas@extundo.com>
3060 * xgetdomainname.c: Include stdlib.h, for free().
3062 2004-07-16 Simon Josefsson <jas@extundo.com>
3064 * dummy.c: New file.
3066 2004-07-16 Bruno Haible <bruno@clisp.org>
3068 * backupfile.h: Add extern "C" for C++.
3069 * closeout.h: Likewise.
3070 * copy-file.h: Likewise.
3071 * findprog.h: Likewise.
3072 * full-write.h: Likewise.
3073 * pathname.h: Likewise.
3074 * progname.h: Likewise.
3075 * stpcpy.h: Likewise.
3076 * stpncpy.h: Likewise.
3077 * strcase.h: Likewise.
3078 * strstr.h: Likewise.
3079 * xalloc.h: Likewise.
3081 * mbswidth.h: Add extern "C" for C++.
3082 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
3084 2004-07-09 Simon Josefsson <jas@extundo.com>
3086 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
3087 failed without this.)
3089 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
3091 * fchown-stub.c: New file.
3093 2004-06-24 Jim Meyering <jim@meyering.net>
3095 * obstack.h (obstack_base): Cast to (void *), per documentation.
3097 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
3099 * argz.c, argz_.h: New files, which are autoupdated from libtool.
3101 2004-06-01 Jim Meyering <jim@meyering.net>
3103 * calloc.c: New file.
3105 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
3107 * getdate.y (yylex): Allow space between sign and number.
3108 Problem reported by Dan Jacobson.
3110 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
3111 and Jim Meyering <jim@meyering.net>
3113 Merge from coreutils CVS.
3115 * stat-macros.h: New file, with contents from file-type.h
3116 and coreutils' system.h.
3117 * file-type.c: Include "stat-macros.h".
3118 * file-type.h (file_type): Move all macro definitions to new file,
3121 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
3122 Wrap old code with this conditional.
3123 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
3124 function that does not dereference symlinks.
3125 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
3127 * xreadlink.c: Include xreadlink.h first, to catch .h file
3128 dependency problems.
3129 (xreadlink): Accept new arg SIZE, for efficiency.
3130 All decls and uses changed.
3131 * xreadlink.h: Include <stddef.h>, for size_t.
3133 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
3134 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
3136 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
3138 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
3140 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
3141 macros to be defined.
3142 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
3143 the allocator returns NULL because the requested size is zero.
3145 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3147 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
3148 var. Add comment explaining why libc still defines it. This
3149 merges the following patch from glibc:
3150 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
3152 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
3154 * obstack.c (_obstack): Remove unused variable. It hasn't been
3155 present in glibc since revision 1.1 of this file.
3156 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
3157 obstack_alignment_mask, obstack_alloc, obstack_base,
3158 obstack_blank, obstack_blank_fast, obstack_chunk_size,
3159 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
3160 obstack_grow0, obstack_init, obstack_int_grow,
3161 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
3162 obstack_next_free, obstack_object_size, obstack_ptr_grow,
3163 obstack_ptr_grow_fast, obstack_room): Remove declarations of
3164 nonexistent functions.
3166 2004-05-17 Derek R. Price <derek@ximbiot.com>
3167 Paul Eggert <eggert@cs.ucla.edu>
3169 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
3171 2004-05-14 Bruno Haible <bruno@clisp.org>
3173 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
3174 that consists of a '.' followed by an empty digit string.
3175 Patch by Tor Lillqvist <tml@iki.fi>.
3177 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
3179 Port obstack to the AS/400, where pointers are 16 bytes wide and
3180 you cannot cast an integer to a valid pointer. This patch is
3181 currently waiting to be integrated into glibc; see
3182 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
3184 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
3185 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
3186 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
3187 (struct obstack): temp member is now a union of a pointer and
3188 an integer, instead of an integer. All integer uses changed.
3189 This does not affect the physical layout of struct obstack,
3190 except on hosts (like the AS/400) where the size or alignment of
3191 void * is greater than that of ptrdiff_t.
3192 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
3193 __STDC__)]: Store temporary in pointer member of union, not
3195 * obstack.c: Include <stddef.h>, for offsetof.
3196 (struct fooalign): Remove; it doesn't need a name.
3197 (union fooround): Change double to long double, and add void *.
3198 (DEFAULT_ALIGNMENT): Use offsetof to compute.
3199 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
3200 not a macro. Hence the values are always int; so remove all
3201 casts-to-int in uses.
3203 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
3204 Derek Price <derek@ximbiot.com>
3206 * alloca.c: Include <alloca.h>, to get our interface.
3207 * alloca_.h: Use __alloca on AIX, so that we don't have to
3208 include <alloca.h> first. Use C89 prototype for alloca; this
3209 requires including <stddef.h> for size_t. Use extern "C" if C++.
3210 Use #elif for simplicity, since we can assume C89 now.
3211 Don't try to source the system alloca.h since it will not be found
3212 and to prevent recursively including its replacement.
3213 * fnmatch.c: Include <alloca.h> instead of opencoding.
3214 * regex.c: Likewise.
3216 2004-05-16 Derek Price <derek@ximbiot.com>
3217 Paul Eggert <eggert@cs.ucla.edu>
3219 getline cleanup. This changes the getndelim2 API: both order of
3220 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
3223 * getline.c: Don't include stddef.h or stdio.h, since our
3224 interface does that.
3225 (getline): Always use getdelim, so that we don't have two
3226 copies of this code.
3227 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
3229 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
3230 (GETNDELIM2_MAXIMUM): New macro.
3231 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
3232 instead of the old practice of delim2==0. All callers changed.
3233 Return -1 on overflow, instead of returning junk.
3234 Do not set *linesize unless allocation succeeds.
3235 * getndelim2.h: Do not include stddef.h; no longer needed, now
3236 that we include sys/types.h.
3237 * getnline.h: Likewise.
3238 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
3239 (getndelim2): Reorder arguments.
3240 * getnline.c (getnline, getndelim):
3241 Don't discard the NMAX argument.
3242 (getnline): Invoke getndelim, to avoid code duplication.
3243 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
3244 of (size_t) -1 by callers of the getnline family.
3246 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3248 * nanosleep.c (suspended): Change its type from int to
3249 sig_atomic_t volatile.
3250 (first_call): Make it private to rpl_nanosleep, and have it
3251 be zero initially as that's a bit faster.
3252 (my_usleep): Round up fractional times instead of truncating them,
3253 as this is the usual meaning for 'sleep'.
3255 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3257 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3258 (ENOSYS): Define if not defined.
3259 (settime): Fall back on stime if it exists and settimeofday fails.
3260 But don't bother with fallbacks if a method fails with errno == EPERM.
3262 2004-05-11 Jim Meyering <jim@meyering.net>
3264 Prior to this change, the save_cwd caller required read access to the
3265 current directory on most systems (ones with the fchdir function).
3267 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
3268 fails, try write-only, and finally, resort to using xgetcwd.
3270 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
3272 * obstack.c, obstack.h: Import changes from libc.
3274 2004-04-28 Bruno Haible <bruno@clisp.org>
3276 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
3277 implicitly appends .exe to executables.
3278 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
3279 accepts Windows pathnames.
3280 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3281 Cygwin like Windows, since it now accepts Windows pathnames.
3282 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3283 Cygwin like Windows, since it now accepts Windows pathnames.
3284 Reported by Derek Robert Price <derek@ximbiot.com>.
3286 2004-04-20 Jim Meyering <jim@meyering.net>
3288 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
3290 2004-04-20 Jim Meyering <jim@meyering.net>
3291 Bruno Haible <bruno@clisp.org>
3293 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
3294 memory when realloc fails.
3296 2004-04-18 Jim Meyering <jim@meyering.net>
3298 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
3299 don't leak memory and do call END_UTMP_ENT.
3301 2004-04-11 Paul Eggert <eggert@twinsun.com>
3303 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
3304 (CHAR_BIT): Remove, since we assume C89.
3305 Include <stdint.h> if available, as per current Autoconf CVS advice.
3307 2004-03-30 Paul Eggert <eggert@twinsun.com>
3309 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
3310 not bool, to be more consistent with Unix conventions.
3311 Suggested by Bruno Haible.
3313 Merge from coreutils.
3315 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
3318 * getdate.h: Include stdbool.h, and timespec.h instead of
3319 the usual <time.h> dance.
3320 (get_date): Change signature to support fractional time stamps.
3321 All callers changed.
3322 * getdate.y: Include "getdate.h" first, as we can now
3323 assume C89 and don't need to worry about 'const'.
3324 Similarly, include "unlocked-io.h" near start, not in middle.
3326 (textint.value): Use long int rather than int.
3327 (textint.digits): Use size_t rather than int.
3328 (BILLION, LOG10_BILLION): New constants.
3329 (parser_control): New member rel_ns. Members day_ordinal,
3330 time_zone, month, day, hour, minutes, rel_year, rel_month,
3331 rel_day, rel_hour, rel_minutes, rel_seconds
3332 are now long int, not int. Member seconds is now struct timespec,
3333 not int. New member timespec_seen. Members dates_seen, days_seen,
3334 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
3336 (%union.intval): Now long int, not int.
3337 New member timespec.
3338 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
3339 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
3340 (spec): Now is a timespec or an item list.
3341 (timespec, items): New nonterminals.
3342 (time, rel, relunit, number, get_date):
3343 Add support for fractional seconds.
3344 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
3345 (gmtime, localtime, mktime): Remove decls; not needed with C89.
3346 (to_hour): First arg is now long int, not int.
3347 (to_year): Returns long int, not int.
3348 Don't treat year -70 like 70.
3349 (tm_diff): Returns long int, not int.
3350 (lookup_word): Use bool instead of int when appropriate.
3351 (yylex): Use size_t for count, not int.
3352 Detect overflow when parsing large integer constants.
3353 Add support for fractions.
3354 (get_date): Make pointers 'const' if possible.
3355 Use more-portable code to detect integer overflow.
3356 (main) [TEST]: Adjust to above changes. Test for localtime failure.
3357 Don't use ctime; it's not reliable if the year has >4 digits.
3359 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
3360 This is for compatibility with BSD.
3362 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
3363 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
3364 From coreutils' system.h.
3366 * userspec.c: Don't include "posixver.h".
3367 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
3368 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
3369 compatible extension. Simplify code by removing a boolean int
3370 that was always nonzero if a string was nonnull.
3372 2004-03-30 Jim Meyering <jim@meyering.net>
3374 Merge from coreutils.
3376 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
3378 * readtokens.c (readtoken): Don't leak 64 bytes when reading
3379 an empty input stream.
3381 * readtokens.c: Include <stdbool.h>.
3382 (readtoken): Use `size_t' rather than int/long.
3383 All callers adjusted.
3384 Use `bool' rather than `int' where appropriate.
3385 Use memset rather than an explicit loop.
3386 Use x2nrealloc rather than xrealloc.
3387 Allow the use of `\0' as a delimiter.
3388 (readtokens): Likewise.
3389 * readtokens.h (readtoken, readtokens): Update prototypes.
3391 2004-03-30 Bruno Haible <bruno@clisp.org>
3393 * getloadavg.c (getloadavg): Don't assume setlocale returns
3396 2004-03-29 Paul Eggert <eggert@twinsun.com>
3398 Merge changes to getloadavg.c from coreutils and Emacs.
3400 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
3401 Define to an expression, not to the empty string.
3402 Include cloexec.h and xalloc.h.
3403 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
3404 Use set_cloexec_flag rather than rolling our own.
3405 * cloexec.c, cloexec.h: New files.
3407 2004-03-18 Paul Eggert <eggert@twinsun.com>
3409 * getopt.h: Sync with libc CVS.
3411 2004-03-18 Paul Eggert <eggert@twinsun.com>
3412 Bruno Haible <bruno@clisp.org>
3414 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
3415 not on all platforms that have <wchar.h>.
3416 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
3418 2004-03-09 Paul Eggert <eggert@twinsun.com>
3420 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
3422 * getopt_int.h: New file, also synced from libc.
3424 2004-03-07 Paul Eggert <eggert@twinsun.com>
3426 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
3427 '#if' expressions. Unlike the code it replaces, it does not
3428 depend on (defined _SC_PAGESIZE). However, it does depend on
3429 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
3430 first reported by Jason Andrade in
3431 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
3433 2004-01-18 Simon Josefsson <jas@extundo.com>
3435 * strdup.h: New file.
3436 * strdup.c: Include it.
3437 * path-concat.c: Include strdup.h. Drop strdup declaration.
3438 * userspec.c: Include strdup.h. Drop strdup declaration.
3440 2004-02-06 Karl Berry <karl@gnu.org>
3442 * config.charset: update from gettext 0.14.1.
3444 2004-02-05 Paul Eggert <eggert@twinsun.com>
3446 Add comments and code, prompted by suggestions from Bruno Haible
3448 * quotearg.h (quotearg_alloc): New decl. Improve the comments
3449 describing the enum quoting_style values.
3450 * quotearg.c (quotearg_alloc): New function.
3451 (quotearg_buffer_restyled): Treat lone { and } as special.
3452 Treat = as special. Work around bug with older shells
3453 that "see" a '\' that is really the 2nd byte of a multibyte char.
3454 Quote empty string with shell_quoting_style.
3456 2004-02-03 Bruno Haible <bruno@clisp.org>
3458 * pipe.h: New file, from GNU gettext.
3459 * pipe.c: New file, from GNU gettext.
3461 2004-01-27 Bruno Haible <bruno@clisp.org>
3463 * execute.h: New file, from GNU gettext.
3464 * execute.c: New file, from GNU gettext.
3465 * w32spawn.h: New file, from GNU gettext.
3467 2004-01-23 Paul Eggert <eggert@twinsun.com>
3469 Exit-status fix from coreutils.
3471 Use exit_failure consistently in place of EXIT_FAILURE,
3472 so that program exit statuses are consistent on failure.
3474 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
3475 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
3476 * argmatch.h: Comment fix to match the above.
3477 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
3478 Now a macro referring to exit_failure, instead of a separate
3479 variable. Include "exitfail.h" to get it.
3480 * xstrtol.h: Include "exitfail.h".
3481 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
3483 * long-options.c (parse_long_options): Use prototype
3484 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
3487 2004-01-21 Jim Meyering <jim@meyering.net>
3489 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
3490 so as not to conflict with a different-sized __mktime_internal
3491 function in GNU libc.
3492 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
3493 Problem building statically-linked `ls' reported by Michael Brunnbauer.
3495 2004-01-18 Paul Eggert <eggert@twinsun.com>
3497 Merge from diffutils.
3499 * file-type.c (file_type): Add typed memory objects.
3500 * file-type.h (S_TYPEISTMO): New macro.
3502 * c-stack.h (c_stack_action): Remove argv argument.
3503 * c-stack.c (c_stack_action): Likewise. All uses changed.
3504 (die): Don't calculate message unless segv_action returns.
3505 (get_stack_location, min_address_from_argv, max_address_from_argv,
3506 volatile stack_base, volatile_stack_size): Remove.
3507 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
3508 that every segmentation violation is a stack overflow. (Ouch!)
3509 See Debian bug 136249 (still outstanding) for more info about why
3510 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
3512 2003-11-30 Bruno Haible <bruno@clisp.org>
3514 Safer stack allocation.
3515 * setenv.c: Include allocsa.h.
3516 (alloca): Remove fallback definition.
3517 (freea): Remove macro.
3518 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
3521 2003-10-17 Bruno Haible <bruno@clisp.org>
3523 * binary-io.h: Avoid warnings on Cygwin.
3525 2003-12-28 Bruno Haible <bruno@clisp.org>
3527 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
3528 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
3530 2003-11-28 Bruno Haible <bruno@clisp.org>
3532 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
3534 2003-11-27 Bruno Haible <bruno@clisp.org>
3536 * wait-process.c: On Windows, include windows.h. Needed on mingw.
3538 2003-11-17 Bruno Haible <bruno@clisp.org>
3540 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
3542 2003-11-24 Bruno Haible <bruno@clisp.org>
3544 * xallocsa.h: New file, from GNU gettext.
3545 * xallocsa.c: New file, from GNU gettext.
3547 2003-11-24 Bruno Haible <bruno@clisp.org>
3549 * allocsa.h: New file, from GNU gettext.
3550 * allocsa.c: New file, from GNU gettext.
3552 2003-11-24 Bruno Haible <bruno@clisp.org>
3554 * eealloc.h: New file.
3556 2004-01-15 Jim Meyering <jim@meyering.net>
3558 Merge from coreutils.
3560 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
3561 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
3562 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
3564 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
3565 optional configure-time default.
3567 * version-etc.c (version_etc_copyright): Update copyright date.
3569 * xreadlink.c (xreadlink): Correct outdated comment.
3571 2004-01-15 Paul Eggert <eggert@twinsun.com>
3573 Merge from coreutils.
3575 * posixver.c: Include posixver.h.
3577 * same.c: Include <stdbool.h>, <limits.h>.
3578 (_POSIX_NAME_MAX): Define if not defined.
3580 (same_name): If file names are silently truncated, report
3581 that the file names are the same if they are the same after
3582 the silent truncation.
3584 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
3585 conversion function.
3586 * xstrtod.c (xstrtod): Likewise. All callers changed to
3587 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
3590 2004-01-14 Paul Eggert <eggert@twinsun.com>
3592 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
3593 with like-named macro in fnmatch.c.
3594 (EXT): Use an internal constant instead.
3596 Merge fnmatch patches from glibc.
3597 * fnmatch.c (mbsinit): Remove define.
3598 Add libc_hidden_ver (__fnmatch, fnmatch).
3599 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
3600 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
3602 2003-12-14 Karl Berry <karl@gnu.org>
3604 * config.charset: update from gettext-runtime.
3606 2003-12-03 Paul Eggert <eggert@twinsun.com>
3608 * getgroups.c (getgroups): xmalloc takes one argument, not two.
3609 Bug reported by Alfred M. Szmidt.
3611 2003-11-29 Karl Berry <karl@gnu.org>
3613 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
3615 2003-11-23 Paul Eggert <eggert@twinsun.com>
3616 Bruno Haible <bruno@clisp.org>
3618 * printf-parse.h: Don't include sys/types.h.
3619 (ARG_NONE): New macro.
3620 (char_directive): Change type of *arg_index fields to size_t.
3621 * printf-parse.c: Don't include sys/types.h.
3622 (SSIZE_MAX): Remove macro.
3623 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
3624 Remove unnecessary overflow check.
3625 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
3628 2003-11-24 Paul Eggert <eggert@twinsun.com>
3630 * alloca.c: Remove dependency on xalloc module.
3631 (xalloc_die): Remove.
3632 (memory_full) [!defined emacs]: New macro.
3633 [!defined emacs]: Don't include xalloc.h.
3634 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
3635 address arithmetic overflows. Change datatypes a bit to avoid
3638 2003-11-22 Jim Meyering <jim@meyering.net>
3640 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
3642 2003-11-17 Bruno Haible <bruno@clisp.org>
3644 * vasnprintf.c (alloca): Remove fallback definition.
3645 (freea): Remove definition.
3646 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
3647 Reported by Paul Eggert.
3649 2003-11-17 Jim Meyering <jim@meyering.net>
3651 On systems without utime and without a utimes function capable of
3652 dealing with a NULL struct utimbuf* argument, this utime replacement
3653 could -- in unusual circumstances -- leak a file descriptor.
3654 * utime.c: Include <unistd.h> and <errno.h>.
3655 (utime_null): Be sure to close `fd' and to preserve errno.
3656 Reported by Geoff Collyer via Arnold Robbins.
3658 2003-11-16 Paul Eggert <eggert@twinsun.com>
3659 Bruno Haible <bruno@clisp.org>
3661 Protect against address arithmetic overflow.
3662 * printf-args.h: Include stddef.h.
3663 (arguments): Change type of field 'count' to size_t.
3664 * printf-args.c (printf_fetchargs): Use size_t instead of
3665 'unsigned int' where appropriate.
3666 * printf-parse.h: Include sys/types.h.
3667 (char_directive): Change type of *arg_index fields to ssize_t.
3668 (char_directives): Change type of fields 'count', max_*_length to
3670 * printf-parse.c: Include sys/types.h and xsize.h.
3671 (SSIZE_MAX): Define fallback value.
3672 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
3673 instead of 'int' where appropriate. Check a_allocated, d_allocated
3674 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
3675 * vasnprintf.c: Include xsize.h.
3676 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
3677 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
3678 overflow. Avoid wraparound when converting a width or precision from
3681 2003-11-16 Bruno Haible <bruno@clisp.org>
3683 Update from GNU gettext.
3684 * printf-parse.c: Generalize to it can be compiled for wide strings.
3685 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
3686 * vasnprintf.c: Generalize to it can be compiled for wide strings.
3687 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
3688 SNPRINTF): New macros.
3689 Don't include <alloca.h> if the file is used inside libintl.
3690 (local_wcslen): New function, for Solaris 2.5.1.
3691 (VASNPRINTF): Use it instead of wcslen.
3693 2003-11-16 Bruno Haible <bruno@clisp.org>
3695 * xsize.h (xmax): New function.
3696 (xsum, xsum3, xsum4): Declare as "pure" functions.
3698 2003-11-12 Paul Eggert <eggert@twinsun.com>
3700 * xalloc.h: Do not include <limits.h> or <stdint.h>.
3701 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
3702 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
3703 heuristic is just as accurate as far as we know, and it removes a
3704 dependency on size_max.m4 and ptrdiff_max.m4.
3706 2003-11-12 Paul Eggert <eggert@twinsun.com>
3708 * xstrtol.c (__xstrtol): Remove "break" immediately after
3709 "return", to pacify some unknown compiler. Problem reported
3712 2003-11-11 Bruno Haible <bruno@clisp.org>
3714 * xsize.h (SIZE_MAX): Remove fallback definition.
3715 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
3718 2003-11-10 Paul Eggert <eggert@twinsun.com>
3720 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
3721 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
3722 rejected some allocations of exactly SIZE_MAX - 2 bytes.
3724 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
3725 not (size_t) -1, since it's defined here.
3727 2003-11-06 Paul Eggert <eggert@twinsun.com>
3729 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
3730 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
3731 Reject sizes of exactly SIZE_MAX bytes.
3732 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
3733 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
3735 2003-11-05 Bruno Haible <bruno@clisp.org>
3737 * xsize.h: Include limits.h, to avoid a possible collision with
3738 SIZE_MAX defined in <limits.h> on Solaris.
3740 2003-11-04 Bruno Haible <bruno@clisp.org>
3742 * xsize.h: New file.
3743 * linebreak.c: Include xsize.h.
3744 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
3745 argument for overflow.
3746 Suggested by Paul Eggert.
3748 2003-10-31 Bruno Haible <bruno@clisp.org>
3750 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
3751 to avoid (extremely rare) race condition.
3752 Suggested by Paul Eggert.
3754 2003-11-03 Jim Meyering <jim@meyering.net>
3756 * userspec.c: Include "userspec.h".
3757 * userspec.h: New file.
3759 2003-10-31 Paul Eggert <eggert@twinsun.com>
3761 * mountlist.h (struct mount_entry.me_type_malloced): New member.
3762 * mountlist.c (SIZE_MAX): Define if not defined already.
3763 (read_filesystem_list): Set and use me_type_malloced.
3764 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
3765 whatever the type happens to be), for brevity and consistency.
3766 Check for size calculation overflow on Alphas running OSF/1.
3768 2003-10-31 Jim Meyering <jim@meyering.net>
3770 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
3772 * linebuffer.c: Include <string.h> for declaration of memset.
3774 2003-10-30 Paul Eggert <eggert@twinsun.com>
3775 Bruno Haible <bruno@clisp.org>
3777 * vasprintf.c: Include <limits.h>, <stdlib.h>.
3778 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
3780 2003-10-29 Paul Eggert <eggert@twinsun.com>
3782 * xalloc.h (xalloc_oversized): Now a macro, not a function,
3783 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
3785 * quotearg.c (quotearg_n_options): Use it.
3786 * group-member.c: Include <stdbool.h>.
3787 (free_group_info): Arg is now const *; don't free arg.
3788 (get_group_info): Now returns bool and accepts struct group_info *,
3789 rather than returning a malloc'ed struct group_info *.
3790 All uses changed. Check for overflow in internal size calculation.
3792 * getusershell.c (readname): Simplify the code by using x2nrealloc
3793 rather than xmalloc/xrealloc.
3794 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
3795 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
3796 conformance bug: the old code used a pointer after freeing the
3797 storage that it addressed.
3798 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
3799 rather than doing it by hand.
3800 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
3801 the buffer preserved. Use free and xmalloc instead.
3802 * quotearg.c (quotearg_n_options): Likewise.
3803 Use a simpler test for size overflow. Don't use xalloc_oversized
3804 because unsigned int might be wider than size_t (!); this suggests
3805 that we should switch from unsigned int to size_t for slot numbers.
3807 2003-10-27 Bruno Haible <bruno@clisp.org>
3809 * stdbool_.h: Better support for BeOS.
3811 2003-10-27 Paul Eggert <eggert@twinsun.com>
3813 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
3814 to allocate the returned structure. Do not allocate a subarray,
3815 as x2nrealloc will do that.
3816 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
3817 instead of xnrealloc.
3818 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
3820 2003-10-26 Paul Eggert <eggert@twinsun.com>
3822 * xalloc.h (xalloc_oversized): New static inline function, for
3823 callers that want to do their own size-overflow checking. Include
3824 <stdbool.h>, since xalloc_oversized returns bool.
3825 * xalloc.c (array_size_overflow): Remove. All callers changed
3826 to use xalloc_oversized.
3828 Add two functions x2realloc, x2nrealloc, for programs that grow
3829 arrays dynamically by doubling their sizes.
3830 * xalloc.h (x2realloc, x2nrealloc): New decls.
3831 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
3834 Port to C99 semantics for 'inline' of external functions.
3835 Bug reported by Bruno Haible.
3836 * xmalloc.c (xnmalloc_inline): New static inline function,
3837 with the old contents of xnmalloc.
3838 (xnmalloc, xmalloc): Use it.
3839 (xnrealloc_inline): New static inline function,
3840 with the old contents of xnrealloc.
3841 (xnrealloc, xrealloc): Use it.
3843 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
3845 2003-10-25 Paul Eggert <eggert@twinsun.com>
3847 Fix several address-calculation bugs in the hash modules,
3848 plus some minor code cleanup.
3850 * hash.h: Include <stdbool.h>, for bool.
3851 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
3852 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
3853 hash_get_n_entries, hash_get_max_bucket_length,
3854 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
3855 hash_rehash): Use size_t rather than unsigned.
3856 * hash.c (struct hash_table, hash_get_n_buckets,
3857 hash_get_n_buckets_used, hash_get_n_entries,
3858 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
3859 hash_get_entries, hash_do_for_each, hash_string, is_prime,
3860 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
3862 (SIZE_MAX): Define if not defined.
3863 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
3864 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
3866 Use const * when possible.
3867 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
3868 (check_tuning): Fix bug: if tuning parameters were very close to
3869 0 or 1, rounding errors could have caused subscript violations.
3870 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
3871 (hash_initialize): Add 'fail:' label
3872 to free table and return NULL, and use it to simplify code.
3873 Use calloc rather than clearing the storage ourself.
3874 (hash_initialize, hash_rehash): Check for arithmetic overflow in
3875 buffer size calculations.
3876 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
3877 Include <stddef.h>, for size_t.
3878 * hash-pjw.c (hash_pjw): Likewise.
3879 Switch to method described by Bruno Haible.
3880 Include <limits.h>, for CHAR_BIT.
3881 (SIZE_BITS): New macro.
3883 2003-10-21 Paul Eggert <eggert@twinsun.com>
3885 * getndelim2.c (getndelim2): When size calculation overflows,
3886 ceiling the allocation at NMAX bytes rather than silently
3887 discarding input bytes before NMAX is reached. This makes
3888 a difference only if NMAX exceeds SIZE_MAX / 2.
3890 * obstack.c: Merge from glibc.
3891 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
3892 Add libc_hidden_def (_obstack_newchunk).
3893 (_obstack_free) [! defined _LIBC]: Remove.
3894 [defined _LIBC]: Make a strong alias from obstack_free, rather than
3895 a clone of the function body.
3896 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
3897 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
3899 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
3900 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
3903 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
3904 (obstack_ptr_grow_fast, obstack_int_grow_fast):
3905 Don't use lvalue casts, as GCC plans to remove support for them
3906 in GCC 3.5. Reported by Joseph S. Myers. This bug
3907 was also present in the non-GCC version, indicating that this
3908 code had always been buggy and had never been widely used.
3909 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
3910 Use the fast variant of each macro, rather than copying the
3911 definiens of the fast variant; that way, we'll be more likely to
3912 catch future bugs in the fast variants.
3914 2003-10-20 Bruno Haible <bruno@clisp.org>
3916 * wait-process.h: New file, from GNU gettext.
3917 * wait-process.c: New file, from GNU gettext.
3919 2003-10-19 Jim Meyering <jim@meyering.net>
3921 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
3923 2003-10-16 Paul Eggert <eggert@twinsun.com>
3925 * getgroups.c: Include <errno.h>, <stdlib.h>.
3926 (getgroups): First arg is int, not size_t.
3927 Don't let 'free' mangle errno.
3929 2003-10-16 Jim Meyering <jim@meyering.net>
3931 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
3933 2003-10-15 Paul Eggert <eggert@twinsun.com>
3935 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
3937 (new_exclude, add_exclude_file): Initial size no longer needs to
3939 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
3940 our own address arithmetic overflow checking.
3942 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
3943 (fnmatch): Do not alloca more than 2000 wide characters;
3944 instead, use malloc for large buffers.
3945 Check for address arithmetic overflow, and return -1
3946 with errno set to ENOMEM in that case.
3947 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
3948 (NEW_PATTERN): Do not alloca more than 8000 bytes;
3949 instead, return -1. Check for address arithmetic overflow.
3951 2003-10-14 Paul Eggert <eggert@twinsun.com>
3953 Handle invalid suffixes and overflow independently, so that
3954 callers can treat them independently as needed. Fix some bugs in
3955 suffix handling, e.g., "100k@" was not diagnosed as an invalid
3956 suffix for a human-readable blocksize. The major caller-visible
3957 change is the addition of a new
3958 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
3959 that both overflow and suffix chars were found.
3961 * human.c (humblock): Don't check separately for invalid suffix
3962 char; that is xstrtoumax's job (now that its bug is fixed).
3963 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
3964 INTMAX_MAX]: New macros.
3965 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
3966 TYPE_MAXIMUM): New macros.
3967 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
3968 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
3969 if overflow occurs, as it's what __strtol does and it's more useful
3971 (__xstrtol): If __strtol reports some error other than ERANGE,
3972 reflect it to the caller as LONGINT_INVALID. If it reports
3973 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
3974 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
3975 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
3977 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
3978 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
3979 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
3980 [defined UINTMAX_MAX]: New macros.
3982 2003-10-14 Bruno Haible <bruno@clisp.org>
3984 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
3985 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
3986 Also use volatile where needed.
3988 2003-10-12 Paul Eggert <eggert@twinsun.com>
3990 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
3991 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
3992 and define in terms of the other primitives.
3993 * xmalloc.c: Include stdbool.h; do not include exit.h.
3994 (SIZE_MAX): Define if not already defined.
3995 (array_size_overflow): New function.
3996 (xalloc_die): Abort instead of exiting if 'error' returns.
3997 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
3998 (xmalloc, xrealloc): Use them.
3999 (xcalloc): Check for address arithmetic overflow.
4000 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
4001 a bit faster than strcpy.
4003 2003-10-08 Paul Eggert <eggert@twinsun.com>
4005 Merge getpass from libc, plus a few fixes.
4007 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
4008 Include <stdbool.h>.
4009 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
4010 __fsetlocking to empty.
4011 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
4012 do include <bits/libc-lock.h>.
4013 Do not include <fcntl.h>; not needed.
4014 [_LIBC]: Include <wchar.h>.
4015 (NOTCANCEL_MODE): New macro.
4016 (flockfile, funlockfile) [_LIBC]: New macros.
4017 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
4018 [!_LIBC]: New macros.
4019 (call_fclose): New function.
4020 (getpass): Use it. Save tty stream separately; this simplifies the
4021 code and makes it more reliable if stdin happens to equal stdout.
4022 Invoke __fsetlocking on tty.
4023 Handle thread cancellation if needed.
4024 Namespace cleanup (use __tcgetattr, __getline).
4025 Use bool for Booleans.
4026 [USE_IN_LIBIO]: Handle wide streams.
4027 [!_LIBC]: Unconditionally do the fseek, since we don't know what
4028 stream might go where.
4030 * unlocked-io.h: Include <stdio.h>, so that the caller
4031 doesn't have to include <stdio.h> before us.
4032 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4033 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4034 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4035 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4036 if not declared, so that we can use getpass.c code from libc without
4038 (flockfile, ftrylockfile, funlockfile): New macros.
4040 2003-10-06 Bruno Haible <bruno@clisp.org>
4042 * version-etc-2.h: Remove file.
4043 * version-etc-2.c: Remove file.
4045 2003-09-25 Jim Meyering <jim@meyering.net>
4046 Bruno Haible <bruno@clisp.org>
4048 This lets translators provide better translations for the
4049 "Written by ..." part of --version output.
4050 * version-etc.h: Include stdarg.h.
4051 (version_etc_copyright): Declare as readonly.
4052 (version_etc): Make this function variadic with a NULL-terminated list
4053 of author name strings.
4054 (version_etc_va): New declaration.
4055 * version-etc.c: Include stdarg.h, stdlib.h.
4056 (version_etc_copyright): Declare as readonly.
4057 (version_etc_va): New function. Provide a different translatable string
4058 for each possible number of authors < 10. Abbreviate when there are 10
4060 (version_etc): Make this function variadic. Call version_etc_va.
4061 Suggestion from Gary V. Vaughan.
4063 * long-options.h (parse_long_options): Change prototype: the authors
4064 string is moved to the end and becomes variadic.
4065 * long-options.c: Include stdarg.h.
4066 (parse_long_options): Make this function variadic, too.
4067 Call version_etc_va, not version_etc.
4069 2003-10-06 Bruno Haible <bruno@clisp.org>
4071 * fatal-signal.h: New file, from GNU gettext.
4072 * fatal-signal.c: New file, from GNU gettext.
4074 2003-10-04 Karl Berry <karl@gnu.org>
4076 * argp*: update from libc.
4078 2003-10-01 Larry Jones <lawrence.jones@eds.com>
4080 * getpass.c (getpass): Use a no-op fseek when switching from input to
4081 output mode on the same stream.
4083 2003-09-29 Paul Eggert <eggert@twinsun.com>
4085 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4086 Fix arg typo in previous patch.
4088 2003-09-28 Jim Meyering <jim@meyering.net>
4090 * error.c: Correct cpp indentation.
4092 2003-09-27 Paul Eggert <eggert@twinsun.com>
4094 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
4095 Omit the special code that used __typeof__, since we worry that
4096 it could be more trouble than it's worth. See:
4097 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
4098 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
4102 2003-09-26 Jim Meyering <jim@meyering.net>
4104 * error.c (error_tail): Move some declarations
4105 into inner scope where the local variables are used.
4107 2003-09-26 Bruno Haible <bruno@clisp.org>
4109 * stpncpy.h (gnu_stpncpy): New declaration.
4110 (stpncpy): Define as alias for gnu_stpncpy.
4111 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
4113 2003-09-26 Paul Eggert <eggert@twinsun.com>
4115 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
4116 (error_tail): Do not loop, reallocating temporary buffer, since
4117 the output cannot contain more wide characters than the input
4118 contains bytes, the size must be big enough already. This avoids
4119 one potential size overflow calculation. Check for size overflow
4120 when calculating temporary buffer size. Free temporary buffer
4121 when done, if it was allocated with malloc; this plugs a memory
4122 leak. Remove casts from void * to pointers, that are no longer
4123 needed now that we're assuming C89 or better.
4125 Merge error changes from glibc.
4127 * error.c, error.h: Update copyright notice header to match glibc.
4128 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
4129 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
4130 Disable cancellation while printing error.
4131 * error.h: Prepend __ to parameter names.
4133 2003-09-25 Karl Berry <karl@gnu.org>
4135 * argp-fmtstream.c, argp-help.c: update from libc.
4137 2003-09-25 Bruno Haible <bruno@clisp.org>
4139 * version-etc-2.h: New file, from version-etc.h with modifications.
4140 * version-etc-2.c: New file, from version-etc.c with modifications.
4142 2003-09-25 Simon Josefsson <jas@extundo.com>
4144 * xgetdomainname.h: New file.
4145 * xgetdomainname.c: New file.
4147 2003-09-25 Simon Josefsson <jas@extundo.com>
4148 Bruno Haible <bruno@clisp.org>
4150 * getdomainname.h: New file.
4151 * getdomainname.c: New file.
4153 2003-09-24 Paul Eggert <eggert@twinsun.com>
4155 * linebuffer.c (freebuffer): Don't free the argument, just
4156 the buffer associated with the argument. Bug reported by
4159 2003-09-19 Karl Berry <karl@gnu.org>
4161 * argp.h: update from libc.
4163 2003-09-16 Paul Eggert <eggert@twinsun.com>
4165 * linebuffer.c (readlinebuffer): Return NULL immediately upon
4166 input error, instead of returning NULL the next time we are called
4167 (and therefore losing track of errno).
4169 2003-09-15 Paul Eggert <eggert@twinsun.com>
4171 * getndelim2.c (getndelim2): Don't trash errno when a read
4172 fails, so that the caller gets the proper errno.
4174 * readutmp.c (read_utmp): Likewise.
4175 Check for fstat error. Close stream and free storage
4178 2003-09-14 Bruno Haible <bruno@clisp.org>
4180 * fwriteerror.h: New file.
4181 * fwriteerror.c: New file.
4183 2003-09-14 Jim Meyering <jim@meyering.net>
4185 * getloadavg.c: Correct cpp indentation.
4186 * strdup.c: Likewise.
4187 * vasnprintf.c: Likewise.
4189 2003-09-12 Paul Eggert <eggert@twinsun.com>
4191 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
4192 * obstack.c [!defined _LIBC]: Likewise.
4193 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4194 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4195 * exitfail.c: Don't include stdlib.h; no longer needed.
4197 More changes to assume C89 or better.
4199 * error.c (error_tail): Assume vprintf.
4201 * argmatch.c (getenv): Remove decl.
4202 * progreloc.c (get_full_program_name): Define via prototype.
4203 * setenv.c (clearenv): Likewise.
4204 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
4206 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
4207 (malloc, memcpy): Remove decls.
4208 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
4209 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
4210 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4211 (memcpy): Remove macro.
4212 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
4213 (__P): Remove. All uses removed.
4214 (PTR): Remove. All uses changed to void *.
4215 (CHAR_BIT, NULL): Remove.
4216 (spaces, zeros, memset_space, memset_zero)
4217 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
4219 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
4220 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
4221 Define with prototype.
4222 Remove now-unnecessary prototype decl.
4223 (extra_args_spec): Assume ANSI C. All uses changed.
4224 (extra_args_spec_iso): Remove.
4225 (my_strftime, emacs_strftimeu): Define via prototype.
4226 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
4228 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
4229 * strtoimax.c: Include <stdlib.h> unconditionally.
4230 (strtoul, strtol): Remove decls.
4231 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
4233 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4234 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
4235 (LOCALE_PARAM_PROTO): New macro.
4236 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
4237 (INTERNAL (strtol), strtol): Define with a prototype.
4238 (PARAMS): Remove. All uses removed.
4239 * tempname.c: Include <string.h> unconditionally.
4240 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
4241 * xgethostname.c (main): Define with a prototype.
4242 * xmalloc.c: Include "xalloc.h" first, to check interface.
4243 Include <stdlib.h> unconditionally.
4244 (calloc, malloc, realloc, free): Remove decls.
4245 * xstrtod.c: Include "xstrtod.h" first, to check interface.
4246 Include <stdlib.h> unconditionally. Sort include file names.
4248 (xstrtod): Define with a prototype.
4249 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
4250 (strtol, strtoul): Remove decls.
4252 2003-09-11 Paul Eggert <eggert@twinsun.com>
4254 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
4255 Include <stdlib.h>, <string.h> unconditionally.
4256 Remove now-unnecessary cast to char *.
4257 * strnlen.c: Include <string.h> unconditionally.
4258 * yesno.c (yesno): Define with a prototype.
4260 2003-09-10 Bruno Haible <bruno@clisp.org>
4262 * strcspn.c: Include <string.h> unconditionally.
4263 * strpbrk.c: Include <string.h> unconditionally.
4264 * strstr.c: Include <string.h> unconditionally.
4265 * unicodeio.c: Include <string.h> unconditionally.
4266 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
4267 * unsetenv.c: Likewise.
4268 * xreadlink.c: Include <stdlib.h> unconditionally.
4269 * yesno.c: Include <stdlib.h> unconditionally.
4270 (rpmatch): Add prototype.
4272 2003-09-10 Jim Meyering <jim@meyering.net>
4274 * error.c: Correct indentation of cpp directives.
4276 2003-09-09 Paul Eggert <eggert@twinsun.com>
4280 * acosl.c (main): Use a prototype.
4281 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
4284 * getloadavg.c (getloadavg, main): Define via prototypes.
4286 * getopt.h (struct option.name): Assume C89, and use 'const'.
4287 (getopt, etopt_long, getopt_long_only, _getopt_internal)
4288 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
4290 * getopt.c (const): Remove macro.
4291 Include <string.h> unconditionally.
4292 (my_index): Remove; all uses changed to strchr.
4293 (strlen): Remove decl.
4294 (exchange): Remove forward decl; no longer needed.
4295 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
4296 Define with prototype.
4297 * getopt1.c (const): Remove macro.
4298 (getopt_long, getopt_long_only, main): Define with prototype.
4300 * getugroups.c: Include <string.h> unconditionally.
4302 * getusershell.c: Include <stdlib.h> unconditionally.
4303 (getusershell, setusershell, endusershell, readname, main):
4304 Define with prototypes.
4306 * group-member.c: Include group-member.h first.
4307 Include <stdlib.h> unconditionally.
4309 * hard-locale.c: Include hard-locale.h first.
4310 Include <stdlib.h>, <string.h> unconditionally.
4312 * hash.c (free, malloc): Remove decls.
4313 Include <stdlib.h> unconditionally.
4315 * human.c: Include <stdlib.h>, <string.h> unconditionally.
4316 (getenv): Do not declare.
4318 * idcache.c: Include <string.h> unconditionally.
4320 * long-options.c: Include long-options.h first, to test interface.
4321 Include <stdlib.h> unconditionally.
4323 * makepath.c: Include makepath.h first, to test interface.
4324 Include <stdlib.h> and <string.h> unconditionally.
4326 * linebuffer.c: Include <stdlib.h>.
4327 (free): Remove decl.
4329 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
4330 rpl_malloc returns void *, not char *.
4331 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
4333 * md5.h: Include <limits.h> unconditionally.
4334 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
4335 (__P): Remove; all uses removed.
4336 * md5.c: Include "md5.h" first.
4337 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
4338 md5_buffer, md5_process_bytes, md5_process_block):
4339 Define with prototypes.
4340 * sha.h (__P): Remove all uses. (It wasn't defined??)
4341 * sha.c: Include "sha.h" first.
4342 Include <stdlib.h>, <string.h> unconditionally.
4344 * memchr.c (__ptr_t): Remove; all uses changed to void *.
4345 * memcmp.c (__ptr_t): Likewise.
4346 * memrchr.c (__ptr_t): Likewise.
4347 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
4348 Include <string.h> unconditionally.
4349 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
4350 * memchr.c: Include <stdlib.h> unconditionally.
4351 * memchr.c (LONG_MAX): Remove.
4352 * memrchr.c (LONG_MAX): Likewise.
4353 * memchr.c (__memchr): Define via a prototype.
4354 * memrchr.c (__memrchr): Likewise.
4355 * memcmp.c (__P): Remove, and remove all uses.
4356 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
4357 Remove forward decls; no longer needed.
4358 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
4359 Use types required by C89 in prototype.
4361 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
4362 * savedir.c: Likewise.
4363 * mkdir.c (free): Remove decl.
4364 * rmdir.c (rmdir): Define with a prototype.
4365 * savedir.c: Include savedir.h first, to test interface.
4367 * mktime.c (STDC_HEADERS): Remove.
4368 Include <stdlib.h>, <string.h> unconditionally.
4370 * modechange.c: Include <stdlib.h> unconditionally.
4371 (malloc): Remove decl.
4373 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
4374 (free): Remove decl.
4376 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
4377 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
4378 (This type really should be intptr_t, but that's a C99ism.)
4379 (_obstack_memcpy): Remove: all uses changed to memcpy.
4380 Include <string.h> unconditionally.
4381 (struct obstack): Assume __STDC__ for types of members
4382 chunkfun, freefun, extra_arg.
4383 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
4384 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
4385 obstack_begin, obstack_specify_allocation,
4386 obstack_specify_allocation_with_arg, obstack_chunkfun,
4387 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
4388 Remove unprototyped decls and the macros that use them.
4389 * obstack.c (POINTER): Remove. All uses changed to void *.
4390 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
4391 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
4392 (defined __STDC__ && __STDC__)]:
4393 Remove nonprototyped code.
4394 Include <stdlib.h> unconditionally.
4395 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
4396 _obstack_allocated_p, _obstack_free, obstack_free,
4397 _obstack_memory_used, print_and_abort):
4398 Define using prototypes.
4399 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
4400 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
4401 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
4402 obstack_next_free, obstack_object_size, obstack_room) [0]:
4403 Remove unused, unprototyped code.
4405 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
4407 * physmem.c (physmem_total, physmem_available, main): Define
4410 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
4411 (main): Define with a prototype.
4413 * posixver.c (getenv): Remove decl.
4415 * putenv.c (malloc): Returns void *, not char *.
4416 Include <string.h> unconditionally.
4417 (strchr, memcpy, NULL): Do not define.
4419 * readtokens.c: Include readtokens.h first, to test interface.
4420 Include <stdlib.h>, <string.h> unconditionally.
4421 (init_tokenbuffer): Define with a prototype.
4423 * regex.c (PARAMS): Remove. All uses removed.
4424 All uses of _RE_ARGS removed, too.
4425 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4427 (bzero): Assume memset exists.
4428 (memcmp, memcpy, NULL): Remove.
4429 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
4430 char, or assignments to local vars of type signed char.
4431 (init_syntax_once, PREFIX(extract_number_and_incr),
4432 PREFIX(print_partial_compiled_pattern),
4433 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
4434 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
4435 PREFIX(regex_grow_registers), PREFIX(regex_compile),
4436 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
4437 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
4438 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
4439 wcs_compile_range, byte_compile_range, truncate_wchar,
4440 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
4441 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
4442 count_mbs_length, wcs_re_match_2_internal,
4443 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
4444 PREFIX(alt_match_null_string_p),
4445 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
4446 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
4447 regfree, PREFIX(extract_number)): Define with prototype. Remove
4448 now-unnecessary declaration, if any.
4449 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
4451 Remove now-unnecessary casts among pointer types.
4452 * regex.h (_RE_ARGS): Remove. All uses removed.
4454 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
4455 (free): Remove decl.
4457 * rpmatch.c: Include <stdlib.h> unconditionally.
4459 * same.c: Include <stdlib.h>, <string.h> unconditionally.
4460 (free): Remove decl.
4462 * save-cwd.c: Include <stdlib.h> unconditionally.
4463 * xgetcwd.c: Likewise.
4465 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
4466 (free): Remove decl.
4468 * strchrnul.c (strchrnul): Define with a prototype.
4469 Fix bug: c_in was not converted to char before searching.
4471 The following changes are not K&R related:
4473 * group-member.h: Include <sys/types.h>, so that this file is
4475 * makepath.h: Likewise.
4477 * getusershell.c (readname, default_index, line_size, readname):
4478 Use size_t, not int, for sizes.
4479 (readname): If the size overflows, report an error instead of
4482 2003-09-09 Derek Robert Price <derek@ximbiot.com>
4484 * getndelim2.c: Assume stdlib.h per the C89 spec.
4486 2003-09-08 Paul Eggert <eggert@twinsun.com>
4488 Assume C89 or better; remove K&R cruft.
4489 A few of these changes were first proposed by Derek Robert Price
4490 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
4492 * addext.c: Include <string.h> unconditionally.
4493 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
4494 Don't declare getenv or malloc.
4496 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
4497 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
4499 (find_stack_direction, alloca): Use prototypes.
4501 * atexit.c (atexit): Define using a prototype.
4503 * basename.c, dirname.c, stripslash.c:
4504 Include <string.h> unconditionally.
4506 * bcopy.c: Include <stddef.h>.
4507 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
4509 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
4511 * error.h (error, error_at_line, error_print_progname)
4512 [! (defined (__STDC__) && __STDC__)]: Remove decls.
4513 * error.c: Include error.h first, to check interface.
4514 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4515 (VA_START): Remove; all uses changeed to va_start.
4516 (exit, strerror): Remove decls.
4517 (error_print_progname): Prototype uncondionally.
4518 Don't include <errno.h>; no longer needed.
4519 (private_strerror): Remove.
4520 (error_tail): Always define.
4521 (error, error_at_line): Assume C89 or better; always use prototypes.
4522 * fatal.c: Include "fatal.h" first, to test interface.
4523 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4524 (VA_START): Remove; all uses changed to va_start.
4525 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
4527 (exit): Remove decl.
4528 (fatal): Prototype unconditionally. Assume va_start works.
4529 Abort at end, to pacify gcc.
4531 * euidaccess.c (main): Define with a prototype.
4533 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
4535 * exitfail.c: Include <stdlib.h> unconditionally.
4537 * fnmatch_.h (__P): Remove. All uses changed to assume
4539 * fnmatch.c: Include fnmatch.h first, to test interface.
4540 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
4541 (getenv): Remove decl.
4542 (fnmatch): Define using a prototype.
4543 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
4544 (FCT): Define using a prototype.
4546 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
4548 * gethostname.c: Include <stddef.h>.
4549 (gethostname): Define with prototype. Length is size_t, not int.
4551 2003-09-08 Paul Eggert <eggert@twinsun.com>
4553 * getversion.c: Remove; was migrated to backupfile.c in 1997.
4554 getversion.c should have been removed then, but was accidentally
4557 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
4558 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
4560 2003-09-07 Paul Eggert <eggert@twinsun.com>
4562 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
4563 copy_tm_result. Bug reported by Simon Josefsson in
4564 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
4566 2003-09-06 Paul Eggert <eggert@twinsun.com>
4568 * time_r.c, time_r.h: New files.
4570 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
4572 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
4573 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
4575 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
4577 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
4578 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
4581 * timegm.c: Switch to glibc implementation, with the following changes:
4582 [defined HAVE_CONFIG_H]: Include <config.h>.
4583 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
4584 (__mktime_internal) [!defined _LIBC]: New decl.
4585 (__gmtime_r) [!defined _LIBC]: New macro and function.
4586 (timegm): Use a prototype, since gnulib assumes C89.
4587 Do not bother declaring tmp to be const, as it's not really usefu.
4588 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
4589 (timegm): Declare only if HAVE_DECL_TIMEGM.
4591 2003-09-03 Paul Eggert <eggert@twinsun.com>
4593 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
4594 Bug reported by Lute Kamstra in
4595 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
4597 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
4598 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
4599 course with correspondingly smaller numbers for tomorrow and
4600 yesterday. From Tadayoshi Funaba. Originally installed into
4601 sh-utils on 1999-08-07, but the patch got lost (I guess during the
4604 2003-08-31 Simon Josefsson <jas@extundo.com>
4606 * timegm.h: New file.
4607 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
4609 2003-08-31 Karl Berry <karl@gnu.org>
4611 * argp.h: update from libc.
4613 2003-08-28 Bruno Haible <bruno@clisp.org>
4615 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
4616 warning on QNX, which defines O_BINARY to 000000.
4618 2003-08-24 Bruno Haible <bruno@clisp.org>
4620 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
4621 MSVC7 <stdio.h> is included later.
4623 2003-08-20 Bruno Haible <bruno@clisp.org>
4625 * progname.h: New file, from GNU gettext.
4626 * progname.c: New file, from GNU gettext.
4627 * progreloc.c: New file, from GNU gettext.
4629 2003-08-19 Bruno Haible <bruno@clisp.org>
4631 * xstrdup.c: Assume <string.h> exists.
4633 2003-08-18 Jim Meyering <jim@meyering.net>
4635 * setenv.h: Indent nested cpp directive.
4636 * vasnprintf.c: Remove trailing blanks.
4638 2003-08-17 Simon Josefsson <jas@extundo.com>
4639 Bruno Haible <bruno@clisp.org>
4641 * xstrndup.h: New file.
4642 * xstrndup.c: New file.
4644 2003-08-17 Bruno Haible <bruno@clisp.org>
4646 * strndup.h: New file.
4648 2003-08-16 Paul Eggert <eggert@twinsun.com>
4650 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
4651 space, undoing this 2003-08-12 change:
4652 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
4654 2003-08-16 Jim Meyering <jim@meyering.net>
4656 Merge from coreutils.
4657 * xstrtoimax.c: #else #if -> #elif.
4658 * xstrtoumax.c: Likewise.
4660 2003-08-15 Paul Eggert <eggert@twinsun.com>
4662 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
4663 rather than tab, after '#' in shell-script copyright notices.
4664 Suggested by Bruno Haible.
4666 2003-08-15 Jim Meyering <jim@meyering.net>
4667 and Paul Eggert <eggert@twinsun.com>
4669 Merge from coreutils.
4670 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
4671 member but strut utmpx does not. Needed for AIX 4.3.3.
4672 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
4674 2003-08-15 Jim Meyering <jim@meyering.net>
4676 Merge from coreutils.
4677 * xgethostname.c: Include <stdlib.h>.
4678 (xghostname): Don't exit for anything other than memory-related
4679 failure; just return NULL.
4680 * userspec.c: Include "posixver.h".
4681 (parse_user_spec): Accept `.' as a separator only
4682 in pre-POSIX-200112 mode.
4683 * strtoimax.c: Use #elif rather than #else #if.
4684 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
4685 Remove function, now that we can rely on a working tzset function.
4686 [!_LIBC]: Ensure that the required autoconf test has been run.
4687 [!defined _NL_CURRENT && HAVE_STRFTIME]:
4688 Use underlying_strftime for %r.
4689 * sha.c: Merge in some clean-up and optimization changes from glibc.
4690 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
4691 Ensure that it is a multiple of 64.
4692 Rearrange loop exit tests so as to avoid performing an
4693 additional fread after encountering an error or EOF.
4694 * realloc.c: Update copyright date.
4696 2003-08-14 Jim Meyering <jim@meyering.net>
4698 Merge from coreutils.
4699 * obstack.h: Whitespace changes.
4700 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
4701 and xcalloc return values.
4702 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
4703 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
4704 hang on OSF/1 5.1 for DIR on both local and remote file systems.
4705 Reported by (and fix confirmed by) Nelson H. F. Beebe.
4706 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4708 Use mntctl's return value to drive the entry-processing loop, since
4709 we can't rely on the value of the vmt_length member in the last
4710 entry. On some systems doing so could result in exhausting
4711 virtual memory. Based in part on a patch from Mike Jetzer.
4713 2003-08-14 Jim Meyering <jim@meyering.net>
4714 and Paul Eggert <eggert@twinsun.com>
4716 Merges from coreutils, plus other fixes.
4717 * physmem.c: Merge in portability changes from gcc/libiberty
4718 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
4719 for credits and details. Thanks to Kaveh Ghazi for helping
4720 to keep these files in sync.
4721 (ARRAY_SIZE): Define it.
4722 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
4723 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
4724 (memcasecmp): Don't assume size_t fits in unsigned int.
4725 Remove casts and duplicate code.
4726 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
4727 (memcpy): Remove definition.
4728 Merge in some clean-up and optimization changes from glibc.
4729 [BLOCKSIZE]: Move definition to top of file.
4730 Ensure that it is a multiple of 64.
4731 Rearrange loop exit tests so as to avoid performing an
4732 additional fread after encountering an error or EOF.
4733 * md5.h (md5_uintptr): Define.
4734 * makepath.c (CLEANUP_CWD): Report an error if we failed to
4735 return to the initial working directory. Preserve errno
4737 * idcache.c: Include "xalloc.h".
4738 (xmalloc, xrealloc): Remove decls.
4739 (getuser): Remove casts no longer required in C89.
4740 * human.c: Include stdio.h, for sprintf.
4741 * group-member.c: Include "xalloc.h".
4742 (xmalloc, xrealloc): Remove decls.
4743 (get_group_info): Remove casts no longer required in C89.
4744 * getusershell.c (readname): Remove casts no longer required in C89.
4745 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
4746 * getline.c: Whitespace fix, from coreutils.
4748 2003-08-13 Paul Eggert <eggert@twinsun.com>
4750 * exclude.c: Include <ctype.h>
4751 (IN_CTYPE_DOMAIN): New macro.
4753 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
4756 * argp-help.c, argp-parse.c, config.charset, getopt.h:
4757 Undo previous (whitespace-only) change.
4759 2003-08-12 Paul Eggert <eggert@twinsun.com>
4761 * argp-help.c, argp-parse.c, config.charset, getopt.h:
4762 Normalize leading white space and remove trailing white space.
4763 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
4764 notice, as per ../config/srclist-update.
4766 Merge from coreutils.
4767 * euidaccess.h: New file.
4768 * euidaccess.c: Include it.
4769 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
4770 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
4771 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
4773 2003-08-11 Bruno Haible <bruno@clisp.org>
4775 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
4776 (vasnprintf): Use it instead of wcslen.
4778 2003-08-11 Bruno Haible <bruno@clisp.org>
4780 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
4781 value to ensure that _Bool promotes to int. Use #define for _Bool when
4782 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
4784 2003-08-10 Karl Berry <karl@gnu.org>
4786 * regex.h: update from libc (whitespace fix).
4788 2003-08-09 Paul Eggert <eggert@twinsun.com>
4790 Merge some files from coreutils. These changes were
4791 originally made by Jim Meyering.
4792 * acl.c: Include <sys/types.h> before <sys/stat.h>;
4793 many older Unixes require this.
4794 * alloca.c (alloca): Remove cast to argument of free;
4795 no longer needed in C89.
4796 * alloca_.h, regex.h: Fix white space to match
4797 what GNU indent does.
4799 2003-08-05 Paul Eggert <eggert@twinsun.com>
4801 * bumpalloc.h: Remove.
4803 2003-08-04 Paul Eggert <eggert@twinsun.com>
4805 * getloadavg.c: Change copyright notice and spacing to conform to
4808 Merge from coreutils.
4809 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
4811 * getdate.y (date): Also accept dates like May-23-2003; suggestion
4812 from Karl Berry, implemented by Jim Meyering.
4813 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
4814 from Dmitry V. Levin.
4815 Remove anachronistic cast of xrealloc.
4816 * fnmatch_.h (__const): Remove. Use 'const'.
4817 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
4818 type. Otherwise, it wouldn't compile with at least /bin/cc on
4819 ymp-cray-unicos9.0.2.X.
4820 Combine two mostly-identical uses of alloca into one.
4821 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
4823 2003-08-04 Dave Love <d.love@dl.ac.uk>
4827 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
4828 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
4829 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
4830 obsolete NLIST_NAME_UNION.
4831 [__GNU__]: Undef BSD and FSCALE.
4832 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
4834 2003-08-03 Paul Eggert <eggert@twinsun.com>
4836 * stdbool_.h (_Bool): Make it signed char, instead of
4837 an enum type, so that it's guaranteed to promote to int. See:
4838 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
4840 2003-07-31 Paul Eggert <eggert@twinsun.com>
4842 * strerror.c: Include config.h, limits.h. Declare sprintf.
4843 (strerror): Don't assume that a printable int fits in 14 bytes.
4845 2003-07-24 Derek Robert Price <derek@ximbiot.com>
4846 Bruno Haible <bruno@clisp.org>
4848 * getline.h (getline, getdelim): Change return type to ssize_t.
4849 * getline.c (getline, getdelim): Likewise.
4850 Remove _GNU_SOURCE define; now it's defined in config.h through
4853 2003-07-22 Paul Eggert <eggert@twinsun.com>
4855 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
4856 over-parenthesization in macros.
4858 Sync with coreutils.
4860 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
4863 Use `exit_failure' for xalloc and xmemcoll instead of their own
4864 private exit-failure variables.
4865 * xalloc.h (xalloc_exit_failure): Remove.
4866 * xmalloc.c: Likewise. Include exitfail.h.
4867 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
4868 * xmemcoll.h (xmemcoll_exit_failure): Remove.
4869 * xmemcoll.c: Likewise. Include exitfail.h.
4870 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
4872 2003-07-18 Paul Eggert <eggert@twinsun.com>
4874 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
4875 * closeout.c: Likewise. Include "closeout.h" right after config.h,
4876 to test that it can stand by itself. Include "exitfail.h".
4877 Clients should set exit_failure instead.
4878 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
4880 2003-07-18 Andreas Schwab <schwab@suse.de>
4882 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
4884 2003-07-18 Bruno Haible <bruno@clisp.org>
4886 * getndelim2.h: New file.
4887 * getndelim2.c: Make into a module of its own. Include config.h,
4889 (getndelim2): Make non-static. Change return type to ssize_t.
4890 * getline.h: Change argument names.
4891 * getline.c: Include getndelim2.h instead of getndelim2.c.
4892 * getnline.c: Include getndelim2.h.
4894 2003-07-17 Bruno Haible <bruno@clisp.org>
4896 * Makefile.am: Remove file.
4897 * Makefile.in: Remove file.
4899 2003-07-17 Bruno Haible <bruno@clisp.org>
4901 * getnline.h: New file.
4902 * getnline.c: New file.
4903 * getndelim2.c: New file, extracted from getline.c.
4904 (getndelim2): Renamed from getdelim2, with added nmax argument.
4905 * getline.c: Include getndelim2.c.
4906 (getdelim2): Moved out to getndelim2.c.
4907 (getline, getdelim): Update.
4909 2003-07-15 <karl@gnu.org>
4911 * vasnprintf.c: update from gettext.
4913 2003-07-15 Jim Meyering <jim@meyering.net>
4915 * makepath.c (make_path): Enclose diagnostic in _(...).
4917 2003-07-14 Paul Eggert <eggert@twinsun.com>
4919 * asnprintf.c, asprintf.c, config.charset, gettext.h,
4920 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
4921 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
4922 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
4923 vasprintf.c, vasprintf.h: Regenerate. These files are now being
4924 updated automatically by ../config/srclist-update. This changes
4925 their license from LPGL to GPL.
4927 2003-07-14 Jim Meyering <jim@meyering.net>
4929 Don't emit diagnostics. Let callers do that.
4930 * save-cwd.c: Don't include "error.h".
4931 (save_cwd): Don't call error. Ensure that errno is valid
4932 when returning nonzero.
4934 * save-cwd.h (restore_cwd): Update prototype.
4935 * save-cwd.c (restore_cwd): Remove two parameters.
4936 Simplify. Don't call error upon failure. Let callers do that.
4937 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
4938 when auditing is enabled. But don't bother updating the #if.
4940 2003-07-14 Simon Josefsson <jas@extundo.com>
4942 * mempcpy.h: New file.
4943 * mempcpy.c: New file.
4945 2003-07-14 Paul Eggert <eggert@twinsun.com>
4947 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
4948 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
4949 unicodeio.c, unicodeio.h, unlocked-io.h:
4950 Switch from LGPL to GPL.
4952 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
4954 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
4955 it breaks C++ compilation.
4956 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
4958 2003-07-10 Jim Meyering <jim@meyering.net>
4960 * vasnprintf.c: Remove trailing blanks.
4961 Make cpp indentation consistent.
4963 2003-07-09 Paul Eggert <eggert@twinsun.com>
4965 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
4966 posixver.c, strftime.c, strnlen.c, strverscmp.c:
4967 Switch from LGPL to GPL.
4969 2003-07-07 Paul Eggert <eggert@twinsun.com>
4971 * mktime.c: Fix some boundary cases and remove need for floating point.
4973 Issue a compile-time diagnostic if time_t is floating point, or if
4974 two's complement arithmetic is not in effect, or if arithmetic
4975 right shift does not propagate the sign. These assumptions were
4976 all in the original code but they weren't checked.
4978 (TIME_T_MIDPOINT, verify): New macros.
4979 (__isleap): Remove; it has integer overflow problems.
4980 (leapyear): New function, without those problems.
4981 (ydhms_tm_diff): Remove; splitting into two parts.
4982 (ydhms_diff): New function, containing the arithmetic part of
4983 the old ydhms_tm_diff function. Issue a compile-time
4984 diagnostic if we are not using C99 integer division.
4985 Avoid casts when possible.
4986 (guess_time_tm): New function, containing the checking part of
4987 the old ydhms_tm_diff function. Return the new value, rather than
4988 the difference between it and the old. Accept a new argument T
4989 so that *T specifies the old value. Check for overflow in the result.
4991 (__mktime_internal): Use a time_t offset, not a long int offset.
4992 This undoes the 2003-06-04 change, which is no longer needed now
4993 that we have better overflow checking.
4994 (localtime_offset): Likewise.
4996 (__mktime_internal): Avoid harmful overflow on hosts where time_t
4997 and long are 64-bit but int is only 32-bit.
4998 (ydhms_diff): Use long int to store year1 and yday1.
4999 Issue a compile-time diagnostic if long int is not wide enough.
5001 (__mktime_internal): Use long int to store adjusted year and yday.
5002 Use plain C rather than preprocessor commands, if that doesn't
5004 Check for overflow (and try to repair) after each probe
5005 rather than checking only at the very end. This avoids some bugs
5006 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
5007 does not equal GMT offset at maximum time).
5008 Use integer to check for overflow rather than floating point; this
5009 is more portable to non-IEEE hosts, and is a tad faster.
5010 When we detect that we are oscillating between two values,
5011 don't check whether tm_isdst has the requested value, since
5012 we already know the answer. When tm_isdst has the wrong value,
5013 use a different heuristic to find the right one, based on the
5014 extreme values actually observed in practice in tz2003a,
5015 rather than the (overly optimistic) "previous 3 calendar quarters".
5017 (not_equal_tm, print_tm, check_result): Use "const T" rather than
5018 "T const" to accommodate glibc style.
5019 (check_result): Use less-confusing report format. "long" -> "long int.
5021 Don't loop if the iteration overflows time_t.
5022 Allow a negative step in the iteration.
5024 2003-07-01 Paul Eggert <eggert@twinsun.com>
5026 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5027 having it depend on HAVE_SYS_TYPES_H.
5029 2003-06-25 Bruno Haible <bruno@clisp.org>
5031 * readlink.c: New file.
5033 2003-06-20 Bruno Haible <bruno@clisp.org>
5035 Assume C89, so PARAMS isn't needed.
5036 * unicodeio.h (PARAMS): Remove.
5037 * unicodeio.c: Don't use PARAMS.
5039 2003-06-18 Jim Meyering <jim@meyering.net>
5041 Merge changes from coreutils.
5042 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5043 Remove explicit declarations of xmalloc and realloc.
5045 (read_utmp): Remove anachronistic cast of xmalloc.
5047 2003-06-17 Paul Eggert <eggert@twinsun.com>
5049 Assume C89, so PARAMS isn't needed.
5050 * backupfile.h (PARAMS): Remove. All uses removed.
5051 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5052 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5053 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5054 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5055 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5056 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5057 xstrtol.h: Likewise.
5058 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
5059 same.h, strverscmp.h: Do not include config.h; no longer needed.
5060 Anyway, config.h should always be included before any other file.
5062 2003-06-11 Simon Josefsson <jas@extundo.com>
5064 * sysexit_.h: New file.
5066 2003-05-20 Derek Price <derek@ximbiot.com>
5068 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5070 2003-06-10 Simon Josefsson <jas@extundo.com>
5072 * strchrnul.h: New file.
5073 * strchrnul.c: New file.
5075 2003-06-10 Simon Josefsson <jas@extundo.com>
5077 * argp.h: New file, from glibc.
5078 * argp-ba.c: New file, from glibc.
5079 * argp-eexst.c: New file, from glibc.
5080 * argp-fmtstream.c: New file, from glibc.
5081 * argp-fmtstream.h: New file, from glibc.
5082 * argp-fs-xinl.c: New file, from glibc.
5083 * argp-help.c: New file, from glibc.
5084 * argp-namefrob.h: New file, from glibc.
5085 * argp-parse.c: New file, from glibc.
5086 * argp-pv.c: New file, from glibc.
5087 * argp-pvh.c: New file, from glibc.
5088 * argp-xinl.c: New file, from glibc.
5090 2003-06-07 Jim Meyering <jim@meyering.net>
5092 * readtokens.h: Put `Free Software Foundation, Inc.'
5093 in place of my name in the copyright comment.
5094 Remove definition and uses of __P.
5097 * stat.c: Don't declare xmalloc explicitly.
5098 Instead, include "xalloc.h".
5099 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
5100 xrealloc, and xcalloc return values.
5101 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
5103 * xgetcwd.h: Remove definition/uses of PARAMS.
5105 2003-06-06 Jim Meyering <jim@meyering.net>
5107 * stdbool_.h: Renamed from stdbool.h.in.
5109 2003-06-06 Jim Meyering <jim@meyering.net>
5111 Merge from coreutils.
5112 * same.c: (same_name): Declare *_basename locals to be `const'.
5113 Consolidate declarations and initializations of *_base* locals.
5115 Merge from coreutils.
5116 This avoids a core dump on systems without GNU putenv,
5117 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5118 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5119 (unsetenv): New static function, from GNU libc.
5120 (rpl_putenv): Use it.
5122 * modechange.c: Remove trailing blanks.
5124 Merge from coreutils.
5125 * fsusage.c: Remove declaration of statfs.
5126 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5128 * posixtm.c: Include <stdbool.h> unconditionally.
5130 2003-06-05 Paul Eggert <eggert@twinsun.com>
5132 * mktime.c (__mktime_internal): When resolving a tm_isdst
5133 mismatch, look in future quarters as well as past. This fixes a
5134 bug when processing fall-backwards gaps immediately after a long
5135 period of daylight-saving time.
5137 * mktime.c: Assume freestanding C89 or better.
5138 (HAVE_LIMITS_H): Remove. Assume it's 1.
5139 (__P): Remove; not used.
5140 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5141 (mktime, not_equal_tm, print_tm, check_result,
5142 main): Use prototypes. Use const * where appropriate.
5143 (main): Fix typo in testing code that uncovered by above changes.
5144 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5146 2003-06-04 Paul Eggert <eggert@twinsun.com>
5148 * mktime.c: Fix Debian bug 177940
5149 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
5150 (localtime_offset): Now long int, not time_t, because we want it
5151 to be guaranteed to be signed. All uses changed.
5152 (__mktime_internal): If overflow would occur when adding offset,
5155 Merge 'human' changes from coreutils. Rewrite to support
5156 locale-specific notations like thousands separators.
5157 * human.c: Simplify authorship notice.
5158 Include human.h immediately after config.h.
5159 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
5160 <limits.h>: Do not include, since human.h does.
5161 (SIZE_MAX, UINTMAX_MAX): New macros.
5162 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
5163 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
5164 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
5165 (power_letter): Renamed from suffixes.
5166 (generate_suffix_backwards): Remove.
5167 (adjust_value): Now takes int style (because of human.h changes)
5168 and long double value (for greater precision on some platforms).
5169 (group_number): New function.
5170 (human_readable): Use it. Use integer options, not enum.
5171 Put the options before the sizes in the arg list.
5172 Support all the new options.
5173 The old human_readable function has been removed;
5174 use inttostr.h instead.
5175 (human_readable, default_block_size, humblock):
5176 Use uintmax_t, not int, for block sizes.
5177 (human_readable_inexact, block_size_types): Remove.
5178 (block_size_opts): New constant.
5179 (human_options): Renamed from human_block_size, with new signature
5180 that allows block sizes up to UINTMAX_MAX. All callers changed.
5181 * human.h: Add copyright and authorship notice.
5182 Include <limits.h> and <stdbool.h> unconditionally.
5183 (PARAMS): Remove. All uses removed.
5184 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
5185 (enum human_inexact_style): Remove tag; now a nameless enum.
5186 (human_floor, human_ceiling, human_round_to_even): Now have
5187 values 2, 0, 1 rather than -1, 1, 0.
5188 (human_group_digits, human_suppress_point_zero, human_autoscale,
5189 human_base_1024, human_SI, human_B): New constants.
5190 (human_readable_inexact, human_block_size): Remove.
5191 (human_readable): Size args are now uintmax_t, not int.
5192 (human_options): New decl.
5194 * exclude.c: (new_exclude, add_exclude): Remove casts that are
5195 unnecessary now that we assume C89 or better. This change
5196 imported from coreutils.
5198 * mktime.c (__mktime_internal): Do not reject negative timestamps
5199 arbitrarily. This is the same patch as 2003-05-28, but it got lost
5200 in the 2003-05-30 sync from glibc.
5202 .h files should stand alone, but we shouldn't include <sys/types.h>
5203 if we can get away with just <stddef.h>.
5205 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
5206 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
5207 rather than <sys/types.h>, as we merely need size_t.
5208 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
5210 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
5211 Include <stdio.h>, to get FILE.
5212 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
5213 memcasecmp.h has included <stddef.h> and all we need is size_t.
5214 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5215 our interface, instead of including <sys/types.h>
5217 2003-06-02 Paul Eggert <eggert@twinsun.com>
5220 Fix some minor time-related bugs with POSIX time arguments.
5221 Some valid time stamps were being rejected (notably -1, and
5222 time stamps before 1900 on 64-bit hosts). And some invalid
5223 time stamps were being accepted, e.g. September 31.
5225 * posixtm.h (posixtime): Return bool instead of time_t, so
5226 that we can return (time_t) -1 successfully.
5227 * posixtm.c: Likewise.
5228 [HAVE_STDBOOL_H]: Include <stdbool.h>.
5229 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
5230 (t): Remove static var.
5231 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
5232 of static var. All uses changed.
5233 (year): Do not reject years before 1900; they can occur with
5235 (posix_time_parse): Do not check for out-of-range components;
5236 that is now the caller's responsibility, since our checks were
5237 only approximations.
5238 (posixtime): Use mktime to check for out-of-range components,
5239 since it knows them exactly.
5240 If mktime returns (time_t) -1, check whether an error actually occurred
5241 by invoking localtime on -1.
5242 (main) [TEST_POSIXTIME]: Check for input data errors, and report
5243 posixtime failures better.
5244 Improve the test data (in comments only).
5246 2003-05-30 <karl@gnu.org>
5248 * mktime.c: update from libc.
5250 2003-05-30 Bruno Haible <bruno@clisp.org>
5252 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
5253 * localcharset.h: Likewise.
5254 * localcharset.c: Likewise.
5256 2003-05-28 Paul Eggert <eggert@twinsun.com>
5258 Assume the headers required for C89 freestanding compilers.
5259 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
5260 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
5261 without checking for HAVE_LIMITS_H.
5262 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
5263 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
5265 * fatal.c: Include <stdarg.h> without checking for __STDC__.
5266 * exclude.c: Include <stdbool.h> unconditionally.
5267 * tempname.c: Include <stddef.h> unconditionally.
5268 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
5269 * modechange.c, rpmatch.c (NULL): Don't define, since
5270 <stddef.h> does that.
5271 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
5272 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
5273 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
5274 * xstrtol.c: Likewise.
5275 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
5276 * savedir.c: Include <stddef.h> instead of defining NULL.
5278 * addext.c (addext): Use assignment rather than cast, to avoid
5279 warnings on some platforms.
5281 * mktime.c (__mktime_internal): Do not reject negative timestamps
5284 2003-05-10 Bruno Haible <bruno@clisp.org>
5286 * linebreak.c (iconv_string_length): Don't return -1 just because the
5287 string is longer than 4 KB.
5289 2003-05-12 Jim Meyering <jim@meyering.net>
5291 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
5292 the space-padded-by-default conversion specifiers, %e, %k, %l.
5294 2003-05-03 Bruno Haible <bruno@clisp.org>
5296 Upgrade to Unicode-4.0.
5297 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
5298 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
5299 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
5300 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
5301 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
5302 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
5303 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
5304 Change width of U+E0100..U+E01EF from 1 to 0.
5306 2003-04-25 Bruno Haible <bruno@clisp.org>
5308 * copy-file.c: Include <stddef.h>, for size_t.
5310 2003-04-25 Jim Meyering <jim@meyering.net>
5312 * copy-file.c (copy_file_preserving): Declare buf_size to be
5313 of type size_t, not int.
5315 2003-04-11 Jim Meyering <jim@meyering.net>
5317 Merge changes from Coreutils.
5319 2003-03-22 Jim Meyering <jim@meyering.net>
5321 * strftime.c (widen): Cast alloca return value to proper type.
5323 2003-01-19 Ulrich Drepper <drepper@redhat.com>
5326 * strftime.c (my_strftime): Handle very large width
5327 specifications for numeric values correctly. Improve checks for
5330 2003-01-19 Jim Meyering <jim@meyering.net>
5332 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
5333 (nl_get_alt_digit) [! defined my_strftime]: Define.
5334 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
5335 _nl_get_alt_digit and _nl_get_walt_digit.
5337 * strftime.c (my_strftime): Merge in locale-related changes from libc.
5338 These changes have no effect outside of _LIBC.
5340 2003-04-10 Bruno Haible <bruno@clisp.org>
5342 * findprog.h: New file, from GNU gettext.
5343 * findprog.c: New file, from GNU gettext.
5345 2003-04-05 Jim Meyering <jim@meyering.net>
5347 Merge changes from Coreutils.
5349 * exclude.h (PARAMS): Remove definition and uses.
5350 * exclude.c: Remove uses of `PARAMS'.
5352 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
5353 Add test-cases for DOS filenames. Declare program_name.
5354 (main): Set up program_name. Patch by Rich Dawe.
5356 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5358 Use mntctl's return value to drive the entry-processing loop, since
5359 we can't rely on the value of the vmt_length member in the last
5360 entry. On some systems doing so could result in exhausting
5361 virtual memory. Based in part on a patch from Mike Jetzer.
5363 2003-04-04 Bruno Haible <bruno@clisp.org>
5365 * linebreak.h: New file, from GNU gettext.
5366 * linebreak.c: New file, from GNU gettext with slight modifications.
5367 * lbrkprop.h: New file, from GNU gettext.
5369 2003-04-03 Bruno Haible <bruno@clisp.org>
5371 * utf8-ucs4.h: New file, from GNU gettext.
5372 * utf16-ucs4.h: New file, from GNU gettext.
5373 * ucs4-utf8.h: New file, from GNU gettext.
5374 * ucs4-utf16.h: New file, from GNU gettext.
5376 2003-04-02 Bruno Haible <bruno@clisp.org>
5378 * binary-io.h: New file, from GNU gettext.
5380 2003-04-01 Bruno Haible <bruno@clisp.org>
5382 * pathname.h: New file, from GNU gettext.
5383 * concatpath.c: New file, from GNU gettext.
5385 2003-03-30 Bruno Haible <bruno@clisp.org>
5387 * copy-file.c (copy_file_preserving): Don't set owner if the function
5388 chown() doesn't exist.
5390 2003-03-28 Bruno Haible <bruno@clisp.org>
5392 * copy-file.h: New file, from GNU gettext.
5393 * copy-file.c: New file, from GNU gettext.
5395 2003-03-18 Jim Meyering <jim@meyering.net>
5397 * quote.c (quote_n): Fix typo in comment.
5399 2003-03-14 Jim Meyering <jim@meyering.net>
5401 Merge changes from Coreutils.
5402 * obstack.h (obstack_object_size): Declare temporary, __o,
5403 to be const, in order to avoid warnings.
5404 (obstack_room): Likewise.
5405 (obstack_empty_p): Likewise.
5407 2003-03-13 Paul Eggert <eggert@twinsun.com>
5409 Merge changes from Bison.
5410 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
5411 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5412 when compiling Bison 1.875's `bitset bset = obstack_alloc
5413 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
5414 * hash.c: Include <stdbool.h> unconditionally.
5416 2003-03-09 Paul Eggert <eggert@twinsun.com>
5418 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
5419 Reported by Bruce Becker; see:
5420 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
5422 2003-03-03 Paul Eggert <eggert@twinsun.com>
5423 Bruno Haible <bruno@clisp.org>
5425 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
5426 Reported by John Hughes, see
5427 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
5429 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
5431 * poll_.h: New file.
5434 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
5436 * mathl.h: New file.
5437 * acosl.c: New file.
5438 * asinl.c: New file.
5439 * atanl.c: New file.
5440 * ceill.c: New file.
5443 * floorl.c: New file.
5444 * frexpl.c: New file.
5445 * ldexpl.c: New file.
5447 * sincosl.c: New file.
5449 * sqrtl.c: New file.
5451 * trigl.c: New file.
5452 * trigl.h: New file.
5454 2003-02-17 Bruno Haible <bruno@clisp.org>
5456 * mkdtemp.h: New file, from GNU gettext.
5457 * mkdtemp.c: New file, from GNU gettext.
5459 2003-01-31 Bruno Haible <bruno@clisp.org>
5461 * rename.c: #undef rename before defining rpl_rename.
5462 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
5464 2003-01-30 Bruno Haible <bruno@clisp.org>
5466 * printf-args.h: New file, from GNU gettext.
5467 * printf-args.c: New file, from GNU gettext.
5468 * printf-parse.h: New file, from GNU gettext.
5469 * printf-parse.c: New file, from GNU gettext.
5470 * vasnprintf.h: New file, from GNU gettext.
5471 * vasnprintf.c: New file, from GNU gettext.
5472 * asnprintf.c: New file, from GNU gettext.
5473 * vasprintf.h: New file, from GNU gettext with modifications.
5474 * vasprintf.c: New file, from GNU gettext.
5475 * asprintf.c: New file, from GNU gettext.
5477 2003-01-29 Bruno Haible <bruno@clisp.org>
5479 * stpncpy.h: New file, from GNU gettext with modifications.
5480 * stpncpy.c: New file, from GNU gettext with modifications.
5482 2003-01-28 Bruno Haible <bruno@clisp.org>
5484 * c-ctype.h: New file, from GNU gettext, with changes suggested by
5486 * c-ctype.c: New file, from GNU gettext, with changes suggested by
5489 2003-01-27 Bruno Haible <bruno@clisp.org>
5491 * xsetenv.h: New file, from GNU gettext.
5492 * xsetenv.c: New file, from GNU gettext.
5494 2003-01-23 Bruno Haible <bruno@clisp.org>
5496 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
5498 2003-01-22 Bruno Haible <bruno@clisp.org>
5500 * exit.h: New file, from GNU gettext.
5502 2003-01-11 Bruno Haible <bruno@clisp.org>
5504 * stpcpy.h (stpcpy): Use ANSI C function declarations.
5505 * strcase.h (strcasecmp, strncasecmp): Likewise.
5507 2003-01-14 Jim Meyering <jim@meyering.net>
5509 * same.c (same_name): Tweak a comment.
5511 2003-01-11 Bruno Haible <bruno@clisp.org>
5513 * same.c (same_name): Reorder tests so as to avoid calling stat()
5514 when a string comparison is sufficient.
5516 2003-01-11 Bruno Haible <bruno@clisp.org>
5518 * readtokens.c (readtoken): Cast character to 'unsigned char', not
5521 2003-01-11 Bruno Haible <bruno@clisp.org>
5523 * hash-pjw.c: Add comment about low quality of this function.
5525 2003-01-12 Paul Eggert <eggert@twinsun.com>
5527 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
5528 to avoid collisions with libcurses and libreadline.
5530 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
5531 * getstr.h, getstr.c: Remove.
5532 * getline.c: Include "getline.h", to check interface.
5533 Move body of old getstr.c here: this defines MIN_CHUNK and
5534 declares getdelim2, which is renamed from getstr.
5535 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
5537 * linebuffer.c (readlinebuffer): Renamed from readline.
5539 * linebuffer.h: Likewise.
5540 (readline): Remove backward-compatibility macro.
5542 2003-01-12 Jim Meyering <jim@meyering.net>
5544 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
5546 2003-01-10 Bruno Haible <bruno@clisp.org>
5548 * alloca_.h: New file.
5549 * getdate.y: Unconditionally include alloca.h.
5550 * makepath.c: Likewise.
5551 * setenv.c: Likewise.
5552 * userspec.c: Likewise.
5554 2003-01-09 Bruno Haible <bruno@clisp.org>
5556 * stdbool.h.in: New file.
5558 2003-01-08 Bruno Haible <bruno@clisp.org>
5560 * safe-read.c: Include specification header first, to ensure its
5562 * full-write.c: Likewise.
5564 2003-01-08 Jim Meyering <jim@meyering.net>
5566 * full-write.c: Undefine and define-away `const' after inclusion
5567 of errno.h, not before. Suggestion from Bruno Haible.
5569 2003-01-07 Jim Meyering <jim@meyering.net>
5571 * full-write.c: Rework so that it may serve to define full_read, too.
5572 * full-read.c: Simply #define FULL_READ and include full-write.c.
5574 2003-01-06 Jim Meyering <jim@meyering.net>
5576 * version-etc.c: Update year in translatable copyright string.
5578 2002-12-25 Bruno Haible <bruno@clisp.org>
5580 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
5581 * xstrtol.h: Likewise.
5582 * xstrtoimax.c: Likewise.
5583 * xstrtoumax.c: Likewise.
5584 * human.h: Likewise.
5586 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
5587 on systems that have <inttypes.h> but not <stdint.h>.
5589 2002-12-31 Paul Eggert <eggert@twinsun.com>
5591 * memcoll.c (memcoll): Fall back on a simple algorithm using
5592 memcmp if strcoll doesn't work.
5594 2002-12-23 Bruno Haible <bruno@clisp.org>
5596 * localcharset.h: New file.
5597 * localcharset.c: Include it.
5598 * unicodeio.c: Likewise.
5600 2002-12-22 Bruno Haible <bruno@clisp.org>
5602 * utime.c (utime_null): No need to call ftruncate if the file was
5605 2002-12-23 Bruno Haible <bruno@clisp.org>
5607 * memcoll.c (STRCOLL): New macro.
5610 2002-12-22 Bruno Haible <bruno@clisp.org>
5612 * getstr.h (getstr): Define, to avoid clash with libcurses.
5613 * linebuffer.h (readline): Define, to avoid clash with libreadline.
5615 2002-12-22 Bruno Haible <bruno@clisp.org>
5617 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
5619 2002-12-23 Bruno Haible <bruno@clisp.org>
5621 * getline.h: Include <stddef.h>, for size_t.
5623 * unicodeio.h: Include <stddef.h>, for size_t.
5624 * unicodeio.c: Don't include <stddef.h>.
5626 2002-12-17 Bruno Haible <bruno@clisp.org>
5628 * canon-host.c (strdup): Remove unused declaration.
5630 * fsusage.c: Include full_read.h.
5631 (get_fs_usage): Use full_read instead of safe_read.
5633 * utime.c (utime_null): Use SAFE_READ_ERROR.
5635 2002-12-11 Bruno Haible <bruno@clisp.org>
5637 * setenv.h: Rewritten to cope with systems that have setenv() but not
5639 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
5642 2002-12-11 Bruno Haible <bruno@clisp.org>
5644 * setenv.c (alloca): Fall back to malloc.
5646 (setenv): Use freea() to free memory allocated with alloca().
5648 2002-11-13 Bruno Haible <bruno@clisp.org>
5650 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
5651 function declarations.
5652 * unsetenv.c (unsetenv): Likewise.
5654 2002-03-04 Bruno Haible <bruno@clisp.org>
5656 Portability to AIX 4.3.3.
5657 * unsetenv.c: New file, extracted from setenv.c.
5658 * setenv.c: Move the unsetenv() function to unsetenv.c.
5660 2001-12-20 Bruno Haible <bruno@clisp.org>
5662 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
5663 use malloc instead. For SunOS 4.
5665 2001-12-11 Bruno Haible <bruno@clisp.org>
5667 * setenv.c: Declare alloca.
5668 (compar_fn_t): New typedef.
5669 (KNOWN_VALUE, STORE_VALUE): Use it.
5671 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
5674 2002-12-10 Paul Eggert <eggert@twinsun.com>
5676 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
5677 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
5678 Choose values that are less likely to collide with system fnmatch
5680 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
5681 defined (e.g., a pure POSIX system).
5682 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
5683 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
5685 2002-12-06 Jim Meyering <jim@meyering.net>
5687 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
5689 Merge in changes from libc's misc/error.c, in preparation
5690 for the merge of gnulib's changes back into libc.
5692 * error.c (_): Define only if not already defined.
5693 Move definition to follow all #include directives.
5694 Include unlocked-io.h only if !_LIBC.
5695 [_LIBC]: Include <libio/libioP.h>.
5696 [USE_IN_LIBIO]: Include <libio/iolibio.h>
5697 (fflush): Tweak definition to use INTUSE.
5700 2002-12-05 Paul Eggert <eggert@twinsun.com>
5702 * alloca.c [defined emacs]: Include "lisp.h".
5703 (xalloc_die) [defined emacs]: New macro.
5704 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
5705 [! defined emacs]: Include <xalloc.h>.
5706 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
5707 (pointer): Typedef to POINTER_TYPE *.
5708 (malloc): Remove decl; we now always use xmalloc.
5709 (alloca): Use old-style definition, since Emacs needs this.
5710 Check for arithmetic overflow when computing combined size.
5712 2002-12-04 Paul Eggert <eggert@twinsun.com>
5714 Do not generate unlocked-io.h automatically, since it's easier to
5715 maintain it by hand.
5717 * unlocked-io.h: New file, from GNU diffutils,
5718 but with proper copyright notice and attribution.
5720 * Makefile.am: Add copyright notice.
5721 (libfetish_a_SOURCES): Add unlocked-io.h.
5722 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
5723 (DISTCLEANFILES, io_functions): Remove macros.
5724 (EXTRA_DIST): Remove gen_uio.
5725 (unlocked-io.h): Remove rule.
5727 2002-12-04 Jim Meyering <jim@meyering.net>
5729 Reflect the fact that stat.c and lstat.c are no longer generated.
5730 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
5731 (DISTCLEANFILES): Likewise.
5732 (EXTRA_DIST): Likewise.
5733 (all_local): Don't depend on stat.c or lstat.c.
5734 (stat.c, lstat.c): Remove rules.
5735 (EXTRA_DIST): Remove xstat.in.
5737 * xstat.in: Remove file. Contents moved into stat.c.
5738 * stat.c: New file. Contents mostly from xstat.in.
5739 * stat.c: Rework so that it may serve to define rpl_lstat, too.
5740 * lstat.c: New file. Simply #define LSTAT and include stat.c.
5742 * safe-read.c: Rework so that it may serve to define safe_write, too.
5743 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
5745 2002-12-03 Jim Meyering <jim@meyering.net>
5747 * safe-read.c, safe-write.c: Change variable names and comments, but
5748 not semantics, to minimize the differences between these two files.
5749 (safe_read): Change comment to mention SAFE_READ_ERROR.
5751 * safe-read.c (IS_EINTR): Define.
5752 (safe_read): Use IS_EINTR in place of in-function cpp directives.
5754 2002-12-02 Bruno Haible <bruno@clisp.org>
5756 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
5757 Define, taken from safe-read.c.
5758 (INT_MAX): Provide fallback.
5759 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
5760 * safe-write.h (SAFE_WRITE_ERROR): Define.
5762 * safe-read.c (EINTR): Remove definition.
5763 (safe_read): Don't use EINTR if it is absent.
5765 2002-12-02 Jim Meyering <jim@meyering.net>
5767 * safe-read.c (EINTR): Define.
5768 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
5769 (INT_MAX): Provide fallback.
5770 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
5772 * safe-read.h (SAFE_READ_ERROR): Define.
5774 2002-12-01 Jim Meyering <jim@meyering.net>
5776 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
5777 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
5779 2002-11-27 Paul Eggert <eggert@twinsun.com>
5781 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
5782 hash_rehash): Replace `if (limit <= value) abort ();' with
5783 `if (! (value < limit)) abort ();', for readability.
5785 2002-11-26 <karl@gnu.org>
5787 * strdup.c: copy from libc again, with jim's ok.
5788 * .cppi-disable: re-add strdup.c
5790 2002-11-25 <karl@gnu.org>
5792 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
5793 instead of "strtol.c".
5795 2002-11-25 Jim Meyering <jim@meyering.net>
5797 * mktime.c: Sync from libc, now that it has the latest fix.
5799 2002-11-24 <karl@gnu.org>
5801 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
5802 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
5804 2002-11-24 Jim Meyering <jim@meyering.net>
5806 Update from coreutils:
5808 * mktime.c: Merge in changes from libc.
5810 Avoid a link-time failure on some Linux systems.
5811 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
5812 (__mon_yday): Declare with the STATIC attribute.
5813 (__mktime_internal): Likewise.
5814 Based on a report from Greg Schafer.
5816 2002-11-23 Jim Meyering <jim@meyering.net>
5818 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
5819 Use `unsigned', not `int', as type of index.
5821 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
5823 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
5825 2002-11-22 Paul Eggert <eggert@twinsun.com>
5827 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
5828 hint that one should use `if (! x) abort ();' rather than `assert
5829 (x);', and anyway it's one less thing to worry about configuring.
5830 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
5831 hash_rehash, hash_insert): Use abort rather than assert.
5833 2002-11-22 Paul Eggert <eggert@twinsun.com>
5835 * quotearg.h: Allow multiple inclusion by surrounding with
5836 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
5837 so that we can be included first.
5838 (PARAMS): Remove; we now assume C89 or later. All uses removed.
5839 * quotearg.c: Include quotearg.h immediately after config.h.
5840 No need to include stddef.h or sys/types.h any more.
5841 Surround local include files with "", not "<>".
5842 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
5843 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
5844 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
5845 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
5846 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
5847 (ISPRINT): Remove; no longer needed now that we assume C89.
5849 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
5852 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
5853 quotearg_char): Use SIZE_MAX rather than
5854 (size_t) -1 when we are talking about "infinity".
5856 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
5858 2002-11-22 Bruno Haible <bruno@clisp.org>
5860 * safe-read.h: Assume C89. Add comments.
5861 (safe_read): Change return type to size_t.
5862 * safe-read.c (safe_read): Change return type to size_t. Handle byte
5863 counts > SSIZE_MAX correctly.
5864 * safe-write.h: New file.
5865 * safe-write.c: New file.
5866 * full-read.h: New file.
5867 * full-read.c: New file.
5868 * full-write.h: Assume C89. Add comments.
5869 * full-write.c: Include safe-write.h.
5870 (full_write): Rewritten to use safe_write.
5871 Suggested by Jim Meyering and Paul Eggert.
5873 2002-11-21 Bruno Haible <bruno@clisp.org>
5875 Remove case insensitive option matching.
5876 * argmatch.h (argcasematch): Remove declaration.
5877 (ARGCASEMATCH): Remove macro.
5878 (__xargmatch_internal): Remove case_sensitive argument.
5879 (XARGMATCH): Update.
5880 (XARGCASEMATCH): Remove macro.
5881 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
5882 case_sensitive argument.
5883 (argcasematch): Remove function.
5884 (__xargmatch_internal): Remove case_sensitive argument.
5885 (main): Use XARGMATCH instead of XARGCASEMATCH.
5887 * xmalloc.c: Change compile-time error message. Add comment about
5888 required autoconf version.
5890 2002-11-21 Jim Meyering <jim@meyering.net>
5892 * strdup.c (strdup): Tweak comment and initial #if/#include.
5894 Merge in changes from the coreutils.
5896 2002-09-25 Paul Eggert <eggert@twinsun.com>
5897 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
5898 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
5899 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
5900 int. Work more efficiently if X is the same width as uintmax_t.
5901 Do not compare X to -1, to avoid bogus compiler warning.
5902 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
5903 Don't assume that f_frsize and f_bsize are the same type.
5905 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
5908 * makepath.c (make_path): Restore umask *before* creating the final
5910 (make_path): Minor reformatting.
5912 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
5913 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
5915 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
5916 ones. At least on GNU/Linux systems, `auto' means something else.
5919 2002-11-20 Paul Eggert <eggert@twinsun.com>
5921 Merge argmatch cleanups from Bison. Assume C89.
5923 * argmatch.c: Include config.h here, not in argmatch.h.
5924 Include stdlib.h, for EXIT_FAILURE.
5925 Always include <string.h>, since we assume C89.
5926 (EXIT_FAILURE): Remove pre-C89 bug workaround.
5927 * argmatch.h: Do not include <config.h> or <sys/types.h>.
5928 Include <stddef.h> instead, since it's all we need for size_t.
5929 (PARAMS): Remove. All uses removed.
5930 (ARRAY_CARDINALITY): Do not bother to #undef.
5931 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
5932 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
5933 Remove unnecessary parentheses.
5934 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
5935 Insert necessary parentheses.
5936 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
5937 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
5939 2002-11-19 Bruno Haible <bruno@clisp.org>
5941 * mbswidth.c: Include mbswidth.h right at the beginning.
5942 * mbswidth.h: Include <stddef.h>, for size_t.
5944 * mbswidth.h (PARAMS): Remove macro.
5945 (mbswidth, mbsnwidth): Use ANSI C function declarations.
5946 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
5948 * gcd.h (PARAMS): Remove macro.
5949 (gcd): Use ANSI C function declarations.
5950 * gcd.c (gcd): Likewise.
5952 2002-11-15 Bruno Haible <bruno@clisp.org>
5954 * strcspn.c: Include <stddef.h>.
5955 (strcspn): Use ANSI C function declaration. Change return type to
5957 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
5958 (strpbrk): Use NULL.
5959 * strpbrk.h (PARAMS): Remove macro.
5960 (strpbrk): Use ANSI C function declaration.
5961 * strstr.c: Don't include <sys/types.h>.
5962 * strstr.h (PARAMS): Remove macro.
5963 (strstr): Use ANSI C function declarations.
5965 2002-11-06 Bruno Haible <bruno@clisp.org>
5967 * gcd.h (gcd): Change argument type to 'unsigned long'.
5968 * gcd.c (gcd): Likewise.
5970 2002-11-05 Bruno Haible <bruno@clisp.org>
5972 * gcd.h: New file, from gettext-0.11.5.
5973 * gcd.c: New file, from gettext-0.11.5.
5975 2002-11-05 Bruno Haible <bruno@clisp.org>
5977 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5978 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5979 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5980 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5982 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
5983 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
5985 * closeout.c: Include gettext.h instead of <libintl.h>.
5986 * human.c: Include gettext.h instead of <libintl.h>.
5987 * quotearg.c: Include gettext.h instead of <libintl.h>.
5988 * rpmatch.c: Include gettext.h instead of <libintl.h>.
5989 * unicodeio.c: Include gettext.h instead of <libintl.h>.
5990 * userspec.c: Include gettext.h instead of <libintl.h>.
5991 * version-etc.c: Include gettext.h instead of <libintl.h>.
5992 * xmalloc.c: Include gettext.h instead of <libintl.h>.
5993 (textdomain): Remove definition.
5994 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
5996 * long-options.c: Remove include of <libintl.h> and definition of _.
5997 * same.c: Remove include of <libintl.h> and definition of _.
5999 2002-11-04 Bruno Haible <bruno@clisp.org>
6001 * stpcpy.h: New file, from GNU gettext-0.11.5.
6002 * strcase.h: New file, from GNU gettext-0.11.5.
6003 * strpbrk.h: New file, from GNU gettext-0.11.5.
6004 * strstr.h: New file, from GNU gettext-0.11.5.
6005 * xgetcwd.h: New file, from GNU gettext-0.11.5.
6007 2002-05-09 Bruno Haible <bruno@clisp.org>
6009 * config.charset: Update for newest glibc. Add canonical names
6010 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
6012 2002-05-09 Bruno Haible <bruno@clisp.org>
6014 * localcharset.c (get_charset_aliases): Add more Windows specific
6017 2002-05-08 Owen Taylor <otaylor@redhat.com>
6019 * config.charset: A few additions for Solaris.
6021 2001-12-05 Bruno Haible <bruno@clisp.org>
6023 * localcharset.c (locale_charset): Don't return an empty string.
6025 2001-10-23 Bruno Haible <haible@clisp.cons.org>
6027 * config.charset: msdos in uk_UA uses CP1125.
6029 2001-08-05 Bruno Haible <haible@clisp.cons.org>
6031 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
6032 * localcharset.c (locale_charset): Declare as extern "C".
6034 2002-02-15 Bruno Haible <bruno@clisp.org>
6036 * config.charset [msdosdjgpp]: For Russian, use CP866.
6038 2002-02-11 Bruno Haible <bruno@clisp.org>
6040 * config.charset: Add support for NetBSD.
6042 2002-09-25 <karl@gnu.org>
6044 * strdup.c: copy from libc/string (via ../config/srclist*).
6045 * getopt*: copy from libc/posix.
6046 * gettext.h: copy from gettext.
6047 * .cppi-disable: add strdup.c, gettext.h.
6049 2002-07-01 Jim Meyering <meyering@lucent.com>
6051 * c-stack.c: Include sys/time.h.
6052 From Volker Borchert.
6054 2002-06-11 Paul Eggert <eggert@twinsun.com>
6056 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6057 New macro. Use it uniformly instead of
6058 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6059 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6060 reported by Vin Shelton.
6062 2002-06-22 Jim Meyering <meyering@lucent.com>
6064 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6065 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6067 2002-06-22 Paul Eggert <eggert@twinsun.com>
6069 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6070 Do not assume SA_SIGINFO behavior.
6071 Bug reported by Jim Meyering on NetBSD 1.5.2.
6073 2002-06-22 Jim Meyering <meyering@lucent.com>
6075 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6077 * exitfail.c, exitfail.h: Likewise.
6078 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6080 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6082 (EXTRA_DIST): Add fnmatch_loop.c.
6083 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6085 * fnmatch_loop.c: New file, from diffutils-2.8.2.
6086 * fnmatch.c: Update from diffutils-2.8.2.
6087 * fnmatch_.h: New file. From diffutils-2.8.2.
6088 * fnmatch.h: Remove file.
6090 2002-06-18 Paul Eggert <eggert@twinsun.com>
6092 * file-type.h: Report an error if neither S_ISREG nor
6093 S_IFREG is defined, instead of using a test specific to glibc
6094 2.2. This should be safe, since POSIX requires S_ISREG and
6095 Unix Version 7 had S_IFREG. We don't need to check for
6096 <sys/types.h> since we don't use any symbols that it defines.
6098 2002-06-15 Jim Meyering <meyering@lucent.com>
6100 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6101 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6102 have been included before this file.
6104 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
6106 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6107 so that each temporary file name is unique and valid in the first
6108 8 characters, for operation under DOS.
6110 2002-06-15 Jim Meyering <meyering@lucent.com>
6112 Work even with DJGPP 2.03, which lacks support for symlinks.
6114 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6116 * lchown.c (S_ISLNK): Likewise.
6118 2002-06-14 Jim Meyering <meyering@lucent.com>
6120 * file-type.h: Use the version from diffutils-2.8.2.
6121 * file-type.c: Likewise.
6123 2002-05-27 Jim Meyering <meyering@lucent.com>
6125 Fix a problem seen only on nonconforming systems whereby ls.c's
6126 use of localtime, and then of gettimeofday would cause trouble:
6127 the localtime call used to initialize rpl_gettimeofday's save
6128 mechanism would clobber ls's current local time information so
6129 that in any long listing the first file would always be listed
6130 with date 1970-01-01. Analysis by Volker Borchert.
6132 * gettimeofday.c (localtime): Undefine.
6133 (rpl_localtime): New function.
6135 2002-05-22 Jim Meyering <meyering@lucent.com>
6137 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6138 * file-type.h: New file.
6139 * file-type.c (file_type): New file/function. Extracted from diffutils.
6141 2002-04-29 Paul Eggert <eggert@twinsun.com>
6143 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6145 2002-04-28 Paul Eggert <eggert@twinsun.com>
6147 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6148 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
6149 of 127, since 64 is the largest conceivable number for ancient
6151 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6153 2002-04-28 Jim Meyering <meyering@lucent.com>
6155 * sig2str.c (WTERMSIG): Remove definition (unused).
6157 2002-04-28 Paul Eggert <eggert@twinsun.com>
6159 * sig2str.h, sig2str.c: New files.
6160 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6162 2002-04-24 Jim Meyering <meyering@lucent.com>
6164 * gettext.h: New file, from Gettext.
6165 * Makefile.am (INCLUDES): Remove -I../intl.
6166 (libfetish_a_SOURCES): Add gettext.h.
6168 2002-04-16 Jim Meyering <meyering@lucent.com>
6170 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6171 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6172 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6174 2002-04-12 Jim Meyering <meyering@lucent.com>
6176 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6178 2002-03-10 Jim Meyering <meyering@lucent.com>
6180 * makepath.c (make_path): Remove a comma from a diagnostic.
6181 Suggestion from Santiago Vila.
6183 2002-03-08 Jim Meyering <meyering@lucent.com>
6185 * rename.c: Mention that this wrapper is needed also on
6186 mips-dec-ultrix4.4 systems.
6188 2002-03-02 Jim Meyering <meyering@lucent.com>
6190 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6191 not HAVE_CLOCK_SETTIME.
6193 2002-02-27 Paul Eggert <eggert@twinsun.com>
6195 * nanosleep.h: Rename to....
6196 * timespec.h: New name for nanosleep.h. All uses changed.
6198 * gettime.c: New file.
6199 * settime.c: New file.
6202 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6203 timespec.h. Remove nanosleep.h.
6205 2002-02-25 Paul Eggert <eggert@twinsun.com>
6207 * acl.c, acl.h: New files.
6208 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6210 2002-02-24 Jim Meyering <meyering@lucent.com>
6212 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6213 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6214 cause trouble. Reported by Nelson Beebe.
6216 2002-02-23 Paul Eggert <eggert@twinsun.com>
6218 * path-concat.c (xpath_concat): Reorder code to pacify
6219 compilers that don't know that xalloc_die never returns.
6221 2002-02-20 Jim Meyering <meyering@lucent.com>
6223 * getdate.c: Regenerate using bison-1.33.
6225 2002-02-15 Paul Eggert <eggert@twinsun.com>
6227 * posixver.c, posixver.h: New files.
6228 * Makefile.am (libfetish_a_SOURCES): Add them.
6230 2002-02-02 Paul Eggert <eggert@twinsun.com>
6231 Bruno Haible <bruno@clisp.org>
6233 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6234 (fwrite_success_callback): New declaration.
6235 * unicodeio.c (unicode_to_mb): New function, extracted from
6236 print_unicode_char. Call failure callback instead of error.
6237 (fwrite_success_callback): New function.
6238 (exit_failure_callback): New function.
6239 (fallback_failure_callback): New function.
6240 (print_unicode_char): Call unicode_to_mb.
6242 2002-01-26 Jim Meyering <meyering@lucent.com>
6244 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6246 2002-01-22 Jim Meyering <meyering@lucent.com>
6248 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6249 Otherwise, some versions of automake would omit the rule that makes
6250 Makefile from Makefile.in.
6252 2001-01-21 Paul Eggert <eggert@twinsun.com>
6254 * xmemcoll.h, xmemcoll.c: New files.
6255 * Makefile.am (libfetish_a_SOURCES): Add them.
6256 * memcoll.c: Include errno.h, and declare errno if not defined.
6257 (memcoll): Set errno to zero if there is no error.
6259 * quotearg.c (quotearg_buffer_restyled):
6260 Fix bug with quoting buffers containing NUL when backslashing escapes.
6261 This bug was exposed by the other changes in this patch.
6262 (quotearg_n_options): New arg ARGSIZE.
6263 All callers changed.
6264 (quoting_options_from_style): New function.
6265 (quotearg_n_style): Use it.
6266 (quotearg_n_style_mem): New function.
6268 * quotearg.h (quotearg_n_style_mem): New function.
6270 2002-01-16 Jim Meyering <meyering@lucent.com>
6272 * getdate.y: Add three semicolons, each just before a closing brace.
6273 Bison (as of version 1.31) no longer papers over that mistake.
6275 2002-02-14 Paul Eggert <eggert@twinsun.com>
6277 * backupfile.c (ISDIGIT): Comment fix.
6278 * getdate.y (ISDIGIT): Likewise.
6279 * posixtm.c (ISDIGIT, year): Likewise.
6280 * strverscmp.c (ISDIGIT): Likewise.
6281 * userspec.c (ISDIGIT): Likewise.
6283 2002-01-05 Jim Meyering <meyering@lucent.com>
6285 * version-etc.c (version_etc_copyright): Update copyright year.
6287 2001-01-19 Paul Eggert <eggert@twinsun.com>
6289 * closeout.c (close_stdout_status): If ferror (stdout), do
6290 not silently exit merely because the output buffer happens to
6291 have nothing pending.
6293 2001-12-18 Paul Eggert <eggert@twinsun.com>
6295 See the big note in ../ChangeLog.
6296 * human.c (suffixes): Prefer K to k for 1024.
6297 (generate_suffix_backwards): New function.
6298 (human_readable_inexact): Use it.
6299 * xstrtol.c (__xstrtol): If there is no number but there
6300 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
6301 Accept 'K' as well as 'k'.
6303 2001-12-15 Jim Meyering <meyering@lucent.com>
6305 * regex.h (__restrict_arr): Update from libc.
6307 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
6308 as `remote' if the name starts with `//'. Suggested by Michael Stone.
6311 2001-12-10 Jim Meyering <meyering@lucent.com>
6313 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
6314 Instead, include "xalloc.h".
6315 (initbuffer): Don't cast xmalloc return value to char*.
6316 (readline): Reword comment.
6317 Don't cast xrealloc return value to char*
6320 2001-12-09 Jim Meyering <meyering@lucent.com>
6322 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
6323 `signed and unsigned type in conditional expression'.
6324 * posixtm.c (posix_time_parse): Likewise.
6326 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
6328 * readtokens.c (readtoken): Declare an index to be of type unsigned
6329 to avoid a pedantic warning.
6331 * getstr.c: Don't include assert.h.
6332 (getstr): Remove warning-evoking assertions.
6333 Return -1 if offset parameter is out of bounds.
6334 Change the type of a local from int to size_t.
6336 * strftime.c (my_strftime_localtime_r): Include this function
6337 definition in the `#if ! HAVE_TM_GMTOFF' block.
6339 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
6340 Include xalloc.h instead.
6342 2001-12-02 Jim Meyering <meyering@lucent.com>
6344 * tempname.c: Don't declare getenv, thus reverting the change of
6345 2001-11-18. It's no longer necessary, now that stdlib.h is always
6348 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
6349 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
6351 2001-11-30 Akim Demaille <akim@epita.fr>
6353 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
6354 before being defined.
6356 2001-11-27 Paul Eggert <eggert@twinsun.com>
6358 * quotearg.h (quotearg_n, quotearg_n_style):
6359 First arg is int, not unsigned.
6360 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
6361 (SIZE_MAX, UINT_MAX): New macros.
6362 (quotearg_n_options): Abort if N is negative.
6363 Avoid overflow check on hosts where size_t is 64 bits and int
6364 is 32 bits, as overflow is impossible there.
6365 Fix off-by-one typo that caused unnecessary reallocation.
6367 2001-11-27 Jim Meyering <meyering@lucent.com>
6369 * tempname.c: Merge with version from libc.
6370 * regex.c: Likewise.
6372 * tempname.c: Include stdlib.h unconditionally. On some old systems
6373 for which STDC_HEADERS is 0, it was not included, resulting in a
6374 warning about an integer-to-pointer conversion problem with getenv.
6375 Reported by Volker Borchert.
6377 2001-11-26 Jim Meyering <meyering@lucent.com>
6379 * gtod.h: Remove file.
6380 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
6381 * gettimeofday.c: Don't include gtod.h.
6382 (GTOD_init): Remove function.
6383 (rpl_gettimeofday): Do its job here instead, rather than aborting.
6384 Suggestion from Volker Borchert.
6386 2001-11-23 Jim Meyering <meyering@lucent.com>
6388 * hash.h (struct hash_table): Don't define here. Merely declare it.
6389 * hash.c (struct hash_table): Define it here instead.
6391 2001-11-22 Jim Meyering <meyering@lucent.com>
6393 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
6395 2001-11-18 Paul Eggert <eggert@twinsun.com>
6397 * tempname.c (TMP_MAX): Remove; no longer needed.
6398 (TEMPORARIES): New macro.
6399 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
6400 removes an artificial limitation (e.g. HP-UX 10.20, where
6403 2001-11-18 Jim Meyering <meyering@lucent.com>
6405 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
6408 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
6409 files will be created before anything else.
6411 2001-11-17 Jim Meyering <meyering@lucent.com>
6413 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
6414 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
6415 rather than group writable. Patch by Juan F. Codagnone.
6417 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
6418 Instead, include "xalloc.h".
6420 * mountlist.c: Include unlocked-io.h after all system headers.
6421 Remove explicit declarations of xmalloc, xrealloc,
6422 and xstrdup. Instead, include "xalloc.h".
6424 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
6425 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
6426 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
6428 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
6429 Reported by Padraig Brady.
6431 * mkstemp.c: #undef mkstemp.
6433 (rpl_mkstemp): Rename from mkstemp.
6436 2001-11-16 Jim Meyering <meyering@lucent.com>
6438 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
6439 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
6440 determine the amount of total physical memory, use pstat_getstatic.
6441 HPUX-11 doesn't define _SC_PHYS_PAGES.
6442 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
6443 If sysconf couldn't be used to determine the amount of available
6444 physical memory, use both pstat_getstatic and pstat_getdynamic.
6445 Based on a patch from Bob Proulx.
6447 2001-11-05 Jim Meyering <meyering@lucent.com>
6449 * xstat.in (slash_aware_lstat): Correct a misleading comment.
6451 2001-11-03 Jim Meyering <meyering@lucent.com>
6453 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
6454 in argmatch_to_argument call.
6456 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
6459 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
6460 e.g., a fault due to an attempt to free a NULL pointer.
6462 2001-11-01 Jim Meyering <meyering@lucent.com>
6464 * dirfd.c, dirfd.h: New files.
6465 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
6467 * hash.c (hash_print) [TESTING]: Clean up.
6469 2001-10-22 Paul Eggert <eggert@twinsun.com>
6471 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
6472 to avoid a warning if -Wall.
6474 2001-10-21 Paul Eggert <eggert@twinsun.com>
6476 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
6478 2001-10-21 Jim Meyering <meyering@lucent.com>
6480 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
6481 this code would end up calling gettext even in packages built
6483 * getopt.c (_): Likewise.
6484 * regex.c (_): Likewise.
6486 2001-10-20 Paul Eggert <eggert@twinsun.com>
6488 * error.c (strerror_r): Do not declare unless !_LIBC.
6489 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
6490 Use strerror_r that is only a macro, even if it is not a function.
6491 (strerror): Check for HAVE_DECL_STRERROR before declaring.
6492 (private_strerror): Use prototypes, not old-style function definition.
6493 (print_errno_message): New function.
6494 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
6496 (error_tail, error, error_at_line): Use it.
6498 2001-10-11 Jim Meyering <meyering@lucent.com>
6500 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
6501 and quote_n (1, ... to avoid clobbering a buffer.
6503 2001-10-05 Jim Meyering <meyering@lucent.com>
6505 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
6506 * hash-pjw.c: New file (factored out of fileutils' remove.c).
6507 * hash-pjw.h: New file.
6509 2001-09-30 Jim Meyering <meyering@lucent.com>
6511 * mountlist.c [MOUNTED_GETFSSTAT]:
6512 Include <sys/ucred.h>, for Apple Darwin.
6513 Include sys/mount.h and sys/fs_types.h only if available.
6515 (read_filesystem_list): Use FS_TYPE.
6517 2001-09-29 Paul Eggert <eggert@twinsun.com>
6519 * exclude.c (excluded_filename): 0 -> false, since it's
6522 2001-09-28 Paul Eggert <eggert@twinsun.com>
6524 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
6525 #defines strtoimax. Also treat the other strto* functions
6528 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
6529 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
6530 (strtoimax, strtoumax): Do not declare if already defined as a macro.
6532 2001-09-26 Jim Meyering <meyering@lucent.com>
6534 Most macros in unlocked-io.h had the wrong number of arguments.
6535 * gen-uio: New script.
6536 (USE_UNLOCKED_IO): Define to 1 if not already defined.
6537 * unlocked-io.hin: Remove file.
6538 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
6539 rather than trying to embed it here.
6540 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
6541 Reported by Padraig Brady.
6543 2001-09-25 Volker Borchert <bt@teknon.de>
6545 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
6547 2001-09-23 Jim Meyering <meyering@lucent.com>
6549 * mountlist.c: Remove useless parentheses in #if directives.
6550 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
6551 the deprecated MOUNTED symbol is no longer defined in mntent.h.
6553 2001-09-22 Jim Meyering <meyering@lucent.com>
6555 * localcharset.c: Update from latest gettext.
6556 * config.charset: Likewise.
6558 2001-09-20 Jim Meyering <meyering@lucent.com>
6560 * xstrtol.c (strtoimax): Guard declaration with
6561 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
6562 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
6563 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
6564 (strtoumax): Likewise, for completeness (it wasn't necessary).
6566 2001-09-06 Paul Eggert <eggert@twinsun.com>
6568 * strtoimax.c (HAVE_LONG_LONG):
6569 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
6570 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
6571 to work around bug in IBM C compiler.
6573 2001-09-16 Jim Meyering <meyering@lucent.com>
6575 * mkdir.c: New file.
6577 2001-09-04 Paul Eggert <eggert@twinsun.com>
6579 * xgetcwd.c: Revert some of the previous change; intead,
6580 fix the HAVE_GETCWD_NULL code to behave more like the
6581 !HAVE_GETCWD_NULL code used to.
6584 (xgetcwd): Do not return NULL when memory is exhausted; instead,
6587 2001-09-04 Paul Eggert <eggert@twinsun.com>
6589 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
6590 Use ssize_t, not int, to store result of readlink.
6591 Check for ssize_t overflow as well as size_t overflow,
6592 as POSIX says the result of readlink is implementation-defined
6593 when ssize_t overflows.
6594 Remove unnecessary cast to char*.
6595 Use free+malloc instead of realloc, as the storage doesn't need
6596 to be preserved and it's clearer and can be more efficient that way.
6597 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
6598 * xreadlink.h (xreadlink): Update prototype.
6600 2001-09-03 Paul Eggert <eggert@twinsun.com>
6602 * exclude.c (fnmatch_no_wildcards): Fix confusion between
6603 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
6604 spotted by Jim Meyering.
6606 2001-09-03 Jim Meyering <meyering@lucent.com>
6608 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
6610 2001-09-03 Paul Eggert <eggert@twinsun.com>
6612 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
6613 like the HAVE_GETCWD_NULL code.
6614 Include pathmax.h if not HAVE_GETCWD.
6615 Do not include xalloc.h.
6616 (INITIAL_BUFFER_SIZE): New symbol.
6617 Do not use xmalloc / xrealloc, since the caller is responsible for
6618 handling errors. Preserve errno around `free' during failure.
6619 Do not overrun buffer when using getwd.
6621 2001-09-03 Paul Eggert <eggert@twinsun.com>
6623 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
6624 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
6626 2001-09-02 Jim Meyering <meyering@lucent.com>
6628 * error.c: Update from GNU libc.
6630 2001-09-01 Jim Meyering <meyering@lucent.com>
6632 * xreadlink.c: New file.
6633 * xreadlink.h: New file.
6634 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
6636 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
6637 doesn't conflict with sparc Solaris 7's definition in
6638 /usr/include/sys/int_types.h.
6640 * exclude.c: Use `""', not `<>' to #include non-system header files.
6641 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
6642 and strncasecmp as r-values. Unixware didn't have declarations.
6644 2001-08-31 Jim Meyering <meyering@lucent.com>
6646 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
6647 Use an initial, malloc'd, buffer of length 128 rather than
6648 a statically allocated one of length 1024.
6650 2001-08-30 Paul Eggert <eggert@twinsun.com>
6652 * xgetcwd.c: Don't include pathmax.h.
6653 Include stdlib.h and unistd.h if available.
6655 (xmalloc, xstrdup, free): Remove decls.
6656 (xgetcwd): Don't assume sizes fit in unsigned.
6657 Check for overflow when computing sizes.
6658 Simplify reallocation code.
6660 2001-08-28 Paul Eggert <eggert@twinsun.com>
6662 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
6664 * strtoimax.c: Renamed from strtoxmax.c, removing the
6667 Also, make the following further changes to make this file's
6668 configuration more similar to that of strtol.c:
6669 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
6670 (strtoumax, uintmax_t, strtoull, strtol): Remove.
6671 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
6672 (strtoimax): Renamed from strtoumax. All uses of unsigned values
6673 changed to signed values.
6675 And make the following changes as well:
6676 Fix copyright notice, as 1999 was missing.
6677 (verify): New macro.
6678 (strtoimax): Check sizes at compile-time, not run-time.
6679 Prefer strtol to strtoll if both work.
6680 (main): Remove; it was not that useful and was a pain to maintain.
6682 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
6684 2001-08-30 Paul Eggert <eggert@twinsun.com>
6686 * savedir.c (savedir): Remove size parameter, as POSIX says that
6687 a directory's st_size can have an arbitrary value, so the old
6688 usage could waste an arbitrary amount of memory. All uses
6690 * savedir.h: Update prototype.
6692 2001-08-30 Paul Eggert <eggert@twinsun.com>
6694 * xstrtol.c (strtoimax): New decl.
6696 2001-08-28 Paul Eggert <eggert@twinsun.com>
6698 * xstrtol.h: Add copyright notice.
6699 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
6700 LONGINT_INVALID_SUFFIX_CHAR.
6702 2001-08-30 Paul Eggert <eggert@twinsun.com>
6704 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
6707 2001-08-30 Paul Eggert <eggert@twinsun.com>
6709 * hash.c: Remove '2001' from copyright notice.
6711 2001-08-30 Paul Eggert <eggert@twinsun.com>
6713 * full-write.h: New file.
6714 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
6715 * full-write.c: Correct credits, as cccp.c no longer
6716 exists and anyway it was so heavily changed from the old cccp
6717 code as to be unrecognizable. Include full-write.h.
6718 (full_write) Return size_t, with short writes meaning failure.
6719 All callers changed. This fixes a bug with large buffers
6721 * utime.c: Include full-write.h.
6723 2001-08-30 Paul Eggert <eggert@twinsun.com>
6725 Merge 'exclude' changes from tar 1.13.22.
6726 This fixes one or two unlikely storage allocation overflow bugs,
6727 but doesn't change user-visible behavior otherwise.
6729 2001-08-30 Paul Eggert <eggert@twinsun.com>
6731 * exclude.c (bool): Declare, perhaps by including stdbool.h.
6732 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
6733 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
6734 Include if available.
6735 (<xalloc.h>): Include
6736 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
6737 (verify): New macro. Use it to verify that EXCLUDE macros do not
6738 collide with FNM macros.
6739 (struct patopts): New struct.
6740 (struct exclude): Use it, as exclude patterns now come with options.
6741 (new_exclude): Support above changes.
6742 (new_exclude, add_exclude_file):
6743 Initial size must now be a power of two to simplify overflow checking.
6744 (free_exclude, fnmatch_no_wildcards): New function.
6745 (excluded_filename): No longer requires options arg, as the options
6746 are determined by add_exclude. Now returns bool, not int.
6747 (excluded_filename, add_exclude):
6748 Add support for the fancy new exclusion options.
6749 (add_exclude, add_exclude_file): Now takes int options arg.
6750 Check for arithmetic overflow when computing sizes.
6751 (add_exclude_file): xrealloc might modify errno, so don't
6752 realloc until after errno might be used.
6754 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
6756 (free_exclude): New decl.
6757 (add_exclude, add_exclude_file): Now takes int options arg.
6758 (excluded_filename): No longer requires options arg, as the options
6759 are determined by add_exclude. Now returns bool, not int.
6761 2001-08-30 Paul Eggert <eggert@twinsun.com>
6763 * alloca.c (alloca): Arg is of type size_t, not unsigned.
6765 2001-08-27 Jim Meyering <meyering@lucent.com>
6767 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
6769 * version-etc.c (N_): Remove definition.
6770 Revert most of last change.
6771 Instead, simply don't mark the `Copyright...' string for translation.
6772 Based on advice from Paul Eggert.
6774 * strtoxmax.c: Tweak comment.
6776 2001-08-26 Jim Meyering <meyering@lucent.com>
6778 * version-etc.c (version_etc_copyright_fmt): Replace literal year
6779 of copyright with `%s' so translators don't get an untranslated
6781 (COPYRIGHT_YEAR): Define.
6782 (version_etc): Use fprintf rather than fputs.
6783 Suggestion from Ulrich Drepper.
6785 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
6787 * strtoll.c: New file, from GNU libc.
6788 * xstrtoimax.c: New file.
6790 * xstrtol.h: Add xstrtoimax.
6791 * strtoumax.c: New file. Simply include "strtoumax.c".
6792 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
6794 * strtoumax.c: Factor to work both for unsigned and signed types, ...
6795 * strtoxmax.c: ... then renamed to this.
6797 2001-08-13 Paul Eggert <eggert@twinsun.com>
6799 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
6800 Port to Solaris 8, where 'sed' requires a space after the 'r'
6801 command, and where sh dislikes "$/". Clean up the spacing a bit.
6802 Redirect output to $tmp just once.
6804 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
6806 * addext.c (<errno.h>): Include.
6807 (errno): Declare if not defined.
6808 (addext): Work correctly when pathconf returns -1 and leaves
6809 errno alone because there is no limit. Also, work even if
6810 pathconf returns a value greater than SIZE_MAX.
6812 2001-08-12 Jim Meyering <meyering@lucent.com>
6814 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
6815 Simply `return getcwd (NULL, 0);'.
6816 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
6817 Use 1300 as initial value for length, not PATH_MAX.
6819 * pathmax.h: Clean up cpp syntax.
6821 2001-08-12 Jim Meyering <meyering@lucent.com>
6823 * gettimeofday.c: New file.
6825 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
6827 2001-08-04 Jim Meyering <meyering@lucent.com>
6829 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
6830 to get in sync with glibc.
6832 2001-08-03 Paul Eggert <eggert@twinsun.com>
6834 The following changes are from gettext 0.10.39 as maintained by
6837 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
6838 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
6839 with inverted sense. All uses changed.
6841 * mbswidth.c: Don't include <limits.h>.
6842 Include <stdlib.h> and <string.h> unconditionally.
6843 (iswcntrl, mbsinit, ISCNTRL): New macros.
6844 (mbsnwidth): Use K&R style function declarations.
6845 Don't bother checking for MB_LEN_MAX == 1, since the compiler
6846 can optimize it when MB_CUR_MAX == 1.
6847 The width of control characters is zero, not 1.
6849 2001-07-15 Jim Meyering <meyering@lucent.com>
6851 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
6852 (BUILT_SOURCES): Add unlocked-io.h.
6853 (io_functions): Define.
6854 (unlocked-io.h): New rule.
6855 (DISTCLEANFILES): Add unlocked-io.h.
6856 (all-local): Depend on unlocked-io.h, to ensure it is created.
6858 * unlocked-io.hin: New file
6860 * regex.c: Update from glibc.
6862 2001-07-05 Jim Meyering <meyering@lucent.com>
6864 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
6866 (libfetish_a_SOURCES): Put all .h files here instead.
6867 Remove a thus-exposed (better checks in automake) duplicate and
6868 two unnecessary .h files.
6870 2001-06-11 Jim Meyering <meyering@lucent.com>
6872 * regex.c: Update from GNU libc.
6874 2001-05-27 Jim Meyering <meyering@lucent.com>
6876 * readutmp.h (UT_TYPE): Define.
6878 2001-05-24 Jim Meyering <meyering@lucent.com>
6880 * argmatch.c: Include "quote.h".
6881 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
6882 quote function. Reported by Göran Uddeborg.
6884 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
6886 * dirname.c (dir_name): Compute append_dot using path, not newpath
6887 which is not yet declared.
6889 2001-05-11 Paul Eggert <eggert@twinsun.com>
6891 * Makefile.am (libfetish_a_SOURCES):
6892 Add strftime.c, since we now compile it on all hosts.
6894 * strftime.c (my_strftime):
6895 Define to nstrftime if emacs, but only if my_strftime is not defined.
6896 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
6897 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
6898 Add one more extra argument: a nanoseconds value.
6901 (my_strftime function): Add %N format.
6902 (emacs_strftimeu): Renamed from emacs_strftime,
6903 with extra ut argument.
6905 2001-05-11 Paul Eggert <eggert@twinsun.com>
6907 dirname code cleanup. base_name now behaves more compatibly
6908 with POSIX basename when given file names that have trailing
6909 slashes, and similarly for dir_name. Add new primitives
6910 base_len and dir_len. Put the directory-name-related decls
6913 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
6914 * backupfile.c (base_name): Likewise.
6915 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
6916 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
6917 * makepath.c (strip_trailing_slashes): Likewise.
6918 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
6920 * rename.c (strip_trailing_slashes): Likewise.
6921 * same.c (base_name): Likewise.
6922 * stripslash.c (ISSLASH): Likewise.
6924 * addext.c: Include <dirname.h> after size_t is defined.
6925 * backupfile.c: Likewise.
6927 * addext.c (addext): Use base_len to trim redundant
6928 trailing slashes instead of doing it ourselves.
6929 But do not trim the last slash if it is not redundant.
6931 * backupfile.c (find_backup_file_name,
6932 max_backup_version): Use base_len instead of rolling it ourselves.
6933 Handle the case of "" and (on DOS) "C:" correctly.
6935 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
6936 Include <string.h>, <dirname.h>.
6937 (base_name): Allow file names ending in slashes, other than names
6938 that are all slashes. In this case, return the basename followed
6939 by the slashes. This is more general, and can be used in places
6940 where the original base_name purposely had an assertion failure.
6941 (base_len): New function.
6943 * dirname.c: Include <string.h> instead of <stdlib.h>.
6944 Do not include <assert.h>; no longer needed.
6946 (memrchr): Remove decl.
6947 (dir_name_r): Remove.
6948 (dir_len): Renamed from dirlen. All callers changed.
6949 Rewrite in terms of base_name, for simplicity and consistency.
6950 (dir_name): Never return NULL. All callers changed.
6951 Do not include <stdlib.h> in test program; no longer needed.
6952 return 0; is fine for test program.
6954 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
6956 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
6958 * path-concat.c (path_concat): Use base_len to compute
6959 base length, not strlen; this means we cannot rely on memcpy
6962 * same.c (STREQ): Remove.
6963 (same_name): Handle the case where the basename ends in trailing '/'.
6965 * stripslash.c (strip_trailing_slashes): Return nonzero if
6966 a slash was stripped. Do not strip the last slash after a
6969 2001-04-08 Jim Meyering <meyering@lucent.com>
6971 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
6972 recomputed; that's necessary when the offset spans a DST transition.
6973 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
6975 2001-04-02 Jim Meyering <meyering@lucent.com>
6977 * regex.h, regex.c: Update from GNU libc.
6979 2001-03-19 Paul Eggert <eggert@twinsun.com>
6981 * version-etc.c (version_etc_copyright): Update to 2001.
6983 2001-03-16 Paul Eggert <eggert@twinsun.com>
6985 * tempname.c (uint64_t): Define to uintmax_t if
6986 not defined, and if UINT64_MAX is not defined.
6987 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
6988 Reported by John David Anglin.
6990 2001-03-10 Bruno Haible <haible@clisp.cons.org>
6992 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
6993 alias if codeset is empty.
6994 * config.charset (BeOS): Use wildcard syntax.
6996 2001-03-13 Jim Meyering <meyering@lucent.com>
6998 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
6999 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
7002 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7004 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
7006 * unicodeio.c (print_unicode_char): Simplify accordingly.
7008 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7010 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
7011 support for DOS/DJGPP.
7013 2001-02-28 Paul Eggert <eggert@twinsun.com>
7015 * Makefile.am (libfetish_a_SOURCES):
7016 Add dup-safer.c, fopen-safer.c.
7017 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
7019 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
7021 2001-02-25 Paul Eggert <eggert@twinsun.com>
7023 The mkstemp replacement is taken from glibc 2.2.2, with some
7024 portability fixes for use outside glibc, as follows:
7026 * tempname.c (struct_stat64): New macro.
7027 (direxists, __gen_tempname): Use it.
7028 This avoids a portability problem with Solaris 8.
7030 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7031 (<stddef.h>, <stdint.h>, <string.h>):
7032 Include only if STDC_HEADERS || _LIBC.
7033 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7034 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7035 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7036 (__set_errno): Define this macro if <errno.h> doesn't.
7037 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7038 Define these macros if <stdio.h> doesn't.
7039 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7040 Define these macros if <sys/stat.h>
7041 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7042 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7043 __xstat64): Define if not _LIBC.
7044 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7045 (__gen_tempname): Invoke gettimeofday only if
7046 HAVE_GETTIMEOFDAY || _LIBC;
7047 otherwise, fall back on plain "time".
7048 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7050 * mkstemp.c (__GT_FILE): Define to zero if not defined.
7052 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7054 2001-02-17 Jim Meyering <meyering@lucent.com>
7056 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
7057 around included file name.
7059 * strnlen.c (__strnlen): Merge in a change from GNU libc.
7061 * strftime.c: Update from GNU libc (the only changes were to comments).
7063 2001-02-13 Bruno Haible <haible@clisp.cons.org>
7065 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7067 2001-02-17 Paul Eggert <eggert@twinsun.com>
7069 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7070 Remove workaround macros for hosts that have mbrtowc but not
7071 mbstate_t, as we now insist on proper declarations for both
7072 before using mbrtowc.
7074 2001-02-17 Jim Meyering <meyering@lucent.com>
7076 * regex.c: Update from libc.
7078 2001-02-16 Paul Eggert <eggert@twinsun.com>
7080 * alloca.c (malloc): Undef before defining, since stdlib.h
7081 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
7082 Reported by Mark Hounschell via Paul Eggert.
7084 2001-01-30 Bruno Haible <haible@clisp.cons.org>
7086 * config.charset: Update for FreeBSD 4.2.
7088 2001-01-26 Jim Meyering <meyering@lucent.com>
7090 * quotearg.c: Include stddef.h.
7091 * quote.c: Include stddef.h.
7092 Reported by Axel Kittenberger.
7094 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7095 line in double quotes so that it evokes a better diagnostic.
7096 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7097 Reported by Axel Kittenberger.
7099 2001-01-15 Bruno Haible <haible@clisp.cons.org>
7101 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7102 to avoid a warning. Add back 'const' to inptr.
7104 2001-01-16 Jim Meyering <meyering@lucent.com>
7106 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7109 2001-01-14 Jim Meyering <meyering@lucent.com>
7111 * rename.c: New file. From Volker Borchert.
7112 Include stdlib.h, string.h or strings.h, and xalloc.h.
7113 Use strip_trailing_slashes rather than open-coding it.
7115 2001-01-03 Paul Eggert <eggert@twinsun.com>
7117 * strftime.c: Sync with glibc time/strftime.c 1.81.
7119 2001-01-03 Jim Meyering <meyering@lucent.com>
7121 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7122 local `inptr' to avoid warning with some system declarations of iconv.
7124 2000-12-29 Paul Eggert <eggert@twinsun.com>
7126 * modechange.c: Do not assume that mode_t uses the
7127 traditional octal encoding. E.g. "chmod 1 FOO" should set
7128 the other-execute bit of FOO even if S_IXOTH != 1.
7130 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7131 WOTH, XOTH, ALLM): New macros.
7132 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7133 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7135 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7136 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7138 No need to use uintmax_t; unsigned long is long enough.
7139 Don't bother to get suffix since we don't use it.
7141 2000-12-24 Jim Meyering <meyering@lucent.com>
7143 * hash.c (is_prime): Return explicit boolean values.
7144 (hash_get_first): Return NULL to appease Irix5.6's 89.
7145 Reported by Nelson Beebe.
7147 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7149 * localcharset.c (locale_charset): Add support for Win32.
7151 2000-12-18 Paul Eggert <eggert@twinsun.com>
7153 * physmem.h, physmem.c: New files.
7155 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7156 (noinst_HEADERS): Add physmem.h.
7158 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7159 't' for compatibility with Solaris 8 sort.
7161 2000-12-18 Bruno Haible <haible@clisp.cons.org>
7163 * config.charset: Add support for BeOS.
7165 2000-12-16 Jim Meyering <meyering@lucent.com>
7167 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7168 SHELLS_FILE to a file name that's useful on djgpp systems.
7170 (ADDITIONAL_DEFAULT_SHELLS): Define.
7171 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7172 Based mostly on a patch from Prashant TR.
7174 2000-12-16 Jim Meyering <meyering@lucent.com>
7176 This bug had a serious impact on chown: `chown N:M FILE' (for integer
7177 N and M) would have treated it like `chown N:N FILE'.
7179 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7181 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7183 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7184 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7185 to the list of canonical encodings. Rename EUC-CN to GB2312.
7187 2000-12-08 Andreas Schwab <schwab@suse.de>
7189 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7190 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7192 2000-12-07 Jim Meyering <meyering@lucent.com>
7194 * stripslash.c (ISSLASH): Define.
7195 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7198 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7199 (dir_name_r): Declare this function as static.
7200 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7201 manifest itself on a name containing a mix of slashes and
7203 Make this function work with names starting with a DOS-style
7204 drive letter and colon prefix.
7205 (dir_name): Append `.' if necessary.
7206 Based mostly on patches from Prashant TR and Eli Zaretskii.
7208 * dirname.h (dir_name_r): Remove prototype.
7210 2000-12-05 Jim Meyering <meyering@lucent.com>
7212 * dirname.c (dir_name_r): Add `const' in a few local declarations.
7214 2000-12-04 Jim Meyering <meyering@lucent.com>
7216 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7217 Also include memory.h, stdlib.h, unistd.h if appropriate.
7218 Reported by Andreas Jaeger (conflicting declaration of malloc).
7220 2000-12-02 Jim Meyering <meyering@lucent.com>
7222 * closeout.h: Make idempotent, to avoid some obscure warnings.
7224 2000-12-01 Paul Eggert <eggert@twinsun.com>
7226 * memrchr.c: Include <config.h> before any system include file.
7228 2000-11-29 Paul Eggert <eggert@twinsun.com>
7230 * dirname.c (dir_name_r): Fix typo: int -> size_t.
7232 2000-11-26 Jim Meyering <meyering@lucent.com>
7234 * memcoll.c: Include sys/types.h. From Werner Almesberger.
7236 2000-11-22 Paul Eggert <eggert@twinsun.com>
7238 * strftime.c (my_strftime): Do not invoke mbrlen with a
7239 size of (size_t) -1; it's not portable.
7241 2000-11-17 Akim Demaille <akim@epita.fr>
7243 * obstack.h: Formatting changes.
7244 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7245 prevent type checking.
7246 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7247 cast the value to (void *): assigning a `foo *' to a `void *'
7249 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7251 2000-11-17 Jim Meyering <meyering@lucent.com>
7253 * strstr.c: Update from GNU libc.
7255 2000-11-16 Jim Meyering <meyering@lucent.com>
7257 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7259 2000-11-11 Jim Meyering <meyering@lucent.com>
7261 * error.c: Add a couple #includes, merging from GNU libc version.
7263 2000-11-10 Jim Meyering <meyering@lucent.com>
7265 * obstack.h: Update from GNU libc.
7266 * obstack.c: Likewise.
7268 2000-11-06 Paul Eggert <eggert@twinsun.com>
7270 * getusershell.c (setusershell): Use rewind rather than
7271 fseek/fseeko, to avoid configuration hassles with fseeko.
7272 Don't bother opening SHELLS_FILE if shellstream is NULL;
7275 2000-11-05 Jim Meyering <meyering@lucent.com>
7277 * makepath.h (make_dir): Declare.
7278 * makepath.c (make_dir): Remove `static' attribute.
7281 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
7283 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
7284 last one in a bucket, advance to the next bucket.
7286 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
7288 * fnmatch.c: Do not comment out all the code if we are using
7289 the GNU C library, because in some cases we are replacing buggy
7290 code in the GNU C library itself.
7292 2000-10-30 Paul Eggert <eggert@twinsun.com>
7294 * error.h, getline.h, modechange.h:
7295 Remove "2000" from Copyright line, as the file hasn't been
7296 changed this year other than in the copyright notice.
7298 * xalloc.h: Add "2000" to Copyright line, as this file
7299 was changed this year.
7301 2000-10-30 Paul Eggert <eggert@twinsun.com>
7303 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
7304 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
7305 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
7307 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
7309 * regex.h (__restrict_arr): Move definition out of #ifndef block.
7310 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
7311 doesn't define __restrict_arr.
7313 2000-10-29 Jim Meyering <meyering@lucent.com>
7315 * xstat.in: Fix grammar in comment.
7317 2000-10-28 Jim Meyering <meyering@lucent.com>
7319 * memchr.c: Update from libc.
7320 Adjust for portability:
7321 [HAVE_STDLIB_H]: Include stdlib.h.
7322 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
7323 Undef __memchr, too.
7324 [!weak_alias]: Define __memchr to memchr.
7326 * regex.c: Update from libc.
7327 * regex.h: Likewise.
7328 * getopt1.c: Likewise.
7329 * memcmp.c: Likewise.
7331 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
7332 Avoid using fseek, when possible -- it's broken by design.
7333 Patch by Ulrich Drepper.
7335 2000-10-26 Jim Meyering <meyering@lucent.com>
7337 * strftime.c: Update from libc.
7339 2000-10-25 Jim Meyering <meyering@lucent.com>
7341 * obstack.c: Update from libc.
7343 2000-10-23 Jim Meyering <meyering@lucent.com>
7345 * hard-locale.c (hard_locale): Revert last change -- it was simply
7346 wrong. That set_locale call must not have any side effects.
7349 2000-10-22 Jim Meyering <meyering@lucent.com>
7351 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
7352 [CYCLIC]: Remove now-unused definition.
7354 * save-cwd.c (O_DIRECTORY): Define, if needed.
7355 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
7356 Suggestion from Ulrich Drepper.
7358 2000-10-21 Jim Meyering <meyering@lucent.com>
7360 * dirname.c (dir_name_r): New function, factored out of dir_name.
7361 (dir_name): Use dir_name_r.
7362 * dirname.h (dir_name_r): Declare it.
7364 2000-10-21 Jim Meyering <meyering@lucent.com>
7366 * dirname.c (memrchr): Declare if necessary.
7367 (dir_name): Remove the restriction that there be no
7368 trailing slashes. Now, this code skips past them, effectively
7370 [TEST_DIRNAME] (main): New unit tests.
7372 * memrchr.c: New file from GNU libc.
7373 Undef __memrchr, too.
7374 [!weak_alias]: Define __memrchr to memrchr.
7375 Guard weak_alias use with `#ifdef weak_alias'.
7377 2000-10-17 Jim Meyering <meyering@lucent.com>
7379 * quote.h (PARAMS): Define and use.
7380 Reported by Akim Demaille.
7382 * getopt.c: Update from libc.
7384 2000-10-16 Jim Meyering <meyering@lucent.com>
7386 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
7389 2000-09-25 Jim Meyering <meyering@lucent.com>
7391 * md5.h (rol): Define (from GnuPG).
7393 * sha.c: Give credit (GnuPG) where due.
7394 (M): Use rol rather than open-coding it.
7395 Add a FIXME comment.
7397 2000-09-21 Jim Meyering <meyering@lucent.com>
7399 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
7400 Reported by Michael Stone.
7402 2000-09-20 Jim Meyering <meyering@lucent.com>
7404 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
7405 (noinst_HEADERS): Add sha.h.
7406 Based on code from Scott G. Miller and from GnuPG.
7408 2000-09-15 Jim Meyering <meyering@lucent.com>
7410 * regex.c: Update from libc.
7412 2000-09-10 Jim Meyering <meyering@lucent.com>
7414 * getopt.c (_getopt_internal): Update from glibc.
7416 2000-09-09 Jim Meyering <meyering@lucent.com>
7418 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
7419 think it should be used as a general replacement for isascii.
7420 * fnmatch.c: Likewise.
7421 * mbswidth.c: Likewise
7422 * regex.c: Likewise.
7425 * userspec.c: Include sys/param.h and limits.h.
7427 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7428 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
7429 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
7430 UID, GID. Check range.
7432 2000-09-06 Jim Meyering <meyering@lucent.com>
7434 * getopt.c (_getopt_internal): Update from glibc.
7436 2000-08-30 Jim Meyering <meyering@lucent.com>
7438 * strftime.c: Merge in changes from GNU libc.
7440 2000-08-26 Jim Meyering <meyering@lucent.com>
7442 * closeout.c: Include "__fpending.h".
7443 (close_stdout_status): Return right away if there's nothing to flush.
7445 * Makefile.am (noinst_HEADERS): Add __fpending.h.
7446 * __fpending.c: New file.
7447 * __fpending.h: New file.
7449 2000-08-07 Paul Eggert <eggert@twinsun.com>
7451 Standardize on "memory exhausted" instead of "Memory exhausted"
7452 or "virtual memory exhausted".
7453 * obstack.c (print_and_abort): Use "memory exhausted", not
7454 "virtual memory exhausted".
7455 * same.c (same_name): Invoke xalloc_die instead of printing
7457 * userspec.c (parse_user_spec): Likewise.
7458 * bumpalloc.h: comment fix
7459 * same.c, userspec.c: Include xalloc.h.
7461 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
7462 not char *const and pointing to a constant array.
7463 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
7464 (xrealloc): Comment fix.
7466 * userspec.c (parse_user_spec):
7467 Don't translate a message until just before returning,
7468 to avoid unnecessary translation.
7470 2000-08-07 Jim Meyering <meyering@lucent.com>
7472 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
7473 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
7474 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
7475 getgroups.c, gethostname.c, getopt.h, group-member.c,
7476 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
7477 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
7478 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
7479 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
7480 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
7481 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
7482 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
7483 yesno.c: Back out Copyright date changes for each file with no change
7484 this year. This eases coordination with other programs using the same
7485 source code modules. From Paul Eggert.
7487 2000-08-03 Greg McGary <greg@mcgary.org>
7489 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
7490 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
7491 (EXTEND_BUFFER): Use them.
7493 2000-08-01 Jim Meyering <meyering@lucent.com>
7495 * dirname.c (ISSLASH): Define.
7496 (BACKSLASH_IS_PATH_SEPARATOR): Define.
7497 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
7498 both `\' and `/' may be use as path separators.
7499 Based on a patch from Prashant TR.
7501 2000-07-31 Paul Eggert <eggert@twinsun.com>
7503 * quotearg.c (quotearg_n_options): Don't make the initial
7504 slot vector a constant, since it might get modified.
7506 2000-07-31 Jim Meyering <meyering@lucent.com>
7508 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
7509 * obstack.c (print_and_abort): Likewise.
7511 2000-07-30 Paul Eggert <eggert@twinsun.com>
7513 * quotearg.c (quotearg_n_options): Preallocate a slot 0
7514 buffer, so that the caller can always quote one small
7515 component of a "memory exhausted" message in slot 0.
7516 From a suggestion by Jim Meyering.
7518 2000-07-30 Jim Meyering <meyering@lucent.com>
7520 * makepath.c (make_path): Quote the other instance, too.
7522 * quotearg.c (N_STATIC_SLOTVECS): Define.
7523 (STATIC_BUF_SIZE): Define.
7524 (quotearg_n_options): Use only statically allocated storage when
7525 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
7526 than STATIC_BUF_SIZE.
7528 2000-07-29 Jim Meyering <meyering@lucent.com>
7530 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
7531 * dirname.c (dir_name): Likewise.
7533 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
7535 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
7536 (dir_name): Assert that there are no trailing slashes.
7538 2000-07-18 Bruno Haible <haible@clisp.cons.org>
7540 * mbswidth.h (mbswidth): Add a flags argument.
7541 (mbswidth): New declaration.
7542 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
7543 * mbswidth.c (mbswidth): Add a flags argument.
7544 (mbsnwidth): New function.
7546 2000-07-24 Jim Meyering <meyering@lucent.com>
7548 * mbswidth.c: Remove useless #else. From Bruno Haible.
7550 2000-07-23 Paul Eggert <eggert@twinsun.com>
7552 * mbswidth.c (_XOPEN_SOURCE):
7553 Don't define; this causes problems on Solaris 7.
7554 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
7556 2000-07-23 Paul Eggert <eggert@twinsun.com>
7559 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
7560 so that mbstate_t is always defined.
7562 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
7563 be 1 in at least one GCC installation, and this configuration
7564 error is likely to be common. Ignoring MB_LEN_MAX hurts
7565 performance on hosts that have mbrtowc but have only unibyte
7566 locales, but I assume these hosts are rare.
7568 2000-07-23 Paul Eggert <eggert@twinsun.com>
7570 * quotearg.c: Streamline by invoking multibyte code only if needed.
7571 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
7572 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
7573 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
7574 invoke multibyte primitives.
7576 2000-07-23 Jim Meyering <meyering@lucent.com>
7578 * basename.c (base_name): Add an assertion.
7580 2000-07-15 Bruno Haible <clisp.cons.org>
7582 * quotearg.c: When the system forces us to redefine mbstate_t,
7583 shadow its mbsinit function.
7585 2000-07-16 Bruno Haible <haible@clisp.cons.org>
7587 * mbswidth.h: New file.
7588 * mbswidth.c: New file.
7589 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
7590 (noinst_HEADERS): Add mbswidth.h.
7592 2000-07-17 Bruno Haible <haible@clisp.cons.org>
7594 * config.charset: Add support for FreeBSD. Improve support for HP-UX
7597 2000-07-15 Jim Meyering <meyering@lucent.com>
7599 * makepath.c: Include quote.h.
7600 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
7601 corresponding argument in a `quote (...)' call.
7602 Give better diagnostics.
7604 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
7605 (noinst_HEADERS): Add quote.h.
7607 * quote.c (quote, quote_n): New file. Two functions taken verbatim
7608 from tar's src/misc.c.
7609 * quote.h: New file. Prototypes for same.
7611 2000-07-10 Paul Eggert <eggert@twinsun.com>
7613 From a suggestion by Bruno Haible.
7614 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
7615 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
7616 to decide whether to define the BeOS workaround macro;
7617 this adjusts to the change to AC_MBSTATE_T.
7619 2000-07-13 Paul Eggert <eggert@twinsun.com>
7621 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
7623 * quotearg.c (quoting_style_args, quoting_style_vals,
7624 quotearg_buffer_restyled): Add support for
7625 clocale_quoting_style. Undo previous change to
7626 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
7627 and "{RIGHT QUOTATION MARK}" msgids.
7629 2000-07-05 Paul Eggert <eggert@twinsun.com>
7631 The old behavior of quoting `like this' doesn't look good with
7632 newer, ISO-style fonts. See:
7633 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
7635 Instead, quote "like this" by default. Let the translator
7636 tailor the locale-specific quoting behavior by providing
7637 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
7639 * quotearg.c (N_): New macro.
7640 (gettext_default): New function.
7641 (quotearg_buffer_restyled): Use
7642 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
7643 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
7645 2000-07-09 Jim Meyering <meyering@lucent.com>
7647 * Most files: Update copyright dates to include 2000.
7649 2000-07-08 Jim Meyering <meyering@lucent.com>
7651 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
7653 (xgethostname): Remove now-unnecessary #ifdef.
7654 Move declaration of `err' into loop where it's used.
7656 2000-07-05 Bruno Haible <haible@clisp.cons.org>
7658 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
7659 by allocating a larger buffer. Test the gethostname return value for
7660 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
7661 returns an error and ENAMETOOLONG isn't defined.
7663 2000-07-05 Paul Eggert <eggert@twinsun.com>
7664 and Bruno Haible <haible@clisp.cons.org>
7666 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
7668 2000-07-05 Bruno Haible <haible@clisp.cons.org>
7670 * quotearg.c (struct quoting_options): Simplify quote_these_too
7673 2000-07-03 Jim Meyering <meyering@lucent.com>
7675 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
7676 Reported by Bruno Haible.
7678 2000-07-04 Jim Meyering <meyering@lucent.com>
7680 * quotearg.c: Make inclusion of <wchar.h> independent of whether
7681 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
7684 2000-07-03 Paul Eggert <eggert@twinsun.com>
7685 and Bruno Haible <haible@clisp.cons.org>
7687 * quotearg.c (mbrtowc):
7688 Assign to *pwc, and return 1 only if result is nonzero.
7689 (iswprint): Use ISPRINT when substituting our own mbrtowc.
7691 2000-07-03 Jim Meyering <meyering@lucent.com>
7693 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
7694 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
7697 2000-07-02 Jim Meyering <meyering@lucent.com>
7699 * quotearg.c (mbstate_t): Don't define here.
7701 2000-07-02 Jim Meyering <meyering@lucent.com>
7703 * nanosleep.c (SIGCONT): Define if not already defined.
7705 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7707 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
7708 per change in ../m4/ls-mntd-fs.m4.
7709 (read_filesystem_list): Ignore symbolic links.
7711 2000-06-29 Jim Meyering <meyering@lucent.com>
7713 * same.c: Include <string.h> or <strings.h>, as appropriate,
7714 for declaration of strcmp.
7716 * long-options.c: Include <stdlib.h>, for declaration of exit.
7718 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
7719 Avoid warning by casting result to `char *' to remove `const'.
7721 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7723 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
7725 2000-06-26 Paul Eggert <eggert@twinsun.com>
7727 savedir now sets errno on failure and invokes xmalloc to get memory.
7728 Fix a couple of other minor bugs while we're at it.
7730 * savedir.c (<unistd.h>): Do not include; there's no need.
7731 (NAMLEN): Remove macro.
7732 (malloc, realloc): Remove decls.
7734 ("xalloc.h"): Include.
7735 (NAME_SIZE_DEFAULT): New macro.
7736 (savedir): Use xmalloc / xrealloc to allocate memory.
7737 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
7738 Skip "" directory entries.
7739 Use strlen to calculate directory entry length, since the old method
7740 is rarely used these days and isn't worth supporting.
7741 Don't use a pointer after freeing it.
7742 Check for integer overflow when calculating allocation size.
7743 Use memcpy to copy entries, instead of stpcpy.
7744 Set errno properly when returning NULL.
7745 Check for readdir error.
7747 2000-06-26 Jim Meyering <meyering@lucent.com>
7749 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
7751 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7753 * getusershell.c (xmalloc, xrealloc): Remove functions.
7755 Don't include <stdlib.h>. Don't declare malloc, realloc.
7757 2000-06-23 Bruno Haible <haible@clisp.cons.org>
7759 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
7761 2000-06-24 Jim Meyering <meyering@lucent.com>
7763 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
7765 2000-06-21 Jim Meyering <meyering@lucent.com>
7767 * getpass.c: New file, from Bruno Haible. Required for BeOS.
7769 2000-06-19 Paul Eggert <eggert@twinsun.com>
7771 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
7772 (mbrtowc, mbstate_t): Define substitutes if
7773 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
7774 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
7775 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
7777 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7779 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
7780 than 1024, return a memory chunk of least possible size, instead
7781 of size PATH_MAX + 2. In the loop, increment the size proportionally.
7782 Use free/xmalloc instead of xrealloc to avoid copying for very long
7785 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7787 * canon-host.c (canon_host): Use malloc and memcpy to copy an
7788 address, not strdup. Include <stdlib.h> and don't declare free().
7790 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7792 * path-concat.c (path_concat): Don't access dir[-1] if dir is
7795 2000-06-21 Jim Meyering <meyering@lucent.com>
7797 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
7798 (noinst_HEADERS): Add getstr.h.
7800 * getline.c (getstr): Move into a separate file.
7801 * getstr.c (getstr): New file, extracted from getline.c, with
7802 the following changes: new parameter, delim2; both delim[12]
7803 parameters have type `int', not `char'. The latter would lose
7804 with 8-bit delimiters.
7805 * getstr.h: New file.
7807 2000-06-19 Jim Meyering <meyering@lucent.com>
7809 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
7811 2000-06-18 Jim Meyering <meyering@lucent.com>
7813 * mkdir.c: Remove file, due mainly to copyright incompatibility.
7814 Besides, these days every porting target provides a mkdir function.
7816 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
7817 (this snippet comes from src/system.h).
7819 2000-06-15 Paul Eggert <eggert@twinsun.com>
7821 * human.c (adjust_value): New function.
7822 (human_readable_inexact): Apply rounding style even when
7823 printing approximate values.
7825 2000-06-14 Paul Eggert <eggert@twinsun.com>
7827 * human.c (human_readable_inexact): Allow an input block
7828 size that is not a multiple of the output block size, and vice versa.
7829 Reported by Piergiorgio Sartor.
7831 2000-06-14 Paul Eggert <eggert@twinsun.com>
7833 * getdate.y (get_date): Apply relative times after time
7834 zone indicator, not before. Reported by Todd A. Jacobs.
7836 2000-06-13 Jim Meyering <meyering@lucent.com>
7838 * Makefile.am (all-local): Depend on lstat.c and stat.c.
7840 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
7842 2000-06-12 Paul Eggert <eggert@twinsun.com>
7844 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
7846 2000-06-04 Paul Eggert <eggert@twinsun.com>
7848 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
7850 2000-06-04 Jim Meyering <meyering@lucent.com>
7852 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
7853 SunOS 4.1.4 for which gid_t is an unsigned type.
7855 2000-06-03 Jim Meyering <meyering@lucent.com>
7857 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
7859 2000-05-26 Bruno Haible <haible@clisp.cons.org>
7861 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
7862 newer, don't install charset.alias.
7863 * config.charset: Change the Linux/glibc rules so they become empty
7864 on glibc-2.1 or newer.
7866 2000-06-02 Jim Meyering <meyering@lucent.com>
7868 * mountlist.c: Back out last change. Instead, do this...
7869 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
7870 member using the same `ignore'-testing code.
7871 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
7875 2000-05-29 Jim Meyering <meyering@lucent.com>
7877 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
7878 with the `ignore' attribute. Based on a patch from Mark D. Roth.
7880 2000-05-22 Jim Meyering <meyering@lucent.com>
7882 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
7884 2000-05-18 Jim Meyering <meyering@lucent.com>
7886 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
7887 back, too, since it may have been modified by allocate_entry.
7888 (hash_delete): Rewrite to use neither the assignment operator
7889 nor the comma operator in an if-expression.
7891 2000-05-15 Paul Eggert <eggert@twinsun.com>
7894 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
7895 Remove; no longer needed.
7896 "quotearg.h": Add include.
7897 (file_name): Do not bother to explicitly initialize to NULL; it's less
7898 efficient on some hosts.
7899 (close_stdout_status): Remove test as to whether stdout was already
7900 closed; it breaks for the case "echo x | sort >&-".
7901 Quote file name colons.
7902 Do not assume that _("write error") lacks format strings.
7904 2000-05-15 Jim Meyering <meyering@lucent.com>
7906 * version-etc.c (version_etc_copyright): Update the copyright string
7907 used in all --version output.
7909 2000-05-14 Jim Meyering <meyering@lucent.com>
7911 * closeout.c (close_stdout_set_file_name): New function.
7912 (close_stdout_status): Use new file-scoped global.
7913 Return right away if fstat says the stdout file descriptor is invalid.
7914 * closeout.h (close_stdout_set_file_name): Declare.
7916 2000-05-10 Jim Meyering <meyering@lucent.com>
7918 * closeout.c [default_exit_status]: New file-scoped variable.
7919 (close_stdout_set_status): New function.
7920 * closeout.h (close_stdout_set_status): Declare.
7922 2000-05-08 Jim Meyering <meyering@lucent.com>
7924 * long-options.c: Don't include closeout.h.
7925 (parse_long_options): Don't call close_stdout for --version.
7927 2000-05-06 Jim Meyering <meyering@lucent.com>
7929 * strnlen.c: Undefine __strnlen and strnlen.
7930 [!weak_alias]: Define __strnlen to strnlen.
7932 * atexit.c: New file, from libiberty.
7934 2000-05-06 Jim Meyering <meyering@lucent.com>
7936 * closeout.c (close_stdout_status): Also check for errors on the
7939 2000-05-05 Bruno Haible <haible@clisp.cons.org>
7941 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
7942 instead of xmalloc, xrealloc, path_concat.
7943 (locale_charset): Treat empty environment variables as absent.
7944 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
7946 2000-05-04 Jim Meyering <meyering@lucent.com>
7948 * getopt.c: Update from glibc.
7949 * obstack.c: Likewise.
7950 * obstack.h: Likewise.
7951 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
7953 * regex.h: Likewise.
7954 * strndup.c: Likewise.
7955 * strnlen.c: New file, from glibc.
7957 2000-05-01 Jim Meyering <meyering@lucent.com>
7959 * full-write.c (full_write): Remove `FIXME' part of comment.
7961 2000-04-29 Jim Meyering <meyering@lucent.com>
7963 * path-concat.c: Declare strdup only if it's not defined.
7964 * canon-host.c: Likewise.
7966 2000-04-28 Jim Meyering <meyering@lucent.com>
7968 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
7969 redefinition warning on some systems (HPUX). Otherwise, regex.h is
7970 included first, then limits.h is included by locale.h by libintl.h.
7971 From John David Anglin.
7973 2000-04-25 Jim Meyering <meyering@lucent.com>
7975 * makepath.c (S_IRWXUGO): Define.
7976 (make_path): Always perform explicit chmod if MODE specifies any
7977 of the `special' permission bits. Prompted by a bug report against
7978 install from Mate Wierdl and Joost van Baal.
7980 2000-04-18 Jim Meyering <meyering@lucent.com>
7984 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
7985 getpagesize. For BeOS. Based on a patch from Bruno Haible.
7987 2000-04-17 Jim Meyering <meyering@lucent.com>
7989 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
7990 the definition of it to rpl_strftime also defined-away the system's
7993 2000-04-15 Jim Meyering <meyering@lucent.com>
7995 Use `C' to denote so-called `contiguous' files, the same way
7997 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
7998 (ftypelet): Use S_ISCTG.
7999 From Michael Deutschmann.
8001 2000-04-14 Jim Meyering <meyering@lucent.com>
8003 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
8005 2000-04-08 Jim Meyering <meyering@lucent.com>
8007 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
8008 names don't conflict. Reported by Eli Zaretskii.
8010 2000-03-28 Bruno Haible <haible@clisp.cons.org>
8012 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
8013 bug. Deal with the different error behavior of Irix iconv.
8015 2000-04-07 Jim Meyering <meyering@lucent.com>
8017 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
8018 to work around system header problems on AIX 3.2.5. From Bruno Haible.
8020 2000-04-05 Jim Meyering <meyering@lucent.com>
8022 Portability tweaks required for ultrix4.3.
8023 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8024 * readutmp.c: Include sys/types.h before sys/stat.h.
8025 * canon-host.c: Declare strdup.
8026 * path-concat.c: Likewise.
8027 From John David Anglin.
8029 2000-04-04 Jim Meyering <meyering@lucent.com>
8031 Be more DOS 8.3-friendly.
8032 * ref-add.sin: Renamed from ref-add.sed.in.
8033 * ref-del.sin: Renamed from ref-del.sed.in.
8034 * Makefile.am: Reflect renaming.
8035 Reported by Eli Zaretskii.
8037 Use a temporary file name that won't clash with `charset.alias'
8038 in the DOS 8.3 name space.
8039 * Makefile.am (charset_tmp): Define.
8040 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8041 (uninstall-local): Likewise.
8042 Reported by Eli Zaretskii.
8044 2000-03-29 Paul Eggert <eggert@twinsun.com>
8046 * time/strftime.c (my_strftime): Make sure we call the system
8047 strftime, not ourselves, when invoking the underlying strftime.
8049 2000-03-24 Jim Meyering <meyering@lucent.com>
8051 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8052 (charset_alias): Define.
8053 (install-exec-local): Factor out common code.
8054 (uninstall-local): Split lines longer than 80.
8055 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8057 (.sed.in.sed): New rule. Don't redirect directly to $@.
8058 (CLEANFILES): Add ref-add.sed and ref-del.sed.
8060 2000-03-19 Bruno Haible <haible@clisp.cons.org>
8062 * config.charset: Output a line containing "Packages using this file".
8063 * ref-add.sed.in, ref-del.sed.in: New files.
8064 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8065 ref-del.sed): New rules.
8067 2000-03-17 Jim Meyering <meyering@lucent.com>
8069 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8070 Otherwise, include <strings.h>
8072 2000-03-17 Bruno Haible <haible@clisp.cons.org>
8074 * unicodeio.c (utf8_wctomb): New function.
8075 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8076 format instead of in UCS-4 with platform dependent endianness.
8078 2000-03-07 Paul Eggert <eggert@twinsun.com>
8080 * savedir.c (savedir): Work even if directory size is
8081 negative; this can happen with some screwy NFS configurations.
8083 2000-03-06 Jim Meyering <meyering@lucent.com>
8085 * localcharset.c (get_charset_aliases): Don't try to free file_name
8086 if it's NULL (because we ran out of memory). From Bruno Haible.
8088 2000-03-05 Jim Meyering <meyering@lucent.com>
8090 * localcharset.c ("path-concat.h"): Include.
8091 (get_charset_aliases): Use path_concat instead of ANSI string
8094 * unicodeio.h (PARAMS): Define.
8095 Use it to guard prototype.
8097 2000-03-04 Jim Meyering <meyering@lucent.com>
8099 * Makefile.am (install-exec-local): Create $(libdir) before installing
8101 (uninstall-local): Uncomment this rule so `make distcheck' works
8104 * unicodeio.c (<errno.h>): Include it.
8105 (errno): Declare if not defined.
8107 * localcharset.c: Add Bruno's comment justifying use of volatile.
8109 * config.charset: New version, incorporating remarks from a linux
8110 i18n mailing list. From Bruno Haible.
8112 2000-03-02 Jim Meyering <meyering@lucent.com>
8114 * Makefile.am (EXTRA_DIST): Add config.charset.
8116 2000-03-01 Jim Meyering <meyering@lucent.com>
8118 * localcharset.c: Guard some #includes with `#if HAVE_...'.
8119 * unicodeio.c: Likewise.
8121 2000-02-02 Bruno Haible <haible@clisp.cons.org>
8123 * config.charset: New file.
8124 * localcharset.c: New file.
8125 * unicodeio.h, unicodeio.c: New files.
8126 * Makefile.am (DEFS): Add -DLIBDIR=...
8127 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8128 (noinst_HEADERS): Add unicodeio.h.
8129 (all-local, install-exec-local, charset.alias): New targets.
8131 2000-02-28 Paul Eggert <eggert@twinsun.com>
8133 * quotearg.c (ALERT_CHAR): New macro.
8134 (quotearg_buffer_restyled): Use it.
8136 2000-02-27 Jim Meyering <meyering@lucent.com>
8138 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8139 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8141 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8142 not `#if STDC_HEADERS'.
8143 Declare malloc if needed.
8145 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8146 now that autoconf always defines the HAVE_DECL_ symbols.
8147 * human.c: Likewise.
8149 * strtoumax.c: Likewise.
8151 * backupfile.c: Arrange for cpp to fail if the configure-time
8152 declaration check was not run.
8154 * human.c: Likewise.
8156 * strtoumax.c: Likewise.
8158 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8159 then first look up the entire `.'-containing string as a login name.
8161 2000-02-18 Paul Eggert <eggert@twinsun.com>
8163 * getdate.y: Handle two-digit years with leading zeros correctly.
8164 (textint): New typedef.
8165 (parser_control): Member year changed from int to textint.
8167 (YYSTYPE): Removed; replaced by %union with int and textint members.
8168 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8169 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8170 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8171 (tSNUMBER, tUNUMBER): Now of type <textintval>.
8172 (date, number, to_year): Use width of number in digits, not its value,
8173 to determine whether it's a 2-digit year, or a 2-digit time.
8174 (yylex): Store number of digits of numeric tokens.
8175 Reported by John Kendall.
8177 (parser_control): Changed from struct parser_control to typedef (for
8178 consistency). All uses changed.
8180 (tID): Removed; not used.
8181 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8183 2000-02-14 Paul Eggert <eggert@twinsun.com>
8185 * getpagesize.h (getpagesize): Port to VMS for Alpha;
8186 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8188 2000-02-12 Jim Meyering <meyering@lucent.com>
8190 * userspec.c (ISDIGIT): Define it.
8191 (isdigit): Remove definition.
8192 (is_number): Use ISDIGIT, not isdigit.
8193 <libintl.h>: Include.
8195 (parse_user_spec): Mark translatable strings.
8197 2000-02-10 Jim Meyering <meyering@lucent.com>
8199 With these changes, nanosleep.[ch] are finally enough like the other
8200 lib/* replacement files to compile on a few more losing systems.
8202 * nanosleep.h: Don't include config.h.
8203 Remove prototype from declaration of nanosleep.
8204 (PARAMS): Remove now-unneeded definition.
8205 * nanosleep.c: #undef nanosleep.
8206 (rpl_nanosleep): Rename from nanosleep.
8208 2000-02-03 Jim Meyering <meyering@lucent.com>
8210 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8211 rather than with `#if HAVE_UTMPNAME'.
8213 2000-02-01 Jim Meyering <meyering@lucent.com>
8215 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
8217 2000-01-31 Jim Meyering <meyering@lucent.com>
8219 * nanosleep.h (nanosleep): Guard declaration with
8220 `#if ! HAVE_DECL_NANOSLEEP'.
8221 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8222 the declaration in that vendor's sys/timers.h.
8223 Reported by Christian Krackowizer.
8225 * quotearg.c (ISASCII): Add #undef and move definition to follow
8226 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8227 (ISPRINT): Likewise.
8228 Reported by Tom Tromey.
8230 2000-01-30 Jim Meyering <meyering@lucent.com>
8232 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8233 uses of ->ut_name. The latter doesn't work with new Linux header files
8234 where only utmpx.ut_user is declared.
8236 * readutmp.h (UT_USER): Define.
8238 2000-01-23 Jim Meyering <meyering@lucent.com>
8240 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8243 2000-01-22 Jim Meyering <meyering@lucent.com>
8245 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8246 [! HAVE_DECL_STRTOULL]: Declare strtoull.
8247 Required for some AIX systems. Reported by Christian Krackowizer.
8248 [TESTING] (main): New function.
8250 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
8251 * dirname.c (dir_name): Support for DOS-style file names with drive
8254 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8256 * strverscmp.c (ISDIGIT): Define.
8257 (strverscmp): Use ISDIGIT, not isdigit.
8259 2000-01-17 Paul Eggert <eggert@twinsun.com>
8261 * nanosleep.c (nanosleep):
8262 Don't use SA_INTERRUPT to decide whether to call sigaction, as
8263 POSIX.1 doesn't require SA_INTERRUPT and some systems
8264 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
8265 it's been part of POSIX.1 since day 1 (in 1988).
8267 2000-01-17 Jim Meyering <meyering@lucent.com>
8269 * interlock: Remove unused file. Reported by François Pinard.
8271 2000-01-16 Paul Eggert <eggert@twinsun.com>
8273 * quotearg.c (quotearg_buffer_restyled): Do not quote
8274 alert, backslash, formfeed, and vertical tab unnecessarily in
8275 shell quoting style.
8278 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
8279 Free Software Foundation, Inc.
8280 Copying and distribution of this file, with or without modification,
8281 are permitted provided the copyright notice and this notice are preserved.