1 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
3 * glob.c: Say "invalid" rather than "illegal" in comments.
5 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7 * lib/mkdtemp.c, lib/setenv.c, lib/unsetenv.c: Normalize
8 inclusion of `config.h'.
10 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
12 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
13 AT_FDCWD exceeds INT_MAX.
14 * openat.h (AT_FDCWD): Likewise.
16 2006-02-14 Jim Meyering <jim@meyering.net>
20 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
21 failure on deficient systems, and simplify gnulib lgpl dependencies.
22 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
23 xmalloc/lstat combination. Based on a patch from Bruno Haible.
25 * xalloc-die.c: Remove unused definition of N_.
27 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
29 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
31 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
33 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
34 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
36 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
38 * argp-namefrob.h: Restore changes accidentally lost during the
39 "autoupdate" on 2005-12-12.
41 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
43 * fnmatch.c (L_): Renamed from L, to work around a bug in
44 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
45 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
48 2006-01-26 Simon Josefsson <jas@extundo.com>
50 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
51 prototype is visible on mingw32.
53 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
56 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
59 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
61 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
62 attempt to open for write; this always fails, at least on POSIX
63 hosts. This reinstates the 2006-01-09 change, which was
64 inadvertently removed.
66 2006-01-26 Bruno Haible <bruno@clisp.org>
67 Paul Eggert <eggert@cs.ucla.edu>
70 [(! (defined __cplusplus || defined __BEOS__)
72 && !(defined __HP_cc || defined __xlc__
73 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
75 #define to signed char in these cases too; this simplifies
76 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
77 etc., separately) and makes it more conservative.
79 2006-01-21 Jim Meyering <jim@meyering.net>
81 Sync from the stable (b5) branch of coreutils:
83 * fts.c (fts_children): Don't let close() clobber errno from
86 * fts.c (fts_stat): When following a symlink-to-directory,
87 don't necessarily interpret stat-fails+lstat-succeeds as indicating
88 a dangling symlink. That can also happen at least for ELOOP.
89 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
90 FYI, this bug predates the inclusion of fts.c in coreutils.
92 * fts.c (fts_open): Put new maxarglen declaration and uses
93 in their own block, so pre-c99 compilers don't object.
95 Avoid the double-free (first in fts_read, second in fts_close) that
96 would occur when an `active' directory is made inaccessible (e.g.,
97 via chmod a-x) during a traversal.
98 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
99 before returning. Reproduce this failure by
100 mkdir -p a/b; cd a; chmod a-x . b
101 Reported by Stavros Passas.
103 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
105 * argp-namefrob.h: Bugfix. Remove stray #
107 2006-01-25 Bruno Haible <bruno@clisp.org>
109 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
111 Reported by Paul Eggert.
113 2006-01-25 Jim Meyering <jim@meyering.net>
115 * fileblocks.c: Remove more useless parentheses.
116 * readutmp.h: Likewise.
118 2006-01-24 Bruno Haible <bruno@clisp.org>
120 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
122 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
125 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
126 to avoid problems with the built-in _Bool type.
127 Reported by Paul Eggert on 2005-11-26.
129 2006-01-24 Jim Meyering <jim@meyering.net>
131 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
133 2006-01-24 Simon Josefsson <jas@extundo.com>
135 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
138 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
140 Work around porting bugs reported by Dieter in
141 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
142 * getopt.c (_NOPROTO): Remove; no longer needed.
143 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
144 Include "getopt.h" first, to check interface.
145 (getenv): Declare only if defined HAVE_DECL_GETENV &&
147 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
148 (__strndup): Revert to K&R-style function dfns, the glibc style.
149 * strnlen.c: Don't claim it's taken from glibc; it's not.
150 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
151 Include strnlen.h first, to get prototype properly.
152 (strnlen): Renamed from __strnlen.
155 2006-01-23 Ulrich Drepper <drepper@redhat.com>
157 These changes imported from libc.
158 * getopt.c: Use __fxprintf instead of inline stream orientation
159 test and two separate function calls.
160 * strndup.c (__strndup): Add libc_hidden_def.
162 2006-01-22 Bruno Haible <bruno@clisp.org>
164 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
165 temporary buffer for sprintf, take into account the precision also
166 for 'd', 'i', 'u', 'o', 'x', 'X'.
168 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
170 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
171 to pacify gcc -Wswitch-default.
173 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
175 * argp-help.c (usage_long_opt): Do not print DOC options.
176 (__argp_base_name): Removed
177 * argp-namefrob.h (__argp_basename): Removed definition. Was a
179 (__argp_base_name): Provide macro definition or extern declaration
180 depending on the configuration
182 2006-01-20 Simon Josefsson <jas@extundo.com>
184 * inet_ntop.h: Unconditionally include sys/socket.h.
186 2006-01-19 Simon Josefsson <jas@extundo.com>
188 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
190 2006-01-12 Simon Josefsson <jas@extundo.com>
192 * base64.c: Fix warning, reported by Bruno Haible
193 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
195 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
198 * md5.c: Fix commentary typos.
199 (alignof, UNALIGNED_P): No need for a GCC-specific version.
200 * md5.h (__attribute__): Remove; unused.
201 * sha1.c: Fix commentary to match md5 better.
202 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
203 so that we don't need to worry about alignment. All uses changed.
204 This merges the 2005-10-28 md5 change into sha1.
206 2006-01-11 Jim Meyering <jim@meyering.net>
209 * md5.c (OP): Fix spacing.
211 2006-01-11 Simon Josefsson <jas@extundo.com>
213 * stdint_.h (SIZE_MAX): Add missing (.
215 2006-01-10 Bruno Haible <bruno@clisp.org>
217 * argp.h (__const): Remove macro. Use const instead.
218 * argp-fmtstream.h (__const): Likewise.
219 * glob_.h (__const): Remove macro.
220 * glob-libc.h: Use const instead of __const.
222 2006-01-10 Jim Meyering <jim@meyering.net>
224 Avoid the double-free (first in fts_read, second in fts_close) that
225 would occur when an `active' directory is made inaccessible (e.g.,
226 via chmod a-x) during a traversal.
227 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
228 before returning. Reproduce this failure by
229 mkdir -p a/b; cd a; chmod a-x . b
230 Reported by Stavros Passas.
233 * sha1.c: Tweak grammar in a comment.
235 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
237 * regex_internal.h (BITSET_WORD_BITS):
238 Work around a bug in 64-bit PGC (before version 6.1-2), where the
239 preprocessor mishandles large unsigned values as if they were signed.
240 Problem reported by Claudio Fontana in
241 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
243 2006-01-10 Simon Josefsson <jas@extundo.com>
245 * socket_.h: New file.
247 2006-01-10 Bruno Haible <bruno@clisp.org>
249 * localcharset.c: Update from GNU gettext.
251 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
254 * chdir-long.c (cdb_free): Don't bother trying to open directory
255 for write access: POSIX says that must fail.
256 * fts.c (diropen): Likewise.
257 * save-cwd.c (save_cwd): Likewise.
258 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
259 well, for minor improvements on hosts that lack O_DIRECTORY.
260 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
261 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
262 Fall back on chown if open failed with EACCES.
264 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
265 Report an error at compile-time if only a 1-second nominal clock
268 * lchmod.h: New file.
269 * mkdir-p.c: Include lchmod.h, lchown.h.
270 (make_dir_parents): Use lchown rather than chown, and
271 lchmod rather than chmod.
273 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
274 too. Problem with "none" reported by Bob Proulx. Problem with
275 "proc" reported by n0dalus.
277 * mountlist.c: Include <limits.h>.
278 (dev_from_mount_options)
279 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
280 New function. It no longer assumes "dev=" has the System V meaning
281 on Linux (since it doesn't). It also parses "dev=" more carefully.
282 (read_file_system_list)
283 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
284 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
287 * posixtm.h (PDS_PRE_2000): New macro.
288 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
289 All usages changed. Reject dates outside the range 1969-1999 if
290 PDS_PRE_2000 is used.
292 2006-01-09 Jim Meyering <jim@meyering.net>
296 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
298 * chdir-safer.h, chdir-safer.c: New files.
300 * modechange.c (mode_compile): Reject an invalid mode string
301 that starts with an octal digit. From Andreas Gruenbacher.
303 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
304 and dup to open_safer and dup_safer, respectively.
305 (openat_permissive): Fix typo in comment.
307 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
308 "gettext.h"; either no longer needed or are guaranteed by openat.h.
309 (_): Remove; no longer needed.
310 (openat): Renamed from rpl_openat; no need for rpl_openat
311 since openat.h renames openat for us.
312 Replace most of the body with a call to openat_permissive,
313 to avoid duplicate code.
314 Port to (probably hypothetical) environments were mode_t is
316 (openat_permissive): Require mode arg, so that we can check
317 types better. Put it just after flags. Change cwd failure
318 indicator from pointer-to-bool to pointer-to-errno-value.
320 Invoke openat_save_fail and/or openat_restore_fail if
321 cwd_errno is null, so that openat can call us.
322 (openat_permissive, fdopendir, fstatat, unlinkat):
323 Simplify errno handling to avoid some duplicate code,
324 as it's OK to set errno on success.
325 * openat.h: Revamp code so that function macros depend on
326 __OPENAT_PREFIX only, not also on AT_FDCWD.
327 (openat_ro): Remove. Caller changed to use openat_permissive.
328 (openat_permissive): Now a macro, if not a function.
329 (openat_restore_fail, openat_save_fail): Now always functions,
330 since mkdirat needs them even if __OPENAT_PREFIX is defined.
332 * openat-priv.h: New file, defining macros used by mkdirat.c
334 * mkdirat.c: Include openat-priv.h.
335 Remove definitions of macros defined therein.
336 * openat.c: Likewise.
338 * mkdirat.c (mkdirat): New file and function.
339 * openat.h (mkdirat): Declare.
341 * openat.c (fdopendir): Don't change errno when returning non-NULL.
343 * openat.h (openat_permissive): Declare.
346 * openat.c (EXPECTED_ERRNO): New macro.
347 (openat_permissive): New function -- used in remove.c rewrite.
348 (all functions): Set errno just before returning, only if there
349 was an actual failure.
350 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
352 Emulate openat-family functions using Linux's procfs, if possible.
353 Idea and some code based on Ulrich Drepper's glibc changes.
355 * openat.c: (BUILD_PROC_NAME): New macro.
356 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
357 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
358 before falling back on save_cwd and restore_cwd.
359 (fdopendir, fstatat, unlinkat): Likewise.
361 * openat.c (fstatat, unlinkat): Perform the syscall directly,
362 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
364 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
365 as second argument to va_arg. Otherwise, some versions of gcc
366 warn that `if this code is reached, the program will abort'.
368 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
372 Add POSIX ACL support
373 * acl.h (copy_acl, set_acl): Add declarations.
374 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
375 systems other than Linux.
376 (chmod_or_fchmod): New function: use fchmod when possible,
378 (file_has_acl): Add a POSIX ACL implementation, with a
379 Linux-specific subcase.
380 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
381 S_ISVTX from one file to another. Fall back to fchmod/chmod when
382 acls are unsupported.
383 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
384 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
387 2006-01-09 Bruno Haible <bruno@clisp.org>
389 * sysexit_.h (EX_OK): New macro.
390 Suggested by Martin Lambers <marlam@marlam.de>.
392 2006-01-09 Bruno Haible <bruno@clisp.org>
394 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
395 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
396 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
397 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
399 2006-01-09 Bruno Haible <bruno@clisp.org>
401 * stdint_.h (SIZE_MAX): Write the value without involving negative
404 2005-10-16 Bruno Haible <bruno@clisp.org>
406 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
407 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
409 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
411 * strftime.c (tzname): Don't declare if it is already #defined.
412 Problem reported for Mingw by Mark Junker.
414 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
416 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
417 long int, not int, for nanosecond counts, so that people who are
418 used to POSIX struct timespec won't be surprised. Reported by Jim
421 2005-12-16 Jim Meyering <jim@meyering.net>
423 * fprintftime.c, fprintftime.h: New files.
425 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
427 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
428 * argp-help.c (fill_in_uparams): Check if the constructed
429 struct uparams is valid. Fall back to the default values if it is
432 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
434 * argp-help.c (__argp_base_name): New function
435 (__argp_short_program_name): Rewrite using __argp_base_name
436 * argp-namefrob.h: Define program_invocation_name and
437 program_invocation_short_name if requested
438 (__argp_base_name): Add prototype
439 * argp-parse.c (argp_def): Use gettext wrappers
440 (argp_default_parser): Use __argp_base_name
441 * argp-pin.c: New file. Defines program_invocation_name and
442 program_invocation_short_name on systems that lack them.
444 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
446 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
447 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
448 porting problem reported by Georg Schwarz in
449 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
451 2005-07-09 Bruno Haible <bruno@clisp.org>
453 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
454 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
455 Reported by Mark Junker <mjscod@gmx.de>.
457 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
459 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
460 (uintmax_t) [defined uintmax_t]: Do not declare.
461 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
462 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
463 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
464 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
465 sake of portability to weird hosts that C allows (though we don't
466 know of any practical examples).
468 * savedir.h (fdsavedir): New decl.
469 * savedir.c (fdsavedir, savedirstream): New functions; the latter
470 contains most of the former guts of savedir.
471 (savedir): Use savedirstream.
474 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
476 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
477 coreutils no longer futzes with rounding modes.
479 2005-11-14 Jim Meyering <jim@meyering.net>
481 * mkstemp-safer.c: Include <config.h>, required for possible
482 replacement of mkstemp.
484 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
486 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
488 (gethrxtime) [! (HAVE_NANOUPTIME
489 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
490 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
491 our own approximation.
493 2005-11-10 Simon Josefsson <jas@extundo.com>
495 * readline.c: Remove EOL.
497 2005-11-08 Eric Blake <ebb9@byu.net>
499 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
501 2005-11-08 Eric Blake <ebb9@byu.net>
503 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
505 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
507 Fix porting problem reported by Theodoros V. Kalamatianos.
508 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
509 Don't assume that futimes failing means we must fail.
511 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
513 * getcwd.c (__getcwd): Don't assume that system calls after readdir
514 leave errno alone. Problem reported by Dmitry V. Levin.
516 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
518 * savedir.c (savedir): Don't assume that xrealloc etc. leave
519 errno alone. Problem reported by Frederic Jolliton.
521 2005-10-28 Simon Josefsson <jas@extundo.com>
523 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
524 "restrict" keywords, as per POSIX. Protect the function
525 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
526 Don't use K&R prototypes. Check the sprintf return values.
527 Re-define EAFNOSUPPORT if not present. Indent.
529 * md5.h, md5.c: Simplify buffer handling visavi alignment,
530 suggested by Bruno Haible <bruno@clisp.org>.
532 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
534 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
536 * gc-libgcrypt.c: Add MD2 (which is not available through
539 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
541 * md2.h, md2.c: New files.
543 2005-10-24 Simon Josefsson <jas@extundo.com>
545 * md4.h: Shrink buffer size, now that we changed the type.
547 2005-10-22 Simon Josefsson <jas@extundo.com>
549 * arcfour.h, arcfour.c: Use fixed size indices in the
550 arcfour_context struct (simplify test vector testing in GNU
553 2005-10-22 Simon Josefsson <jas@extundo.com>
555 * md4.h, md4.c: Simplify buffer handling visavi alignment,
556 suggested by Bruno Haible <bruno@clisp.org>.
558 2005-10-22 Simon Josefsson <jas@extundo.com>
560 * crc.h: Include stddef.h, for size_t.
562 2005-10-21 Simon Josefsson <jas@extundo.com>
564 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
565 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
567 2005-10-21 Simon Josefsson <jas@extundo.com>
569 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
572 2005-10-21 Simon Josefsson <jas@extundo.com>
574 * gc-gnulib.c: Support ARCTWO in CBC mode.
576 2005-10-21 Simon Josefsson <jas@extundo.com>
578 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
581 * hmac-sha1.c (hmac_sha1): Likewise.
583 * crc.c (crc32_update): Actually use crc parameter, suggested by
584 Bruno Haible <bruno@clisp.org>.
586 * crc.h: Include stdint.h directly, suggested by Bruno Haible
589 2005-10-21 Simon Josefsson <jas@extundo.com>
591 * des.h, des.c: New files.
593 * gc-gnulib.c: Support DES.c
595 2005-10-21 Simon Josefsson <jas@extundo.com>
597 * arctwo.h, arctwo.c: New files.
599 * gc-gnulib.c: Support ARCTWO.
601 2005-10-21 Simon Josefsson <jas@extundo.com>
603 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
605 2005-10-19 Simon Josefsson <jas@extundo.com>
607 * gc-gnulib.c: Support ARCFOUR.
609 2005-10-19 Simon Josefsson <jas@extundo.com>
611 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
614 * gc.h: Add ECB enum type.
616 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
618 2005-10-19 Simon Josefsson <jas@extundo.com>
620 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
622 2005-10-18 Simon Josefsson <jas@extundo.com>
624 * md4.h, md4.c: New files, based on md5.?.
626 2005-10-17 Simon Josefsson <jas@extundo.com>
628 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
630 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
632 2005-10-17 Simon Josefsson <jas@extundo.com>
634 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
636 2005-10-17 Simon Josefsson <jas@extundo.com>
638 * gc.h, gc-libgcrypt.c: Add ciphers.
640 2005-10-17 Simon Josefsson <jas@extundo.com>
642 * sha1.c: Use uint32_t instead of md5_uint32.t
644 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
647 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
649 * md5.h: Use stdint.h and uint32_t. Doc fix.
651 2005-10-15 Simon Josefsson <jas@extundo.com>
653 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
655 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
657 2005-10-14 Simon Josefsson <jas@extundo.com>
659 * arcfour.h, arcfour.c: New files.
661 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
663 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
664 include <wchar.h>; no longer needed.
666 2005-10-14 Jakub Jelinek <jakub@redhat.com>
667 and Ulrich Drepper <drepper@redhat.com>
670 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
671 instead of inline stream orientation test and two separate
672 function calls. Pay no attention to USE_IN_LIBIO.
674 2005-10-14 Roland McGrath <roland@redhat.com>
676 Import from libc. [BZ #1331]
677 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
679 Reported by Matej Vela <vela@debian.org>.
681 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
683 * mkdir-p.c (make_dir_parents): Don't report an error if an
684 intermediate directory is in a read-only file system. Problem
685 reported by Eric Blake.
687 2005-10-13 Simon Josefsson <jas@extundo.com>
689 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
690 Move memory allocation outside of loop.
692 2005-10-12 Simon Josefsson <jas@extundo.com>
694 * gc-pbkdf2-sha1.c: New file.
696 * gc.h: Add gc_pbkdf2_sha1 prototype.
698 2005-10-12 Simon Josefsson <jas@extundo.com>
700 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
701 suggested by Bruno Haible <bruno@clisp.org>.
703 2005-10-12 Simon Josefsson <jas@extundo.com>
705 * gc-libgcrypt.c (gc_hmac_sha1): New function.
707 * gc-gnulib.c (gc_hmac_sha1): New function.
709 2005-10-12 Simon Josefsson <jas@extundo.com>
711 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
713 2005-10-12 Simon Josefsson <jas@extundo.com>
715 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
716 GC_USE_HMAC_MD5, respectively.
718 * gc-libgcrypt.c (gc_md5): Fix assert call.
721 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
723 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
725 * gc-gnulib.c (gc_hash_buffer): Ditto.
727 2005-10-11 Bruno Haible <bruno@clisp.org>
729 * c-strcasestr.h: New file, from GNU gettext.
730 * c-strcasestr.c: New file, from GNU gettext.
732 2005-10-11 Bruno Haible <bruno@clisp.org>
734 * c-strcase.h: New file, from GNU gettext.
735 * c-strcasecmp.c: New file, from GNU gettext.
736 * c-strncasecmp.c: New file, from GNU gettext.
738 2005-10-11 Simon Josefsson <jas@extundo.com>
740 * crc.h, crc.c: New files.
742 * gc.h (gc_hash_buffer): Add doc.
744 2005-10-08 Simon Josefsson <jas@extundo.com>
746 * gc.h: Add gc_hash and gc_hash_buffer.
748 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
750 * gc-libgcrypt.c (gc_hash_buffer): Add.
752 2005-10-11 Bruno Haible <bruno@clisp.org>
754 * strcasecmp.c: Include limits.h.
755 (strcasecmp): Avoid integer overflow on exotic platforms.
756 * strncasecmp.c: Include limits.h.
757 (strncasecmp): Avoid integer overflow on exotic platforms.
758 Reported by Paul Eggert.
760 2005-10-06 Simon Josefsson <jas@extundo.com>
762 * hmac-md5.c: New file.
766 2005-10-06 Simon Josefsson <jas@extundo.com>
768 * memxor.c (memxor): Avoid casts and warnings.
770 2005-10-05 Derek Price <derek@ximbiot.com>
772 * getdelim.c (SIZE_MAX): New macro, if not already defined.
774 2005-10-05 Simon Josefsson <jas@extundo.com>
776 * memxor.c (memxor): Fix compiler error.
778 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
779 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
781 * memxor.h, memxor.c: New files.
783 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
784 we assume all systems have it, suggested by Jim Meyering
785 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
786 any systems lack sys/socket.h; mingw32 is known to lack it, but we
787 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
790 2005-10-04 Bruno Haible <bruno@clisp.org>
792 * verify.h (verify_true): Provide alternative definition for C++.
794 2005-10-04 Simon Josefsson <jas@extundo.com>
796 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
797 D. Baushke" <mdb@gnu.org>.
799 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
801 * getdelim.c: Include getdelim.h first. Include <limits.h>.
802 (SSIZE_MAX): New macro, if not already defined.
803 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
806 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
808 * exclude.c: Include verify.h.
809 (verify): Remove. All callers changed to use verify.h's version.
810 * strtoimax.c: Likewise.
811 * utimecmp.c: Likewis.e
814 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
815 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
816 * .cvsignore: Add fts.h, search.h, t-fpending.
817 * settime.c (settime): Fix { typo in previous patch. Also, don't
818 bother returning ENOSYS if settimeofday or stime fails; just let
819 them return whatever errno they want to return.
820 * utimens.c: Include unistd.h, for dup2.
821 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
822 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
824 2005-10-02 Jim Meyering <jim@meyering.net>
827 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
828 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
829 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
830 Remove AT_FDCWD test.
831 Do not consume the fd unless successful.
832 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
833 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
834 block, so that we don't even try to compile it if settimeofday is
835 available. This works around a compilation failure on OSF1 V5.1,
836 due to stime requiring a `long int*' while tv_sec is `int'.
838 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
840 * getdelim.c (getdelim): Remove unused variables.
842 2005-10-01 Simon Josefsson <jas@extundo.com>
844 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
845 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
846 AI_* and EAI_* definitions. Protect function declarations.
848 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
850 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
851 so that the code works even with ancient cpp. Portability problem
852 with GCC 2.7.2.1 reported by Thomas M.Ott.
854 2005-09-27 Jim Meyering <jim@meyering.net>
856 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
858 * intprops.h (signed_type_or_expr__): Define.
859 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
862 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
864 * verify.h (verify_expr): Remove, replacing with:
865 (verify_true): New macro that returns true instead of void.
866 (verify_type__): Remove.
867 (verify): Use verify_true rather than verify_type__.
869 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
871 * utimens.c (ENOSYS): Define if not already defined.
872 (futimens): Support having a null PATH if the file descriptor
875 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
877 (__attribute): Define to empty unless GCC 3.1 or later.
878 This works around a core dump on OpenBSD 3.4, which has GCC
879 2.95.3, which dumps core when given __attribute__(()). It also
880 simplifies other tests, since we really don't want to bother with
881 worrying about which ancient version of GCC supported what.
882 Original problem reported by Yoann Vandoorselaere, with part of
883 the fix suggested by Derek Price.
885 2005-09-24 Jim Meyering <jim@meyering.net>
887 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
888 so we can once again use a positive bitfield width of 1 -- now we
889 don't have to explain why we were using a bitfield width of 2.
891 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
893 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
894 Problem reported by Eric Blake.
895 (getaddrinfo): Initialize se so that it's not garbage.
896 Redo internal storage allocation so that it doesn't make unportable
897 assumptions about alignment.
900 * utimens.c (futimens): Use futimesat if available.
901 Prefer it to futimes since it doesn't have the futimes bug.
903 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
904 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
905 Instead, declare a function that returns a pointer to an array,
906 and use verify_type__ to declare the size of the array.
907 Problem and germ of a solution reported by Bruno Haible.
908 (verify_type__): Use 2, not 1, for bitfield size, to avoid
909 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
911 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
915 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
917 * argmatch.h: Include verify.h
918 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
919 (ARGMATCH_ASSERT): Remove; unused.
920 * canonicalize.c: Assume STDC_HEADERS.
921 * exclude.c: Include "strcase.h".
922 * regex_internal.h [!defined _LIBC]: Likewise.
923 * getusershell.c: Include stdio--.h rather than stdio.h
925 (getusershell): Call fopen, not fopen_safer.
926 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
927 Do not include unistd-safer.h.
928 (save_cwd): Don't call fd_safer; no longer needed
929 now that we include fcntl--.h.
931 * getdate.y (relative_time): New type.
932 (RELATIVE_TIME_0): New constant.
933 (parser_control): Use relative_time instead of doing it ourselves.
934 (%union): Add new relative_time rel member.
935 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
937 (relunit, relunit_snumber): Now of type rel.
938 (zone, rel, relunit, get_date): Adjust to above changes.
940 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
941 Do not include unistd-safer.h.
942 (getloadavg): Don't call fd_safer; no longer needed
943 now that we include fcntl--.h.
945 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
946 (make_dir_parents): Treat ENOSYS like EEXIST.
948 Improve quality of diagnostics on restore_cwd failure.
949 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
950 (make_dir_parents): Last arg is now int * (for errno), not bool *.
951 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
952 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
953 each time through the loop. Do not diagnose restore_cwd failure;
954 that is the caller's job (and perhaps the caller does not care).
956 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
957 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
958 If the file already exists but is not a directory, don't bother
959 to try to make its parents.
960 Close potential file descriptor leak if we can't chdir("/") (!).
961 Don't always return true if chdir($PWD) fails; return true only
962 if the requested action was done successfully (except for the
964 Don't log final directory unless we actually made it.
965 Refactor to avoid duplicate code to fix up permissions.
966 Don't attempt to fix up parent permissions if chdir($PWD) fails.
968 * strftime.c (my_strftime): Rewrite the previous change slightly,
969 to make it a bit faster and (I hope) clearer.
970 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
971 Fix bug in formats like %2N.
973 * verify.h: New file.
975 2005-09-22 Jim Meyering <jim@meyering.net>
979 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
981 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
982 the .tm_year member, since otherwise gcc-4.0 would now warn about
983 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
985 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
986 order to avoid an unsuppressible warning from gcc on 64-bit systems.
988 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
989 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
990 when run in a time zone for which daylight savings time is in effect
991 for the starting date.
993 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
994 stop us from restricting permissions of just-created absolute-named
996 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
997 to restore initial working directory.
998 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
999 to tell caller if/when we change the working directory and are
1000 unable to return to the initial one.
1001 * mkdir-p.h (make_dir_parents): Update prototype.
1002 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
1003 `return false'. This fixes a bug introduced on 2004-07-30.
1005 * openat.c (fdopendir): Be sure to close the supplied
1006 file descriptor before returning. This makes our replacement
1007 implementation a little closer to Solaris's, where fdopendir
1008 ties the file descriptor to the returned DIR* pointer.
1009 * openat.c (unlinkat): New function.
1010 * openat.h (unlinkat): Add prototype.
1011 * openat-die.c (openat_save_fail): Rename from openat_save_die.
1012 (openat_restore_fail): Rename from openat_restore_die.
1013 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
1015 Provide an alternative to exiting immediately upon save_cwd or
1016 restore_cwd failure. Now, an application can arrange e.g.,
1017 to perform a longjump in that case.
1018 * openat.c: Include dirname.h.
1019 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
1020 (rpl_openat, fdopendir, fstatat): Call openat_save_die
1021 and openat_restore_die rather than calling error directly.
1022 Don't include "error.h" or "exitfail.h"; they're no longer needed.
1024 * openat-die.c (openat_save_die, openat_restore_die): New file.
1025 * openat.h (openat_save_die, openat_restore_die): Declare and define.
1027 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
1028 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
1029 int utc, int nanoseconds);
1031 date should not have to allocate a megabyte of virtual memory to
1032 handle a format argument like +%1048575T. When implemented with
1033 strftime, it must allocate such a buffer, use strftime to fill it
1034 in, print it, then free it.
1035 With fprintftime, it simply prints everything and exits.
1036 With no need for memory allocation, that's one fewer way to fail.
1037 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
1038 optional field width, not before, so we accept %9:z, not %:9z.
1039 (my_strftime): Be sure to use L_('x') for literals.
1041 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
1042 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
1043 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
1044 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
1045 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
1046 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
1047 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
1048 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
1049 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
1051 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1052 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
1053 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1054 and don't include <sys/file.h>).
1056 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
1058 Sync from coreutils.
1060 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
1061 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
1062 [!LDAV_DONE]: Avoid unused variable warning.
1064 2005-09-21 Bruno Haible <bruno@clisp.org>
1066 * unicodeio.h (unicode_to_mb): New declaration.
1068 2005-09-20 Derek Price <derek@ximbiot.com>
1070 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
1072 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1074 Use a consistent style for including <config.h>.
1075 * __fpending.c, acl.c, argmatch.c,
1076 argp-help.c, argp-parse.c,
1077 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
1078 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
1079 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
1080 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
1081 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
1082 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
1083 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
1084 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
1085 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
1086 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
1087 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
1088 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
1089 modechange.c, mountlist.c, open-safer.c, physmem.c,
1090 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
1091 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
1092 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
1093 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
1094 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
1095 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
1096 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
1097 userspec.c, utimecmp.c, version-etc-fsf.c,
1098 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
1099 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
1100 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
1101 Standardize inclusion of config.h.
1102 * __fpending.h, dirfd.h, getdate.h, human.h,
1103 inttostr.h: Removed inclusion of config.h from header files.
1104 * inttostr.c: Adjusted in-tree users.
1105 * timespec.h: Remove superfluous warning to include config.h.
1106 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
1107 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
1108 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
1109 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
1111 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
1113 * stat-time.h: New file.
1114 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
1115 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
1117 (timespec_cmp): New function.
1118 * utimecmp.c: Include stat-time.h.
1119 (SYSCALL_RESOLUTION): Depend on whether various struct stat
1120 members exist, not on the obsolescent ST_MTIM_NSEC.
1121 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
1123 2005-09-15 Derek Price <derek@ximbiot.com>
1124 Paul Eggert <eggert@cs.ucla.edu>
1126 * regcomp.c, regexec.c, regex_internal.c: Back out previous
1127 changes, consolidating in...
1128 * regex_internal.h: ...this file.
1130 2005-09-15 Derek Price <derek@ximbiot.com>
1132 * regex_internal.h: Blank `pure' for GNUC < 3.
1133 * regex_internal.c: Ditto, using this...
1134 (__GNUC_PREREQ): ...new macro.
1135 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
1136 (__GNUC_PREREQ): ...this new macro.
1138 * strstr.h: Include string.h. Define strstr as a macro here.
1140 2005-09-13 Derek Price <derek@ximbiot.com>
1142 * canon-host.c (canon_host_r): Set *cherror on memory allocation
1144 Reported by Jim Meyering <jim@meyering.net>.
1146 2005-09-13 Jim Meyering <jim@meyering.net>
1148 * canon-host.c: Filter through gnu indent and reword comments slightly.
1149 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
1151 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1153 * lib/base64.c: Typo.
1154 (base64_encode): Put b64str in initialized data section.
1156 2005-09-12 Derek Price <derek@ximbiot.com>
1158 Return usable errors from canon-host.
1159 * canon-host.h: New file.
1160 * canon-host.c (canon_host): Wrap...
1161 (canon_host_r): ...this new function, which now relies exclusively on
1163 (ch_strerror): New function.
1164 (last_cherror): New global.
1165 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
1166 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
1168 (freeaddrinfo): Free ai->ai_canonname when set.
1170 2005-09-12 Derek Price <derek@ximbiot.com>
1171 Paul Eggert <eggert@cs.ucla.edu>
1173 * glob-libc.h: Renamed from glob_.h. The new version is
1174 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
1175 protecting things that should be done only in gnulib contexts.
1176 * glob_.h: New file, containing only the glob things needed for
1178 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
1179 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
1180 (glob, globfree, glob_pattern_p): Now defined simply in terms of
1181 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
1182 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
1183 and to respect the namespace rules better.
1185 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
1187 Merge glibc and coreutils changes into gnulib, plus a few
1189 * md5.c: Use #error rather than a string.
1190 (CYCLIC): New macro, from glibc source. Use it instead of rol.
1191 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
1192 (__attribute__): Define to empty for non recent-GCC.
1193 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
1194 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
1195 Renamed from their non-__ counterparts, with new macros replacing
1196 them if not _LIBC. Add __THROW attribute.
1198 (struct md5_ctx): Align buffer if using GCC.
1199 * sha1.h (struct sha1_ctx): Likewise.
1200 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
1201 The old name was backwards.
1202 (NOTSWAP): Remove; not used.
1203 (rol): New macro, moved here from md5.h.
1204 (sha1_process_block): Remove a FIXME that doesn't make sense.
1206 2005-09-12 Derek Price <derek@ximbiot.com>
1208 * gai_strerror.c: Include config.h when available. Include
1209 getaddrinfo.h before other headers to test interface.
1210 Reported by Larry Jones <lawrence.jones@ugs.com>.
1212 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
1214 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
1215 definitions, since that's the preferred style in glibc.
1216 Fix a minor spacing issue, and update copyright notice to match glibc's.
1218 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1220 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
1222 2005-09-06 Simon Josefsson <jas@extundo.com>
1224 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
1225 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
1227 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
1229 Change bitset word type from unsigned int to unsigned long int,
1230 as this has better performance on typical 64-bit hosts.
1231 Port bitset code to hosts with unusual word sizes.
1232 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
1233 (build_collating_symbol):
1234 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
1235 argument is a bitset. This is merely a style issue, but it makes
1236 it clearer that an entire array is expected.
1237 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
1238 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
1239 Port to the case where bitset_word is not the same as unsigned int.
1240 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
1241 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
1243 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1244 (build_trtable, group_nodes_into_DFAstates):
1246 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
1247 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
1248 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
1249 * regexec.c (group_nodes_into_DFAstates): Likewise.
1250 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
1251 * regcomp.c (optimize_subexps, lower_subexp):
1252 Work even if bitset_word has holes in its bitwise representation.
1253 * regex_internal.h (BITSET_WORD_BITS): Likewise.
1254 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1256 * regex_internal.c (re_string_reconstruct):
1257 Don't assume UCHAR_MAX == 255.
1258 * regex_internal.h (bitset_set_all): Likewise.
1259 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
1261 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
1262 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
1264 (BITSET_WORD_MAX): New macro.
1265 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
1266 (bitset_set_all, bitset_copy): Now inline functions, not macros.
1267 (bitset_empty, bitset_copy):
1268 Prefer sizeof (bitset) to multiplying it out ourselves.
1269 (bitset_not_merge): Remove; unused.
1270 (bitset_contain): Return bool, not unsigned int with one bit on.
1271 All callers changed.
1272 * regexec.c (build_trtable): Don't assume bitset has no stricter
1273 alignment than re_node_set; do this by defining a new internal
1274 type struct dests_alloc and using it to allocate memory.
1276 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
1278 Check for arithmetic overflow when calculating sizes, to prevent
1279 some buffer-overflow issues. These patches are conservative, in the
1280 sense that when I couldn't determine whether an overflow was possible,
1281 I inserted a run-time check.
1282 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
1283 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
1284 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
1285 (re_xnrealloc, re_x2nrealloc): New inline functions.
1286 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
1287 (build_equiv_class, build_charclass): Check for arithmetic overflow
1288 in size expression calculations.
1289 * lib/regex_internal.c (re_string_realloc_buffers):
1290 (build_wcs_upper_buffer, re_node_set_add_intersect):
1291 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
1292 (re_dfa_add_node, register_state): Likewise.
1293 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
1294 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
1295 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
1296 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
1298 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
1300 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
1301 to avoid a collision with bits/local_lim.h in glibc.
1302 All uses changed. Problem reported by Dmitry V. Levin in
1303 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
1305 * regex_internal.c (build_wcs_upper_buffer): Fix portability
1306 bugs in int versus size_t comparisons.
1307 (re_string_context_at): Fix bug where the code assumed that
1310 Use bool where appropriate.
1311 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
1312 All callers changed.
1313 (calc_eclosure_iter): Likewise, for ROOT arg.
1314 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
1315 (build_charclass_op): Likewise, for NON_MATCH arg.
1316 * regex_internal.c (re_string_allocate, re_string_construct):
1317 (re_string_construct_common): Likewise, for ICASE arg.
1318 * regexec.c (re_search_2_stub, re_search_stub):
1319 Likewise, for RET_LEN arg.
1320 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
1321 (set_regs): Likewise, for FL_BACKTRACK arg.
1322 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
1323 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
1324 (calc_eclosure_iter, parse_bracket_exp):
1325 Use bool for internal variables that are booleans.
1326 * regexec.c (re_search_internal, check_matching, proceed_next_node):
1327 (set_regs, build_sifted_states, sift_states_bkref):
1328 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
1329 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1330 (find_collation_sequence_value):
1332 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
1333 (re_node_set_compare):
1334 Return bool, not int. All callers changed.
1335 * regexec.c (check_halt_node_context, check_dst_limits):
1336 (build_trtable, check_node_accept): Likewise.
1337 * regex_internal.h: Include stdbool.h.
1339 Fix bugs uncovered when converting to bool.
1340 * regcomp.c (calc_eclosure_iter): Check for storage allocation
1341 failure instead of charging ahead blindly.
1342 * regex_internal.c (register_state): Likewise.
1343 * regexec.c (re_search_2_stub): Use simpler method than boolean
1344 for freeing internal storage.
1345 (group_nodes_into_DFA_states): Use unsigned int, not int, for
1346 bitset pieces used as boolean, to avoid undefined behavior
1347 on hosts that do int overflow checking.
1349 2005-08-31 Derek Price <derek@ximbiot.com>
1351 * getdelim.c (getdelim): Return EOF on EOF.
1352 Reported by Larry Jones <lawrence.jones@ugs.com>.
1354 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
1356 * regex_internal.c (re_string_reconstruct): Don't assume buffer
1357 lengths fit in regoff_t; this isn't true if regoff_t is the same
1359 * regex.c (re_search_internal): 5th arg is LAST_START
1360 (= START + RANGE) instead of RANGE. This avoids overflow
1361 problems when regoff_t is the same width as size_t.
1362 All callers changed.
1363 (re_search_2_stub): Check for overflow when adding the
1364 sizes of the two strings.
1365 (re_search_stub): Check for overflow when adding START
1366 to RANGE; if it occurs, substitute the extreme value.
1368 2005-08-31 Jim Meyering <jim@meyering.net>
1370 * regcomp.c (search_duplicated_node): Make first pointer arg
1372 * regex_internal.c (create_ci_newstate, create_cd_newstate):
1373 (register_state): Likewise.
1374 * regexec.c (search_cur_bkref_entry, check_dst_limits):
1375 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
1376 (group_nodes_into_DFAstates): Likewise.
1378 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
1380 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
1381 old glibc regex code mishandles strings longer than 2**31 bytes.
1382 This patch fixes this when the regex code is used in gnulib
1383 (i.e., outside glibc).
1385 This patch should not affect the use of the regex code inside
1386 glibc. No doubt this problem also needs to be handled for glibc
1387 as well, but the result will be an incompatible change to the
1388 glibc ABI, and the old ABI will have to be supported too. That
1389 can be the the subject for another patch.
1391 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
1392 governing whether the rest of this patch is active. By default,
1393 the macro is disabled and the patch has no effect.
1394 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
1395 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
1396 (struct re_pattern_buffer, re_search, re_search_2, re_match):
1397 (re_match_2, re_set_registers): Use the new types.
1398 * regex_internal.h (Idx, re_hashval_t): New types.
1399 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
1401 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
1402 (re_string_context_at, bin_tree_t, re_dfastate_t):
1403 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
1404 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
1405 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
1406 (re_string_char_size_at, re_string_wchar_at):
1407 (re_string_elem_size_at):
1408 Use the new types and macros to port to 64-bit hosts.
1409 Use unsigned types for internal values, so that the code
1410 mostly works even for arrays larger than SSIZE_MAX.
1411 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
1412 (search_duplicated_node, calc_eclosure_iter, fetch_number):
1413 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
1414 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
1415 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
1416 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
1417 (calc_inveclosure, parse_dup_op, build_range_exp):
1418 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
1419 (fetch_number, create_token_tree, mark_opt_subexp):
1421 * regex_internal.c (re_string_construct_common, create_ci_newstate):
1422 (create_cd_newstate, re_string_allocate, re_string_construct):
1423 (re_string_realloc_buffers, build_wcs_upper_buffer):
1424 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1425 (re_string_reconstruct, re_string_peek_byte_case):
1426 (re_string_fetch_byte_case, re_string_context_at):
1427 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1428 (re_node_set_init_copy, re_node_set_add_intersect):
1429 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1430 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1431 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1432 (re_acquire_state, re_acquire_state_context, register_state):
1434 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
1435 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
1436 (re_search_internal, re_search_2_stub, re_search_stub)
1437 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
1438 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
1439 (update_cur_sifted_state, check_dst_limits):
1440 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
1441 (check_subexp_limits, sift_states_bkref, merge_state_array):
1442 (check_subexp_matching_top, get_subexp, get_subexp_sub):
1443 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
1444 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1445 (expand_bkref_cache, check_node_accept_bytes):
1446 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
1447 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
1448 (acquire_init_state_context, check_halt_node_context):
1449 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
1450 (sift_states_backward, clean_state_log_if_needed):
1451 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
1452 (find_recover_state, transit_state_sb, transit_state_mb):
1453 (transit_state_bkref, build_trtable, match_ctx_clean):
1455 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
1456 to work around an assumption that REG_MISSING is negative.
1458 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
1459 (seek_collating_symbol_entry) [defined _LIBC]:
1460 (lookup_collation_sequence_value) [defined _LIBC]:
1461 (build_range_exp, build_collating_symbol) [defined _LIBC]:
1462 Use prototypes rather than old-style function definitions.
1463 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
1464 (transit_state_sb) [0]:
1465 (find_collation_sequence_value) [defined _LIBC]: Likewise.
1467 * regexec.c (re_search_internal): Simplify update of rm_so and
1470 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
1471 (optimize_subexps, lower_subexp):
1472 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
1473 since the signed shift might overflow. Use 1u<<31 instead.
1474 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
1475 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1478 * regcomp.c (optimize_subexps, lower_subexp):
1479 Use CHAR_BIT rather than 8, for clarity.
1480 * regexec.c (check_dst_limits_calc_pos_1):
1481 (check_subexp_matching_top): Likewise.
1482 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
1483 have to worry about portability issues when shifting it left.
1484 Remove no-longer-needed test for table_size > 0.
1485 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
1486 in a word, as the resulting behavior is undefined.
1487 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
1488 in one case, a <= should have been an <, and in another case the
1489 whole test was missing.
1490 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
1491 the standard name CHAR_BIT.
1492 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
1493 this is not true on one's complement and signed-magnitude hosts.
1495 * regex_internal.h (re_sub_match_top_t): Remove unused member
1497 (struct re_dfa_t): Remove unused member states_alloc.
1498 * regcomp.c (init_dfa): Don't initialize unused members.
1500 2005-08-31 Bruno Haible <bruno@clisp.org>
1502 * strstr.c: Include <stddef.h>, for NULL.
1503 * strcasestr.c: Likewise.
1504 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
1506 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
1508 * iconvme.h: Add prototype for iconv_alloc.
1510 2005-08-29 Simon Josefsson <jas@extundo.com>
1512 * iconvme.c: Fix errno.
1514 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
1516 * iconvme.c: Split iconv_string into iconv_alloc.
1518 2005-08-27 Jim Meyering <jim@meyering.net>
1520 * fopen-safer.c: Merge minor changes from coreutils.
1521 * dup-safer.c: Likewise.
1522 * fd-safer.c: Likewise.
1524 Merge from coreutils.
1525 * stdio--.h: New file.
1526 * stdlib--.h: New file.
1527 * mkstemp-safer.c: New file.
1529 GNU tar needs these.
1530 * pipe-safer.c: New file.
1531 * creat-safer.c: New file.
1532 * fcntl--.h (creat): Define to creat_safer.
1533 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
1534 * unistd--.h (pipe): Define to pipe_safer.
1535 * unistd-safer.h: Declare pipe_safer.
1537 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
1539 * regex_internal.h: Remove all references to
1540 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
1542 (bitset_not, bitset_merge, bitset_not_merge):
1543 (bitset_mask, re_string_allocate, re_string_construct):
1544 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
1545 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
1546 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
1547 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
1548 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1549 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1550 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
1551 (re_acquire_state_context):
1552 Remove unnecessary forward decls.
1553 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
1554 Put __attribute at function definition,
1555 now that the function decl has been removed.
1556 * lib/regex_internal.c (re_string_peek_byte_case):
1557 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
1560 2005-08-26 Simon Josefsson <jas@extundo.com>
1562 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
1563 Haible <bruno@clisp.org>.
1565 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1567 * regexec.c (set_regs): Don't alloca with an unbounded size.
1569 alloca modernization/simplification for regex.
1570 * regex.c: Remove portability cruft for alloca. This no longer
1571 needs to be at the start of the file, and can be moved into
1572 regex_internal.h and simplified.
1573 * regex_internal.h: Include <alloca.h>.
1574 (__libc_use_alloca) [!defined _LIBC]: New macro.
1575 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
1576 now works outside glibc.
1578 2005-08-24 Simon Josefsson <jas@extundo.com>
1580 * getpass.c: Add WIN32 implementation. Conditionalize use of
1581 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
1582 GLIBC specific code.
1584 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1586 Make regex safe for g++. This fixes one real bug (an "err"
1587 that should have been "*err"). g++ problem reported by
1589 * regex_internal.h (re_calloc): New macro, consistent with
1590 re_malloc etc. All callers of calloc changed to use re_calloc.
1591 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
1592 not int. All callers changed.
1593 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
1594 just use an array of size MB_LEN_MAX.
1595 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
1596 (find_recover_state): Change "err" to "*err"; this fixes what
1597 appears to be a real bug.
1598 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
1601 2005-08-25 Jim Meyering <jim@meyering.net>
1603 * open-safer.c: Include <config.h>.
1604 Otherwise, we'd lose LARGEFILE support in any file using
1607 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
1609 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
1610 * regex.h (regerror): Likewise.
1612 * regex.c: Do not include <sys/types.h>, as POSIX no longer
1613 requires this. (The code never needed it.)
1615 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
1616 All uses of recently-renamed identifiers changed to use the new,
1617 POSIX-compliant names. The code will build and run just fine
1618 without these changes, but it's better to eat our own dog food
1619 and use the standard-conforming names.
1621 * regex.h: Fix a multitude of POSIX name space violations.
1622 These changes have an effect only for programs that define
1623 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
1624 do not change anything for programs compiled in the normal way.
1625 Also, there is no effect on the ABI.
1627 (_REGEX_SOURCE): New macro.
1628 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
1629 defined and _GNU_SOURCE is not; this fixes a name space violation.
1631 Rename the following macros to obey POSIX requirements.
1632 The old names are still visible as macros if _REGEX_SOURCE is defined.
1633 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
1634 RE_BACKSLASH_ESCAPE_IN_LISTS.
1635 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
1636 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
1637 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
1638 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
1639 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
1640 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
1641 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
1642 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
1643 (REG_INTERVALS): renamed from RE_INTERVALS.
1644 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
1645 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
1646 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
1647 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
1648 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
1649 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
1650 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
1651 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
1652 RE_UNMATCHED_RIGHT_PAREN_ORD.
1653 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
1654 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
1655 (REG_DEBUG): renamed from RE_DEBUG.
1656 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
1657 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
1658 unusual, since we can't clash with the POSIX REG_ICASE.
1659 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
1660 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
1661 (REG_NO_SUB): renamed from RE_NO_SUB.
1662 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
1663 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
1664 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
1665 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
1666 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
1667 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
1668 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
1669 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
1670 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
1671 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
1672 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
1673 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
1674 RE_SYNTAX_POSIX_MINIMAL_BASIC.
1675 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
1676 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
1677 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
1678 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
1679 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
1680 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
1681 (REG_FIXED): Renamed from REGS_FIXED.
1682 (REG_NREGS): Renamed from RE_NREGS.
1684 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
1685 of other REG_* macros, since POSIX says the user is allowed to
1686 #undef these macros selectively.
1688 (reg_errcode_t): Update comment stating what other tables need
1691 Rename the following enum values to obey POSIX requirements.
1692 The old names are still visible as macros.
1693 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
1694 is not defined, since GNU is supposed to be a superset of POSIX as
1695 much as possible, and since we want reg_errcode_t to be a signed
1696 type for implementation consistency.
1697 (_REG_NOERROR): Renamed from REG_NOERROR.
1698 (_REG_NOMATCH): Renamed from REG_NOMATCH.
1699 (_REG_BADPAT): Renamed from REG_BADPAT.
1700 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
1701 (_REG_ECTYPE): Renamed from REG_ECTYPE.
1702 (_REG_EESCAPE): Renamed from REG_EESCAPE.
1703 (_REG_ESUBREG): Renamed from REG_ESUBREG.
1704 (_REG_EBRACK): Renamed from REG_EBRACK.
1705 (_REG_EPAREN): Renamed from REG_EPAREN.
1706 (_REG_EBRACE): Renamed from REG_EBRACE.
1707 (_REG_BADBR): Renamed from REG_BADBR.
1708 (_REG_ERANGE): Renamed from REG_ERANGE.
1709 (_REG_ESPACE): Renamed from REG_ESPACE.
1710 (_REG_BADRPT): Renamed from REG_BADRPT.
1711 (_REG_EEND): Renamed from REG_EEND.
1712 (_REG_ESIZE): Renamed from REG_ESIZE.
1713 (_REG_ERPAREN): Renamed from REG_ERPAREN.
1714 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
1715 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
1716 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
1717 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
1719 (_REG_RE_NAME, _REG_RM_NAME): New macros.
1720 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
1721 changed. But support the old name if the new one is not defined
1722 and if _REGEX_SOURCE.
1724 Change the following member names in struct re_pattern_buffer.
1725 The old names are still supported if !_REGEX_SOURCE.
1726 The new names are always supported, regardless of _REGEX_SOURCE.
1727 (re_buffer): Renamed from buffer.
1728 (re_allocated): Renamed from allocated.
1729 (re_used): Renamed from used.
1730 (re_syntax): Renamed from syntax.
1731 (re_fastmap): Renamed from fastmap.
1732 (re_translate): Renamed from translate.
1733 (re_can_be_null): Renamed from can_be_null.
1734 (re_regs_allocated): Renamed from regs_allocated.
1735 (re_fastmap_accurate): Renamed from fastmap_accurate.
1736 (re_no_sub): Renamed from no_sub.
1737 (re_not_bol): Renamed from not_bol.
1738 (re_not_eol): Renamed from not_eol.
1739 (re_newline_anchor): Renamed from newline_anchor.
1741 Change the following member names in struct re_registers.
1742 The old names are still supported if !_REGEX_SOURCE.
1743 The new names are always supported, regardless of _REGEX_SOURCE.
1744 (rm_num_regs): Renamed from num_regs.
1745 (rm_start): Renamed from start.
1746 (rm_end): Renamed from end.
1748 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
1749 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
1750 Prepend __ to parameter names.
1752 Undo yesterday's changes.
1754 2005-08-24 Jim Meyering <jim@meyering.net>
1756 Sync from coreutils.
1757 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
1759 2005-08-21 Bruno Haible <bruno@clisp.org>
1761 * lock.h: Add multiple inclusion guard.
1762 * tls.h: Add multiple inclusion guard.
1764 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
1766 * regex.h (REG_NOSYS)
1767 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
1768 Define, since POSIX requires it as of 2001.
1769 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
1770 New private symbol, used to keep the enum signed in all cases.
1771 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
1772 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
1774 * regex_internal.c (re_string_skip_chars, register_state):
1776 Remove forward decls; no longer needed now that we use prototypes.
1777 * regexec.c (acquire_init_state_context, check_halt_node_context):
1778 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
1779 (clean_state_log_if_needed): Likewise.
1781 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1783 Fix problems reported by Sam Steingold in
1784 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
1785 * regexec.c (sift_states_bkref): Fix portability bug: the code
1786 assumed that reg_errcode_t is a signed type, which is not
1787 necessarily true if _XOPEN_SOURCE is not defined.
1788 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
1789 some compilers warn about it otherwise.
1791 2005-08-20 Jim Meyering <jim@meyering.net>
1793 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
1794 of unused local, dfa.
1796 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1798 * regcomp.c (create_initial_state): Remove duplicate decl.
1799 (init_word_char, create_initial_state, duplicate_node_closure):
1800 (fetch_token, peek_token_bracket, build_range_exp):
1801 (build_collating_symbol): Remove forward decls; no longer needed
1802 now that we use prototypes.
1805 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
1806 (re_compile_fastmap_iter, regcomp, regerror, regfree):
1807 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
1808 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
1809 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
1810 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
1811 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
1812 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
1813 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
1814 (build_range_exp, build_collating_symbol, parse_bracket_exp):
1815 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
1816 (build_charclass, build_charclass_op, fetch_number, create_tree):
1817 (create_token_tree, mark_opt_subexp, duplicate_tree):
1818 Use prototypes rather than old-style definitions.
1821 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
1822 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
1823 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1824 (re_string_reconstruct, re_string_peek_byte_case):
1825 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
1826 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1827 (re_node_set_init_copy, re_node_set_add_intersect):
1828 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1829 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1830 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1831 (re_acquire_state, re_acquire_state_context, register_state):
1832 (create_ci_newstate, create_cd_newstate, free_state):
1834 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
1835 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
1836 (re_search_internal, prune_impossible_nodes):
1837 (acquire_init_state_context, check_matching, static):
1838 (check_halt_node_context, check_halt_state_context, proceed_next_node):
1839 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
1840 (update_regs, sift_states_backward, build_sifted_states):
1841 (clean_state_log_if_needed, merge_state_array):
1842 (update_cur_sifted_state, add_epsilon_src_nodes):
1843 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
1844 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
1845 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
1846 (find_recover_state, check_subexp_matching_top, transit_state_mb):
1847 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
1848 (check_arrival, check_arrival_add_next_nodes):
1849 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1850 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1851 (check_node_accept_bytes, check_node_accept, extend_buffers):
1852 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
1853 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
1858 (re_string_allocate, re_string_construct, re_string_reconstruct):
1859 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
1860 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
1861 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
1862 (re_string_context_at, re_string_peek_byte_case):
1863 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
1864 is defined, since we now use prototypes always.
1866 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
1867 C89 or better. All uses removed.
1869 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1871 * regex_internal.c (re_acquire_state, re_acquire_state_context)
1872 [defined lint]: Suppress bogus uninitialized-variable warnings.
1874 * regcomp.c (duplicate_node): Return new index, not an error code,
1875 and let the caller return REG_ESPACE if out of space. This
1876 removes an uninitialied-variable warning with GCC 4.0.1, and also
1877 avoids taking the address of a local variable. All callers
1880 2005-08-19 Jim Meyering <jim@meyering.net>
1882 * regexec.c (proceed_next_node): Redo local variables to
1883 avoid GCC shadowing warnings.
1885 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1887 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
1888 (re_node_set_insert_last, re_dfa_add_node):
1889 Rename local variables to avoid GCC shadowing warnings.
1891 2005-08-18 Bruno Haible <bruno@clisp.org>
1893 * strstr.c (strstr): Fix return value in multibyte case.
1894 * strcasestr.c (strcasestr): Likewise.
1896 2005-08-17 Jim Meyering <jim@meyering.net>
1898 Make the %s format (seconds since the epoch) work for a negative
1899 number and when used with a zero-padded field width, e.g. %015s.
1901 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1902 label so that it precedes the code to set `digits'. Otherwise,
1903 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
1904 print `00-22'. Now, it prints `-0022', as it should.
1906 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
1908 * regex.h: Remove useless space-before-tab. From coreutils.
1910 2005-08-17 Bruno Haible <bruno@clisp.org>
1912 * strcasestr.h: New file.
1913 * strcasestr.c: New file.
1915 2005-08-17 Bruno Haible <bruno@clisp.org>
1917 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
1918 * strstr.c: Completely rewritten, with multibyte locale support.
1920 2005-08-17 Bruno Haible <bruno@clisp.org>
1922 * strcasecmp.c: Use mbuiter.h.
1924 2005-08-17 Bruno Haible <bruno@clisp.org>
1926 * mbuiter.h: New file.
1928 2005-08-16 Bruno Haible <bruno@clisp.org>
1930 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
1932 (mbi_avail, mbi_advance): Let the iteration end before the terminating
1933 NUL byte, not after it.
1935 2005-08-16 Bruno Haible <bruno@clisp.org>
1937 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
1938 the valid ones. Makes the comparison operations transitive:
1939 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
1940 * strcasecmp.c (strcasecmp): Use mb_casecmp.
1942 2005-08-16 Bruno Haible <bruno@clisp.org>
1944 * strcase.h (strcasecmp): Add note in comments.
1945 * strncasecmp.c: Use code from strcasecmp.c.
1946 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
1947 (strcasecmp): Work correctly in multibyte locales.
1949 2005-08-16 Bruno Haible <bruno@clisp.org>
1951 * strnlen1.h: New file.
1952 * strnlen1.c: New file.
1954 2005-08-16 Bruno Haible <bruno@clisp.org>
1956 * mbfile.h: New file.
1958 2005-08-16 Bruno Haible <bruno@clisp.org>
1960 * mbiter.h: New file.
1962 2005-08-16 Bruno Haible <bruno@clisp.org>
1964 * mbchar.h: New file.
1965 * mbchar.c: New file.
1967 2005-08-16 Bruno Haible <bruno@clisp.org>
1969 * tls.h: New file, from GNU gettext.
1970 * tls.c: New file, from GNU gettext.
1972 2005-08-15 Bruno Haible <bruno@clisp.org>
1974 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
1977 2005-08-14 Jim Meyering <jim@meyering.net>
1979 Sync from coreutils.
1981 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
1982 Use the hash-table-based cycle-detection code not just when
1983 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
1984 Reported by James Youngman in
1985 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
1986 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
1987 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
1988 This lets us compile with -DFTS_DEBUG, once again.
1989 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
1990 * fts.c (fd_safer): Remove decl.
1991 Include fcntl--.h rather than unistd-safer.h
1992 (fts_safe_changedir): Don't call fd_safer; no longer needed
1993 now that we include fcntl--.h.
1995 2005-08-11 Simon Josefsson <jas@extundo.com>
1997 * readline.h, readline.c: New file.
1999 2005-08-11 Bruno Haible <bruno@clisp.org>
2001 * strnlen.h (strnlen): Change parameter name to match comment.
2003 2005-08-10 Simon Josefsson <jas@extundo.com>
2005 * strndup.c: Use strnlen.h.
2007 * strnlen.h: New file.
2009 2005-08-02 Simon Josefsson <jas@extundo.com>
2011 * getline.h, getline.c: Rewrite.
2013 * getdelim.h, getdelim.c: New files, ported from glibc.
2015 2005-07-31 Bruno Haible <bruno@clisp.org>
2017 * lock.h (gl_lock_initializer): New macro.
2018 (gl_lock_define_initialized): Use it.
2019 (gl_rwlock_initializer): New macro.
2020 (gl_rwlock_define_initialized): Use it.
2021 (gl_recursive_lock_initializer): New macro.
2022 (gl_recursive_lock_define_initialized): Use it.
2024 2005-07-26 Bruno Haible <bruno@clisp.org>
2026 * lock.h: Update from GNU gettext.
2027 * lock.c: Update from GNU gettext.
2029 2005-07-18 Bruno Haible <bruno@clisp.org>
2031 * lock.h (gl_once_t): New type.
2032 (gl_once_define, gl_once): New macros.
2033 * lock.c (fresh_once): New variable.
2034 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
2037 2005-07-18 Simon Josefsson <jas@extundo.com>
2039 * check-version.c (check_version): Accept identical versions too.
2041 2005-07-18 Bruno Haible <bruno@clisp.org>
2043 * lock.h: New file, from GNU gettext.
2044 * lock.c: New file, from GNU gettext.
2046 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
2048 * quotearg.c: Add translator comment suggested by Bruno Haible,
2049 with a minor change.
2051 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
2053 * version-etc-fsf.c (version_etc_copyright): Parameterize the
2054 copyright symbol and the year.
2055 * version-etc.c (COPYRIGHT_YEAR): New constant.
2056 (version_etc_va): Use parameterized copyright notice.
2057 Reword to conform to the current GNU coding standards.
2059 2005-07-11 Simon Josefsson <jas@extundo.com>
2061 * size_max.h: New file.
2063 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
2065 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
2068 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
2069 and Paul Eggert <eggert@cs.ucla.edu>
2071 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
2072 in wint_t, not wchar_t. Remove now-unnecessary cast.
2074 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
2076 * regex.c, regex.h: Sync from libc.
2077 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
2078 New files, synced from libc, except that regex_internal.h
2079 currently has a small porting fix.
2081 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
2083 Remove the dependency of the strftime module on the tzset module.
2084 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
2085 Copy the input structure, to work around some of the bug with
2086 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
2087 Solaris releases, you should also use the tzset module, but we won't
2088 require it as a dependency any more since we don't want LGPLed code
2089 to depend on GPLed code.
2091 2005-07-02 Jim Meyering <jim@meyering.net>
2093 * backupfile.c (backup_args): Change a `0' to NULL.
2095 2005-07-01 Jim Meyering <jim@meyering.net>
2097 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2098 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
2099 * save-cwd.c, tempname.c:
2100 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2101 and don't include <sys/file.h>).
2103 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
2105 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
2106 declares only 'struct timespec;' (!).
2108 2005-06-29 Jim Meyering <jim@meyering.net>
2110 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
2111 type name. Use the variable name instead.
2112 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
2114 2005-06-28 Simon Josefsson <jas@extundo.com>
2116 * check-version.h, check-version.c: New files.
2118 2005-06-28 Simon Josefsson <jas@extundo.com>
2120 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
2121 collision with global variable. Better indentation. Don't
2122 increment buffer pointer beyond buffer end. Based on comments
2123 from Paul Eggert <eggert@cs.ucla.edu>.
2127 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
2129 * canon-host.c (canon-host): Append trailing "," to 0 in
2130 initializer of struct addrinfo, as an indication that we don't
2131 care how many members the structure has.
2133 2005-06-24 Derek Price <derek@ximbiot.com>
2134 and Bruno Haible <bruno@clisp.org>
2136 Remove stat module & update lstat.
2137 * stat.c: Remove this file...
2138 (slash_aware_lstat): ...moving this content and its support...
2139 * lstat.c (rpl_lstat): ...into here.
2140 * lstat.h: New file.
2142 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
2144 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
2145 (ranged_convert): Don't save conversion in a temporary struct.
2146 This causes a warning with GCC 4.0.0, and anyway in the typical
2147 case it's not worth the extra 100 bytes or so of code.
2148 (ranged_convert, __mktime_internal): When calling a function via a
2149 pointer P, use P () rather than (*P) (), as we now assume C89 or
2152 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
2154 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
2155 "who -r" failed to give output. Problem reported by Tim Waugh.
2157 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
2158 (xcalloc): Use it to avoid needless tests.
2159 Problem reported by Jim Meyering.
2161 2005-06-16 Jim Meyering <jim@meyering.net>
2163 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
2164 when either N or S is zero.
2166 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2168 * argp.h (__option_is_short): Check upper limit of
2169 __key. Isprint() requires its argument to have the value
2170 of an unsigned char or EOF.
2172 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
2174 * fnmatch.c (fnmatch): If there is an encoding error in a
2175 multibyte string or pattern, fall back on unibyte matching.
2176 Problem reported by James Youngman.
2178 2005-06-08 Bruno Haible <bruno@clisp.org>
2180 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
2183 2005-06-08 Bruno Haible <bruno@clisp.org>
2185 * csharpcomp.h: New file, from GNU gettext.
2186 * csharpcomp.c: New file, from GNU gettext.
2187 * csharpcomp.sh.in: New file, from GNU gettext.
2189 2005-06-07 Derek Price <derek@ximbiot.com>
2192 * glob_.h: Indent nested #ifdef.
2194 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
2196 Sync from coreutils.
2197 Use "file name" when talking about file names, instead of "filename"
2198 or "path", as per the GNU coding standards.
2199 * mkdir-p.c: Renamed from makepath.c.
2200 (make_dir_parents): Renamed from make_path. All callers changed.
2201 * mkdir-p.h: Likewise. All includers changed.
2202 * filenamecat.c: Renamed from path-concat.c.
2203 (file_name_concat): Renamed from path_concat. All callers changed.
2204 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
2205 * filenamecat.h: Likewise. All includers changed.
2206 * acl.c: Don't use "path" or "filename" to mean "file name"
2207 in comments or local variable names.
2208 * basename.c: Likewise.
2209 * canonicalize.c, canonicalize.h: Likewise.
2210 * dirname.c, dirname.h: Likewise.
2211 * euidaccess.c: Likewise.
2212 * exclude.c: Likewise
2213 * fnmatch_.h, fnmatch_loop.c: Likewise.
2214 * fsusage.c, fsuage.h: Likewise.
2215 * fts.c, fts_.h: Likewise.
2216 * getcwd.c: Likewise.
2217 * getloadavg.c: Likewise.
2218 * mkstemp.c: Likewise.
2219 * mountlist.c, mountlist.h: Likewise.
2220 * openat.c, openat.h: Likewise.
2221 * readlink-stub.c: Likewise.
2222 * readutmp.c, readutmp.h: Likewise.
2223 * rename.c: Likewise.
2224 * rmdir.c: Likewise.
2226 * savedir.c: Likewise.
2227 * stripslash.c: Likewise.
2228 * tempname.c: Likewise.
2229 * xreadlink.c: Likewise.
2230 * exclude.c (excluded_file_name): Renamed from excluded_filename.
2232 * exclude.h: Likewise.
2234 * euidaccess.c (getuid, getgid, getuid, getegid)
2235 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2236 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
2237 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2238 * pathmax.h: Include <limits.h> unconditionally, since other
2239 files have been getting away with it for years (MORE/BSD 4.3
2241 * userspec.c (getpwnam, getgrnam, getgrgid)
2242 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2244 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
2245 Define to 256, not 255, as per modern POSIX.
2247 2005-06-01 Bruno Haible <bruno@clisp.org>
2249 * csharpexec.h: New file, from GNU gettext.
2250 * csharpexec.c: New file, from GNU gettext.
2251 * csharpexec.sh.in: New file, from GNU gettext.
2253 2005-05-31 Derek Price <derek@ximbiot.com>
2254 Paul Eggert <eggert@cs.ucla.edu>
2257 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
2259 2005-05-29 Derek Price <derek@ximbiot.com>
2260 Paul Eggert <eggert@cs.ucla.edu>
2262 * glob_.h, glob.c: New files.
2264 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
2266 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
2268 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
2269 the configuration hassle isn't worth it.
2270 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
2271 (LONGEST_MODIFIER, PRIuMAX): Remove.
2273 2005-05-27 Bruno Haible <bruno@clisp.org>
2275 * getlogin_r.h: Remove second include of <stddef.h>.
2277 2005-05-25 Bruno Haible <bruno@clisp.org>
2278 Derek Price <derek@ximbiot.com>
2280 * getlogin_r.h: Simplify API documentation.
2282 2005-05-25 Derek Price <derek@ximbiot.com>
2283 Paul Eggert <eggert@cs.ucla.edu>
2285 * getlogin_r.c, getlogin_r.h: New files.
2287 2005-05-22 Bruno Haible <bruno@clisp.org>
2289 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
2290 Also include <sys/param.h> if it defines MIN, MAX.
2291 Based on a patch by Derek Price <derek@ximbiot.com>.
2293 2005-05-22 Bruno Haible <bruno@clisp.org>
2295 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
2296 (INT64_MIN): Fix definition.
2297 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2299 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
2300 NEED_SIGNED_INT_TYPES.
2302 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
2303 HAVE_SYSTEM_INTTYPES.
2305 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
2307 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
2308 so that unistd-safer.h (GPL'ed code) need not be included.
2310 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
2313 * fts.c: Don't include "cycle-check.h" or "hash.h".
2314 (setup_dir, free_dir): New functions.
2315 (enter_dir, leave_dir): Define trivial
2316 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
2317 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
2318 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
2319 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
2320 Move to fts-cycle.c.
2321 (fts_open): Use setup_dir.
2322 (fts_close): Use free_dir.
2323 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
2324 This adds a label and some gotos, but the alternatives were messier.
2325 Check for memory allocation failure when entering a dir.
2326 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
2327 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
2328 (FTS): New member fts_cycle, that is a union that contains the
2329 old active_dir_ht and cycle_state. All uses changed to mention
2330 fts_cycle.ht and fts_cycle.state.
2331 * fts-cycle.c: New file, containing GPL'ed code migrated out of
2332 fts.c, with the following changes:
2333 (setup_dir, free_dir): New functions.
2334 (enter_dir): Now returns bool. Return true if successful, false
2335 if memory exhausted. All callers changed.
2336 Do not bother partly cleaning up on
2337 memory allocation failure; that is free_dir's job.
2338 However, free ad if hash_insert fails, to avoid memory leak.
2339 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
2340 fts->fts_options to see which union member to use.
2342 2005-05-20 Jim Meyering <jim@meyering.net>
2344 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
2345 Now a macro, to pacify GCC.
2347 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
2349 * chown.c (rpl_chown): Return -1 on failure.
2351 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
2353 * canonicalize.c: Include canonicalize.h first, to test interface.
2354 Include <stddef.h> unconditionally, since we assume C89 now.
2355 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
2356 * fts.c: Include fts_.h first, to check interface.
2357 Do not include intprops.h; no longer needed.
2358 Include cycle-check.h and hash.h, since fts_.h no longer does.
2359 Remove unnecessary casts of closedir to void.
2360 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
2361 decide whether to decrement nlinks.
2362 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
2363 (FTS): Use struct hash_table * instead of Hash_table, so that
2364 we no longer need to include hash.h here.
2366 2005-05-17 Jim Meyering <jim@meyering.net>
2368 * fts.c, fts_.h: New files, from coreutils.
2370 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
2372 Sync from coreutils.
2373 * unlinkdir.c, unlinkdir.h: New files.
2374 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
2375 regex.h, unlocked-io.h, xtime.h:
2376 White space changes only.
2377 * makepath.c (make_path): Port to hosts where leading "//" is special.
2378 * yesno.c: Include getline.h, not ctype.h.
2379 (yesno): Don't remove leading white space; POSIX doesn't allow it.
2380 Use getline to remove arbitrary restriction on response length.
2382 2005-05-13 Bruno Haible <bruno@clisp.org>
2384 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
2385 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
2386 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
2387 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
2388 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
2389 Add support for 64-bit integers in the MSVC compiler.
2391 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
2393 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
2394 Change the initial comment to refer to GPL, not LGPL.
2395 gnulib-tool will change it to LGPL as needed.
2397 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
2398 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
2399 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
2400 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
2401 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
2402 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
2403 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
2404 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
2405 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
2406 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
2407 concatpath.c, config.charset, copy-file.c, copy-file.h,
2408 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
2409 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
2410 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
2411 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
2412 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
2413 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
2414 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
2415 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
2416 full-read.c, full-read.h, full-write.c, full-write.h,
2417 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
2418 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
2419 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
2420 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
2421 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
2422 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
2423 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
2424 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
2425 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
2426 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
2427 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
2428 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
2429 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
2430 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
2431 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
2432 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
2433 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
2434 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
2435 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
2436 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
2437 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
2438 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
2439 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
2440 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
2441 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
2442 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
2443 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
2444 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
2445 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
2446 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
2447 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
2448 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
2449 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
2450 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
2451 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
2452 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
2453 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
2454 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
2455 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
2456 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
2457 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
2458 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
2459 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
2460 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
2461 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
2462 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
2463 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
2464 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
2465 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
2466 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
2467 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
2468 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
2469 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
2470 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
2471 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
2472 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
2473 Update FSF postal mail address.
2475 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2477 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
2478 specified in ai_socktype. Fix invalid ai_protocol
2479 check. ai_protocol is usually set to 0 or depending on
2480 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
2481 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
2482 ai_socktype / ai_protocol in the returned addrinfo structure.
2484 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2485 Bruno Haible <bruno@clisp.org>
2487 * inet_ntop.h: New file.
2488 * inet_ntop.c: New file, from glibc with modifications.
2490 2005-05-08 Jim Meyering <jim@meyering.net>
2492 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
2494 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
2496 Merge from coreutils. Among other things,
2497 add bulletproofing for cases where stdin, stdout, or stderr are closed.
2498 * fd-safer.c: New file.
2499 * fcntl-safer.h, open-safer.c: Remove.
2500 * chdir-long.c: Fix comment "fetish" -> "coreutils".
2501 * dup-safer.c: Include unistd-safer.h first.
2502 Don't include errno.h.
2503 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
2504 * file-type.h: Don't assume invoker included sys/stat.h first.
2505 * file-type.c: Rely on file-type.h change.
2506 * getloadavg.c: Include unistd-safer.h.
2507 (getloadavg): Use safer open.
2508 * getusershell.c: Include "stdio-safer.h".
2509 (getusershell): Use safer fopen.
2510 * long-options.c (long_options): Use NULL rather than 0.
2511 * modechange.h (mode_free): Remove; all callers changed to invoke
2513 * modechange.c: Likewise.
2514 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
2515 (MODE_DONE): New constant.
2516 (struct mode_change): Remove 'next' member.
2517 (make_node_op_equals): New function; like the old one of the
2518 same name, except it allocates an array.
2519 (mode_compile, mode_create_from_ref): Use it.
2520 (mode_compile): Allocate result as an array, not a linked list.
2521 Parse octal string ourself, so that we catch mistakes like "+0".
2522 (mode_adjust): Arg is an array, not a linked list.
2523 * modechange.c: Include stat-macros.h, xalloc.h.
2524 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
2525 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
2526 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
2527 Remove. This is now stat-macros.h's job.
2528 (talloc): Remove. All callers replaced by xalloc, so that
2529 our invokers don't have to worry about reporting memory failures.
2530 (make_node_op_equals): Remove.
2531 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2533 (struct mode_change): Moved here from modechange.h.
2534 (mode_append_entry): Remove.
2535 (mode_compile): Remove MASKED_OPS arg, since it encouraged
2536 apps to have incorrect behavior. Use simpler algorithm for head
2537 and tail. Don't futz with umask; that's now the job of mode_adjust.
2538 Detect more invalid usages rather than having somewhat-random behavior.
2539 Don't insert an "a=" action, as that leads to incorrect behavior.
2540 (mode_compile, mode_create_from_ref): Return NULL on error instead
2541 of an enum, since now there's only one way to have an error. All
2543 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
2544 at the correct time. Simplify calculation of "+u" and its ilk.
2545 Don't mishandle "+X".
2546 (mode_free): Remove "register" and localize decls.
2547 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2548 (struct mode_change): Move to modechange.c; callers don't
2549 need to see this stuff.
2550 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
2551 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
2552 (mode_change, mode_adjust): Reflect the new signatures noted above.
2553 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
2554 that might redefine system include files.
2555 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
2556 (my_usleep): Use NULL rather than (void *) 0.
2557 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
2558 Use siginterrupt to specify that system calls should be interrupted.
2559 (rpl_nanosleep): Move initialization of suspended closer to call of
2561 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
2562 * readutmp.c: Likewise. Include signal.h, stdbool.h.
2563 (desirable_utmp_entry): New function.
2564 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
2565 using x2nrealloc, to simplify logic.
2566 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
2567 size calculation. Do not assume utmp file is a regular file.
2568 * readutmp.h (UT_PID): Moved here from ../src/who.c.
2569 (READ_UTMP_CHECK_PIDS): New constant.
2570 * save-cwd.c: Include unistd-safer.h.
2571 (save_cwd): Use fd_safer.
2572 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
2573 [!_LIBC] Include "stat-macros.h" instead.
2574 * unistd-safer.h (fd_safer): New decl.
2576 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
2578 * byteswap_.h: New file.
2580 2005-04-25 Albert Chin <china@thewrittenword.com>
2582 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
2585 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
2587 * getdate.y (zone): Allow relunit_snumber after tZONE, so
2588 that "UTC +1 second" continues to work. Problem reported
2590 (relunit_snumber): New rule.
2593 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
2595 * getdate.y (universal_time_zone_table): New constant.
2596 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
2597 universal_time_zone_table.
2598 (lookup_zone): Prefer universal_time_zone_table to
2599 local_time_zone_table, so that "GMT" time stamps are allowed in
2600 London during the summer. Problem reported by Ian Abbott.
2602 2005-04-12 Jim Meyering <jim@meyering.net>
2604 * human.c (humblock): Set *options even when returning due to
2605 xstrtoumax conversion failure. Thanks to a used-uninitialized
2608 2005-04-09 Jim Meyering <jim@meyering.net>
2610 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
2611 -Wuninitialized: initialize tm0.tm_year.
2613 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
2615 * getdate.y (parser_control): rels_seen is now a boolean, not a
2616 count, since there's no maximum. All uses changed.
2617 Add member dsts_seen.
2618 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
2620 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
2621 Use pc_rels_seen to decide whther a date is absolute.
2623 * getdate.y (number): Don't overwrite year.
2624 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
2627 2005-04-02 Simon Josefsson <jas@extundo.com>
2629 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
2630 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
2632 2005-03-27 Jim Meyering <jim@meyering.net>
2634 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
2636 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
2638 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
2639 "one's complement" -> "ones' complement" in comment, as per Knuth.
2640 "value of type" -> "type or expression" in comment.
2641 * mktime.c, strftime.c: Propagate intprops.h comment nits.
2643 2005-03-26 Jim Meyering <jim@meyering.net>
2646 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
2647 Correct typos: s/or/of/.
2649 2005-03-23 Jim Meyering <jim@meyering.net>
2651 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
2653 2005-03-21 Jim Meyering <jim@meyering.net>
2655 Changes imported from coreutils.
2657 * cycle-check.c: Don't include xalloc.h.
2659 * path-concat.c: Don't include assert.h.
2660 (path_concat): Remove assertion that would have triggered
2661 for ABASE starting with more than one slash.
2662 Reported by Andreas Schwab.
2664 * path-concat.c (path_concat): Set *BASE_IN_RESULT
2665 properly when ABASE is an absolute file name.
2666 Correct the description of this function.
2668 Add an assertion and a test driver.
2669 This fixes a bug introduced on 2004-07-02.
2670 Andreas Schwab reported the resulting failure of cp --parents:
2671 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
2673 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
2675 * strftime.c (my_strftime): If the underlying strftime returns 0
2676 (which shouldn't happen), generate nothing instead of returning 0
2677 immediately, so that nstrftime (NULL, ...) doesn't return 0.
2679 2005-03-16 Bruno Haible <bruno@clisp.org>
2681 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
2683 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
2685 * strftime.c (my_strftime): Prepend space to format so that we can
2686 reliably distinguish strftime failure from empty output on POSIX
2689 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
2691 * iconvme.c (SIZE_MAX): New macro, if not already defined.
2692 (iconv_string): Don't guess a size-zero buffer, as that might cause
2693 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
2694 result would be 'too large', where 'too large' is (heuristically)
2695 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
2696 overflow concerns. This will prevent some unwanted malloc failures
2697 when the inputs are very large.
2699 2005-03-15 Bruno Haible <bruno@clisp.org>
2701 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
2704 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
2707 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
2709 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
2711 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
2712 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
2714 * strtol.c: Likewise.
2716 2005-03-14 Simon Josefsson <jas@extundo.com>
2718 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
2721 2005-03-14 Jim Meyering <jim@meyering.net>
2723 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
2724 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
2725 to be nonzero so that we (and caller) can detect the difference
2726 between a valid zero-length expansion and an error return, even
2727 when the underlying strftime fails before writing anything into
2730 2005-03-10 Jim Meyering <jim@meyering.net>
2732 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
2733 so that this module works on systems without fchdir.
2735 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
2737 Factor int-properties macros into a single file, except for
2738 glibc-related files.
2739 * intprops.h: New file.
2740 * getloadavg.c: Include it instead of limits.h.
2741 (INT_STRLEN_BOUND): Remove.
2742 * human.c: Include intprops.h.
2743 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2744 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2745 * inttostr.h: Include intprops.h instead of limits.h.
2746 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2747 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2748 for consistency with intprops.h.
2749 (time_t_is_integer, twos_complement_arithmetic): Use them.
2750 * sig2str.h: Include <signal.h>, intprops.h.
2751 (INT_STRLEN_BOUND): Remove.
2752 * strftime.c (TYPE_SIGNED): Remove.
2753 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2754 * strtol.c: Adjust comments to match intprops.h.
2755 * userspec.c: Include intprops.h.
2756 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2757 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2758 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2759 instead of rolling our own expressions.
2760 * xstrtol.c: Include xstrtol.h first, to test interface.
2762 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
2764 (my_strftime): Do not mishandle years close to INT_MAX, by doing
2765 the right thing even if adding 1900 would overflow. Similarly
2766 for tm_mon + 1 and tm_yday + 1.
2767 Make %Y always equivalent to %C%y, and similarly for %G and %g.
2768 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2769 (DO_SIGNED_NUMBER): New macro.
2770 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2772 2005-03-07 Bruno Haible <bruno@clisp.org>
2774 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
2776 2005-03-03 Derek R. Price <derek@ximbiot.com>
2777 Bruno Haible <bruno@clisp.org>
2779 * pagealign_alloc.h: New file.
2780 * pagealign_alloc.c: New file.
2782 2005-01-28 Bruno Haible <bruno@clisp.org>
2784 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
2787 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
2789 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2790 The workaround isn't strictly needed for POSIX conformance, and
2791 it's too much of a pain to configure and maintain. We'll ask
2792 people to fix their kernels instead.
2793 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2794 (NANOSLEEP_BUG_WORKAROUND): Remove.
2795 (xnanosleep): Remove the workaround.
2797 2005-02-12 Bruno Haible <bruno@clisp.org>
2799 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
2801 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
2803 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2804 * timespec.h (gettime): Return void, since it always
2805 succeeds now. All uses changed.
2806 * gettime.c (gettime) Likewise.
2807 [HAVE_NANOTIME]: Prefer nanotime.
2808 Assume gettimeofday succeeds, as POSIX requires.
2809 Assime time () succeeds, since other code already does.
2810 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2811 (timespec_subtract): Remove.
2812 (NANOSLEEP_BUG_WORKAROUND): New constant.
2813 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2814 things considerably. Use it only on GNU/Linux hosts, since the
2815 workaround shouldn't be needed elsewhere.
2817 2005-02-24 Bruno Haible <bruno@clisp.org>
2819 * gettext.h: Update from GNU gettext 0.14.2.
2821 2005-02-24 Bruno Haible <bruno@clisp.org>
2823 * localcharset.c: Update from GNU gettext 0.14.2.
2824 * config.charset: Update from GNU gettext 0.14.2.
2826 2005-02-22 Simon Josefsson <jas@extundo.com>
2828 * iconvme.h, iconvme.c: New files, from libc.
2830 2005-02-20 Neil Conway <neilc@samurai.com>
2832 * xgethostname.c (xgethostname): Check for ENOMEM, which is
2833 returned by OSX/Darwin if the specified buffer is not large
2834 enough for the hostname.
2836 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
2838 * memrchr.h: New file.
2839 * chdir-long.c: Include it.
2840 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
2841 Don't bother including stddef.h.
2843 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2845 * argp-help.c (__argp_help): Create a fake struct argp_state and
2846 pass it to _help, otherwise the latter coredumps trying to
2847 dereference state.root_argp.
2849 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
2851 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2853 Include <sys/types.h>, for dev_t.
2854 (ME_DUMMY, ME_REMOTE): Move from here....
2855 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2856 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
2858 Include mountlist.h first, to test the interface.
2860 2005-01-29 Bruno Haible <bruno@clisp.org>
2862 * progname.c (program_name): Initialize.
2863 Needed when linking statically on MacOS X.
2865 2005-01-28 Bruno Haible <bruno@clisp.org>
2867 * javacomp.sh.in: New file, from GNU gettext.
2868 * javacomp.h: New file, from GNU gettext.
2869 * javacomp.c: New file, from GNU gettext.
2871 2005-01-26 Bruno Haible <bruno@clisp.org>
2873 * javaexec.sh.in: New file, from GNU gettext.
2874 * javaexec.h: New file, from GNU gettext.
2875 * javaexec.c: New file, from GNU gettext.
2877 2005-01-26 Simon Josefsson <jas@extundo.com>
2879 * gai_strerror.c: Use GPL in header.
2881 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2883 * argp-help.c (hol_entry_help): Avoid using non-constant
2884 initializers for struct pentry_state.
2885 (__argp_error): Check return value of __asprintf
2886 (__argp_failure): Translate error message
2888 * argp-parse.c: Removed braces around the expansion of N_()
2890 2005-01-21 Jim Meyering <jim@meyering.net>
2892 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2893 same value as for Solaris 9.
2895 * chdir-long.c (chdir_long): Rewrite to remove limitation on
2896 component length. This included changing the parameter to be
2897 of type `char *' rather than `char const *'.
2898 * chdir-long.h (chdir_long): Update prototype.
2900 * openat.c (fdopendir, fstatat): New functions.
2901 * openat.h: Include headers required for use of DIR and struct stat.
2902 [AT_SYMLINK_NOFOLLOW]: Define.
2903 (fdopendir, fstatat): Add prototypes.
2905 2005-01-21 Bruno Haible <bruno@clisp.org>
2907 * classpath.h: New file, from GNU gettext.
2908 * classpath.c: New file, from GNU gettext.
2910 2005-01-20 Simon Josefsson <jas@extundo.com>
2912 * version-etc-fsf.c: New file, with version_etc_copyright.
2913 * version-etc.c: Remove version_etc_copyright.
2914 * version-etc.h (version_etc_copyright): Use [] instead of * in
2915 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
2917 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
2919 * save-cwd.c (save_cwd): Remove code to support the case
2920 where fchdir is missing or flaky.
2922 2005-01-20 Simon Josefsson <jas@extundo.com>
2924 * base64.h (isbase64): Add.
2926 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
2927 using a unsigned prototype, don't inline.
2928 (base64_decode): Use it.
2930 2005-01-19 Bruno Haible <bruno@clisp.org>
2932 * sh-quote.h: New file, from GNU gettext.
2933 * sh-quote.c: New file, from GNU gettext.
2935 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
2937 Merge changes from coreutils, as described below in several
2938 changelogs dated today.
2940 * save-cwd.c: Include "save-cwd.h" before other include files.
2941 (O_DIRECTORY): Remove; not needed here, since "." must be
2942 a directory. All uses removed.
2943 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
2944 universal on Suns, and we also need to test for IRIX.
2945 Revamp code to use 'if' rather than '#if'.
2946 Avoid unnecessary comparison of cwd->desc to 0.
2948 * utimens.c (futimens): Robustify the previous patch, by checking
2949 for known valid error numbers rather than observed invalid ones.
2951 2005-01-18 Jim Meyering <jim@meyering.net>
2953 * version-etc.c (version_etc_copyright): Update copyright date.
2955 * utimens.c (futimens): Account for the fact that futimes
2956 can also fail with errno == ENOSYS or errno == ENOENT.
2957 Patch from Dmitry V. Levin.
2959 Change the name of the robust chdir function from chdir to chdir_long.
2960 * save-cwd.c: Include chdir-long.h rather than chdir.h.
2961 (restore_cwd): Use chdir_long, not chdir.
2962 * chdir-long.c: Renamed from chdir.c.
2963 * chdir-long.h: Renamed from chdir.h.
2964 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
2967 2005-01-18 Bob Proulx <bob@proulx.com>
2969 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
2970 offsetof() macro construct to avoid compile failure with native HP-UX
2971 11.0 ANSI C compiler.
2973 2005-01-06 Bruno Haible <bruno@clisp.org>
2975 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
2976 because stpncpy.m4 takes care of it.
2978 2004-01-24 Bruno Haible <bruno@clisp.org>
2980 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
2982 2003-10-09 Bruno Haible <bruno@clisp.org>
2984 * progreloc.c: Include xalloc.h instead of xmalloc.h.
2986 2005-01-06 Bruno Haible <bruno@clisp.org>
2988 * fwriteerror.h (fwriteerror): Change specification to include fclose.
2989 * fwriteerror.c: Include <stdbool.h>.
2990 (fwriteerror): At the end, close the file stream. Record whether
2991 stdout was already closed.
2993 2004-05-27 Bruno Haible <bruno@clisp.org>
2995 * execute.c (environ): Declare if needed.
2996 * pipe.c (environ): Likewise.
2997 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
2999 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
3001 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
3002 definitions to be after all include files, to avoid collisions.
3003 Problem reported by Bob Proulx.
3005 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
3007 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
3008 not needed. This removes a dependency on the gettext module.
3009 [defined _LIBC]: Do not include <libintl.h>; not needed.
3011 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
3013 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
3016 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
3018 * argp-parse.c: Include <stddef.h>.
3019 (alignof, alignto): New macros.
3020 (parser_init): Don't assume that void * is aligned sufficiently
3023 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
3024 need to extend the stack.
3025 (YYINITDEPTH): New macro, so that the initial stack isn't overly
3028 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3030 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
3032 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
3034 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
3035 Remove now-obsolete comment about AIX.
3036 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
3037 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
3038 (YYMAXDEPTH): New macro.
3040 2004-12-18 Bruno Haible <bruno@clisp.org>
3042 * fatal-signal.c (fatal_signals): Make non-const.
3043 (init_fatal_signals): New function.
3044 (uninstall_handlers, install_handlers): Ignore signals that were set to
3046 (at_fatal_signal): Call init_fatal_signals.
3047 (init_fatal_signal_set): Likewise. Ignore signals that were set to
3049 Reported by Paul Eggert.
3051 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
3053 * getdate.y (textint): New member "negative".
3054 (time_zone_hhmm): New function.
3055 Expect 14 shift-reduce conflicts, not 13.
3056 (o_colon_minutes): New rule.
3057 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
3058 (yylex): Set the "negative" member of signed numbers.
3060 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
3062 Changes imported from coreutils.
3063 * hard-locale.c: Assume <locale.h> exists.
3065 (GLIBC_VERSION): New macro.
3066 (hard_locale): Assume setlocale exists.
3067 Rewrite to avoid #ifdef.
3068 Use strdup rather than malloc + strcpy.
3069 * human.c: Assume <locale.h> exists.
3070 (human_readable): Assume localeconv exists.
3072 2004-12-01 Jakub Jelinek <jakub@redhat.com>
3074 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
3075 convert T2, not T. (Imported from libc.)
3077 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
3079 * getcwd.c (is_ENAMETOOLONG): New macro.
3080 (__getcwd.c): Don't restore errno; glibc doesn't.
3081 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
3082 first, falling back to our code only if its results look suspicious.
3083 Ensure that the resulting buffer is only as large as necessary.
3085 * readutmp.c: Include readutmp.h first.
3086 Include <errno.h>, since readutmp.h no longer does that.
3087 * readutmp.h: Don't include <errno.h>,
3088 <sys/param.h>, <time.h>; not needed to establish interface.
3089 (errno): Remove decl.
3090 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
3091 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
3092 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
3094 2004-11-28 Simon Josefsson <jas@extundo.com>
3096 * base64.h, base64.c: New file.
3098 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
3100 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
3102 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
3104 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
3105 HP's ANSI C compiler.
3106 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
3107 Declaring int functions causes warnings on some modern systems and
3108 shouldn't be needed to compile on ancient ones.
3109 * same.c (MIN) [defined MIN]: Don't define, since it's already
3112 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
3113 with the following changes.
3114 (__set_errno): Parenthesize properly.
3115 Include <stdbool.h>.
3116 (MIN, MAX, MATCHING_INO): New macros.
3117 (__getcwd): Define with prototype, not K&R form.
3118 Use heuristics to allocate default buffer on stack if possible.
3119 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
3120 behavior, and to avoid the PATH_MAX limit when computing
3122 Use MATCHING_INO to compare inode number to file.
3123 Check for arithmetic overflow in size calculations.
3124 Fix bug in reallocation of dot array that caused getcwd to fail
3125 on directories nested deeper than 75.
3126 Be more careful about saving errno on error.
3127 Do not use realloc; use only free+malloc, as this is a bit
3128 more flexible and avoids a needless copy operation.
3129 Do not inspect st_dev and st_ino for symbolic links; POSIX
3130 doesn't specify the latter.
3131 Check for closedir errors.
3132 Avoid needless casts.
3133 Use "#ifdef weak_alias" around weak_alias, to be like other
3135 The following changes to getcwd.c have effect only when used in
3136 gnulib; they have no effect inside glibc proper.
3137 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
3138 as alloca isn't used.
3139 (alloca, __alloca): Likewise.
3140 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
3141 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3142 unconditionally, as gnulib assumes C89 or better.
3143 Do not include <sys/param.h>.
3144 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
3145 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
3147 (NULL) [!defined NULL]: Remove; we assume C89 or better.
3148 Include <dirent.h> in a way that is compatible with modern Autoconf.
3149 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
3150 New macros, if not already defined.
3151 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
3152 Use "_LIBC", not "defined _LIBC", for consistency.
3153 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
3155 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
3156 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
3157 * xgetcwd.c: David MacKenzie's old code was removed, so give
3158 credit only to Jim Meyering and adjust the copyright dates.
3159 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
3160 <stdlib.h>, <unistd.h>, "pathmax.h".
3161 Instead, include "xgetcwd.h" (first) and "getcwd.h".
3162 (INITIAL_BUFFER_SIZE): Remove.
3163 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
3165 2004-11-23 Jim Meyering <jim@meyering.net>
3167 * getopt_.h: Remove trailing blanks.
3169 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
3171 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
3172 (futimens): New function, which uses futimes if available.
3173 (futimens, utimens): Support timespec==NULL, with same semantics
3174 as utime and utimens.
3175 * utimens.h (futimens): New decl.
3177 2004-11-23 Jim Meyering <jim@meyering.net>
3179 * __fpending.c: Add comment.
3181 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3183 * getopt_.h: Re-addition of __getopt_argv_const caused
3184 redefinition warnings. To avoid them, include the defines
3185 in `#if !defined __need_getopt ... #endif'. The only place
3186 where __getopt_argv_const is used is in definitions
3187 of getopt_long and getopt_long_only below, which are as well
3188 protected by `#ifndef __need_getopt'.
3189 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
3190 __need_getopt after including <stdio.h> and <unistd.h> These
3191 headers might have defined it.
3193 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
3195 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
3197 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
3198 optopt): Use them instead of invoking ## directly; otherwise, the
3199 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
3201 2004-11-19 Bruno Haible <bruno@clisp.org>
3203 * strtok_r.c: Move comments from here...
3204 * strtok_r.h: ... to here.
3206 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
3208 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
3209 might fail. Problem reported by Yoann Vandoorselaere.
3210 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
3211 that mishandle size_t overflow.
3213 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
3215 * canon-host.c: Include "strdup.h".
3216 (canon_host): Use getaddrinfo if available, so that IPv6 works.
3217 Use strdup instead of malloc/strcpy to duplicate strings.
3219 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
3220 (human_space_before_unit): New constant.
3221 * human.c (human_readable): Support it.
3223 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
3224 (xgetcwd): Set errno correctly when failing.
3225 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
3226 the failure is actually due to a PATH_MAX problem.
3228 Further getopt changes to make it more likely that glibc will
3229 buy the changes back.
3230 * getopt.c (POSIXLY_CORRECT): New constant.
3231 (getopt): Use it, so to preserve glibc semantic
3232 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
3233 when compiling for libc.
3234 * getopt_.h (__getopt_argv_const): Bring it back.
3235 (getopt_long, getopt_long_only): Use it.
3237 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
3238 New arg POSIXLY_CORRECT. All callers changed.
3239 (getopt): Argv is now char * const *, as per standard.
3240 (_getopt_internal_r, _getopt_internal): Argv is now char **,
3241 not char *__getopt_argv_const *.
3242 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
3243 _getopt_long_only_r): Likewise.
3244 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
3245 * getopt_int.h (_getopt_internal, _getopt_internal_r,
3246 _getopt_long_r, _getopt_long_only_r): Likewise.
3247 * getopt_.h (__getopt_argv_const): Remove.
3248 (getopt): Argv is now char * const *, as per standard.
3250 * getdate.y (tORDINAL): New token.
3251 (day, relunit): Allow it for relative times.
3252 (relative_time_table): Use tORDINAL for ordinals.
3254 2004-11-15 Jim Meyering <jim@meyering.net>
3256 * closeout.c: Include "__fpending.h" once again.
3257 Include <stdbool.h>.
3258 (close_stdout): Don't fail just because stdout was closed initially,
3259 since some programs don't write to stdout in the normal course of
3260 operation (other than --version and --help), and we don't want this
3261 function to make e.g. `touch file >&-' fail.
3262 But do fail if it was closed and someone has tried to write to it.
3263 E.g., `printf foo >&-' must fail.
3265 2004-11-11 Simon Josefsson <jas@extundo.com>
3267 * strtok_r.h, strtok_r.c: New file.
3269 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
3271 * getopt_.h (__getopt_argv_const): New macro, to be used so that
3272 we can stop lying to compilers about the constness of argv when we
3273 are compiled outside glibc.
3274 (getopt, getopt_long, getopt_long_only): Use it.
3275 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
3277 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
3278 _getopt_long_only_r): Likewise.
3279 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
3280 _getopt_long_only_r): Likewise.
3282 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
3283 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
3284 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
3285 the other external symbols.
3286 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
3287 declaration, since the above renaming now works around collisions.
3289 2004-11-11 Jim Meyering <jim@meyering.net>
3291 * linebreak.c: Remove trailing blanks.
3292 * alloca_.h: Likewise.
3293 * acosl.c: Likewise.
3294 * euidaccess.c: Likewise.
3295 * allocsa.h: Likewise.
3297 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
3299 * mktime.c (SHR): New macro, which is a portable
3300 substitute for >> that should work even on Crays.
3301 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
3302 Problem reported by Mark D. Baushke in
3303 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
3304 * getdate.y (SHR): Likewise.
3306 * strftime.c (SHR): Likewise.
3308 * quotearg.c (struct quoting_options): Use unsigned int for
3309 quote_these_too, so that right shifts are well defined. All uses
3312 2004-11-10 Simon Josefsson <jas@extundo.com>
3314 * getaddrinfo.h, getaddrinfo.c: New files.
3316 2004-11-10 Jim Meyering <jim@meyering.net>
3318 Ensure that no close failure goes unreported.
3319 * closeout.c (close_stdout): Always close stdout. I.e., don't
3320 return early when it seems there's nothing to flush.
3321 Don't include __fpending.h.
3323 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
3325 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
3327 2004-11-05 Bruno Haible <bruno@clisp.org>
3329 * readlink.c: Include stddef.h, needed for size_t on Woe32.
3330 Reported by Mark D. Baushke <mdb@cvshome.org>.
3332 2004-11-04 Bruno Haible <bruno@clisp.org>
3334 2004-09-11 Bruno Haible <bruno@clisp.org>
3335 * allocsa.valgrind: New file.
3336 2004-02-06 Bruno Haible <bruno@clisp.org>
3337 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
3338 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
3339 Reported by Christopher Seip <chris.seip@hp.com>.
3341 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
3343 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
3344 with errno == ERANGE if the buffer is too small.
3345 Problem reported by Mark D. Baushke.
3347 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
3349 * xreadlink.c (MAXSIZE): New macro.
3350 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
3351 size does not exceed MAXSIZE. Avoid cast.
3352 As suggested by Mark D. Baushke in
3353 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
3354 if readlink fails with buffer size just under MAXSIZE, try again
3357 2004-11-02 Derek R. Price <derek@ximbiot.com>
3358 and Paul Eggert <eggert@cs.ucla.edu>
3360 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
3361 (get_date): Overparenthesize to avoid GCC warning.
3363 2004-11-02 Bruno Haible <bruno@clisp.org>
3365 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
3366 function returns void.
3368 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
3370 * getpass.c (fflush_unlocked, flockfile, funlockfile)
3371 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
3374 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
3376 * getdate.y: Add support for TZ="foo" within a date string.
3377 Fix some bugs near time_t boundaries. Reject dates with
3378 out-of-range components, e.g., "Sept 31".
3379 Include <stdlib.h>, "setenv.h", "xalloc.h".
3380 (ISDIGIT_LOCALE): Remove; unused.
3381 Note that the TZ and time functions used here are not reentrant.
3382 (mktime_ok, get_tz): New functions.
3383 (TZBUFSIZE): New constant.
3384 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
3385 This requires that we sometimes generate our own TZ="XXX..." setting.
3387 2004-10-27 Derek R. Price <derek@ximbiot.com>
3389 * mktime.c (not_equal_tm): Remove redundant check.
3391 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
3393 * getdate.y: Use Bison 1.875 features, and some minor
3394 code cleanups. This change does not affect semantics.
3395 Don't include <stdlib.h>; no longer needed.
3396 Don't include unlocked-io.h; only the "#if TEST" code uses
3397 stdio, and performance isn't crucial there.
3398 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
3399 Bison 1.875 features as described below.
3400 All uses of "PC." replaced by "pc->".
3401 (YYSTYPE): Add a forward declaration.
3402 (yylex, yyerror): Use full prototypes in forward decls.
3403 Use "%pure-parser" rather than obsolescent "%pure_parser".
3404 Use %parse-param and %lex-param instead of obsolescent
3405 YYPARSE_PARAM and YYLEX_PARAM.
3406 (meridian_table, month_and_day_table, time_units_table,
3407 relative_time_table, time_zone_table, military_table,
3408 lookup_zone, lookup_word, get_date):
3409 Use NULL instead of 0 where appropriate.
3410 (to_hour): Avoid abort (), to avoid a dependency on
3412 (yyerror, yylex): Now accepts parser_control * arg.
3413 (main) [TEST]: Use '\0' rather than 0 for char.
3415 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
3417 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
3418 It's now the caller's responsibility to handle the case where
3419 !HAVE_GETPAGESIZE && !defined getpagesize.
3421 * mktime.c (leapyear): Arg is long int, not int.
3423 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
3425 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
3427 2004-10-12 Simon Josefsson <jas@extundo.com>
3429 * getpass.c (fflush_unlocked, flockfile, funlockfile)
3430 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
3433 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
3435 * vsnprintf.h: New file.
3436 * vsnprintf.c: New file.
3438 2004-10-07 Bruno Haible <bruno@clisp.org>
3440 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
3441 into the provided buffer.
3443 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
3445 * diacrit.c, diacrit.h: Add GPL notice.
3447 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
3448 * atanl.c (atanl): Keep the code as similar to glibc as possible.
3449 * logl.c (logl): Keep the code as similar to glibc as possible.
3450 This avoids a potential constant-folding bug.
3452 2004-10-05 Bruno Haible <bruno@clisp.org>
3454 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
3456 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
3458 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
3459 * xmalloc.c (xmemdup): Likewise.
3460 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
3461 XFREE): Remove these long-obsolescent macros.
3462 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
3463 * xstrdup.c: Remove.
3465 * regex.c (re_comp): Cast gettext return value to char *,
3466 Problem reported by Martin Neitzel via Mark D. Baushke.
3468 2004-10-04 Simon Josefsson <jas@extundo.com>
3470 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
3471 '#ifdef USE_UNLOCKED_IO'.
3473 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
3475 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
3476 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
3477 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
3478 regex.c, sha1.c, version-etc.c, yesno.c:
3479 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
3480 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
3481 the includer's responsibility.
3483 Sync from coreutils.
3485 * modechange.c (mode_compile): Don't decrement a pointer that
3486 points to the start of a string, as the C Standard says the
3487 resulting behavior is undefined.
3489 * backupfile.h (enum backuptype): Rename none -> no_backups,
3490 simple -> simple_backups, numbered_existing ->
3491 numbered_existing_backups, numbered -> numbered_backups
3492 to avoid shadowing problems. All uses changed.
3493 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
3494 * backupfile.c (check_extension, numbered_backup):
3495 Rename locals to avoid shadowing 'basename'.
3496 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
3499 * .cppi-disable: Add getopt_.h, getopt_int.h.
3500 * .cvsignore: Add getopt.h.
3502 2004-10-04 Simon Josefsson <jas@extundo.com>
3504 * memmem.h: New file.
3505 * memmem.c: New file, taken from glibc.
3507 2004-10-02 Jim Meyering <jim@meyering.net>
3509 * dirfd.h, getpagesize.h: Add copyright notice.
3511 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
3513 * snprintf.c: Remove comments as to why each header is needed.
3515 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
3517 * strsep.h: New file.
3518 * strsep.c: New file.
3520 2004-10-01 Simon Josefsson <jas@extundo.com>
3522 * snprintf.c (snprintf): Handle size==0.
3524 2004-10-01 Simon Josefsson <jas@extundo.com>
3525 Bruno Haible <bruno@clisp.org>
3527 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
3528 (snprintf): Declare 'args'.
3530 2004-09-30 Simon Josefsson <jas@extundo.com>
3532 * snprintf.h, snprintf.c: New files.
3534 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3536 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
3537 (hol_entry_help): Never translate an empty string.
3538 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
3539 * argp.h (OPTION_NO_TRANS): New option.
3541 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
3543 * xvasprintf.c: Include xalloc.h.
3544 (xvasprintf): Use xalloc_die, not xmalloc_die.
3546 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
3548 * dummy.c: Change copyright notice to FSF, and license to GPL.
3550 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
3552 * argp-pvh.c (argp_program_version_hook): Provide initial value.
3553 Problem reported by Bruno Haible in:
3554 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
3556 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
3558 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
3559 in case some system header has #define'd it. Problem reported by
3560 Soeren D. Schulze in
3561 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
3563 2004-09-08 Bruno Haible <bruno@clisp.org>
3565 * stdint_.h: New file, taken from GNU clisp.
3567 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
3569 * xvasprintf.h: New file.
3570 * xvasprintf.c: New file.
3571 * xasprintf.c: New file.
3573 2004-09-08 Bruno Haible <bruno@clisp.org>
3575 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
3577 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
3579 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
3581 Import from coreutils.
3582 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
3583 strings on unbounded length. alloca's performance benefits aren't
3584 that important here.
3586 (parse_with_separator): New function, with most of the internals
3587 of the old parse_user_spec. Allow user to omit both user and group,
3588 for compatibility with FreeBSD.
3589 Clone only the user name, not the entire spec.
3590 Do not set *uid, *gid unless entirely successful.
3591 Avoid memory leak in some failing cases.
3592 Fix regression for USER.GROUP reported by Dmitry V. Levin in
3593 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
3594 (parse_user_spec): Rewrite to use parse_with_separator.
3596 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
3598 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
3599 its complicated substitute.
3600 * argp-help.c: Include <errno.h>, for program_invocation_short_name
3601 and program_invocation_name.
3602 (__argp_basename) [!_LIBC]: Remove; the only use was
3603 replaced by its body.
3604 (__argp_short_program_name): Change condition from
3605 !defined __argp_short_program_name to
3606 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
3607 to match argp-namefrob.h.
3608 (__argp_failure): Don't assume strerror_r returns char *.
3609 * argp-parse.c (N_): Define unconditionally.
3610 (argp_default_options): Fill out initializers with 0 to avoid
3613 2004-08-12 Simon Josefsson <jas@extundo.com>
3615 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
3616 * getopt_.h: Renamed from getopt.h.
3618 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
3620 Merge from coreutils.
3622 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
3623 wmemchr or wmemcpy. Problem reported by Robert Dahlem
3624 for Reliant Unix 5.43.
3626 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
3627 (union fooround): Use uintmax_t, not long int.
3628 The rest is a merge from libc:
3629 [defined _LIBC]: Include <shlib-compat.h>.
3630 (_obstack) [defined _LIBC]: Remove after 2.3.4.
3632 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
3634 * strverscmp.c: Convert to UTF-8.
3636 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
3638 * obstack.h (obstack_empty_p):
3639 Don't assume that chunk->contents is suitably aligned.
3640 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
3641 Likewise. Problem reported by Benno in
3642 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
3644 * chown.c (rpl_chown): Work even if the file is writeable but not
3645 readable. This could be improved further but it'd take some work.
3647 2004-08-08 Simon Josefsson <jas@extundo.com>
3649 * xgethostname.c: Don't include error.h (not used).
3652 * getpass.c: Include getpass.h first.
3654 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
3656 * xalloc-die.c: New files.
3657 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
3659 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
3660 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
3661 (_, N_, xalloc_die): Move to xalloc-die.c.
3662 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
3663 so that we needn't mess with xalloc_msg_memory_exhausted.
3665 * sha1.h: Renamed from sha.h.
3666 (SHA1_H): Renamed from _SHA_H.
3667 (sha1_ctx): Renamed from sha_ctx.
3668 (sha1_init_ctx): Renamed from sha_init_ctx.
3669 (sha1_process_block): Renamed from sha_process_block.
3670 (sha1_process_bytes): Renamed from sha_process_bytes.
3671 (sha1_finish_ctx): Renamed from sha_finish_ctx.
3672 (sha1_read_ctx): Renamed from sha_read_ctx.
3673 (sha1_stream): Renamed from sha_stream.
3674 (sha1_buffer): Renamed from sha_buffer.
3675 * sha1.c: Likewise; renamed from sha.c.
3676 Do not include <sys/types.h>.
3677 Include <stddef.h> rather than <stdlib.h>.
3679 2004-08-08 Bruno Haible <bruno@clisp.org>
3681 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
3682 FILESYSTEM_PREFIX_LEN.
3683 * progreloc.c: Likewise.
3684 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
3686 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
3689 * argp-help.c (make_hol, hol_append): Don't assume that
3690 SIZE_MAX is a valid preprocessor constant.
3691 (__argp_basename): Change from "#ifndef _LIBC"
3692 to "#ifndef __argp_short_program_name", so that
3693 we don't compile these functions for tar.
3695 More merges from coreutils.
3696 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
3697 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
3699 * addext.c: Remove; no longer needed.
3700 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
3701 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
3702 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
3703 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
3704 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
3705 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
3706 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
3707 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
3708 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
3709 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
3710 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
3711 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
3712 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
3713 Import changes from coreutils.
3715 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
3717 Merge from coreutils.
3719 * .gdb-history: Remove; this doesn't belong here.
3721 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
3722 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
3723 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
3725 * dirname.h: Include <stdbool.h>.
3726 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
3727 for consistency with POSIX terminology. All uses changed.
3728 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
3729 (strip_trailing_slashes): Use bool for booleans.
3730 * stripslash.c (strip_trailing_slashes): Likewise.
3732 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
3733 sometimes returns a positive errno value even when it succeeds.
3734 (print_errno_message) [!LIBC]: Fall back on strerror if
3737 * path-concat.c (mempcpy): Don't define if a system header defines it.
3738 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
3739 (longest_relative_suffix): New function.
3740 (path_concat): Use it. Assume first argument is not NULL.
3741 Port to DOS. Omit redundant separators.
3742 Report an error instead of returning NULL.
3743 Use mempcpy instead of memcpy.
3744 (xpath_concat): Remove: not declared or used.
3746 * same.h: Include <stdbool.h>
3747 (same_name): Return bool, not int.
3748 * same.c (same_name): Likewise.
3749 (errno): Don't declare; we assume C89 or better now.
3751 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
3752 if not already defined.
3754 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
3755 * dup-safer.c (errno): Likewise.
3757 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
3759 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
3762 2004-08-03 Simon Josefsson <jas@extundo.com>
3764 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
3765 * progname.h: Don't include stdbool.h.
3767 2004-08-02 Simon Josefsson <jas@extundo.com>
3769 * getsubopt.h: New file, with comments from Bruno Haible.
3770 * getsubopt.c: New file, from glibc, but slightly modified based on
3771 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
3773 2004-08-01 Simon Josefsson <jas@extundo.com>
3775 * xgetdomainname.c: Include stdlib.h, for free().
3777 2004-07-16 Simon Josefsson <jas@extundo.com>
3779 * dummy.c: New file.
3781 2004-07-16 Bruno Haible <bruno@clisp.org>
3783 * backupfile.h: Add extern "C" for C++.
3784 * closeout.h: Likewise.
3785 * copy-file.h: Likewise.
3786 * findprog.h: Likewise.
3787 * full-write.h: Likewise.
3788 * pathname.h: Likewise.
3789 * progname.h: Likewise.
3790 * stpcpy.h: Likewise.
3791 * stpncpy.h: Likewise.
3792 * strcase.h: Likewise.
3793 * strstr.h: Likewise.
3794 * xalloc.h: Likewise.
3796 * mbswidth.h: Add extern "C" for C++.
3797 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
3799 2004-07-09 Simon Josefsson <jas@extundo.com>
3801 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
3802 failed without this.)
3804 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
3806 * fchown-stub.c: New file.
3808 2004-06-24 Jim Meyering <jim@meyering.net>
3810 * obstack.h (obstack_base): Cast to (void *), per documentation.
3812 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
3814 * argz.c, argz_.h: New files, which are autoupdated from libtool.
3816 2004-06-01 Jim Meyering <jim@meyering.net>
3818 * calloc.c: New file.
3820 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
3822 * getdate.y (yylex): Allow space between sign and number.
3823 Problem reported by Dan Jacobson.
3825 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
3826 and Jim Meyering <jim@meyering.net>
3828 Merge from coreutils CVS.
3830 * stat-macros.h: New file, with contents from file-type.h
3831 and coreutils' system.h.
3832 * file-type.c: Include "stat-macros.h".
3833 * file-type.h (file_type): Move all macro definitions to new file,
3836 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
3837 Wrap old code with this conditional.
3838 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
3839 function that does not dereference symlinks.
3840 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
3842 * xreadlink.c: Include xreadlink.h first, to catch .h file
3843 dependency problems.
3844 (xreadlink): Accept new arg SIZE, for efficiency.
3845 All decls and uses changed.
3846 * xreadlink.h: Include <stddef.h>, for size_t.
3848 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
3849 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
3851 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
3853 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
3855 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
3856 macros to be defined.
3857 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
3858 the allocator returns NULL because the requested size is zero.
3860 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3862 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
3863 var. Add comment explaining why libc still defines it. This
3864 merges the following patch from glibc:
3865 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
3867 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
3869 * obstack.c (_obstack): Remove unused variable. It hasn't been
3870 present in glibc since revision 1.1 of this file.
3871 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
3872 obstack_alignment_mask, obstack_alloc, obstack_base,
3873 obstack_blank, obstack_blank_fast, obstack_chunk_size,
3874 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
3875 obstack_grow0, obstack_init, obstack_int_grow,
3876 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
3877 obstack_next_free, obstack_object_size, obstack_ptr_grow,
3878 obstack_ptr_grow_fast, obstack_room): Remove declarations of
3879 nonexistent functions.
3881 2004-05-17 Derek R. Price <derek@ximbiot.com>
3882 Paul Eggert <eggert@cs.ucla.edu>
3884 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
3886 2004-05-14 Bruno Haible <bruno@clisp.org>
3888 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
3889 that consists of a '.' followed by an empty digit string.
3890 Patch by Tor Lillqvist <tml@iki.fi>.
3892 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
3894 Port obstack to the AS/400, where pointers are 16 bytes wide and
3895 you cannot cast an integer to a valid pointer. This patch is
3896 currently waiting to be integrated into glibc; see
3897 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
3899 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
3900 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
3901 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
3902 (struct obstack): temp member is now a union of a pointer and
3903 an integer, instead of an integer. All integer uses changed.
3904 This does not affect the physical layout of struct obstack,
3905 except on hosts (like the AS/400) where the size or alignment of
3906 void * is greater than that of ptrdiff_t.
3907 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
3908 __STDC__)]: Store temporary in pointer member of union, not
3910 * obstack.c: Include <stddef.h>, for offsetof.
3911 (struct fooalign): Remove; it doesn't need a name.
3912 (union fooround): Change double to long double, and add void *.
3913 (DEFAULT_ALIGNMENT): Use offsetof to compute.
3914 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
3915 not a macro. Hence the values are always int; so remove all
3916 casts-to-int in uses.
3918 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
3919 Derek Price <derek@ximbiot.com>
3921 * alloca.c: Include <alloca.h>, to get our interface.
3922 * alloca_.h: Use __alloca on AIX, so that we don't have to
3923 include <alloca.h> first. Use C89 prototype for alloca; this
3924 requires including <stddef.h> for size_t. Use extern "C" if C++.
3925 Use #elif for simplicity, since we can assume C89 now.
3926 Don't try to source the system alloca.h since it will not be found
3927 and to prevent recursively including its replacement.
3928 * fnmatch.c: Include <alloca.h> instead of opencoding.
3929 * regex.c: Likewise.
3931 2004-05-16 Derek Price <derek@ximbiot.com>
3932 Paul Eggert <eggert@cs.ucla.edu>
3934 getline cleanup. This changes the getndelim2 API: both order of
3935 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
3938 * getline.c: Don't include stddef.h or stdio.h, since our
3939 interface does that.
3940 (getline): Always use getdelim, so that we don't have two
3941 copies of this code.
3942 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
3944 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
3945 (GETNDELIM2_MAXIMUM): New macro.
3946 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
3947 instead of the old practice of delim2==0. All callers changed.
3948 Return -1 on overflow, instead of returning junk.
3949 Do not set *linesize unless allocation succeeds.
3950 * getndelim2.h: Do not include stddef.h; no longer needed, now
3951 that we include sys/types.h.
3952 * getnline.h: Likewise.
3953 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
3954 (getndelim2): Reorder arguments.
3955 * getnline.c (getnline, getndelim):
3956 Don't discard the NMAX argument.
3957 (getnline): Invoke getndelim, to avoid code duplication.
3958 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
3959 of (size_t) -1 by callers of the getnline family.
3961 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3963 * nanosleep.c (suspended): Change its type from int to
3964 sig_atomic_t volatile.
3965 (first_call): Make it private to rpl_nanosleep, and have it
3966 be zero initially as that's a bit faster.
3967 (my_usleep): Round up fractional times instead of truncating them,
3968 as this is the usual meaning for 'sleep'.
3970 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3972 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3973 (ENOSYS): Define if not defined.
3974 (settime): Fall back on stime if it exists and settimeofday fails.
3975 But don't bother with fallbacks if a method fails with errno == EPERM.
3977 2004-05-11 Jim Meyering <jim@meyering.net>
3979 Prior to this change, the save_cwd caller required read access to the
3980 current directory on most systems (ones with the fchdir function).
3982 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
3983 fails, try write-only, and finally, resort to using xgetcwd.
3985 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
3987 * obstack.c, obstack.h: Import changes from libc.
3989 2004-04-28 Bruno Haible <bruno@clisp.org>
3991 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
3992 implicitly appends .exe to executables.
3993 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
3994 accepts Windows pathnames.
3995 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3996 Cygwin like Windows, since it now accepts Windows pathnames.
3997 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3998 Cygwin like Windows, since it now accepts Windows pathnames.
3999 Reported by Derek Robert Price <derek@ximbiot.com>.
4001 2004-04-20 Jim Meyering <jim@meyering.net>
4003 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
4005 2004-04-20 Jim Meyering <jim@meyering.net>
4006 Bruno Haible <bruno@clisp.org>
4008 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
4009 memory when realloc fails.
4011 2004-04-18 Jim Meyering <jim@meyering.net>
4013 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
4014 don't leak memory and do call END_UTMP_ENT.
4016 2004-04-11 Paul Eggert <eggert@twinsun.com>
4018 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
4019 (CHAR_BIT): Remove, since we assume C89.
4020 Include <stdint.h> if available, as per current Autoconf CVS advice.
4022 2004-03-30 Paul Eggert <eggert@twinsun.com>
4024 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
4025 not bool, to be more consistent with Unix conventions.
4026 Suggested by Bruno Haible.
4028 Merge from coreutils.
4030 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
4033 * getdate.h: Include stdbool.h, and timespec.h instead of
4034 the usual <time.h> dance.
4035 (get_date): Change signature to support fractional time stamps.
4036 All callers changed.
4037 * getdate.y: Include "getdate.h" first, as we can now
4038 assume C89 and don't need to worry about 'const'.
4039 Similarly, include "unlocked-io.h" near start, not in middle.
4041 (textint.value): Use long int rather than int.
4042 (textint.digits): Use size_t rather than int.
4043 (BILLION, LOG10_BILLION): New constants.
4044 (parser_control): New member rel_ns. Members day_ordinal,
4045 time_zone, month, day, hour, minutes, rel_year, rel_month,
4046 rel_day, rel_hour, rel_minutes, rel_seconds
4047 are now long int, not int. Member seconds is now struct timespec,
4048 not int. New member timespec_seen. Members dates_seen, days_seen,
4049 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
4051 (%union.intval): Now long int, not int.
4052 New member timespec.
4053 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
4054 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
4055 (spec): Now is a timespec or an item list.
4056 (timespec, items): New nonterminals.
4057 (time, rel, relunit, number, get_date):
4058 Add support for fractional seconds.
4059 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
4060 (gmtime, localtime, mktime): Remove decls; not needed with C89.
4061 (to_hour): First arg is now long int, not int.
4062 (to_year): Returns long int, not int.
4063 Don't treat year -70 like 70.
4064 (tm_diff): Returns long int, not int.
4065 (lookup_word): Use bool instead of int when appropriate.
4066 (yylex): Use size_t for count, not int.
4067 Detect overflow when parsing large integer constants.
4068 Add support for fractions.
4069 (get_date): Make pointers 'const' if possible.
4070 Use more-portable code to detect integer overflow.
4071 (main) [TEST]: Adjust to above changes. Test for localtime failure.
4072 Don't use ctime; it's not reliable if the year has >4 digits.
4074 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
4075 This is for compatibility with BSD.
4077 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
4078 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
4079 From coreutils' system.h.
4081 * userspec.c: Don't include "posixver.h".
4082 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
4083 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
4084 compatible extension. Simplify code by removing a boolean int
4085 that was always nonzero if a string was nonnull.
4087 2004-03-30 Jim Meyering <jim@meyering.net>
4089 Merge from coreutils.
4091 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
4093 * readtokens.c (readtoken): Don't leak 64 bytes when reading
4094 an empty input stream.
4096 * readtokens.c: Include <stdbool.h>.
4097 (readtoken): Use `size_t' rather than int/long.
4098 All callers adjusted.
4099 Use `bool' rather than `int' where appropriate.
4100 Use memset rather than an explicit loop.
4101 Use x2nrealloc rather than xrealloc.
4102 Allow the use of `\0' as a delimiter.
4103 (readtokens): Likewise.
4104 * readtokens.h (readtoken, readtokens): Update prototypes.
4106 2004-03-30 Bruno Haible <bruno@clisp.org>
4108 * getloadavg.c (getloadavg): Don't assume setlocale returns
4111 2004-03-29 Paul Eggert <eggert@twinsun.com>
4113 Merge changes to getloadavg.c from coreutils and Emacs.
4115 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
4116 Define to an expression, not to the empty string.
4117 Include cloexec.h and xalloc.h.
4118 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
4119 Use set_cloexec_flag rather than rolling our own.
4120 * cloexec.c, cloexec.h: New files.
4122 2004-03-18 Paul Eggert <eggert@twinsun.com>
4124 * getopt.h: Sync with libc CVS.
4126 2004-03-18 Paul Eggert <eggert@twinsun.com>
4127 Bruno Haible <bruno@clisp.org>
4129 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
4130 not on all platforms that have <wchar.h>.
4131 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
4133 2004-03-09 Paul Eggert <eggert@twinsun.com>
4135 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
4137 * getopt_int.h: New file, also synced from libc.
4139 2004-03-07 Paul Eggert <eggert@twinsun.com>
4141 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
4142 '#if' expressions. Unlike the code it replaces, it does not
4143 depend on (defined _SC_PAGESIZE). However, it does depend on
4144 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
4145 first reported by Jason Andrade in
4146 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
4148 2004-01-18 Simon Josefsson <jas@extundo.com>
4150 * strdup.h: New file.
4151 * strdup.c: Include it.
4152 * path-concat.c: Include strdup.h. Drop strdup declaration.
4153 * userspec.c: Include strdup.h. Drop strdup declaration.
4155 2004-02-06 Karl Berry <karl@gnu.org>
4157 * config.charset: update from gettext 0.14.1.
4159 2004-02-05 Paul Eggert <eggert@twinsun.com>
4161 Add comments and code, prompted by suggestions from Bruno Haible
4163 * quotearg.h (quotearg_alloc): New decl. Improve the comments
4164 describing the enum quoting_style values.
4165 * quotearg.c (quotearg_alloc): New function.
4166 (quotearg_buffer_restyled): Treat lone { and } as special.
4167 Treat = as special. Work around bug with older shells
4168 that "see" a '\' that is really the 2nd byte of a multibyte char.
4169 Quote empty string with shell_quoting_style.
4171 2004-02-03 Bruno Haible <bruno@clisp.org>
4173 * pipe.h: New file, from GNU gettext.
4174 * pipe.c: New file, from GNU gettext.
4176 2004-01-27 Bruno Haible <bruno@clisp.org>
4178 * execute.h: New file, from GNU gettext.
4179 * execute.c: New file, from GNU gettext.
4180 * w32spawn.h: New file, from GNU gettext.
4182 2004-01-23 Paul Eggert <eggert@twinsun.com>
4184 Exit-status fix from coreutils.
4186 Use exit_failure consistently in place of EXIT_FAILURE,
4187 so that program exit statuses are consistent on failure.
4189 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
4190 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
4191 * argmatch.h: Comment fix to match the above.
4192 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
4193 Now a macro referring to exit_failure, instead of a separate
4194 variable. Include "exitfail.h" to get it.
4195 * xstrtol.h: Include "exitfail.h".
4196 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
4198 * long-options.c (parse_long_options): Use prototype
4199 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
4202 2004-01-21 Jim Meyering <jim@meyering.net>
4204 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
4205 so as not to conflict with a different-sized __mktime_internal
4206 function in GNU libc.
4207 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
4208 Problem building statically-linked `ls' reported by Michael Brunnbauer.
4210 2004-01-18 Paul Eggert <eggert@twinsun.com>
4212 Merge from diffutils.
4214 * file-type.c (file_type): Add typed memory objects.
4215 * file-type.h (S_TYPEISTMO): New macro.
4217 * c-stack.h (c_stack_action): Remove argv argument.
4218 * c-stack.c (c_stack_action): Likewise. All uses changed.
4219 (die): Don't calculate message unless segv_action returns.
4220 (get_stack_location, min_address_from_argv, max_address_from_argv,
4221 volatile stack_base, volatile_stack_size): Remove.
4222 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
4223 that every segmentation violation is a stack overflow. (Ouch!)
4224 See Debian bug 136249 (still outstanding) for more info about why
4225 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
4227 2003-11-30 Bruno Haible <bruno@clisp.org>
4229 Safer stack allocation.
4230 * setenv.c: Include allocsa.h.
4231 (alloca): Remove fallback definition.
4232 (freea): Remove macro.
4233 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
4236 2003-10-17 Bruno Haible <bruno@clisp.org>
4238 * binary-io.h: Avoid warnings on Cygwin.
4240 2003-12-28 Bruno Haible <bruno@clisp.org>
4242 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
4243 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
4245 2003-11-28 Bruno Haible <bruno@clisp.org>
4247 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
4249 2003-11-27 Bruno Haible <bruno@clisp.org>
4251 * wait-process.c: On Windows, include windows.h. Needed on mingw.
4253 2003-11-17 Bruno Haible <bruno@clisp.org>
4255 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
4257 2003-11-24 Bruno Haible <bruno@clisp.org>
4259 * xallocsa.h: New file, from GNU gettext.
4260 * xallocsa.c: New file, from GNU gettext.
4262 2003-11-24 Bruno Haible <bruno@clisp.org>
4264 * allocsa.h: New file, from GNU gettext.
4265 * allocsa.c: New file, from GNU gettext.
4267 2003-11-24 Bruno Haible <bruno@clisp.org>
4269 * eealloc.h: New file.
4271 2004-01-15 Jim Meyering <jim@meyering.net>
4273 Merge from coreutils.
4275 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
4276 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
4277 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
4279 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
4280 optional configure-time default.
4282 * version-etc.c (version_etc_copyright): Update copyright date.
4284 * xreadlink.c (xreadlink): Correct outdated comment.
4286 2004-01-15 Paul Eggert <eggert@twinsun.com>
4288 Merge from coreutils.
4290 * posixver.c: Include posixver.h.
4292 * same.c: Include <stdbool.h>, <limits.h>.
4293 (_POSIX_NAME_MAX): Define if not defined.
4295 (same_name): If file names are silently truncated, report
4296 that the file names are the same if they are the same after
4297 the silent truncation.
4299 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
4300 conversion function.
4301 * xstrtod.c (xstrtod): Likewise. All callers changed to
4302 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
4305 2004-01-14 Paul Eggert <eggert@twinsun.com>
4307 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
4308 with like-named macro in fnmatch.c.
4309 (EXT): Use an internal constant instead.
4311 Merge fnmatch patches from glibc.
4312 * fnmatch.c (mbsinit): Remove define.
4313 Add libc_hidden_ver (__fnmatch, fnmatch).
4314 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
4315 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
4317 2003-12-14 Karl Berry <karl@gnu.org>
4319 * config.charset: update from gettext-runtime.
4321 2003-12-03 Paul Eggert <eggert@twinsun.com>
4323 * getgroups.c (getgroups): xmalloc takes one argument, not two.
4324 Bug reported by Alfred M. Szmidt.
4326 2003-11-29 Karl Berry <karl@gnu.org>
4328 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
4330 2003-11-23 Paul Eggert <eggert@twinsun.com>
4331 Bruno Haible <bruno@clisp.org>
4333 * printf-parse.h: Don't include sys/types.h.
4334 (ARG_NONE): New macro.
4335 (char_directive): Change type of *arg_index fields to size_t.
4336 * printf-parse.c: Don't include sys/types.h.
4337 (SSIZE_MAX): Remove macro.
4338 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
4339 Remove unnecessary overflow check.
4340 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
4343 2003-11-24 Paul Eggert <eggert@twinsun.com>
4345 * alloca.c: Remove dependency on xalloc module.
4346 (xalloc_die): Remove.
4347 (memory_full) [!defined emacs]: New macro.
4348 [!defined emacs]: Don't include xalloc.h.
4349 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
4350 address arithmetic overflows. Change datatypes a bit to avoid
4353 2003-11-22 Jim Meyering <jim@meyering.net>
4355 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
4357 2003-11-17 Bruno Haible <bruno@clisp.org>
4359 * vasnprintf.c (alloca): Remove fallback definition.
4360 (freea): Remove definition.
4361 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
4362 Reported by Paul Eggert.
4364 2003-11-17 Jim Meyering <jim@meyering.net>
4366 On systems without utime and without a utimes function capable of
4367 dealing with a NULL struct utimbuf* argument, this utime replacement
4368 could -- in unusual circumstances -- leak a file descriptor.
4369 * utime.c: Include <unistd.h> and <errno.h>.
4370 (utime_null): Be sure to close `fd' and to preserve errno.
4371 Reported by Geoff Collyer via Arnold Robbins.
4373 2003-11-16 Paul Eggert <eggert@twinsun.com>
4374 Bruno Haible <bruno@clisp.org>
4376 Protect against address arithmetic overflow.
4377 * printf-args.h: Include stddef.h.
4378 (arguments): Change type of field 'count' to size_t.
4379 * printf-args.c (printf_fetchargs): Use size_t instead of
4380 'unsigned int' where appropriate.
4381 * printf-parse.h: Include sys/types.h.
4382 (char_directive): Change type of *arg_index fields to ssize_t.
4383 (char_directives): Change type of fields 'count', max_*_length to
4385 * printf-parse.c: Include sys/types.h and xsize.h.
4386 (SSIZE_MAX): Define fallback value.
4387 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
4388 instead of 'int' where appropriate. Check a_allocated, d_allocated
4389 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
4390 * vasnprintf.c: Include xsize.h.
4391 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
4392 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
4393 overflow. Avoid wraparound when converting a width or precision from
4396 2003-11-16 Bruno Haible <bruno@clisp.org>
4398 Update from GNU gettext.
4399 * printf-parse.c: Generalize to it can be compiled for wide strings.
4400 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
4401 * vasnprintf.c: Generalize to it can be compiled for wide strings.
4402 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
4403 SNPRINTF): New macros.
4404 Don't include <alloca.h> if the file is used inside libintl.
4405 (local_wcslen): New function, for Solaris 2.5.1.
4406 (VASNPRINTF): Use it instead of wcslen.
4408 2003-11-16 Bruno Haible <bruno@clisp.org>
4410 * xsize.h (xmax): New function.
4411 (xsum, xsum3, xsum4): Declare as "pure" functions.
4413 2003-11-12 Paul Eggert <eggert@twinsun.com>
4415 * xalloc.h: Do not include <limits.h> or <stdint.h>.
4416 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
4417 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
4418 heuristic is just as accurate as far as we know, and it removes a
4419 dependency on size_max.m4 and ptrdiff_max.m4.
4421 2003-11-12 Paul Eggert <eggert@twinsun.com>
4423 * xstrtol.c (__xstrtol): Remove "break" immediately after
4424 "return", to pacify some unknown compiler. Problem reported
4427 2003-11-11 Bruno Haible <bruno@clisp.org>
4429 * xsize.h (SIZE_MAX): Remove fallback definition.
4430 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
4433 2003-11-10 Paul Eggert <eggert@twinsun.com>
4435 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
4436 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
4437 rejected some allocations of exactly SIZE_MAX - 2 bytes.
4439 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
4440 not (size_t) -1, since it's defined here.
4442 2003-11-06 Paul Eggert <eggert@twinsun.com>
4444 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
4445 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
4446 Reject sizes of exactly SIZE_MAX bytes.
4447 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
4448 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
4450 2003-11-05 Bruno Haible <bruno@clisp.org>
4452 * xsize.h: Include limits.h, to avoid a possible collision with
4453 SIZE_MAX defined in <limits.h> on Solaris.
4455 2003-11-04 Bruno Haible <bruno@clisp.org>
4457 * xsize.h: New file.
4458 * linebreak.c: Include xsize.h.
4459 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
4460 argument for overflow.
4461 Suggested by Paul Eggert.
4463 2003-10-31 Bruno Haible <bruno@clisp.org>
4465 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
4466 to avoid (extremely rare) race condition.
4467 Suggested by Paul Eggert.
4469 2003-11-03 Jim Meyering <jim@meyering.net>
4471 * userspec.c: Include "userspec.h".
4472 * userspec.h: New file.
4474 2003-10-31 Paul Eggert <eggert@twinsun.com>
4476 * mountlist.h (struct mount_entry.me_type_malloced): New member.
4477 * mountlist.c (SIZE_MAX): Define if not defined already.
4478 (read_filesystem_list): Set and use me_type_malloced.
4479 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
4480 whatever the type happens to be), for brevity and consistency.
4481 Check for size calculation overflow on Alphas running OSF/1.
4483 2003-10-31 Jim Meyering <jim@meyering.net>
4485 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
4487 * linebuffer.c: Include <string.h> for declaration of memset.
4489 2003-10-30 Paul Eggert <eggert@twinsun.com>
4490 Bruno Haible <bruno@clisp.org>
4492 * vasprintf.c: Include <limits.h>, <stdlib.h>.
4493 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
4495 2003-10-29 Paul Eggert <eggert@twinsun.com>
4497 * xalloc.h (xalloc_oversized): Now a macro, not a function,
4498 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
4500 * quotearg.c (quotearg_n_options): Use it.
4501 * group-member.c: Include <stdbool.h>.
4502 (free_group_info): Arg is now const *; don't free arg.
4503 (get_group_info): Now returns bool and accepts struct group_info *,
4504 rather than returning a malloc'ed struct group_info *.
4505 All uses changed. Check for overflow in internal size calculation.
4507 * getusershell.c (readname): Simplify the code by using x2nrealloc
4508 rather than xmalloc/xrealloc.
4509 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
4510 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
4511 conformance bug: the old code used a pointer after freeing the
4512 storage that it addressed.
4513 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
4514 rather than doing it by hand.
4515 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
4516 the buffer preserved. Use free and xmalloc instead.
4517 * quotearg.c (quotearg_n_options): Likewise.
4518 Use a simpler test for size overflow. Don't use xalloc_oversized
4519 because unsigned int might be wider than size_t (!); this suggests
4520 that we should switch from unsigned int to size_t for slot numbers.
4522 2003-10-27 Bruno Haible <bruno@clisp.org>
4524 * stdbool_.h: Better support for BeOS.
4526 2003-10-27 Paul Eggert <eggert@twinsun.com>
4528 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
4529 to allocate the returned structure. Do not allocate a subarray,
4530 as x2nrealloc will do that.
4531 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
4532 instead of xnrealloc.
4533 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
4535 2003-10-26 Paul Eggert <eggert@twinsun.com>
4537 * xalloc.h (xalloc_oversized): New static inline function, for
4538 callers that want to do their own size-overflow checking. Include
4539 <stdbool.h>, since xalloc_oversized returns bool.
4540 * xalloc.c (array_size_overflow): Remove. All callers changed
4541 to use xalloc_oversized.
4543 Add two functions x2realloc, x2nrealloc, for programs that grow
4544 arrays dynamically by doubling their sizes.
4545 * xalloc.h (x2realloc, x2nrealloc): New decls.
4546 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
4549 Port to C99 semantics for 'inline' of external functions.
4550 Bug reported by Bruno Haible.
4551 * xmalloc.c (xnmalloc_inline): New static inline function,
4552 with the old contents of xnmalloc.
4553 (xnmalloc, xmalloc): Use it.
4554 (xnrealloc_inline): New static inline function,
4555 with the old contents of xnrealloc.
4556 (xnrealloc, xrealloc): Use it.
4558 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
4560 2003-10-25 Paul Eggert <eggert@twinsun.com>
4562 Fix several address-calculation bugs in the hash modules,
4563 plus some minor code cleanup.
4565 * hash.h: Include <stdbool.h>, for bool.
4566 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
4567 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
4568 hash_get_n_entries, hash_get_max_bucket_length,
4569 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
4570 hash_rehash): Use size_t rather than unsigned.
4571 * hash.c (struct hash_table, hash_get_n_buckets,
4572 hash_get_n_buckets_used, hash_get_n_entries,
4573 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
4574 hash_get_entries, hash_do_for_each, hash_string, is_prime,
4575 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
4577 (SIZE_MAX): Define if not defined.
4578 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
4579 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
4581 Use const * when possible.
4582 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
4583 (check_tuning): Fix bug: if tuning parameters were very close to
4584 0 or 1, rounding errors could have caused subscript violations.
4585 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
4586 (hash_initialize): Add 'fail:' label
4587 to free table and return NULL, and use it to simplify code.
4588 Use calloc rather than clearing the storage ourself.
4589 (hash_initialize, hash_rehash): Check for arithmetic overflow in
4590 buffer size calculations.
4591 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
4592 Include <stddef.h>, for size_t.
4593 * hash-pjw.c (hash_pjw): Likewise.
4594 Switch to method described by Bruno Haible.
4595 Include <limits.h>, for CHAR_BIT.
4596 (SIZE_BITS): New macro.
4598 2003-10-21 Paul Eggert <eggert@twinsun.com>
4600 * getndelim2.c (getndelim2): When size calculation overflows,
4601 ceiling the allocation at NMAX bytes rather than silently
4602 discarding input bytes before NMAX is reached. This makes
4603 a difference only if NMAX exceeds SIZE_MAX / 2.
4605 * obstack.c: Merge from glibc.
4606 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
4607 Add libc_hidden_def (_obstack_newchunk).
4608 (_obstack_free) [! defined _LIBC]: Remove.
4609 [defined _LIBC]: Make a strong alias from obstack_free, rather than
4610 a clone of the function body.
4611 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
4612 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
4614 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
4615 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
4618 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
4619 (obstack_ptr_grow_fast, obstack_int_grow_fast):
4620 Don't use lvalue casts, as GCC plans to remove support for them
4621 in GCC 3.5. Reported by Joseph S. Myers. This bug
4622 was also present in the non-GCC version, indicating that this
4623 code had always been buggy and had never been widely used.
4624 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
4625 Use the fast variant of each macro, rather than copying the
4626 definiens of the fast variant; that way, we'll be more likely to
4627 catch future bugs in the fast variants.
4629 2003-10-20 Bruno Haible <bruno@clisp.org>
4631 * wait-process.h: New file, from GNU gettext.
4632 * wait-process.c: New file, from GNU gettext.
4634 2003-10-19 Jim Meyering <jim@meyering.net>
4636 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
4638 2003-10-16 Paul Eggert <eggert@twinsun.com>
4640 * getgroups.c: Include <errno.h>, <stdlib.h>.
4641 (getgroups): First arg is int, not size_t.
4642 Don't let 'free' mangle errno.
4644 2003-10-16 Jim Meyering <jim@meyering.net>
4646 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
4648 2003-10-15 Paul Eggert <eggert@twinsun.com>
4650 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
4652 (new_exclude, add_exclude_file): Initial size no longer needs to
4654 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
4655 our own address arithmetic overflow checking.
4657 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
4658 (fnmatch): Do not alloca more than 2000 wide characters;
4659 instead, use malloc for large buffers.
4660 Check for address arithmetic overflow, and return -1
4661 with errno set to ENOMEM in that case.
4662 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
4663 (NEW_PATTERN): Do not alloca more than 8000 bytes;
4664 instead, return -1. Check for address arithmetic overflow.
4666 2003-10-14 Paul Eggert <eggert@twinsun.com>
4668 Handle invalid suffixes and overflow independently, so that
4669 callers can treat them independently as needed. Fix some bugs in
4670 suffix handling, e.g., "100k@" was not diagnosed as an invalid
4671 suffix for a human-readable blocksize. The major caller-visible
4672 change is the addition of a new
4673 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
4674 that both overflow and suffix chars were found.
4676 * human.c (humblock): Don't check separately for invalid suffix
4677 char; that is xstrtoumax's job (now that its bug is fixed).
4678 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
4679 INTMAX_MAX]: New macros.
4680 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
4681 TYPE_MAXIMUM): New macros.
4682 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
4683 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
4684 if overflow occurs, as it's what __strtol does and it's more useful
4686 (__xstrtol): If __strtol reports some error other than ERANGE,
4687 reflect it to the caller as LONGINT_INVALID. If it reports
4688 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
4689 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
4690 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
4692 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
4693 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
4694 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
4695 [defined UINTMAX_MAX]: New macros.
4697 2003-10-14 Bruno Haible <bruno@clisp.org>
4699 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
4700 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
4701 Also use volatile where needed.
4703 2003-10-12 Paul Eggert <eggert@twinsun.com>
4705 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
4706 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
4707 and define in terms of the other primitives.
4708 * xmalloc.c: Include stdbool.h; do not include exit.h.
4709 (SIZE_MAX): Define if not already defined.
4710 (array_size_overflow): New function.
4711 (xalloc_die): Abort instead of exiting if 'error' returns.
4712 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
4713 (xmalloc, xrealloc): Use them.
4714 (xcalloc): Check for address arithmetic overflow.
4715 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
4716 a bit faster than strcpy.
4718 2003-10-08 Paul Eggert <eggert@twinsun.com>
4720 Merge getpass from libc, plus a few fixes.
4722 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
4723 Include <stdbool.h>.
4724 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
4725 __fsetlocking to empty.
4726 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
4727 do include <bits/libc-lock.h>.
4728 Do not include <fcntl.h>; not needed.
4729 [_LIBC]: Include <wchar.h>.
4730 (NOTCANCEL_MODE): New macro.
4731 (flockfile, funlockfile) [_LIBC]: New macros.
4732 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
4733 [!_LIBC]: New macros.
4734 (call_fclose): New function.
4735 (getpass): Use it. Save tty stream separately; this simplifies the
4736 code and makes it more reliable if stdin happens to equal stdout.
4737 Invoke __fsetlocking on tty.
4738 Handle thread cancellation if needed.
4739 Namespace cleanup (use __tcgetattr, __getline).
4740 Use bool for Booleans.
4741 [USE_IN_LIBIO]: Handle wide streams.
4742 [!_LIBC]: Unconditionally do the fseek, since we don't know what
4743 stream might go where.
4745 * unlocked-io.h: Include <stdio.h>, so that the caller
4746 doesn't have to include <stdio.h> before us.
4747 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4748 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4749 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4750 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4751 if not declared, so that we can use getpass.c code from libc without
4753 (flockfile, ftrylockfile, funlockfile): New macros.
4755 2003-10-06 Bruno Haible <bruno@clisp.org>
4757 * version-etc-2.h: Remove file.
4758 * version-etc-2.c: Remove file.
4760 2003-09-25 Jim Meyering <jim@meyering.net>
4761 Bruno Haible <bruno@clisp.org>
4763 This lets translators provide better translations for the
4764 "Written by ..." part of --version output.
4765 * version-etc.h: Include stdarg.h.
4766 (version_etc_copyright): Declare as readonly.
4767 (version_etc): Make this function variadic with a NULL-terminated list
4768 of author name strings.
4769 (version_etc_va): New declaration.
4770 * version-etc.c: Include stdarg.h, stdlib.h.
4771 (version_etc_copyright): Declare as readonly.
4772 (version_etc_va): New function. Provide a different translatable string
4773 for each possible number of authors < 10. Abbreviate when there are 10
4775 (version_etc): Make this function variadic. Call version_etc_va.
4776 Suggestion from Gary V. Vaughan.
4778 * long-options.h (parse_long_options): Change prototype: the authors
4779 string is moved to the end and becomes variadic.
4780 * long-options.c: Include stdarg.h.
4781 (parse_long_options): Make this function variadic, too.
4782 Call version_etc_va, not version_etc.
4784 2003-10-06 Bruno Haible <bruno@clisp.org>
4786 * fatal-signal.h: New file, from GNU gettext.
4787 * fatal-signal.c: New file, from GNU gettext.
4789 2003-10-04 Karl Berry <karl@gnu.org>
4791 * argp*: update from libc.
4793 2003-10-01 Larry Jones <lawrence.jones@eds.com>
4795 * getpass.c (getpass): Use a no-op fseek when switching from input to
4796 output mode on the same stream.
4798 2003-09-29 Paul Eggert <eggert@twinsun.com>
4800 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4801 Fix arg typo in previous patch.
4803 2003-09-28 Jim Meyering <jim@meyering.net>
4805 * error.c: Correct cpp indentation.
4807 2003-09-27 Paul Eggert <eggert@twinsun.com>
4809 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
4810 Omit the special code that used __typeof__, since we worry that
4811 it could be more trouble than it's worth. See:
4812 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
4813 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
4817 2003-09-26 Jim Meyering <jim@meyering.net>
4819 * error.c (error_tail): Move some declarations
4820 into inner scope where the local variables are used.
4822 2003-09-26 Bruno Haible <bruno@clisp.org>
4824 * stpncpy.h (gnu_stpncpy): New declaration.
4825 (stpncpy): Define as alias for gnu_stpncpy.
4826 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
4828 2003-09-26 Paul Eggert <eggert@twinsun.com>
4830 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
4831 (error_tail): Do not loop, reallocating temporary buffer, since
4832 the output cannot contain more wide characters than the input
4833 contains bytes, the size must be big enough already. This avoids
4834 one potential size overflow calculation. Check for size overflow
4835 when calculating temporary buffer size. Free temporary buffer
4836 when done, if it was allocated with malloc; this plugs a memory
4837 leak. Remove casts from void * to pointers, that are no longer
4838 needed now that we're assuming C89 or better.
4840 Merge error changes from glibc.
4842 * error.c, error.h: Update copyright notice header to match glibc.
4843 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
4844 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
4845 Disable cancellation while printing error.
4846 * error.h: Prepend __ to parameter names.
4848 2003-09-25 Karl Berry <karl@gnu.org>
4850 * argp-fmtstream.c, argp-help.c: update from libc.
4852 2003-09-25 Bruno Haible <bruno@clisp.org>
4854 * version-etc-2.h: New file, from version-etc.h with modifications.
4855 * version-etc-2.c: New file, from version-etc.c with modifications.
4857 2003-09-25 Simon Josefsson <jas@extundo.com>
4859 * xgetdomainname.h: New file.
4860 * xgetdomainname.c: New file.
4862 2003-09-25 Simon Josefsson <jas@extundo.com>
4863 Bruno Haible <bruno@clisp.org>
4865 * getdomainname.h: New file.
4866 * getdomainname.c: New file.
4868 2003-09-24 Paul Eggert <eggert@twinsun.com>
4870 * linebuffer.c (freebuffer): Don't free the argument, just
4871 the buffer associated with the argument. Bug reported by
4874 2003-09-19 Karl Berry <karl@gnu.org>
4876 * argp.h: update from libc.
4878 2003-09-16 Paul Eggert <eggert@twinsun.com>
4880 * linebuffer.c (readlinebuffer): Return NULL immediately upon
4881 input error, instead of returning NULL the next time we are called
4882 (and therefore losing track of errno).
4884 2003-09-15 Paul Eggert <eggert@twinsun.com>
4886 * getndelim2.c (getndelim2): Don't trash errno when a read
4887 fails, so that the caller gets the proper errno.
4889 * readutmp.c (read_utmp): Likewise.
4890 Check for fstat error. Close stream and free storage
4893 2003-09-14 Bruno Haible <bruno@clisp.org>
4895 * fwriteerror.h: New file.
4896 * fwriteerror.c: New file.
4898 2003-09-14 Jim Meyering <jim@meyering.net>
4900 * getloadavg.c: Correct cpp indentation.
4901 * strdup.c: Likewise.
4902 * vasnprintf.c: Likewise.
4904 2003-09-12 Paul Eggert <eggert@twinsun.com>
4906 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
4907 * obstack.c [!defined _LIBC]: Likewise.
4908 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4909 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4910 * exitfail.c: Don't include stdlib.h; no longer needed.
4912 More changes to assume C89 or better.
4914 * error.c (error_tail): Assume vprintf.
4916 * argmatch.c (getenv): Remove decl.
4917 * progreloc.c (get_full_program_name): Define via prototype.
4918 * setenv.c (clearenv): Likewise.
4919 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
4921 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
4922 (malloc, memcpy): Remove decls.
4923 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
4924 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
4925 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4926 (memcpy): Remove macro.
4927 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
4928 (__P): Remove. All uses removed.
4929 (PTR): Remove. All uses changed to void *.
4930 (CHAR_BIT, NULL): Remove.
4931 (spaces, zeros, memset_space, memset_zero)
4932 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
4934 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
4935 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
4936 Define with prototype.
4937 Remove now-unnecessary prototype decl.
4938 (extra_args_spec): Assume ANSI C. All uses changed.
4939 (extra_args_spec_iso): Remove.
4940 (my_strftime, emacs_strftimeu): Define via prototype.
4941 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
4943 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
4944 * strtoimax.c: Include <stdlib.h> unconditionally.
4945 (strtoul, strtol): Remove decls.
4946 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
4948 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4949 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
4950 (LOCALE_PARAM_PROTO): New macro.
4951 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
4952 (INTERNAL (strtol), strtol): Define with a prototype.
4953 (PARAMS): Remove. All uses removed.
4954 * tempname.c: Include <string.h> unconditionally.
4955 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
4956 * xgethostname.c (main): Define with a prototype.
4957 * xmalloc.c: Include "xalloc.h" first, to check interface.
4958 Include <stdlib.h> unconditionally.
4959 (calloc, malloc, realloc, free): Remove decls.
4960 * xstrtod.c: Include "xstrtod.h" first, to check interface.
4961 Include <stdlib.h> unconditionally. Sort include file names.
4963 (xstrtod): Define with a prototype.
4964 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
4965 (strtol, strtoul): Remove decls.
4967 2003-09-11 Paul Eggert <eggert@twinsun.com>
4969 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
4970 Include <stdlib.h>, <string.h> unconditionally.
4971 Remove now-unnecessary cast to char *.
4972 * strnlen.c: Include <string.h> unconditionally.
4973 * yesno.c (yesno): Define with a prototype.
4975 2003-09-10 Bruno Haible <bruno@clisp.org>
4977 * strcspn.c: Include <string.h> unconditionally.
4978 * strpbrk.c: Include <string.h> unconditionally.
4979 * strstr.c: Include <string.h> unconditionally.
4980 * unicodeio.c: Include <string.h> unconditionally.
4981 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
4982 * unsetenv.c: Likewise.
4983 * xreadlink.c: Include <stdlib.h> unconditionally.
4984 * yesno.c: Include <stdlib.h> unconditionally.
4985 (rpmatch): Add prototype.
4987 2003-09-10 Jim Meyering <jim@meyering.net>
4989 * error.c: Correct indentation of cpp directives.
4991 2003-09-09 Paul Eggert <eggert@twinsun.com>
4995 * acosl.c (main): Use a prototype.
4996 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
4999 * getloadavg.c (getloadavg, main): Define via prototypes.
5001 * getopt.h (struct option.name): Assume C89, and use 'const'.
5002 (getopt, etopt_long, getopt_long_only, _getopt_internal)
5003 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
5005 * getopt.c (const): Remove macro.
5006 Include <string.h> unconditionally.
5007 (my_index): Remove; all uses changed to strchr.
5008 (strlen): Remove decl.
5009 (exchange): Remove forward decl; no longer needed.
5010 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
5011 Define with prototype.
5012 * getopt1.c (const): Remove macro.
5013 (getopt_long, getopt_long_only, main): Define with prototype.
5015 * getugroups.c: Include <string.h> unconditionally.
5017 * getusershell.c: Include <stdlib.h> unconditionally.
5018 (getusershell, setusershell, endusershell, readname, main):
5019 Define with prototypes.
5021 * group-member.c: Include group-member.h first.
5022 Include <stdlib.h> unconditionally.
5024 * hard-locale.c: Include hard-locale.h first.
5025 Include <stdlib.h>, <string.h> unconditionally.
5027 * hash.c (free, malloc): Remove decls.
5028 Include <stdlib.h> unconditionally.
5030 * human.c: Include <stdlib.h>, <string.h> unconditionally.
5031 (getenv): Do not declare.
5033 * idcache.c: Include <string.h> unconditionally.
5035 * long-options.c: Include long-options.h first, to test interface.
5036 Include <stdlib.h> unconditionally.
5038 * makepath.c: Include makepath.h first, to test interface.
5039 Include <stdlib.h> and <string.h> unconditionally.
5041 * linebuffer.c: Include <stdlib.h>.
5042 (free): Remove decl.
5044 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
5045 rpl_malloc returns void *, not char *.
5046 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
5048 * md5.h: Include <limits.h> unconditionally.
5049 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
5050 (__P): Remove; all uses removed.
5051 * md5.c: Include "md5.h" first.
5052 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
5053 md5_buffer, md5_process_bytes, md5_process_block):
5054 Define with prototypes.
5055 * sha.h (__P): Remove all uses. (It wasn't defined??)
5056 * sha.c: Include "sha.h" first.
5057 Include <stdlib.h>, <string.h> unconditionally.
5059 * memchr.c (__ptr_t): Remove; all uses changed to void *.
5060 * memcmp.c (__ptr_t): Likewise.
5061 * memrchr.c (__ptr_t): Likewise.
5062 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
5063 Include <string.h> unconditionally.
5064 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
5065 * memchr.c: Include <stdlib.h> unconditionally.
5066 * memchr.c (LONG_MAX): Remove.
5067 * memrchr.c (LONG_MAX): Likewise.
5068 * memchr.c (__memchr): Define via a prototype.
5069 * memrchr.c (__memrchr): Likewise.
5070 * memcmp.c (__P): Remove, and remove all uses.
5071 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
5072 Remove forward decls; no longer needed.
5073 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
5074 Use types required by C89 in prototype.
5076 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
5077 * savedir.c: Likewise.
5078 * mkdir.c (free): Remove decl.
5079 * rmdir.c (rmdir): Define with a prototype.
5080 * savedir.c: Include savedir.h first, to test interface.
5082 * mktime.c (STDC_HEADERS): Remove.
5083 Include <stdlib.h>, <string.h> unconditionally.
5085 * modechange.c: Include <stdlib.h> unconditionally.
5086 (malloc): Remove decl.
5088 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
5089 (free): Remove decl.
5091 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
5092 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
5093 (This type really should be intptr_t, but that's a C99ism.)
5094 (_obstack_memcpy): Remove: all uses changed to memcpy.
5095 Include <string.h> unconditionally.
5096 (struct obstack): Assume __STDC__ for types of members
5097 chunkfun, freefun, extra_arg.
5098 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
5099 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
5100 obstack_begin, obstack_specify_allocation,
5101 obstack_specify_allocation_with_arg, obstack_chunkfun,
5102 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
5103 Remove unprototyped decls and the macros that use them.
5104 * obstack.c (POINTER): Remove. All uses changed to void *.
5105 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
5106 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
5107 (defined __STDC__ && __STDC__)]:
5108 Remove nonprototyped code.
5109 Include <stdlib.h> unconditionally.
5110 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
5111 _obstack_allocated_p, _obstack_free, obstack_free,
5112 _obstack_memory_used, print_and_abort):
5113 Define using prototypes.
5114 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
5115 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
5116 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
5117 obstack_next_free, obstack_object_size, obstack_room) [0]:
5118 Remove unused, unprototyped code.
5120 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
5122 * physmem.c (physmem_total, physmem_available, main): Define
5125 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
5126 (main): Define with a prototype.
5128 * posixver.c (getenv): Remove decl.
5130 * putenv.c (malloc): Returns void *, not char *.
5131 Include <string.h> unconditionally.
5132 (strchr, memcpy, NULL): Do not define.
5134 * readtokens.c: Include readtokens.h first, to test interface.
5135 Include <stdlib.h>, <string.h> unconditionally.
5136 (init_tokenbuffer): Define with a prototype.
5138 * regex.c (PARAMS): Remove. All uses removed.
5139 All uses of _RE_ARGS removed, too.
5140 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5142 (bzero): Assume memset exists.
5143 (memcmp, memcpy, NULL): Remove.
5144 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
5145 char, or assignments to local vars of type signed char.
5146 (init_syntax_once, PREFIX(extract_number_and_incr),
5147 PREFIX(print_partial_compiled_pattern),
5148 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
5149 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
5150 PREFIX(regex_grow_registers), PREFIX(regex_compile),
5151 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
5152 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
5153 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
5154 wcs_compile_range, byte_compile_range, truncate_wchar,
5155 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
5156 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
5157 count_mbs_length, wcs_re_match_2_internal,
5158 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
5159 PREFIX(alt_match_null_string_p),
5160 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
5161 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
5162 regfree, PREFIX(extract_number)): Define with prototype. Remove
5163 now-unnecessary declaration, if any.
5164 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
5166 Remove now-unnecessary casts among pointer types.
5167 * regex.h (_RE_ARGS): Remove. All uses removed.
5169 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
5170 (free): Remove decl.
5172 * rpmatch.c: Include <stdlib.h> unconditionally.
5174 * same.c: Include <stdlib.h>, <string.h> unconditionally.
5175 (free): Remove decl.
5177 * save-cwd.c: Include <stdlib.h> unconditionally.
5178 * xgetcwd.c: Likewise.
5180 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
5181 (free): Remove decl.
5183 * strchrnul.c (strchrnul): Define with a prototype.
5184 Fix bug: c_in was not converted to char before searching.
5186 The following changes are not K&R related:
5188 * group-member.h: Include <sys/types.h>, so that this file is
5190 * makepath.h: Likewise.
5192 * getusershell.c (readname, default_index, line_size, readname):
5193 Use size_t, not int, for sizes.
5194 (readname): If the size overflows, report an error instead of
5197 2003-09-09 Derek Robert Price <derek@ximbiot.com>
5199 * getndelim2.c: Assume stdlib.h per the C89 spec.
5201 2003-09-08 Paul Eggert <eggert@twinsun.com>
5203 Assume C89 or better; remove K&R cruft.
5204 A few of these changes were first proposed by Derek Robert Price
5205 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
5207 * addext.c: Include <string.h> unconditionally.
5208 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
5209 Don't declare getenv or malloc.
5211 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
5212 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
5214 (find_stack_direction, alloca): Use prototypes.
5216 * atexit.c (atexit): Define using a prototype.
5218 * basename.c, dirname.c, stripslash.c:
5219 Include <string.h> unconditionally.
5221 * bcopy.c: Include <stddef.h>.
5222 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
5224 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
5226 * error.h (error, error_at_line, error_print_progname)
5227 [! (defined (__STDC__) && __STDC__)]: Remove decls.
5228 * error.c: Include error.h first, to check interface.
5229 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
5230 (VA_START): Remove; all uses changeed to va_start.
5231 (exit, strerror): Remove decls.
5232 (error_print_progname): Prototype uncondionally.
5233 Don't include <errno.h>; no longer needed.
5234 (private_strerror): Remove.
5235 (error_tail): Always define.
5236 (error, error_at_line): Assume C89 or better; always use prototypes.
5237 * fatal.c: Include "fatal.h" first, to test interface.
5238 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
5239 (VA_START): Remove; all uses changed to va_start.
5240 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
5242 (exit): Remove decl.
5243 (fatal): Prototype unconditionally. Assume va_start works.
5244 Abort at end, to pacify gcc.
5246 * euidaccess.c (main): Define with a prototype.
5248 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
5250 * exitfail.c: Include <stdlib.h> unconditionally.
5252 * fnmatch_.h (__P): Remove. All uses changed to assume
5254 * fnmatch.c: Include fnmatch.h first, to test interface.
5255 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
5256 (getenv): Remove decl.
5257 (fnmatch): Define using a prototype.
5258 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
5259 (FCT): Define using a prototype.
5261 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
5263 * gethostname.c: Include <stddef.h>.
5264 (gethostname): Define with prototype. Length is size_t, not int.
5266 2003-09-08 Paul Eggert <eggert@twinsun.com>
5268 * getversion.c: Remove; was migrated to backupfile.c in 1997.
5269 getversion.c should have been removed then, but was accidentally
5272 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
5273 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
5275 2003-09-07 Paul Eggert <eggert@twinsun.com>
5277 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
5278 copy_tm_result. Bug reported by Simon Josefsson in
5279 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
5281 2003-09-06 Paul Eggert <eggert@twinsun.com>
5283 * time_r.c, time_r.h: New files.
5285 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
5287 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
5288 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
5290 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
5292 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
5293 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
5296 * timegm.c: Switch to glibc implementation, with the following changes:
5297 [defined HAVE_CONFIG_H]: Include <config.h>.
5298 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
5299 (__mktime_internal) [!defined _LIBC]: New decl.
5300 (__gmtime_r) [!defined _LIBC]: New macro and function.
5301 (timegm): Use a prototype, since gnulib assumes C89.
5302 Do not bother declaring tmp to be const, as it's not really usefu.
5303 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
5304 (timegm): Declare only if HAVE_DECL_TIMEGM.
5306 2003-09-03 Paul Eggert <eggert@twinsun.com>
5308 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
5309 Bug reported by Lute Kamstra in
5310 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
5312 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
5313 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
5314 course with correspondingly smaller numbers for tomorrow and
5315 yesterday. From Tadayoshi Funaba. Originally installed into
5316 sh-utils on 1999-08-07, but the patch got lost (I guess during the
5319 2003-08-31 Simon Josefsson <jas@extundo.com>
5321 * timegm.h: New file.
5322 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
5324 2003-08-31 Karl Berry <karl@gnu.org>
5326 * argp.h: update from libc.
5328 2003-08-28 Bruno Haible <bruno@clisp.org>
5330 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
5331 warning on QNX, which defines O_BINARY to 000000.
5333 2003-08-24 Bruno Haible <bruno@clisp.org>
5335 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
5336 MSVC7 <stdio.h> is included later.
5338 2003-08-20 Bruno Haible <bruno@clisp.org>
5340 * progname.h: New file, from GNU gettext.
5341 * progname.c: New file, from GNU gettext.
5342 * progreloc.c: New file, from GNU gettext.
5344 2003-08-19 Bruno Haible <bruno@clisp.org>
5346 * xstrdup.c: Assume <string.h> exists.
5348 2003-08-18 Jim Meyering <jim@meyering.net>
5350 * setenv.h: Indent nested cpp directive.
5351 * vasnprintf.c: Remove trailing blanks.
5353 2003-08-17 Simon Josefsson <jas@extundo.com>
5354 Bruno Haible <bruno@clisp.org>
5356 * xstrndup.h: New file.
5357 * xstrndup.c: New file.
5359 2003-08-17 Bruno Haible <bruno@clisp.org>
5361 * strndup.h: New file.
5363 2003-08-16 Paul Eggert <eggert@twinsun.com>
5365 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
5366 space, undoing this 2003-08-12 change:
5367 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
5369 2003-08-16 Jim Meyering <jim@meyering.net>
5371 Merge from coreutils.
5372 * xstrtoimax.c: #else #if -> #elif.
5373 * xstrtoumax.c: Likewise.
5375 2003-08-15 Paul Eggert <eggert@twinsun.com>
5377 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
5378 rather than tab, after '#' in shell-script copyright notices.
5379 Suggested by Bruno Haible.
5381 2003-08-15 Jim Meyering <jim@meyering.net>
5382 and Paul Eggert <eggert@twinsun.com>
5384 Merge from coreutils.
5385 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
5386 member but strut utmpx does not. Needed for AIX 4.3.3.
5387 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
5389 2003-08-15 Jim Meyering <jim@meyering.net>
5391 Merge from coreutils.
5392 * xgethostname.c: Include <stdlib.h>.
5393 (xghostname): Don't exit for anything other than memory-related
5394 failure; just return NULL.
5395 * userspec.c: Include "posixver.h".
5396 (parse_user_spec): Accept `.' as a separator only
5397 in pre-POSIX-200112 mode.
5398 * strtoimax.c: Use #elif rather than #else #if.
5399 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
5400 Remove function, now that we can rely on a working tzset function.
5401 [!_LIBC]: Ensure that the required autoconf test has been run.
5402 [!defined _NL_CURRENT && HAVE_STRFTIME]:
5403 Use underlying_strftime for %r.
5404 * sha.c: Merge in some clean-up and optimization changes from glibc.
5405 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
5406 Ensure that it is a multiple of 64.
5407 Rearrange loop exit tests so as to avoid performing an
5408 additional fread after encountering an error or EOF.
5409 * realloc.c: Update copyright date.
5411 2003-08-14 Jim Meyering <jim@meyering.net>
5413 Merge from coreutils.
5414 * obstack.h: Whitespace changes.
5415 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
5416 and xcalloc return values.
5417 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
5418 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
5419 hang on OSF/1 5.1 for DIR on both local and remote file systems.
5420 Reported by (and fix confirmed by) Nelson H. F. Beebe.
5421 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5423 Use mntctl's return value to drive the entry-processing loop, since
5424 we can't rely on the value of the vmt_length member in the last
5425 entry. On some systems doing so could result in exhausting
5426 virtual memory. Based in part on a patch from Mike Jetzer.
5428 2003-08-14 Jim Meyering <jim@meyering.net>
5429 and Paul Eggert <eggert@twinsun.com>
5431 Merges from coreutils, plus other fixes.
5432 * physmem.c: Merge in portability changes from gcc/libiberty
5433 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
5434 for credits and details. Thanks to Kaveh Ghazi for helping
5435 to keep these files in sync.
5436 (ARRAY_SIZE): Define it.
5437 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
5438 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
5439 (memcasecmp): Don't assume size_t fits in unsigned int.
5440 Remove casts and duplicate code.
5441 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
5442 (memcpy): Remove definition.
5443 Merge in some clean-up and optimization changes from glibc.
5444 [BLOCKSIZE]: Move definition to top of file.
5445 Ensure that it is a multiple of 64.
5446 Rearrange loop exit tests so as to avoid performing an
5447 additional fread after encountering an error or EOF.
5448 * md5.h (md5_uintptr): Define.
5449 * makepath.c (CLEANUP_CWD): Report an error if we failed to
5450 return to the initial working directory. Preserve errno
5452 * idcache.c: Include "xalloc.h".
5453 (xmalloc, xrealloc): Remove decls.
5454 (getuser): Remove casts no longer required in C89.
5455 * human.c: Include stdio.h, for sprintf.
5456 * group-member.c: Include "xalloc.h".
5457 (xmalloc, xrealloc): Remove decls.
5458 (get_group_info): Remove casts no longer required in C89.
5459 * getusershell.c (readname): Remove casts no longer required in C89.
5460 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
5461 * getline.c: Whitespace fix, from coreutils.
5463 2003-08-13 Paul Eggert <eggert@twinsun.com>
5465 * exclude.c: Include <ctype.h>
5466 (IN_CTYPE_DOMAIN): New macro.
5468 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
5471 * argp-help.c, argp-parse.c, config.charset, getopt.h:
5472 Undo previous (whitespace-only) change.
5474 2003-08-12 Paul Eggert <eggert@twinsun.com>
5476 * argp-help.c, argp-parse.c, config.charset, getopt.h:
5477 Normalize leading white space and remove trailing white space.
5478 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
5479 notice, as per ../config/srclist-update.
5481 Merge from coreutils.
5482 * euidaccess.h: New file.
5483 * euidaccess.c: Include it.
5484 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
5485 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
5486 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
5488 2003-08-11 Bruno Haible <bruno@clisp.org>
5490 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
5491 (vasnprintf): Use it instead of wcslen.
5493 2003-08-11 Bruno Haible <bruno@clisp.org>
5495 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
5496 value to ensure that _Bool promotes to int. Use #define for _Bool when
5497 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
5499 2003-08-10 Karl Berry <karl@gnu.org>
5501 * regex.h: update from libc (whitespace fix).
5503 2003-08-09 Paul Eggert <eggert@twinsun.com>
5505 Merge some files from coreutils. These changes were
5506 originally made by Jim Meyering.
5507 * acl.c: Include <sys/types.h> before <sys/stat.h>;
5508 many older Unixes require this.
5509 * alloca.c (alloca): Remove cast to argument of free;
5510 no longer needed in C89.
5511 * alloca_.h, regex.h: Fix white space to match
5512 what GNU indent does.
5514 2003-08-05 Paul Eggert <eggert@twinsun.com>
5516 * bumpalloc.h: Remove.
5518 2003-08-04 Paul Eggert <eggert@twinsun.com>
5520 * getloadavg.c: Change copyright notice and spacing to conform to
5523 Merge from coreutils.
5524 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
5526 * getdate.y (date): Also accept dates like May-23-2003; suggestion
5527 from Karl Berry, implemented by Jim Meyering.
5528 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
5529 from Dmitry V. Levin.
5530 Remove anachronistic cast of xrealloc.
5531 * fnmatch_.h (__const): Remove. Use 'const'.
5532 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
5533 type. Otherwise, it wouldn't compile with at least /bin/cc on
5534 ymp-cray-unicos9.0.2.X.
5535 Combine two mostly-identical uses of alloca into one.
5536 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
5538 2003-08-04 Dave Love <d.love@dl.ac.uk>
5542 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
5543 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
5544 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
5545 obsolete NLIST_NAME_UNION.
5546 [__GNU__]: Undef BSD and FSCALE.
5547 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
5549 2003-08-03 Paul Eggert <eggert@twinsun.com>
5551 * stdbool_.h (_Bool): Make it signed char, instead of
5552 an enum type, so that it's guaranteed to promote to int. See:
5553 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
5555 2003-07-31 Paul Eggert <eggert@twinsun.com>
5557 * strerror.c: Include config.h, limits.h. Declare sprintf.
5558 (strerror): Don't assume that a printable int fits in 14 bytes.
5560 2003-07-24 Derek Robert Price <derek@ximbiot.com>
5561 Bruno Haible <bruno@clisp.org>
5563 * getline.h (getline, getdelim): Change return type to ssize_t.
5564 * getline.c (getline, getdelim): Likewise.
5565 Remove _GNU_SOURCE define; now it's defined in config.h through
5568 2003-07-22 Paul Eggert <eggert@twinsun.com>
5570 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
5571 over-parenthesization in macros.
5573 Sync with coreutils.
5575 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
5578 Use `exit_failure' for xalloc and xmemcoll instead of their own
5579 private exit-failure variables.
5580 * xalloc.h (xalloc_exit_failure): Remove.
5581 * xmalloc.c: Likewise. Include exitfail.h.
5582 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
5583 * xmemcoll.h (xmemcoll_exit_failure): Remove.
5584 * xmemcoll.c: Likewise. Include exitfail.h.
5585 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
5587 2003-07-18 Paul Eggert <eggert@twinsun.com>
5589 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
5590 * closeout.c: Likewise. Include "closeout.h" right after config.h,
5591 to test that it can stand by itself. Include "exitfail.h".
5592 Clients should set exit_failure instead.
5593 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
5595 2003-07-18 Andreas Schwab <schwab@suse.de>
5597 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
5599 2003-07-18 Bruno Haible <bruno@clisp.org>
5601 * getndelim2.h: New file.
5602 * getndelim2.c: Make into a module of its own. Include config.h,
5604 (getndelim2): Make non-static. Change return type to ssize_t.
5605 * getline.h: Change argument names.
5606 * getline.c: Include getndelim2.h instead of getndelim2.c.
5607 * getnline.c: Include getndelim2.h.
5609 2003-07-17 Bruno Haible <bruno@clisp.org>
5611 * Makefile.am: Remove file.
5612 * Makefile.in: Remove file.
5614 2003-07-17 Bruno Haible <bruno@clisp.org>
5616 * getnline.h: New file.
5617 * getnline.c: New file.
5618 * getndelim2.c: New file, extracted from getline.c.
5619 (getndelim2): Renamed from getdelim2, with added nmax argument.
5620 * getline.c: Include getndelim2.c.
5621 (getdelim2): Moved out to getndelim2.c.
5622 (getline, getdelim): Update.
5624 2003-07-15 <karl@gnu.org>
5626 * vasnprintf.c: update from gettext.
5628 2003-07-15 Jim Meyering <jim@meyering.net>
5630 * makepath.c (make_path): Enclose diagnostic in _(...).
5632 2003-07-14 Paul Eggert <eggert@twinsun.com>
5634 * asnprintf.c, asprintf.c, config.charset, gettext.h,
5635 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
5636 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
5637 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
5638 vasprintf.c, vasprintf.h: Regenerate. These files are now being
5639 updated automatically by ../config/srclist-update. This changes
5640 their license from LPGL to GPL.
5642 2003-07-14 Jim Meyering <jim@meyering.net>
5644 Don't emit diagnostics. Let callers do that.
5645 * save-cwd.c: Don't include "error.h".
5646 (save_cwd): Don't call error. Ensure that errno is valid
5647 when returning nonzero.
5649 * save-cwd.h (restore_cwd): Update prototype.
5650 * save-cwd.c (restore_cwd): Remove two parameters.
5651 Simplify. Don't call error upon failure. Let callers do that.
5652 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
5653 when auditing is enabled. But don't bother updating the #if.
5655 2003-07-14 Simon Josefsson <jas@extundo.com>
5657 * mempcpy.h: New file.
5658 * mempcpy.c: New file.
5660 2003-07-14 Paul Eggert <eggert@twinsun.com>
5662 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
5663 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
5664 unicodeio.c, unicodeio.h, unlocked-io.h:
5665 Switch from LGPL to GPL.
5667 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
5669 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
5670 it breaks C++ compilation.
5671 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
5673 2003-07-10 Jim Meyering <jim@meyering.net>
5675 * vasnprintf.c: Remove trailing blanks.
5676 Make cpp indentation consistent.
5678 2003-07-09 Paul Eggert <eggert@twinsun.com>
5680 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
5681 posixver.c, strftime.c, strnlen.c, strverscmp.c:
5682 Switch from LGPL to GPL.
5684 2003-07-07 Paul Eggert <eggert@twinsun.com>
5686 * mktime.c: Fix some boundary cases and remove need for floating point.
5688 Issue a compile-time diagnostic if time_t is floating point, or if
5689 two's complement arithmetic is not in effect, or if arithmetic
5690 right shift does not propagate the sign. These assumptions were
5691 all in the original code but they weren't checked.
5693 (TIME_T_MIDPOINT, verify): New macros.
5694 (__isleap): Remove; it has integer overflow problems.
5695 (leapyear): New function, without those problems.
5696 (ydhms_tm_diff): Remove; splitting into two parts.
5697 (ydhms_diff): New function, containing the arithmetic part of
5698 the old ydhms_tm_diff function. Issue a compile-time
5699 diagnostic if we are not using C99 integer division.
5700 Avoid casts when possible.
5701 (guess_time_tm): New function, containing the checking part of
5702 the old ydhms_tm_diff function. Return the new value, rather than
5703 the difference between it and the old. Accept a new argument T
5704 so that *T specifies the old value. Check for overflow in the result.
5706 (__mktime_internal): Use a time_t offset, not a long int offset.
5707 This undoes the 2003-06-04 change, which is no longer needed now
5708 that we have better overflow checking.
5709 (localtime_offset): Likewise.
5711 (__mktime_internal): Avoid harmful overflow on hosts where time_t
5712 and long are 64-bit but int is only 32-bit.
5713 (ydhms_diff): Use long int to store year1 and yday1.
5714 Issue a compile-time diagnostic if long int is not wide enough.
5716 (__mktime_internal): Use long int to store adjusted year and yday.
5717 Use plain C rather than preprocessor commands, if that doesn't
5719 Check for overflow (and try to repair) after each probe
5720 rather than checking only at the very end. This avoids some bugs
5721 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
5722 does not equal GMT offset at maximum time).
5723 Use integer to check for overflow rather than floating point; this
5724 is more portable to non-IEEE hosts, and is a tad faster.
5725 When we detect that we are oscillating between two values,
5726 don't check whether tm_isdst has the requested value, since
5727 we already know the answer. When tm_isdst has the wrong value,
5728 use a different heuristic to find the right one, based on the
5729 extreme values actually observed in practice in tz2003a,
5730 rather than the (overly optimistic) "previous 3 calendar quarters".
5732 (not_equal_tm, print_tm, check_result): Use "const T" rather than
5733 "T const" to accommodate glibc style.
5734 (check_result): Use less-confusing report format. "long" -> "long int.
5736 Don't loop if the iteration overflows time_t.
5737 Allow a negative step in the iteration.
5739 2003-07-01 Paul Eggert <eggert@twinsun.com>
5741 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5742 having it depend on HAVE_SYS_TYPES_H.
5744 2003-06-25 Bruno Haible <bruno@clisp.org>
5746 * readlink.c: New file.
5748 2003-06-20 Bruno Haible <bruno@clisp.org>
5750 Assume C89, so PARAMS isn't needed.
5751 * unicodeio.h (PARAMS): Remove.
5752 * unicodeio.c: Don't use PARAMS.
5754 2003-06-18 Jim Meyering <jim@meyering.net>
5756 Merge changes from coreutils.
5757 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5758 Remove explicit declarations of xmalloc and realloc.
5760 (read_utmp): Remove anachronistic cast of xmalloc.
5762 2003-06-17 Paul Eggert <eggert@twinsun.com>
5764 Assume C89, so PARAMS isn't needed.
5765 * backupfile.h (PARAMS): Remove. All uses removed.
5766 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5767 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5768 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5769 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5770 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5771 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5772 xstrtol.h: Likewise.
5773 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
5774 same.h, strverscmp.h: Do not include config.h; no longer needed.
5775 Anyway, config.h should always be included before any other file.
5777 2003-06-11 Simon Josefsson <jas@extundo.com>
5779 * sysexit_.h: New file.
5781 2003-05-20 Derek Price <derek@ximbiot.com>
5783 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5785 2003-06-10 Simon Josefsson <jas@extundo.com>
5787 * strchrnul.h: New file.
5788 * strchrnul.c: New file.
5790 2003-06-10 Simon Josefsson <jas@extundo.com>
5792 * argp.h: New file, from glibc.
5793 * argp-ba.c: New file, from glibc.
5794 * argp-eexst.c: New file, from glibc.
5795 * argp-fmtstream.c: New file, from glibc.
5796 * argp-fmtstream.h: New file, from glibc.
5797 * argp-fs-xinl.c: New file, from glibc.
5798 * argp-help.c: New file, from glibc.
5799 * argp-namefrob.h: New file, from glibc.
5800 * argp-parse.c: New file, from glibc.
5801 * argp-pv.c: New file, from glibc.
5802 * argp-pvh.c: New file, from glibc.
5803 * argp-xinl.c: New file, from glibc.
5805 2003-06-07 Jim Meyering <jim@meyering.net>
5807 * readtokens.h: Put `Free Software Foundation, Inc.'
5808 in place of my name in the copyright comment.
5809 Remove definition and uses of __P.
5812 * stat.c: Don't declare xmalloc explicitly.
5813 Instead, include "xalloc.h".
5814 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
5815 xrealloc, and xcalloc return values.
5816 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
5818 * xgetcwd.h: Remove definition/uses of PARAMS.
5820 2003-06-06 Jim Meyering <jim@meyering.net>
5822 * stdbool_.h: Renamed from stdbool.h.in.
5824 2003-06-06 Jim Meyering <jim@meyering.net>
5826 Merge from coreutils.
5827 * same.c: (same_name): Declare *_basename locals to be `const'.
5828 Consolidate declarations and initializations of *_base* locals.
5830 Merge from coreutils.
5831 This avoids a core dump on systems without GNU putenv,
5832 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5833 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5834 (unsetenv): New static function, from GNU libc.
5835 (rpl_putenv): Use it.
5837 * modechange.c: Remove trailing blanks.
5839 Merge from coreutils.
5840 * fsusage.c: Remove declaration of statfs.
5841 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5843 * posixtm.c: Include <stdbool.h> unconditionally.
5845 2003-06-05 Paul Eggert <eggert@twinsun.com>
5847 * mktime.c (__mktime_internal): When resolving a tm_isdst
5848 mismatch, look in future quarters as well as past. This fixes a
5849 bug when processing fall-backwards gaps immediately after a long
5850 period of daylight-saving time.
5852 * mktime.c: Assume freestanding C89 or better.
5853 (HAVE_LIMITS_H): Remove. Assume it's 1.
5854 (__P): Remove; not used.
5855 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5856 (mktime, not_equal_tm, print_tm, check_result,
5857 main): Use prototypes. Use const * where appropriate.
5858 (main): Fix typo in testing code that uncovered by above changes.
5859 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5861 2003-06-04 Paul Eggert <eggert@twinsun.com>
5863 * mktime.c: Fix Debian bug 177940
5864 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
5865 (localtime_offset): Now long int, not time_t, because we want it
5866 to be guaranteed to be signed. All uses changed.
5867 (__mktime_internal): If overflow would occur when adding offset,
5870 Merge 'human' changes from coreutils. Rewrite to support
5871 locale-specific notations like thousands separators.
5872 * human.c: Simplify authorship notice.
5873 Include human.h immediately after config.h.
5874 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
5875 <limits.h>: Do not include, since human.h does.
5876 (SIZE_MAX, UINTMAX_MAX): New macros.
5877 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
5878 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
5879 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
5880 (power_letter): Renamed from suffixes.
5881 (generate_suffix_backwards): Remove.
5882 (adjust_value): Now takes int style (because of human.h changes)
5883 and long double value (for greater precision on some platforms).
5884 (group_number): New function.
5885 (human_readable): Use it. Use integer options, not enum.
5886 Put the options before the sizes in the arg list.
5887 Support all the new options.
5888 The old human_readable function has been removed;
5889 use inttostr.h instead.
5890 (human_readable, default_block_size, humblock):
5891 Use uintmax_t, not int, for block sizes.
5892 (human_readable_inexact, block_size_types): Remove.
5893 (block_size_opts): New constant.
5894 (human_options): Renamed from human_block_size, with new signature
5895 that allows block sizes up to UINTMAX_MAX. All callers changed.
5896 * human.h: Add copyright and authorship notice.
5897 Include <limits.h> and <stdbool.h> unconditionally.
5898 (PARAMS): Remove. All uses removed.
5899 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
5900 (enum human_inexact_style): Remove tag; now a nameless enum.
5901 (human_floor, human_ceiling, human_round_to_even): Now have
5902 values 2, 0, 1 rather than -1, 1, 0.
5903 (human_group_digits, human_suppress_point_zero, human_autoscale,
5904 human_base_1024, human_SI, human_B): New constants.
5905 (human_readable_inexact, human_block_size): Remove.
5906 (human_readable): Size args are now uintmax_t, not int.
5907 (human_options): New decl.
5909 * exclude.c: (new_exclude, add_exclude): Remove casts that are
5910 unnecessary now that we assume C89 or better. This change
5911 imported from coreutils.
5913 * mktime.c (__mktime_internal): Do not reject negative timestamps
5914 arbitrarily. This is the same patch as 2003-05-28, but it got lost
5915 in the 2003-05-30 sync from glibc.
5917 .h files should stand alone, but we shouldn't include <sys/types.h>
5918 if we can get away with just <stddef.h>.
5920 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
5921 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
5922 rather than <sys/types.h>, as we merely need size_t.
5923 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
5925 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
5926 Include <stdio.h>, to get FILE.
5927 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
5928 memcasecmp.h has included <stddef.h> and all we need is size_t.
5929 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5930 our interface, instead of including <sys/types.h>
5932 2003-06-02 Paul Eggert <eggert@twinsun.com>
5935 Fix some minor time-related bugs with POSIX time arguments.
5936 Some valid time stamps were being rejected (notably -1, and
5937 time stamps before 1900 on 64-bit hosts). And some invalid
5938 time stamps were being accepted, e.g. September 31.
5940 * posixtm.h (posixtime): Return bool instead of time_t, so
5941 that we can return (time_t) -1 successfully.
5942 * posixtm.c: Likewise.
5943 [HAVE_STDBOOL_H]: Include <stdbool.h>.
5944 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
5945 (t): Remove static var.
5946 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
5947 of static var. All uses changed.
5948 (year): Do not reject years before 1900; they can occur with
5950 (posix_time_parse): Do not check for out-of-range components;
5951 that is now the caller's responsibility, since our checks were
5952 only approximations.
5953 (posixtime): Use mktime to check for out-of-range components,
5954 since it knows them exactly.
5955 If mktime returns (time_t) -1, check whether an error actually occurred
5956 by invoking localtime on -1.
5957 (main) [TEST_POSIXTIME]: Check for input data errors, and report
5958 posixtime failures better.
5959 Improve the test data (in comments only).
5961 2003-05-30 <karl@gnu.org>
5963 * mktime.c: update from libc.
5965 2003-05-30 Bruno Haible <bruno@clisp.org>
5967 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
5968 * localcharset.h: Likewise.
5969 * localcharset.c: Likewise.
5971 2003-05-28 Paul Eggert <eggert@twinsun.com>
5973 Assume the headers required for C89 freestanding compilers.
5974 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
5975 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
5976 without checking for HAVE_LIMITS_H.
5977 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
5978 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
5980 * fatal.c: Include <stdarg.h> without checking for __STDC__.
5981 * exclude.c: Include <stdbool.h> unconditionally.
5982 * tempname.c: Include <stddef.h> unconditionally.
5983 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
5984 * modechange.c, rpmatch.c (NULL): Don't define, since
5985 <stddef.h> does that.
5986 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
5987 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
5988 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
5989 * xstrtol.c: Likewise.
5990 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
5991 * savedir.c: Include <stddef.h> instead of defining NULL.
5993 * addext.c (addext): Use assignment rather than cast, to avoid
5994 warnings on some platforms.
5996 * mktime.c (__mktime_internal): Do not reject negative timestamps
5999 2003-05-10 Bruno Haible <bruno@clisp.org>
6001 * linebreak.c (iconv_string_length): Don't return -1 just because the
6002 string is longer than 4 KB.
6004 2003-05-12 Jim Meyering <jim@meyering.net>
6006 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
6007 the space-padded-by-default conversion specifiers, %e, %k, %l.
6009 2003-05-03 Bruno Haible <bruno@clisp.org>
6011 Upgrade to Unicode-4.0.
6012 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
6013 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
6014 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
6015 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
6016 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
6017 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
6018 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
6019 Change width of U+E0100..U+E01EF from 1 to 0.
6021 2003-04-25 Bruno Haible <bruno@clisp.org>
6023 * copy-file.c: Include <stddef.h>, for size_t.
6025 2003-04-25 Jim Meyering <jim@meyering.net>
6027 * copy-file.c (copy_file_preserving): Declare buf_size to be
6028 of type size_t, not int.
6030 2003-04-11 Jim Meyering <jim@meyering.net>
6032 Merge changes from Coreutils.
6034 2003-03-22 Jim Meyering <jim@meyering.net>
6036 * strftime.c (widen): Cast alloca return value to proper type.
6038 2003-01-19 Ulrich Drepper <drepper@redhat.com>
6041 * strftime.c (my_strftime): Handle very large width
6042 specifications for numeric values correctly. Improve checks for
6045 2003-01-19 Jim Meyering <jim@meyering.net>
6047 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
6048 (nl_get_alt_digit) [! defined my_strftime]: Define.
6049 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
6050 _nl_get_alt_digit and _nl_get_walt_digit.
6052 * strftime.c (my_strftime): Merge in locale-related changes from libc.
6053 These changes have no effect outside of _LIBC.
6055 2003-04-10 Bruno Haible <bruno@clisp.org>
6057 * findprog.h: New file, from GNU gettext.
6058 * findprog.c: New file, from GNU gettext.
6060 2003-04-05 Jim Meyering <jim@meyering.net>
6062 Merge changes from Coreutils.
6064 * exclude.h (PARAMS): Remove definition and uses.
6065 * exclude.c: Remove uses of `PARAMS'.
6067 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
6068 Add test-cases for DOS filenames. Declare program_name.
6069 (main): Set up program_name. Patch by Rich Dawe.
6071 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6073 Use mntctl's return value to drive the entry-processing loop, since
6074 we can't rely on the value of the vmt_length member in the last
6075 entry. On some systems doing so could result in exhausting
6076 virtual memory. Based in part on a patch from Mike Jetzer.
6078 2003-04-04 Bruno Haible <bruno@clisp.org>
6080 * linebreak.h: New file, from GNU gettext.
6081 * linebreak.c: New file, from GNU gettext with slight modifications.
6082 * lbrkprop.h: New file, from GNU gettext.
6084 2003-04-03 Bruno Haible <bruno@clisp.org>
6086 * utf8-ucs4.h: New file, from GNU gettext.
6087 * utf16-ucs4.h: New file, from GNU gettext.
6088 * ucs4-utf8.h: New file, from GNU gettext.
6089 * ucs4-utf16.h: New file, from GNU gettext.
6091 2003-04-02 Bruno Haible <bruno@clisp.org>
6093 * binary-io.h: New file, from GNU gettext.
6095 2003-04-01 Bruno Haible <bruno@clisp.org>
6097 * pathname.h: New file, from GNU gettext.
6098 * concatpath.c: New file, from GNU gettext.
6100 2003-03-30 Bruno Haible <bruno@clisp.org>
6102 * copy-file.c (copy_file_preserving): Don't set owner if the function
6103 chown() doesn't exist.
6105 2003-03-28 Bruno Haible <bruno@clisp.org>
6107 * copy-file.h: New file, from GNU gettext.
6108 * copy-file.c: New file, from GNU gettext.
6110 2003-03-18 Jim Meyering <jim@meyering.net>
6112 * quote.c (quote_n): Fix typo in comment.
6114 2003-03-14 Jim Meyering <jim@meyering.net>
6116 Merge changes from Coreutils.
6117 * obstack.h (obstack_object_size): Declare temporary, __o,
6118 to be const, in order to avoid warnings.
6119 (obstack_room): Likewise.
6120 (obstack_empty_p): Likewise.
6122 2003-03-13 Paul Eggert <eggert@twinsun.com>
6124 Merge changes from Bison.
6125 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
6126 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
6127 when compiling Bison 1.875's `bitset bset = obstack_alloc
6128 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
6129 * hash.c: Include <stdbool.h> unconditionally.
6131 2003-03-09 Paul Eggert <eggert@twinsun.com>
6133 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
6134 Reported by Bruce Becker; see:
6135 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
6137 2003-03-03 Paul Eggert <eggert@twinsun.com>
6138 Bruno Haible <bruno@clisp.org>
6140 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
6141 Reported by John Hughes, see
6142 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
6144 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
6146 * poll_.h: New file.
6149 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
6151 * mathl.h: New file.
6152 * acosl.c: New file.
6153 * asinl.c: New file.
6154 * atanl.c: New file.
6155 * ceill.c: New file.
6158 * floorl.c: New file.
6159 * frexpl.c: New file.
6160 * ldexpl.c: New file.
6162 * sincosl.c: New file.
6164 * sqrtl.c: New file.
6166 * trigl.c: New file.
6167 * trigl.h: New file.
6169 2003-02-17 Bruno Haible <bruno@clisp.org>
6171 * mkdtemp.h: New file, from GNU gettext.
6172 * mkdtemp.c: New file, from GNU gettext.
6174 2003-01-31 Bruno Haible <bruno@clisp.org>
6176 * rename.c: #undef rename before defining rpl_rename.
6177 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
6179 2003-01-30 Bruno Haible <bruno@clisp.org>
6181 * printf-args.h: New file, from GNU gettext.
6182 * printf-args.c: New file, from GNU gettext.
6183 * printf-parse.h: New file, from GNU gettext.
6184 * printf-parse.c: New file, from GNU gettext.
6185 * vasnprintf.h: New file, from GNU gettext.
6186 * vasnprintf.c: New file, from GNU gettext.
6187 * asnprintf.c: New file, from GNU gettext.
6188 * vasprintf.h: New file, from GNU gettext with modifications.
6189 * vasprintf.c: New file, from GNU gettext.
6190 * asprintf.c: New file, from GNU gettext.
6192 2003-01-29 Bruno Haible <bruno@clisp.org>
6194 * stpncpy.h: New file, from GNU gettext with modifications.
6195 * stpncpy.c: New file, from GNU gettext with modifications.
6197 2003-01-28 Bruno Haible <bruno@clisp.org>
6199 * c-ctype.h: New file, from GNU gettext, with changes suggested by
6201 * c-ctype.c: New file, from GNU gettext, with changes suggested by
6204 2003-01-27 Bruno Haible <bruno@clisp.org>
6206 * xsetenv.h: New file, from GNU gettext.
6207 * xsetenv.c: New file, from GNU gettext.
6209 2003-01-23 Bruno Haible <bruno@clisp.org>
6211 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
6213 2003-01-22 Bruno Haible <bruno@clisp.org>
6215 * exit.h: New file, from GNU gettext.
6217 2003-01-11 Bruno Haible <bruno@clisp.org>
6219 * stpcpy.h (stpcpy): Use ANSI C function declarations.
6220 * strcase.h (strcasecmp, strncasecmp): Likewise.
6222 2003-01-14 Jim Meyering <jim@meyering.net>
6224 * same.c (same_name): Tweak a comment.
6226 2003-01-11 Bruno Haible <bruno@clisp.org>
6228 * same.c (same_name): Reorder tests so as to avoid calling stat()
6229 when a string comparison is sufficient.
6231 2003-01-11 Bruno Haible <bruno@clisp.org>
6233 * readtokens.c (readtoken): Cast character to 'unsigned char', not
6236 2003-01-11 Bruno Haible <bruno@clisp.org>
6238 * hash-pjw.c: Add comment about low quality of this function.
6240 2003-01-12 Paul Eggert <eggert@twinsun.com>
6242 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
6243 to avoid collisions with libcurses and libreadline.
6245 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
6246 * getstr.h, getstr.c: Remove.
6247 * getline.c: Include "getline.h", to check interface.
6248 Move body of old getstr.c here: this defines MIN_CHUNK and
6249 declares getdelim2, which is renamed from getstr.
6250 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
6252 * linebuffer.c (readlinebuffer): Renamed from readline.
6254 * linebuffer.h: Likewise.
6255 (readline): Remove backward-compatibility macro.
6257 2003-01-12 Jim Meyering <jim@meyering.net>
6259 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
6261 2003-01-10 Bruno Haible <bruno@clisp.org>
6263 * alloca_.h: New file.
6264 * getdate.y: Unconditionally include alloca.h.
6265 * makepath.c: Likewise.
6266 * setenv.c: Likewise.
6267 * userspec.c: Likewise.
6269 2003-01-09 Bruno Haible <bruno@clisp.org>
6271 * stdbool.h.in: New file.
6273 2003-01-08 Bruno Haible <bruno@clisp.org>
6275 * safe-read.c: Include specification header first, to ensure its
6277 * full-write.c: Likewise.
6279 2003-01-08 Jim Meyering <jim@meyering.net>
6281 * full-write.c: Undefine and define-away `const' after inclusion
6282 of errno.h, not before. Suggestion from Bruno Haible.
6284 2003-01-07 Jim Meyering <jim@meyering.net>
6286 * full-write.c: Rework so that it may serve to define full_read, too.
6287 * full-read.c: Simply #define FULL_READ and include full-write.c.
6289 2003-01-06 Jim Meyering <jim@meyering.net>
6291 * version-etc.c: Update year in translatable copyright string.
6293 2002-12-25 Bruno Haible <bruno@clisp.org>
6295 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
6296 * xstrtol.h: Likewise.
6297 * xstrtoimax.c: Likewise.
6298 * xstrtoumax.c: Likewise.
6299 * human.h: Likewise.
6301 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
6302 on systems that have <inttypes.h> but not <stdint.h>.
6304 2002-12-31 Paul Eggert <eggert@twinsun.com>
6306 * memcoll.c (memcoll): Fall back on a simple algorithm using
6307 memcmp if strcoll doesn't work.
6309 2002-12-23 Bruno Haible <bruno@clisp.org>
6311 * localcharset.h: New file.
6312 * localcharset.c: Include it.
6313 * unicodeio.c: Likewise.
6315 2002-12-22 Bruno Haible <bruno@clisp.org>
6317 * utime.c (utime_null): No need to call ftruncate if the file was
6320 2002-12-23 Bruno Haible <bruno@clisp.org>
6322 * memcoll.c (STRCOLL): New macro.
6325 2002-12-22 Bruno Haible <bruno@clisp.org>
6327 * getstr.h (getstr): Define, to avoid clash with libcurses.
6328 * linebuffer.h (readline): Define, to avoid clash with libreadline.
6330 2002-12-22 Bruno Haible <bruno@clisp.org>
6332 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
6334 2002-12-23 Bruno Haible <bruno@clisp.org>
6336 * getline.h: Include <stddef.h>, for size_t.
6338 * unicodeio.h: Include <stddef.h>, for size_t.
6339 * unicodeio.c: Don't include <stddef.h>.
6341 2002-12-17 Bruno Haible <bruno@clisp.org>
6343 * canon-host.c (strdup): Remove unused declaration.
6345 * fsusage.c: Include full_read.h.
6346 (get_fs_usage): Use full_read instead of safe_read.
6348 * utime.c (utime_null): Use SAFE_READ_ERROR.
6350 2002-12-11 Bruno Haible <bruno@clisp.org>
6352 * setenv.h: Rewritten to cope with systems that have setenv() but not
6354 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
6357 2002-12-11 Bruno Haible <bruno@clisp.org>
6359 * setenv.c (alloca): Fall back to malloc.
6361 (setenv): Use freea() to free memory allocated with alloca().
6363 2002-11-13 Bruno Haible <bruno@clisp.org>
6365 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
6366 function declarations.
6367 * unsetenv.c (unsetenv): Likewise.
6369 2002-03-04 Bruno Haible <bruno@clisp.org>
6371 Portability to AIX 4.3.3.
6372 * unsetenv.c: New file, extracted from setenv.c.
6373 * setenv.c: Move the unsetenv() function to unsetenv.c.
6375 2001-12-20 Bruno Haible <bruno@clisp.org>
6377 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
6378 use malloc instead. For SunOS 4.
6380 2001-12-11 Bruno Haible <bruno@clisp.org>
6382 * setenv.c: Declare alloca.
6383 (compar_fn_t): New typedef.
6384 (KNOWN_VALUE, STORE_VALUE): Use it.
6386 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
6389 2002-12-10 Paul Eggert <eggert@twinsun.com>
6391 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
6392 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
6393 Choose values that are less likely to collide with system fnmatch
6395 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
6396 defined (e.g., a pure POSIX system).
6397 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
6398 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
6400 2002-12-06 Jim Meyering <jim@meyering.net>
6402 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
6404 Merge in changes from libc's misc/error.c, in preparation
6405 for the merge of gnulib's changes back into libc.
6407 * error.c (_): Define only if not already defined.
6408 Move definition to follow all #include directives.
6409 Include unlocked-io.h only if !_LIBC.
6410 [_LIBC]: Include <libio/libioP.h>.
6411 [USE_IN_LIBIO]: Include <libio/iolibio.h>
6412 (fflush): Tweak definition to use INTUSE.
6415 2002-12-05 Paul Eggert <eggert@twinsun.com>
6417 * alloca.c [defined emacs]: Include "lisp.h".
6418 (xalloc_die) [defined emacs]: New macro.
6419 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
6420 [! defined emacs]: Include <xalloc.h>.
6421 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
6422 (pointer): Typedef to POINTER_TYPE *.
6423 (malloc): Remove decl; we now always use xmalloc.
6424 (alloca): Use old-style definition, since Emacs needs this.
6425 Check for arithmetic overflow when computing combined size.
6427 2002-12-04 Paul Eggert <eggert@twinsun.com>
6429 Do not generate unlocked-io.h automatically, since it's easier to
6430 maintain it by hand.
6432 * unlocked-io.h: New file, from GNU diffutils,
6433 but with proper copyright notice and attribution.
6435 * Makefile.am: Add copyright notice.
6436 (libfetish_a_SOURCES): Add unlocked-io.h.
6437 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
6438 (DISTCLEANFILES, io_functions): Remove macros.
6439 (EXTRA_DIST): Remove gen_uio.
6440 (unlocked-io.h): Remove rule.
6442 2002-12-04 Jim Meyering <jim@meyering.net>
6444 Reflect the fact that stat.c and lstat.c are no longer generated.
6445 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
6446 (DISTCLEANFILES): Likewise.
6447 (EXTRA_DIST): Likewise.
6448 (all_local): Don't depend on stat.c or lstat.c.
6449 (stat.c, lstat.c): Remove rules.
6450 (EXTRA_DIST): Remove xstat.in.
6452 * xstat.in: Remove file. Contents moved into stat.c.
6453 * stat.c: New file. Contents mostly from xstat.in.
6454 * stat.c: Rework so that it may serve to define rpl_lstat, too.
6455 * lstat.c: New file. Simply #define LSTAT and include stat.c.
6457 * safe-read.c: Rework so that it may serve to define safe_write, too.
6458 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
6460 2002-12-03 Jim Meyering <jim@meyering.net>
6462 * safe-read.c, safe-write.c: Change variable names and comments, but
6463 not semantics, to minimize the differences between these two files.
6464 (safe_read): Change comment to mention SAFE_READ_ERROR.
6466 * safe-read.c (IS_EINTR): Define.
6467 (safe_read): Use IS_EINTR in place of in-function cpp directives.
6469 2002-12-02 Bruno Haible <bruno@clisp.org>
6471 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
6472 Define, taken from safe-read.c.
6473 (INT_MAX): Provide fallback.
6474 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
6475 * safe-write.h (SAFE_WRITE_ERROR): Define.
6477 * safe-read.c (EINTR): Remove definition.
6478 (safe_read): Don't use EINTR if it is absent.
6480 2002-12-02 Jim Meyering <jim@meyering.net>
6482 * safe-read.c (EINTR): Define.
6483 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6484 (INT_MAX): Provide fallback.
6485 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
6487 * safe-read.h (SAFE_READ_ERROR): Define.
6489 2002-12-01 Jim Meyering <jim@meyering.net>
6491 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
6492 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
6494 2002-11-27 Paul Eggert <eggert@twinsun.com>
6496 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6497 hash_rehash): Replace `if (limit <= value) abort ();' with
6498 `if (! (value < limit)) abort ();', for readability.
6500 2002-11-26 <karl@gnu.org>
6502 * strdup.c: copy from libc again, with jim's ok.
6503 * .cppi-disable: re-add strdup.c
6505 2002-11-25 <karl@gnu.org>
6507 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
6508 instead of "strtol.c".
6510 2002-11-25 Jim Meyering <jim@meyering.net>
6512 * mktime.c: Sync from libc, now that it has the latest fix.
6514 2002-11-24 <karl@gnu.org>
6516 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
6517 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
6519 2002-11-24 Jim Meyering <jim@meyering.net>
6521 Update from coreutils:
6523 * mktime.c: Merge in changes from libc.
6525 Avoid a link-time failure on some Linux systems.
6526 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
6527 (__mon_yday): Declare with the STATIC attribute.
6528 (__mktime_internal): Likewise.
6529 Based on a report from Greg Schafer.
6531 2002-11-23 Jim Meyering <jim@meyering.net>
6533 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
6534 Use `unsigned', not `int', as type of index.
6536 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
6538 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
6540 2002-11-22 Paul Eggert <eggert@twinsun.com>
6542 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
6543 hint that one should use `if (! x) abort ();' rather than `assert
6544 (x);', and anyway it's one less thing to worry about configuring.
6545 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6546 hash_rehash, hash_insert): Use abort rather than assert.
6548 2002-11-22 Paul Eggert <eggert@twinsun.com>
6550 * quotearg.h: Allow multiple inclusion by surrounding with
6551 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
6552 so that we can be included first.
6553 (PARAMS): Remove; we now assume C89 or later. All uses removed.
6554 * quotearg.c: Include quotearg.h immediately after config.h.
6555 No need to include stddef.h or sys/types.h any more.
6556 Surround local include files with "", not "<>".
6557 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
6558 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
6559 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
6560 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
6561 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
6562 (ISPRINT): Remove; no longer needed now that we assume C89.
6564 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
6567 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
6568 quotearg_char): Use SIZE_MAX rather than
6569 (size_t) -1 when we are talking about "infinity".
6571 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
6573 2002-11-22 Bruno Haible <bruno@clisp.org>
6575 * safe-read.h: Assume C89. Add comments.
6576 (safe_read): Change return type to size_t.
6577 * safe-read.c (safe_read): Change return type to size_t. Handle byte
6578 counts > SSIZE_MAX correctly.
6579 * safe-write.h: New file.
6580 * safe-write.c: New file.
6581 * full-read.h: New file.
6582 * full-read.c: New file.
6583 * full-write.h: Assume C89. Add comments.
6584 * full-write.c: Include safe-write.h.
6585 (full_write): Rewritten to use safe_write.
6586 Suggested by Jim Meyering and Paul Eggert.
6588 2002-11-21 Bruno Haible <bruno@clisp.org>
6590 Remove case insensitive option matching.
6591 * argmatch.h (argcasematch): Remove declaration.
6592 (ARGCASEMATCH): Remove macro.
6593 (__xargmatch_internal): Remove case_sensitive argument.
6594 (XARGMATCH): Update.
6595 (XARGCASEMATCH): Remove macro.
6596 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
6597 case_sensitive argument.
6598 (argcasematch): Remove function.
6599 (__xargmatch_internal): Remove case_sensitive argument.
6600 (main): Use XARGMATCH instead of XARGCASEMATCH.
6602 * xmalloc.c: Change compile-time error message. Add comment about
6603 required autoconf version.
6605 2002-11-21 Jim Meyering <jim@meyering.net>
6607 * strdup.c (strdup): Tweak comment and initial #if/#include.
6609 Merge in changes from the coreutils.
6611 2002-09-25 Paul Eggert <eggert@twinsun.com>
6612 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
6613 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
6614 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
6615 int. Work more efficiently if X is the same width as uintmax_t.
6616 Do not compare X to -1, to avoid bogus compiler warning.
6617 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
6618 Don't assume that f_frsize and f_bsize are the same type.
6620 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
6623 * makepath.c (make_path): Restore umask *before* creating the final
6625 (make_path): Minor reformatting.
6627 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
6628 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
6630 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
6631 ones. At least on GNU/Linux systems, `auto' means something else.
6634 2002-11-20 Paul Eggert <eggert@twinsun.com>
6636 Merge argmatch cleanups from Bison. Assume C89.
6638 * argmatch.c: Include config.h here, not in argmatch.h.
6639 Include stdlib.h, for EXIT_FAILURE.
6640 Always include <string.h>, since we assume C89.
6641 (EXIT_FAILURE): Remove pre-C89 bug workaround.
6642 * argmatch.h: Do not include <config.h> or <sys/types.h>.
6643 Include <stddef.h> instead, since it's all we need for size_t.
6644 (PARAMS): Remove. All uses removed.
6645 (ARRAY_CARDINALITY): Do not bother to #undef.
6646 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
6647 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6648 Remove unnecessary parentheses.
6649 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6650 Insert necessary parentheses.
6651 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
6652 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
6654 2002-11-19 Bruno Haible <bruno@clisp.org>
6656 * mbswidth.c: Include mbswidth.h right at the beginning.
6657 * mbswidth.h: Include <stddef.h>, for size_t.
6659 * mbswidth.h (PARAMS): Remove macro.
6660 (mbswidth, mbsnwidth): Use ANSI C function declarations.
6661 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
6663 * gcd.h (PARAMS): Remove macro.
6664 (gcd): Use ANSI C function declarations.
6665 * gcd.c (gcd): Likewise.
6667 2002-11-15 Bruno Haible <bruno@clisp.org>
6669 * strcspn.c: Include <stddef.h>.
6670 (strcspn): Use ANSI C function declaration. Change return type to
6672 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
6673 (strpbrk): Use NULL.
6674 * strpbrk.h (PARAMS): Remove macro.
6675 (strpbrk): Use ANSI C function declaration.
6676 * strstr.c: Don't include <sys/types.h>.
6677 * strstr.h (PARAMS): Remove macro.
6678 (strstr): Use ANSI C function declarations.
6680 2002-11-06 Bruno Haible <bruno@clisp.org>
6682 * gcd.h (gcd): Change argument type to 'unsigned long'.
6683 * gcd.c (gcd): Likewise.
6685 2002-11-05 Bruno Haible <bruno@clisp.org>
6687 * gcd.h: New file, from gettext-0.11.5.
6688 * gcd.c: New file, from gettext-0.11.5.
6690 2002-11-05 Bruno Haible <bruno@clisp.org>
6692 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6693 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6694 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6695 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6697 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6698 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6700 * closeout.c: Include gettext.h instead of <libintl.h>.
6701 * human.c: Include gettext.h instead of <libintl.h>.
6702 * quotearg.c: Include gettext.h instead of <libintl.h>.
6703 * rpmatch.c: Include gettext.h instead of <libintl.h>.
6704 * unicodeio.c: Include gettext.h instead of <libintl.h>.
6705 * userspec.c: Include gettext.h instead of <libintl.h>.
6706 * version-etc.c: Include gettext.h instead of <libintl.h>.
6707 * xmalloc.c: Include gettext.h instead of <libintl.h>.
6708 (textdomain): Remove definition.
6709 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
6711 * long-options.c: Remove include of <libintl.h> and definition of _.
6712 * same.c: Remove include of <libintl.h> and definition of _.
6714 2002-11-04 Bruno Haible <bruno@clisp.org>
6716 * stpcpy.h: New file, from GNU gettext-0.11.5.
6717 * strcase.h: New file, from GNU gettext-0.11.5.
6718 * strpbrk.h: New file, from GNU gettext-0.11.5.
6719 * strstr.h: New file, from GNU gettext-0.11.5.
6720 * xgetcwd.h: New file, from GNU gettext-0.11.5.
6722 2002-05-09 Bruno Haible <bruno@clisp.org>
6724 * config.charset: Update for newest glibc. Add canonical names
6725 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
6727 2002-05-09 Bruno Haible <bruno@clisp.org>
6729 * localcharset.c (get_charset_aliases): Add more Windows specific
6732 2002-05-08 Owen Taylor <otaylor@redhat.com>
6734 * config.charset: A few additions for Solaris.
6736 2001-12-05 Bruno Haible <bruno@clisp.org>
6738 * localcharset.c (locale_charset): Don't return an empty string.
6740 2001-10-23 Bruno Haible <haible@clisp.cons.org>
6742 * config.charset: msdos in uk_UA uses CP1125.
6744 2001-08-05 Bruno Haible <haible@clisp.cons.org>
6746 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
6747 * localcharset.c (locale_charset): Declare as extern "C".
6749 2002-02-15 Bruno Haible <bruno@clisp.org>
6751 * config.charset [msdosdjgpp]: For Russian, use CP866.
6753 2002-02-11 Bruno Haible <bruno@clisp.org>
6755 * config.charset: Add support for NetBSD.
6757 2002-09-25 <karl@gnu.org>
6759 * strdup.c: copy from libc/string (via ../config/srclist*).
6760 * getopt*: copy from libc/posix.
6761 * gettext.h: copy from gettext.
6762 * .cppi-disable: add strdup.c, gettext.h.
6764 2002-07-01 Jim Meyering <meyering@lucent.com>
6766 * c-stack.c: Include sys/time.h.
6767 From Volker Borchert.
6769 2002-06-11 Paul Eggert <eggert@twinsun.com>
6771 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6772 New macro. Use it uniformly instead of
6773 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6774 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6775 reported by Vin Shelton.
6777 2002-06-22 Jim Meyering <meyering@lucent.com>
6779 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6780 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6782 2002-06-22 Paul Eggert <eggert@twinsun.com>
6784 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6785 Do not assume SA_SIGINFO behavior.
6786 Bug reported by Jim Meyering on NetBSD 1.5.2.
6788 2002-06-22 Jim Meyering <meyering@lucent.com>
6790 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6792 * exitfail.c, exitfail.h: Likewise.
6793 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6795 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6797 (EXTRA_DIST): Add fnmatch_loop.c.
6798 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6800 * fnmatch_loop.c: New file, from diffutils-2.8.2.
6801 * fnmatch.c: Update from diffutils-2.8.2.
6802 * fnmatch_.h: New file. From diffutils-2.8.2.
6803 * fnmatch.h: Remove file.
6805 2002-06-18 Paul Eggert <eggert@twinsun.com>
6807 * file-type.h: Report an error if neither S_ISREG nor
6808 S_IFREG is defined, instead of using a test specific to glibc
6809 2.2. This should be safe, since POSIX requires S_ISREG and
6810 Unix Version 7 had S_IFREG. We don't need to check for
6811 <sys/types.h> since we don't use any symbols that it defines.
6813 2002-06-15 Jim Meyering <meyering@lucent.com>
6815 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6816 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6817 have been included before this file.
6819 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
6821 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6822 so that each temporary file name is unique and valid in the first
6823 8 characters, for operation under DOS.
6825 2002-06-15 Jim Meyering <meyering@lucent.com>
6827 Work even with DJGPP 2.03, which lacks support for symlinks.
6829 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6831 * lchown.c (S_ISLNK): Likewise.
6833 2002-06-14 Jim Meyering <meyering@lucent.com>
6835 * file-type.h: Use the version from diffutils-2.8.2.
6836 * file-type.c: Likewise.
6838 2002-05-27 Jim Meyering <meyering@lucent.com>
6840 Fix a problem seen only on nonconforming systems whereby ls.c's
6841 use of localtime, and then of gettimeofday would cause trouble:
6842 the localtime call used to initialize rpl_gettimeofday's save
6843 mechanism would clobber ls's current local time information so
6844 that in any long listing the first file would always be listed
6845 with date 1970-01-01. Analysis by Volker Borchert.
6847 * gettimeofday.c (localtime): Undefine.
6848 (rpl_localtime): New function.
6850 2002-05-22 Jim Meyering <meyering@lucent.com>
6852 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6853 * file-type.h: New file.
6854 * file-type.c (file_type): New file/function. Extracted from diffutils.
6856 2002-04-29 Paul Eggert <eggert@twinsun.com>
6858 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6860 2002-04-28 Paul Eggert <eggert@twinsun.com>
6862 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6863 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
6864 of 127, since 64 is the largest conceivable number for ancient
6866 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6868 2002-04-28 Jim Meyering <meyering@lucent.com>
6870 * sig2str.c (WTERMSIG): Remove definition (unused).
6872 2002-04-28 Paul Eggert <eggert@twinsun.com>
6874 * sig2str.h, sig2str.c: New files.
6875 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6877 2002-04-24 Jim Meyering <meyering@lucent.com>
6879 * gettext.h: New file, from Gettext.
6880 * Makefile.am (INCLUDES): Remove -I../intl.
6881 (libfetish_a_SOURCES): Add gettext.h.
6883 2002-04-16 Jim Meyering <meyering@lucent.com>
6885 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6886 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6887 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6889 2002-04-12 Jim Meyering <meyering@lucent.com>
6891 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6893 2002-03-10 Jim Meyering <meyering@lucent.com>
6895 * makepath.c (make_path): Remove a comma from a diagnostic.
6896 Suggestion from Santiago Vila.
6898 2002-03-08 Jim Meyering <meyering@lucent.com>
6900 * rename.c: Mention that this wrapper is needed also on
6901 mips-dec-ultrix4.4 systems.
6903 2002-03-02 Jim Meyering <meyering@lucent.com>
6905 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6906 not HAVE_CLOCK_SETTIME.
6908 2002-02-27 Paul Eggert <eggert@twinsun.com>
6910 * nanosleep.h: Rename to....
6911 * timespec.h: New name for nanosleep.h. All uses changed.
6913 * gettime.c: New file.
6914 * settime.c: New file.
6917 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6918 timespec.h. Remove nanosleep.h.
6920 2002-02-25 Paul Eggert <eggert@twinsun.com>
6922 * acl.c, acl.h: New files.
6923 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6925 2002-02-24 Jim Meyering <meyering@lucent.com>
6927 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6928 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6929 cause trouble. Reported by Nelson Beebe.
6931 2002-02-23 Paul Eggert <eggert@twinsun.com>
6933 * path-concat.c (xpath_concat): Reorder code to pacify
6934 compilers that don't know that xalloc_die never returns.
6936 2002-02-20 Jim Meyering <meyering@lucent.com>
6938 * getdate.c: Regenerate using bison-1.33.
6940 2002-02-15 Paul Eggert <eggert@twinsun.com>
6942 * posixver.c, posixver.h: New files.
6943 * Makefile.am (libfetish_a_SOURCES): Add them.
6945 2002-02-02 Paul Eggert <eggert@twinsun.com>
6946 Bruno Haible <bruno@clisp.org>
6948 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6949 (fwrite_success_callback): New declaration.
6950 * unicodeio.c (unicode_to_mb): New function, extracted from
6951 print_unicode_char. Call failure callback instead of error.
6952 (fwrite_success_callback): New function.
6953 (exit_failure_callback): New function.
6954 (fallback_failure_callback): New function.
6955 (print_unicode_char): Call unicode_to_mb.
6957 2002-01-26 Jim Meyering <meyering@lucent.com>
6959 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6961 2002-01-22 Jim Meyering <meyering@lucent.com>
6963 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6964 Otherwise, some versions of automake would omit the rule that makes
6965 Makefile from Makefile.in.
6967 2001-01-21 Paul Eggert <eggert@twinsun.com>
6969 * xmemcoll.h, xmemcoll.c: New files.
6970 * Makefile.am (libfetish_a_SOURCES): Add them.
6971 * memcoll.c: Include errno.h, and declare errno if not defined.
6972 (memcoll): Set errno to zero if there is no error.
6974 * quotearg.c (quotearg_buffer_restyled):
6975 Fix bug with quoting buffers containing NUL when backslashing escapes.
6976 This bug was exposed by the other changes in this patch.
6977 (quotearg_n_options): New arg ARGSIZE.
6978 All callers changed.
6979 (quoting_options_from_style): New function.
6980 (quotearg_n_style): Use it.
6981 (quotearg_n_style_mem): New function.
6983 * quotearg.h (quotearg_n_style_mem): New function.
6985 2002-01-16 Jim Meyering <meyering@lucent.com>
6987 * getdate.y: Add three semicolons, each just before a closing brace.
6988 Bison (as of version 1.31) no longer papers over that mistake.
6990 2002-02-14 Paul Eggert <eggert@twinsun.com>
6992 * backupfile.c (ISDIGIT): Comment fix.
6993 * getdate.y (ISDIGIT): Likewise.
6994 * posixtm.c (ISDIGIT, year): Likewise.
6995 * strverscmp.c (ISDIGIT): Likewise.
6996 * userspec.c (ISDIGIT): Likewise.
6998 2002-01-05 Jim Meyering <meyering@lucent.com>
7000 * version-etc.c (version_etc_copyright): Update copyright year.
7002 2001-01-19 Paul Eggert <eggert@twinsun.com>
7004 * closeout.c (close_stdout_status): If ferror (stdout), do
7005 not silently exit merely because the output buffer happens to
7006 have nothing pending.
7008 2001-12-18 Paul Eggert <eggert@twinsun.com>
7010 See the big note in ../ChangeLog.
7011 * human.c (suffixes): Prefer K to k for 1024.
7012 (generate_suffix_backwards): New function.
7013 (human_readable_inexact): Use it.
7014 * xstrtol.c (__xstrtol): If there is no number but there
7015 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
7016 Accept 'K' as well as 'k'.
7018 2001-12-15 Jim Meyering <meyering@lucent.com>
7020 * regex.h (__restrict_arr): Update from libc.
7022 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
7023 as `remote' if the name starts with `//'. Suggested by Michael Stone.
7026 2001-12-10 Jim Meyering <meyering@lucent.com>
7028 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
7029 Instead, include "xalloc.h".
7030 (initbuffer): Don't cast xmalloc return value to char*.
7031 (readline): Reword comment.
7032 Don't cast xrealloc return value to char*
7035 2001-12-09 Jim Meyering <meyering@lucent.com>
7037 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
7038 `signed and unsigned type in conditional expression'.
7039 * posixtm.c (posix_time_parse): Likewise.
7041 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
7043 * readtokens.c (readtoken): Declare an index to be of type unsigned
7044 to avoid a pedantic warning.
7046 * getstr.c: Don't include assert.h.
7047 (getstr): Remove warning-evoking assertions.
7048 Return -1 if offset parameter is out of bounds.
7049 Change the type of a local from int to size_t.
7051 * strftime.c (my_strftime_localtime_r): Include this function
7052 definition in the `#if ! HAVE_TM_GMTOFF' block.
7054 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
7055 Include xalloc.h instead.
7057 2001-12-02 Jim Meyering <meyering@lucent.com>
7059 * tempname.c: Don't declare getenv, thus reverting the change of
7060 2001-11-18. It's no longer necessary, now that stdlib.h is always
7063 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
7064 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
7066 2001-11-30 Akim Demaille <akim@epita.fr>
7068 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
7069 before being defined.
7071 2001-11-27 Paul Eggert <eggert@twinsun.com>
7073 * quotearg.h (quotearg_n, quotearg_n_style):
7074 First arg is int, not unsigned.
7075 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
7076 (SIZE_MAX, UINT_MAX): New macros.
7077 (quotearg_n_options): Abort if N is negative.
7078 Avoid overflow check on hosts where size_t is 64 bits and int
7079 is 32 bits, as overflow is impossible there.
7080 Fix off-by-one typo that caused unnecessary reallocation.
7082 2001-11-27 Jim Meyering <meyering@lucent.com>
7084 * tempname.c: Merge with version from libc.
7085 * regex.c: Likewise.
7087 * tempname.c: Include stdlib.h unconditionally. On some old systems
7088 for which STDC_HEADERS is 0, it was not included, resulting in a
7089 warning about an integer-to-pointer conversion problem with getenv.
7090 Reported by Volker Borchert.
7092 2001-11-26 Jim Meyering <meyering@lucent.com>
7094 * gtod.h: Remove file.
7095 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
7096 * gettimeofday.c: Don't include gtod.h.
7097 (GTOD_init): Remove function.
7098 (rpl_gettimeofday): Do its job here instead, rather than aborting.
7099 Suggestion from Volker Borchert.
7101 2001-11-23 Jim Meyering <meyering@lucent.com>
7103 * hash.h (struct hash_table): Don't define here. Merely declare it.
7104 * hash.c (struct hash_table): Define it here instead.
7106 2001-11-22 Jim Meyering <meyering@lucent.com>
7108 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
7110 2001-11-18 Paul Eggert <eggert@twinsun.com>
7112 * tempname.c (TMP_MAX): Remove; no longer needed.
7113 (TEMPORARIES): New macro.
7114 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
7115 removes an artificial limitation (e.g. HP-UX 10.20, where
7118 2001-11-18 Jim Meyering <meyering@lucent.com>
7120 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
7123 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
7124 files will be created before anything else.
7126 2001-11-17 Jim Meyering <meyering@lucent.com>
7128 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
7129 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
7130 rather than group writable. Patch by Juan F. Codagnone.
7132 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
7133 Instead, include "xalloc.h".
7135 * mountlist.c: Include unlocked-io.h after all system headers.
7136 Remove explicit declarations of xmalloc, xrealloc,
7137 and xstrdup. Instead, include "xalloc.h".
7139 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
7140 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
7141 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
7143 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
7144 Reported by Padraig Brady.
7146 * mkstemp.c: #undef mkstemp.
7148 (rpl_mkstemp): Rename from mkstemp.
7151 2001-11-16 Jim Meyering <meyering@lucent.com>
7153 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
7154 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
7155 determine the amount of total physical memory, use pstat_getstatic.
7156 HPUX-11 doesn't define _SC_PHYS_PAGES.
7157 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
7158 If sysconf couldn't be used to determine the amount of available
7159 physical memory, use both pstat_getstatic and pstat_getdynamic.
7160 Based on a patch from Bob Proulx.
7162 2001-11-05 Jim Meyering <meyering@lucent.com>
7164 * xstat.in (slash_aware_lstat): Correct a misleading comment.
7166 2001-11-03 Jim Meyering <meyering@lucent.com>
7168 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
7169 in argmatch_to_argument call.
7171 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
7174 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
7175 e.g., a fault due to an attempt to free a NULL pointer.
7177 2001-11-01 Jim Meyering <meyering@lucent.com>
7179 * dirfd.c, dirfd.h: New files.
7180 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
7182 * hash.c (hash_print) [TESTING]: Clean up.
7184 2001-10-22 Paul Eggert <eggert@twinsun.com>
7186 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
7187 to avoid a warning if -Wall.
7189 2001-10-21 Paul Eggert <eggert@twinsun.com>
7191 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
7193 2001-10-21 Jim Meyering <meyering@lucent.com>
7195 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
7196 this code would end up calling gettext even in packages built
7198 * getopt.c (_): Likewise.
7199 * regex.c (_): Likewise.
7201 2001-10-20 Paul Eggert <eggert@twinsun.com>
7203 * error.c (strerror_r): Do not declare unless !_LIBC.
7204 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
7205 Use strerror_r that is only a macro, even if it is not a function.
7206 (strerror): Check for HAVE_DECL_STRERROR before declaring.
7207 (private_strerror): Use prototypes, not old-style function definition.
7208 (print_errno_message): New function.
7209 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
7211 (error_tail, error, error_at_line): Use it.
7213 2001-10-11 Jim Meyering <meyering@lucent.com>
7215 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
7216 and quote_n (1, ... to avoid clobbering a buffer.
7218 2001-10-05 Jim Meyering <meyering@lucent.com>
7220 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
7221 * hash-pjw.c: New file (factored out of fileutils' remove.c).
7222 * hash-pjw.h: New file.
7224 2001-09-30 Jim Meyering <meyering@lucent.com>
7226 * mountlist.c [MOUNTED_GETFSSTAT]:
7227 Include <sys/ucred.h>, for Apple Darwin.
7228 Include sys/mount.h and sys/fs_types.h only if available.
7230 (read_filesystem_list): Use FS_TYPE.
7232 2001-09-29 Paul Eggert <eggert@twinsun.com>
7234 * exclude.c (excluded_filename): 0 -> false, since it's
7237 2001-09-28 Paul Eggert <eggert@twinsun.com>
7239 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
7240 #defines strtoimax. Also treat the other strto* functions
7243 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
7244 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
7245 (strtoimax, strtoumax): Do not declare if already defined as a macro.
7247 2001-09-26 Jim Meyering <meyering@lucent.com>
7249 Most macros in unlocked-io.h had the wrong number of arguments.
7250 * gen-uio: New script.
7251 (USE_UNLOCKED_IO): Define to 1 if not already defined.
7252 * unlocked-io.hin: Remove file.
7253 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
7254 rather than trying to embed it here.
7255 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
7256 Reported by Padraig Brady.
7258 2001-09-25 Volker Borchert <bt@teknon.de>
7260 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
7262 2001-09-23 Jim Meyering <meyering@lucent.com>
7264 * mountlist.c: Remove useless parentheses in #if directives.
7265 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
7266 the deprecated MOUNTED symbol is no longer defined in mntent.h.
7268 2001-09-22 Jim Meyering <meyering@lucent.com>
7270 * localcharset.c: Update from latest gettext.
7271 * config.charset: Likewise.
7273 2001-09-20 Jim Meyering <meyering@lucent.com>
7275 * xstrtol.c (strtoimax): Guard declaration with
7276 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
7277 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
7278 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
7279 (strtoumax): Likewise, for completeness (it wasn't necessary).
7281 2001-09-06 Paul Eggert <eggert@twinsun.com>
7283 * strtoimax.c (HAVE_LONG_LONG):
7284 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
7285 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
7286 to work around bug in IBM C compiler.
7288 2001-09-16 Jim Meyering <meyering@lucent.com>
7290 * mkdir.c: New file.
7292 2001-09-04 Paul Eggert <eggert@twinsun.com>
7294 * xgetcwd.c: Revert some of the previous change; intead,
7295 fix the HAVE_GETCWD_NULL code to behave more like the
7296 !HAVE_GETCWD_NULL code used to.
7299 (xgetcwd): Do not return NULL when memory is exhausted; instead,
7302 2001-09-04 Paul Eggert <eggert@twinsun.com>
7304 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
7305 Use ssize_t, not int, to store result of readlink.
7306 Check for ssize_t overflow as well as size_t overflow,
7307 as POSIX says the result of readlink is implementation-defined
7308 when ssize_t overflows.
7309 Remove unnecessary cast to char*.
7310 Use free+malloc instead of realloc, as the storage doesn't need
7311 to be preserved and it's clearer and can be more efficient that way.
7312 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
7313 * xreadlink.h (xreadlink): Update prototype.
7315 2001-09-03 Paul Eggert <eggert@twinsun.com>
7317 * exclude.c (fnmatch_no_wildcards): Fix confusion between
7318 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
7319 spotted by Jim Meyering.
7321 2001-09-03 Jim Meyering <meyering@lucent.com>
7323 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
7325 2001-09-03 Paul Eggert <eggert@twinsun.com>
7327 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
7328 like the HAVE_GETCWD_NULL code.
7329 Include pathmax.h if not HAVE_GETCWD.
7330 Do not include xalloc.h.
7331 (INITIAL_BUFFER_SIZE): New symbol.
7332 Do not use xmalloc / xrealloc, since the caller is responsible for
7333 handling errors. Preserve errno around `free' during failure.
7334 Do not overrun buffer when using getwd.
7336 2001-09-03 Paul Eggert <eggert@twinsun.com>
7338 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
7339 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
7341 2001-09-02 Jim Meyering <meyering@lucent.com>
7343 * error.c: Update from GNU libc.
7345 2001-09-01 Jim Meyering <meyering@lucent.com>
7347 * xreadlink.c: New file.
7348 * xreadlink.h: New file.
7349 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
7351 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
7352 doesn't conflict with sparc Solaris 7's definition in
7353 /usr/include/sys/int_types.h.
7355 * exclude.c: Use `""', not `<>' to #include non-system header files.
7356 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
7357 and strncasecmp as r-values. Unixware didn't have declarations.
7359 2001-08-31 Jim Meyering <meyering@lucent.com>
7361 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
7362 Use an initial, malloc'd, buffer of length 128 rather than
7363 a statically allocated one of length 1024.
7365 2001-08-30 Paul Eggert <eggert@twinsun.com>
7367 * xgetcwd.c: Don't include pathmax.h.
7368 Include stdlib.h and unistd.h if available.
7370 (xmalloc, xstrdup, free): Remove decls.
7371 (xgetcwd): Don't assume sizes fit in unsigned.
7372 Check for overflow when computing sizes.
7373 Simplify reallocation code.
7375 2001-08-28 Paul Eggert <eggert@twinsun.com>
7377 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
7379 * strtoimax.c: Renamed from strtoxmax.c, removing the
7382 Also, make the following further changes to make this file's
7383 configuration more similar to that of strtol.c:
7384 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
7385 (strtoumax, uintmax_t, strtoull, strtol): Remove.
7386 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
7387 (strtoimax): Renamed from strtoumax. All uses of unsigned values
7388 changed to signed values.
7390 And make the following changes as well:
7391 Fix copyright notice, as 1999 was missing.
7392 (verify): New macro.
7393 (strtoimax): Check sizes at compile-time, not run-time.
7394 Prefer strtol to strtoll if both work.
7395 (main): Remove; it was not that useful and was a pain to maintain.
7397 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
7399 2001-08-30 Paul Eggert <eggert@twinsun.com>
7401 * savedir.c (savedir): Remove size parameter, as POSIX says that
7402 a directory's st_size can have an arbitrary value, so the old
7403 usage could waste an arbitrary amount of memory. All uses
7405 * savedir.h: Update prototype.
7407 2001-08-30 Paul Eggert <eggert@twinsun.com>
7409 * xstrtol.c (strtoimax): New decl.
7411 2001-08-28 Paul Eggert <eggert@twinsun.com>
7413 * xstrtol.h: Add copyright notice.
7414 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
7415 LONGINT_INVALID_SUFFIX_CHAR.
7417 2001-08-30 Paul Eggert <eggert@twinsun.com>
7419 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
7422 2001-08-30 Paul Eggert <eggert@twinsun.com>
7424 * hash.c: Remove '2001' from copyright notice.
7426 2001-08-30 Paul Eggert <eggert@twinsun.com>
7428 * full-write.h: New file.
7429 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
7430 * full-write.c: Correct credits, as cccp.c no longer
7431 exists and anyway it was so heavily changed from the old cccp
7432 code as to be unrecognizable. Include full-write.h.
7433 (full_write) Return size_t, with short writes meaning failure.
7434 All callers changed. This fixes a bug with large buffers
7436 * utime.c: Include full-write.h.
7438 2001-08-30 Paul Eggert <eggert@twinsun.com>
7440 Merge 'exclude' changes from tar 1.13.22.
7441 This fixes one or two unlikely storage allocation overflow bugs,
7442 but doesn't change user-visible behavior otherwise.
7444 2001-08-30 Paul Eggert <eggert@twinsun.com>
7446 * exclude.c (bool): Declare, perhaps by including stdbool.h.
7447 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
7448 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
7449 Include if available.
7450 (<xalloc.h>): Include
7451 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
7452 (verify): New macro. Use it to verify that EXCLUDE macros do not
7453 collide with FNM macros.
7454 (struct patopts): New struct.
7455 (struct exclude): Use it, as exclude patterns now come with options.
7456 (new_exclude): Support above changes.
7457 (new_exclude, add_exclude_file):
7458 Initial size must now be a power of two to simplify overflow checking.
7459 (free_exclude, fnmatch_no_wildcards): New function.
7460 (excluded_filename): No longer requires options arg, as the options
7461 are determined by add_exclude. Now returns bool, not int.
7462 (excluded_filename, add_exclude):
7463 Add support for the fancy new exclusion options.
7464 (add_exclude, add_exclude_file): Now takes int options arg.
7465 Check for arithmetic overflow when computing sizes.
7466 (add_exclude_file): xrealloc might modify errno, so don't
7467 realloc until after errno might be used.
7469 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
7471 (free_exclude): New decl.
7472 (add_exclude, add_exclude_file): Now takes int options arg.
7473 (excluded_filename): No longer requires options arg, as the options
7474 are determined by add_exclude. Now returns bool, not int.
7476 2001-08-30 Paul Eggert <eggert@twinsun.com>
7478 * alloca.c (alloca): Arg is of type size_t, not unsigned.
7480 2001-08-27 Jim Meyering <meyering@lucent.com>
7482 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
7484 * version-etc.c (N_): Remove definition.
7485 Revert most of last change.
7486 Instead, simply don't mark the `Copyright...' string for translation.
7487 Based on advice from Paul Eggert.
7489 * strtoxmax.c: Tweak comment.
7491 2001-08-26 Jim Meyering <meyering@lucent.com>
7493 * version-etc.c (version_etc_copyright_fmt): Replace literal year
7494 of copyright with `%s' so translators don't get an untranslated
7496 (COPYRIGHT_YEAR): Define.
7497 (version_etc): Use fprintf rather than fputs.
7498 Suggestion from Ulrich Drepper.
7500 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
7502 * strtoll.c: New file, from GNU libc.
7503 * xstrtoimax.c: New file.
7505 * xstrtol.h: Add xstrtoimax.
7506 * strtoumax.c: New file. Simply include "strtoumax.c".
7507 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
7509 * strtoumax.c: Factor to work both for unsigned and signed types, ...
7510 * strtoxmax.c: ... then renamed to this.
7512 2001-08-13 Paul Eggert <eggert@twinsun.com>
7514 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
7515 Port to Solaris 8, where 'sed' requires a space after the 'r'
7516 command, and where sh dislikes "$/". Clean up the spacing a bit.
7517 Redirect output to $tmp just once.
7519 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
7521 * addext.c (<errno.h>): Include.
7522 (errno): Declare if not defined.
7523 (addext): Work correctly when pathconf returns -1 and leaves
7524 errno alone because there is no limit. Also, work even if
7525 pathconf returns a value greater than SIZE_MAX.
7527 2001-08-12 Jim Meyering <meyering@lucent.com>
7529 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
7530 Simply `return getcwd (NULL, 0);'.
7531 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
7532 Use 1300 as initial value for length, not PATH_MAX.
7534 * pathmax.h: Clean up cpp syntax.
7536 2001-08-12 Jim Meyering <meyering@lucent.com>
7538 * gettimeofday.c: New file.
7540 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
7542 2001-08-04 Jim Meyering <meyering@lucent.com>
7544 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
7545 to get in sync with glibc.
7547 2001-08-03 Paul Eggert <eggert@twinsun.com>
7549 The following changes are from gettext 0.10.39 as maintained by
7552 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
7553 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
7554 with inverted sense. All uses changed.
7556 * mbswidth.c: Don't include <limits.h>.
7557 Include <stdlib.h> and <string.h> unconditionally.
7558 (iswcntrl, mbsinit, ISCNTRL): New macros.
7559 (mbsnwidth): Use K&R style function declarations.
7560 Don't bother checking for MB_LEN_MAX == 1, since the compiler
7561 can optimize it when MB_CUR_MAX == 1.
7562 The width of control characters is zero, not 1.
7564 2001-07-15 Jim Meyering <meyering@lucent.com>
7566 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
7567 (BUILT_SOURCES): Add unlocked-io.h.
7568 (io_functions): Define.
7569 (unlocked-io.h): New rule.
7570 (DISTCLEANFILES): Add unlocked-io.h.
7571 (all-local): Depend on unlocked-io.h, to ensure it is created.
7573 * unlocked-io.hin: New file
7575 * regex.c: Update from glibc.
7577 2001-07-05 Jim Meyering <meyering@lucent.com>
7579 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
7581 (libfetish_a_SOURCES): Put all .h files here instead.
7582 Remove a thus-exposed (better checks in automake) duplicate and
7583 two unnecessary .h files.
7585 2001-06-11 Jim Meyering <meyering@lucent.com>
7587 * regex.c: Update from GNU libc.
7589 2001-05-27 Jim Meyering <meyering@lucent.com>
7591 * readutmp.h (UT_TYPE): Define.
7593 2001-05-24 Jim Meyering <meyering@lucent.com>
7595 * argmatch.c: Include "quote.h".
7596 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
7597 quote function. Reported by Göran Uddeborg.
7599 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
7601 * dirname.c (dir_name): Compute append_dot using path, not newpath
7602 which is not yet declared.
7604 2001-05-11 Paul Eggert <eggert@twinsun.com>
7606 * Makefile.am (libfetish_a_SOURCES):
7607 Add strftime.c, since we now compile it on all hosts.
7609 * strftime.c (my_strftime):
7610 Define to nstrftime if emacs, but only if my_strftime is not defined.
7611 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
7612 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
7613 Add one more extra argument: a nanoseconds value.
7616 (my_strftime function): Add %N format.
7617 (emacs_strftimeu): Renamed from emacs_strftime,
7618 with extra ut argument.
7620 2001-05-11 Paul Eggert <eggert@twinsun.com>
7622 dirname code cleanup. base_name now behaves more compatibly
7623 with POSIX basename when given file names that have trailing
7624 slashes, and similarly for dir_name. Add new primitives
7625 base_len and dir_len. Put the directory-name-related decls
7628 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
7629 * backupfile.c (base_name): Likewise.
7630 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
7631 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
7632 * makepath.c (strip_trailing_slashes): Likewise.
7633 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
7635 * rename.c (strip_trailing_slashes): Likewise.
7636 * same.c (base_name): Likewise.
7637 * stripslash.c (ISSLASH): Likewise.
7639 * addext.c: Include <dirname.h> after size_t is defined.
7640 * backupfile.c: Likewise.
7642 * addext.c (addext): Use base_len to trim redundant
7643 trailing slashes instead of doing it ourselves.
7644 But do not trim the last slash if it is not redundant.
7646 * backupfile.c (find_backup_file_name,
7647 max_backup_version): Use base_len instead of rolling it ourselves.
7648 Handle the case of "" and (on DOS) "C:" correctly.
7650 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
7651 Include <string.h>, <dirname.h>.
7652 (base_name): Allow file names ending in slashes, other than names
7653 that are all slashes. In this case, return the basename followed
7654 by the slashes. This is more general, and can be used in places
7655 where the original base_name purposely had an assertion failure.
7656 (base_len): New function.
7658 * dirname.c: Include <string.h> instead of <stdlib.h>.
7659 Do not include <assert.h>; no longer needed.
7661 (memrchr): Remove decl.
7662 (dir_name_r): Remove.
7663 (dir_len): Renamed from dirlen. All callers changed.
7664 Rewrite in terms of base_name, for simplicity and consistency.
7665 (dir_name): Never return NULL. All callers changed.
7666 Do not include <stdlib.h> in test program; no longer needed.
7667 return 0; is fine for test program.
7669 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
7671 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
7673 * path-concat.c (path_concat): Use base_len to compute
7674 base length, not strlen; this means we cannot rely on memcpy
7677 * same.c (STREQ): Remove.
7678 (same_name): Handle the case where the basename ends in trailing '/'.
7680 * stripslash.c (strip_trailing_slashes): Return nonzero if
7681 a slash was stripped. Do not strip the last slash after a
7684 2001-04-08 Jim Meyering <meyering@lucent.com>
7686 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
7687 recomputed; that's necessary when the offset spans a DST transition.
7688 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
7690 2001-04-02 Jim Meyering <meyering@lucent.com>
7692 * regex.h, regex.c: Update from GNU libc.
7694 2001-03-19 Paul Eggert <eggert@twinsun.com>
7696 * version-etc.c (version_etc_copyright): Update to 2001.
7698 2001-03-16 Paul Eggert <eggert@twinsun.com>
7700 * tempname.c (uint64_t): Define to uintmax_t if
7701 not defined, and if UINT64_MAX is not defined.
7702 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
7703 Reported by John David Anglin.
7705 2001-03-10 Bruno Haible <haible@clisp.cons.org>
7707 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
7708 alias if codeset is empty.
7709 * config.charset (BeOS): Use wildcard syntax.
7711 2001-03-13 Jim Meyering <meyering@lucent.com>
7713 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
7714 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
7717 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7719 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
7721 * unicodeio.c (print_unicode_char): Simplify accordingly.
7723 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7725 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
7726 support for DOS/DJGPP.
7728 2001-02-28 Paul Eggert <eggert@twinsun.com>
7730 * Makefile.am (libfetish_a_SOURCES):
7731 Add dup-safer.c, fopen-safer.c.
7732 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
7734 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
7736 2001-02-25 Paul Eggert <eggert@twinsun.com>
7738 The mkstemp replacement is taken from glibc 2.2.2, with some
7739 portability fixes for use outside glibc, as follows:
7741 * tempname.c (struct_stat64): New macro.
7742 (direxists, __gen_tempname): Use it.
7743 This avoids a portability problem with Solaris 8.
7745 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7746 (<stddef.h>, <stdint.h>, <string.h>):
7747 Include only if STDC_HEADERS || _LIBC.
7748 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7749 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7750 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7751 (__set_errno): Define this macro if <errno.h> doesn't.
7752 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7753 Define these macros if <stdio.h> doesn't.
7754 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7755 Define these macros if <sys/stat.h>
7756 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7757 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7758 __xstat64): Define if not _LIBC.
7759 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7760 (__gen_tempname): Invoke gettimeofday only if
7761 HAVE_GETTIMEOFDAY || _LIBC;
7762 otherwise, fall back on plain "time".
7763 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7765 * mkstemp.c (__GT_FILE): Define to zero if not defined.
7767 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7769 2001-02-17 Jim Meyering <meyering@lucent.com>
7771 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
7772 around included file name.
7774 * strnlen.c (__strnlen): Merge in a change from GNU libc.
7776 * strftime.c: Update from GNU libc (the only changes were to comments).
7778 2001-02-13 Bruno Haible <haible@clisp.cons.org>
7780 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7782 2001-02-17 Paul Eggert <eggert@twinsun.com>
7784 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7785 Remove workaround macros for hosts that have mbrtowc but not
7786 mbstate_t, as we now insist on proper declarations for both
7787 before using mbrtowc.
7789 2001-02-17 Jim Meyering <meyering@lucent.com>
7791 * regex.c: Update from libc.
7793 2001-02-16 Paul Eggert <eggert@twinsun.com>
7795 * alloca.c (malloc): Undef before defining, since stdlib.h
7796 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
7797 Reported by Mark Hounschell via Paul Eggert.
7799 2001-01-30 Bruno Haible <haible@clisp.cons.org>
7801 * config.charset: Update for FreeBSD 4.2.
7803 2001-01-26 Jim Meyering <meyering@lucent.com>
7805 * quotearg.c: Include stddef.h.
7806 * quote.c: Include stddef.h.
7807 Reported by Axel Kittenberger.
7809 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7810 line in double quotes so that it evokes a better diagnostic.
7811 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7812 Reported by Axel Kittenberger.
7814 2001-01-15 Bruno Haible <haible@clisp.cons.org>
7816 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7817 to avoid a warning. Add back 'const' to inptr.
7819 2001-01-16 Jim Meyering <meyering@lucent.com>
7821 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7824 2001-01-14 Jim Meyering <meyering@lucent.com>
7826 * rename.c: New file. From Volker Borchert.
7827 Include stdlib.h, string.h or strings.h, and xalloc.h.
7828 Use strip_trailing_slashes rather than open-coding it.
7830 2001-01-03 Paul Eggert <eggert@twinsun.com>
7832 * strftime.c: Sync with glibc time/strftime.c 1.81.
7834 2001-01-03 Jim Meyering <meyering@lucent.com>
7836 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7837 local `inptr' to avoid warning with some system declarations of iconv.
7839 2000-12-29 Paul Eggert <eggert@twinsun.com>
7841 * modechange.c: Do not assume that mode_t uses the
7842 traditional octal encoding. E.g. "chmod 1 FOO" should set
7843 the other-execute bit of FOO even if S_IXOTH != 1.
7845 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7846 WOTH, XOTH, ALLM): New macros.
7847 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7848 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7850 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7851 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7853 No need to use uintmax_t; unsigned long is long enough.
7854 Don't bother to get suffix since we don't use it.
7856 2000-12-24 Jim Meyering <meyering@lucent.com>
7858 * hash.c (is_prime): Return explicit boolean values.
7859 (hash_get_first): Return NULL to appease Irix5.6's 89.
7860 Reported by Nelson Beebe.
7862 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7864 * localcharset.c (locale_charset): Add support for Win32.
7866 2000-12-18 Paul Eggert <eggert@twinsun.com>
7868 * physmem.h, physmem.c: New files.
7870 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7871 (noinst_HEADERS): Add physmem.h.
7873 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7874 't' for compatibility with Solaris 8 sort.
7876 2000-12-18 Bruno Haible <haible@clisp.cons.org>
7878 * config.charset: Add support for BeOS.
7880 2000-12-16 Jim Meyering <meyering@lucent.com>
7882 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7883 SHELLS_FILE to a file name that's useful on djgpp systems.
7885 (ADDITIONAL_DEFAULT_SHELLS): Define.
7886 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7887 Based mostly on a patch from Prashant TR.
7889 2000-12-16 Jim Meyering <meyering@lucent.com>
7891 This bug had a serious impact on chown: `chown N:M FILE' (for integer
7892 N and M) would have treated it like `chown N:N FILE'.
7894 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7896 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7898 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7899 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7900 to the list of canonical encodings. Rename EUC-CN to GB2312.
7902 2000-12-08 Andreas Schwab <schwab@suse.de>
7904 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7905 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7907 2000-12-07 Jim Meyering <meyering@lucent.com>
7909 * stripslash.c (ISSLASH): Define.
7910 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7913 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7914 (dir_name_r): Declare this function as static.
7915 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7916 manifest itself on a name containing a mix of slashes and
7918 Make this function work with names starting with a DOS-style
7919 drive letter and colon prefix.
7920 (dir_name): Append `.' if necessary.
7921 Based mostly on patches from Prashant TR and Eli Zaretskii.
7923 * dirname.h (dir_name_r): Remove prototype.
7925 2000-12-05 Jim Meyering <meyering@lucent.com>
7927 * dirname.c (dir_name_r): Add `const' in a few local declarations.
7929 2000-12-04 Jim Meyering <meyering@lucent.com>
7931 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7932 Also include memory.h, stdlib.h, unistd.h if appropriate.
7933 Reported by Andreas Jaeger (conflicting declaration of malloc).
7935 2000-12-02 Jim Meyering <meyering@lucent.com>
7937 * closeout.h: Make idempotent, to avoid some obscure warnings.
7939 2000-12-01 Paul Eggert <eggert@twinsun.com>
7941 * memrchr.c: Include <config.h> before any system include file.
7943 2000-11-29 Paul Eggert <eggert@twinsun.com>
7945 * dirname.c (dir_name_r): Fix typo: int -> size_t.
7947 2000-11-26 Jim Meyering <meyering@lucent.com>
7949 * memcoll.c: Include sys/types.h. From Werner Almesberger.
7951 2000-11-22 Paul Eggert <eggert@twinsun.com>
7953 * strftime.c (my_strftime): Do not invoke mbrlen with a
7954 size of (size_t) -1; it's not portable.
7956 2000-11-17 Akim Demaille <akim@epita.fr>
7958 * obstack.h: Formatting changes.
7959 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7960 prevent type checking.
7961 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7962 cast the value to (void *): assigning a `foo *' to a `void *'
7964 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7966 2000-11-17 Jim Meyering <meyering@lucent.com>
7968 * strstr.c: Update from GNU libc.
7970 2000-11-16 Jim Meyering <meyering@lucent.com>
7972 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7974 2000-11-11 Jim Meyering <meyering@lucent.com>
7976 * error.c: Add a couple #includes, merging from GNU libc version.
7978 2000-11-10 Jim Meyering <meyering@lucent.com>
7980 * obstack.h: Update from GNU libc.
7981 * obstack.c: Likewise.
7983 2000-11-06 Paul Eggert <eggert@twinsun.com>
7985 * getusershell.c (setusershell): Use rewind rather than
7986 fseek/fseeko, to avoid configuration hassles with fseeko.
7987 Don't bother opening SHELLS_FILE if shellstream is NULL;
7990 2000-11-05 Jim Meyering <meyering@lucent.com>
7992 * makepath.h (make_dir): Declare.
7993 * makepath.c (make_dir): Remove `static' attribute.
7996 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
7998 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
7999 last one in a bucket, advance to the next bucket.
8001 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
8003 * fnmatch.c: Do not comment out all the code if we are using
8004 the GNU C library, because in some cases we are replacing buggy
8005 code in the GNU C library itself.
8007 2000-10-30 Paul Eggert <eggert@twinsun.com>
8009 * error.h, getline.h, modechange.h:
8010 Remove "2000" from Copyright line, as the file hasn't been
8011 changed this year other than in the copyright notice.
8013 * xalloc.h: Add "2000" to Copyright line, as this file
8014 was changed this year.
8016 2000-10-30 Paul Eggert <eggert@twinsun.com>
8018 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
8019 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
8020 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
8022 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
8024 * regex.h (__restrict_arr): Move definition out of #ifndef block.
8025 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
8026 doesn't define __restrict_arr.
8028 2000-10-29 Jim Meyering <meyering@lucent.com>
8030 * xstat.in: Fix grammar in comment.
8032 2000-10-28 Jim Meyering <meyering@lucent.com>
8034 * memchr.c: Update from libc.
8035 Adjust for portability:
8036 [HAVE_STDLIB_H]: Include stdlib.h.
8037 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
8038 Undef __memchr, too.
8039 [!weak_alias]: Define __memchr to memchr.
8041 * regex.c: Update from libc.
8042 * regex.h: Likewise.
8043 * getopt1.c: Likewise.
8044 * memcmp.c: Likewise.
8046 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
8047 Avoid using fseek, when possible -- it's broken by design.
8048 Patch by Ulrich Drepper.
8050 2000-10-26 Jim Meyering <meyering@lucent.com>
8052 * strftime.c: Update from libc.
8054 2000-10-25 Jim Meyering <meyering@lucent.com>
8056 * obstack.c: Update from libc.
8058 2000-10-23 Jim Meyering <meyering@lucent.com>
8060 * hard-locale.c (hard_locale): Revert last change -- it was simply
8061 wrong. That set_locale call must not have any side effects.
8064 2000-10-22 Jim Meyering <meyering@lucent.com>
8066 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
8067 [CYCLIC]: Remove now-unused definition.
8069 * save-cwd.c (O_DIRECTORY): Define, if needed.
8070 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
8071 Suggestion from Ulrich Drepper.
8073 2000-10-21 Jim Meyering <meyering@lucent.com>
8075 * dirname.c (dir_name_r): New function, factored out of dir_name.
8076 (dir_name): Use dir_name_r.
8077 * dirname.h (dir_name_r): Declare it.
8079 2000-10-21 Jim Meyering <meyering@lucent.com>
8081 * dirname.c (memrchr): Declare if necessary.
8082 (dir_name): Remove the restriction that there be no
8083 trailing slashes. Now, this code skips past them, effectively
8085 [TEST_DIRNAME] (main): New unit tests.
8087 * memrchr.c: New file from GNU libc.
8088 Undef __memrchr, too.
8089 [!weak_alias]: Define __memrchr to memrchr.
8090 Guard weak_alias use with `#ifdef weak_alias'.
8092 2000-10-17 Jim Meyering <meyering@lucent.com>
8094 * quote.h (PARAMS): Define and use.
8095 Reported by Akim Demaille.
8097 * getopt.c: Update from libc.
8099 2000-10-16 Jim Meyering <meyering@lucent.com>
8101 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
8104 2000-09-25 Jim Meyering <meyering@lucent.com>
8106 * md5.h (rol): Define (from GnuPG).
8108 * sha.c: Give credit (GnuPG) where due.
8109 (M): Use rol rather than open-coding it.
8110 Add a FIXME comment.
8112 2000-09-21 Jim Meyering <meyering@lucent.com>
8114 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
8115 Reported by Michael Stone.
8117 2000-09-20 Jim Meyering <meyering@lucent.com>
8119 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
8120 (noinst_HEADERS): Add sha.h.
8121 Based on code from Scott G. Miller and from GnuPG.
8123 2000-09-15 Jim Meyering <meyering@lucent.com>
8125 * regex.c: Update from libc.
8127 2000-09-10 Jim Meyering <meyering@lucent.com>
8129 * getopt.c (_getopt_internal): Update from glibc.
8131 2000-09-09 Jim Meyering <meyering@lucent.com>
8133 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
8134 think it should be used as a general replacement for isascii.
8135 * fnmatch.c: Likewise.
8136 * mbswidth.c: Likewise
8137 * regex.c: Likewise.
8140 * userspec.c: Include sys/param.h and limits.h.
8142 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8143 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
8144 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
8145 UID, GID. Check range.
8147 2000-09-06 Jim Meyering <meyering@lucent.com>
8149 * getopt.c (_getopt_internal): Update from glibc.
8151 2000-08-30 Jim Meyering <meyering@lucent.com>
8153 * strftime.c: Merge in changes from GNU libc.
8155 2000-08-26 Jim Meyering <meyering@lucent.com>
8157 * closeout.c: Include "__fpending.h".
8158 (close_stdout_status): Return right away if there's nothing to flush.
8160 * Makefile.am (noinst_HEADERS): Add __fpending.h.
8161 * __fpending.c: New file.
8162 * __fpending.h: New file.
8164 2000-08-07 Paul Eggert <eggert@twinsun.com>
8166 Standardize on "memory exhausted" instead of "Memory exhausted"
8167 or "virtual memory exhausted".
8168 * obstack.c (print_and_abort): Use "memory exhausted", not
8169 "virtual memory exhausted".
8170 * same.c (same_name): Invoke xalloc_die instead of printing
8172 * userspec.c (parse_user_spec): Likewise.
8173 * bumpalloc.h: comment fix
8174 * same.c, userspec.c: Include xalloc.h.
8176 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
8177 not char *const and pointing to a constant array.
8178 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
8179 (xrealloc): Comment fix.
8181 * userspec.c (parse_user_spec):
8182 Don't translate a message until just before returning,
8183 to avoid unnecessary translation.
8185 2000-08-07 Jim Meyering <meyering@lucent.com>
8187 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
8188 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
8189 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
8190 getgroups.c, gethostname.c, getopt.h, group-member.c,
8191 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
8192 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
8193 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
8194 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
8195 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
8196 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
8197 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
8198 yesno.c: Back out Copyright date changes for each file with no change
8199 this year. This eases coordination with other programs using the same
8200 source code modules. From Paul Eggert.
8202 2000-08-03 Greg McGary <greg@mcgary.org>
8204 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
8205 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
8206 (EXTEND_BUFFER): Use them.
8208 2000-08-01 Jim Meyering <meyering@lucent.com>
8210 * dirname.c (ISSLASH): Define.
8211 (BACKSLASH_IS_PATH_SEPARATOR): Define.
8212 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
8213 both `\' and `/' may be use as path separators.
8214 Based on a patch from Prashant TR.
8216 2000-07-31 Paul Eggert <eggert@twinsun.com>
8218 * quotearg.c (quotearg_n_options): Don't make the initial
8219 slot vector a constant, since it might get modified.
8221 2000-07-31 Jim Meyering <meyering@lucent.com>
8223 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
8224 * obstack.c (print_and_abort): Likewise.
8226 2000-07-30 Paul Eggert <eggert@twinsun.com>
8228 * quotearg.c (quotearg_n_options): Preallocate a slot 0
8229 buffer, so that the caller can always quote one small
8230 component of a "memory exhausted" message in slot 0.
8231 From a suggestion by Jim Meyering.
8233 2000-07-30 Jim Meyering <meyering@lucent.com>
8235 * makepath.c (make_path): Quote the other instance, too.
8237 * quotearg.c (N_STATIC_SLOTVECS): Define.
8238 (STATIC_BUF_SIZE): Define.
8239 (quotearg_n_options): Use only statically allocated storage when
8240 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
8241 than STATIC_BUF_SIZE.
8243 2000-07-29 Jim Meyering <meyering@lucent.com>
8245 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
8246 * dirname.c (dir_name): Likewise.
8248 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
8250 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
8251 (dir_name): Assert that there are no trailing slashes.
8253 2000-07-18 Bruno Haible <haible@clisp.cons.org>
8255 * mbswidth.h (mbswidth): Add a flags argument.
8256 (mbswidth): New declaration.
8257 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
8258 * mbswidth.c (mbswidth): Add a flags argument.
8259 (mbsnwidth): New function.
8261 2000-07-24 Jim Meyering <meyering@lucent.com>
8263 * mbswidth.c: Remove useless #else. From Bruno Haible.
8265 2000-07-23 Paul Eggert <eggert@twinsun.com>
8267 * mbswidth.c (_XOPEN_SOURCE):
8268 Don't define; this causes problems on Solaris 7.
8269 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
8271 2000-07-23 Paul Eggert <eggert@twinsun.com>
8274 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
8275 so that mbstate_t is always defined.
8277 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
8278 be 1 in at least one GCC installation, and this configuration
8279 error is likely to be common. Ignoring MB_LEN_MAX hurts
8280 performance on hosts that have mbrtowc but have only unibyte
8281 locales, but I assume these hosts are rare.
8283 2000-07-23 Paul Eggert <eggert@twinsun.com>
8285 * quotearg.c: Streamline by invoking multibyte code only if needed.
8286 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
8287 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
8288 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
8289 invoke multibyte primitives.
8291 2000-07-23 Jim Meyering <meyering@lucent.com>
8293 * basename.c (base_name): Add an assertion.
8295 2000-07-15 Bruno Haible <clisp.cons.org>
8297 * quotearg.c: When the system forces us to redefine mbstate_t,
8298 shadow its mbsinit function.
8300 2000-07-16 Bruno Haible <haible@clisp.cons.org>
8302 * mbswidth.h: New file.
8303 * mbswidth.c: New file.
8304 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
8305 (noinst_HEADERS): Add mbswidth.h.
8307 2000-07-17 Bruno Haible <haible@clisp.cons.org>
8309 * config.charset: Add support for FreeBSD. Improve support for HP-UX
8312 2000-07-15 Jim Meyering <meyering@lucent.com>
8314 * makepath.c: Include quote.h.
8315 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
8316 corresponding argument in a `quote (...)' call.
8317 Give better diagnostics.
8319 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
8320 (noinst_HEADERS): Add quote.h.
8322 * quote.c (quote, quote_n): New file. Two functions taken verbatim
8323 from tar's src/misc.c.
8324 * quote.h: New file. Prototypes for same.
8326 2000-07-10 Paul Eggert <eggert@twinsun.com>
8328 From a suggestion by Bruno Haible.
8329 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
8330 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
8331 to decide whether to define the BeOS workaround macro;
8332 this adjusts to the change to AC_MBSTATE_T.
8334 2000-07-13 Paul Eggert <eggert@twinsun.com>
8336 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
8338 * quotearg.c (quoting_style_args, quoting_style_vals,
8339 quotearg_buffer_restyled): Add support for
8340 clocale_quoting_style. Undo previous change to
8341 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
8342 and "{RIGHT QUOTATION MARK}" msgids.
8344 2000-07-05 Paul Eggert <eggert@twinsun.com>
8346 The old behavior of quoting `like this' doesn't look good with
8347 newer, ISO-style fonts. See:
8348 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
8350 Instead, quote "like this" by default. Let the translator
8351 tailor the locale-specific quoting behavior by providing
8352 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
8354 * quotearg.c (N_): New macro.
8355 (gettext_default): New function.
8356 (quotearg_buffer_restyled): Use
8357 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
8358 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
8360 2000-07-09 Jim Meyering <meyering@lucent.com>
8362 * Most files: Update copyright dates to include 2000.
8364 2000-07-08 Jim Meyering <meyering@lucent.com>
8366 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
8368 (xgethostname): Remove now-unnecessary #ifdef.
8369 Move declaration of `err' into loop where it's used.
8371 2000-07-05 Bruno Haible <haible@clisp.cons.org>
8373 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
8374 by allocating a larger buffer. Test the gethostname return value for
8375 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
8376 returns an error and ENAMETOOLONG isn't defined.
8378 2000-07-05 Paul Eggert <eggert@twinsun.com>
8379 and Bruno Haible <haible@clisp.cons.org>
8381 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
8383 2000-07-05 Bruno Haible <haible@clisp.cons.org>
8385 * quotearg.c (struct quoting_options): Simplify quote_these_too
8388 2000-07-03 Jim Meyering <meyering@lucent.com>
8390 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
8391 Reported by Bruno Haible.
8393 2000-07-04 Jim Meyering <meyering@lucent.com>
8395 * quotearg.c: Make inclusion of <wchar.h> independent of whether
8396 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
8399 2000-07-03 Paul Eggert <eggert@twinsun.com>
8400 and Bruno Haible <haible@clisp.cons.org>
8402 * quotearg.c (mbrtowc):
8403 Assign to *pwc, and return 1 only if result is nonzero.
8404 (iswprint): Use ISPRINT when substituting our own mbrtowc.
8406 2000-07-03 Jim Meyering <meyering@lucent.com>
8408 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
8409 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
8412 2000-07-02 Jim Meyering <meyering@lucent.com>
8414 * quotearg.c (mbstate_t): Don't define here.
8416 2000-07-02 Jim Meyering <meyering@lucent.com>
8418 * nanosleep.c (SIGCONT): Define if not already defined.
8420 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8422 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
8423 per change in ../m4/ls-mntd-fs.m4.
8424 (read_filesystem_list): Ignore symbolic links.
8426 2000-06-29 Jim Meyering <meyering@lucent.com>
8428 * same.c: Include <string.h> or <strings.h>, as appropriate,
8429 for declaration of strcmp.
8431 * long-options.c: Include <stdlib.h>, for declaration of exit.
8433 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
8434 Avoid warning by casting result to `char *' to remove `const'.
8436 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8438 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
8440 2000-06-26 Paul Eggert <eggert@twinsun.com>
8442 savedir now sets errno on failure and invokes xmalloc to get memory.
8443 Fix a couple of other minor bugs while we're at it.
8445 * savedir.c (<unistd.h>): Do not include; there's no need.
8446 (NAMLEN): Remove macro.
8447 (malloc, realloc): Remove decls.
8449 ("xalloc.h"): Include.
8450 (NAME_SIZE_DEFAULT): New macro.
8451 (savedir): Use xmalloc / xrealloc to allocate memory.
8452 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
8453 Skip "" directory entries.
8454 Use strlen to calculate directory entry length, since the old method
8455 is rarely used these days and isn't worth supporting.
8456 Don't use a pointer after freeing it.
8457 Check for integer overflow when calculating allocation size.
8458 Use memcpy to copy entries, instead of stpcpy.
8459 Set errno properly when returning NULL.
8460 Check for readdir error.
8462 2000-06-26 Jim Meyering <meyering@lucent.com>
8464 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
8466 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8468 * getusershell.c (xmalloc, xrealloc): Remove functions.
8470 Don't include <stdlib.h>. Don't declare malloc, realloc.
8472 2000-06-23 Bruno Haible <haible@clisp.cons.org>
8474 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
8476 2000-06-24 Jim Meyering <meyering@lucent.com>
8478 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
8480 2000-06-21 Jim Meyering <meyering@lucent.com>
8482 * getpass.c: New file, from Bruno Haible. Required for BeOS.
8484 2000-06-19 Paul Eggert <eggert@twinsun.com>
8486 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
8487 (mbrtowc, mbstate_t): Define substitutes if
8488 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
8489 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
8490 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
8492 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8494 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
8495 than 1024, return a memory chunk of least possible size, instead
8496 of size PATH_MAX + 2. In the loop, increment the size proportionally.
8497 Use free/xmalloc instead of xrealloc to avoid copying for very long
8500 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8502 * canon-host.c (canon_host): Use malloc and memcpy to copy an
8503 address, not strdup. Include <stdlib.h> and don't declare free().
8505 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8507 * path-concat.c (path_concat): Don't access dir[-1] if dir is
8510 2000-06-21 Jim Meyering <meyering@lucent.com>
8512 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
8513 (noinst_HEADERS): Add getstr.h.
8515 * getline.c (getstr): Move into a separate file.
8516 * getstr.c (getstr): New file, extracted from getline.c, with
8517 the following changes: new parameter, delim2; both delim[12]
8518 parameters have type `int', not `char'. The latter would lose
8519 with 8-bit delimiters.
8520 * getstr.h: New file.
8522 2000-06-19 Jim Meyering <meyering@lucent.com>
8524 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
8526 2000-06-18 Jim Meyering <meyering@lucent.com>
8528 * mkdir.c: Remove file, due mainly to copyright incompatibility.
8529 Besides, these days every porting target provides a mkdir function.
8531 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
8532 (this snippet comes from src/system.h).
8534 2000-06-15 Paul Eggert <eggert@twinsun.com>
8536 * human.c (adjust_value): New function.
8537 (human_readable_inexact): Apply rounding style even when
8538 printing approximate values.
8540 2000-06-14 Paul Eggert <eggert@twinsun.com>
8542 * human.c (human_readable_inexact): Allow an input block
8543 size that is not a multiple of the output block size, and vice versa.
8544 Reported by Piergiorgio Sartor.
8546 2000-06-14 Paul Eggert <eggert@twinsun.com>
8548 * getdate.y (get_date): Apply relative times after time
8549 zone indicator, not before. Reported by Todd A. Jacobs.
8551 2000-06-13 Jim Meyering <meyering@lucent.com>
8553 * Makefile.am (all-local): Depend on lstat.c and stat.c.
8555 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
8557 2000-06-12 Paul Eggert <eggert@twinsun.com>
8559 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
8561 2000-06-04 Paul Eggert <eggert@twinsun.com>
8563 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
8565 2000-06-04 Jim Meyering <meyering@lucent.com>
8567 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
8568 SunOS 4.1.4 for which gid_t is an unsigned type.
8570 2000-06-03 Jim Meyering <meyering@lucent.com>
8572 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
8574 2000-05-26 Bruno Haible <haible@clisp.cons.org>
8576 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
8577 newer, don't install charset.alias.
8578 * config.charset: Change the Linux/glibc rules so they become empty
8579 on glibc-2.1 or newer.
8581 2000-06-02 Jim Meyering <meyering@lucent.com>
8583 * mountlist.c: Back out last change. Instead, do this...
8584 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
8585 member using the same `ignore'-testing code.
8586 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
8590 2000-05-29 Jim Meyering <meyering@lucent.com>
8592 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
8593 with the `ignore' attribute. Based on a patch from Mark D. Roth.
8595 2000-05-22 Jim Meyering <meyering@lucent.com>
8597 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
8599 2000-05-18 Jim Meyering <meyering@lucent.com>
8601 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
8602 back, too, since it may have been modified by allocate_entry.
8603 (hash_delete): Rewrite to use neither the assignment operator
8604 nor the comma operator in an if-expression.
8606 2000-05-15 Paul Eggert <eggert@twinsun.com>
8609 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
8610 Remove; no longer needed.
8611 "quotearg.h": Add include.
8612 (file_name): Do not bother to explicitly initialize to NULL; it's less
8613 efficient on some hosts.
8614 (close_stdout_status): Remove test as to whether stdout was already
8615 closed; it breaks for the case "echo x | sort >&-".
8616 Quote file name colons.
8617 Do not assume that _("write error") lacks format strings.
8619 2000-05-15 Jim Meyering <meyering@lucent.com>
8621 * version-etc.c (version_etc_copyright): Update the copyright string
8622 used in all --version output.
8624 2000-05-14 Jim Meyering <meyering@lucent.com>
8626 * closeout.c (close_stdout_set_file_name): New function.
8627 (close_stdout_status): Use new file-scoped global.
8628 Return right away if fstat says the stdout file descriptor is invalid.
8629 * closeout.h (close_stdout_set_file_name): Declare.
8631 2000-05-10 Jim Meyering <meyering@lucent.com>
8633 * closeout.c [default_exit_status]: New file-scoped variable.
8634 (close_stdout_set_status): New function.
8635 * closeout.h (close_stdout_set_status): Declare.
8637 2000-05-08 Jim Meyering <meyering@lucent.com>
8639 * long-options.c: Don't include closeout.h.
8640 (parse_long_options): Don't call close_stdout for --version.
8642 2000-05-06 Jim Meyering <meyering@lucent.com>
8644 * strnlen.c: Undefine __strnlen and strnlen.
8645 [!weak_alias]: Define __strnlen to strnlen.
8647 * atexit.c: New file, from libiberty.
8649 2000-05-06 Jim Meyering <meyering@lucent.com>
8651 * closeout.c (close_stdout_status): Also check for errors on the
8654 2000-05-05 Bruno Haible <haible@clisp.cons.org>
8656 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
8657 instead of xmalloc, xrealloc, path_concat.
8658 (locale_charset): Treat empty environment variables as absent.
8659 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
8661 2000-05-04 Jim Meyering <meyering@lucent.com>
8663 * getopt.c: Update from glibc.
8664 * obstack.c: Likewise.
8665 * obstack.h: Likewise.
8666 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
8668 * regex.h: Likewise.
8669 * strndup.c: Likewise.
8670 * strnlen.c: New file, from glibc.
8672 2000-05-01 Jim Meyering <meyering@lucent.com>
8674 * full-write.c (full_write): Remove `FIXME' part of comment.
8676 2000-04-29 Jim Meyering <meyering@lucent.com>
8678 * path-concat.c: Declare strdup only if it's not defined.
8679 * canon-host.c: Likewise.
8681 2000-04-28 Jim Meyering <meyering@lucent.com>
8683 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
8684 redefinition warning on some systems (HPUX). Otherwise, regex.h is
8685 included first, then limits.h is included by locale.h by libintl.h.
8686 From John David Anglin.
8688 2000-04-25 Jim Meyering <meyering@lucent.com>
8690 * makepath.c (S_IRWXUGO): Define.
8691 (make_path): Always perform explicit chmod if MODE specifies any
8692 of the `special' permission bits. Prompted by a bug report against
8693 install from Mate Wierdl and Joost van Baal.
8695 2000-04-18 Jim Meyering <meyering@lucent.com>
8699 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
8700 getpagesize. For BeOS. Based on a patch from Bruno Haible.
8702 2000-04-17 Jim Meyering <meyering@lucent.com>
8704 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
8705 the definition of it to rpl_strftime also defined-away the system's
8708 2000-04-15 Jim Meyering <meyering@lucent.com>
8710 Use `C' to denote so-called `contiguous' files, the same way
8712 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
8713 (ftypelet): Use S_ISCTG.
8714 From Michael Deutschmann.
8716 2000-04-14 Jim Meyering <meyering@lucent.com>
8718 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
8720 2000-04-08 Jim Meyering <meyering@lucent.com>
8722 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
8723 names don't conflict. Reported by Eli Zaretskii.
8725 2000-03-28 Bruno Haible <haible@clisp.cons.org>
8727 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
8728 bug. Deal with the different error behavior of Irix iconv.
8730 2000-04-07 Jim Meyering <meyering@lucent.com>
8732 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
8733 to work around system header problems on AIX 3.2.5. From Bruno Haible.
8735 2000-04-05 Jim Meyering <meyering@lucent.com>
8737 Portability tweaks required for ultrix4.3.
8738 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8739 * readutmp.c: Include sys/types.h before sys/stat.h.
8740 * canon-host.c: Declare strdup.
8741 * path-concat.c: Likewise.
8742 From John David Anglin.
8744 2000-04-04 Jim Meyering <meyering@lucent.com>
8746 Be more DOS 8.3-friendly.
8747 * ref-add.sin: Renamed from ref-add.sed.in.
8748 * ref-del.sin: Renamed from ref-del.sed.in.
8749 * Makefile.am: Reflect renaming.
8750 Reported by Eli Zaretskii.
8752 Use a temporary file name that won't clash with `charset.alias'
8753 in the DOS 8.3 name space.
8754 * Makefile.am (charset_tmp): Define.
8755 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8756 (uninstall-local): Likewise.
8757 Reported by Eli Zaretskii.
8759 2000-03-29 Paul Eggert <eggert@twinsun.com>
8761 * time/strftime.c (my_strftime): Make sure we call the system
8762 strftime, not ourselves, when invoking the underlying strftime.
8764 2000-03-24 Jim Meyering <meyering@lucent.com>
8766 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8767 (charset_alias): Define.
8768 (install-exec-local): Factor out common code.
8769 (uninstall-local): Split lines longer than 80.
8770 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8772 (.sed.in.sed): New rule. Don't redirect directly to $@.
8773 (CLEANFILES): Add ref-add.sed and ref-del.sed.
8775 2000-03-19 Bruno Haible <haible@clisp.cons.org>
8777 * config.charset: Output a line containing "Packages using this file".
8778 * ref-add.sed.in, ref-del.sed.in: New files.
8779 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8780 ref-del.sed): New rules.
8782 2000-03-17 Jim Meyering <meyering@lucent.com>
8784 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8785 Otherwise, include <strings.h>
8787 2000-03-17 Bruno Haible <haible@clisp.cons.org>
8789 * unicodeio.c (utf8_wctomb): New function.
8790 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8791 format instead of in UCS-4 with platform dependent endianness.
8793 2000-03-07 Paul Eggert <eggert@twinsun.com>
8795 * savedir.c (savedir): Work even if directory size is
8796 negative; this can happen with some screwy NFS configurations.
8798 2000-03-06 Jim Meyering <meyering@lucent.com>
8800 * localcharset.c (get_charset_aliases): Don't try to free file_name
8801 if it's NULL (because we ran out of memory). From Bruno Haible.
8803 2000-03-05 Jim Meyering <meyering@lucent.com>
8805 * localcharset.c ("path-concat.h"): Include.
8806 (get_charset_aliases): Use path_concat instead of ANSI string
8809 * unicodeio.h (PARAMS): Define.
8810 Use it to guard prototype.
8812 2000-03-04 Jim Meyering <meyering@lucent.com>
8814 * Makefile.am (install-exec-local): Create $(libdir) before installing
8816 (uninstall-local): Uncomment this rule so `make distcheck' works
8819 * unicodeio.c (<errno.h>): Include it.
8820 (errno): Declare if not defined.
8822 * localcharset.c: Add Bruno's comment justifying use of volatile.
8824 * config.charset: New version, incorporating remarks from a linux
8825 i18n mailing list. From Bruno Haible.
8827 2000-03-02 Jim Meyering <meyering@lucent.com>
8829 * Makefile.am (EXTRA_DIST): Add config.charset.
8831 2000-03-01 Jim Meyering <meyering@lucent.com>
8833 * localcharset.c: Guard some #includes with `#if HAVE_...'.
8834 * unicodeio.c: Likewise.
8836 2000-02-02 Bruno Haible <haible@clisp.cons.org>
8838 * config.charset: New file.
8839 * localcharset.c: New file.
8840 * unicodeio.h, unicodeio.c: New files.
8841 * Makefile.am (DEFS): Add -DLIBDIR=...
8842 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8843 (noinst_HEADERS): Add unicodeio.h.
8844 (all-local, install-exec-local, charset.alias): New targets.
8846 2000-02-28 Paul Eggert <eggert@twinsun.com>
8848 * quotearg.c (ALERT_CHAR): New macro.
8849 (quotearg_buffer_restyled): Use it.
8851 2000-02-27 Jim Meyering <meyering@lucent.com>
8853 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8854 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8856 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8857 not `#if STDC_HEADERS'.
8858 Declare malloc if needed.
8860 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8861 now that autoconf always defines the HAVE_DECL_ symbols.
8862 * human.c: Likewise.
8864 * strtoumax.c: Likewise.
8866 * backupfile.c: Arrange for cpp to fail if the configure-time
8867 declaration check was not run.
8869 * human.c: Likewise.
8871 * strtoumax.c: Likewise.
8873 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8874 then first look up the entire `.'-containing string as a login name.
8876 2000-02-18 Paul Eggert <eggert@twinsun.com>
8878 * getdate.y: Handle two-digit years with leading zeros correctly.
8879 (textint): New typedef.
8880 (parser_control): Member year changed from int to textint.
8882 (YYSTYPE): Removed; replaced by %union with int and textint members.
8883 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8884 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8885 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8886 (tSNUMBER, tUNUMBER): Now of type <textintval>.
8887 (date, number, to_year): Use width of number in digits, not its value,
8888 to determine whether it's a 2-digit year, or a 2-digit time.
8889 (yylex): Store number of digits of numeric tokens.
8890 Reported by John Kendall.
8892 (parser_control): Changed from struct parser_control to typedef (for
8893 consistency). All uses changed.
8895 (tID): Removed; not used.
8896 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8898 2000-02-14 Paul Eggert <eggert@twinsun.com>
8900 * getpagesize.h (getpagesize): Port to VMS for Alpha;
8901 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8903 2000-02-12 Jim Meyering <meyering@lucent.com>
8905 * userspec.c (ISDIGIT): Define it.
8906 (isdigit): Remove definition.
8907 (is_number): Use ISDIGIT, not isdigit.
8908 <libintl.h>: Include.
8910 (parse_user_spec): Mark translatable strings.
8912 2000-02-10 Jim Meyering <meyering@lucent.com>
8914 With these changes, nanosleep.[ch] are finally enough like the other
8915 lib/* replacement files to compile on a few more losing systems.
8917 * nanosleep.h: Don't include config.h.
8918 Remove prototype from declaration of nanosleep.
8919 (PARAMS): Remove now-unneeded definition.
8920 * nanosleep.c: #undef nanosleep.
8921 (rpl_nanosleep): Rename from nanosleep.
8923 2000-02-03 Jim Meyering <meyering@lucent.com>
8925 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8926 rather than with `#if HAVE_UTMPNAME'.
8928 2000-02-01 Jim Meyering <meyering@lucent.com>
8930 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
8932 2000-01-31 Jim Meyering <meyering@lucent.com>
8934 * nanosleep.h (nanosleep): Guard declaration with
8935 `#if ! HAVE_DECL_NANOSLEEP'.
8936 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8937 the declaration in that vendor's sys/timers.h.
8938 Reported by Christian Krackowizer.
8940 * quotearg.c (ISASCII): Add #undef and move definition to follow
8941 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8942 (ISPRINT): Likewise.
8943 Reported by Tom Tromey.
8945 2000-01-30 Jim Meyering <meyering@lucent.com>
8947 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8948 uses of ->ut_name. The latter doesn't work with new Linux header files
8949 where only utmpx.ut_user is declared.
8951 * readutmp.h (UT_USER): Define.
8953 2000-01-23 Jim Meyering <meyering@lucent.com>
8955 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8958 2000-01-22 Jim Meyering <meyering@lucent.com>
8960 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8961 [! HAVE_DECL_STRTOULL]: Declare strtoull.
8962 Required for some AIX systems. Reported by Christian Krackowizer.
8963 [TESTING] (main): New function.
8965 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
8966 * dirname.c (dir_name): Support for DOS-style file names with drive
8969 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8971 * strverscmp.c (ISDIGIT): Define.
8972 (strverscmp): Use ISDIGIT, not isdigit.
8974 2000-01-17 Paul Eggert <eggert@twinsun.com>
8976 * nanosleep.c (nanosleep):
8977 Don't use SA_INTERRUPT to decide whether to call sigaction, as
8978 POSIX.1 doesn't require SA_INTERRUPT and some systems
8979 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
8980 it's been part of POSIX.1 since day 1 (in 1988).
8982 2000-01-17 Jim Meyering <meyering@lucent.com>
8984 * interlock: Remove unused file. Reported by François Pinard.
8986 2000-01-16 Paul Eggert <eggert@twinsun.com>
8988 * quotearg.c (quotearg_buffer_restyled): Do not quote
8989 alert, backslash, formfeed, and vertical tab unnecessarily in
8990 shell quoting style.
8993 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
8994 Free Software Foundation, Inc.
8995 Copying and distribution of this file, with or without modification,
8996 are permitted provided the copyright notice and this notice are preserved.