1 2004-12-28 Simon Josefsson <jas@extundo.com>
3 * base64.h (isbase64): Add.
5 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
6 using a unsigned prototype, don't inline.
7 (base64_decode): Use it.
9 2005-01-19 Bruno Haible <bruno@clisp.org>
11 * sh-quote.h: New file, from GNU gettext.
12 * sh-quote.c: New file, from GNU gettext.
14 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
16 Merge changes from coreutils, as described below in several
17 changelogs dated today.
19 * save-cwd.c: Include "save-cwd.h" before other include files.
20 (O_DIRECTORY): Remove; not needed here, since "." must be
21 a directory. All uses removed.
22 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
23 universal on Suns, and we also need to test for IRIX.
24 Revamp code to use 'if' rather than '#if'.
25 Avoid unnecessary comparison of cwd->desc to 0.
27 * utimens.c (futimens): Robustify the previous patch, by checking
28 for known valid error numbers rather than observed invalid ones.
30 2005-01-18 Jim Meyering <jim@meyering.net>
32 * version-etc.c (version_etc_copyright): Update copyright date.
34 * utimens.c (futimens): Account for the fact that futimes
35 can also fail with errno == ENOSYS or errno == ENOENT.
36 Patch from Dmitry V. Levin.
38 Change the name of the robust chdir function from chdir to chdir_long.
39 * save-cwd.c: Include chdir-long.h rather than chdir.h.
40 (restore_cwd): Use chdir_long, not chdir.
41 * chdir-long.c: Renamed from chdir.c.
42 * chdir-long.h: Renamed from chdir.h.
43 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the Hurd.
44 2005-01-18 Bob Proulx <bob@proulx.com>
46 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
47 offsetof() macro construct to avoid compile failure with native HP-UX
50 2005-01-06 Bruno Haible <bruno@clisp.org>
52 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
53 because stpncpy.m4 takes care of it.
55 2004-01-24 Bruno Haible <bruno@clisp.org>
57 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
59 2003-10-09 Bruno Haible <bruno@clisp.org>
61 * progreloc.c: Include xalloc.h instead of xmalloc.h.
63 2005-01-06 Bruno Haible <bruno@clisp.org>
65 * fwriteerror.h (fwriteerror): Change specification to include fclose.
66 * fwriteerror.c: Include <stdbool.h>.
67 (fwriteerror): At the end, close the file stream. Record whether
68 stdout was already closed.
70 2004-05-27 Bruno Haible <bruno@clisp.org>
72 * execute.c (environ): Declare if needed.
73 * pipe.c (environ): Likewise.
74 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
76 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
78 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
79 definitions to be after all include files, to avoid collisions.
80 Problem reported by Bob Proulx.
82 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
84 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
85 not needed. This removes a dependency on the gettext module.
86 [defined _LIBC]: Do not include <libintl.h>; not needed.
88 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
90 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
93 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
95 * argp-parse.c: Include <stddef.h>.
96 (alignof, alignto): New macros.
97 (parser_init): Don't assume that void * is aligned sufficiently
100 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
101 need to extend the stack.
102 (YYINITDEPTH): New macro, so that the initial stack isn't overly
105 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
107 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
109 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
111 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
112 Remove now-obsolete comment about AIX.
113 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
114 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
115 (YYMAXDEPTH): New macro.
117 2004-12-18 Bruno Haible <bruno@clisp.org>
119 * fatal-signal.c (fatal_signals): Make non-const.
120 (init_fatal_signals): New function.
121 (uninstall_handlers, install_handlers): Ignore signals that were set to
123 (at_fatal_signal): Call init_fatal_signals.
124 (init_fatal_signal_set): Likewise. Ignore signals that were set to
126 Reported by Paul Eggert.
128 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
130 * getdate.y (textint): New member "negative".
131 (time_zone_hhmm): New function.
132 Expect 14 shift-reduce conflicts, not 13.
133 (o_colon_minutes): New rule.
134 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
135 (yylex): Set the "negative" member of signed numbers.
137 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
139 Changes imported from coreutils.
140 * hard-locale.c: Assume <locale.h> exists.
142 (GLIBC_VERSION): New macro.
143 (hard_locale): Assume setlocale exists.
144 Rewrite to avoid #ifdef.
145 Use strdup rather than malloc + strcpy.
146 * human.c: Assume <locale.h> exists.
147 (human_readable): Assume localeconv exists.
149 2004-12-01 Jakub Jelinek <jakub@redhat.com>
151 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
152 convert T2, not T. (Imported from libc.)
154 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
156 * getcwd.c (is_ENAMETOOLONG): New macro.
157 (__getcwd.c): Don't restore errno; glibc doesn't.
158 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
159 first, falling back to our code only if its results look suspicious.
160 Ensure that the resulting buffer is only as large as necessary.
162 * readutmp.c: Include readutmp.h first.
163 Include <errno.h>, since readutmp.h no longer does that.
164 * readutmp.h: Don't include <errno.h>,
165 <sys/param.h>, <time.h>; not needed to establish interface.
166 (errno): Remove decl.
167 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
168 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
169 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
171 2004-11-28 Simon Josefsson <jas@extundo.com>
173 * base64.h, base64.c: New file.
175 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
177 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
179 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
181 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
182 HP's ANSI C compiler.
183 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
184 Declaring int functions causes warnings on some modern systems and
185 shouldn't be needed to compile on ancient ones.
186 * same.c (MIN) [defined MIN]: Don't define, since it's already
189 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
190 with the following changes.
191 (__set_errno): Parenthesize properly.
193 (MIN, MAX, MATCHING_INO): New macros.
194 (__getcwd): Define with prototype, not K&R form.
195 Use heuristics to allocate default buffer on stack if possible.
196 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
197 behavior, and to avoid the PATH_MAX limit when computing
199 Use MATCHING_INO to compare inode number to file.
200 Check for arithmetic overflow in size calculations.
201 Fix bug in reallocation of dot array that caused getcwd to fail
202 on directories nested deeper than 75.
203 Be more careful about saving errno on error.
204 Do not use realloc; use only free+malloc, as this is a bit
205 more flexible and avoids a needless copy operation.
206 Do not inspect st_dev and st_ino for symbolic links; POSIX
207 doesn't specify the latter.
208 Check for closedir errors.
209 Avoid needless casts.
210 Use "#ifdef weak_alias" around weak_alias, to be like other
212 The following changes to getcwd.c have effect only when used in
213 gnulib; they have no effect inside glibc proper.
214 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
215 as alloca isn't used.
216 (alloca, __alloca): Likewise.
217 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
218 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
219 unconditionally, as gnulib assumes C89 or better.
220 Do not include <sys/param.h>.
221 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
222 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
224 (NULL) [!defined NULL]: Remove; we assume C89 or better.
225 Include <dirent.h> in a way that is compatible with modern Autoconf.
226 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
227 New macros, if not already defined.
228 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
229 Use "_LIBC", not "defined _LIBC", for consistency.
230 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
232 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
233 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
234 * xgetcwd.c: David MacKenzie's old code was removed, so give
235 credit only to Jim Meyering and adjust the copyright dates.
236 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
237 <stdlib.h>, <unistd.h>, "pathmax.h".
238 Instead, include "xgetcwd.h" (first) and "getcwd.h".
239 (INITIAL_BUFFER_SIZE): Remove.
240 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
242 2004-11-23 Jim Meyering <jim@meyering.net>
244 * getopt_.h: Remove trailing blanks.
246 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
248 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
249 (futimens): New function, which uses futimes if available.
250 (futimens, utimens): Support timespec==NULL, with same semantics
251 as utime and utimens.
252 * utimens.h (futimens): New decl.
254 2004-11-23 Jim Meyering <jim@meyering.net>
256 * __fpending.c: Add comment.
258 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
260 * getopt_.h: Re-addition of __getopt_argv_const caused
261 redefinition warnings. To avoid them, include the defines
262 in `#if !defined __need_getopt ... #endif'. The only place
263 where __getopt_argv_const is used is in definitions
264 of getopt_long and getopt_long_only below, which are as well
265 protected by `#ifndef __need_getopt'.
266 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
267 __need_getopt after including <stdio.h> and <unistd.h> These
268 headers might have defined it.
270 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
272 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
274 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
275 optopt): Use them instead of invoking ## directly; otherwise, the
276 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
278 2004-11-19 Bruno Haible <bruno@clisp.org>
280 * strtok_r.c: Move comments from here...
281 * strtok_r.h: ... to here.
283 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
285 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
286 might fail. Problem reported by Yoann Vandoorselaere.
287 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
288 that mishandle size_t overflow.
290 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
292 * canon-host.c: Include "strdup.h".
293 (canon_host): Use getaddrinfo if available, so that IPv6 works.
294 Use strdup instead of malloc/strcpy to duplicate strings.
296 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
297 (human_space_before_unit): New constant.
298 * human.c (human_readable): Support it.
300 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
301 (xgetcwd): Set errno correctly when failing.
302 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
303 the failure is actually due to a PATH_MAX problem.
305 Further getopt changes to make it more likely that glibc will
306 buy the changes back.
307 * getopt.c (POSIXLY_CORRECT): New constant.
308 (getopt): Use it, so to preserve glibc semantic
309 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
310 when compiling for libc.
311 * getopt_.h (__getopt_argv_const): Bring it back.
312 (getopt_long, getopt_long_only): Use it.
314 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
315 New arg POSIXLY_CORRECT. All callers changed.
316 (getopt): Argv is now char * const *, as per standard.
317 (_getopt_internal_r, _getopt_internal): Argv is now char **,
318 not char *__getopt_argv_const *.
319 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
320 _getopt_long_only_r): Likewise.
321 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
322 * getopt_int.h (_getopt_internal, _getopt_internal_r,
323 _getopt_long_r, _getopt_long_only_r): Likewise.
324 * getopt_.h (__getopt_argv_const): Remove.
325 (getopt): Argv is now char * const *, as per standard.
327 * getdate.y (tORDINAL): New token.
328 (day, relunit): Allow it for relative times.
329 (relative_time_table): Use tORDINAL for ordinals.
331 2004-11-15 Jim Meyering <jim@meyering.net>
333 * closeout.c: Include "__fpending.h" once again.
335 (close_stdout): Don't fail just because stdout was closed initially,
336 since some programs don't write to stdout in the normal course of
337 operation (other than --version and --help), and we don't want this
338 function to make e.g. `touch file >&-' fail.
339 But do fail if it was closed and someone has tried to write to it.
340 E.g., `printf foo >&-' must fail.
342 2004-11-11 Simon Josefsson <jas@extundo.com>
344 * strtok_r.h, strtok_r.c: New file.
346 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
348 * getopt_.h (__getopt_argv_const): New macro, to be used so that
349 we can stop lying to compilers about the constness of argv when we
350 are compiled outside glibc.
351 (getopt, getopt_long, getopt_long_only): Use it.
352 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
354 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
355 _getopt_long_only_r): Likewise.
356 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
357 _getopt_long_only_r): Likewise.
359 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
360 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
361 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
362 the other external symbols.
363 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
364 declaration, since the above renaming now works around collisions.
366 2004-11-11 Jim Meyering <jim@meyering.net>
368 * linebreak.c: Remove trailing blanks.
369 * alloca_.h: Likewise.
371 * euidaccess.c: Likewise.
372 * allocsa.h: Likewise.
374 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
376 * mktime.c (SHR): New macro, which is a portable
377 substitute for >> that should work even on Crays.
378 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
379 Problem reported by Mark D. Baushke in
380 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
381 * getdate.y (SHR): Likewise.
383 * strftime.c (SHR): Likewise.
385 * quotearg.c (struct quoting_options): Use unsigned int for
386 quote_these_too, so that right shifts are well defined. All uses
389 2004-11-10 Simon Josefsson <jas@extundo.com>
391 * getaddrinfo.h, getaddrinfo.c: New files.
393 2004-11-10 Jim Meyering <jim@meyering.net>
395 Ensure that no close failure goes unreported.
396 * closeout.c (close_stdout): Always close stdout. I.e., don't
397 return early when it seems there's nothing to flush.
398 Don't include __fpending.h.
400 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
402 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
404 2004-11-05 Bruno Haible <bruno@clisp.org>
406 * readlink.c: Include stddef.h, needed for size_t on Woe32.
407 Reported by Mark D. Baushke <mdb@cvshome.org>.
409 2004-11-04 Bruno Haible <bruno@clisp.org>
411 2004-09-11 Bruno Haible <bruno@clisp.org>
412 * allocsa.valgrind: New file.
413 2004-02-06 Bruno Haible <bruno@clisp.org>
414 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
415 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
416 Reported by Christopher Seip <chris.seip@hp.com>.
418 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
420 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
421 with errno == ERANGE if the buffer is too small.
422 Problem reported by Mark D. Baushke.
424 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
426 * xreadlink.c (MAXSIZE): New macro.
427 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
428 size does not exceed MAXSIZE. Avoid cast.
429 As suggested by Mark D. Baushke in
430 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
431 if readlink fails with buffer size just under MAXSIZE, try again
434 2004-11-02 Derek R. Price <derek@ximbiot.com>
435 and Paul Eggert <eggert@cs.ucla.edu>
437 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
438 (get_date): Overparenthesize to avoid GCC warning.
440 2004-11-02 Bruno Haible <bruno@clisp.org>
442 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
443 function returns void.
445 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
447 * getpass.c (fflush_unlocked, flockfile, funlockfile)
448 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
451 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
453 * getdate.y: Add support for TZ="foo" within a date string.
454 Fix some bugs near time_t boundaries. Reject dates with
455 out-of-range components, e.g., "Sept 31".
456 Include <stdlib.h>, "setenv.h", "xalloc.h".
457 (ISDIGIT_LOCALE): Remove; unused.
458 Note that the TZ and time functions used here are not reentrant.
459 (mktime_ok, get_tz): New functions.
460 (TZBUFSIZE): New constant.
461 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
462 This requires that we sometimes generate our own TZ="XXX..." setting.
464 2004-10-27 Derek R. Price <derek@ximbiot.com>
466 * mktime.c (not_equal_tm): Remove redundant check.
468 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
470 * getdate.y: Use Bison 1.875 features, and some minor
471 code cleanups. This change does not affect semantics.
472 Don't include <stdlib.h>; no longer needed.
473 Don't include unlocked-io.h; only the "#if TEST" code uses
474 stdio, and performance isn't crucial there.
475 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
476 Bison 1.875 features as described below.
477 All uses of "PC." replaced by "pc->".
478 (YYSTYPE): Add a forward declaration.
479 (yylex, yyerror): Use full prototypes in forward decls.
480 Use "%pure-parser" rather than obsolescent "%pure_parser".
481 Use %parse-param and %lex-param instead of obsolescent
482 YYPARSE_PARAM and YYLEX_PARAM.
483 (meridian_table, month_and_day_table, time_units_table,
484 relative_time_table, time_zone_table, military_table,
485 lookup_zone, lookup_word, get_date):
486 Use NULL instead of 0 where appropriate.
487 (to_hour): Avoid abort (), to avoid a dependency on
489 (yyerror, yylex): Now accepts parser_control * arg.
490 (main) [TEST]: Use '\0' rather than 0 for char.
492 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
494 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
495 It's now the caller's responsibility to handle the case where
496 !HAVE_GETPAGESIZE && !defined getpagesize.
498 * mktime.c (leapyear): Arg is long int, not int.
500 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
502 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
504 2004-10-12 Simon Josefsson <jas@extundo.com>
506 * getpass.c (fflush_unlocked, flockfile, funlockfile)
507 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
510 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
512 * vsnprintf.h: New file.
513 * vsnprintf.c: New file.
515 2004-10-07 Bruno Haible <bruno@clisp.org>
517 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
518 into the provided buffer.
520 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
522 * diacrit.c, diacrit.h: Add GPL notice.
524 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
525 * atanl.c (atanl): Keep the code as similar to glibc as possible.
526 * logl.c (logl): Keep the code as similar to glibc as possible.
527 This avoids a potential constant-folding bug.
529 2004-10-05 Bruno Haible <bruno@clisp.org>
531 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
533 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
535 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
536 * xmalloc.c (xmemdup): Likewise.
537 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
538 XFREE): Remove these long-obsolescent macros.
539 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
542 * regex.c (re_comp): Cast gettext return value to char *,
543 Problem reported by Martin Neitzel via Mark D. Baushke.
545 2004-10-04 Simon Josefsson <jas@extundo.com>
547 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
548 '#ifdef USE_UNLOCKED_IO'.
550 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
552 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
553 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
554 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
555 regex.c, sha1.c, version-etc.c, yesno.c:
556 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
557 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
558 the includer's responsibility.
562 * modechange.c (mode_compile): Don't decrement a pointer that
563 points to the start of a string, as the C Standard says the
564 resulting behavior is undefined.
566 * backupfile.h (enum backuptype): Rename none -> no_backups,
567 simple -> simple_backups, numbered_existing ->
568 numbered_existing_backups, numbered -> numbered_backups
569 to avoid shadowing problems. All uses changed.
570 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
571 * backupfile.c (check_extension, numbered_backup):
572 Rename locals to avoid shadowing 'basename'.
573 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
576 * .cppi-disable: Add getopt_.h, getopt_int.h.
577 * .cvsignore: Add getopt.h.
579 2004-10-04 Simon Josefsson <jas@extundo.com>
581 * memmem.h: New file.
582 * memmem.c: New file, taken from glibc.
584 2004-10-02 Jim Meyering <jim@meyering.net>
586 * dirfd.h, getpagesize.h: Add copyright notice.
588 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
590 * snprintf.c: Remove comments as to why each header is needed.
592 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
594 * strsep.h: New file.
595 * strsep.c: New file.
597 2004-10-01 Simon Josefsson <jas@extundo.com>
599 * snprintf.c (snprintf): Handle size==0.
601 2004-10-01 Simon Josefsson <jas@extundo.com>
602 Bruno Haible <bruno@clisp.org>
604 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
605 (snprintf): Declare 'args'.
607 2004-09-30 Simon Josefsson <jas@extundo.com>
609 * snprintf.h, snprintf.c: New files.
611 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
613 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
614 (hol_entry_help): Never translate an empty string.
615 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
616 * argp.h (OPTION_NO_TRANS): New option.
618 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
620 * xvasprintf.c: Include xalloc.h.
621 (xvasprintf): Use xalloc_die, not xmalloc_die.
623 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
625 * dummy.c: Change copyright notice to FSF, and license to GPL.
627 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
629 * argp-pvh.c (argp_program_version_hook): Provide initial value.
630 Problem reported by Bruno Haible in:
631 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
633 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
635 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
636 in case some system header has #define'd it. Problem reported by
638 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
640 2004-09-08 Bruno Haible <bruno@clisp.org>
642 * stdint_.h.in: New file, taken from GNU clisp.
644 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
646 * xvasprintf.h: New file.
647 * xvasprintf.c: New file.
648 * xasprintf.c: New file.
650 2004-09-08 Bruno Haible <bruno@clisp.org>
652 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
654 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
656 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
658 Import from coreutils.
659 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
660 strings on unbounded length. alloca's performance benefits aren't
663 (parse_with_separator): New function, with most of the internals
664 of the old parse_user_spec. Allow user to omit both user and group,
665 for compatibility with FreeBSD.
666 Clone only the user name, not the entire spec.
667 Do not set *uid, *gid unless entirely successful.
668 Avoid memory leak in some failing cases.
669 Fix regression for USER.GROUP reported by Dmitry V. Levin in
670 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
671 (parse_user_spec): Rewrite to use parse_with_separator.
673 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
675 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
676 its complicated substitute.
677 * argp-help.c: Include <errno.h>, for program_invocation_short_name
678 and program_invocation_name.
679 (__argp_basename) [!_LIBC]: Remove; the only use was
680 replaced by its body.
681 (__argp_short_program_name): Change condition from
682 !defined __argp_short_program_name to
683 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
684 to match argp-namefrob.h.
685 (__argp_failure): Don't assume strerror_r returns char *.
686 * argp-parse.c (N_): Define unconditionally.
687 (argp_default_options): Fill out initializers with 0 to avoid
690 2004-08-12 Simon Josefsson <jas@extundo.com>
692 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
693 * getopt_.h: Renamed from getopt.h.
695 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
697 Merge from coreutils.
699 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
700 wmemchr or wmemcpy. Problem reported by Robert Dahlem
701 for Reliant Unix 5.43.
703 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
704 (union fooround): Use uintmax_t, not long int.
705 The rest is a merge from libc:
706 [defined _LIBC]: Include <shlib-compat.h>.
707 (_obstack) [defined _LIBC]: Remove after 2.3.4.
709 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
711 * strverscmp.c: Convert to UTF-8.
713 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
715 * obstack.h (obstack_empty_p):
716 Don't assume that chunk->contents is suitably aligned.
717 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
718 Likewise. Problem reported by Benno in
719 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
721 * chown.c (rpl_chown): Work even if the file is writeable but not
722 readable. This could be improved further but it'd take some work.
724 2004-08-08 Simon Josefsson <jas@extundo.com>
726 * xgethostname.c: Don't include error.h (not used).
729 * getpass.c: Include getpass.h first.
731 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
733 * xalloc-die.c: New files.
734 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
736 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
737 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
738 (_, N_, xalloc_die): Move to xalloc-die.c.
739 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
740 so that we needn't mess with xalloc_msg_memory_exhausted.
742 * sha1.h: Renamed from sha.h.
743 (SHA1_H): Renamed from _SHA_H.
744 (sha1_ctx): Renamed from sha_ctx.
745 (sha1_init_ctx): Renamed from sha_init_ctx.
746 (sha1_process_block): Renamed from sha_process_block.
747 (sha1_process_bytes): Renamed from sha_process_bytes.
748 (sha1_finish_ctx): Renamed from sha_finish_ctx.
749 (sha1_read_ctx): Renamed from sha_read_ctx.
750 (sha1_stream): Renamed from sha_stream.
751 (sha1_buffer): Renamed from sha_buffer.
752 * sha1.c: Likewise; renamed from sha.c.
753 Do not include <sys/types.h>.
754 Include <stddef.h> rather than <stdlib.h>.
756 2004-08-08 Bruno Haible <bruno@clisp.org>
758 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
759 FILESYSTEM_PREFIX_LEN.
760 * progreloc.c: Likewise.
761 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
763 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
766 * argp-help.c (make_hol, hol_append): Don't assume that
767 SIZE_MAX is a valid preprocessor constant.
768 (__argp_basename): Change from "#ifndef _LIBC"
769 to "#ifndef __argp_short_program_name", so that
770 we don't compile these functions for tar.
772 More merges from coreutils.
773 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
774 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
776 * addext.c: Remove; no longer needed.
777 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
778 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
779 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
780 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
781 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
782 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
783 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
784 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
785 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
786 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
787 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
788 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
789 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
790 Import changes from coreutils.
792 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
794 Merge from coreutils.
796 * .gdb-history: Remove; this doesn't belong here.
798 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
799 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
800 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
802 * dirname.h: Include <stdbool.h>.
803 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
804 for consistency with POSIX terminology. All uses changed.
805 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
806 (strip_trailing_slashes): Use bool for booleans.
807 * stripslash.c (strip_trailing_slashes): Likewise.
809 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
810 sometimes returns a positive errno value even when it succeeds.
811 (print_errno_message) [!LIBC]: Fall back on strerror if
814 * path-concat.c (mempcpy): Don't define if a system header defines it.
815 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
816 (longest_relative_suffix): New function.
817 (path_concat): Use it. Assume first argument is not NULL.
818 Port to DOS. Omit redundant separators.
819 Report an error instead of returning NULL.
820 Use mempcpy instead of memcpy.
821 (xpath_concat): Remove: not declared or used.
823 * same.h: Include <stdbool.h>
824 (same_name): Return bool, not int.
825 * same.c (same_name): Likewise.
826 (errno): Don't declare; we assume C89 or better now.
828 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
829 if not already defined.
831 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
832 * dup-safer.c (errno): Likewise.
834 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
836 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
839 2004-08-03 Simon Josefsson <jas@extundo.com>
841 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
842 * progname.h: Don't include stdbool.h.
844 2004-08-02 Simon Josefsson <jas@extundo.com>
846 * getsubopt.h: New file, with comments from Bruno Haible.
847 * getsubopt.c: New file, from glibc, but slightly modified based on
848 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
850 2004-08-01 Simon Josefsson <jas@extundo.com>
852 * xgetdomainname.c: Include stdlib.h, for free().
854 2004-07-16 Simon Josefsson <jas@extundo.com>
858 2004-07-16 Bruno Haible <bruno@clisp.org>
860 * backupfile.h: Add extern "C" for C++.
861 * closeout.h: Likewise.
862 * copy-file.h: Likewise.
863 * findprog.h: Likewise.
864 * full-write.h: Likewise.
865 * pathname.h: Likewise.
866 * progname.h: Likewise.
867 * stpcpy.h: Likewise.
868 * stpncpy.h: Likewise.
869 * strcase.h: Likewise.
870 * strstr.h: Likewise.
871 * xalloc.h: Likewise.
873 * mbswidth.h: Add extern "C" for C++.
874 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
876 2004-07-09 Simon Josefsson <jas@extundo.com>
878 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
879 failed without this.)
881 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
883 * fchown-stub.c: New file.
885 2004-06-24 Jim Meyering <jim@meyering.net>
887 * obstack.h (obstack_base): Cast to (void *), per documentation.
889 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
891 * argz.c, argz_.h: New files, which are autoupdated from libtool.
893 2004-06-01 Jim Meyering <jim@meyering.net>
895 * calloc.c: New file.
897 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
899 * getdate.y (yylex): Allow space between sign and number.
900 Problem reported by Dan Jacobson.
902 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
903 and Jim Meyering <jim@meyering.net>
905 Merge from coreutils CVS.
907 * stat-macros.h: New file, with contents from file-type.h
908 and coreutils' system.h.
909 * file-type.c: Include "stat-macros.h".
910 * file-type.h (file_type): Move all macro definitions to new file,
913 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
914 Wrap old code with this conditional.
915 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
916 function that does not dereference symlinks.
917 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
919 * xreadlink.c: Include xreadlink.h first, to catch .h file
921 (xreadlink): Accept new arg SIZE, for efficiency.
922 All decls and uses changed.
923 * xreadlink.h: Include <stddef.h>, for size_t.
925 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
926 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
928 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
930 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
932 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
933 macros to be defined.
934 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
935 the allocator returns NULL because the requested size is zero.
937 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
939 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
940 var. Add comment explaining why libc still defines it. This
941 merges the following patch from glibc:
942 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
944 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
946 * obstack.c (_obstack): Remove unused variable. It hasn't been
947 present in glibc since revision 1.1 of this file.
948 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
949 obstack_alignment_mask, obstack_alloc, obstack_base,
950 obstack_blank, obstack_blank_fast, obstack_chunk_size,
951 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
952 obstack_grow0, obstack_init, obstack_int_grow,
953 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
954 obstack_next_free, obstack_object_size, obstack_ptr_grow,
955 obstack_ptr_grow_fast, obstack_room): Remove declarations of
956 nonexistent functions.
958 2004-05-17 Derek R. Price <derek@ximbiot.com>
959 Paul Eggert <eggert@cs.ucla.edu>
961 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
963 2004-05-14 Bruno Haible <bruno@clisp.org>
965 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
966 that consists of a '.' followed by an empty digit string.
967 Patch by Tor Lillqvist <tml@iki.fi>.
969 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
971 Port obstack to the AS/400, where pointers are 16 bytes wide and
972 you cannot cast an integer to a valid pointer. This patch is
973 currently waiting to be integrated into glibc; see
974 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
976 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
977 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
978 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
979 (struct obstack): temp member is now a union of a pointer and
980 an integer, instead of an integer. All integer uses changed.
981 This does not affect the physical layout of struct obstack,
982 except on hosts (like the AS/400) where the size or alignment of
983 void * is greater than that of ptrdiff_t.
984 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
985 __STDC__)]: Store temporary in pointer member of union, not
987 * obstack.c: Include <stddef.h>, for offsetof.
988 (struct fooalign): Remove; it doesn't need a name.
989 (union fooround): Change double to long double, and add void *.
990 (DEFAULT_ALIGNMENT): Use offsetof to compute.
991 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
992 not a macro. Hence the values are always int; so remove all
993 casts-to-int in uses.
995 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
996 Derek Price <derek@ximbiot.com>
998 * alloca.c: Include <alloca.h>, to get our interface.
999 * alloca_.h: Use __alloca on AIX, so that we don't have to
1000 include <alloca.h> first. Use C89 prototype for alloca; this
1001 requires including <stddef.h> for size_t. Use extern "C" if C++.
1002 Use #elif for simplicity, since we can assume C89 now.
1003 Don't try to source the system alloca.h since it will not be found
1004 and to prevent recursively including its replacement.
1005 * fnmatch.c: Include <alloca.h> instead of opencoding.
1006 * regex.c: Likewise.
1008 2004-05-16 Derek Price <derek@ximbiot.com>
1009 Paul Eggert <eggert@cs.ucla.edu>
1011 getline cleanup. This changes the getndelim2 API: both order of
1012 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
1015 * getline.c: Don't include stddef.h or stdio.h, since our
1016 interface does that.
1017 (getline): Always use getdelim, so that we don't have two
1018 copies of this code.
1019 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
1021 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
1022 (GETNDELIM2_MAXIMUM): New macro.
1023 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
1024 instead of the old practice of delim2==0. All callers changed.
1025 Return -1 on overflow, instead of returning junk.
1026 Do not set *linesize unless allocation succeeds.
1027 * getndelim2.h: Do not include stddef.h; no longer needed, now
1028 that we include sys/types.h.
1029 * getnline.h: Likewise.
1030 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
1031 (getndelim2): Reorder arguments.
1032 * getnline.c (getnline, getndelim):
1033 Don't discard the NMAX argument.
1034 (getnline): Invoke getndelim, to avoid code duplication.
1035 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
1036 of (size_t) -1 by callers of the getnline family.
1038 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
1040 * nanosleep.c (suspended): Change its type from int to
1041 sig_atomic_t volatile.
1042 (first_call): Make it private to rpl_nanosleep, and have it
1043 be zero initially as that's a bit faster.
1044 (my_usleep): Round up fractional times instead of truncating them,
1045 as this is the usual meaning for 'sleep'.
1047 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
1049 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
1050 (ENOSYS): Define if not defined.
1051 (settime): Fall back on stime if it exists and settimeofday fails.
1052 But don't bother with fallbacks if a method fails with errno == EPERM.
1054 2004-05-11 Jim Meyering <jim@meyering.net>
1056 Prior to this change, the save_cwd caller required read access to the
1057 current directory on most systems (ones with the fchdir function).
1059 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
1060 fails, try write-only, and finally, resort to using xgetcwd.
1062 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
1064 * obstack.c, obstack.h: Import changes from libc.
1066 2004-04-28 Bruno Haible <bruno@clisp.org>
1068 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
1069 implicitly appends .exe to executables.
1070 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
1071 accepts Windows pathnames.
1072 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1073 Cygwin like Windows, since it now accepts Windows pathnames.
1074 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1075 Cygwin like Windows, since it now accepts Windows pathnames.
1076 Reported by Derek Robert Price <derek@ximbiot.com>.
1078 2004-04-20 Jim Meyering <jim@meyering.net>
1080 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
1082 2004-04-20 Jim Meyering <jim@meyering.net>
1083 Bruno Haible <bruno@clisp.org>
1085 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
1086 memory when realloc fails.
1088 2004-04-18 Jim Meyering <jim@meyering.net>
1090 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
1091 don't leak memory and do call END_UTMP_ENT.
1093 2004-04-11 Paul Eggert <eggert@twinsun.com>
1095 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
1096 (CHAR_BIT): Remove, since we assume C89.
1097 Include <stdint.h> if available, as per current Autoconf CVS advice.
1099 2004-03-30 Paul Eggert <eggert@twinsun.com>
1101 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
1102 not bool, to be more consistent with Unix conventions.
1103 Suggested by Bruno Haible.
1105 Merge from coreutils.
1107 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
1110 * getdate.h: Include stdbool.h, and timespec.h instead of
1111 the usual <time.h> dance.
1112 (get_date): Change signature to support fractional time stamps.
1113 All callers changed.
1114 * getdate.y: Include "getdate.h" first, as we can now
1115 assume C89 and don't need to worry about 'const'.
1116 Similarly, include "unlocked-io.h" near start, not in middle.
1118 (textint.value): Use long int rather than int.
1119 (textint.digits): Use size_t rather than int.
1120 (BILLION, LOG10_BILLION): New constants.
1121 (parser_control): New member rel_ns. Members day_ordinal,
1122 time_zone, month, day, hour, minutes, rel_year, rel_month,
1123 rel_day, rel_hour, rel_minutes, rel_seconds
1124 are now long int, not int. Member seconds is now struct timespec,
1125 not int. New member timespec_seen. Members dates_seen, days_seen,
1126 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
1128 (%union.intval): Now long int, not int.
1129 New member timespec.
1130 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
1131 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
1132 (spec): Now is a timespec or an item list.
1133 (timespec, items): New nonterminals.
1134 (time, rel, relunit, number, get_date):
1135 Add support for fractional seconds.
1136 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
1137 (gmtime, localtime, mktime): Remove decls; not needed with C89.
1138 (to_hour): First arg is now long int, not int.
1139 (to_year): Returns long int, not int.
1140 Don't treat year -70 like 70.
1141 (tm_diff): Returns long int, not int.
1142 (lookup_word): Use bool instead of int when appropriate.
1143 (yylex): Use size_t for count, not int.
1144 Detect overflow when parsing large integer constants.
1145 Add support for fractions.
1146 (get_date): Make pointers 'const' if possible.
1147 Use more-portable code to detect integer overflow.
1148 (main) [TEST]: Adjust to above changes. Test for localtime failure.
1149 Don't use ctime; it's not reliable if the year has >4 digits.
1151 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
1152 This is for compatibility with BSD.
1154 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
1155 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
1156 From coreutils' system.h.
1158 * userspec.c: Don't include "posixver.h".
1159 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
1160 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
1161 compatible extension. Simplify code by removing a boolean int
1162 that was always nonzero if a string was nonnull.
1164 2004-03-30 Jim Meyering <jim@meyering.net>
1166 Merge from coreutils.
1168 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
1170 * readtokens.c (readtoken): Don't leak 64 bytes when reading
1171 an empty input stream.
1173 * readtokens.c: Include <stdbool.h>.
1174 (readtoken): Use `size_t' rather than int/long.
1175 All callers adjusted.
1176 Use `bool' rather than `int' where appropriate.
1177 Use memset rather than an explicit loop.
1178 Use x2nrealloc rather than xrealloc.
1179 Allow the use of `\0' as a delimiter.
1180 (readtokens): Likewise.
1181 * readtokens.h (readtoken, readtokens): Update prototypes.
1183 2004-03-30 Bruno Haible <bruno@clisp.org>
1185 * getloadavg.c (getloadavg): Don't assume setlocale returns
1188 2004-03-29 Paul Eggert <eggert@twinsun.com>
1190 Merge changes to getloadavg.c from coreutils and Emacs.
1192 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
1193 Define to an expression, not to the empty string.
1194 Include cloexec.h and xalloc.h.
1195 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
1196 Use set_cloexec_flag rather than rolling our own.
1197 * cloexec.c, cloexec.h: New files.
1199 2004-03-18 Paul Eggert <eggert@twinsun.com>
1201 * getopt.h: Sync with libc CVS.
1203 2004-03-18 Paul Eggert <eggert@twinsun.com>
1204 Bruno Haible <bruno@clisp.org>
1206 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
1207 not on all platforms that have <wchar.h>.
1208 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
1210 2004-03-09 Paul Eggert <eggert@twinsun.com>
1212 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
1214 * getopt_int.h: New file, also synced from libc.
1216 2004-03-07 Paul Eggert <eggert@twinsun.com>
1218 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
1219 '#if' expressions. Unlike the code it replaces, it does not
1220 depend on (defined _SC_PAGESIZE). However, it does depend on
1221 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
1222 first reported by Jason Andrade in
1223 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
1225 2004-01-18 Simon Josefsson <jas@extundo.com>
1227 * strdup.h: New file.
1228 * strdup.c: Include it.
1229 * path-concat.c: Include strdup.h. Drop strdup declaration.
1230 * userspec.c: Include strdup.h. Drop strdup declaration.
1232 2004-02-06 Karl Berry <karl@gnu.org>
1234 * config.charset: update from gettext 0.14.1.
1236 2004-02-05 Paul Eggert <eggert@twinsun.com>
1238 Add comments and code, prompted by suggestions from Bruno Haible
1240 * quotearg.h (quotearg_alloc): New decl. Improve the comments
1241 describing the enum quoting_style values.
1242 * quotearg.c (quotearg_alloc): New function.
1243 (quotearg_buffer_restyled): Treat lone { and } as special.
1244 Treat = as special. Work around bug with older shells
1245 that "see" a '\' that is really the 2nd byte of a multibyte char.
1246 Quote empty string with shell_quoting_style.
1248 2004-02-03 Bruno Haible <bruno@clisp.org>
1250 * pipe.h: New file, from GNU gettext.
1251 * pipe.c: New file, from GNU gettext.
1253 2004-01-27 Bruno Haible <bruno@clisp.org>
1255 * execute.h: New file, from GNU gettext.
1256 * execute.c: New file, from GNU gettext.
1257 * w32spawn.h: New file, from GNU gettext.
1259 2004-01-23 Paul Eggert <eggert@twinsun.com>
1261 Exit-status fix from coreutils.
1263 Use exit_failure consistently in place of EXIT_FAILURE,
1264 so that program exit statuses are consistent on failure.
1266 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
1267 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
1268 * argmatch.h: Comment fix to match the above.
1269 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
1270 Now a macro referring to exit_failure, instead of a separate
1271 variable. Include "exitfail.h" to get it.
1272 * xstrtol.h: Include "exitfail.h".
1273 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
1275 * long-options.c (parse_long_options): Use prototype
1276 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
1279 2004-01-21 Jim Meyering <jim@meyering.net>
1281 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
1282 so as not to conflict with a different-sized __mktime_internal
1283 function in GNU libc.
1284 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
1285 Problem building statically-linked `ls' reported by Michael Brunnbauer.
1287 2004-01-18 Paul Eggert <eggert@twinsun.com>
1289 Merge from diffutils.
1291 * file-type.c (file_type): Add typed memory objects.
1292 * file-type.h (S_TYPEISTMO): New macro.
1294 * c-stack.h (c_stack_action): Remove argv argument.
1295 * c-stack.c (c_stack_action): Likewise. All uses changed.
1296 (die): Don't calculate message unless segv_action returns.
1297 (get_stack_location, min_address_from_argv, max_address_from_argv,
1298 volatile stack_base, volatile_stack_size): Remove.
1299 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
1300 that every segmentation violation is a stack overflow. (Ouch!)
1301 See Debian bug 136249 (still outstanding) for more info about why
1302 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
1304 2003-11-30 Bruno Haible <bruno@clisp.org>
1306 Safer stack allocation.
1307 * setenv.c: Include allocsa.h.
1308 (alloca): Remove fallback definition.
1309 (freea): Remove macro.
1310 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
1313 2003-10-17 Bruno Haible <bruno@clisp.org>
1315 * binary-io.h: Avoid warnings on Cygwin.
1317 2003-12-28 Bruno Haible <bruno@clisp.org>
1319 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
1320 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
1322 2003-11-28 Bruno Haible <bruno@clisp.org>
1324 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
1326 2003-11-27 Bruno Haible <bruno@clisp.org>
1328 * wait-process.c: On Windows, include windows.h. Needed on mingw.
1330 2003-11-17 Bruno Haible <bruno@clisp.org>
1332 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
1334 2003-11-24 Bruno Haible <bruno@clisp.org>
1336 * xallocsa.h: New file, from GNU gettext.
1337 * xallocsa.c: New file, from GNU gettext.
1339 2003-11-24 Bruno Haible <bruno@clisp.org>
1341 * allocsa.h: New file, from GNU gettext.
1342 * allocsa.c: New file, from GNU gettext.
1344 2003-11-24 Bruno Haible <bruno@clisp.org>
1346 * eealloc.h: New file.
1348 2004-01-15 Jim Meyering <jim@meyering.net>
1350 Merge from coreutils.
1352 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
1353 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
1354 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
1356 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
1357 optional configure-time default.
1359 * version-etc.c (version_etc_copyright): Update copyright date.
1361 * xreadlink.c (xreadlink): Correct outdated comment.
1363 2004-01-15 Paul Eggert <eggert@twinsun.com>
1365 Merge from coreutils.
1367 * posixver.c: Include posixver.h.
1369 * same.c: Include <stdbool.h>, <limits.h>.
1370 (_POSIX_NAME_MAX): Define if not defined.
1372 (same_name): If file names are silently truncated, report
1373 that the file names are the same if they are the same after
1374 the silent truncation.
1376 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
1377 conversion function.
1378 * xstrtod.c (xstrtod): Likewise. All callers changed to
1379 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
1382 2004-01-14 Paul Eggert <eggert@twinsun.com>
1384 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
1385 with like-named macro in fnmatch.c.
1386 (EXT): Use an internal constant instead.
1388 Merge fnmatch patches from glibc.
1389 * fnmatch.c (mbsinit): Remove define.
1390 Add libc_hidden_ver (__fnmatch, fnmatch).
1391 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
1392 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
1394 2003-12-14 Karl Berry <karl@gnu.org>
1396 * config.charset: update from gettext-runtime.
1398 2003-12-03 Paul Eggert <eggert@twinsun.com>
1400 * getgroups.c (getgroups): xmalloc takes one argument, not two.
1401 Bug reported by Alfred M. Szmidt.
1403 2003-11-29 Karl Berry <karl@gnu.org>
1405 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
1407 2003-11-23 Paul Eggert <eggert@twinsun.com>
1408 Bruno Haible <bruno@clisp.org>
1410 * printf-parse.h: Don't include sys/types.h.
1411 (ARG_NONE): New macro.
1412 (char_directive): Change type of *arg_index fields to size_t.
1413 * printf-parse.c: Don't include sys/types.h.
1414 (SSIZE_MAX): Remove macro.
1415 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
1416 Remove unnecessary overflow check.
1417 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
1420 2003-11-24 Paul Eggert <eggert@twinsun.com>
1422 * alloca.c: Remove dependency on xalloc module.
1423 (xalloc_die): Remove.
1424 (memory_full) [!defined emacs]: New macro.
1425 [!defined emacs]: Don't include xalloc.h.
1426 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
1427 address arithmetic overflows. Change datatypes a bit to avoid
1430 2003-11-22 Jim Meyering <jim@meyering.net>
1432 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
1434 2003-11-17 Bruno Haible <bruno@clisp.org>
1436 * vasnprintf.c (alloca): Remove fallback definition.
1437 (freea): Remove definition.
1438 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
1439 Reported by Paul Eggert.
1441 2003-11-17 Jim Meyering <jim@meyering.net>
1443 On systems without utime and without a utimes function capable of
1444 dealing with a NULL struct utimbuf* argument, this utime replacement
1445 could -- in unusual circumstances -- leak a file descriptor.
1446 * utime.c: Include <unistd.h> and <errno.h>.
1447 (utime_null): Be sure to close `fd' and to preserve errno.
1448 Reported by Geoff Collyer via Arnold Robbins.
1450 2003-11-16 Paul Eggert <eggert@twinsun.com>
1451 Bruno Haible <bruno@clisp.org>
1453 Protect against address arithmetic overflow.
1454 * printf-args.h: Include stddef.h.
1455 (arguments): Change type of field 'count' to size_t.
1456 * printf-args.c (printf_fetchargs): Use size_t instead of
1457 'unsigned int' where appropriate.
1458 * printf-parse.h: Include sys/types.h.
1459 (char_directive): Change type of *arg_index fields to ssize_t.
1460 (char_directives): Change type of fields 'count', max_*_length to
1462 * printf-parse.c: Include sys/types.h and xsize.h.
1463 (SSIZE_MAX): Define fallback value.
1464 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
1465 instead of 'int' where appropriate. Check a_allocated, d_allocated
1466 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
1467 * vasnprintf.c: Include xsize.h.
1468 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
1469 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
1470 overflow. Avoid wraparound when converting a width or precision from
1473 2003-11-16 Bruno Haible <bruno@clisp.org>
1475 Update from GNU gettext.
1476 * printf-parse.c: Generalize to it can be compiled for wide strings.
1477 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
1478 * vasnprintf.c: Generalize to it can be compiled for wide strings.
1479 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
1480 SNPRINTF): New macros.
1481 Don't include <alloca.h> if the file is used inside libintl.
1482 (local_wcslen): New function, for Solaris 2.5.1.
1483 (VASNPRINTF): Use it instead of wcslen.
1485 2003-11-16 Bruno Haible <bruno@clisp.org>
1487 * xsize.h (xmax): New function.
1488 (xsum, xsum3, xsum4): Declare as "pure" functions.
1490 2003-11-12 Paul Eggert <eggert@twinsun.com>
1492 * xalloc.h: Do not include <limits.h> or <stdint.h>.
1493 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
1494 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
1495 heuristic is just as accurate as far as we know, and it removes a
1496 dependency on size_max.m4 and ptrdiff_max.m4.
1498 2003-11-12 Paul Eggert <eggert@twinsun.com>
1500 * xstrtol.c (__xstrtol): Remove "break" immediately after
1501 "return", to pacify some unknown compiler. Problem reported
1504 2003-11-11 Bruno Haible <bruno@clisp.org>
1506 * xsize.h (SIZE_MAX): Remove fallback definition.
1507 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
1510 2003-11-10 Paul Eggert <eggert@twinsun.com>
1512 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
1513 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
1514 rejected some allocations of exactly SIZE_MAX - 2 bytes.
1516 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
1517 not (size_t) -1, since it's defined here.
1519 2003-11-06 Paul Eggert <eggert@twinsun.com>
1521 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
1522 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
1523 Reject sizes of exactly SIZE_MAX bytes.
1524 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
1525 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
1527 2003-11-05 Bruno Haible <bruno@clisp.org>
1529 * xsize.h: Include limits.h, to avoid a possible collision with
1530 SIZE_MAX defined in <limits.h> on Solaris.
1532 2003-11-04 Bruno Haible <bruno@clisp.org>
1534 * xsize.h: New file.
1535 * linebreak.c: Include xsize.h.
1536 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
1537 argument for overflow.
1538 Suggested by Paul Eggert.
1540 2003-10-31 Bruno Haible <bruno@clisp.org>
1542 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
1543 to avoid (extremely rare) race condition.
1544 Suggested by Paul Eggert.
1546 2003-11-03 Jim Meyering <jim@meyering.net>
1548 * userspec.c: Include "userspec.h".
1549 * userspec.h: New file.
1551 2003-10-31 Paul Eggert <eggert@twinsun.com>
1553 * mountlist.h (struct mount_entry.me_type_malloced): New member.
1554 * mountlist.c (SIZE_MAX): Define if not defined already.
1555 (read_filesystem_list): Set and use me_type_malloced.
1556 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
1557 whatever the type happens to be), for brevity and consistency.
1558 Check for size calculation overflow on Alphas running OSF/1.
1560 2003-10-31 Jim Meyering <jim@meyering.net>
1562 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
1564 * linebuffer.c: Include <string.h> for declaration of memset.
1566 2003-10-30 Paul Eggert <eggert@twinsun.com>
1567 Bruno Haible <bruno@clisp.org>
1569 * vasprintf.c: Include <limits.h>, <stdlib.h>.
1570 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
1572 2003-10-29 Paul Eggert <eggert@twinsun.com>
1574 * xalloc.h (xalloc_oversized): Now a macro, not a function,
1575 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
1577 * quotearg.c (quotearg_n_options): Use it.
1578 * group-member.c: Include <stdbool.h>.
1579 (free_group_info): Arg is now const *; don't free arg.
1580 (get_group_info): Now returns bool and accepts struct group_info *,
1581 rather than returning a malloc'ed struct group_info *.
1582 All uses changed. Check for overflow in internal size calculation.
1584 * getusershell.c (readname): Simplify the code by using x2nrealloc
1585 rather than xmalloc/xrealloc.
1586 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
1587 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
1588 conformance bug: the old code used a pointer after freeing the
1589 storage that it addressed.
1590 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
1591 rather than doing it by hand.
1592 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
1593 the buffer preserved. Use free and xmalloc instead.
1594 * quotearg.c (quotearg_n_options): Likewise.
1595 Use a simpler test for size overflow. Don't use xalloc_oversized
1596 because unsigned int might be wider than size_t (!); this suggests
1597 that we should switch from unsigned int to size_t for slot numbers.
1599 2003-10-27 Bruno Haible <bruno@clisp.org>
1601 * stdbool_.h: Better support for BeOS.
1603 2003-10-27 Paul Eggert <eggert@twinsun.com>
1605 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
1606 to allocate the returned structure. Do not allocate a subarray,
1607 as x2nrealloc will do that.
1608 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
1609 instead of xnrealloc.
1610 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
1612 2003-10-26 Paul Eggert <eggert@twinsun.com>
1614 * xalloc.h (xalloc_oversized): New static inline function, for
1615 callers that want to do their own size-overflow checking. Include
1616 <stdbool.h>, since xalloc_oversized returns bool.
1617 * xalloc.c (array_size_overflow): Remove. All callers changed
1618 to use xalloc_oversized.
1620 Add two functions x2realloc, x2nrealloc, for programs that grow
1621 arrays dynamically by doubling their sizes.
1622 * xalloc.h (x2realloc, x2nrealloc): New decls.
1623 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
1626 Port to C99 semantics for 'inline' of external functions.
1627 Bug reported by Bruno Haible.
1628 * xmalloc.c (xnmalloc_inline): New static inline function,
1629 with the old contents of xnmalloc.
1630 (xnmalloc, xmalloc): Use it.
1631 (xnrealloc_inline): New static inline function,
1632 with the old contents of xnrealloc.
1633 (xnrealloc, xrealloc): Use it.
1635 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
1637 2003-10-25 Paul Eggert <eggert@twinsun.com>
1639 Fix several address-calculation bugs in the hash modules,
1640 plus some minor code cleanup.
1642 * hash.h: Include <stdbool.h>, for bool.
1643 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
1644 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
1645 hash_get_n_entries, hash_get_max_bucket_length,
1646 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
1647 hash_rehash): Use size_t rather than unsigned.
1648 * hash.c (struct hash_table, hash_get_n_buckets,
1649 hash_get_n_buckets_used, hash_get_n_entries,
1650 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
1651 hash_get_entries, hash_do_for_each, hash_string, is_prime,
1652 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
1654 (SIZE_MAX): Define if not defined.
1655 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
1656 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
1658 Use const * when possible.
1659 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
1660 (check_tuning): Fix bug: if tuning parameters were very close to
1661 0 or 1, rounding errors could have caused subscript violations.
1662 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
1663 (hash_initialize): Add 'fail:' label
1664 to free table and return NULL, and use it to simplify code.
1665 Use calloc rather than clearing the storage ourself.
1666 (hash_initialize, hash_rehash): Check for arithmetic overflow in
1667 buffer size calculations.
1668 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
1669 Include <stddef.h>, for size_t.
1670 * hash-pjw.c (hash_pjw): Likewise.
1671 Switch to method described by Bruno Haible.
1672 Include <limits.h>, for CHAR_BIT.
1673 (SIZE_BITS): New macro.
1675 2003-10-21 Paul Eggert <eggert@twinsun.com>
1677 * getndelim2.c (getndelim2): When size calculation overflows,
1678 ceiling the allocation at NMAX bytes rather than silently
1679 discarding input bytes before NMAX is reached. This makes
1680 a difference only if NMAX exceeds SIZE_MAX / 2.
1682 * obstack.c: Merge from glibc.
1683 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
1684 Add libc_hidden_def (_obstack_newchunk).
1685 (_obstack_free) [! defined _LIBC]: Remove.
1686 [defined _LIBC]: Make a strong alias from obstack_free, rather than
1687 a clone of the function body.
1688 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
1689 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
1691 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
1692 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
1695 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
1696 (obstack_ptr_grow_fast, obstack_int_grow_fast):
1697 Don't use lvalue casts, as GCC plans to remove support for them
1698 in GCC 3.5. Reported by Joseph S. Myers. This bug
1699 was also present in the non-GCC version, indicating that this
1700 code had always been buggy and had never been widely used.
1701 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
1702 Use the fast variant of each macro, rather than copying the
1703 definiens of the fast variant; that way, we'll be more likely to
1704 catch future bugs in the fast variants.
1706 2003-10-20 Bruno Haible <bruno@clisp.org>
1708 * wait-process.h: New file, from GNU gettext.
1709 * wait-process.c: New file, from GNU gettext.
1711 2003-10-19 Jim Meyering <jim@meyering.net>
1713 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
1715 2003-10-16 Paul Eggert <eggert@twinsun.com>
1717 * getgroups.c: Include <errno.h>, <stdlib.h>.
1718 (getgroups): First arg is int, not size_t.
1719 Don't let 'free' mangle errno.
1721 2003-10-16 Jim Meyering <jim@meyering.net>
1723 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
1725 2003-10-15 Paul Eggert <eggert@twinsun.com>
1727 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
1729 (new_exclude, add_exclude_file): Initial size no longer needs to
1731 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
1732 our own address arithmetic overflow checking.
1734 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
1735 (fnmatch): Do not alloca more than 2000 wide characters;
1736 instead, use malloc for large buffers.
1737 Check for address arithmetic overflow, and return -1
1738 with errno set to ENOMEM in that case.
1739 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
1740 (NEW_PATTERN): Do not alloca more than 8000 bytes;
1741 instead, return -1. Check for address arithmetic overflow.
1743 2003-10-14 Paul Eggert <eggert@twinsun.com>
1745 Handle invalid suffixes and overflow independently, so that
1746 callers can treat them independently as needed. Fix some bugs in
1747 suffix handling, e.g., "100k@" was not diagnosed as an invalid
1748 suffix for a human-readable blocksize. The major caller-visible
1749 change is the addition of a new
1750 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
1751 that both overflow and suffix chars were found.
1753 * human.c (humblock): Don't check separately for invalid suffix
1754 char; that is xstrtoumax's job (now that its bug is fixed).
1755 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
1756 INTMAX_MAX]: New macros.
1757 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
1758 TYPE_MAXIMUM): New macros.
1759 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
1760 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
1761 if overflow occurs, as it's what __strtol does and it's more useful
1763 (__xstrtol): If __strtol reports some error other than ERANGE,
1764 reflect it to the caller as LONGINT_INVALID. If it reports
1765 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
1766 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
1767 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
1769 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
1770 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
1771 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
1772 [defined UINTMAX_MAX]: New macros.
1774 2003-10-14 Bruno Haible <bruno@clisp.org>
1776 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
1777 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
1778 Also use volatile where needed.
1780 2003-10-12 Paul Eggert <eggert@twinsun.com>
1782 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
1783 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
1784 and define in terms of the other primitives.
1785 * xmalloc.c: Include stdbool.h; do not include exit.h.
1786 (SIZE_MAX): Define if not already defined.
1787 (array_size_overflow): New function.
1788 (xalloc_die): Abort instead of exiting if 'error' returns.
1789 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
1790 (xmalloc, xrealloc): Use them.
1791 (xcalloc): Check for address arithmetic overflow.
1792 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
1793 a bit faster than strcpy.
1795 2003-10-08 Paul Eggert <eggert@twinsun.com>
1797 Merge getpass from libc, plus a few fixes.
1799 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
1800 Include <stdbool.h>.
1801 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
1802 __fsetlocking to empty.
1803 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
1804 do include <bits/libc-lock.h>.
1805 Do not include <fcntl.h>; not needed.
1806 [_LIBC]: Include <wchar.h>.
1807 (NOTCANCEL_MODE): New macro.
1808 (flockfile, funlockfile) [_LIBC]: New macros.
1809 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
1810 [!_LIBC]: New macros.
1811 (call_fclose): New function.
1812 (getpass): Use it. Save tty stream separately; this simplifies the
1813 code and makes it more reliable if stdin happens to equal stdout.
1814 Invoke __fsetlocking on tty.
1815 Handle thread cancellation if needed.
1816 Namespace cleanup (use __tcgetattr, __getline).
1817 Use bool for Booleans.
1818 [USE_IN_LIBIO]: Handle wide streams.
1819 [!_LIBC]: Unconditionally do the fseek, since we don't know what
1820 stream might go where.
1822 * unlocked-io.h: Include <stdio.h>, so that the caller
1823 doesn't have to include <stdio.h> before us.
1824 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
1825 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
1826 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
1827 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
1828 if not declared, so that we can use getpass.c code from libc without
1830 (flockfile, ftrylockfile, funlockfile): New macros.
1832 2003-10-06 Bruno Haible <bruno@clisp.org>
1834 * version-etc-2.h: Remove file.
1835 * version-etc-2.c: Remove file.
1837 2003-09-25 Jim Meyering <jim@meyering.net>
1838 Bruno Haible <bruno@clisp.org>
1840 This lets translators provide better translations for the
1841 "Written by ..." part of --version output.
1842 * version-etc.h: Include stdarg.h.
1843 (version_etc_copyright): Declare as readonly.
1844 (version_etc): Make this function variadic with a NULL-terminated list
1845 of author name strings.
1846 (version_etc_va): New declaration.
1847 * version-etc.c: Include stdarg.h, stdlib.h.
1848 (version_etc_copyright): Declare as readonly.
1849 (version_etc_va): New function. Provide a different translatable string
1850 for each possible number of authors < 10. Abbreviate when there are 10
1852 (version_etc): Make this function variadic. Call version_etc_va.
1853 Suggestion from Gary V. Vaughan.
1855 * long-options.h (parse_long_options): Change prototype: the authors
1856 string is moved to the end and becomes variadic.
1857 * long-options.c: Include stdarg.h.
1858 (parse_long_options): Make this function variadic, too.
1859 Call version_etc_va, not version_etc.
1861 2003-10-06 Bruno Haible <bruno@clisp.org>
1863 * fatal-signal.h: New file, from GNU gettext.
1864 * fatal-signal.c: New file, from GNU gettext.
1866 2003-10-04 Karl Berry <karl@gnu.org>
1868 * argp*: update from libc.
1870 2003-10-01 Larry Jones <lawrence.jones@eds.com>
1872 * getpass.c (getpass): Use a no-op fseek when switching from input to
1873 output mode on the same stream.
1875 2003-09-29 Paul Eggert <eggert@twinsun.com>
1877 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
1878 Fix arg typo in previous patch.
1880 2003-09-28 Jim Meyering <jim@meyering.net>
1882 * error.c: Correct cpp indentation.
1884 2003-09-27 Paul Eggert <eggert@twinsun.com>
1886 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
1887 Omit the special code that used __typeof__, since we worry that
1888 it could be more trouble than it's worth. See:
1889 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
1890 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
1894 2003-09-26 Jim Meyering <jim@meyering.net>
1896 * error.c (error_tail): Move some declarations
1897 into inner scope where the local variables are used.
1899 2003-09-26 Bruno Haible <bruno@clisp.org>
1901 * stpncpy.h (gnu_stpncpy): New declaration.
1902 (stpncpy): Define as alias for gnu_stpncpy.
1903 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
1905 2003-09-26 Paul Eggert <eggert@twinsun.com>
1907 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
1908 (error_tail): Do not loop, reallocating temporary buffer, since
1909 the output cannot contain more wide characters than the input
1910 contains bytes, the size must be big enough already. This avoids
1911 one potential size overflow calculation. Check for size overflow
1912 when calculating temporary buffer size. Free temporary buffer
1913 when done, if it was allocated with malloc; this plugs a memory
1914 leak. Remove casts from void * to pointers, that are no longer
1915 needed now that we're assuming C89 or better.
1917 Merge error changes from glibc.
1919 * error.c, error.h: Update copyright notice header to match glibc.
1920 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
1921 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
1922 Disable cancellation while printing error.
1923 * error.h: Prepend __ to parameter names.
1925 2003-09-25 Karl Berry <karl@gnu.org>
1927 * argp-fmtstream.c, argp-help.c: update from libc.
1929 2003-09-25 Bruno Haible <bruno@clisp.org>
1931 * version-etc-2.h: New file, from version-etc.h with modifications.
1932 * version-etc-2.c: New file, from version-etc.c with modifications.
1934 2003-09-25 Simon Josefsson <jas@extundo.com>
1936 * xgetdomainname.h: New file.
1937 * xgetdomainname.c: New file.
1939 2003-09-25 Simon Josefsson <jas@extundo.com>
1940 Bruno Haible <bruno@clisp.org>
1942 * getdomainname.h: New file.
1943 * getdomainname.c: New file.
1945 2003-09-24 Paul Eggert <eggert@twinsun.com>
1947 * linebuffer.c (freebuffer): Don't free the argument, just
1948 the buffer associated with the argument. Bug reported by
1951 2003-09-19 Karl Berry <karl@gnu.org>
1953 * argp.h: update from libc.
1955 2003-09-16 Paul Eggert <eggert@twinsun.com>
1957 * linebuffer.c (readlinebuffer): Return NULL immediately upon
1958 input error, instead of returning NULL the next time we are called
1959 (and therefore losing track of errno).
1961 2003-09-15 Paul Eggert <eggert@twinsun.com>
1963 * getndelim2.c (getndelim2): Don't trash errno when a read
1964 fails, so that the caller gets the proper errno.
1966 * readutmp.c (read_utmp): Likewise.
1967 Check for fstat error. Close stream and free storage
1970 2003-09-14 Bruno Haible <bruno@clisp.org>
1972 * fwriteerror.h: New file.
1973 * fwriteerror.c: New file.
1975 2003-09-14 Jim Meyering <jim@meyering.net>
1977 * getloadavg.c: Correct cpp indentation.
1978 * strdup.c: Likewise.
1979 * vasnprintf.c: Likewise.
1981 2003-09-12 Paul Eggert <eggert@twinsun.com>
1983 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
1984 * obstack.c [!defined _LIBC]: Likewise.
1985 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
1986 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
1987 * exitfail.c: Don't include stdlib.h; no longer needed.
1989 More changes to assume C89 or better.
1991 * error.c (error_tail): Assume vprintf.
1993 * argmatch.c (getenv): Remove decl.
1994 * progreloc.c (get_full_program_name): Define via prototype.
1995 * setenv.c (clearenv): Likewise.
1996 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
1998 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
1999 (malloc, memcpy): Remove decls.
2000 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
2001 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
2002 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2003 (memcpy): Remove macro.
2004 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
2005 (__P): Remove. All uses removed.
2006 (PTR): Remove. All uses changed to void *.
2007 (CHAR_BIT, NULL): Remove.
2008 (spaces, zeros, memset_space, memset_zero)
2009 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
2011 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
2012 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
2013 Define with prototype.
2014 Remove now-unnecessary prototype decl.
2015 (extra_args_spec): Assume ANSI C. All uses changed.
2016 (extra_args_spec_iso): Remove.
2017 (my_strftime, emacs_strftimeu): Define via prototype.
2018 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
2020 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
2021 * strtoimax.c: Include <stdlib.h> unconditionally.
2022 (strtoul, strtol): Remove decls.
2023 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
2025 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2026 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
2027 (LOCALE_PARAM_PROTO): New macro.
2028 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
2029 (INTERNAL (strtol), strtol): Define with a prototype.
2030 (PARAMS): Remove. All uses removed.
2031 * tempname.c: Include <string.h> unconditionally.
2032 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
2033 * xgethostname.c (main): Define with a prototype.
2034 * xmalloc.c: Include "xalloc.h" first, to check interface.
2035 Include <stdlib.h> unconditionally.
2036 (calloc, malloc, realloc, free): Remove decls.
2037 * xstrtod.c: Include "xstrtod.h" first, to check interface.
2038 Include <stdlib.h> unconditionally. Sort include file names.
2040 (xstrtod): Define with a prototype.
2041 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
2042 (strtol, strtoul): Remove decls.
2044 2003-09-11 Paul Eggert <eggert@twinsun.com>
2046 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
2047 Include <stdlib.h>, <string.h> unconditionally.
2048 Remove now-unnecessary cast to char *.
2049 * strnlen.c: Include <string.h> unconditionally.
2050 * yesno.c (yesno): Define with a prototype.
2052 2003-09-10 Bruno Haible <bruno@clisp.org>
2054 * strcspn.c: Include <string.h> unconditionally.
2055 * strpbrk.c: Include <string.h> unconditionally.
2056 * strstr.c: Include <string.h> unconditionally.
2057 * unicodeio.c: Include <string.h> unconditionally.
2058 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
2059 * unsetenv.c: Likewise.
2060 * xreadlink.c: Include <stdlib.h> unconditionally.
2061 * yesno.c: Include <stdlib.h> unconditionally.
2062 (rpmatch): Add prototype.
2064 2003-09-10 Jim Meyering <jim@meyering.net>
2066 * error.c: Correct indentation of cpp directives.
2068 2003-09-09 Paul Eggert <eggert@twinsun.com>
2072 * acosl.c (main): Use a prototype.
2073 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
2076 * getloadavg.c (getloadavg, main): Define via prototypes.
2078 * getopt.h (struct option.name): Assume C89, and use 'const'.
2079 (getopt, etopt_long, getopt_long_only, _getopt_internal)
2080 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
2082 * getopt.c (const): Remove macro.
2083 Include <string.h> unconditionally.
2084 (my_index): Remove; all uses changed to strchr.
2085 (strlen): Remove decl.
2086 (exchange): Remove forward decl; no longer needed.
2087 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
2088 Define with prototype.
2089 * getopt1.c (const): Remove macro.
2090 (getopt_long, getopt_long_only, main): Define with prototype.
2092 * getugroups.c: Include <string.h> unconditionally.
2094 * getusershell.c: Include <stdlib.h> unconditionally.
2095 (getusershell, setusershell, endusershell, readname, main):
2096 Define with prototypes.
2098 * group-member.c: Include group-member.h first.
2099 Include <stdlib.h> unconditionally.
2101 * hard-locale.c: Include hard-locale.h first.
2102 Include <stdlib.h>, <string.h> unconditionally.
2104 * hash.c (free, malloc): Remove decls.
2105 Include <stdlib.h> unconditionally.
2107 * human.c: Include <stdlib.h>, <string.h> unconditionally.
2108 (getenv): Do not declare.
2110 * idcache.c: Include <string.h> unconditionally.
2112 * long-options.c: Include long-options.h first, to test interface.
2113 Include <stdlib.h> unconditionally.
2115 * makepath.c: Include makepath.h first, to test interface.
2116 Include <stdlib.h> and <string.h> unconditionally.
2118 * linebuffer.c: Include <stdlib.h>.
2119 (free): Remove decl.
2121 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
2122 rpl_malloc returns void *, not char *.
2123 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
2125 * md5.h: Include <limits.h> unconditionally.
2126 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
2127 (__P): Remove; all uses removed.
2128 * md5.c: Include "md5.h" first.
2129 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
2130 md5_buffer, md5_process_bytes, md5_process_block):
2131 Define with prototypes.
2132 * sha.h (__P): Remove all uses. (It wasn't defined??)
2133 * sha.c: Include "sha.h" first.
2134 Include <stdlib.h>, <string.h> unconditionally.
2136 * memchr.c (__ptr_t): Remove; all uses changed to void *.
2137 * memcmp.c (__ptr_t): Likewise.
2138 * memrchr.c (__ptr_t): Likewise.
2139 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
2140 Include <string.h> unconditionally.
2141 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
2142 * memchr.c: Include <stdlib.h> unconditionally.
2143 * memchr.c (LONG_MAX): Remove.
2144 * memrchr.c (LONG_MAX): Likewise.
2145 * memchr.c (__memchr): Define via a prototype.
2146 * memrchr.c (__memrchr): Likewise.
2147 * memcmp.c (__P): Remove, and remove all uses.
2148 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
2149 Remove forward decls; no longer needed.
2150 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
2151 Use types required by C89 in prototype.
2153 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
2154 * savedir.c: Likewise.
2155 * mkdir.c (free): Remove decl.
2156 * rmdir.c (rmdir): Define with a prototype.
2157 * savedir.c: Include savedir.h first, to test interface.
2159 * mktime.c (STDC_HEADERS): Remove.
2160 Include <stdlib.h>, <string.h> unconditionally.
2162 * modechange.c: Include <stdlib.h> unconditionally.
2163 (malloc): Remove decl.
2165 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
2166 (free): Remove decl.
2168 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
2169 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
2170 (This type really should be intptr_t, but that's a C99ism.)
2171 (_obstack_memcpy): Remove: all uses changed to memcpy.
2172 Include <string.h> unconditionally.
2173 (struct obstack): Assume __STDC__ for types of members
2174 chunkfun, freefun, extra_arg.
2175 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
2176 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
2177 obstack_begin, obstack_specify_allocation,
2178 obstack_specify_allocation_with_arg, obstack_chunkfun,
2179 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
2180 Remove unprototyped decls and the macros that use them.
2181 * obstack.c (POINTER): Remove. All uses changed to void *.
2182 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
2183 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
2184 (defined __STDC__ && __STDC__)]:
2185 Remove nonprototyped code.
2186 Include <stdlib.h> unconditionally.
2187 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
2188 _obstack_allocated_p, _obstack_free, obstack_free,
2189 _obstack_memory_used, print_and_abort):
2190 Define using prototypes.
2191 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
2192 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
2193 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
2194 obstack_next_free, obstack_object_size, obstack_room) [0]:
2195 Remove unused, unprototyped code.
2197 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
2199 * physmem.c (physmem_total, physmem_available, main): Define
2202 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
2203 (main): Define with a prototype.
2205 * posixver.c (getenv): Remove decl.
2207 * putenv.c (malloc): Returns void *, not char *.
2208 Include <string.h> unconditionally.
2209 (strchr, memcpy, NULL): Do not define.
2211 * readtokens.c: Include readtokens.h first, to test interface.
2212 Include <stdlib.h>, <string.h> unconditionally.
2213 (init_tokenbuffer): Define with a prototype.
2215 * regex.c (PARAMS): Remove. All uses removed.
2216 All uses of _RE_ARGS removed, too.
2217 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2219 (bzero): Assume memset exists.
2220 (memcmp, memcpy, NULL): Remove.
2221 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
2222 char, or assignments to local vars of type signed char.
2223 (init_syntax_once, PREFIX(extract_number_and_incr),
2224 PREFIX(print_partial_compiled_pattern),
2225 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
2226 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
2227 PREFIX(regex_grow_registers), PREFIX(regex_compile),
2228 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
2229 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
2230 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
2231 wcs_compile_range, byte_compile_range, truncate_wchar,
2232 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
2233 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
2234 count_mbs_length, wcs_re_match_2_internal,
2235 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
2236 PREFIX(alt_match_null_string_p),
2237 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
2238 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
2239 regfree, PREFIX(extract_number)): Define with prototype. Remove
2240 now-unnecessary declaration, if any.
2241 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
2243 Remove now-unnecessary casts among pointer types.
2244 * regex.h (_RE_ARGS): Remove. All uses removed.
2246 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
2247 (free): Remove decl.
2249 * rpmatch.c: Include <stdlib.h> unconditionally.
2251 * same.c: Include <stdlib.h>, <string.h> unconditionally.
2252 (free): Remove decl.
2254 * save-cwd.c: Include <stdlib.h> unconditionally.
2255 * xgetcwd.c: Likewise.
2257 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
2258 (free): Remove decl.
2260 * strchrnul.c (strchrnul): Define with a prototype.
2261 Fix bug: c_in was not converted to char before searching.
2263 The following changes are not K&R related:
2265 * group-member.h: Include <sys/types.h>, so that this file is
2267 * makepath.h: Likewise.
2269 * getusershell.c (readname, default_index, line_size, readname):
2270 Use size_t, not int, for sizes.
2271 (readname): If the size overflows, report an error instead of
2274 2003-09-09 Derek Robert Price <derek@ximbiot.com>
2276 * getndelim2.c: Assume stdlib.h per the C89 spec.
2278 2003-09-08 Paul Eggert <eggert@twinsun.com>
2280 Assume C89 or better; remove K&R cruft.
2281 A few of these changes were first proposed by Derek Robert Price
2282 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
2284 * addext.c: Include <string.h> unconditionally.
2285 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
2286 Don't declare getenv or malloc.
2288 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
2289 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
2291 (find_stack_direction, alloca): Use prototypes.
2293 * atexit.c (atexit): Define using a prototype.
2295 * basename.c, dirname.c, stripslash.c:
2296 Include <string.h> unconditionally.
2298 * bcopy.c: Include <stddef.h>.
2299 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
2301 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
2303 * error.h (error, error_at_line, error_print_progname)
2304 [! (defined (__STDC__) && __STDC__)]: Remove decls.
2305 * error.c: Include error.h first, to check interface.
2306 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
2307 (VA_START): Remove; all uses changeed to va_start.
2308 (exit, strerror): Remove decls.
2309 (error_print_progname): Prototype uncondionally.
2310 Don't include <errno.h>; no longer needed.
2311 (private_strerror): Remove.
2312 (error_tail): Always define.
2313 (error, error_at_line): Assume C89 or better; always use prototypes.
2314 * fatal.c: Include "fatal.h" first, to test interface.
2315 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
2316 (VA_START): Remove; all uses changed to va_start.
2317 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
2319 (exit): Remove decl.
2320 (fatal): Prototype unconditionally. Assume va_start works.
2321 Abort at end, to pacify gcc.
2323 * euidaccess.c (main): Define with a prototype.
2325 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
2327 * exitfail.c: Include <stdlib.h> unconditionally.
2329 * fnmatch_.h (__P): Remove. All uses changed to assume
2331 * fnmatch.c: Include fnmatch.h first, to test interface.
2332 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
2333 (getenv): Remove decl.
2334 (fnmatch): Define using a prototype.
2335 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
2336 (FCT): Define using a prototype.
2338 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
2340 * gethostname.c: Include <stddef.h>.
2341 (gethostname): Define with prototype. Length is size_t, not int.
2343 2003-09-08 Paul Eggert <eggert@twinsun.com>
2345 * getversion.c: Remove; was migrated to backupfile.c in 1997.
2346 getversion.c should have been removed then, but was accidentally
2349 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
2350 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
2352 2003-09-07 Paul Eggert <eggert@twinsun.com>
2354 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
2355 copy_tm_result. Bug reported by Simon Josefsson in
2356 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
2358 2003-09-06 Paul Eggert <eggert@twinsun.com>
2360 * time_r.c, time_r.h: New files.
2362 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
2364 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
2365 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
2367 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
2369 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
2370 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
2373 * timegm.c: Switch to glibc implementation, with the following changes:
2374 [defined HAVE_CONFIG_H]: Include <config.h>.
2375 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
2376 (__mktime_internal) [!defined _LIBC]: New decl.
2377 (__gmtime_r) [!defined _LIBC]: New macro and function.
2378 (timegm): Use a prototype, since gnulib assumes C89.
2379 Do not bother declaring tmp to be const, as it's not really usefu.
2380 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
2381 (timegm): Declare only if HAVE_DECL_TIMEGM.
2383 2003-09-03 Paul Eggert <eggert@twinsun.com>
2385 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
2386 Bug reported by Lute Kamstra in
2387 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
2389 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
2390 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
2391 course with correspondingly smaller numbers for tomorrow and
2392 yesterday. From Tadayoshi Funaba. Originally installed into
2393 sh-utils on 1999-08-07, but the patch got lost (I guess during the
2396 2003-08-31 Simon Josefsson <jas@extundo.com>
2398 * timegm.h: New file.
2399 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
2401 2003-08-31 Karl Berry <karl@gnu.org>
2403 * argp.h: update from libc.
2405 2003-08-28 Bruno Haible <bruno@clisp.org>
2407 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
2408 warning on QNX, which defines O_BINARY to 000000.
2410 2003-08-24 Bruno Haible <bruno@clisp.org>
2412 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
2413 MSVC7 <stdio.h> is included later.
2415 2003-08-20 Bruno Haible <bruno@clisp.org>
2417 * progname.h: New file, from GNU gettext.
2418 * progname.c: New file, from GNU gettext.
2419 * progreloc.c: New file, from GNU gettext.
2421 2003-08-19 Bruno Haible <bruno@clisp.org>
2423 * xstrdup.c: Assume <string.h> exists.
2425 2003-08-18 Jim Meyering <jim@meyering.net>
2427 * setenv.h: Indent nested cpp directive.
2428 * vasnprintf.c: Remove trailing blanks.
2430 2003-08-17 Simon Josefsson <jas@extundo.com>
2431 Bruno Haible <bruno@clisp.org>
2433 * xstrndup.h: New file.
2434 * xstrndup.c: New file.
2436 2003-08-17 Bruno Haible <bruno@clisp.org>
2438 * strndup.h: New file.
2440 2003-08-16 Paul Eggert <eggert@twinsun.com>
2442 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
2443 space, undoing this 2003-08-12 change:
2444 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
2446 2003-08-16 Jim Meyering <jim@meyering.net>
2448 Merge from coreutils.
2449 * xstrtoimax.c: #else #if -> #elif.
2450 * xstrtoumax.c: Likewise.
2452 2003-08-15 Paul Eggert <eggert@twinsun.com>
2454 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
2455 rather than tab, after '#' in shell-script copyright notices.
2456 Suggested by Bruno Haible.
2458 2003-08-15 Jim Meyering <jim@meyering.net>
2459 and Paul Eggert <eggert@twinsun.com>
2461 Merge from coreutils.
2462 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
2463 member but strut utmpx does not. Needed for AIX 4.3.3.
2464 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
2466 2003-08-15 Jim Meyering <jim@meyering.net>
2468 Merge from coreutils.
2469 * xgethostname.c: Include <stdlib.h>.
2470 (xghostname): Don't exit for anything other than memory-related
2471 failure; just return NULL.
2472 * userspec.c: Include "posixver.h".
2473 (parse_user_spec): Accept `.' as a separator only
2474 in pre-POSIX-200112 mode.
2475 * strtoimax.c: Use #elif rather than #else #if.
2476 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
2477 Remove function, now that we can rely on a working tzset function.
2478 [!_LIBC]: Ensure that the required autoconf test has been run.
2479 [!defined _NL_CURRENT && HAVE_STRFTIME]:
2480 Use underlying_strftime for %r.
2481 * sha.c: Merge in some clean-up and optimization changes from glibc.
2482 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
2483 Ensure that it is a multiple of 64.
2484 Rearrange loop exit tests so as to avoid performing an
2485 additional fread after encountering an error or EOF.
2486 * realloc.c: Update copyright date.
2488 2003-08-14 Jim Meyering <jim@meyering.net>
2490 Merge from coreutils.
2491 * obstack.h: Whitespace changes.
2492 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
2493 and xcalloc return values.
2494 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
2495 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
2496 hang on OSF/1 5.1 for DIR on both local and remote file systems.
2497 Reported by (and fix confirmed by) Nelson H. F. Beebe.
2498 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
2500 Use mntctl's return value to drive the entry-processing loop, since
2501 we can't rely on the value of the vmt_length member in the last
2502 entry. On some systems doing so could result in exhausting
2503 virtual memory. Based in part on a patch from Mike Jetzer.
2505 2003-08-14 Jim Meyering <jim@meyering.net>
2506 and Paul Eggert <eggert@twinsun.com>
2508 Merges from coreutils, plus other fixes.
2509 * physmem.c: Merge in portability changes from gcc/libiberty
2510 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
2511 for credits and details. Thanks to Kaveh Ghazi for helping
2512 to keep these files in sync.
2513 (ARRAY_SIZE): Define it.
2514 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
2515 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
2516 (memcasecmp): Don't assume size_t fits in unsigned int.
2517 Remove casts and duplicate code.
2518 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
2519 (memcpy): Remove definition.
2520 Merge in some clean-up and optimization changes from glibc.
2521 [BLOCKSIZE]: Move definition to top of file.
2522 Ensure that it is a multiple of 64.
2523 Rearrange loop exit tests so as to avoid performing an
2524 additional fread after encountering an error or EOF.
2525 * md5.h (md5_uintptr): Define.
2526 * makepath.c (CLEANUP_CWD): Report an error if we failed to
2527 return to the initial working directory. Preserve errno
2529 * idcache.c: Include "xalloc.h".
2530 (xmalloc, xrealloc): Remove decls.
2531 (getuser): Remove casts no longer required in C89.
2532 * human.c: Include stdio.h, for sprintf.
2533 * group-member.c: Include "xalloc.h".
2534 (xmalloc, xrealloc): Remove decls.
2535 (get_group_info): Remove casts no longer required in C89.
2536 * getusershell.c (readname): Remove casts no longer required in C89.
2537 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
2538 * getline.c: Whitespace fix, from coreutils.
2540 2003-08-13 Paul Eggert <eggert@twinsun.com>
2542 * exclude.c: Include <ctype.h>
2543 (IN_CTYPE_DOMAIN): New macro.
2545 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
2548 * argp-help.c, argp-parse.c, config.charset, getopt.h:
2549 Undo previous (whitespace-only) change.
2551 2003-08-12 Paul Eggert <eggert@twinsun.com>
2553 * argp-help.c, argp-parse.c, config.charset, getopt.h:
2554 Normalize leading white space and remove trailing white space.
2555 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
2556 notice, as per ../config/srclist-update.
2558 Merge from coreutils.
2559 * euidaccess.h: New file.
2560 * euidaccess.c: Include it.
2561 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
2562 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
2563 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
2565 2003-08-11 Bruno Haible <bruno@clisp.org>
2567 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
2568 (vasnprintf): Use it instead of wcslen.
2570 2003-08-11 Bruno Haible <bruno@clisp.org>
2572 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
2573 value to ensure that _Bool promotes to int. Use #define for _Bool when
2574 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
2576 2003-08-10 Karl Berry <karl@gnu.org>
2578 * regex.h: update from libc (whitespace fix).
2580 2003-08-09 Paul Eggert <eggert@twinsun.com>
2582 Merge some files from coreutils. These changes were
2583 originally made by Jim Meyering.
2584 * acl.c: Include <sys/types.h> before <sys/stat.h>;
2585 many older Unixes require this.
2586 * alloca.c (alloca): Remove cast to argument of free;
2587 no longer needed in C89.
2588 * alloca_.h, regex.h: Fix white space to match
2589 what GNU indent does.
2591 2003-08-05 Paul Eggert <eggert@twinsun.com>
2593 * bumpalloc.h: Remove.
2595 2003-08-04 Paul Eggert <eggert@twinsun.com>
2597 * getloadavg.c: Change copyright notice and spacing to conform to
2600 Merge from coreutils.
2601 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
2603 * getdate.y (date): Also accept dates like May-23-2003; suggestion
2604 from Karl Berry, implemented by Jim Meyering.
2605 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
2606 from Dmitry V. Levin.
2607 Remove anachronistic cast of xrealloc.
2608 * fnmatch_.h (__const): Remove. Use 'const'.
2609 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
2610 type. Otherwise, it wouldn't compile with at least /bin/cc on
2611 ymp-cray-unicos9.0.2.X.
2612 Combine two mostly-identical uses of alloca into one.
2613 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
2615 2003-08-04 Dave Love <d.love@dl.ac.uk>
2619 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
2620 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
2621 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
2622 obsolete NLIST_NAME_UNION.
2623 [__GNU__]: Undef BSD and FSCALE.
2624 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
2626 2003-08-03 Paul Eggert <eggert@twinsun.com>
2628 * stdbool_.h (_Bool): Make it signed char, instead of
2629 an enum type, so that it's guaranteed to promote to int. See:
2630 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
2632 2003-07-31 Paul Eggert <eggert@twinsun.com>
2634 * strerror.c: Include config.h, limits.h. Declare sprintf.
2635 (strerror): Don't assume that a printable int fits in 14 bytes.
2637 2003-07-24 Derek Robert Price <derek@ximbiot.com>
2638 Bruno Haible <bruno@clisp.org>
2640 * getline.h (getline, getdelim): Change return type to ssize_t.
2641 * getline.c (getline, getdelim): Likewise.
2642 Remove _GNU_SOURCE define; now it's defined in config.h through
2645 2003-07-22 Paul Eggert <eggert@twinsun.com>
2647 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
2648 over-parenthesization in macros.
2650 Sync with coreutils.
2652 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
2655 Use `exit_failure' for xalloc and xmemcoll instead of their own
2656 private exit-failure variables.
2657 * xalloc.h (xalloc_exit_failure): Remove.
2658 * xmalloc.c: Likewise. Include exitfail.h.
2659 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
2660 * xmemcoll.h (xmemcoll_exit_failure): Remove.
2661 * xmemcoll.c: Likewise. Include exitfail.h.
2662 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
2664 2003-07-18 Paul Eggert <eggert@twinsun.com>
2666 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
2667 * closeout.c: Likewise. Include "closeout.h" right after config.h,
2668 to test that it can stand by itself. Include "exitfail.h".
2669 Clients should set exit_failure instead.
2670 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
2672 2003-07-18 Andreas Schwab <schwab@suse.de>
2674 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
2676 2003-07-18 Bruno Haible <bruno@clisp.org>
2678 * getndelim2.h: New file.
2679 * getndelim2.c: Make into a module of its own. Include config.h,
2681 (getndelim2): Make non-static. Change return type to ssize_t.
2682 * getline.h: Change argument names.
2683 * getline.c: Include getndelim2.h instead of getndelim2.c.
2684 * getnline.c: Include getndelim2.h.
2686 2003-07-17 Bruno Haible <bruno@clisp.org>
2688 * Makefile.am: Remove file.
2689 * Makefile.in: Remove file.
2691 2003-07-17 Bruno Haible <bruno@clisp.org>
2693 * getnline.h: New file.
2694 * getnline.c: New file.
2695 * getndelim2.c: New file, extracted from getline.c.
2696 (getndelim2): Renamed from getdelim2, with added nmax argument.
2697 * getline.c: Include getndelim2.c.
2698 (getdelim2): Moved out to getndelim2.c.
2699 (getline, getdelim): Update.
2701 2003-07-15 <karl@gnu.org>
2703 * vasnprintf.c: update from gettext.
2705 2003-07-15 Jim Meyering <jim@meyering.net>
2707 * makepath.c (make_path): Enclose diagnostic in _(...).
2709 2003-07-14 Paul Eggert <eggert@twinsun.com>
2711 * asnprintf.c, asprintf.c, config.charset, gettext.h,
2712 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
2713 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
2714 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
2715 vasprintf.c, vasprintf.h: Regenerate. These files are now being
2716 updated automatically by ../config/srclist-update. This changes
2717 their license from LPGL to GPL.
2719 2003-07-14 Jim Meyering <jim@meyering.net>
2721 Don't emit diagnostics. Let callers do that.
2722 * save-cwd.c: Don't include "error.h".
2723 (save_cwd): Don't call error. Ensure that errno is valid
2724 when returning nonzero.
2726 * save-cwd.h (restore_cwd): Update prototype.
2727 * save-cwd.c (restore_cwd): Remove two parameters.
2728 Simplify. Don't call error upon failure. Let callers do that.
2729 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
2730 when auditing is enabled. But don't bother updating the #if.
2732 2003-07-14 Simon Josefsson <jas@extundo.com>
2734 * mempcpy.h: New file.
2735 * mempcpy.c: New file.
2737 2003-07-14 Paul Eggert <eggert@twinsun.com>
2739 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
2740 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
2741 unicodeio.c, unicodeio.h, unlocked-io.h:
2742 Switch from LGPL to GPL.
2744 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
2746 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
2747 it breaks C++ compilation.
2748 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
2750 2003-07-10 Jim Meyering <jim@meyering.net>
2752 * vasnprintf.c: Remove trailing blanks.
2753 Make cpp indentation consistent.
2755 2003-07-09 Paul Eggert <eggert@twinsun.com>
2757 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
2758 posixver.c, strftime.c, strnlen.c, strverscmp.c:
2759 Switch from LGPL to GPL.
2761 2003-07-07 Paul Eggert <eggert@twinsun.com>
2763 * mktime.c: Fix some boundary cases and remove need for floating point.
2765 Issue a compile-time diagnostic if time_t is floating point, or if
2766 two's complement arithmetic is not in effect, or if arithmetic
2767 right shift does not propagate the sign. These assumptions were
2768 all in the original code but they weren't checked.
2770 (TIME_T_MIDPOINT, verify): New macros.
2771 (__isleap): Remove; it has integer overflow problems.
2772 (leapyear): New function, without those problems.
2773 (ydhms_tm_diff): Remove; splitting into two parts.
2774 (ydhms_diff): New function, containing the arithmetic part of
2775 the old ydhms_tm_diff function. Issue a compile-time
2776 diagnostic if we are not using C99 integer division.
2777 Avoid casts when possible.
2778 (guess_time_tm): New function, containing the checking part of
2779 the old ydhms_tm_diff function. Return the new value, rather than
2780 the difference between it and the old. Accept a new argument T
2781 so that *T specifies the old value. Check for overflow in the result.
2783 (__mktime_internal): Use a time_t offset, not a long int offset.
2784 This undoes the 2003-06-04 change, which is no longer needed now
2785 that we have better overflow checking.
2786 (localtime_offset): Likewise.
2788 (__mktime_internal): Avoid harmful overflow on hosts where time_t
2789 and long are 64-bit but int is only 32-bit.
2790 (ydhms_diff): Use long int to store year1 and yday1.
2791 Issue a compile-time diagnostic if long int is not wide enough.
2793 (__mktime_internal): Use long int to store adjusted year and yday.
2794 Use plain C rather than preprocessor commands, if that doesn't
2796 Check for overflow (and try to repair) after each probe
2797 rather than checking only at the very end. This avoids some bugs
2798 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
2799 does not equal GMT offset at maximum time).
2800 Use integer to check for overflow rather than floating point; this
2801 is more portable to non-IEEE hosts, and is a tad faster.
2802 When we detect that we are oscillating between two values,
2803 don't check whether tm_isdst has the requested value, since
2804 we already know the answer. When tm_isdst has the wrong value,
2805 use a different heuristic to find the right one, based on the
2806 extreme values actually observed in practice in tz2003a,
2807 rather than the (overly optimistic) "previous 3 calendar quarters".
2809 (not_equal_tm, print_tm, check_result): Use "const T" rather than
2810 "T const" to accommodate glibc style.
2811 (check_result): Use less-confusing report format. "long" -> "long int.
2813 Don't loop if the iteration overflows time_t.
2814 Allow a negative step in the iteration.
2816 2003-07-01 Paul Eggert <eggert@twinsun.com>
2818 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
2819 having it depend on HAVE_SYS_TYPES_H.
2821 2003-06-25 Bruno Haible <bruno@clisp.org>
2823 * readlink.c: New file.
2825 2003-06-20 Bruno Haible <bruno@clisp.org>
2827 Assume C89, so PARAMS isn't needed.
2828 * unicodeio.h (PARAMS): Remove.
2829 * unicodeio.c: Don't use PARAMS.
2831 2003-06-18 Jim Meyering <jim@meyering.net>
2833 Merge changes from coreutils.
2834 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
2835 Remove explicit declarations of xmalloc and realloc.
2837 (read_utmp): Remove anachronistic cast of xmalloc.
2839 2003-06-17 Paul Eggert <eggert@twinsun.com>
2841 Assume C89, so PARAMS isn't needed.
2842 * backupfile.h (PARAMS): Remove. All uses removed.
2843 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
2844 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
2845 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
2846 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
2847 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
2848 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
2849 xstrtol.h: Likewise.
2850 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
2851 same.h, strverscmp.h: Do not include config.h; no longer needed.
2852 Anyway, config.h should always be included before any other file.
2854 2003-06-11 Simon Josefsson <jas@extundo.com>
2856 * sysexit_.h: New file.
2858 2003-05-20 Derek Price <derek@ximbiot.com>
2860 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
2862 2003-06-10 Simon Josefsson <jas@extundo.com>
2864 * strchrnul.h: New file.
2865 * strchrnul.c: New file.
2867 2003-06-10 Simon Josefsson <jas@extundo.com>
2869 * argp.h: New file, from glibc.
2870 * argp-ba.c: New file, from glibc.
2871 * argp-eexst.c: New file, from glibc.
2872 * argp-fmtstream.c: New file, from glibc.
2873 * argp-fmtstream.h: New file, from glibc.
2874 * argp-fs-xinl.c: New file, from glibc.
2875 * argp-help.c: New file, from glibc.
2876 * argp-namefrob.h: New file, from glibc.
2877 * argp-parse.c: New file, from glibc.
2878 * argp-pv.c: New file, from glibc.
2879 * argp-pvh.c: New file, from glibc.
2880 * argp-xinl.c: New file, from glibc.
2882 2003-06-07 Jim Meyering <jim@meyering.net>
2884 * readtokens.h: Put `Free Software Foundation, Inc.'
2885 in place of my name in the copyright comment.
2886 Remove definition and uses of __P.
2889 * stat.c: Don't declare xmalloc explicitly.
2890 Instead, include "xalloc.h".
2891 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
2892 xrealloc, and xcalloc return values.
2893 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
2895 * xgetcwd.h: Remove definition/uses of PARAMS.
2897 2003-06-06 Jim Meyering <jim@meyering.net>
2899 * stdbool_.h: Renamed from stdbool.h.in.
2901 2003-06-06 Jim Meyering <jim@meyering.net>
2903 Merge from coreutils.
2904 * same.c: (same_name): Declare *_basename locals to be `const'.
2905 Consolidate declarations and initializations of *_base* locals.
2907 Merge from coreutils.
2908 This avoids a core dump on systems without GNU putenv,
2909 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
2910 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
2911 (unsetenv): New static function, from GNU libc.
2912 (rpl_putenv): Use it.
2914 * modechange.c: Remove trailing blanks.
2916 Merge from coreutils.
2917 * fsusage.c: Remove declaration of statfs.
2918 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
2920 * posixtm.c: Include <stdbool.h> unconditionally.
2922 2003-06-05 Paul Eggert <eggert@twinsun.com>
2924 * mktime.c (__mktime_internal): When resolving a tm_isdst
2925 mismatch, look in future quarters as well as past. This fixes a
2926 bug when processing fall-backwards gaps immediately after a long
2927 period of daylight-saving time.
2929 * mktime.c: Assume freestanding C89 or better.
2930 (HAVE_LIMITS_H): Remove. Assume it's 1.
2931 (__P): Remove; not used.
2932 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
2933 (mktime, not_equal_tm, print_tm, check_result,
2934 main): Use prototypes. Use const * where appropriate.
2935 (main): Fix typo in testing code that uncovered by above changes.
2936 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
2938 2003-06-04 Paul Eggert <eggert@twinsun.com>
2940 * mktime.c: Fix Debian bug 177940
2941 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
2942 (localtime_offset): Now long int, not time_t, because we want it
2943 to be guaranteed to be signed. All uses changed.
2944 (__mktime_internal): If overflow would occur when adding offset,
2947 Merge 'human' changes from coreutils. Rewrite to support
2948 locale-specific notations like thousands separators.
2949 * human.c: Simplify authorship notice.
2950 Include human.h immediately after config.h.
2951 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
2952 <limits.h>: Do not include, since human.h does.
2953 (SIZE_MAX, UINTMAX_MAX): New macros.
2954 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
2955 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
2956 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
2957 (power_letter): Renamed from suffixes.
2958 (generate_suffix_backwards): Remove.
2959 (adjust_value): Now takes int style (because of human.h changes)
2960 and long double value (for greater precision on some platforms).
2961 (group_number): New function.
2962 (human_readable): Use it. Use integer options, not enum.
2963 Put the options before the sizes in the arg list.
2964 Support all the new options.
2965 The old human_readable function has been removed;
2966 use inttostr.h instead.
2967 (human_readable, default_block_size, humblock):
2968 Use uintmax_t, not int, for block sizes.
2969 (human_readable_inexact, block_size_types): Remove.
2970 (block_size_opts): New constant.
2971 (human_options): Renamed from human_block_size, with new signature
2972 that allows block sizes up to UINTMAX_MAX. All callers changed.
2973 * human.h: Add copyright and authorship notice.
2974 Include <limits.h> and <stdbool.h> unconditionally.
2975 (PARAMS): Remove. All uses removed.
2976 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
2977 (enum human_inexact_style): Remove tag; now a nameless enum.
2978 (human_floor, human_ceiling, human_round_to_even): Now have
2979 values 2, 0, 1 rather than -1, 1, 0.
2980 (human_group_digits, human_suppress_point_zero, human_autoscale,
2981 human_base_1024, human_SI, human_B): New constants.
2982 (human_readable_inexact, human_block_size): Remove.
2983 (human_readable): Size args are now uintmax_t, not int.
2984 (human_options): New decl.
2986 * exclude.c: (new_exclude, add_exclude): Remove casts that are
2987 unnecessary now that we assume C89 or better. This change
2988 imported from coreutils.
2990 * mktime.c (__mktime_internal): Do not reject negative timestamps
2991 arbitrarily. This is the same patch as 2003-05-28, but it got lost
2992 in the 2003-05-30 sync from glibc.
2994 .h files should stand alone, but we shouldn't include <sys/types.h>
2995 if we can get away with just <stddef.h>.
2997 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
2998 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
2999 rather than <sys/types.h>, as we merely need size_t.
3000 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
3002 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
3003 Include <stdio.h>, to get FILE.
3004 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
3005 memcasecmp.h has included <stddef.h> and all we need is size_t.
3006 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
3007 our interface, instead of including <sys/types.h>
3009 2003-06-02 Paul Eggert <eggert@twinsun.com>
3012 Fix some minor time-related bugs with POSIX time arguments.
3013 Some valid time stamps were being rejected (notably -1, and
3014 time stamps before 1900 on 64-bit hosts). And some invalid
3015 time stamps were being accepted, e.g. September 31.
3017 * posixtm.h (posixtime): Return bool instead of time_t, so
3018 that we can return (time_t) -1 successfully.
3019 * posixtm.c: Likewise.
3020 [HAVE_STDBOOL_H]: Include <stdbool.h>.
3021 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
3022 (t): Remove static var.
3023 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
3024 of static var. All uses changed.
3025 (year): Do not reject years before 1900; they can occur with
3027 (posix_time_parse): Do not check for out-of-range components;
3028 that is now the caller's responsibility, since our checks were
3029 only approximations.
3030 (posixtime): Use mktime to check for out-of-range components,
3031 since it knows them exactly.
3032 If mktime returns (time_t) -1, check whether an error actually occurred
3033 by invoking localtime on -1.
3034 (main) [TEST_POSIXTIME]: Check for input data errors, and report
3035 posixtime failures better.
3036 Improve the test data (in comments only).
3038 2003-05-30 <karl@gnu.org>
3040 * mktime.c: update from libc.
3042 2003-05-30 Bruno Haible <bruno@clisp.org>
3044 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
3045 * localcharset.h: Likewise.
3046 * localcharset.c: Likewise.
3048 2003-05-28 Paul Eggert <eggert@twinsun.com>
3050 Assume the headers required for C89 freestanding compilers.
3051 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
3052 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
3053 without checking for HAVE_LIMITS_H.
3054 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
3055 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
3057 * fatal.c: Include <stdarg.h> without checking for __STDC__.
3058 * exclude.c: Include <stdbool.h> unconditionally.
3059 * tempname.c: Include <stddef.h> unconditionally.
3060 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
3061 * modechange.c, rpmatch.c (NULL): Don't define, since
3062 <stddef.h> does that.
3063 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
3064 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
3065 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
3066 * xstrtol.c: Likewise.
3067 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
3068 * savedir.c: Include <stddef.h> instead of defining NULL.
3070 * addext.c (addext): Use assignment rather than cast, to avoid
3071 warnings on some platforms.
3073 * mktime.c (__mktime_internal): Do not reject negative timestamps
3076 2003-05-10 Bruno Haible <bruno@clisp.org>
3078 * linebreak.c (iconv_string_length): Don't return -1 just because the
3079 string is longer than 4 KB.
3081 2003-05-12 Jim Meyering <jim@meyering.net>
3083 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
3084 the space-padded-by-default conversion specifiers, %e, %k, %l.
3086 2003-05-03 Bruno Haible <bruno@clisp.org>
3088 Upgrade to Unicode-4.0.
3089 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
3090 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
3091 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
3092 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
3093 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
3094 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
3095 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
3096 Change width of U+E0100..U+E01EF from 1 to 0.
3098 2003-04-25 Bruno Haible <bruno@clisp.org>
3100 * copy-file.c: Include <stddef.h>, for size_t.
3102 2003-04-25 Jim Meyering <jim@meyering.net>
3104 * copy-file.c (copy_file_preserving): Declare buf_size to be
3105 of type size_t, not int.
3107 2003-04-11 Jim Meyering <jim@meyering.net>
3109 Merge changes from Coreutils.
3111 2003-03-22 Jim Meyering <jim@meyering.net>
3113 * strftime.c (widen): Cast alloca return value to proper type.
3115 2003-01-19 Ulrich Drepper <drepper@redhat.com>
3118 * strftime.c (my_strftime): Handle very large width
3119 specifications for numeric values correctly. Improve checks for
3122 2003-01-19 Jim Meyering <jim@meyering.net>
3124 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
3125 (nl_get_alt_digit) [! defined my_strftime]: Define.
3126 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
3127 _nl_get_alt_digit and _nl_get_walt_digit.
3129 * strftime.c (my_strftime): Merge in locale-related changes from libc.
3130 These changes have no effect outside of _LIBC.
3132 2003-04-10 Bruno Haible <bruno@clisp.org>
3134 * findprog.h: New file, from GNU gettext.
3135 * findprog.c: New file, from GNU gettext.
3137 2003-04-05 Jim Meyering <jim@meyering.net>
3139 Merge changes from Coreutils.
3141 * exclude.h (PARAMS): Remove definition and uses.
3142 * exclude.c: Remove uses of `PARAMS'.
3144 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
3145 Add test-cases for DOS filenames. Declare program_name.
3146 (main): Set up program_name. Patch by Rich Dawe.
3148 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3150 Use mntctl's return value to drive the entry-processing loop, since
3151 we can't rely on the value of the vmt_length member in the last
3152 entry. On some systems doing so could result in exhausting
3153 virtual memory. Based in part on a patch from Mike Jetzer.
3155 2003-04-04 Bruno Haible <bruno@clisp.org>
3157 * linebreak.h: New file, from GNU gettext.
3158 * linebreak.c: New file, from GNU gettext with slight modifications.
3159 * lbrkprop.h: New file, from GNU gettext.
3161 2003-04-03 Bruno Haible <bruno@clisp.org>
3163 * utf8-ucs4.h: New file, from GNU gettext.
3164 * utf16-ucs4.h: New file, from GNU gettext.
3165 * ucs4-utf8.h: New file, from GNU gettext.
3166 * ucs4-utf16.h: New file, from GNU gettext.
3168 2003-04-02 Bruno Haible <bruno@clisp.org>
3170 * binary-io.h: New file, from GNU gettext.
3172 2003-04-01 Bruno Haible <bruno@clisp.org>
3174 * pathname.h: New file, from GNU gettext.
3175 * concatpath.c: New file, from GNU gettext.
3177 2003-03-30 Bruno Haible <bruno@clisp.org>
3179 * copy-file.c (copy_file_preserving): Don't set owner if the function
3180 chown() doesn't exist.
3182 2003-03-28 Bruno Haible <bruno@clisp.org>
3184 * copy-file.h: New file, from GNU gettext.
3185 * copy-file.c: New file, from GNU gettext.
3187 2003-03-18 Jim Meyering <jim@meyering.net>
3189 * quote.c (quote_n): Fix typo in comment.
3191 2003-03-14 Jim Meyering <jim@meyering.net>
3193 Merge changes from Coreutils.
3194 * obstack.h (obstack_object_size): Declare temporary, __o,
3195 to be const, in order to avoid warnings.
3196 (obstack_room): Likewise.
3197 (obstack_empty_p): Likewise.
3199 2003-03-13 Paul Eggert <eggert@twinsun.com>
3201 Merge changes from Bison.
3202 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
3203 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
3204 when compiling Bison 1.875's `bitset bset = obstack_alloc
3205 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
3206 * hash.c: Include <stdbool.h> unconditionally.
3208 2003-03-09 Paul Eggert <eggert@twinsun.com>
3210 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
3211 Reported by Bruce Becker; see:
3212 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
3214 2003-03-03 Paul Eggert <eggert@twinsun.com>
3215 Bruno Haible <bruno@clisp.org>
3217 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
3218 Reported by John Hughes, see
3219 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
3221 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
3223 * poll_.h: New file.
3226 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
3228 * mathl.h: New file.
3229 * acosl.c: New file.
3230 * asinl.c: New file.
3231 * atanl.c: New file.
3232 * ceill.c: New file.
3235 * floorl.c: New file.
3236 * frexpl.c: New file.
3237 * ldexpl.c: New file.
3239 * sincosl.c: New file.
3241 * sqrtl.c: New file.
3243 * trigl.c: New file.
3244 * trigl.h: New file.
3246 2003-02-17 Bruno Haible <bruno@clisp.org>
3248 * mkdtemp.h: New file, from GNU gettext.
3249 * mkdtemp.c: New file, from GNU gettext.
3251 2003-01-31 Bruno Haible <bruno@clisp.org>
3253 * rename.c: #undef rename before defining rpl_rename.
3254 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
3256 2003-01-30 Bruno Haible <bruno@clisp.org>
3258 * printf-args.h: New file, from GNU gettext.
3259 * printf-args.c: New file, from GNU gettext.
3260 * printf-parse.h: New file, from GNU gettext.
3261 * printf-parse.c: New file, from GNU gettext.
3262 * vasnprintf.h: New file, from GNU gettext.
3263 * vasnprintf.c: New file, from GNU gettext.
3264 * asnprintf.c: New file, from GNU gettext.
3265 * vasprintf.h: New file, from GNU gettext with modifications.
3266 * vasprintf.c: New file, from GNU gettext.
3267 * asprintf.c: New file, from GNU gettext.
3269 2003-01-29 Bruno Haible <bruno@clisp.org>
3271 * stpncpy.h: New file, from GNU gettext with modifications.
3272 * stpncpy.c: New file, from GNU gettext with modifications.
3274 2003-01-28 Bruno Haible <bruno@clisp.org>
3276 * c-ctype.h: New file, from GNU gettext, with changes suggested by
3278 * c-ctype.c: New file, from GNU gettext, with changes suggested by
3281 2003-01-27 Bruno Haible <bruno@clisp.org>
3283 * xsetenv.h: New file, from GNU gettext.
3284 * xsetenv.c: New file, from GNU gettext.
3286 2003-01-23 Bruno Haible <bruno@clisp.org>
3288 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
3290 2003-01-22 Bruno Haible <bruno@clisp.org>
3292 * exit.h: New file, from GNU gettext.
3294 2003-01-11 Bruno Haible <bruno@clisp.org>
3296 * stpcpy.h (stpcpy): Use ANSI C function declarations.
3297 * strcase.h (strcasecmp, strncasecmp): Likewise.
3299 2003-01-14 Jim Meyering <jim@meyering.net>
3301 * same.c (same_name): Tweak a comment.
3303 2003-01-11 Bruno Haible <bruno@clisp.org>
3305 * same.c (same_name): Reorder tests so as to avoid calling stat()
3306 when a string comparison is sufficient.
3308 2003-01-11 Bruno Haible <bruno@clisp.org>
3310 * readtokens.c (readtoken): Cast character to 'unsigned char', not
3313 2003-01-11 Bruno Haible <bruno@clisp.org>
3315 * hash-pjw.c: Add comment about low quality of this function.
3317 2003-01-12 Paul Eggert <eggert@twinsun.com>
3319 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
3320 to avoid collisions with libcurses and libreadline.
3322 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
3323 * getstr.h, getstr.c: Remove.
3324 * getline.c: Include "getline.h", to check interface.
3325 Move body of old getstr.c here: this defines MIN_CHUNK and
3326 declares getdelim2, which is renamed from getstr.
3327 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
3329 * linebuffer.c (readlinebuffer): Renamed from readline.
3331 * linebuffer.h: Likewise.
3332 (readline): Remove backward-compatibility macro.
3334 2003-01-12 Jim Meyering <jim@meyering.net>
3336 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
3338 2003-01-10 Bruno Haible <bruno@clisp.org>
3340 * alloca_.h: New file.
3341 * getdate.y: Unconditionally include alloca.h.
3342 * makepath.c: Likewise.
3343 * setenv.c: Likewise.
3344 * userspec.c: Likewise.
3346 2003-01-09 Bruno Haible <bruno@clisp.org>
3348 * stdbool.h.in: New file.
3350 2003-01-08 Bruno Haible <bruno@clisp.org>
3352 * safe-read.c: Include specification header first, to ensure its
3354 * full-write.c: Likewise.
3356 2003-01-08 Jim Meyering <jim@meyering.net>
3358 * full-write.c: Undefine and define-away `const' after inclusion
3359 of errno.h, not before. Suggestion from Bruno Haible.
3361 2003-01-07 Jim Meyering <jim@meyering.net>
3363 * full-write.c: Rework so that it may serve to define full_read, too.
3364 * full-read.c: Simply #define FULL_READ and include full-write.c.
3366 2003-01-06 Jim Meyering <jim@meyering.net>
3368 * version-etc.c: Update year in translatable copyright string.
3370 2002-12-25 Bruno Haible <bruno@clisp.org>
3372 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
3373 * xstrtol.h: Likewise.
3374 * xstrtoimax.c: Likewise.
3375 * xstrtoumax.c: Likewise.
3376 * human.h: Likewise.
3378 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
3379 on systems that have <inttypes.h> but not <stdint.h>.
3381 2002-12-31 Paul Eggert <eggert@twinsun.com>
3383 * memcoll.c (memcoll): Fall back on a simple algorithm using
3384 memcmp if strcoll doesn't work.
3386 2002-12-23 Bruno Haible <bruno@clisp.org>
3388 * localcharset.h: New file.
3389 * localcharset.c: Include it.
3390 * unicodeio.c: Likewise.
3392 2002-12-22 Bruno Haible <bruno@clisp.org>
3394 * utime.c (utime_null): No need to call ftruncate if the file was
3397 2002-12-23 Bruno Haible <bruno@clisp.org>
3399 * memcoll.c (STRCOLL): New macro.
3402 2002-12-22 Bruno Haible <bruno@clisp.org>
3404 * getstr.h (getstr): Define, to avoid clash with libcurses.
3405 * linebuffer.h (readline): Define, to avoid clash with libreadline.
3407 2002-12-22 Bruno Haible <bruno@clisp.org>
3409 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
3411 2002-12-23 Bruno Haible <bruno@clisp.org>
3413 * getline.h: Include <stddef.h>, for size_t.
3415 * unicodeio.h: Include <stddef.h>, for size_t.
3416 * unicodeio.c: Don't include <stddef.h>.
3418 2002-12-17 Bruno Haible <bruno@clisp.org>
3420 * canon-host.c (strdup): Remove unused declaration.
3422 * fsusage.c: Include full_read.h.
3423 (get_fs_usage): Use full_read instead of safe_read.
3425 * utime.c (utime_null): Use SAFE_READ_ERROR.
3427 2002-12-11 Bruno Haible <bruno@clisp.org>
3429 * setenv.h: Rewritten to cope with systems that have setenv() but not
3431 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
3434 2002-12-11 Bruno Haible <bruno@clisp.org>
3436 * setenv.c (alloca): Fall back to malloc.
3438 (setenv): Use freea() to free memory allocated with alloca().
3440 2002-11-13 Bruno Haible <bruno@clisp.org>
3442 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
3443 function declarations.
3444 * unsetenv.c (unsetenv): Likewise.
3446 2002-03-04 Bruno Haible <bruno@clisp.org>
3448 Portability to AIX 4.3.3.
3449 * unsetenv.c: New file, extracted from setenv.c.
3450 * setenv.c: Move the unsetenv() function to unsetenv.c.
3452 2001-12-20 Bruno Haible <bruno@clisp.org>
3454 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
3455 use malloc instead. For SunOS 4.
3457 2001-12-11 Bruno Haible <bruno@clisp.org>
3459 * setenv.c: Declare alloca.
3460 (compar_fn_t): New typedef.
3461 (KNOWN_VALUE, STORE_VALUE): Use it.
3463 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
3466 2002-12-10 Paul Eggert <eggert@twinsun.com>
3468 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
3469 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
3470 Choose values that are less likely to collide with system fnmatch
3472 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
3473 defined (e.g., a pure POSIX system).
3474 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
3475 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
3477 2002-12-06 Jim Meyering <jim@meyering.net>
3479 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
3481 Merge in changes from libc's misc/error.c, in preparation
3482 for the merge of gnulib's changes back into libc.
3484 * error.c (_): Define only if not already defined.
3485 Move definition to follow all #include directives.
3486 Include unlocked-io.h only if !_LIBC.
3487 [_LIBC]: Include <libio/libioP.h>.
3488 [USE_IN_LIBIO]: Include <libio/iolibio.h>
3489 (fflush): Tweak definition to use INTUSE.
3492 2002-12-05 Paul Eggert <eggert@twinsun.com>
3494 * alloca.c [defined emacs]: Include "lisp.h".
3495 (xalloc_die) [defined emacs]: New macro.
3496 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
3497 [! defined emacs]: Include <xalloc.h>.
3498 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
3499 (pointer): Typedef to POINTER_TYPE *.
3500 (malloc): Remove decl; we now always use xmalloc.
3501 (alloca): Use old-style definition, since Emacs needs this.
3502 Check for arithmetic overflow when computing combined size.
3504 2002-12-04 Paul Eggert <eggert@twinsun.com>
3506 Do not generate unlocked-io.h automatically, since it's easier to
3507 maintain it by hand.
3509 * unlocked-io.h: New file, from GNU diffutils,
3510 but with proper copyright notice and attribution.
3512 * Makefile.am: Add copyright notice.
3513 (libfetish_a_SOURCES): Add unlocked-io.h.
3514 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
3515 (DISTCLEANFILES, io_functions): Remove macros.
3516 (EXTRA_DIST): Remove gen_uio.
3517 (unlocked-io.h): Remove rule.
3519 2002-12-04 Jim Meyering <jim@meyering.net>
3521 Reflect the fact that stat.c and lstat.c are no longer generated.
3522 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
3523 (DISTCLEANFILES): Likewise.
3524 (EXTRA_DIST): Likewise.
3525 (all_local): Don't depend on stat.c or lstat.c.
3526 (stat.c, lstat.c): Remove rules.
3527 (EXTRA_DIST): Remove xstat.in.
3529 * xstat.in: Remove file. Contents moved into stat.c.
3530 * stat.c: New file. Contents mostly from xstat.in.
3531 * stat.c: Rework so that it may serve to define rpl_lstat, too.
3532 * lstat.c: New file. Simply #define LSTAT and include stat.c.
3534 * safe-read.c: Rework so that it may serve to define safe_write, too.
3535 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
3537 2002-12-03 Jim Meyering <jim@meyering.net>
3539 * safe-read.c, safe-write.c: Change variable names and comments, but
3540 not semantics, to minimize the differences between these two files.
3541 (safe_read): Change comment to mention SAFE_READ_ERROR.
3543 * safe-read.c (IS_EINTR): Define.
3544 (safe_read): Use IS_EINTR in place of in-function cpp directives.
3546 2002-12-02 Bruno Haible <bruno@clisp.org>
3548 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
3549 Define, taken from safe-read.c.
3550 (INT_MAX): Provide fallback.
3551 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
3552 * safe-write.h (SAFE_WRITE_ERROR): Define.
3554 * safe-read.c (EINTR): Remove definition.
3555 (safe_read): Don't use EINTR if it is absent.
3557 2002-12-02 Jim Meyering <jim@meyering.net>
3559 * safe-read.c (EINTR): Define.
3560 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
3561 (INT_MAX): Provide fallback.
3562 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
3564 * safe-read.h (SAFE_READ_ERROR): Define.
3566 2002-12-01 Jim Meyering <jim@meyering.net>
3568 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
3569 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
3571 2002-11-27 Paul Eggert <eggert@twinsun.com>
3573 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
3574 hash_rehash): Replace `if (limit <= value) abort ();' with
3575 `if (! (value < limit)) abort ();', for readability.
3577 2002-11-26 <karl@gnu.org>
3579 * strdup.c: copy from libc again, with jim's ok.
3580 * .cppi-disable: re-add strdup.c
3582 2002-11-25 <karl@gnu.org>
3584 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
3585 instead of "strtol.c".
3587 2002-11-25 Jim Meyering <jim@meyering.net>
3589 * mktime.c: Sync from libc, now that it has the latest fix.
3591 2002-11-24 <karl@gnu.org>
3593 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
3594 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
3596 2002-11-24 Jim Meyering <jim@meyering.net>
3598 Update from coreutils:
3600 * mktime.c: Merge in changes from libc.
3602 Avoid a link-time failure on some Linux systems.
3603 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
3604 (__mon_yday): Declare with the STATIC attribute.
3605 (__mktime_internal): Likewise.
3606 Based on a report from Greg Schafer.
3608 2002-11-23 Jim Meyering <jim@meyering.net>
3610 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
3611 Use `unsigned', not `int', as type of index.
3613 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
3615 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
3617 2002-11-22 Paul Eggert <eggert@twinsun.com>
3619 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
3620 hint that one should use `if (! x) abort ();' rather than `assert
3621 (x);', and anyway it's one less thing to worry about configuring.
3622 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
3623 hash_rehash, hash_insert): Use abort rather than assert.
3625 2002-11-22 Paul Eggert <eggert@twinsun.com>
3627 * quotearg.h: Allow multiple inclusion by surrounding with
3628 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
3629 so that we can be included first.
3630 (PARAMS): Remove; we now assume C89 or later. All uses removed.
3631 * quotearg.c: Include quotearg.h immediately after config.h.
3632 No need to include stddef.h or sys/types.h any more.
3633 Surround local include files with "", not "<>".
3634 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
3635 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
3636 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
3637 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
3638 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
3639 (ISPRINT): Remove; no longer needed now that we assume C89.
3641 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
3644 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
3645 quotearg_char): Use SIZE_MAX rather than
3646 (size_t) -1 when we are talking about "infinity".
3648 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
3650 2002-11-22 Bruno Haible <bruno@clisp.org>
3652 * safe-read.h: Assume C89. Add comments.
3653 (safe_read): Change return type to size_t.
3654 * safe-read.c (safe_read): Change return type to size_t. Handle byte
3655 counts > SSIZE_MAX correctly.
3656 * safe-write.h: New file.
3657 * safe-write.c: New file.
3658 * full-read.h: New file.
3659 * full-read.c: New file.
3660 * full-write.h: Assume C89. Add comments.
3661 * full-write.c: Include safe-write.h.
3662 (full_write): Rewritten to use safe_write.
3663 Suggested by Jim Meyering and Paul Eggert.
3665 2002-11-21 Bruno Haible <bruno@clisp.org>
3667 Remove case insensitive option matching.
3668 * argmatch.h (argcasematch): Remove declaration.
3669 (ARGCASEMATCH): Remove macro.
3670 (__xargmatch_internal): Remove case_sensitive argument.
3671 (XARGMATCH): Update.
3672 (XARGCASEMATCH): Remove macro.
3673 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
3674 case_sensitive argument.
3675 (argcasematch): Remove function.
3676 (__xargmatch_internal): Remove case_sensitive argument.
3677 (main): Use XARGMATCH instead of XARGCASEMATCH.
3679 * xmalloc.c: Change compile-time error message. Add comment about
3680 required autoconf version.
3682 2002-11-21 Jim Meyering <jim@meyering.net>
3684 * strdup.c (strdup): Tweak comment and initial #if/#include.
3686 Merge in changes from the coreutils.
3688 2002-09-25 Paul Eggert <eggert@twinsun.com>
3689 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
3690 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
3691 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
3692 int. Work more efficiently if X is the same width as uintmax_t.
3693 Do not compare X to -1, to avoid bogus compiler warning.
3694 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
3695 Don't assume that f_frsize and f_bsize are the same type.
3697 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
3700 * makepath.c (make_path): Restore umask *before* creating the final
3702 (make_path): Minor reformatting.
3704 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
3705 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
3707 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
3708 ones. At least on GNU/Linux systems, `auto' means something else.
3711 2002-11-20 Paul Eggert <eggert@twinsun.com>
3713 Merge argmatch cleanups from Bison. Assume C89.
3715 * argmatch.c: Include config.h here, not in argmatch.h.
3716 Include stdlib.h, for EXIT_FAILURE.
3717 Always include <string.h>, since we assume C89.
3718 (EXIT_FAILURE): Remove pre-C89 bug workaround.
3719 * argmatch.h: Do not include <config.h> or <sys/types.h>.
3720 Include <stddef.h> instead, since it's all we need for size_t.
3721 (PARAMS): Remove. All uses removed.
3722 (ARRAY_CARDINALITY): Do not bother to #undef.
3723 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
3724 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3725 Remove unnecessary parentheses.
3726 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
3727 Insert necessary parentheses.
3728 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
3729 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
3731 2002-11-19 Bruno Haible <bruno@clisp.org>
3733 * mbswidth.c: Include mbswidth.h right at the beginning.
3734 * mbswidth.h: Include <stddef.h>, for size_t.
3736 * mbswidth.h (PARAMS): Remove macro.
3737 (mbswidth, mbsnwidth): Use ANSI C function declarations.
3738 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
3740 * gcd.h (PARAMS): Remove macro.
3741 (gcd): Use ANSI C function declarations.
3742 * gcd.c (gcd): Likewise.
3744 2002-11-15 Bruno Haible <bruno@clisp.org>
3746 * strcspn.c: Include <stddef.h>.
3747 (strcspn): Use ANSI C function declaration. Change return type to
3749 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
3750 (strpbrk): Use NULL.
3751 * strpbrk.h (PARAMS): Remove macro.
3752 (strpbrk): Use ANSI C function declaration.
3753 * strstr.c: Don't include <sys/types.h>.
3754 * strstr.h (PARAMS): Remove macro.
3755 (strstr): Use ANSI C function declarations.
3757 2002-11-06 Bruno Haible <bruno@clisp.org>
3759 * gcd.h (gcd): Change argument type to 'unsigned long'.
3760 * gcd.c (gcd): Likewise.
3762 2002-11-05 Bruno Haible <bruno@clisp.org>
3764 * gcd.h: New file, from gettext-0.11.5.
3765 * gcd.c: New file, from gettext-0.11.5.
3767 2002-11-05 Bruno Haible <bruno@clisp.org>
3769 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3770 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3771 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3772 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
3774 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3775 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
3777 * closeout.c: Include gettext.h instead of <libintl.h>.
3778 * human.c: Include gettext.h instead of <libintl.h>.
3779 * quotearg.c: Include gettext.h instead of <libintl.h>.
3780 * rpmatch.c: Include gettext.h instead of <libintl.h>.
3781 * unicodeio.c: Include gettext.h instead of <libintl.h>.
3782 * userspec.c: Include gettext.h instead of <libintl.h>.
3783 * version-etc.c: Include gettext.h instead of <libintl.h>.
3784 * xmalloc.c: Include gettext.h instead of <libintl.h>.
3785 (textdomain): Remove definition.
3786 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
3788 * long-options.c: Remove include of <libintl.h> and definition of _.
3789 * same.c: Remove include of <libintl.h> and definition of _.
3791 2002-11-04 Bruno Haible <bruno@clisp.org>
3793 * stpcpy.h: New file, from GNU gettext-0.11.5.
3794 * strcase.h: New file, from GNU gettext-0.11.5.
3795 * strpbrk.h: New file, from GNU gettext-0.11.5.
3796 * strstr.h: New file, from GNU gettext-0.11.5.
3797 * xgetcwd.h: New file, from GNU gettext-0.11.5.
3799 2002-05-09 Bruno Haible <bruno@clisp.org>
3801 * config.charset: Update for newest glibc. Add canonical names
3802 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
3804 2002-05-09 Bruno Haible <bruno@clisp.org>
3806 * localcharset.c (get_charset_aliases): Add more Windows specific
3809 2002-05-08 Owen Taylor <otaylor@redhat.com>
3811 * config.charset: A few additions for Solaris.
3813 2001-12-05 Bruno Haible <bruno@clisp.org>
3815 * localcharset.c (locale_charset): Don't return an empty string.
3817 2001-10-23 Bruno Haible <haible@clisp.cons.org>
3819 * config.charset: msdos in uk_UA uses CP1125.
3821 2001-08-05 Bruno Haible <haible@clisp.cons.org>
3823 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
3824 * localcharset.c (locale_charset): Declare as extern "C".
3826 2002-02-15 Bruno Haible <bruno@clisp.org>
3828 * config.charset [msdosdjgpp]: For Russian, use CP866.
3830 2002-02-11 Bruno Haible <bruno@clisp.org>
3832 * config.charset: Add support for NetBSD.
3834 2002-09-25 <karl@gnu.org>
3836 * strdup.c: copy from libc/string (via ../config/srclist*).
3837 * getopt*: copy from libc/posix.
3838 * gettext.h: copy from gettext.
3839 * .cppi-disable: add strdup.c, gettext.h.
3841 2002-07-01 Jim Meyering <meyering@lucent.com>
3843 * c-stack.c: Include sys/time.h.
3844 From Volker Borchert.
3846 2002-06-11 Paul Eggert <eggert@twinsun.com>
3848 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
3849 New macro. Use it uniformly instead of
3850 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
3851 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
3852 reported by Vin Shelton.
3854 2002-06-22 Jim Meyering <meyering@lucent.com>
3856 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
3857 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
3859 2002-06-22 Paul Eggert <eggert@twinsun.com>
3861 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
3862 Do not assume SA_SIGINFO behavior.
3863 Bug reported by Jim Meyering on NetBSD 1.5.2.
3865 2002-06-22 Jim Meyering <meyering@lucent.com>
3867 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
3869 * exitfail.c, exitfail.h: Likewise.
3870 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
3872 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
3874 (EXTRA_DIST): Add fnmatch_loop.c.
3875 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
3877 * fnmatch_loop.c: New file, from diffutils-2.8.2.
3878 * fnmatch.c: Update from diffutils-2.8.2.
3879 * fnmatch_.h: New file. From diffutils-2.8.2.
3880 * fnmatch.h: Remove file.
3882 2002-06-18 Paul Eggert <eggert@twinsun.com>
3884 * file-type.h: Report an error if neither S_ISREG nor
3885 S_IFREG is defined, instead of using a test specific to glibc
3886 2.2. This should be safe, since POSIX requires S_ISREG and
3887 Unix Version 7 had S_IFREG. We don't need to check for
3888 <sys/types.h> since we don't use any symbols that it defines.
3890 2002-06-15 Jim Meyering <meyering@lucent.com>
3892 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
3893 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
3894 have been included before this file.
3896 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
3898 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
3899 so that each temporary file name is unique and valid in the first
3900 8 characters, for operation under DOS.
3902 2002-06-15 Jim Meyering <meyering@lucent.com>
3904 Work even with DJGPP 2.03, which lacks support for symlinks.
3906 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
3908 * lchown.c (S_ISLNK): Likewise.
3910 2002-06-14 Jim Meyering <meyering@lucent.com>
3912 * file-type.h: Use the version from diffutils-2.8.2.
3913 * file-type.c: Likewise.
3915 2002-05-27 Jim Meyering <meyering@lucent.com>
3917 Fix a problem seen only on nonconforming systems whereby ls.c's
3918 use of localtime, and then of gettimeofday would cause trouble:
3919 the localtime call used to initialize rpl_gettimeofday's save
3920 mechanism would clobber ls's current local time information so
3921 that in any long listing the first file would always be listed
3922 with date 1970-01-01. Analysis by Volker Borchert.
3924 * gettimeofday.c (localtime): Undefine.
3925 (rpl_localtime): New function.
3927 2002-05-22 Jim Meyering <meyering@lucent.com>
3929 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
3930 * file-type.h: New file.
3931 * file-type.c (file_type): New file/function. Extracted from diffutils.
3933 2002-04-29 Paul Eggert <eggert@twinsun.com>
3935 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
3937 2002-04-28 Paul Eggert <eggert@twinsun.com>
3939 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
3940 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
3941 of 127, since 64 is the largest conceivable number for ancient
3943 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
3945 2002-04-28 Jim Meyering <meyering@lucent.com>
3947 * sig2str.c (WTERMSIG): Remove definition (unused).
3949 2002-04-28 Paul Eggert <eggert@twinsun.com>
3951 * sig2str.h, sig2str.c: New files.
3952 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
3954 2002-04-24 Jim Meyering <meyering@lucent.com>
3956 * gettext.h: New file, from Gettext.
3957 * Makefile.am (INCLUDES): Remove -I../intl.
3958 (libfetish_a_SOURCES): Add gettext.h.
3960 2002-04-16 Jim Meyering <meyering@lucent.com>
3962 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
3963 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
3964 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
3966 2002-04-12 Jim Meyering <meyering@lucent.com>
3968 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
3970 2002-03-10 Jim Meyering <meyering@lucent.com>
3972 * makepath.c (make_path): Remove a comma from a diagnostic.
3973 Suggestion from Santiago Vila.
3975 2002-03-08 Jim Meyering <meyering@lucent.com>
3977 * rename.c: Mention that this wrapper is needed also on
3978 mips-dec-ultrix4.4 systems.
3980 2002-03-02 Jim Meyering <meyering@lucent.com>
3982 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
3983 not HAVE_CLOCK_SETTIME.
3985 2002-02-27 Paul Eggert <eggert@twinsun.com>
3987 * nanosleep.h: Rename to....
3988 * timespec.h: New name for nanosleep.h. All uses changed.
3990 * gettime.c: New file.
3991 * settime.c: New file.
3994 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
3995 timespec.h. Remove nanosleep.h.
3997 2002-02-25 Paul Eggert <eggert@twinsun.com>
3999 * acl.c, acl.h: New files.
4000 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
4002 2002-02-24 Jim Meyering <meyering@lucent.com>
4004 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
4005 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
4006 cause trouble. Reported by Nelson Beebe.
4008 2002-02-23 Paul Eggert <eggert@twinsun.com>
4010 * path-concat.c (xpath_concat): Reorder code to pacify
4011 compilers that don't know that xalloc_die never returns.
4013 2002-02-20 Jim Meyering <meyering@lucent.com>
4015 * getdate.c: Regenerate using bison-1.33.
4017 2002-02-15 Paul Eggert <eggert@twinsun.com>
4019 * posixver.c, posixver.h: New files.
4020 * Makefile.am (libfetish_a_SOURCES): Add them.
4022 2002-02-02 Paul Eggert <eggert@twinsun.com>
4023 Bruno Haible <bruno@clisp.org>
4025 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
4026 (fwrite_success_callback): New declaration.
4027 * unicodeio.c (unicode_to_mb): New function, extracted from
4028 print_unicode_char. Call failure callback instead of error.
4029 (fwrite_success_callback): New function.
4030 (exit_failure_callback): New function.
4031 (fallback_failure_callback): New function.
4032 (print_unicode_char): Call unicode_to_mb.
4034 2002-01-26 Jim Meyering <meyering@lucent.com>
4036 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
4038 2002-01-22 Jim Meyering <meyering@lucent.com>
4040 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
4041 Otherwise, some versions of automake would omit the rule that makes
4042 Makefile from Makefile.in.
4044 2001-01-21 Paul Eggert <eggert@twinsun.com>
4046 * xmemcoll.h, xmemcoll.c: New files.
4047 * Makefile.am (libfetish_a_SOURCES): Add them.
4048 * memcoll.c: Include errno.h, and declare errno if not defined.
4049 (memcoll): Set errno to zero if there is no error.
4051 * quotearg.c (quotearg_buffer_restyled):
4052 Fix bug with quoting buffers containing NUL when backslashing escapes.
4053 This bug was exposed by the other changes in this patch.
4054 (quotearg_n_options): New arg ARGSIZE.
4055 All callers changed.
4056 (quoting_options_from_style): New function.
4057 (quotearg_n_style): Use it.
4058 (quotearg_n_style_mem): New function.
4060 * quotearg.h (quotearg_n_style_mem): New function.
4062 2002-01-16 Jim Meyering <meyering@lucent.com>
4064 * getdate.y: Add three semicolons, each just before a closing brace.
4065 Bison (as of version 1.31) no longer papers over that mistake.
4067 2002-02-14 Paul Eggert <eggert@twinsun.com>
4069 * backupfile.c (ISDIGIT): Comment fix.
4070 * getdate.y (ISDIGIT): Likewise.
4071 * posixtm.c (ISDIGIT, year): Likewise.
4072 * strverscmp.c (ISDIGIT): Likewise.
4073 * userspec.c (ISDIGIT): Likewise.
4075 2002-01-05 Jim Meyering <meyering@lucent.com>
4077 * version-etc.c (version_etc_copyright): Update copyright year.
4079 2001-01-19 Paul Eggert <eggert@twinsun.com>
4081 * closeout.c (close_stdout_status): If ferror (stdout), do
4082 not silently exit merely because the output buffer happens to
4083 have nothing pending.
4085 2001-12-18 Paul Eggert <eggert@twinsun.com>
4087 See the big note in ../ChangeLog.
4088 * human.c (suffixes): Prefer K to k for 1024.
4089 (generate_suffix_backwards): New function.
4090 (human_readable_inexact): Use it.
4091 * xstrtol.c (__xstrtol): If there is no number but there
4092 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
4093 Accept 'K' as well as 'k'.
4095 2001-12-15 Jim Meyering <meyering@lucent.com>
4097 * regex.h (__restrict_arr): Update from libc.
4099 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
4100 as `remote' if the name starts with `//'. Suggested by Michael Stone.
4103 2001-12-10 Jim Meyering <meyering@lucent.com>
4105 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
4106 Instead, include "xalloc.h".
4107 (initbuffer): Don't cast xmalloc return value to char*.
4108 (readline): Reword comment.
4109 Don't cast xrealloc return value to char*
4112 2001-12-09 Jim Meyering <meyering@lucent.com>
4114 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
4115 `signed and unsigned type in conditional expression'.
4116 * posixtm.c (posix_time_parse): Likewise.
4118 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
4120 * readtokens.c (readtoken): Declare an index to be of type unsigned
4121 to avoid a pedantic warning.
4123 * getstr.c: Don't include assert.h.
4124 (getstr): Remove warning-evoking assertions.
4125 Return -1 if offset parameter is out of bounds.
4126 Change the type of a local from int to size_t.
4128 * strftime.c (my_strftime_localtime_r): Include this function
4129 definition in the `#if ! HAVE_TM_GMTOFF' block.
4131 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
4132 Include xalloc.h instead.
4134 2001-12-02 Jim Meyering <meyering@lucent.com>
4136 * tempname.c: Don't declare getenv, thus reverting the change of
4137 2001-11-18. It's no longer necessary, now that stdlib.h is always
4140 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
4141 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
4143 2001-11-30 Akim Demaille <akim@epita.fr>
4145 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
4146 before being defined.
4148 2001-11-27 Paul Eggert <eggert@twinsun.com>
4150 * quotearg.h (quotearg_n, quotearg_n_style):
4151 First arg is int, not unsigned.
4152 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
4153 (SIZE_MAX, UINT_MAX): New macros.
4154 (quotearg_n_options): Abort if N is negative.
4155 Avoid overflow check on hosts where size_t is 64 bits and int
4156 is 32 bits, as overflow is impossible there.
4157 Fix off-by-one typo that caused unnecessary reallocation.
4159 2001-11-27 Jim Meyering <meyering@lucent.com>
4161 * tempname.c: Merge with version from libc.
4162 * regex.c: Likewise.
4164 * tempname.c: Include stdlib.h unconditionally. On some old systems
4165 for which STDC_HEADERS is 0, it was not included, resulting in a
4166 warning about an integer-to-pointer conversion problem with getenv.
4167 Reported by Volker Borchert.
4169 2001-11-26 Jim Meyering <meyering@lucent.com>
4171 * gtod.h: Remove file.
4172 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
4173 * gettimeofday.c: Don't include gtod.h.
4174 (GTOD_init): Remove function.
4175 (rpl_gettimeofday): Do its job here instead, rather than aborting.
4176 Suggestion from Volker Borchert.
4178 2001-11-23 Jim Meyering <meyering@lucent.com>
4180 * hash.h (struct hash_table): Don't define here. Merely declare it.
4181 * hash.c (struct hash_table): Define it here instead.
4183 2001-11-22 Jim Meyering <meyering@lucent.com>
4185 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
4187 2001-11-18 Paul Eggert <eggert@twinsun.com>
4189 * tempname.c (TMP_MAX): Remove; no longer needed.
4190 (TEMPORARIES): New macro.
4191 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
4192 removes an artificial limitation (e.g. HP-UX 10.20, where
4195 2001-11-18 Jim Meyering <meyering@lucent.com>
4197 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
4200 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
4201 files will be created before anything else.
4203 2001-11-17 Jim Meyering <meyering@lucent.com>
4205 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
4206 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
4207 rather than group writable. Patch by Juan F. Codagnone.
4209 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
4210 Instead, include "xalloc.h".
4212 * mountlist.c: Include unlocked-io.h after all system headers.
4213 Remove explicit declarations of xmalloc, xrealloc,
4214 and xstrdup. Instead, include "xalloc.h".
4216 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
4217 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
4218 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
4220 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
4221 Reported by Padraig Brady.
4223 * mkstemp.c: #undef mkstemp.
4225 (rpl_mkstemp): Rename from mkstemp.
4228 2001-11-16 Jim Meyering <meyering@lucent.com>
4230 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
4231 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
4232 determine the amount of total physical memory, use pstat_getstatic.
4233 HPUX-11 doesn't define _SC_PHYS_PAGES.
4234 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
4235 If sysconf couldn't be used to determine the amount of available
4236 physical memory, use both pstat_getstatic and pstat_getdynamic.
4237 Based on a patch from Bob Proulx.
4239 2001-11-05 Jim Meyering <meyering@lucent.com>
4241 * xstat.in (slash_aware_lstat): Correct a misleading comment.
4243 2001-11-03 Jim Meyering <meyering@lucent.com>
4245 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
4246 in argmatch_to_argument call.
4248 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
4251 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
4252 e.g., a fault due to an attempt to free a NULL pointer.
4254 2001-11-01 Jim Meyering <meyering@lucent.com>
4256 * dirfd.c, dirfd.h: New files.
4257 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
4259 * hash.c (hash_print) [TESTING]: Clean up.
4261 2001-10-22 Paul Eggert <eggert@twinsun.com>
4263 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
4264 to avoid a warning if -Wall.
4266 2001-10-21 Paul Eggert <eggert@twinsun.com>
4268 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
4270 2001-10-21 Jim Meyering <meyering@lucent.com>
4272 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
4273 this code would end up calling gettext even in packages built
4275 * getopt.c (_): Likewise.
4276 * regex.c (_): Likewise.
4278 2001-10-20 Paul Eggert <eggert@twinsun.com>
4280 * error.c (strerror_r): Do not declare unless !_LIBC.
4281 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
4282 Use strerror_r that is only a macro, even if it is not a function.
4283 (strerror): Check for HAVE_DECL_STRERROR before declaring.
4284 (private_strerror): Use prototypes, not old-style function definition.
4285 (print_errno_message): New function.
4286 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
4288 (error_tail, error, error_at_line): Use it.
4290 2001-10-11 Jim Meyering <meyering@lucent.com>
4292 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
4293 and quote_n (1, ... to avoid clobbering a buffer.
4295 2001-10-05 Jim Meyering <meyering@lucent.com>
4297 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
4298 * hash-pjw.c: New file (factored out of fileutils' remove.c).
4299 * hash-pjw.h: New file.
4301 2001-09-30 Jim Meyering <meyering@lucent.com>
4303 * mountlist.c [MOUNTED_GETFSSTAT]:
4304 Include <sys/ucred.h>, for Apple Darwin.
4305 Include sys/mount.h and sys/fs_types.h only if available.
4307 (read_filesystem_list): Use FS_TYPE.
4309 2001-09-29 Paul Eggert <eggert@twinsun.com>
4311 * exclude.c (excluded_filename): 0 -> false, since it's
4314 2001-09-28 Paul Eggert <eggert@twinsun.com>
4316 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
4317 #defines strtoimax. Also treat the other strto* functions
4320 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
4321 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
4322 (strtoimax, strtoumax): Do not declare if already defined as a macro.
4324 2001-09-26 Jim Meyering <meyering@lucent.com>
4326 Most macros in unlocked-io.h had the wrong number of arguments.
4327 * gen-uio: New script.
4328 (USE_UNLOCKED_IO): Define to 1 if not already defined.
4329 * unlocked-io.hin: Remove file.
4330 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
4331 rather than trying to embed it here.
4332 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
4333 Reported by Padraig Brady.
4335 2001-09-25 Volker Borchert <bt@teknon.de>
4337 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
4339 2001-09-23 Jim Meyering <meyering@lucent.com>
4341 * mountlist.c: Remove useless parentheses in #if directives.
4342 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
4343 the deprecated MOUNTED symbol is no longer defined in mntent.h.
4345 2001-09-22 Jim Meyering <meyering@lucent.com>
4347 * localcharset.c: Update from latest gettext.
4348 * config.charset: Likewise.
4350 2001-09-20 Jim Meyering <meyering@lucent.com>
4352 * xstrtol.c (strtoimax): Guard declaration with
4353 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
4354 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
4355 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
4356 (strtoumax): Likewise, for completeness (it wasn't necessary).
4358 2001-09-06 Paul Eggert <eggert@twinsun.com>
4360 * strtoimax.c (HAVE_LONG_LONG):
4361 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
4362 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
4363 to work around bug in IBM C compiler.
4365 2001-09-16 Jim Meyering <meyering@lucent.com>
4367 * mkdir.c: New file.
4369 2001-09-04 Paul Eggert <eggert@twinsun.com>
4371 * xgetcwd.c: Revert some of the previous change; intead,
4372 fix the HAVE_GETCWD_NULL code to behave more like the
4373 !HAVE_GETCWD_NULL code used to.
4376 (xgetcwd): Do not return NULL when memory is exhausted; instead,
4379 2001-09-04 Paul Eggert <eggert@twinsun.com>
4381 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
4382 Use ssize_t, not int, to store result of readlink.
4383 Check for ssize_t overflow as well as size_t overflow,
4384 as POSIX says the result of readlink is implementation-defined
4385 when ssize_t overflows.
4386 Remove unnecessary cast to char*.
4387 Use free+malloc instead of realloc, as the storage doesn't need
4388 to be preserved and it's clearer and can be more efficient that way.
4389 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
4390 * xreadlink.h (xreadlink): Update prototype.
4392 2001-09-03 Paul Eggert <eggert@twinsun.com>
4394 * exclude.c (fnmatch_no_wildcards): Fix confusion between
4395 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
4396 spotted by Jim Meyering.
4398 2001-09-03 Jim Meyering <meyering@lucent.com>
4400 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
4402 2001-09-03 Paul Eggert <eggert@twinsun.com>
4404 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
4405 like the HAVE_GETCWD_NULL code.
4406 Include pathmax.h if not HAVE_GETCWD.
4407 Do not include xalloc.h.
4408 (INITIAL_BUFFER_SIZE): New symbol.
4409 Do not use xmalloc / xrealloc, since the caller is responsible for
4410 handling errors. Preserve errno around `free' during failure.
4411 Do not overrun buffer when using getwd.
4413 2001-09-03 Paul Eggert <eggert@twinsun.com>
4415 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
4416 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
4418 2001-09-02 Jim Meyering <meyering@lucent.com>
4420 * error.c: Update from GNU libc.
4422 2001-09-01 Jim Meyering <meyering@lucent.com>
4424 * xreadlink.c: New file.
4425 * xreadlink.h: New file.
4426 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
4428 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
4429 doesn't conflict with sparc Solaris 7's definition in
4430 /usr/include/sys/int_types.h.
4432 * exclude.c: Use `""', not `<>' to #include non-system header files.
4433 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
4434 and strncasecmp as r-values. Unixware didn't have declarations.
4436 2001-08-31 Jim Meyering <meyering@lucent.com>
4438 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
4439 Use an initial, malloc'd, buffer of length 128 rather than
4440 a statically allocated one of length 1024.
4442 2001-08-30 Paul Eggert <eggert@twinsun.com>
4444 * xgetcwd.c: Don't include pathmax.h.
4445 Include stdlib.h and unistd.h if available.
4447 (xmalloc, xstrdup, free): Remove decls.
4448 (xgetcwd): Don't assume sizes fit in unsigned.
4449 Check for overflow when computing sizes.
4450 Simplify reallocation code.
4452 2001-08-28 Paul Eggert <eggert@twinsun.com>
4454 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
4456 * strtoimax.c: Renamed from strtoxmax.c, removing the
4459 Also, make the following further changes to make this file's
4460 configuration more similar to that of strtol.c:
4461 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
4462 (strtoumax, uintmax_t, strtoull, strtol): Remove.
4463 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
4464 (strtoimax): Renamed from strtoumax. All uses of unsigned values
4465 changed to signed values.
4467 And make the following changes as well:
4468 Fix copyright notice, as 1999 was missing.
4469 (verify): New macro.
4470 (strtoimax): Check sizes at compile-time, not run-time.
4471 Prefer strtol to strtoll if both work.
4472 (main): Remove; it was not that useful and was a pain to maintain.
4474 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
4476 2001-08-30 Paul Eggert <eggert@twinsun.com>
4478 * savedir.c (savedir): Remove size parameter, as POSIX says that
4479 a directory's st_size can have an arbitrary value, so the old
4480 usage could waste an arbitrary amount of memory. All uses
4482 * savedir.h: Update prototype.
4484 2001-08-30 Paul Eggert <eggert@twinsun.com>
4486 * xstrtol.c (strtoimax): New decl.
4488 2001-08-28 Paul Eggert <eggert@twinsun.com>
4490 * xstrtol.h: Add copyright notice.
4491 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
4492 LONGINT_INVALID_SUFFIX_CHAR.
4494 2001-08-30 Paul Eggert <eggert@twinsun.com>
4496 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
4499 2001-08-30 Paul Eggert <eggert@twinsun.com>
4501 * hash.c: Remove '2001' from copyright notice.
4503 2001-08-30 Paul Eggert <eggert@twinsun.com>
4505 * full-write.h: New file.
4506 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
4507 * full-write.c: Correct credits, as cccp.c no longer
4508 exists and anyway it was so heavily changed from the old cccp
4509 code as to be unrecognizable. Include full-write.h.
4510 (full_write) Return size_t, with short writes meaning failure.
4511 All callers changed. This fixes a bug with large buffers
4513 * utime.c: Include full-write.h.
4515 2001-08-30 Paul Eggert <eggert@twinsun.com>
4517 Merge 'exclude' changes from tar 1.13.22.
4518 This fixes one or two unlikely storage allocation overflow bugs,
4519 but doesn't change user-visible behavior otherwise.
4521 2001-08-30 Paul Eggert <eggert@twinsun.com>
4523 * exclude.c (bool): Declare, perhaps by including stdbool.h.
4524 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
4525 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
4526 Include if available.
4527 (<xalloc.h>): Include
4528 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
4529 (verify): New macro. Use it to verify that EXCLUDE macros do not
4530 collide with FNM macros.
4531 (struct patopts): New struct.
4532 (struct exclude): Use it, as exclude patterns now come with options.
4533 (new_exclude): Support above changes.
4534 (new_exclude, add_exclude_file):
4535 Initial size must now be a power of two to simplify overflow checking.
4536 (free_exclude, fnmatch_no_wildcards): New function.
4537 (excluded_filename): No longer requires options arg, as the options
4538 are determined by add_exclude. Now returns bool, not int.
4539 (excluded_filename, add_exclude):
4540 Add support for the fancy new exclusion options.
4541 (add_exclude, add_exclude_file): Now takes int options arg.
4542 Check for arithmetic overflow when computing sizes.
4543 (add_exclude_file): xrealloc might modify errno, so don't
4544 realloc until after errno might be used.
4546 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
4548 (free_exclude): New decl.
4549 (add_exclude, add_exclude_file): Now takes int options arg.
4550 (excluded_filename): No longer requires options arg, as the options
4551 are determined by add_exclude. Now returns bool, not int.
4553 2001-08-30 Paul Eggert <eggert@twinsun.com>
4555 * alloca.c (alloca): Arg is of type size_t, not unsigned.
4557 2001-08-27 Jim Meyering <meyering@lucent.com>
4559 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
4561 * version-etc.c (N_): Remove definition.
4562 Revert most of last change.
4563 Instead, simply don't mark the `Copyright...' string for translation.
4564 Based on advice from Paul Eggert.
4566 * strtoxmax.c: Tweak comment.
4568 2001-08-26 Jim Meyering <meyering@lucent.com>
4570 * version-etc.c (version_etc_copyright_fmt): Replace literal year
4571 of copyright with `%s' so translators don't get an untranslated
4573 (COPYRIGHT_YEAR): Define.
4574 (version_etc): Use fprintf rather than fputs.
4575 Suggestion from Ulrich Drepper.
4577 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
4579 * strtoll.c: New file, from GNU libc.
4580 * xstrtoimax.c: New file.
4582 * xstrtol.h: Add xstrtoimax.
4583 * strtoumax.c: New file. Simply include "strtoumax.c".
4584 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
4586 * strtoumax.c: Factor to work both for unsigned and signed types, ...
4587 * strtoxmax.c: ... then renamed to this.
4589 2001-08-13 Paul Eggert <eggert@twinsun.com>
4591 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
4592 Port to Solaris 8, where 'sed' requires a space after the 'r'
4593 command, and where sh dislikes "$/". Clean up the spacing a bit.
4594 Redirect output to $tmp just once.
4596 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
4598 * addext.c (<errno.h>): Include.
4599 (errno): Declare if not defined.
4600 (addext): Work correctly when pathconf returns -1 and leaves
4601 errno alone because there is no limit. Also, work even if
4602 pathconf returns a value greater than SIZE_MAX.
4604 2001-08-12 Jim Meyering <meyering@lucent.com>
4606 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
4607 Simply `return getcwd (NULL, 0);'.
4608 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
4609 Use 1300 as initial value for length, not PATH_MAX.
4611 * pathmax.h: Clean up cpp syntax.
4613 2001-08-12 Jim Meyering <meyering@lucent.com>
4615 * gettimeofday.c: New file.
4617 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
4619 2001-08-04 Jim Meyering <meyering@lucent.com>
4621 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
4622 to get in sync with glibc.
4624 2001-08-03 Paul Eggert <eggert@twinsun.com>
4626 The following changes are from gettext 0.10.39 as maintained by
4629 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
4630 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
4631 with inverted sense. All uses changed.
4633 * mbswidth.c: Don't include <limits.h>.
4634 Include <stdlib.h> and <string.h> unconditionally.
4635 (iswcntrl, mbsinit, ISCNTRL): New macros.
4636 (mbsnwidth): Use K&R style function declarations.
4637 Don't bother checking for MB_LEN_MAX == 1, since the compiler
4638 can optimize it when MB_CUR_MAX == 1.
4639 The width of control characters is zero, not 1.
4641 2001-07-15 Jim Meyering <meyering@lucent.com>
4643 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
4644 (BUILT_SOURCES): Add unlocked-io.h.
4645 (io_functions): Define.
4646 (unlocked-io.h): New rule.
4647 (DISTCLEANFILES): Add unlocked-io.h.
4648 (all-local): Depend on unlocked-io.h, to ensure it is created.
4650 * unlocked-io.hin: New file
4652 * regex.c: Update from glibc.
4654 2001-07-05 Jim Meyering <meyering@lucent.com>
4656 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
4658 (libfetish_a_SOURCES): Put all .h files here instead.
4659 Remove a thus-exposed (better checks in automake) duplicate and
4660 two unnecessary .h files.
4662 2001-06-11 Jim Meyering <meyering@lucent.com>
4664 * regex.c: Update from GNU libc.
4666 2001-05-27 Jim Meyering <meyering@lucent.com>
4668 * readutmp.h (UT_TYPE): Define.
4670 2001-05-24 Jim Meyering <meyering@lucent.com>
4672 * argmatch.c: Include "quote.h".
4673 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
4674 quote function. Reported by Göran Uddeborg.
4676 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
4678 * dirname.c (dir_name): Compute append_dot using path, not newpath
4679 which is not yet declared.
4681 2001-05-11 Paul Eggert <eggert@twinsun.com>
4683 * Makefile.am (libfetish_a_SOURCES):
4684 Add strftime.c, since we now compile it on all hosts.
4686 * strftime.c (my_strftime):
4687 Define to nstrftime if emacs, but only if my_strftime is not defined.
4688 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
4689 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
4690 Add one more extra argument: a nanoseconds value.
4693 (my_strftime function): Add %N format.
4694 (emacs_strftimeu): Renamed from emacs_strftime,
4695 with extra ut argument.
4697 2001-05-11 Paul Eggert <eggert@twinsun.com>
4699 dirname code cleanup. base_name now behaves more compatibly
4700 with POSIX basename when given file names that have trailing
4701 slashes, and similarly for dir_name. Add new primitives
4702 base_len and dir_len. Put the directory-name-related decls
4705 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
4706 * backupfile.c (base_name): Likewise.
4707 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
4708 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
4709 * makepath.c (strip_trailing_slashes): Likewise.
4710 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
4712 * rename.c (strip_trailing_slashes): Likewise.
4713 * same.c (base_name): Likewise.
4714 * stripslash.c (ISSLASH): Likewise.
4716 * addext.c: Include <dirname.h> after size_t is defined.
4717 * backupfile.c: Likewise.
4719 * addext.c (addext): Use base_len to trim redundant
4720 trailing slashes instead of doing it ourselves.
4721 But do not trim the last slash if it is not redundant.
4723 * backupfile.c (find_backup_file_name,
4724 max_backup_version): Use base_len instead of rolling it ourselves.
4725 Handle the case of "" and (on DOS) "C:" correctly.
4727 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
4728 Include <string.h>, <dirname.h>.
4729 (base_name): Allow file names ending in slashes, other than names
4730 that are all slashes. In this case, return the basename followed
4731 by the slashes. This is more general, and can be used in places
4732 where the original base_name purposely had an assertion failure.
4733 (base_len): New function.
4735 * dirname.c: Include <string.h> instead of <stdlib.h>.
4736 Do not include <assert.h>; no longer needed.
4738 (memrchr): Remove decl.
4739 (dir_name_r): Remove.
4740 (dir_len): Renamed from dirlen. All callers changed.
4741 Rewrite in terms of base_name, for simplicity and consistency.
4742 (dir_name): Never return NULL. All callers changed.
4743 Do not include <stdlib.h> in test program; no longer needed.
4744 return 0; is fine for test program.
4746 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
4748 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
4750 * path-concat.c (path_concat): Use base_len to compute
4751 base length, not strlen; this means we cannot rely on memcpy
4754 * same.c (STREQ): Remove.
4755 (same_name): Handle the case where the basename ends in trailing '/'.
4757 * stripslash.c (strip_trailing_slashes): Return nonzero if
4758 a slash was stripped. Do not strip the last slash after a
4761 2001-04-08 Jim Meyering <meyering@lucent.com>
4763 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
4764 recomputed; that's necessary when the offset spans a DST transition.
4765 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
4767 2001-04-02 Jim Meyering <meyering@lucent.com>
4769 * regex.h, regex.c: Update from GNU libc.
4771 2001-03-19 Paul Eggert <eggert@twinsun.com>
4773 * version-etc.c (version_etc_copyright): Update to 2001.
4775 2001-03-16 Paul Eggert <eggert@twinsun.com>
4777 * tempname.c (uint64_t): Define to uintmax_t if
4778 not defined, and if UINT64_MAX is not defined.
4779 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
4780 Reported by John David Anglin.
4782 2001-03-10 Bruno Haible <haible@clisp.cons.org>
4784 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
4785 alias if codeset is empty.
4786 * config.charset (BeOS): Use wildcard syntax.
4788 2001-03-13 Jim Meyering <meyering@lucent.com>
4790 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
4791 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
4794 2001-03-06 Bruno Haible <haible@clisp.cons.org>
4796 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
4798 * unicodeio.c (print_unicode_char): Simplify accordingly.
4800 2001-03-06 Bruno Haible <haible@clisp.cons.org>
4802 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
4803 support for DOS/DJGPP.
4805 2001-02-28 Paul Eggert <eggert@twinsun.com>
4807 * Makefile.am (libfetish_a_SOURCES):
4808 Add dup-safer.c, fopen-safer.c.
4809 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
4811 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
4813 2001-02-25 Paul Eggert <eggert@twinsun.com>
4815 The mkstemp replacement is taken from glibc 2.2.2, with some
4816 portability fixes for use outside glibc, as follows:
4818 * tempname.c (struct_stat64): New macro.
4819 (direxists, __gen_tempname): Use it.
4820 This avoids a portability problem with Solaris 8.
4822 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
4823 (<stddef.h>, <stdint.h>, <string.h>):
4824 Include only if STDC_HEADERS || _LIBC.
4825 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
4826 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
4827 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
4828 (__set_errno): Define this macro if <errno.h> doesn't.
4829 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
4830 Define these macros if <stdio.h> doesn't.
4831 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
4832 Define these macros if <sys/stat.h>
4833 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
4834 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
4835 __xstat64): Define if not _LIBC.
4836 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
4837 (__gen_tempname): Invoke gettimeofday only if
4838 HAVE_GETTIMEOFDAY || _LIBC;
4839 otherwise, fall back on plain "time".
4840 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
4842 * mkstemp.c (__GT_FILE): Define to zero if not defined.
4844 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
4846 2001-02-17 Jim Meyering <meyering@lucent.com>
4848 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
4849 around included file name.
4851 * strnlen.c (__strnlen): Merge in a change from GNU libc.
4853 * strftime.c: Update from GNU libc (the only changes were to comments).
4855 2001-02-13 Bruno Haible <haible@clisp.cons.org>
4857 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
4859 2001-02-17 Paul Eggert <eggert@twinsun.com>
4861 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
4862 Remove workaround macros for hosts that have mbrtowc but not
4863 mbstate_t, as we now insist on proper declarations for both
4864 before using mbrtowc.
4866 2001-02-17 Jim Meyering <meyering@lucent.com>
4868 * regex.c: Update from libc.
4870 2001-02-16 Paul Eggert <eggert@twinsun.com>
4872 * alloca.c (malloc): Undef before defining, since stdlib.h
4873 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
4874 Reported by Mark Hounschell via Paul Eggert.
4876 2001-01-30 Bruno Haible <haible@clisp.cons.org>
4878 * config.charset: Update for FreeBSD 4.2.
4880 2001-01-26 Jim Meyering <meyering@lucent.com>
4882 * quotearg.c: Include stddef.h.
4883 * quote.c: Include stddef.h.
4884 Reported by Axel Kittenberger.
4886 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
4887 line in double quotes so that it evokes a better diagnostic.
4888 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
4889 Reported by Axel Kittenberger.
4891 2001-01-15 Bruno Haible <haible@clisp.cons.org>
4893 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
4894 to avoid a warning. Add back 'const' to inptr.
4896 2001-01-16 Jim Meyering <meyering@lucent.com>
4898 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
4901 2001-01-14 Jim Meyering <meyering@lucent.com>
4903 * rename.c: New file. From Volker Borchert.
4904 Include stdlib.h, string.h or strings.h, and xalloc.h.
4905 Use strip_trailing_slashes rather than open-coding it.
4907 2001-01-03 Paul Eggert <eggert@twinsun.com>
4909 * strftime.c: Sync with glibc time/strftime.c 1.81.
4911 2001-01-03 Jim Meyering <meyering@lucent.com>
4913 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
4914 local `inptr' to avoid warning with some system declarations of iconv.
4916 2000-12-29 Paul Eggert <eggert@twinsun.com>
4918 * modechange.c: Do not assume that mode_t uses the
4919 traditional octal encoding. E.g. "chmod 1 FOO" should set
4920 the other-execute bit of FOO even if S_IXOTH != 1.
4922 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
4923 WOTH, XOTH, ALLM): New macros.
4924 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
4925 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
4927 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
4928 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
4930 No need to use uintmax_t; unsigned long is long enough.
4931 Don't bother to get suffix since we don't use it.
4933 2000-12-24 Jim Meyering <meyering@lucent.com>
4935 * hash.c (is_prime): Return explicit boolean values.
4936 (hash_get_first): Return NULL to appease Irix5.6's 89.
4937 Reported by Nelson Beebe.
4939 2000-10-31 Bruno Haible <haible@clisp.cons.org>
4941 * localcharset.c (locale_charset): Add support for Win32.
4943 2000-12-18 Paul Eggert <eggert@twinsun.com>
4945 * physmem.h, physmem.c: New files.
4947 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
4948 (noinst_HEADERS): Add physmem.h.
4950 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
4951 't' for compatibility with Solaris 8 sort.
4953 2000-12-18 Bruno Haible <haible@clisp.cons.org>
4955 * config.charset: Add support for BeOS.
4957 2000-12-16 Jim Meyering <meyering@lucent.com>
4959 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
4960 SHELLS_FILE to a file name that's useful on djgpp systems.
4962 (ADDITIONAL_DEFAULT_SHELLS): Define.
4963 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
4964 Based mostly on a patch from Prashant TR.
4966 2000-12-16 Jim Meyering <meyering@lucent.com>
4968 This bug had a serious impact on chown: `chown N:M FILE' (for integer
4969 N and M) would have treated it like `chown N:N FILE'.
4971 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
4973 2000-10-31 Bruno Haible <haible@clisp.cons.org>
4975 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
4976 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
4977 to the list of canonical encodings. Rename EUC-CN to GB2312.
4979 2000-12-08 Andreas Schwab <schwab@suse.de>
4981 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
4982 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
4984 2000-12-07 Jim Meyering <meyering@lucent.com>
4986 * stripslash.c (ISSLASH): Define.
4987 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
4990 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
4991 (dir_name_r): Declare this function as static.
4992 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
4993 manifest itself on a name containing a mix of slashes and
4995 Make this function work with names starting with a DOS-style
4996 drive letter and colon prefix.
4997 (dir_name): Append `.' if necessary.
4998 Based mostly on patches from Prashant TR and Eli Zaretskii.
5000 * dirname.h (dir_name_r): Remove prototype.
5002 2000-12-05 Jim Meyering <meyering@lucent.com>
5004 * dirname.c (dir_name_r): Add `const' in a few local declarations.
5006 2000-12-04 Jim Meyering <meyering@lucent.com>
5008 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
5009 Also include memory.h, stdlib.h, unistd.h if appropriate.
5010 Reported by Andreas Jaeger (conflicting declaration of malloc).
5012 2000-12-02 Jim Meyering <meyering@lucent.com>
5014 * closeout.h: Make idempotent, to avoid some obscure warnings.
5016 2000-12-01 Paul Eggert <eggert@twinsun.com>
5018 * memrchr.c: Include <config.h> before any system include file.
5020 2000-11-29 Paul Eggert <eggert@twinsun.com>
5022 * dirname.c (dir_name_r): Fix typo: int -> size_t.
5024 2000-11-26 Jim Meyering <meyering@lucent.com>
5026 * memcoll.c: Include sys/types.h. From Werner Almesberger.
5028 2000-11-22 Paul Eggert <eggert@twinsun.com>
5030 * strftime.c (my_strftime): Do not invoke mbrlen with a
5031 size of (size_t) -1; it's not portable.
5033 2000-11-17 Akim Demaille <akim@epita.fr>
5035 * obstack.h: Formatting changes.
5036 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
5037 prevent type checking.
5038 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
5039 cast the value to (void *): assigning a `foo *' to a `void *'
5041 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
5043 2000-11-17 Jim Meyering <meyering@lucent.com>
5045 * strstr.c: Update from GNU libc.
5047 2000-11-16 Jim Meyering <meyering@lucent.com>
5049 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
5051 2000-11-11 Jim Meyering <meyering@lucent.com>
5053 * error.c: Add a couple #includes, merging from GNU libc version.
5055 2000-11-10 Jim Meyering <meyering@lucent.com>
5057 * obstack.h: Update from GNU libc.
5058 * obstack.c: Likewise.
5060 2000-11-06 Paul Eggert <eggert@twinsun.com>
5062 * getusershell.c (setusershell): Use rewind rather than
5063 fseek/fseeko, to avoid configuration hassles with fseeko.
5064 Don't bother opening SHELLS_FILE if shellstream is NULL;
5067 2000-11-05 Jim Meyering <meyering@lucent.com>
5069 * makepath.h (make_dir): Declare.
5070 * makepath.c (make_dir): Remove `static' attribute.
5073 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
5075 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
5076 last one in a bucket, advance to the next bucket.
5078 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
5080 * fnmatch.c: Do not comment out all the code if we are using
5081 the GNU C library, because in some cases we are replacing buggy
5082 code in the GNU C library itself.
5084 2000-10-30 Paul Eggert <eggert@twinsun.com>
5086 * error.h, getline.h, modechange.h:
5087 Remove "2000" from Copyright line, as the file hasn't been
5088 changed this year other than in the copyright notice.
5090 * xalloc.h: Add "2000" to Copyright line, as this file
5091 was changed this year.
5093 2000-10-30 Paul Eggert <eggert@twinsun.com>
5095 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
5096 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
5097 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
5099 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
5101 * regex.h (__restrict_arr): Move definition out of #ifndef block.
5102 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
5103 doesn't define __restrict_arr.
5105 2000-10-29 Jim Meyering <meyering@lucent.com>
5107 * xstat.in: Fix grammar in comment.
5109 2000-10-28 Jim Meyering <meyering@lucent.com>
5111 * memchr.c: Update from libc.
5112 Adjust for portability:
5113 [HAVE_STDLIB_H]: Include stdlib.h.
5114 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
5115 Undef __memchr, too.
5116 [!weak_alias]: Define __memchr to memchr.
5118 * regex.c: Update from libc.
5119 * regex.h: Likewise.
5120 * getopt1.c: Likewise.
5121 * memcmp.c: Likewise.
5123 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
5124 Avoid using fseek, when possible -- it's broken by design.
5125 Patch by Ulrich Drepper.
5127 2000-10-26 Jim Meyering <meyering@lucent.com>
5129 * strftime.c: Update from libc.
5131 2000-10-25 Jim Meyering <meyering@lucent.com>
5133 * obstack.c: Update from libc.
5135 2000-10-23 Jim Meyering <meyering@lucent.com>
5137 * hard-locale.c (hard_locale): Revert last change -- it was simply
5138 wrong. That set_locale call must not have any side effects.
5141 2000-10-22 Jim Meyering <meyering@lucent.com>
5143 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
5144 [CYCLIC]: Remove now-unused definition.
5146 * save-cwd.c (O_DIRECTORY): Define, if needed.
5147 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
5148 Suggestion from Ulrich Drepper.
5150 2000-10-21 Jim Meyering <meyering@lucent.com>
5152 * dirname.c (dir_name_r): New function, factored out of dir_name.
5153 (dir_name): Use dir_name_r.
5154 * dirname.h (dir_name_r): Declare it.
5156 2000-10-21 Jim Meyering <meyering@lucent.com>
5158 * dirname.c (memrchr): Declare if necessary.
5159 (dir_name): Remove the restriction that there be no
5160 trailing slashes. Now, this code skips past them, effectively
5162 [TEST_DIRNAME] (main): New unit tests.
5164 * memrchr.c: New file from GNU libc.
5165 Undef __memrchr, too.
5166 [!weak_alias]: Define __memrchr to memrchr.
5167 Guard weak_alias use with `#ifdef weak_alias'.
5169 2000-10-17 Jim Meyering <meyering@lucent.com>
5171 * quote.h (PARAMS): Define and use.
5172 Reported by Akim Demaille.
5174 * getopt.c: Update from libc.
5176 2000-10-16 Jim Meyering <meyering@lucent.com>
5178 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
5181 2000-09-25 Jim Meyering <meyering@lucent.com>
5183 * md5.h (rol): Define (from GnuPG).
5185 * sha.c: Give credit (GnuPG) where due.
5186 (M): Use rol rather than open-coding it.
5187 Add a FIXME comment.
5189 2000-09-21 Jim Meyering <meyering@lucent.com>
5191 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
5192 Reported by Michael Stone.
5194 2000-09-20 Jim Meyering <meyering@lucent.com>
5196 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
5197 (noinst_HEADERS): Add sha.h.
5198 Based on code from Scott G. Miller and from GnuPG.
5200 2000-09-15 Jim Meyering <meyering@lucent.com>
5202 * regex.c: Update from libc.
5204 2000-09-10 Jim Meyering <meyering@lucent.com>
5206 * getopt.c (_getopt_internal): Update from glibc.
5208 2000-09-09 Jim Meyering <meyering@lucent.com>
5210 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
5211 think it should be used as a general replacement for isascii.
5212 * fnmatch.c: Likewise.
5213 * mbswidth.c: Likewise
5214 * regex.c: Likewise.
5217 * userspec.c: Include sys/param.h and limits.h.
5219 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
5220 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
5221 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
5222 UID, GID. Check range.
5224 2000-09-06 Jim Meyering <meyering@lucent.com>
5226 * getopt.c (_getopt_internal): Update from glibc.
5228 2000-08-30 Jim Meyering <meyering@lucent.com>
5230 * strftime.c: Merge in changes from GNU libc.
5232 2000-08-26 Jim Meyering <meyering@lucent.com>
5234 * closeout.c: Include "__fpending.h".
5235 (close_stdout_status): Return right away if there's nothing to flush.
5237 * Makefile.am (noinst_HEADERS): Add __fpending.h.
5238 * __fpending.c: New file.
5239 * __fpending.h: New file.
5241 2000-08-07 Paul Eggert <eggert@twinsun.com>
5243 Standardize on "memory exhausted" instead of "Memory exhausted"
5244 or "virtual memory exhausted".
5245 * obstack.c (print_and_abort): Use "memory exhausted", not
5246 "virtual memory exhausted".
5247 * same.c (same_name): Invoke xalloc_die instead of printing
5249 * userspec.c (parse_user_spec): Likewise.
5250 * bumpalloc.h: comment fix
5251 * same.c, userspec.c: Include xalloc.h.
5253 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
5254 not char *const and pointing to a constant array.
5255 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
5256 (xrealloc): Comment fix.
5258 * userspec.c (parse_user_spec):
5259 Don't translate a message until just before returning,
5260 to avoid unnecessary translation.
5262 2000-08-07 Jim Meyering <meyering@lucent.com>
5264 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
5265 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
5266 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
5267 getgroups.c, gethostname.c, getopt.h, group-member.c,
5268 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
5269 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
5270 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
5271 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
5272 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
5273 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
5274 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
5275 yesno.c: Back out Copyright date changes for each file with no change
5276 this year. This eases coordination with other programs using the same
5277 source code modules. From Paul Eggert.
5279 2000-08-03 Greg McGary <greg@mcgary.org>
5281 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
5282 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
5283 (EXTEND_BUFFER): Use them.
5285 2000-08-01 Jim Meyering <meyering@lucent.com>
5287 * dirname.c (ISSLASH): Define.
5288 (BACKSLASH_IS_PATH_SEPARATOR): Define.
5289 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
5290 both `\' and `/' may be use as path separators.
5291 Based on a patch from Prashant TR.
5293 2000-07-31 Paul Eggert <eggert@twinsun.com>
5295 * quotearg.c (quotearg_n_options): Don't make the initial
5296 slot vector a constant, since it might get modified.
5298 2000-07-31 Jim Meyering <meyering@lucent.com>
5300 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
5301 * obstack.c (print_and_abort): Likewise.
5303 2000-07-30 Paul Eggert <eggert@twinsun.com>
5305 * quotearg.c (quotearg_n_options): Preallocate a slot 0
5306 buffer, so that the caller can always quote one small
5307 component of a "memory exhausted" message in slot 0.
5308 From a suggestion by Jim Meyering.
5310 2000-07-30 Jim Meyering <meyering@lucent.com>
5312 * makepath.c (make_path): Quote the other instance, too.
5314 * quotearg.c (N_STATIC_SLOTVECS): Define.
5315 (STATIC_BUF_SIZE): Define.
5316 (quotearg_n_options): Use only statically allocated storage when
5317 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
5318 than STATIC_BUF_SIZE.
5320 2000-07-29 Jim Meyering <meyering@lucent.com>
5322 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
5323 * dirname.c (dir_name): Likewise.
5325 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
5327 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
5328 (dir_name): Assert that there are no trailing slashes.
5330 2000-07-18 Bruno Haible <haible@clisp.cons.org>
5332 * mbswidth.h (mbswidth): Add a flags argument.
5333 (mbswidth): New declaration.
5334 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
5335 * mbswidth.c (mbswidth): Add a flags argument.
5336 (mbsnwidth): New function.
5338 2000-07-24 Jim Meyering <meyering@lucent.com>
5340 * mbswidth.c: Remove useless #else. From Bruno Haible.
5342 2000-07-23 Paul Eggert <eggert@twinsun.com>
5344 * mbswidth.c (_XOPEN_SOURCE):
5345 Don't define; this causes problems on Solaris 7.
5346 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
5348 2000-07-23 Paul Eggert <eggert@twinsun.com>
5351 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
5352 so that mbstate_t is always defined.
5354 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
5355 be 1 in at least one GCC installation, and this configuration
5356 error is likely to be common. Ignoring MB_LEN_MAX hurts
5357 performance on hosts that have mbrtowc but have only unibyte
5358 locales, but I assume these hosts are rare.
5360 2000-07-23 Paul Eggert <eggert@twinsun.com>
5362 * quotearg.c: Streamline by invoking multibyte code only if needed.
5363 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
5364 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
5365 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
5366 invoke multibyte primitives.
5368 2000-07-23 Jim Meyering <meyering@lucent.com>
5370 * basename.c (base_name): Add an assertion.
5372 2000-07-15 Bruno Haible <clisp.cons.org>
5374 * quotearg.c: When the system forces us to redefine mbstate_t,
5375 shadow its mbsinit function.
5377 2000-07-16 Bruno Haible <haible@clisp.cons.org>
5379 * mbswidth.h: New file.
5380 * mbswidth.c: New file.
5381 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
5382 (noinst_HEADERS): Add mbswidth.h.
5384 2000-07-17 Bruno Haible <haible@clisp.cons.org>
5386 * config.charset: Add support for FreeBSD. Improve support for HP-UX
5389 2000-07-15 Jim Meyering <meyering@lucent.com>
5391 * makepath.c: Include quote.h.
5392 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
5393 corresponding argument in a `quote (...)' call.
5394 Give better diagnostics.
5396 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
5397 (noinst_HEADERS): Add quote.h.
5399 * quote.c (quote, quote_n): New file. Two functions taken verbatim
5400 from tar's src/misc.c.
5401 * quote.h: New file. Prototypes for same.
5403 2000-07-10 Paul Eggert <eggert@twinsun.com>
5405 From a suggestion by Bruno Haible.
5406 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
5407 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
5408 to decide whether to define the BeOS workaround macro;
5409 this adjusts to the change to AC_MBSTATE_T.
5411 2000-07-13 Paul Eggert <eggert@twinsun.com>
5413 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
5415 * quotearg.c (quoting_style_args, quoting_style_vals,
5416 quotearg_buffer_restyled): Add support for
5417 clocale_quoting_style. Undo previous change to
5418 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
5419 and "{RIGHT QUOTATION MARK}" msgids.
5421 2000-07-05 Paul Eggert <eggert@twinsun.com>
5423 The old behavior of quoting `like this' doesn't look good with
5424 newer, ISO-style fonts. See:
5425 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
5427 Instead, quote "like this" by default. Let the translator
5428 tailor the locale-specific quoting behavior by providing
5429 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
5431 * quotearg.c (N_): New macro.
5432 (gettext_default): New function.
5433 (quotearg_buffer_restyled): Use
5434 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
5435 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
5437 2000-07-09 Jim Meyering <meyering@lucent.com>
5439 * Most files: Update copyright dates to include 2000.
5441 2000-07-08 Jim Meyering <meyering@lucent.com>
5443 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
5445 (xgethostname): Remove now-unnecessary #ifdef.
5446 Move declaration of `err' into loop where it's used.
5448 2000-07-05 Bruno Haible <haible@clisp.cons.org>
5450 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
5451 by allocating a larger buffer. Test the gethostname return value for
5452 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
5453 returns an error and ENAMETOOLONG isn't defined.
5455 2000-07-05 Paul Eggert <eggert@twinsun.com>
5456 and Bruno Haible <haible@clisp.cons.org>
5458 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
5460 2000-07-05 Bruno Haible <haible@clisp.cons.org>
5462 * quotearg.c (struct quoting_options): Simplify quote_these_too
5465 2000-07-03 Jim Meyering <meyering@lucent.com>
5467 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
5468 Reported by Bruno Haible.
5470 2000-07-04 Jim Meyering <meyering@lucent.com>
5472 * quotearg.c: Make inclusion of <wchar.h> independent of whether
5473 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
5476 2000-07-03 Paul Eggert <eggert@twinsun.com>
5477 and Bruno Haible <haible@clisp.cons.org>
5479 * quotearg.c (mbrtowc):
5480 Assign to *pwc, and return 1 only if result is nonzero.
5481 (iswprint): Use ISPRINT when substituting our own mbrtowc.
5483 2000-07-03 Jim Meyering <meyering@lucent.com>
5485 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
5486 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
5489 2000-07-02 Jim Meyering <meyering@lucent.com>
5491 * quotearg.c (mbstate_t): Don't define here.
5493 2000-07-02 Jim Meyering <meyering@lucent.com>
5495 * nanosleep.c (SIGCONT): Define if not already defined.
5497 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5499 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
5500 per change in ../m4/ls-mntd-fs.m4.
5501 (read_filesystem_list): Ignore symbolic links.
5503 2000-06-29 Jim Meyering <meyering@lucent.com>
5505 * same.c: Include <string.h> or <strings.h>, as appropriate,
5506 for declaration of strcmp.
5508 * long-options.c: Include <stdlib.h>, for declaration of exit.
5510 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
5511 Avoid warning by casting result to `char *' to remove `const'.
5513 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5515 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
5517 2000-06-26 Paul Eggert <eggert@twinsun.com>
5519 savedir now sets errno on failure and invokes xmalloc to get memory.
5520 Fix a couple of other minor bugs while we're at it.
5522 * savedir.c (<unistd.h>): Do not include; there's no need.
5523 (NAMLEN): Remove macro.
5524 (malloc, realloc): Remove decls.
5526 ("xalloc.h"): Include.
5527 (NAME_SIZE_DEFAULT): New macro.
5528 (savedir): Use xmalloc / xrealloc to allocate memory.
5529 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
5530 Skip "" directory entries.
5531 Use strlen to calculate directory entry length, since the old method
5532 is rarely used these days and isn't worth supporting.
5533 Don't use a pointer after freeing it.
5534 Check for integer overflow when calculating allocation size.
5535 Use memcpy to copy entries, instead of stpcpy.
5536 Set errno properly when returning NULL.
5537 Check for readdir error.
5539 2000-06-26 Jim Meyering <meyering@lucent.com>
5541 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
5543 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5545 * getusershell.c (xmalloc, xrealloc): Remove functions.
5547 Don't include <stdlib.h>. Don't declare malloc, realloc.
5549 2000-06-23 Bruno Haible <haible@clisp.cons.org>
5551 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
5553 2000-06-24 Jim Meyering <meyering@lucent.com>
5555 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
5557 2000-06-21 Jim Meyering <meyering@lucent.com>
5559 * getpass.c: New file, from Bruno Haible. Required for BeOS.
5561 2000-06-19 Paul Eggert <eggert@twinsun.com>
5563 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
5564 (mbrtowc, mbstate_t): Define substitutes if
5565 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
5566 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
5567 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
5569 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5571 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
5572 than 1024, return a memory chunk of least possible size, instead
5573 of size PATH_MAX + 2. In the loop, increment the size proportionally.
5574 Use free/xmalloc instead of xrealloc to avoid copying for very long
5577 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5579 * canon-host.c (canon_host): Use malloc and memcpy to copy an
5580 address, not strdup. Include <stdlib.h> and don't declare free().
5582 2000-06-17 Bruno Haible <haible@clisp.cons.org>
5584 * path-concat.c (path_concat): Don't access dir[-1] if dir is
5587 2000-06-21 Jim Meyering <meyering@lucent.com>
5589 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
5590 (noinst_HEADERS): Add getstr.h.
5592 * getline.c (getstr): Move into a separate file.
5593 * getstr.c (getstr): New file, extracted from getline.c, with
5594 the following changes: new parameter, delim2; both delim[12]
5595 parameters have type `int', not `char'. The latter would lose
5596 with 8-bit delimiters.
5597 * getstr.h: New file.
5599 2000-06-19 Jim Meyering <meyering@lucent.com>
5601 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
5603 2000-06-18 Jim Meyering <meyering@lucent.com>
5605 * mkdir.c: Remove file, due mainly to copyright incompatibility.
5606 Besides, these days every porting target provides a mkdir function.
5608 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
5609 (this snippet comes from src/system.h).
5611 2000-06-15 Paul Eggert <eggert@twinsun.com>
5613 * human.c (adjust_value): New function.
5614 (human_readable_inexact): Apply rounding style even when
5615 printing approximate values.
5617 2000-06-14 Paul Eggert <eggert@twinsun.com>
5619 * human.c (human_readable_inexact): Allow an input block
5620 size that is not a multiple of the output block size, and vice versa.
5621 Reported by Piergiorgio Sartor.
5623 2000-06-14 Paul Eggert <eggert@twinsun.com>
5625 * getdate.y (get_date): Apply relative times after time
5626 zone indicator, not before. Reported by Todd A. Jacobs.
5628 2000-06-13 Jim Meyering <meyering@lucent.com>
5630 * Makefile.am (all-local): Depend on lstat.c and stat.c.
5632 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
5634 2000-06-12 Paul Eggert <eggert@twinsun.com>
5636 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
5638 2000-06-04 Paul Eggert <eggert@twinsun.com>
5640 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
5642 2000-06-04 Jim Meyering <meyering@lucent.com>
5644 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
5645 SunOS 4.1.4 for which gid_t is an unsigned type.
5647 2000-06-03 Jim Meyering <meyering@lucent.com>
5649 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
5651 2000-05-26 Bruno Haible <haible@clisp.cons.org>
5653 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
5654 newer, don't install charset.alias.
5655 * config.charset: Change the Linux/glibc rules so they become empty
5656 on glibc-2.1 or newer.
5658 2000-06-02 Jim Meyering <meyering@lucent.com>
5660 * mountlist.c: Back out last change. Instead, do this...
5661 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
5662 member using the same `ignore'-testing code.
5663 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
5667 2000-05-29 Jim Meyering <meyering@lucent.com>
5669 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
5670 with the `ignore' attribute. Based on a patch from Mark D. Roth.
5672 2000-05-22 Jim Meyering <meyering@lucent.com>
5674 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
5676 2000-05-18 Jim Meyering <meyering@lucent.com>
5678 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
5679 back, too, since it may have been modified by allocate_entry.
5680 (hash_delete): Rewrite to use neither the assignment operator
5681 nor the comma operator in an if-expression.
5683 2000-05-15 Paul Eggert <eggert@twinsun.com>
5686 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
5687 Remove; no longer needed.
5688 "quotearg.h": Add include.
5689 (file_name): Do not bother to explicitly initialize to NULL; it's less
5690 efficient on some hosts.
5691 (close_stdout_status): Remove test as to whether stdout was already
5692 closed; it breaks for the case "echo x | sort >&-".
5693 Quote file name colons.
5694 Do not assume that _("write error") lacks format strings.
5696 2000-05-15 Jim Meyering <meyering@lucent.com>
5698 * version-etc.c (version_etc_copyright): Update the copyright string
5699 used in all --version output.
5701 2000-05-14 Jim Meyering <meyering@lucent.com>
5703 * closeout.c (close_stdout_set_file_name): New function.
5704 (close_stdout_status): Use new file-scoped global.
5705 Return right away if fstat says the stdout file descriptor is invalid.
5706 * closeout.h (close_stdout_set_file_name): Declare.
5708 2000-05-10 Jim Meyering <meyering@lucent.com>
5710 * closeout.c [default_exit_status]: New file-scoped variable.
5711 (close_stdout_set_status): New function.
5712 * closeout.h (close_stdout_set_status): Declare.
5714 2000-05-08 Jim Meyering <meyering@lucent.com>
5716 * long-options.c: Don't include closeout.h.
5717 (parse_long_options): Don't call close_stdout for --version.
5719 2000-05-06 Jim Meyering <meyering@lucent.com>
5721 * strnlen.c: Undefine __strnlen and strnlen.
5722 [!weak_alias]: Define __strnlen to strnlen.
5724 * atexit.c: New file, from libiberty.
5726 2000-05-06 Jim Meyering <meyering@lucent.com>
5728 * closeout.c (close_stdout_status): Also check for errors on the
5731 2000-05-05 Bruno Haible <haible@clisp.cons.org>
5733 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
5734 instead of xmalloc, xrealloc, path_concat.
5735 (locale_charset): Treat empty environment variables as absent.
5736 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
5738 2000-05-04 Jim Meyering <meyering@lucent.com>
5740 * getopt.c: Update from glibc.
5741 * obstack.c: Likewise.
5742 * obstack.h: Likewise.
5743 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
5745 * regex.h: Likewise.
5746 * strndup.c: Likewise.
5747 * strnlen.c: New file, from glibc.
5749 2000-05-01 Jim Meyering <meyering@lucent.com>
5751 * full-write.c (full_write): Remove `FIXME' part of comment.
5753 2000-04-29 Jim Meyering <meyering@lucent.com>
5755 * path-concat.c: Declare strdup only if it's not defined.
5756 * canon-host.c: Likewise.
5758 2000-04-28 Jim Meyering <meyering@lucent.com>
5760 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
5761 redefinition warning on some systems (HPUX). Otherwise, regex.h is
5762 included first, then limits.h is included by locale.h by libintl.h.
5763 From John David Anglin.
5765 2000-04-25 Jim Meyering <meyering@lucent.com>
5767 * makepath.c (S_IRWXUGO): Define.
5768 (make_path): Always perform explicit chmod if MODE specifies any
5769 of the `special' permission bits. Prompted by a bug report against
5770 install from Mate Wierdl and Joost van Baal.
5772 2000-04-18 Jim Meyering <meyering@lucent.com>
5776 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
5777 getpagesize. For BeOS. Based on a patch from Bruno Haible.
5779 2000-04-17 Jim Meyering <meyering@lucent.com>
5781 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
5782 the definition of it to rpl_strftime also defined-away the system's
5785 2000-04-15 Jim Meyering <meyering@lucent.com>
5787 Use `C' to denote so-called `contiguous' files, the same way
5789 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
5790 (ftypelet): Use S_ISCTG.
5791 From Michael Deutschmann.
5793 2000-04-14 Jim Meyering <meyering@lucent.com>
5795 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
5797 2000-04-08 Jim Meyering <meyering@lucent.com>
5799 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
5800 names don't conflict. Reported by Eli Zaretskii.
5802 2000-03-28 Bruno Haible <haible@clisp.cons.org>
5804 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
5805 bug. Deal with the different error behavior of Irix iconv.
5807 2000-04-07 Jim Meyering <meyering@lucent.com>
5809 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
5810 to work around system header problems on AIX 3.2.5. From Bruno Haible.
5812 2000-04-05 Jim Meyering <meyering@lucent.com>
5814 Portability tweaks required for ultrix4.3.
5815 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
5816 * readutmp.c: Include sys/types.h before sys/stat.h.
5817 * canon-host.c: Declare strdup.
5818 * path-concat.c: Likewise.
5819 From John David Anglin.
5821 2000-04-04 Jim Meyering <meyering@lucent.com>
5823 Be more DOS 8.3-friendly.
5824 * ref-add.sin: Renamed from ref-add.sed.in.
5825 * ref-del.sin: Renamed from ref-del.sed.in.
5826 * Makefile.am: Reflect renaming.
5827 Reported by Eli Zaretskii.
5829 Use a temporary file name that won't clash with `charset.alias'
5830 in the DOS 8.3 name space.
5831 * Makefile.am (charset_tmp): Define.
5832 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
5833 (uninstall-local): Likewise.
5834 Reported by Eli Zaretskii.
5836 2000-03-29 Paul Eggert <eggert@twinsun.com>
5838 * time/strftime.c (my_strftime): Make sure we call the system
5839 strftime, not ourselves, when invoking the underlying strftime.
5841 2000-03-24 Jim Meyering <meyering@lucent.com>
5843 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
5844 (charset_alias): Define.
5845 (install-exec-local): Factor out common code.
5846 (uninstall-local): Split lines longer than 80.
5847 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
5849 (.sed.in.sed): New rule. Don't redirect directly to $@.
5850 (CLEANFILES): Add ref-add.sed and ref-del.sed.
5852 2000-03-19 Bruno Haible <haible@clisp.cons.org>
5854 * config.charset: Output a line containing "Packages using this file".
5855 * ref-add.sed.in, ref-del.sed.in: New files.
5856 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
5857 ref-del.sed): New rules.
5859 2000-03-17 Jim Meyering <meyering@lucent.com>
5861 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
5862 Otherwise, include <strings.h>
5864 2000-03-17 Bruno Haible <haible@clisp.cons.org>
5866 * unicodeio.c (utf8_wctomb): New function.
5867 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
5868 format instead of in UCS-4 with platform dependent endianness.
5870 2000-03-07 Paul Eggert <eggert@twinsun.com>
5872 * savedir.c (savedir): Work even if directory size is
5873 negative; this can happen with some screwy NFS configurations.
5875 2000-03-06 Jim Meyering <meyering@lucent.com>
5877 * localcharset.c (get_charset_aliases): Don't try to free file_name
5878 if it's NULL (because we ran out of memory). From Bruno Haible.
5880 2000-03-05 Jim Meyering <meyering@lucent.com>
5882 * localcharset.c ("path-concat.h"): Include.
5883 (get_charset_aliases): Use path_concat instead of ANSI string
5886 * unicodeio.h (PARAMS): Define.
5887 Use it to guard prototype.
5889 2000-03-04 Jim Meyering <meyering@lucent.com>
5891 * Makefile.am (install-exec-local): Create $(libdir) before installing
5893 (uninstall-local): Uncomment this rule so `make distcheck' works
5896 * unicodeio.c (<errno.h>): Include it.
5897 (errno): Declare if not defined.
5899 * localcharset.c: Add Bruno's comment justifying use of volatile.
5901 * config.charset: New version, incorporating remarks from a linux
5902 i18n mailing list. From Bruno Haible.
5904 2000-03-02 Jim Meyering <meyering@lucent.com>
5906 * Makefile.am (EXTRA_DIST): Add config.charset.
5908 2000-03-01 Jim Meyering <meyering@lucent.com>
5910 * localcharset.c: Guard some #includes with `#if HAVE_...'.
5911 * unicodeio.c: Likewise.
5913 2000-02-02 Bruno Haible <haible@clisp.cons.org>
5915 * config.charset: New file.
5916 * localcharset.c: New file.
5917 * unicodeio.h, unicodeio.c: New files.
5918 * Makefile.am (DEFS): Add -DLIBDIR=...
5919 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
5920 (noinst_HEADERS): Add unicodeio.h.
5921 (all-local, install-exec-local, charset.alias): New targets.
5923 2000-02-28 Paul Eggert <eggert@twinsun.com>
5925 * quotearg.c (ALERT_CHAR): New macro.
5926 (quotearg_buffer_restyled): Use it.
5928 2000-02-27 Jim Meyering <meyering@lucent.com>
5930 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
5931 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
5933 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
5934 not `#if STDC_HEADERS'.
5935 Declare malloc if needed.
5937 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
5938 now that autoconf always defines the HAVE_DECL_ symbols.
5939 * human.c: Likewise.
5941 * strtoumax.c: Likewise.
5943 * backupfile.c: Arrange for cpp to fail if the configure-time
5944 declaration check was not run.
5946 * human.c: Likewise.
5948 * strtoumax.c: Likewise.
5950 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
5951 then first look up the entire `.'-containing string as a login name.
5953 2000-02-18 Paul Eggert <eggert@twinsun.com>
5955 * getdate.y: Handle two-digit years with leading zeros correctly.
5956 (textint): New typedef.
5957 (parser_control): Member year changed from int to textint.
5959 (YYSTYPE): Removed; replaced by %union with int and textint members.
5960 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
5961 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
5962 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
5963 (tSNUMBER, tUNUMBER): Now of type <textintval>.
5964 (date, number, to_year): Use width of number in digits, not its value,
5965 to determine whether it's a 2-digit year, or a 2-digit time.
5966 (yylex): Store number of digits of numeric tokens.
5967 Reported by John Kendall.
5969 (parser_control): Changed from struct parser_control to typedef (for
5970 consistency). All uses changed.
5972 (tID): Removed; not used.
5973 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
5975 2000-02-14 Paul Eggert <eggert@twinsun.com>
5977 * getpagesize.h (getpagesize): Port to VMS for Alpha;
5978 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
5980 2000-02-12 Jim Meyering <meyering@lucent.com>
5982 * userspec.c (ISDIGIT): Define it.
5983 (isdigit): Remove definition.
5984 (is_number): Use ISDIGIT, not isdigit.
5985 <libintl.h>: Include.
5987 (parse_user_spec): Mark translatable strings.
5989 2000-02-10 Jim Meyering <meyering@lucent.com>
5991 With these changes, nanosleep.[ch] are finally enough like the other
5992 lib/* replacement files to compile on a few more losing systems.
5994 * nanosleep.h: Don't include config.h.
5995 Remove prototype from declaration of nanosleep.
5996 (PARAMS): Remove now-unneeded definition.
5997 * nanosleep.c: #undef nanosleep.
5998 (rpl_nanosleep): Rename from nanosleep.
6000 2000-02-03 Jim Meyering <meyering@lucent.com>
6002 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
6003 rather than with `#if HAVE_UTMPNAME'.
6005 2000-02-01 Jim Meyering <meyering@lucent.com>
6007 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
6009 2000-01-31 Jim Meyering <meyering@lucent.com>
6011 * nanosleep.h (nanosleep): Guard declaration with
6012 `#if ! HAVE_DECL_NANOSLEEP'.
6013 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
6014 the declaration in that vendor's sys/timers.h.
6015 Reported by Christian Krackowizer.
6017 * quotearg.c (ISASCII): Add #undef and move definition to follow
6018 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
6019 (ISPRINT): Likewise.
6020 Reported by Tom Tromey.
6022 2000-01-30 Jim Meyering <meyering@lucent.com>
6024 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
6025 uses of ->ut_name. The latter doesn't work with new Linux header files
6026 where only utmpx.ut_user is declared.
6028 * readutmp.h (UT_USER): Define.
6030 2000-01-23 Jim Meyering <meyering@lucent.com>
6032 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
6035 2000-01-22 Jim Meyering <meyering@lucent.com>
6037 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
6038 [! HAVE_DECL_STRTOULL]: Declare strtoull.
6039 Required for some AIX systems. Reported by Christian Krackowizer.
6040 [TESTING] (main): New function.
6042 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
6043 * dirname.c (dir_name): Support for DOS-style file names with drive
6046 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
6048 * strverscmp.c (ISDIGIT): Define.
6049 (strverscmp): Use ISDIGIT, not isdigit.
6051 2000-01-17 Paul Eggert <eggert@twinsun.com>
6053 * nanosleep.c (nanosleep):
6054 Don't use SA_INTERRUPT to decide whether to call sigaction, as
6055 POSIX.1 doesn't require SA_INTERRUPT and some systems
6056 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
6057 it's been part of POSIX.1 since day 1 (in 1988).
6059 2000-01-17 Jim Meyering <meyering@lucent.com>
6061 * interlock: Remove unused file. Reported by François Pinard.
6063 2000-01-16 Paul Eggert <eggert@twinsun.com>
6065 * quotearg.c (quotearg_buffer_restyled): Do not quote
6066 alert, backslash, formfeed, and vertical tab unnecessarily in
6067 shell quoting style.
6070 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
6071 Free Software Foundation, Inc.
6072 Copying and distribution of this file, with or without modification,
6073 are permitted provided the copyright notice and this notice are preserved.