1 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
3 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
4 Typedef to long int, not to off_, as POSIX will likely change
7 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
9 * argp-help.c (validate_uparams): Fix typo
10 * argp-parse.c (argp_default_options): Consistently begin help
11 messages with a lowercase letter.
13 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
15 * time_r.h (asctime_r, ctime_r): Remove. These functions can
16 overrun buffers and shouldn't be used (much as gets shouldn't be
18 * time_r.c (asctime_r, ctime_r): Likewise.
20 2006-03-08 Simon Josefsson <jas@extundo.com>
22 * gc-gnulib.c (randomize): Don't open files called 'no', they
23 signal that configure disabled the device.
25 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
27 * c-stack.c: Include unistd.h unconditionally, since we now assume
29 * getlogin_r.c: Likewise.
30 * getlogin_r.h: Likewise.
32 * pagealign_alloc.c: Likewise.
33 * unistd_.h: Remove; no longer needed.
35 2006-03-07 Simon Josefsson <jas@extundo.com>
37 * unistd_.h: New file.
39 2006-03-07 Simon Josefsson <jas@extundo.com>
41 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
43 2006-03-01 Simon Josefsson <jas@extundo.com>
45 * readline.c: Fix typo, tiny patch from Stepan Kasal
48 2006-02-28 Simon Josefsson <jas@extundo.com>
50 * getopt.c: Protect #include of unistd.h, for MSVS.
52 2006-02-27 Simon Josefsson <jas@extundo.com>
54 * base64.h: Indent #define's. From Jim Meyering
57 2006-02-27 Jim Meyering <jim@meyering.net>
59 Revert the change of 2006-02-24, so these files can continue
60 to be sync'd from gettext.
61 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
64 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
66 * glob.c: Say "invalid" rather than "illegal" in comments.
68 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
70 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
72 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
74 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
75 AT_FDCWD exceeds INT_MAX.
76 * openat.h (AT_FDCWD): Likewise.
78 2006-02-14 Jim Meyering <jim@meyering.net>
82 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
83 failure on deficient systems, and simplify gnulib lgpl dependencies.
84 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
85 xmalloc/lstat combination. Based on a patch from Bruno Haible.
87 * xalloc-die.c: Remove unused definition of N_.
89 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
91 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
93 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
95 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
96 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
98 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
100 * argp-namefrob.h: Restore changes accidentally lost during the
101 "autoupdate" on 2005-12-12.
103 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
105 * fnmatch.c (L_): Renamed from L, to work around a bug in
106 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
107 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
110 2006-01-26 Simon Josefsson <jas@extundo.com>
112 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
113 prototype is visible on mingw32.
115 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
118 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
121 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
123 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
124 attempt to open for write; this always fails, at least on POSIX
125 hosts. This reinstates the 2006-01-09 change, which was
126 inadvertently removed.
128 2006-01-26 Bruno Haible <bruno@clisp.org>
129 Paul Eggert <eggert@cs.ucla.edu>
132 [(! (defined __cplusplus || defined __BEOS__)
134 && !(defined __HP_cc || defined __xlc__
135 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
137 #define to signed char in these cases too; this simplifies
138 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
139 etc., separately) and makes it more conservative.
141 2006-01-21 Jim Meyering <jim@meyering.net>
143 Sync from the stable (b5) branch of coreutils:
145 * fts.c (fts_children): Don't let close() clobber errno from
148 * fts.c (fts_stat): When following a symlink-to-directory,
149 don't necessarily interpret stat-fails+lstat-succeeds as indicating
150 a dangling symlink. That can also happen at least for ELOOP.
151 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
152 FYI, this bug predates the inclusion of fts.c in coreutils.
154 * fts.c (fts_open): Put new maxarglen declaration and uses
155 in their own block, so pre-c99 compilers don't object.
157 Avoid the double-free (first in fts_read, second in fts_close) that
158 would occur when an `active' directory is made inaccessible (e.g.,
159 via chmod a-x) during a traversal.
160 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
161 before returning. Reproduce this failure by
162 mkdir -p a/b; cd a; chmod a-x . b
163 Reported by Stavros Passas.
165 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
167 * argp-namefrob.h: Bugfix. Remove stray #
169 2006-01-25 Bruno Haible <bruno@clisp.org>
171 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
173 Reported by Paul Eggert.
175 2006-01-25 Jim Meyering <jim@meyering.net>
177 * fileblocks.c: Remove more useless parentheses.
178 * readutmp.h: Likewise.
180 2006-01-24 Bruno Haible <bruno@clisp.org>
182 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
184 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
187 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
188 to avoid problems with the built-in _Bool type.
189 Reported by Paul Eggert on 2005-11-26.
191 2006-01-24 Jim Meyering <jim@meyering.net>
193 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
195 2006-01-24 Simon Josefsson <jas@extundo.com>
197 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
200 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
202 Work around porting bugs reported by Dieter in
203 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
204 * getopt.c (_NOPROTO): Remove; no longer needed.
205 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
206 Include "getopt.h" first, to check interface.
207 (getenv): Declare only if defined HAVE_DECL_GETENV &&
209 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
210 (__strndup): Revert to K&R-style function dfns, the glibc style.
211 * strnlen.c: Don't claim it's taken from glibc; it's not.
212 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
213 Include strnlen.h first, to get prototype properly.
214 (strnlen): Renamed from __strnlen.
217 2006-01-23 Ulrich Drepper <drepper@redhat.com>
219 These changes imported from libc.
220 * getopt.c: Use __fxprintf instead of inline stream orientation
221 test and two separate function calls.
222 * strndup.c (__strndup): Add libc_hidden_def.
224 2006-01-22 Bruno Haible <bruno@clisp.org>
226 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
227 temporary buffer for sprintf, take into account the precision also
228 for 'd', 'i', 'u', 'o', 'x', 'X'.
230 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
232 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
233 to pacify gcc -Wswitch-default.
235 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
237 * argp-help.c (usage_long_opt): Do not print DOC options.
238 (__argp_base_name): Removed
239 * argp-namefrob.h (__argp_basename): Removed definition. Was a
241 (__argp_base_name): Provide macro definition or extern declaration
242 depending on the configuration
244 2006-01-20 Simon Josefsson <jas@extundo.com>
246 * inet_ntop.h: Unconditionally include sys/socket.h.
248 2006-01-19 Simon Josefsson <jas@extundo.com>
250 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
252 2006-01-12 Simon Josefsson <jas@extundo.com>
254 * base64.c: Fix warning, reported by Bruno Haible
255 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
257 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
260 * md5.c: Fix commentary typos.
261 (alignof, UNALIGNED_P): No need for a GCC-specific version.
262 * md5.h (__attribute__): Remove; unused.
263 * sha1.c: Fix commentary to match md5 better.
264 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
265 so that we don't need to worry about alignment. All uses changed.
266 This merges the 2005-10-28 md5 change into sha1.
268 2006-01-11 Jim Meyering <jim@meyering.net>
271 * md5.c (OP): Fix spacing.
273 2006-01-11 Simon Josefsson <jas@extundo.com>
275 * stdint_.h (SIZE_MAX): Add missing (.
277 2006-01-10 Bruno Haible <bruno@clisp.org>
279 * argp.h (__const): Remove macro. Use const instead.
280 * argp-fmtstream.h (__const): Likewise.
281 * glob_.h (__const): Remove macro.
282 * glob-libc.h: Use const instead of __const.
284 2006-01-10 Jim Meyering <jim@meyering.net>
286 Avoid the double-free (first in fts_read, second in fts_close) that
287 would occur when an `active' directory is made inaccessible (e.g.,
288 via chmod a-x) during a traversal.
289 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
290 before returning. Reproduce this failure by
291 mkdir -p a/b; cd a; chmod a-x . b
292 Reported by Stavros Passas.
295 * sha1.c: Tweak grammar in a comment.
297 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
299 * regex_internal.h (BITSET_WORD_BITS):
300 Work around a bug in 64-bit PGC (before version 6.1-2), where the
301 preprocessor mishandles large unsigned values as if they were signed.
302 Problem reported by Claudio Fontana in
303 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
305 2006-01-10 Simon Josefsson <jas@extundo.com>
307 * socket_.h: New file.
309 2006-01-10 Bruno Haible <bruno@clisp.org>
311 * localcharset.c: Update from GNU gettext.
313 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
316 * chdir-long.c (cdb_free): Don't bother trying to open directory
317 for write access: POSIX says that must fail.
318 * fts.c (diropen): Likewise.
319 * save-cwd.c (save_cwd): Likewise.
320 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
321 well, for minor improvements on hosts that lack O_DIRECTORY.
322 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
323 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
324 Fall back on chown if open failed with EACCES.
326 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
327 Report an error at compile-time if only a 1-second nominal clock
330 * lchmod.h: New file.
331 * mkdir-p.c: Include lchmod.h, lchown.h.
332 (make_dir_parents): Use lchown rather than chown, and
333 lchmod rather than chmod.
335 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
336 too. Problem with "none" reported by Bob Proulx. Problem with
337 "proc" reported by n0dalus.
339 * mountlist.c: Include <limits.h>.
340 (dev_from_mount_options)
341 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
342 New function. It no longer assumes "dev=" has the System V meaning
343 on Linux (since it doesn't). It also parses "dev=" more carefully.
344 (read_file_system_list)
345 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
346 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
349 * posixtm.h (PDS_PRE_2000): New macro.
350 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
351 All usages changed. Reject dates outside the range 1969-1999 if
352 PDS_PRE_2000 is used.
354 2006-01-09 Jim Meyering <jim@meyering.net>
358 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
360 * chdir-safer.h, chdir-safer.c: New files.
362 * modechange.c (mode_compile): Reject an invalid mode string
363 that starts with an octal digit. From Andreas Gruenbacher.
365 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
366 and dup to open_safer and dup_safer, respectively.
367 (openat_permissive): Fix typo in comment.
369 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
370 "gettext.h"; either no longer needed or are guaranteed by openat.h.
371 (_): Remove; no longer needed.
372 (openat): Renamed from rpl_openat; no need for rpl_openat
373 since openat.h renames openat for us.
374 Replace most of the body with a call to openat_permissive,
375 to avoid duplicate code.
376 Port to (probably hypothetical) environments were mode_t is
378 (openat_permissive): Require mode arg, so that we can check
379 types better. Put it just after flags. Change cwd failure
380 indicator from pointer-to-bool to pointer-to-errno-value.
382 Invoke openat_save_fail and/or openat_restore_fail if
383 cwd_errno is null, so that openat can call us.
384 (openat_permissive, fdopendir, fstatat, unlinkat):
385 Simplify errno handling to avoid some duplicate code,
386 as it's OK to set errno on success.
387 * openat.h: Revamp code so that function macros depend on
388 __OPENAT_PREFIX only, not also on AT_FDCWD.
389 (openat_ro): Remove. Caller changed to use openat_permissive.
390 (openat_permissive): Now a macro, if not a function.
391 (openat_restore_fail, openat_save_fail): Now always functions,
392 since mkdirat needs them even if __OPENAT_PREFIX is defined.
394 * openat-priv.h: New file, defining macros used by mkdirat.c
396 * mkdirat.c: Include openat-priv.h.
397 Remove definitions of macros defined therein.
398 * openat.c: Likewise.
400 * mkdirat.c (mkdirat): New file and function.
401 * openat.h (mkdirat): Declare.
403 * openat.c (fdopendir): Don't change errno when returning non-NULL.
405 * openat.h (openat_permissive): Declare.
408 * openat.c (EXPECTED_ERRNO): New macro.
409 (openat_permissive): New function -- used in remove.c rewrite.
410 (all functions): Set errno just before returning, only if there
411 was an actual failure.
412 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
414 Emulate openat-family functions using Linux's procfs, if possible.
415 Idea and some code based on Ulrich Drepper's glibc changes.
417 * openat.c: (BUILD_PROC_NAME): New macro.
418 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
419 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
420 before falling back on save_cwd and restore_cwd.
421 (fdopendir, fstatat, unlinkat): Likewise.
423 * openat.c (fstatat, unlinkat): Perform the syscall directly,
424 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
426 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
427 as second argument to va_arg. Otherwise, some versions of gcc
428 warn that `if this code is reached, the program will abort'.
430 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
434 Add POSIX ACL support
435 * acl.h (copy_acl, set_acl): Add declarations.
436 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
437 systems other than Linux.
438 (chmod_or_fchmod): New function: use fchmod when possible,
440 (file_has_acl): Add a POSIX ACL implementation, with a
441 Linux-specific subcase.
442 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
443 S_ISVTX from one file to another. Fall back to fchmod/chmod when
444 acls are unsupported.
445 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
446 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
449 2006-01-09 Bruno Haible <bruno@clisp.org>
451 * sysexit_.h (EX_OK): New macro.
452 Suggested by Martin Lambers <marlam@marlam.de>.
454 2006-01-09 Bruno Haible <bruno@clisp.org>
456 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
457 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
458 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
459 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
461 2006-01-09 Bruno Haible <bruno@clisp.org>
463 * stdint_.h (SIZE_MAX): Write the value without involving negative
466 2005-10-16 Bruno Haible <bruno@clisp.org>
468 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
469 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
471 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
473 * strftime.c (tzname): Don't declare if it is already #defined.
474 Problem reported for Mingw by Mark Junker.
476 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
478 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
479 long int, not int, for nanosecond counts, so that people who are
480 used to POSIX struct timespec won't be surprised. Reported by Jim
483 2005-12-16 Jim Meyering <jim@meyering.net>
485 * fprintftime.c, fprintftime.h: New files.
487 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
489 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
490 * argp-help.c (fill_in_uparams): Check if the constructed
491 struct uparams is valid. Fall back to the default values if it is
494 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
496 * argp-help.c (__argp_base_name): New function
497 (__argp_short_program_name): Rewrite using __argp_base_name
498 * argp-namefrob.h: Define program_invocation_name and
499 program_invocation_short_name if requested
500 (__argp_base_name): Add prototype
501 * argp-parse.c (argp_def): Use gettext wrappers
502 (argp_default_parser): Use __argp_base_name
503 * argp-pin.c: New file. Defines program_invocation_name and
504 program_invocation_short_name on systems that lack them.
506 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
508 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
509 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
510 porting problem reported by Georg Schwarz in
511 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
513 2005-07-09 Bruno Haible <bruno@clisp.org>
515 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
516 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
517 Reported by Mark Junker <mjscod@gmx.de>.
519 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
521 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
522 (uintmax_t) [defined uintmax_t]: Do not declare.
523 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
524 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
525 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
526 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
527 sake of portability to weird hosts that C allows (though we don't
528 know of any practical examples).
530 * savedir.h (fdsavedir): New decl.
531 * savedir.c (fdsavedir, savedirstream): New functions; the latter
532 contains most of the former guts of savedir.
533 (savedir): Use savedirstream.
536 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
538 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
539 coreutils no longer futzes with rounding modes.
541 2005-11-14 Jim Meyering <jim@meyering.net>
543 * mkstemp-safer.c: Include <config.h>, required for possible
544 replacement of mkstemp.
546 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
548 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
550 (gethrxtime) [! (HAVE_NANOUPTIME
551 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
552 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
553 our own approximation.
555 2005-11-10 Simon Josefsson <jas@extundo.com>
557 * readline.c: Remove EOL.
559 2005-11-08 Eric Blake <ebb9@byu.net>
561 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
563 2005-11-08 Eric Blake <ebb9@byu.net>
565 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
567 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
569 Fix porting problem reported by Theodoros V. Kalamatianos.
570 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
571 Don't assume that futimes failing means we must fail.
573 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
575 * getcwd.c (__getcwd): Don't assume that system calls after readdir
576 leave errno alone. Problem reported by Dmitry V. Levin.
578 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
580 * savedir.c (savedir): Don't assume that xrealloc etc. leave
581 errno alone. Problem reported by Frederic Jolliton.
583 2005-10-28 Simon Josefsson <jas@extundo.com>
585 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
586 "restrict" keywords, as per POSIX. Protect the function
587 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
588 Don't use K&R prototypes. Check the sprintf return values.
589 Re-define EAFNOSUPPORT if not present. Indent.
591 * md5.h, md5.c: Simplify buffer handling visavi alignment,
592 suggested by Bruno Haible <bruno@clisp.org>.
594 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
596 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
598 * gc-libgcrypt.c: Add MD2 (which is not available through
601 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
603 * md2.h, md2.c: New files.
605 2005-10-24 Simon Josefsson <jas@extundo.com>
607 * md4.h: Shrink buffer size, now that we changed the type.
609 2005-10-22 Simon Josefsson <jas@extundo.com>
611 * arcfour.h, arcfour.c: Use fixed size indices in the
612 arcfour_context struct (simplify test vector testing in GNU
615 2005-10-22 Simon Josefsson <jas@extundo.com>
617 * md4.h, md4.c: Simplify buffer handling visavi alignment,
618 suggested by Bruno Haible <bruno@clisp.org>.
620 2005-10-22 Simon Josefsson <jas@extundo.com>
622 * crc.h: Include stddef.h, for size_t.
624 2005-10-21 Simon Josefsson <jas@extundo.com>
626 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
627 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
629 2005-10-21 Simon Josefsson <jas@extundo.com>
631 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
634 2005-10-21 Simon Josefsson <jas@extundo.com>
636 * gc-gnulib.c: Support ARCTWO in CBC mode.
638 2005-10-21 Simon Josefsson <jas@extundo.com>
640 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
643 * hmac-sha1.c (hmac_sha1): Likewise.
645 * crc.c (crc32_update): Actually use crc parameter, suggested by
646 Bruno Haible <bruno@clisp.org>.
648 * crc.h: Include stdint.h directly, suggested by Bruno Haible
651 2005-10-21 Simon Josefsson <jas@extundo.com>
653 * des.h, des.c: New files.
655 * gc-gnulib.c: Support DES.c
657 2005-10-21 Simon Josefsson <jas@extundo.com>
659 * arctwo.h, arctwo.c: New files.
661 * gc-gnulib.c: Support ARCTWO.
663 2005-10-21 Simon Josefsson <jas@extundo.com>
665 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
667 2005-10-19 Simon Josefsson <jas@extundo.com>
669 * gc-gnulib.c: Support ARCFOUR.
671 2005-10-19 Simon Josefsson <jas@extundo.com>
673 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
676 * gc.h: Add ECB enum type.
678 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
680 2005-10-19 Simon Josefsson <jas@extundo.com>
682 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
684 2005-10-18 Simon Josefsson <jas@extundo.com>
686 * md4.h, md4.c: New files, based on md5.?.
688 2005-10-17 Simon Josefsson <jas@extundo.com>
690 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
692 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
694 2005-10-17 Simon Josefsson <jas@extundo.com>
696 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
698 2005-10-17 Simon Josefsson <jas@extundo.com>
700 * gc.h, gc-libgcrypt.c: Add ciphers.
702 2005-10-17 Simon Josefsson <jas@extundo.com>
704 * sha1.c: Use uint32_t instead of md5_uint32.t
706 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
709 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
711 * md5.h: Use stdint.h and uint32_t. Doc fix.
713 2005-10-15 Simon Josefsson <jas@extundo.com>
715 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
717 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
719 2005-10-14 Simon Josefsson <jas@extundo.com>
721 * arcfour.h, arcfour.c: New files.
723 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
725 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
726 include <wchar.h>; no longer needed.
728 2005-10-14 Jakub Jelinek <jakub@redhat.com>
729 and Ulrich Drepper <drepper@redhat.com>
732 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
733 instead of inline stream orientation test and two separate
734 function calls. Pay no attention to USE_IN_LIBIO.
736 2005-10-14 Roland McGrath <roland@redhat.com>
738 Import from libc. [BZ #1331]
739 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
741 Reported by Matej Vela <vela@debian.org>.
743 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
745 * mkdir-p.c (make_dir_parents): Don't report an error if an
746 intermediate directory is in a read-only file system. Problem
747 reported by Eric Blake.
749 2005-10-13 Simon Josefsson <jas@extundo.com>
751 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
752 Move memory allocation outside of loop.
754 2005-10-12 Simon Josefsson <jas@extundo.com>
756 * gc-pbkdf2-sha1.c: New file.
758 * gc.h: Add gc_pbkdf2_sha1 prototype.
760 2005-10-12 Simon Josefsson <jas@extundo.com>
762 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
763 suggested by Bruno Haible <bruno@clisp.org>.
765 2005-10-12 Simon Josefsson <jas@extundo.com>
767 * gc-libgcrypt.c (gc_hmac_sha1): New function.
769 * gc-gnulib.c (gc_hmac_sha1): New function.
771 2005-10-12 Simon Josefsson <jas@extundo.com>
773 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
775 2005-10-12 Simon Josefsson <jas@extundo.com>
777 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
778 GC_USE_HMAC_MD5, respectively.
780 * gc-libgcrypt.c (gc_md5): Fix assert call.
783 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
785 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
787 * gc-gnulib.c (gc_hash_buffer): Ditto.
789 2005-10-11 Bruno Haible <bruno@clisp.org>
791 * c-strcasestr.h: New file, from GNU gettext.
792 * c-strcasestr.c: New file, from GNU gettext.
794 2005-10-11 Bruno Haible <bruno@clisp.org>
796 * c-strcase.h: New file, from GNU gettext.
797 * c-strcasecmp.c: New file, from GNU gettext.
798 * c-strncasecmp.c: New file, from GNU gettext.
800 2005-10-11 Simon Josefsson <jas@extundo.com>
802 * crc.h, crc.c: New files.
804 * gc.h (gc_hash_buffer): Add doc.
806 2005-10-08 Simon Josefsson <jas@extundo.com>
808 * gc.h: Add gc_hash and gc_hash_buffer.
810 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
812 * gc-libgcrypt.c (gc_hash_buffer): Add.
814 2005-10-11 Bruno Haible <bruno@clisp.org>
816 * strcasecmp.c: Include limits.h.
817 (strcasecmp): Avoid integer overflow on exotic platforms.
818 * strncasecmp.c: Include limits.h.
819 (strncasecmp): Avoid integer overflow on exotic platforms.
820 Reported by Paul Eggert.
822 2005-10-06 Simon Josefsson <jas@extundo.com>
824 * hmac-md5.c: New file.
828 2005-10-06 Simon Josefsson <jas@extundo.com>
830 * memxor.c (memxor): Avoid casts and warnings.
832 2005-10-05 Derek Price <derek@ximbiot.com>
834 * getdelim.c (SIZE_MAX): New macro, if not already defined.
836 2005-10-05 Simon Josefsson <jas@extundo.com>
838 * memxor.c (memxor): Fix compiler error.
840 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
841 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
843 * memxor.h, memxor.c: New files.
845 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
846 we assume all systems have it, suggested by Jim Meyering
847 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
848 any systems lack sys/socket.h; mingw32 is known to lack it, but we
849 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
852 2005-10-04 Bruno Haible <bruno@clisp.org>
854 * verify.h (verify_true): Provide alternative definition for C++.
856 2005-10-04 Simon Josefsson <jas@extundo.com>
858 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
859 D. Baushke" <mdb@gnu.org>.
861 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
863 * getdelim.c: Include getdelim.h first. Include <limits.h>.
864 (SSIZE_MAX): New macro, if not already defined.
865 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
868 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
870 * exclude.c: Include verify.h.
871 (verify): Remove. All callers changed to use verify.h's version.
872 * strtoimax.c: Likewise.
873 * utimecmp.c: Likewis.e
876 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
877 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
878 * .cvsignore: Add fts.h, search.h, t-fpending.
879 * settime.c (settime): Fix { typo in previous patch. Also, don't
880 bother returning ENOSYS if settimeofday or stime fails; just let
881 them return whatever errno they want to return.
882 * utimens.c: Include unistd.h, for dup2.
883 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
884 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
886 2005-10-02 Jim Meyering <jim@meyering.net>
889 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
890 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
891 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
892 Remove AT_FDCWD test.
893 Do not consume the fd unless successful.
894 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
895 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
896 block, so that we don't even try to compile it if settimeofday is
897 available. This works around a compilation failure on OSF1 V5.1,
898 due to stime requiring a `long int*' while tv_sec is `int'.
900 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
902 * getdelim.c (getdelim): Remove unused variables.
904 2005-10-01 Simon Josefsson <jas@extundo.com>
906 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
907 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
908 AI_* and EAI_* definitions. Protect function declarations.
910 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
912 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
913 so that the code works even with ancient cpp. Portability problem
914 with GCC 2.7.2.1 reported by Thomas M.Ott.
916 2005-09-27 Jim Meyering <jim@meyering.net>
918 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
920 * intprops.h (signed_type_or_expr__): Define.
921 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
924 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
926 * verify.h (verify_expr): Remove, replacing with:
927 (verify_true): New macro that returns true instead of void.
928 (verify_type__): Remove.
929 (verify): Use verify_true rather than verify_type__.
931 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
933 * utimens.c (ENOSYS): Define if not already defined.
934 (futimens): Support having a null PATH if the file descriptor
937 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
939 (__attribute): Define to empty unless GCC 3.1 or later.
940 This works around a core dump on OpenBSD 3.4, which has GCC
941 2.95.3, which dumps core when given __attribute__(()). It also
942 simplifies other tests, since we really don't want to bother with
943 worrying about which ancient version of GCC supported what.
944 Original problem reported by Yoann Vandoorselaere, with part of
945 the fix suggested by Derek Price.
947 2005-09-24 Jim Meyering <jim@meyering.net>
949 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
950 so we can once again use a positive bitfield width of 1 -- now we
951 don't have to explain why we were using a bitfield width of 2.
953 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
955 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
956 Problem reported by Eric Blake.
957 (getaddrinfo): Initialize se so that it's not garbage.
958 Redo internal storage allocation so that it doesn't make unportable
959 assumptions about alignment.
962 * utimens.c (futimens): Use futimesat if available.
963 Prefer it to futimes since it doesn't have the futimes bug.
965 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
966 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
967 Instead, declare a function that returns a pointer to an array,
968 and use verify_type__ to declare the size of the array.
969 Problem and germ of a solution reported by Bruno Haible.
970 (verify_type__): Use 2, not 1, for bitfield size, to avoid
971 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
973 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
977 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
979 * argmatch.h: Include verify.h
980 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
981 (ARGMATCH_ASSERT): Remove; unused.
982 * canonicalize.c: Assume STDC_HEADERS.
983 * exclude.c: Include "strcase.h".
984 * regex_internal.h [!defined _LIBC]: Likewise.
985 * getusershell.c: Include stdio--.h rather than stdio.h
987 (getusershell): Call fopen, not fopen_safer.
988 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
989 Do not include unistd-safer.h.
990 (save_cwd): Don't call fd_safer; no longer needed
991 now that we include fcntl--.h.
993 * getdate.y (relative_time): New type.
994 (RELATIVE_TIME_0): New constant.
995 (parser_control): Use relative_time instead of doing it ourselves.
996 (%union): Add new relative_time rel member.
997 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
999 (relunit, relunit_snumber): Now of type rel.
1000 (zone, rel, relunit, get_date): Adjust to above changes.
1002 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
1003 Do not include unistd-safer.h.
1004 (getloadavg): Don't call fd_safer; no longer needed
1005 now that we include fcntl--.h.
1007 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
1008 (make_dir_parents): Treat ENOSYS like EEXIST.
1010 Improve quality of diagnostics on restore_cwd failure.
1011 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
1012 (make_dir_parents): Last arg is now int * (for errno), not bool *.
1013 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
1014 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
1015 each time through the loop. Do not diagnose restore_cwd failure;
1016 that is the caller's job (and perhaps the caller does not care).
1018 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
1019 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
1020 If the file already exists but is not a directory, don't bother
1021 to try to make its parents.
1022 Close potential file descriptor leak if we can't chdir("/") (!).
1023 Don't always return true if chdir($PWD) fails; return true only
1024 if the requested action was done successfully (except for the
1026 Don't log final directory unless we actually made it.
1027 Refactor to avoid duplicate code to fix up permissions.
1028 Don't attempt to fix up parent permissions if chdir($PWD) fails.
1030 * strftime.c (my_strftime): Rewrite the previous change slightly,
1031 to make it a bit faster and (I hope) clearer.
1032 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
1033 Fix bug in formats like %2N.
1035 * verify.h: New file.
1037 2005-09-22 Jim Meyering <jim@meyering.net>
1039 Sync from coreutils.
1041 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
1043 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
1044 the .tm_year member, since otherwise gcc-4.0 would now warn about
1045 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
1047 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
1048 order to avoid an unsuppressible warning from gcc on 64-bit systems.
1050 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
1051 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
1052 when run in a time zone for which daylight savings time is in effect
1053 for the starting date.
1055 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
1056 stop us from restricting permissions of just-created absolute-named
1058 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
1059 to restore initial working directory.
1060 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
1061 to tell caller if/when we change the working directory and are
1062 unable to return to the initial one.
1063 * mkdir-p.h (make_dir_parents): Update prototype.
1064 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
1065 `return false'. This fixes a bug introduced on 2004-07-30.
1067 * openat.c (fdopendir): Be sure to close the supplied
1068 file descriptor before returning. This makes our replacement
1069 implementation a little closer to Solaris's, where fdopendir
1070 ties the file descriptor to the returned DIR* pointer.
1071 * openat.c (unlinkat): New function.
1072 * openat.h (unlinkat): Add prototype.
1073 * openat-die.c (openat_save_fail): Rename from openat_save_die.
1074 (openat_restore_fail): Rename from openat_restore_die.
1075 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
1077 Provide an alternative to exiting immediately upon save_cwd or
1078 restore_cwd failure. Now, an application can arrange e.g.,
1079 to perform a longjump in that case.
1080 * openat.c: Include dirname.h.
1081 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
1082 (rpl_openat, fdopendir, fstatat): Call openat_save_die
1083 and openat_restore_die rather than calling error directly.
1084 Don't include "error.h" or "exitfail.h"; they're no longer needed.
1086 * openat-die.c (openat_save_die, openat_restore_die): New file.
1087 * openat.h (openat_save_die, openat_restore_die): Declare and define.
1089 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
1090 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
1091 int utc, int nanoseconds);
1093 date should not have to allocate a megabyte of virtual memory to
1094 handle a format argument like +%1048575T. When implemented with
1095 strftime, it must allocate such a buffer, use strftime to fill it
1096 in, print it, then free it.
1097 With fprintftime, it simply prints everything and exits.
1098 With no need for memory allocation, that's one fewer way to fail.
1099 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
1100 optional field width, not before, so we accept %9:z, not %:9z.
1101 (my_strftime): Be sure to use L_('x') for literals.
1103 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
1104 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
1105 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
1106 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
1107 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
1108 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
1109 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
1110 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
1111 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
1113 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1114 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
1115 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1116 and don't include <sys/file.h>).
1118 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
1120 Sync from coreutils.
1122 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
1123 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
1124 [!LDAV_DONE]: Avoid unused variable warning.
1126 2005-09-21 Bruno Haible <bruno@clisp.org>
1128 * unicodeio.h (unicode_to_mb): New declaration.
1130 2005-09-20 Derek Price <derek@ximbiot.com>
1132 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
1134 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1136 Use a consistent style for including <config.h>.
1137 * __fpending.c, acl.c, argmatch.c,
1138 argp-help.c, argp-parse.c,
1139 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
1140 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
1141 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
1142 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
1143 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
1144 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
1145 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
1146 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
1147 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
1148 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
1149 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
1150 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
1151 modechange.c, mountlist.c, open-safer.c, physmem.c,
1152 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
1153 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
1154 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
1155 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
1156 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
1157 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
1158 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
1159 userspec.c, utimecmp.c, version-etc-fsf.c,
1160 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
1161 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
1162 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
1163 Standardize inclusion of config.h.
1164 * __fpending.h, dirfd.h, getdate.h, human.h,
1165 inttostr.h: Removed inclusion of config.h from header files.
1166 * inttostr.c: Adjusted in-tree users.
1167 * timespec.h: Remove superfluous warning to include config.h.
1168 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
1169 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
1170 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
1171 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
1173 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
1175 * stat-time.h: New file.
1176 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
1177 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
1179 (timespec_cmp): New function.
1180 * utimecmp.c: Include stat-time.h.
1181 (SYSCALL_RESOLUTION): Depend on whether various struct stat
1182 members exist, not on the obsolescent ST_MTIM_NSEC.
1183 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
1185 2005-09-15 Derek Price <derek@ximbiot.com>
1186 Paul Eggert <eggert@cs.ucla.edu>
1188 * regcomp.c, regexec.c, regex_internal.c: Back out previous
1189 changes, consolidating in...
1190 * regex_internal.h: ...this file.
1192 2005-09-15 Derek Price <derek@ximbiot.com>
1194 * regex_internal.h: Blank `pure' for GNUC < 3.
1195 * regex_internal.c: Ditto, using this...
1196 (__GNUC_PREREQ): ...new macro.
1197 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
1198 (__GNUC_PREREQ): ...this new macro.
1200 * strstr.h: Include string.h. Define strstr as a macro here.
1202 2005-09-13 Derek Price <derek@ximbiot.com>
1204 * canon-host.c (canon_host_r): Set *cherror on memory allocation
1206 Reported by Jim Meyering <jim@meyering.net>.
1208 2005-09-13 Jim Meyering <jim@meyering.net>
1210 * canon-host.c: Filter through gnu indent and reword comments slightly.
1211 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
1213 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1215 * lib/base64.c: Typo.
1216 (base64_encode): Put b64str in initialized data section.
1218 2005-09-12 Derek Price <derek@ximbiot.com>
1220 Return usable errors from canon-host.
1221 * canon-host.h: New file.
1222 * canon-host.c (canon_host): Wrap...
1223 (canon_host_r): ...this new function, which now relies exclusively on
1225 (ch_strerror): New function.
1226 (last_cherror): New global.
1227 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
1228 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
1230 (freeaddrinfo): Free ai->ai_canonname when set.
1232 2005-09-12 Derek Price <derek@ximbiot.com>
1233 Paul Eggert <eggert@cs.ucla.edu>
1235 * glob-libc.h: Renamed from glob_.h. The new version is
1236 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
1237 protecting things that should be done only in gnulib contexts.
1238 * glob_.h: New file, containing only the glob things needed for
1240 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
1241 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
1242 (glob, globfree, glob_pattern_p): Now defined simply in terms of
1243 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
1244 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
1245 and to respect the namespace rules better.
1247 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
1249 Merge glibc and coreutils changes into gnulib, plus a few
1251 * md5.c: Use #error rather than a string.
1252 (CYCLIC): New macro, from glibc source. Use it instead of rol.
1253 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
1254 (__attribute__): Define to empty for non recent-GCC.
1255 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
1256 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
1257 Renamed from their non-__ counterparts, with new macros replacing
1258 them if not _LIBC. Add __THROW attribute.
1260 (struct md5_ctx): Align buffer if using GCC.
1261 * sha1.h (struct sha1_ctx): Likewise.
1262 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
1263 The old name was backwards.
1264 (NOTSWAP): Remove; not used.
1265 (rol): New macro, moved here from md5.h.
1266 (sha1_process_block): Remove a FIXME that doesn't make sense.
1268 2005-09-12 Derek Price <derek@ximbiot.com>
1270 * gai_strerror.c: Include config.h when available. Include
1271 getaddrinfo.h before other headers to test interface.
1272 Reported by Larry Jones <lawrence.jones@ugs.com>.
1274 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
1276 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
1277 definitions, since that's the preferred style in glibc.
1278 Fix a minor spacing issue, and update copyright notice to match glibc's.
1280 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1282 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
1284 2005-09-06 Simon Josefsson <jas@extundo.com>
1286 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
1287 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
1289 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
1291 Change bitset word type from unsigned int to unsigned long int,
1292 as this has better performance on typical 64-bit hosts.
1293 Port bitset code to hosts with unusual word sizes.
1294 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
1295 (build_collating_symbol):
1296 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
1297 argument is a bitset. This is merely a style issue, but it makes
1298 it clearer that an entire array is expected.
1299 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
1300 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
1301 Port to the case where bitset_word is not the same as unsigned int.
1302 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
1303 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
1305 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1306 (build_trtable, group_nodes_into_DFAstates):
1308 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
1309 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
1310 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
1311 * regexec.c (group_nodes_into_DFAstates): Likewise.
1312 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
1313 * regcomp.c (optimize_subexps, lower_subexp):
1314 Work even if bitset_word has holes in its bitwise representation.
1315 * regex_internal.h (BITSET_WORD_BITS): Likewise.
1316 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1318 * regex_internal.c (re_string_reconstruct):
1319 Don't assume UCHAR_MAX == 255.
1320 * regex_internal.h (bitset_set_all): Likewise.
1321 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
1323 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
1324 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
1326 (BITSET_WORD_MAX): New macro.
1327 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
1328 (bitset_set_all, bitset_copy): Now inline functions, not macros.
1329 (bitset_empty, bitset_copy):
1330 Prefer sizeof (bitset) to multiplying it out ourselves.
1331 (bitset_not_merge): Remove; unused.
1332 (bitset_contain): Return bool, not unsigned int with one bit on.
1333 All callers changed.
1334 * regexec.c (build_trtable): Don't assume bitset has no stricter
1335 alignment than re_node_set; do this by defining a new internal
1336 type struct dests_alloc and using it to allocate memory.
1338 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
1340 Check for arithmetic overflow when calculating sizes, to prevent
1341 some buffer-overflow issues. These patches are conservative, in the
1342 sense that when I couldn't determine whether an overflow was possible,
1343 I inserted a run-time check.
1344 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
1345 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
1346 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
1347 (re_xnrealloc, re_x2nrealloc): New inline functions.
1348 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
1349 (build_equiv_class, build_charclass): Check for arithmetic overflow
1350 in size expression calculations.
1351 * lib/regex_internal.c (re_string_realloc_buffers):
1352 (build_wcs_upper_buffer, re_node_set_add_intersect):
1353 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
1354 (re_dfa_add_node, register_state): Likewise.
1355 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
1356 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
1357 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
1358 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
1360 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
1362 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
1363 to avoid a collision with bits/local_lim.h in glibc.
1364 All uses changed. Problem reported by Dmitry V. Levin in
1365 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
1367 * regex_internal.c (build_wcs_upper_buffer): Fix portability
1368 bugs in int versus size_t comparisons.
1369 (re_string_context_at): Fix bug where the code assumed that
1372 Use bool where appropriate.
1373 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
1374 All callers changed.
1375 (calc_eclosure_iter): Likewise, for ROOT arg.
1376 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
1377 (build_charclass_op): Likewise, for NON_MATCH arg.
1378 * regex_internal.c (re_string_allocate, re_string_construct):
1379 (re_string_construct_common): Likewise, for ICASE arg.
1380 * regexec.c (re_search_2_stub, re_search_stub):
1381 Likewise, for RET_LEN arg.
1382 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
1383 (set_regs): Likewise, for FL_BACKTRACK arg.
1384 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
1385 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
1386 (calc_eclosure_iter, parse_bracket_exp):
1387 Use bool for internal variables that are booleans.
1388 * regexec.c (re_search_internal, check_matching, proceed_next_node):
1389 (set_regs, build_sifted_states, sift_states_bkref):
1390 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
1391 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1392 (find_collation_sequence_value):
1394 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
1395 (re_node_set_compare):
1396 Return bool, not int. All callers changed.
1397 * regexec.c (check_halt_node_context, check_dst_limits):
1398 (build_trtable, check_node_accept): Likewise.
1399 * regex_internal.h: Include stdbool.h.
1401 Fix bugs uncovered when converting to bool.
1402 * regcomp.c (calc_eclosure_iter): Check for storage allocation
1403 failure instead of charging ahead blindly.
1404 * regex_internal.c (register_state): Likewise.
1405 * regexec.c (re_search_2_stub): Use simpler method than boolean
1406 for freeing internal storage.
1407 (group_nodes_into_DFA_states): Use unsigned int, not int, for
1408 bitset pieces used as boolean, to avoid undefined behavior
1409 on hosts that do int overflow checking.
1411 2005-08-31 Derek Price <derek@ximbiot.com>
1413 * getdelim.c (getdelim): Return EOF on EOF.
1414 Reported by Larry Jones <lawrence.jones@ugs.com>.
1416 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
1418 * regex_internal.c (re_string_reconstruct): Don't assume buffer
1419 lengths fit in regoff_t; this isn't true if regoff_t is the same
1421 * regex.c (re_search_internal): 5th arg is LAST_START
1422 (= START + RANGE) instead of RANGE. This avoids overflow
1423 problems when regoff_t is the same width as size_t.
1424 All callers changed.
1425 (re_search_2_stub): Check for overflow when adding the
1426 sizes of the two strings.
1427 (re_search_stub): Check for overflow when adding START
1428 to RANGE; if it occurs, substitute the extreme value.
1430 2005-08-31 Jim Meyering <jim@meyering.net>
1432 * regcomp.c (search_duplicated_node): Make first pointer arg
1434 * regex_internal.c (create_ci_newstate, create_cd_newstate):
1435 (register_state): Likewise.
1436 * regexec.c (search_cur_bkref_entry, check_dst_limits):
1437 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
1438 (group_nodes_into_DFAstates): Likewise.
1440 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
1442 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
1443 old glibc regex code mishandles strings longer than 2**31 bytes.
1444 This patch fixes this when the regex code is used in gnulib
1445 (i.e., outside glibc).
1447 This patch should not affect the use of the regex code inside
1448 glibc. No doubt this problem also needs to be handled for glibc
1449 as well, but the result will be an incompatible change to the
1450 glibc ABI, and the old ABI will have to be supported too. That
1451 can be the the subject for another patch.
1453 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
1454 governing whether the rest of this patch is active. By default,
1455 the macro is disabled and the patch has no effect.
1456 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
1457 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
1458 (struct re_pattern_buffer, re_search, re_search_2, re_match):
1459 (re_match_2, re_set_registers): Use the new types.
1460 * regex_internal.h (Idx, re_hashval_t): New types.
1461 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
1463 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
1464 (re_string_context_at, bin_tree_t, re_dfastate_t):
1465 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
1466 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
1467 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
1468 (re_string_char_size_at, re_string_wchar_at):
1469 (re_string_elem_size_at):
1470 Use the new types and macros to port to 64-bit hosts.
1471 Use unsigned types for internal values, so that the code
1472 mostly works even for arrays larger than SSIZE_MAX.
1473 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
1474 (search_duplicated_node, calc_eclosure_iter, fetch_number):
1475 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
1476 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
1477 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
1478 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
1479 (calc_inveclosure, parse_dup_op, build_range_exp):
1480 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
1481 (fetch_number, create_token_tree, mark_opt_subexp):
1483 * regex_internal.c (re_string_construct_common, create_ci_newstate):
1484 (create_cd_newstate, re_string_allocate, re_string_construct):
1485 (re_string_realloc_buffers, build_wcs_upper_buffer):
1486 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1487 (re_string_reconstruct, re_string_peek_byte_case):
1488 (re_string_fetch_byte_case, re_string_context_at):
1489 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1490 (re_node_set_init_copy, re_node_set_add_intersect):
1491 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1492 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1493 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1494 (re_acquire_state, re_acquire_state_context, register_state):
1496 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
1497 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
1498 (re_search_internal, re_search_2_stub, re_search_stub)
1499 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
1500 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
1501 (update_cur_sifted_state, check_dst_limits):
1502 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
1503 (check_subexp_limits, sift_states_bkref, merge_state_array):
1504 (check_subexp_matching_top, get_subexp, get_subexp_sub):
1505 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
1506 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1507 (expand_bkref_cache, check_node_accept_bytes):
1508 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
1509 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
1510 (acquire_init_state_context, check_halt_node_context):
1511 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
1512 (sift_states_backward, clean_state_log_if_needed):
1513 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
1514 (find_recover_state, transit_state_sb, transit_state_mb):
1515 (transit_state_bkref, build_trtable, match_ctx_clean):
1517 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
1518 to work around an assumption that REG_MISSING is negative.
1520 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
1521 (seek_collating_symbol_entry) [defined _LIBC]:
1522 (lookup_collation_sequence_value) [defined _LIBC]:
1523 (build_range_exp, build_collating_symbol) [defined _LIBC]:
1524 Use prototypes rather than old-style function definitions.
1525 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
1526 (transit_state_sb) [0]:
1527 (find_collation_sequence_value) [defined _LIBC]: Likewise.
1529 * regexec.c (re_search_internal): Simplify update of rm_so and
1532 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
1533 (optimize_subexps, lower_subexp):
1534 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
1535 since the signed shift might overflow. Use 1u<<31 instead.
1536 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
1537 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
1540 * regcomp.c (optimize_subexps, lower_subexp):
1541 Use CHAR_BIT rather than 8, for clarity.
1542 * regexec.c (check_dst_limits_calc_pos_1):
1543 (check_subexp_matching_top): Likewise.
1544 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
1545 have to worry about portability issues when shifting it left.
1546 Remove no-longer-needed test for table_size > 0.
1547 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
1548 in a word, as the resulting behavior is undefined.
1549 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
1550 in one case, a <= should have been an <, and in another case the
1551 whole test was missing.
1552 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
1553 the standard name CHAR_BIT.
1554 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
1555 this is not true on one's complement and signed-magnitude hosts.
1557 * regex_internal.h (re_sub_match_top_t): Remove unused member
1559 (struct re_dfa_t): Remove unused member states_alloc.
1560 * regcomp.c (init_dfa): Don't initialize unused members.
1562 2005-08-31 Bruno Haible <bruno@clisp.org>
1564 * strstr.c: Include <stddef.h>, for NULL.
1565 * strcasestr.c: Likewise.
1566 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
1568 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
1570 * iconvme.h: Add prototype for iconv_alloc.
1572 2005-08-29 Simon Josefsson <jas@extundo.com>
1574 * iconvme.c: Fix errno.
1576 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
1578 * iconvme.c: Split iconv_string into iconv_alloc.
1580 2005-08-27 Jim Meyering <jim@meyering.net>
1582 * fopen-safer.c: Merge minor changes from coreutils.
1583 * dup-safer.c: Likewise.
1584 * fd-safer.c: Likewise.
1586 Merge from coreutils.
1587 * stdio--.h: New file.
1588 * stdlib--.h: New file.
1589 * mkstemp-safer.c: New file.
1591 GNU tar needs these.
1592 * pipe-safer.c: New file.
1593 * creat-safer.c: New file.
1594 * fcntl--.h (creat): Define to creat_safer.
1595 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
1596 * unistd--.h (pipe): Define to pipe_safer.
1597 * unistd-safer.h: Declare pipe_safer.
1599 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
1601 * regex_internal.h: Remove all references to
1602 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
1604 (bitset_not, bitset_merge, bitset_not_merge):
1605 (bitset_mask, re_string_allocate, re_string_construct):
1606 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
1607 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
1608 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
1609 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
1610 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1611 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1612 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
1613 (re_acquire_state_context):
1614 Remove unnecessary forward decls.
1615 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
1616 Put __attribute at function definition,
1617 now that the function decl has been removed.
1618 * lib/regex_internal.c (re_string_peek_byte_case):
1619 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
1622 2005-08-26 Simon Josefsson <jas@extundo.com>
1624 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
1625 Haible <bruno@clisp.org>.
1627 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1629 * regexec.c (set_regs): Don't alloca with an unbounded size.
1631 alloca modernization/simplification for regex.
1632 * regex.c: Remove portability cruft for alloca. This no longer
1633 needs to be at the start of the file, and can be moved into
1634 regex_internal.h and simplified.
1635 * regex_internal.h: Include <alloca.h>.
1636 (__libc_use_alloca) [!defined _LIBC]: New macro.
1637 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
1638 now works outside glibc.
1640 2005-08-24 Simon Josefsson <jas@extundo.com>
1642 * getpass.c: Add WIN32 implementation. Conditionalize use of
1643 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
1644 GLIBC specific code.
1646 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1648 Make regex safe for g++. This fixes one real bug (an "err"
1649 that should have been "*err"). g++ problem reported by
1651 * regex_internal.h (re_calloc): New macro, consistent with
1652 re_malloc etc. All callers of calloc changed to use re_calloc.
1653 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
1654 not int. All callers changed.
1655 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
1656 just use an array of size MB_LEN_MAX.
1657 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
1658 (find_recover_state): Change "err" to "*err"; this fixes what
1659 appears to be a real bug.
1660 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
1663 2005-08-25 Jim Meyering <jim@meyering.net>
1665 * open-safer.c: Include <config.h>.
1666 Otherwise, we'd lose LARGEFILE support in any file using
1669 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
1671 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
1672 * regex.h (regerror): Likewise.
1674 * regex.c: Do not include <sys/types.h>, as POSIX no longer
1675 requires this. (The code never needed it.)
1677 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
1678 All uses of recently-renamed identifiers changed to use the new,
1679 POSIX-compliant names. The code will build and run just fine
1680 without these changes, but it's better to eat our own dog food
1681 and use the standard-conforming names.
1683 * regex.h: Fix a multitude of POSIX name space violations.
1684 These changes have an effect only for programs that define
1685 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
1686 do not change anything for programs compiled in the normal way.
1687 Also, there is no effect on the ABI.
1689 (_REGEX_SOURCE): New macro.
1690 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
1691 defined and _GNU_SOURCE is not; this fixes a name space violation.
1693 Rename the following macros to obey POSIX requirements.
1694 The old names are still visible as macros if _REGEX_SOURCE is defined.
1695 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
1696 RE_BACKSLASH_ESCAPE_IN_LISTS.
1697 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
1698 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
1699 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
1700 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
1701 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
1702 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
1703 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
1704 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
1705 (REG_INTERVALS): renamed from RE_INTERVALS.
1706 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
1707 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
1708 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
1709 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
1710 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
1711 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
1712 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
1713 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
1714 RE_UNMATCHED_RIGHT_PAREN_ORD.
1715 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
1716 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
1717 (REG_DEBUG): renamed from RE_DEBUG.
1718 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
1719 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
1720 unusual, since we can't clash with the POSIX REG_ICASE.
1721 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
1722 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
1723 (REG_NO_SUB): renamed from RE_NO_SUB.
1724 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
1725 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
1726 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
1727 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
1728 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
1729 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
1730 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
1731 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
1732 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
1733 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
1734 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
1735 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
1736 RE_SYNTAX_POSIX_MINIMAL_BASIC.
1737 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
1738 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
1739 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
1740 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
1741 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
1742 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
1743 (REG_FIXED): Renamed from REGS_FIXED.
1744 (REG_NREGS): Renamed from RE_NREGS.
1746 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
1747 of other REG_* macros, since POSIX says the user is allowed to
1748 #undef these macros selectively.
1750 (reg_errcode_t): Update comment stating what other tables need
1753 Rename the following enum values to obey POSIX requirements.
1754 The old names are still visible as macros.
1755 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
1756 is not defined, since GNU is supposed to be a superset of POSIX as
1757 much as possible, and since we want reg_errcode_t to be a signed
1758 type for implementation consistency.
1759 (_REG_NOERROR): Renamed from REG_NOERROR.
1760 (_REG_NOMATCH): Renamed from REG_NOMATCH.
1761 (_REG_BADPAT): Renamed from REG_BADPAT.
1762 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
1763 (_REG_ECTYPE): Renamed from REG_ECTYPE.
1764 (_REG_EESCAPE): Renamed from REG_EESCAPE.
1765 (_REG_ESUBREG): Renamed from REG_ESUBREG.
1766 (_REG_EBRACK): Renamed from REG_EBRACK.
1767 (_REG_EPAREN): Renamed from REG_EPAREN.
1768 (_REG_EBRACE): Renamed from REG_EBRACE.
1769 (_REG_BADBR): Renamed from REG_BADBR.
1770 (_REG_ERANGE): Renamed from REG_ERANGE.
1771 (_REG_ESPACE): Renamed from REG_ESPACE.
1772 (_REG_BADRPT): Renamed from REG_BADRPT.
1773 (_REG_EEND): Renamed from REG_EEND.
1774 (_REG_ESIZE): Renamed from REG_ESIZE.
1775 (_REG_ERPAREN): Renamed from REG_ERPAREN.
1776 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
1777 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
1778 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
1779 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
1781 (_REG_RE_NAME, _REG_RM_NAME): New macros.
1782 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
1783 changed. But support the old name if the new one is not defined
1784 and if _REGEX_SOURCE.
1786 Change the following member names in struct re_pattern_buffer.
1787 The old names are still supported if !_REGEX_SOURCE.
1788 The new names are always supported, regardless of _REGEX_SOURCE.
1789 (re_buffer): Renamed from buffer.
1790 (re_allocated): Renamed from allocated.
1791 (re_used): Renamed from used.
1792 (re_syntax): Renamed from syntax.
1793 (re_fastmap): Renamed from fastmap.
1794 (re_translate): Renamed from translate.
1795 (re_can_be_null): Renamed from can_be_null.
1796 (re_regs_allocated): Renamed from regs_allocated.
1797 (re_fastmap_accurate): Renamed from fastmap_accurate.
1798 (re_no_sub): Renamed from no_sub.
1799 (re_not_bol): Renamed from not_bol.
1800 (re_not_eol): Renamed from not_eol.
1801 (re_newline_anchor): Renamed from newline_anchor.
1803 Change the following member names in struct re_registers.
1804 The old names are still supported if !_REGEX_SOURCE.
1805 The new names are always supported, regardless of _REGEX_SOURCE.
1806 (rm_num_regs): Renamed from num_regs.
1807 (rm_start): Renamed from start.
1808 (rm_end): Renamed from end.
1810 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
1811 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
1812 Prepend __ to parameter names.
1814 Undo yesterday's changes.
1816 2005-08-24 Jim Meyering <jim@meyering.net>
1818 Sync from coreutils.
1819 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
1821 2005-08-21 Bruno Haible <bruno@clisp.org>
1823 * lock.h: Add multiple inclusion guard.
1824 * tls.h: Add multiple inclusion guard.
1826 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
1828 * regex.h (REG_NOSYS)
1829 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
1830 Define, since POSIX requires it as of 2001.
1831 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
1832 New private symbol, used to keep the enum signed in all cases.
1833 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
1834 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
1836 * regex_internal.c (re_string_skip_chars, register_state):
1838 Remove forward decls; no longer needed now that we use prototypes.
1839 * regexec.c (acquire_init_state_context, check_halt_node_context):
1840 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
1841 (clean_state_log_if_needed): Likewise.
1843 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1845 Fix problems reported by Sam Steingold in
1846 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
1847 * regexec.c (sift_states_bkref): Fix portability bug: the code
1848 assumed that reg_errcode_t is a signed type, which is not
1849 necessarily true if _XOPEN_SOURCE is not defined.
1850 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
1851 some compilers warn about it otherwise.
1853 2005-08-20 Jim Meyering <jim@meyering.net>
1855 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
1856 of unused local, dfa.
1858 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
1860 * regcomp.c (create_initial_state): Remove duplicate decl.
1861 (init_word_char, create_initial_state, duplicate_node_closure):
1862 (fetch_token, peek_token_bracket, build_range_exp):
1863 (build_collating_symbol): Remove forward decls; no longer needed
1864 now that we use prototypes.
1867 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
1868 (re_compile_fastmap_iter, regcomp, regerror, regfree):
1869 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
1870 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
1871 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
1872 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
1873 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
1874 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
1875 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
1876 (build_range_exp, build_collating_symbol, parse_bracket_exp):
1877 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
1878 (build_charclass, build_charclass_op, fetch_number, create_tree):
1879 (create_token_tree, mark_opt_subexp, duplicate_tree):
1880 Use prototypes rather than old-style definitions.
1883 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
1884 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
1885 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
1886 (re_string_reconstruct, re_string_peek_byte_case):
1887 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
1888 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
1889 (re_node_set_init_copy, re_node_set_add_intersect):
1890 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
1891 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
1892 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
1893 (re_acquire_state, re_acquire_state_context, register_state):
1894 (create_ci_newstate, create_cd_newstate, free_state):
1896 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
1897 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
1898 (re_search_internal, prune_impossible_nodes):
1899 (acquire_init_state_context, check_matching, static):
1900 (check_halt_node_context, check_halt_state_context, proceed_next_node):
1901 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
1902 (update_regs, sift_states_backward, build_sifted_states):
1903 (clean_state_log_if_needed, merge_state_array):
1904 (update_cur_sifted_state, add_epsilon_src_nodes):
1905 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
1906 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
1907 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
1908 (find_recover_state, check_subexp_matching_top, transit_state_mb):
1909 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
1910 (check_arrival, check_arrival_add_next_nodes):
1911 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1912 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1913 (check_node_accept_bytes, check_node_accept, extend_buffers):
1914 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
1915 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
1920 (re_string_allocate, re_string_construct, re_string_reconstruct):
1921 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
1922 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
1923 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
1924 (re_string_context_at, re_string_peek_byte_case):
1925 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
1926 is defined, since we now use prototypes always.
1928 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
1929 C89 or better. All uses removed.
1931 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1933 * regex_internal.c (re_acquire_state, re_acquire_state_context)
1934 [defined lint]: Suppress bogus uninitialized-variable warnings.
1936 * regcomp.c (duplicate_node): Return new index, not an error code,
1937 and let the caller return REG_ESPACE if out of space. This
1938 removes an uninitialied-variable warning with GCC 4.0.1, and also
1939 avoids taking the address of a local variable. All callers
1942 2005-08-19 Jim Meyering <jim@meyering.net>
1944 * regexec.c (proceed_next_node): Redo local variables to
1945 avoid GCC shadowing warnings.
1947 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1949 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
1950 (re_node_set_insert_last, re_dfa_add_node):
1951 Rename local variables to avoid GCC shadowing warnings.
1953 2005-08-18 Bruno Haible <bruno@clisp.org>
1955 * strstr.c (strstr): Fix return value in multibyte case.
1956 * strcasestr.c (strcasestr): Likewise.
1958 2005-08-17 Jim Meyering <jim@meyering.net>
1960 Make the %s format (seconds since the epoch) work for a negative
1961 number and when used with a zero-padded field width, e.g. %015s.
1963 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1964 label so that it precedes the code to set `digits'. Otherwise,
1965 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
1966 print `00-22'. Now, it prints `-0022', as it should.
1968 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
1970 * regex.h: Remove useless space-before-tab. From coreutils.
1972 2005-08-17 Bruno Haible <bruno@clisp.org>
1974 * strcasestr.h: New file.
1975 * strcasestr.c: New file.
1977 2005-08-17 Bruno Haible <bruno@clisp.org>
1979 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
1980 * strstr.c: Completely rewritten, with multibyte locale support.
1982 2005-08-17 Bruno Haible <bruno@clisp.org>
1984 * strcasecmp.c: Use mbuiter.h.
1986 2005-08-17 Bruno Haible <bruno@clisp.org>
1988 * mbuiter.h: New file.
1990 2005-08-16 Bruno Haible <bruno@clisp.org>
1992 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
1994 (mbi_avail, mbi_advance): Let the iteration end before the terminating
1995 NUL byte, not after it.
1997 2005-08-16 Bruno Haible <bruno@clisp.org>
1999 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
2000 the valid ones. Makes the comparison operations transitive:
2001 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
2002 * strcasecmp.c (strcasecmp): Use mb_casecmp.
2004 2005-08-16 Bruno Haible <bruno@clisp.org>
2006 * strcase.h (strcasecmp): Add note in comments.
2007 * strncasecmp.c: Use code from strcasecmp.c.
2008 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
2009 (strcasecmp): Work correctly in multibyte locales.
2011 2005-08-16 Bruno Haible <bruno@clisp.org>
2013 * strnlen1.h: New file.
2014 * strnlen1.c: New file.
2016 2005-08-16 Bruno Haible <bruno@clisp.org>
2018 * mbfile.h: New file.
2020 2005-08-16 Bruno Haible <bruno@clisp.org>
2022 * mbiter.h: New file.
2024 2005-08-16 Bruno Haible <bruno@clisp.org>
2026 * mbchar.h: New file.
2027 * mbchar.c: New file.
2029 2005-08-16 Bruno Haible <bruno@clisp.org>
2031 * tls.h: New file, from GNU gettext.
2032 * tls.c: New file, from GNU gettext.
2034 2005-08-15 Bruno Haible <bruno@clisp.org>
2036 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
2039 2005-08-14 Jim Meyering <jim@meyering.net>
2041 Sync from coreutils.
2043 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
2044 Use the hash-table-based cycle-detection code not just when
2045 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
2046 Reported by James Youngman in
2047 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
2048 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
2049 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
2050 This lets us compile with -DFTS_DEBUG, once again.
2051 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
2052 * fts.c (fd_safer): Remove decl.
2053 Include fcntl--.h rather than unistd-safer.h
2054 (fts_safe_changedir): Don't call fd_safer; no longer needed
2055 now that we include fcntl--.h.
2057 2005-08-11 Simon Josefsson <jas@extundo.com>
2059 * readline.h, readline.c: New file.
2061 2005-08-11 Bruno Haible <bruno@clisp.org>
2063 * strnlen.h (strnlen): Change parameter name to match comment.
2065 2005-08-10 Simon Josefsson <jas@extundo.com>
2067 * strndup.c: Use strnlen.h.
2069 * strnlen.h: New file.
2071 2005-08-02 Simon Josefsson <jas@extundo.com>
2073 * getline.h, getline.c: Rewrite.
2075 * getdelim.h, getdelim.c: New files, ported from glibc.
2077 2005-07-31 Bruno Haible <bruno@clisp.org>
2079 * lock.h (gl_lock_initializer): New macro.
2080 (gl_lock_define_initialized): Use it.
2081 (gl_rwlock_initializer): New macro.
2082 (gl_rwlock_define_initialized): Use it.
2083 (gl_recursive_lock_initializer): New macro.
2084 (gl_recursive_lock_define_initialized): Use it.
2086 2005-07-26 Bruno Haible <bruno@clisp.org>
2088 * lock.h: Update from GNU gettext.
2089 * lock.c: Update from GNU gettext.
2091 2005-07-18 Bruno Haible <bruno@clisp.org>
2093 * lock.h (gl_once_t): New type.
2094 (gl_once_define, gl_once): New macros.
2095 * lock.c (fresh_once): New variable.
2096 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
2099 2005-07-18 Simon Josefsson <jas@extundo.com>
2101 * check-version.c (check_version): Accept identical versions too.
2103 2005-07-18 Bruno Haible <bruno@clisp.org>
2105 * lock.h: New file, from GNU gettext.
2106 * lock.c: New file, from GNU gettext.
2108 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
2110 * quotearg.c: Add translator comment suggested by Bruno Haible,
2111 with a minor change.
2113 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
2115 * version-etc-fsf.c (version_etc_copyright): Parameterize the
2116 copyright symbol and the year.
2117 * version-etc.c (COPYRIGHT_YEAR): New constant.
2118 (version_etc_va): Use parameterized copyright notice.
2119 Reword to conform to the current GNU coding standards.
2121 2005-07-11 Simon Josefsson <jas@extundo.com>
2123 * size_max.h: New file.
2125 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
2127 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
2130 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
2131 and Paul Eggert <eggert@cs.ucla.edu>
2133 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
2134 in wint_t, not wchar_t. Remove now-unnecessary cast.
2136 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
2138 * regex.c, regex.h: Sync from libc.
2139 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
2140 New files, synced from libc, except that regex_internal.h
2141 currently has a small porting fix.
2143 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
2145 Remove the dependency of the strftime module on the tzset module.
2146 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
2147 Copy the input structure, to work around some of the bug with
2148 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
2149 Solaris releases, you should also use the tzset module, but we won't
2150 require it as a dependency any more since we don't want LGPLed code
2151 to depend on GPLed code.
2153 2005-07-02 Jim Meyering <jim@meyering.net>
2155 * backupfile.c (backup_args): Change a `0' to NULL.
2157 2005-07-01 Jim Meyering <jim@meyering.net>
2159 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2160 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
2161 * save-cwd.c, tempname.c:
2162 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2163 and don't include <sys/file.h>).
2165 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
2167 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
2168 declares only 'struct timespec;' (!).
2170 2005-06-29 Jim Meyering <jim@meyering.net>
2172 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
2173 type name. Use the variable name instead.
2174 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
2176 2005-06-28 Simon Josefsson <jas@extundo.com>
2178 * check-version.h, check-version.c: New files.
2180 2005-06-28 Simon Josefsson <jas@extundo.com>
2182 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
2183 collision with global variable. Better indentation. Don't
2184 increment buffer pointer beyond buffer end. Based on comments
2185 from Paul Eggert <eggert@cs.ucla.edu>.
2189 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
2191 * canon-host.c (canon-host): Append trailing "," to 0 in
2192 initializer of struct addrinfo, as an indication that we don't
2193 care how many members the structure has.
2195 2005-06-24 Derek Price <derek@ximbiot.com>
2196 and Bruno Haible <bruno@clisp.org>
2198 Remove stat module & update lstat.
2199 * stat.c: Remove this file...
2200 (slash_aware_lstat): ...moving this content and its support...
2201 * lstat.c (rpl_lstat): ...into here.
2202 * lstat.h: New file.
2204 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
2206 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
2207 (ranged_convert): Don't save conversion in a temporary struct.
2208 This causes a warning with GCC 4.0.0, and anyway in the typical
2209 case it's not worth the extra 100 bytes or so of code.
2210 (ranged_convert, __mktime_internal): When calling a function via a
2211 pointer P, use P () rather than (*P) (), as we now assume C89 or
2214 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
2216 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
2217 "who -r" failed to give output. Problem reported by Tim Waugh.
2219 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
2220 (xcalloc): Use it to avoid needless tests.
2221 Problem reported by Jim Meyering.
2223 2005-06-16 Jim Meyering <jim@meyering.net>
2225 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
2226 when either N or S is zero.
2228 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2230 * argp.h (__option_is_short): Check upper limit of
2231 __key. Isprint() requires its argument to have the value
2232 of an unsigned char or EOF.
2234 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
2236 * fnmatch.c (fnmatch): If there is an encoding error in a
2237 multibyte string or pattern, fall back on unibyte matching.
2238 Problem reported by James Youngman.
2240 2005-06-08 Bruno Haible <bruno@clisp.org>
2242 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
2245 2005-06-08 Bruno Haible <bruno@clisp.org>
2247 * csharpcomp.h: New file, from GNU gettext.
2248 * csharpcomp.c: New file, from GNU gettext.
2249 * csharpcomp.sh.in: New file, from GNU gettext.
2251 2005-06-07 Derek Price <derek@ximbiot.com>
2254 * glob_.h: Indent nested #ifdef.
2256 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
2258 Sync from coreutils.
2259 Use "file name" when talking about file names, instead of "filename"
2260 or "path", as per the GNU coding standards.
2261 * mkdir-p.c: Renamed from makepath.c.
2262 (make_dir_parents): Renamed from make_path. All callers changed.
2263 * mkdir-p.h: Likewise. All includers changed.
2264 * filenamecat.c: Renamed from path-concat.c.
2265 (file_name_concat): Renamed from path_concat. All callers changed.
2266 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
2267 * filenamecat.h: Likewise. All includers changed.
2268 * acl.c: Don't use "path" or "filename" to mean "file name"
2269 in comments or local variable names.
2270 * basename.c: Likewise.
2271 * canonicalize.c, canonicalize.h: Likewise.
2272 * dirname.c, dirname.h: Likewise.
2273 * euidaccess.c: Likewise.
2274 * exclude.c: Likewise
2275 * fnmatch_.h, fnmatch_loop.c: Likewise.
2276 * fsusage.c, fsuage.h: Likewise.
2277 * fts.c, fts_.h: Likewise.
2278 * getcwd.c: Likewise.
2279 * getloadavg.c: Likewise.
2280 * mkstemp.c: Likewise.
2281 * mountlist.c, mountlist.h: Likewise.
2282 * openat.c, openat.h: Likewise.
2283 * readlink-stub.c: Likewise.
2284 * readutmp.c, readutmp.h: Likewise.
2285 * rename.c: Likewise.
2286 * rmdir.c: Likewise.
2288 * savedir.c: Likewise.
2289 * stripslash.c: Likewise.
2290 * tempname.c: Likewise.
2291 * xreadlink.c: Likewise.
2292 * exclude.c (excluded_file_name): Renamed from excluded_filename.
2294 * exclude.h: Likewise.
2296 * euidaccess.c (getuid, getgid, getuid, getegid)
2297 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2298 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
2299 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2300 * pathmax.h: Include <limits.h> unconditionally, since other
2301 files have been getting away with it for years (MORE/BSD 4.3
2303 * userspec.c (getpwnam, getgrnam, getgrgid)
2304 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2306 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
2307 Define to 256, not 255, as per modern POSIX.
2309 2005-06-01 Bruno Haible <bruno@clisp.org>
2311 * csharpexec.h: New file, from GNU gettext.
2312 * csharpexec.c: New file, from GNU gettext.
2313 * csharpexec.sh.in: New file, from GNU gettext.
2315 2005-05-31 Derek Price <derek@ximbiot.com>
2316 Paul Eggert <eggert@cs.ucla.edu>
2319 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
2321 2005-05-29 Derek Price <derek@ximbiot.com>
2322 Paul Eggert <eggert@cs.ucla.edu>
2324 * glob_.h, glob.c: New files.
2326 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
2328 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
2330 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
2331 the configuration hassle isn't worth it.
2332 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
2333 (LONGEST_MODIFIER, PRIuMAX): Remove.
2335 2005-05-27 Bruno Haible <bruno@clisp.org>
2337 * getlogin_r.h: Remove second include of <stddef.h>.
2339 2005-05-25 Bruno Haible <bruno@clisp.org>
2340 Derek Price <derek@ximbiot.com>
2342 * getlogin_r.h: Simplify API documentation.
2344 2005-05-25 Derek Price <derek@ximbiot.com>
2345 Paul Eggert <eggert@cs.ucla.edu>
2347 * getlogin_r.c, getlogin_r.h: New files.
2349 2005-05-22 Bruno Haible <bruno@clisp.org>
2351 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
2352 Also include <sys/param.h> if it defines MIN, MAX.
2353 Based on a patch by Derek Price <derek@ximbiot.com>.
2355 2005-05-22 Bruno Haible <bruno@clisp.org>
2357 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
2358 (INT64_MIN): Fix definition.
2359 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2361 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
2362 NEED_SIGNED_INT_TYPES.
2364 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
2365 HAVE_SYSTEM_INTTYPES.
2367 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
2369 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
2370 so that unistd-safer.h (GPL'ed code) need not be included.
2372 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
2375 * fts.c: Don't include "cycle-check.h" or "hash.h".
2376 (setup_dir, free_dir): New functions.
2377 (enter_dir, leave_dir): Define trivial
2378 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
2379 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
2380 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
2381 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
2382 Move to fts-cycle.c.
2383 (fts_open): Use setup_dir.
2384 (fts_close): Use free_dir.
2385 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
2386 This adds a label and some gotos, but the alternatives were messier.
2387 Check for memory allocation failure when entering a dir.
2388 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
2389 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
2390 (FTS): New member fts_cycle, that is a union that contains the
2391 old active_dir_ht and cycle_state. All uses changed to mention
2392 fts_cycle.ht and fts_cycle.state.
2393 * fts-cycle.c: New file, containing GPL'ed code migrated out of
2394 fts.c, with the following changes:
2395 (setup_dir, free_dir): New functions.
2396 (enter_dir): Now returns bool. Return true if successful, false
2397 if memory exhausted. All callers changed.
2398 Do not bother partly cleaning up on
2399 memory allocation failure; that is free_dir's job.
2400 However, free ad if hash_insert fails, to avoid memory leak.
2401 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
2402 fts->fts_options to see which union member to use.
2404 2005-05-20 Jim Meyering <jim@meyering.net>
2406 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
2407 Now a macro, to pacify GCC.
2409 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
2411 * chown.c (rpl_chown): Return -1 on failure.
2413 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
2415 * canonicalize.c: Include canonicalize.h first, to test interface.
2416 Include <stddef.h> unconditionally, since we assume C89 now.
2417 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
2418 * fts.c: Include fts_.h first, to check interface.
2419 Do not include intprops.h; no longer needed.
2420 Include cycle-check.h and hash.h, since fts_.h no longer does.
2421 Remove unnecessary casts of closedir to void.
2422 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
2423 decide whether to decrement nlinks.
2424 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
2425 (FTS): Use struct hash_table * instead of Hash_table, so that
2426 we no longer need to include hash.h here.
2428 2005-05-17 Jim Meyering <jim@meyering.net>
2430 * fts.c, fts_.h: New files, from coreutils.
2432 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
2434 Sync from coreutils.
2435 * unlinkdir.c, unlinkdir.h: New files.
2436 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
2437 regex.h, unlocked-io.h, xtime.h:
2438 White space changes only.
2439 * makepath.c (make_path): Port to hosts where leading "//" is special.
2440 * yesno.c: Include getline.h, not ctype.h.
2441 (yesno): Don't remove leading white space; POSIX doesn't allow it.
2442 Use getline to remove arbitrary restriction on response length.
2444 2005-05-13 Bruno Haible <bruno@clisp.org>
2446 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
2447 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
2448 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
2449 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
2450 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
2451 Add support for 64-bit integers in the MSVC compiler.
2453 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
2455 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
2456 Change the initial comment to refer to GPL, not LGPL.
2457 gnulib-tool will change it to LGPL as needed.
2459 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
2460 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
2461 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
2462 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
2463 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
2464 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
2465 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
2466 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
2467 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
2468 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
2469 concatpath.c, config.charset, copy-file.c, copy-file.h,
2470 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
2471 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
2472 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
2473 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
2474 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
2475 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
2476 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
2477 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
2478 full-read.c, full-read.h, full-write.c, full-write.h,
2479 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
2480 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
2481 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
2482 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
2483 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
2484 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
2485 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
2486 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
2487 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
2488 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
2489 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
2490 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
2491 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
2492 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
2493 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
2494 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
2495 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
2496 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
2497 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
2498 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
2499 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
2500 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
2501 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
2502 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
2503 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
2504 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
2505 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
2506 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
2507 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
2508 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
2509 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
2510 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
2511 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
2512 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
2513 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
2514 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
2515 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
2516 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
2517 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
2518 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
2519 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
2520 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
2521 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
2522 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
2523 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
2524 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
2525 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
2526 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
2527 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
2528 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
2529 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
2530 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
2531 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
2532 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
2533 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
2534 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
2535 Update FSF postal mail address.
2537 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2539 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
2540 specified in ai_socktype. Fix invalid ai_protocol
2541 check. ai_protocol is usually set to 0 or depending on
2542 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
2543 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
2544 ai_socktype / ai_protocol in the returned addrinfo structure.
2546 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
2547 Bruno Haible <bruno@clisp.org>
2549 * inet_ntop.h: New file.
2550 * inet_ntop.c: New file, from glibc with modifications.
2552 2005-05-08 Jim Meyering <jim@meyering.net>
2554 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
2556 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
2558 Merge from coreutils. Among other things,
2559 add bulletproofing for cases where stdin, stdout, or stderr are closed.
2560 * fd-safer.c: New file.
2561 * fcntl-safer.h, open-safer.c: Remove.
2562 * chdir-long.c: Fix comment "fetish" -> "coreutils".
2563 * dup-safer.c: Include unistd-safer.h first.
2564 Don't include errno.h.
2565 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
2566 * file-type.h: Don't assume invoker included sys/stat.h first.
2567 * file-type.c: Rely on file-type.h change.
2568 * getloadavg.c: Include unistd-safer.h.
2569 (getloadavg): Use safer open.
2570 * getusershell.c: Include "stdio-safer.h".
2571 (getusershell): Use safer fopen.
2572 * long-options.c (long_options): Use NULL rather than 0.
2573 * modechange.h (mode_free): Remove; all callers changed to invoke
2575 * modechange.c: Likewise.
2576 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
2577 (MODE_DONE): New constant.
2578 (struct mode_change): Remove 'next' member.
2579 (make_node_op_equals): New function; like the old one of the
2580 same name, except it allocates an array.
2581 (mode_compile, mode_create_from_ref): Use it.
2582 (mode_compile): Allocate result as an array, not a linked list.
2583 Parse octal string ourself, so that we catch mistakes like "+0".
2584 (mode_adjust): Arg is an array, not a linked list.
2585 * modechange.c: Include stat-macros.h, xalloc.h.
2586 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
2587 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
2588 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
2589 Remove. This is now stat-macros.h's job.
2590 (talloc): Remove. All callers replaced by xalloc, so that
2591 our invokers don't have to worry about reporting memory failures.
2592 (make_node_op_equals): Remove.
2593 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2595 (struct mode_change): Moved here from modechange.h.
2596 (mode_append_entry): Remove.
2597 (mode_compile): Remove MASKED_OPS arg, since it encouraged
2598 apps to have incorrect behavior. Use simpler algorithm for head
2599 and tail. Don't futz with umask; that's now the job of mode_adjust.
2600 Detect more invalid usages rather than having somewhat-random behavior.
2601 Don't insert an "a=" action, as that leads to incorrect behavior.
2602 (mode_compile, mode_create_from_ref): Return NULL on error instead
2603 of an enum, since now there's only one way to have an error. All
2605 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
2606 at the correct time. Simplify calculation of "+u" and its ilk.
2607 Don't mishandle "+X".
2608 (mode_free): Remove "register" and localize decls.
2609 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2610 (struct mode_change): Move to modechange.c; callers don't
2611 need to see this stuff.
2612 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
2613 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
2614 (mode_change, mode_adjust): Reflect the new signatures noted above.
2615 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
2616 that might redefine system include files.
2617 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
2618 (my_usleep): Use NULL rather than (void *) 0.
2619 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
2620 Use siginterrupt to specify that system calls should be interrupted.
2621 (rpl_nanosleep): Move initialization of suspended closer to call of
2623 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
2624 * readutmp.c: Likewise. Include signal.h, stdbool.h.
2625 (desirable_utmp_entry): New function.
2626 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
2627 using x2nrealloc, to simplify logic.
2628 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
2629 size calculation. Do not assume utmp file is a regular file.
2630 * readutmp.h (UT_PID): Moved here from ../src/who.c.
2631 (READ_UTMP_CHECK_PIDS): New constant.
2632 * save-cwd.c: Include unistd-safer.h.
2633 (save_cwd): Use fd_safer.
2634 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
2635 [!_LIBC] Include "stat-macros.h" instead.
2636 * unistd-safer.h (fd_safer): New decl.
2638 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
2640 * byteswap_.h: New file.
2642 2005-04-25 Albert Chin <china@thewrittenword.com>
2644 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
2647 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
2649 * getdate.y (zone): Allow relunit_snumber after tZONE, so
2650 that "UTC +1 second" continues to work. Problem reported
2652 (relunit_snumber): New rule.
2655 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
2657 * getdate.y (universal_time_zone_table): New constant.
2658 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
2659 universal_time_zone_table.
2660 (lookup_zone): Prefer universal_time_zone_table to
2661 local_time_zone_table, so that "GMT" time stamps are allowed in
2662 London during the summer. Problem reported by Ian Abbott.
2664 2005-04-12 Jim Meyering <jim@meyering.net>
2666 * human.c (humblock): Set *options even when returning due to
2667 xstrtoumax conversion failure. Thanks to a used-uninitialized
2670 2005-04-09 Jim Meyering <jim@meyering.net>
2672 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
2673 -Wuninitialized: initialize tm0.tm_year.
2675 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
2677 * getdate.y (parser_control): rels_seen is now a boolean, not a
2678 count, since there's no maximum. All uses changed.
2679 Add member dsts_seen.
2680 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
2682 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
2683 Use pc_rels_seen to decide whther a date is absolute.
2685 * getdate.y (number): Don't overwrite year.
2686 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
2689 2005-04-02 Simon Josefsson <jas@extundo.com>
2691 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
2692 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
2694 2005-03-27 Jim Meyering <jim@meyering.net>
2696 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
2698 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
2700 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
2701 "one's complement" -> "ones' complement" in comment, as per Knuth.
2702 "value of type" -> "type or expression" in comment.
2703 * mktime.c, strftime.c: Propagate intprops.h comment nits.
2705 2005-03-26 Jim Meyering <jim@meyering.net>
2708 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
2709 Correct typos: s/or/of/.
2711 2005-03-23 Jim Meyering <jim@meyering.net>
2713 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
2715 2005-03-21 Jim Meyering <jim@meyering.net>
2717 Changes imported from coreutils.
2719 * cycle-check.c: Don't include xalloc.h.
2721 * path-concat.c: Don't include assert.h.
2722 (path_concat): Remove assertion that would have triggered
2723 for ABASE starting with more than one slash.
2724 Reported by Andreas Schwab.
2726 * path-concat.c (path_concat): Set *BASE_IN_RESULT
2727 properly when ABASE is an absolute file name.
2728 Correct the description of this function.
2730 Add an assertion and a test driver.
2731 This fixes a bug introduced on 2004-07-02.
2732 Andreas Schwab reported the resulting failure of cp --parents:
2733 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
2735 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
2737 * strftime.c (my_strftime): If the underlying strftime returns 0
2738 (which shouldn't happen), generate nothing instead of returning 0
2739 immediately, so that nstrftime (NULL, ...) doesn't return 0.
2741 2005-03-16 Bruno Haible <bruno@clisp.org>
2743 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
2745 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
2747 * strftime.c (my_strftime): Prepend space to format so that we can
2748 reliably distinguish strftime failure from empty output on POSIX
2751 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
2753 * iconvme.c (SIZE_MAX): New macro, if not already defined.
2754 (iconv_string): Don't guess a size-zero buffer, as that might cause
2755 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
2756 result would be 'too large', where 'too large' is (heuristically)
2757 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
2758 overflow concerns. This will prevent some unwanted malloc failures
2759 when the inputs are very large.
2761 2005-03-15 Bruno Haible <bruno@clisp.org>
2763 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
2766 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
2769 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
2771 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
2773 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
2774 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
2776 * strtol.c: Likewise.
2778 2005-03-14 Simon Josefsson <jas@extundo.com>
2780 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
2783 2005-03-14 Jim Meyering <jim@meyering.net>
2785 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
2786 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
2787 to be nonzero so that we (and caller) can detect the difference
2788 between a valid zero-length expansion and an error return, even
2789 when the underlying strftime fails before writing anything into
2792 2005-03-10 Jim Meyering <jim@meyering.net>
2794 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
2795 so that this module works on systems without fchdir.
2797 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
2799 Factor int-properties macros into a single file, except for
2800 glibc-related files.
2801 * intprops.h: New file.
2802 * getloadavg.c: Include it instead of limits.h.
2803 (INT_STRLEN_BOUND): Remove.
2804 * human.c: Include intprops.h.
2805 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2806 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2807 * inttostr.h: Include intprops.h instead of limits.h.
2808 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2809 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2810 for consistency with intprops.h.
2811 (time_t_is_integer, twos_complement_arithmetic): Use them.
2812 * sig2str.h: Include <signal.h>, intprops.h.
2813 (INT_STRLEN_BOUND): Remove.
2814 * strftime.c (TYPE_SIGNED): Remove.
2815 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2816 * strtol.c: Adjust comments to match intprops.h.
2817 * userspec.c: Include intprops.h.
2818 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2819 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2820 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2821 instead of rolling our own expressions.
2822 * xstrtol.c: Include xstrtol.h first, to test interface.
2824 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
2826 (my_strftime): Do not mishandle years close to INT_MAX, by doing
2827 the right thing even if adding 1900 would overflow. Similarly
2828 for tm_mon + 1 and tm_yday + 1.
2829 Make %Y always equivalent to %C%y, and similarly for %G and %g.
2830 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2831 (DO_SIGNED_NUMBER): New macro.
2832 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2834 2005-03-07 Bruno Haible <bruno@clisp.org>
2836 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
2838 2005-03-03 Derek R. Price <derek@ximbiot.com>
2839 Bruno Haible <bruno@clisp.org>
2841 * pagealign_alloc.h: New file.
2842 * pagealign_alloc.c: New file.
2844 2005-01-28 Bruno Haible <bruno@clisp.org>
2846 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
2849 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
2851 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2852 The workaround isn't strictly needed for POSIX conformance, and
2853 it's too much of a pain to configure and maintain. We'll ask
2854 people to fix their kernels instead.
2855 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2856 (NANOSLEEP_BUG_WORKAROUND): Remove.
2857 (xnanosleep): Remove the workaround.
2859 2005-02-12 Bruno Haible <bruno@clisp.org>
2861 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
2863 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
2865 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2866 * timespec.h (gettime): Return void, since it always
2867 succeeds now. All uses changed.
2868 * gettime.c (gettime) Likewise.
2869 [HAVE_NANOTIME]: Prefer nanotime.
2870 Assume gettimeofday succeeds, as POSIX requires.
2871 Assime time () succeeds, since other code already does.
2872 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2873 (timespec_subtract): Remove.
2874 (NANOSLEEP_BUG_WORKAROUND): New constant.
2875 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2876 things considerably. Use it only on GNU/Linux hosts, since the
2877 workaround shouldn't be needed elsewhere.
2879 2005-02-24 Bruno Haible <bruno@clisp.org>
2881 * gettext.h: Update from GNU gettext 0.14.2.
2883 2005-02-24 Bruno Haible <bruno@clisp.org>
2885 * localcharset.c: Update from GNU gettext 0.14.2.
2886 * config.charset: Update from GNU gettext 0.14.2.
2888 2005-02-22 Simon Josefsson <jas@extundo.com>
2890 * iconvme.h, iconvme.c: New files, from libc.
2892 2005-02-20 Neil Conway <neilc@samurai.com>
2894 * xgethostname.c (xgethostname): Check for ENOMEM, which is
2895 returned by OSX/Darwin if the specified buffer is not large
2896 enough for the hostname.
2898 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
2900 * memrchr.h: New file.
2901 * chdir-long.c: Include it.
2902 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
2903 Don't bother including stddef.h.
2905 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2907 * argp-help.c (__argp_help): Create a fake struct argp_state and
2908 pass it to _help, otherwise the latter coredumps trying to
2909 dereference state.root_argp.
2911 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
2913 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2915 Include <sys/types.h>, for dev_t.
2916 (ME_DUMMY, ME_REMOTE): Move from here....
2917 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2918 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
2920 Include mountlist.h first, to test the interface.
2922 2005-01-29 Bruno Haible <bruno@clisp.org>
2924 * progname.c (program_name): Initialize.
2925 Needed when linking statically on MacOS X.
2927 2005-01-28 Bruno Haible <bruno@clisp.org>
2929 * javacomp.sh.in: New file, from GNU gettext.
2930 * javacomp.h: New file, from GNU gettext.
2931 * javacomp.c: New file, from GNU gettext.
2933 2005-01-26 Bruno Haible <bruno@clisp.org>
2935 * javaexec.sh.in: New file, from GNU gettext.
2936 * javaexec.h: New file, from GNU gettext.
2937 * javaexec.c: New file, from GNU gettext.
2939 2005-01-26 Simon Josefsson <jas@extundo.com>
2941 * gai_strerror.c: Use GPL in header.
2943 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2945 * argp-help.c (hol_entry_help): Avoid using non-constant
2946 initializers for struct pentry_state.
2947 (__argp_error): Check return value of __asprintf
2948 (__argp_failure): Translate error message
2950 * argp-parse.c: Removed braces around the expansion of N_()
2952 2005-01-21 Jim Meyering <jim@meyering.net>
2954 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2955 same value as for Solaris 9.
2957 * chdir-long.c (chdir_long): Rewrite to remove limitation on
2958 component length. This included changing the parameter to be
2959 of type `char *' rather than `char const *'.
2960 * chdir-long.h (chdir_long): Update prototype.
2962 * openat.c (fdopendir, fstatat): New functions.
2963 * openat.h: Include headers required for use of DIR and struct stat.
2964 [AT_SYMLINK_NOFOLLOW]: Define.
2965 (fdopendir, fstatat): Add prototypes.
2967 2005-01-21 Bruno Haible <bruno@clisp.org>
2969 * classpath.h: New file, from GNU gettext.
2970 * classpath.c: New file, from GNU gettext.
2972 2005-01-20 Simon Josefsson <jas@extundo.com>
2974 * version-etc-fsf.c: New file, with version_etc_copyright.
2975 * version-etc.c: Remove version_etc_copyright.
2976 * version-etc.h (version_etc_copyright): Use [] instead of * in
2977 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
2979 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
2981 * save-cwd.c (save_cwd): Remove code to support the case
2982 where fchdir is missing or flaky.
2984 2005-01-20 Simon Josefsson <jas@extundo.com>
2986 * base64.h (isbase64): Add.
2988 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
2989 using a unsigned prototype, don't inline.
2990 (base64_decode): Use it.
2992 2005-01-19 Bruno Haible <bruno@clisp.org>
2994 * sh-quote.h: New file, from GNU gettext.
2995 * sh-quote.c: New file, from GNU gettext.
2997 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
2999 Merge changes from coreutils, as described below in several
3000 changelogs dated today.
3002 * save-cwd.c: Include "save-cwd.h" before other include files.
3003 (O_DIRECTORY): Remove; not needed here, since "." must be
3004 a directory. All uses removed.
3005 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
3006 universal on Suns, and we also need to test for IRIX.
3007 Revamp code to use 'if' rather than '#if'.
3008 Avoid unnecessary comparison of cwd->desc to 0.
3010 * utimens.c (futimens): Robustify the previous patch, by checking
3011 for known valid error numbers rather than observed invalid ones.
3013 2005-01-18 Jim Meyering <jim@meyering.net>
3015 * version-etc.c (version_etc_copyright): Update copyright date.
3017 * utimens.c (futimens): Account for the fact that futimes
3018 can also fail with errno == ENOSYS or errno == ENOENT.
3019 Patch from Dmitry V. Levin.
3021 Change the name of the robust chdir function from chdir to chdir_long.
3022 * save-cwd.c: Include chdir-long.h rather than chdir.h.
3023 (restore_cwd): Use chdir_long, not chdir.
3024 * chdir-long.c: Renamed from chdir.c.
3025 * chdir-long.h: Renamed from chdir.h.
3026 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
3029 2005-01-18 Bob Proulx <bob@proulx.com>
3031 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
3032 offsetof() macro construct to avoid compile failure with native HP-UX
3033 11.0 ANSI C compiler.
3035 2005-01-06 Bruno Haible <bruno@clisp.org>
3037 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
3038 because stpncpy.m4 takes care of it.
3040 2004-01-24 Bruno Haible <bruno@clisp.org>
3042 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
3044 2003-10-09 Bruno Haible <bruno@clisp.org>
3046 * progreloc.c: Include xalloc.h instead of xmalloc.h.
3048 2005-01-06 Bruno Haible <bruno@clisp.org>
3050 * fwriteerror.h (fwriteerror): Change specification to include fclose.
3051 * fwriteerror.c: Include <stdbool.h>.
3052 (fwriteerror): At the end, close the file stream. Record whether
3053 stdout was already closed.
3055 2004-05-27 Bruno Haible <bruno@clisp.org>
3057 * execute.c (environ): Declare if needed.
3058 * pipe.c (environ): Likewise.
3059 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
3061 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
3063 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
3064 definitions to be after all include files, to avoid collisions.
3065 Problem reported by Bob Proulx.
3067 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
3069 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
3070 not needed. This removes a dependency on the gettext module.
3071 [defined _LIBC]: Do not include <libintl.h>; not needed.
3073 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
3075 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
3078 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
3080 * argp-parse.c: Include <stddef.h>.
3081 (alignof, alignto): New macros.
3082 (parser_init): Don't assume that void * is aligned sufficiently
3085 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
3086 need to extend the stack.
3087 (YYINITDEPTH): New macro, so that the initial stack isn't overly
3090 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3092 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
3094 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
3096 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
3097 Remove now-obsolete comment about AIX.
3098 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
3099 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
3100 (YYMAXDEPTH): New macro.
3102 2004-12-18 Bruno Haible <bruno@clisp.org>
3104 * fatal-signal.c (fatal_signals): Make non-const.
3105 (init_fatal_signals): New function.
3106 (uninstall_handlers, install_handlers): Ignore signals that were set to
3108 (at_fatal_signal): Call init_fatal_signals.
3109 (init_fatal_signal_set): Likewise. Ignore signals that were set to
3111 Reported by Paul Eggert.
3113 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
3115 * getdate.y (textint): New member "negative".
3116 (time_zone_hhmm): New function.
3117 Expect 14 shift-reduce conflicts, not 13.
3118 (o_colon_minutes): New rule.
3119 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
3120 (yylex): Set the "negative" member of signed numbers.
3122 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
3124 Changes imported from coreutils.
3125 * hard-locale.c: Assume <locale.h> exists.
3127 (GLIBC_VERSION): New macro.
3128 (hard_locale): Assume setlocale exists.
3129 Rewrite to avoid #ifdef.
3130 Use strdup rather than malloc + strcpy.
3131 * human.c: Assume <locale.h> exists.
3132 (human_readable): Assume localeconv exists.
3134 2004-12-01 Jakub Jelinek <jakub@redhat.com>
3136 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
3137 convert T2, not T. (Imported from libc.)
3139 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
3141 * getcwd.c (is_ENAMETOOLONG): New macro.
3142 (__getcwd.c): Don't restore errno; glibc doesn't.
3143 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
3144 first, falling back to our code only if its results look suspicious.
3145 Ensure that the resulting buffer is only as large as necessary.
3147 * readutmp.c: Include readutmp.h first.
3148 Include <errno.h>, since readutmp.h no longer does that.
3149 * readutmp.h: Don't include <errno.h>,
3150 <sys/param.h>, <time.h>; not needed to establish interface.
3151 (errno): Remove decl.
3152 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
3153 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
3154 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
3156 2004-11-28 Simon Josefsson <jas@extundo.com>
3158 * base64.h, base64.c: New file.
3160 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
3162 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
3164 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
3166 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
3167 HP's ANSI C compiler.
3168 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
3169 Declaring int functions causes warnings on some modern systems and
3170 shouldn't be needed to compile on ancient ones.
3171 * same.c (MIN) [defined MIN]: Don't define, since it's already
3174 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
3175 with the following changes.
3176 (__set_errno): Parenthesize properly.
3177 Include <stdbool.h>.
3178 (MIN, MAX, MATCHING_INO): New macros.
3179 (__getcwd): Define with prototype, not K&R form.
3180 Use heuristics to allocate default buffer on stack if possible.
3181 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
3182 behavior, and to avoid the PATH_MAX limit when computing
3184 Use MATCHING_INO to compare inode number to file.
3185 Check for arithmetic overflow in size calculations.
3186 Fix bug in reallocation of dot array that caused getcwd to fail
3187 on directories nested deeper than 75.
3188 Be more careful about saving errno on error.
3189 Do not use realloc; use only free+malloc, as this is a bit
3190 more flexible and avoids a needless copy operation.
3191 Do not inspect st_dev and st_ino for symbolic links; POSIX
3192 doesn't specify the latter.
3193 Check for closedir errors.
3194 Avoid needless casts.
3195 Use "#ifdef weak_alias" around weak_alias, to be like other
3197 The following changes to getcwd.c have effect only when used in
3198 gnulib; they have no effect inside glibc proper.
3199 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
3200 as alloca isn't used.
3201 (alloca, __alloca): Likewise.
3202 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
3203 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3204 unconditionally, as gnulib assumes C89 or better.
3205 Do not include <sys/param.h>.
3206 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
3207 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
3209 (NULL) [!defined NULL]: Remove; we assume C89 or better.
3210 Include <dirent.h> in a way that is compatible with modern Autoconf.
3211 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
3212 New macros, if not already defined.
3213 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
3214 Use "_LIBC", not "defined _LIBC", for consistency.
3215 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
3217 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
3218 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
3219 * xgetcwd.c: David MacKenzie's old code was removed, so give
3220 credit only to Jim Meyering and adjust the copyright dates.
3221 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
3222 <stdlib.h>, <unistd.h>, "pathmax.h".
3223 Instead, include "xgetcwd.h" (first) and "getcwd.h".
3224 (INITIAL_BUFFER_SIZE): Remove.
3225 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
3227 2004-11-23 Jim Meyering <jim@meyering.net>
3229 * getopt_.h: Remove trailing blanks.
3231 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
3233 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
3234 (futimens): New function, which uses futimes if available.
3235 (futimens, utimens): Support timespec==NULL, with same semantics
3236 as utime and utimens.
3237 * utimens.h (futimens): New decl.
3239 2004-11-23 Jim Meyering <jim@meyering.net>
3241 * __fpending.c: Add comment.
3243 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3245 * getopt_.h: Re-addition of __getopt_argv_const caused
3246 redefinition warnings. To avoid them, include the defines
3247 in `#if !defined __need_getopt ... #endif'. The only place
3248 where __getopt_argv_const is used is in definitions
3249 of getopt_long and getopt_long_only below, which are as well
3250 protected by `#ifndef __need_getopt'.
3251 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
3252 __need_getopt after including <stdio.h> and <unistd.h> These
3253 headers might have defined it.
3255 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
3257 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
3259 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
3260 optopt): Use them instead of invoking ## directly; otherwise, the
3261 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
3263 2004-11-19 Bruno Haible <bruno@clisp.org>
3265 * strtok_r.c: Move comments from here...
3266 * strtok_r.h: ... to here.
3268 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
3270 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
3271 might fail. Problem reported by Yoann Vandoorselaere.
3272 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
3273 that mishandle size_t overflow.
3275 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
3277 * canon-host.c: Include "strdup.h".
3278 (canon_host): Use getaddrinfo if available, so that IPv6 works.
3279 Use strdup instead of malloc/strcpy to duplicate strings.
3281 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
3282 (human_space_before_unit): New constant.
3283 * human.c (human_readable): Support it.
3285 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
3286 (xgetcwd): Set errno correctly when failing.
3287 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
3288 the failure is actually due to a PATH_MAX problem.
3290 Further getopt changes to make it more likely that glibc will
3291 buy the changes back.
3292 * getopt.c (POSIXLY_CORRECT): New constant.
3293 (getopt): Use it, so to preserve glibc semantic
3294 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
3295 when compiling for libc.
3296 * getopt_.h (__getopt_argv_const): Bring it back.
3297 (getopt_long, getopt_long_only): Use it.
3299 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
3300 New arg POSIXLY_CORRECT. All callers changed.
3301 (getopt): Argv is now char * const *, as per standard.
3302 (_getopt_internal_r, _getopt_internal): Argv is now char **,
3303 not char *__getopt_argv_const *.
3304 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
3305 _getopt_long_only_r): Likewise.
3306 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
3307 * getopt_int.h (_getopt_internal, _getopt_internal_r,
3308 _getopt_long_r, _getopt_long_only_r): Likewise.
3309 * getopt_.h (__getopt_argv_const): Remove.
3310 (getopt): Argv is now char * const *, as per standard.
3312 * getdate.y (tORDINAL): New token.
3313 (day, relunit): Allow it for relative times.
3314 (relative_time_table): Use tORDINAL for ordinals.
3316 2004-11-15 Jim Meyering <jim@meyering.net>
3318 * closeout.c: Include "__fpending.h" once again.
3319 Include <stdbool.h>.
3320 (close_stdout): Don't fail just because stdout was closed initially,
3321 since some programs don't write to stdout in the normal course of
3322 operation (other than --version and --help), and we don't want this
3323 function to make e.g. `touch file >&-' fail.
3324 But do fail if it was closed and someone has tried to write to it.
3325 E.g., `printf foo >&-' must fail.
3327 2004-11-11 Simon Josefsson <jas@extundo.com>
3329 * strtok_r.h, strtok_r.c: New file.
3331 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
3333 * getopt_.h (__getopt_argv_const): New macro, to be used so that
3334 we can stop lying to compilers about the constness of argv when we
3335 are compiled outside glibc.
3336 (getopt, getopt_long, getopt_long_only): Use it.
3337 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
3339 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
3340 _getopt_long_only_r): Likewise.
3341 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
3342 _getopt_long_only_r): Likewise.
3344 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
3345 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
3346 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
3347 the other external symbols.
3348 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
3349 declaration, since the above renaming now works around collisions.
3351 2004-11-11 Jim Meyering <jim@meyering.net>
3353 * linebreak.c: Remove trailing blanks.
3354 * alloca_.h: Likewise.
3355 * acosl.c: Likewise.
3356 * euidaccess.c: Likewise.
3357 * allocsa.h: Likewise.
3359 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
3361 * mktime.c (SHR): New macro, which is a portable
3362 substitute for >> that should work even on Crays.
3363 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
3364 Problem reported by Mark D. Baushke in
3365 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
3366 * getdate.y (SHR): Likewise.
3368 * strftime.c (SHR): Likewise.
3370 * quotearg.c (struct quoting_options): Use unsigned int for
3371 quote_these_too, so that right shifts are well defined. All uses
3374 2004-11-10 Simon Josefsson <jas@extundo.com>
3376 * getaddrinfo.h, getaddrinfo.c: New files.
3378 2004-11-10 Jim Meyering <jim@meyering.net>
3380 Ensure that no close failure goes unreported.
3381 * closeout.c (close_stdout): Always close stdout. I.e., don't
3382 return early when it seems there's nothing to flush.
3383 Don't include __fpending.h.
3385 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
3387 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
3389 2004-11-05 Bruno Haible <bruno@clisp.org>
3391 * readlink.c: Include stddef.h, needed for size_t on Woe32.
3392 Reported by Mark D. Baushke <mdb@cvshome.org>.
3394 2004-11-04 Bruno Haible <bruno@clisp.org>
3396 2004-09-11 Bruno Haible <bruno@clisp.org>
3397 * allocsa.valgrind: New file.
3398 2004-02-06 Bruno Haible <bruno@clisp.org>
3399 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
3400 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
3401 Reported by Christopher Seip <chris.seip@hp.com>.
3403 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
3405 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
3406 with errno == ERANGE if the buffer is too small.
3407 Problem reported by Mark D. Baushke.
3409 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
3411 * xreadlink.c (MAXSIZE): New macro.
3412 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
3413 size does not exceed MAXSIZE. Avoid cast.
3414 As suggested by Mark D. Baushke in
3415 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
3416 if readlink fails with buffer size just under MAXSIZE, try again
3419 2004-11-02 Derek R. Price <derek@ximbiot.com>
3420 and Paul Eggert <eggert@cs.ucla.edu>
3422 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
3423 (get_date): Overparenthesize to avoid GCC warning.
3425 2004-11-02 Bruno Haible <bruno@clisp.org>
3427 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
3428 function returns void.
3430 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
3432 * getpass.c (fflush_unlocked, flockfile, funlockfile)
3433 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
3436 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
3438 * getdate.y: Add support for TZ="foo" within a date string.
3439 Fix some bugs near time_t boundaries. Reject dates with
3440 out-of-range components, e.g., "Sept 31".
3441 Include <stdlib.h>, "setenv.h", "xalloc.h".
3442 (ISDIGIT_LOCALE): Remove; unused.
3443 Note that the TZ and time functions used here are not reentrant.
3444 (mktime_ok, get_tz): New functions.
3445 (TZBUFSIZE): New constant.
3446 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
3447 This requires that we sometimes generate our own TZ="XXX..." setting.
3449 2004-10-27 Derek R. Price <derek@ximbiot.com>
3451 * mktime.c (not_equal_tm): Remove redundant check.
3453 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
3455 * getdate.y: Use Bison 1.875 features, and some minor
3456 code cleanups. This change does not affect semantics.
3457 Don't include <stdlib.h>; no longer needed.
3458 Don't include unlocked-io.h; only the "#if TEST" code uses
3459 stdio, and performance isn't crucial there.
3460 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
3461 Bison 1.875 features as described below.
3462 All uses of "PC." replaced by "pc->".
3463 (YYSTYPE): Add a forward declaration.
3464 (yylex, yyerror): Use full prototypes in forward decls.
3465 Use "%pure-parser" rather than obsolescent "%pure_parser".
3466 Use %parse-param and %lex-param instead of obsolescent
3467 YYPARSE_PARAM and YYLEX_PARAM.
3468 (meridian_table, month_and_day_table, time_units_table,
3469 relative_time_table, time_zone_table, military_table,
3470 lookup_zone, lookup_word, get_date):
3471 Use NULL instead of 0 where appropriate.
3472 (to_hour): Avoid abort (), to avoid a dependency on
3474 (yyerror, yylex): Now accepts parser_control * arg.
3475 (main) [TEST]: Use '\0' rather than 0 for char.
3477 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
3479 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
3480 It's now the caller's responsibility to handle the case where
3481 !HAVE_GETPAGESIZE && !defined getpagesize.
3483 * mktime.c (leapyear): Arg is long int, not int.
3485 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
3487 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
3489 2004-10-12 Simon Josefsson <jas@extundo.com>
3491 * getpass.c (fflush_unlocked, flockfile, funlockfile)
3492 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
3495 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
3497 * vsnprintf.h: New file.
3498 * vsnprintf.c: New file.
3500 2004-10-07 Bruno Haible <bruno@clisp.org>
3502 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
3503 into the provided buffer.
3505 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
3507 * diacrit.c, diacrit.h: Add GPL notice.
3509 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
3510 * atanl.c (atanl): Keep the code as similar to glibc as possible.
3511 * logl.c (logl): Keep the code as similar to glibc as possible.
3512 This avoids a potential constant-folding bug.
3514 2004-10-05 Bruno Haible <bruno@clisp.org>
3516 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
3518 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
3520 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
3521 * xmalloc.c (xmemdup): Likewise.
3522 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
3523 XFREE): Remove these long-obsolescent macros.
3524 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
3525 * xstrdup.c: Remove.
3527 * regex.c (re_comp): Cast gettext return value to char *,
3528 Problem reported by Martin Neitzel via Mark D. Baushke.
3530 2004-10-04 Simon Josefsson <jas@extundo.com>
3532 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
3533 '#ifdef USE_UNLOCKED_IO'.
3535 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
3537 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
3538 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
3539 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
3540 regex.c, sha1.c, version-etc.c, yesno.c:
3541 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
3542 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
3543 the includer's responsibility.
3545 Sync from coreutils.
3547 * modechange.c (mode_compile): Don't decrement a pointer that
3548 points to the start of a string, as the C Standard says the
3549 resulting behavior is undefined.
3551 * backupfile.h (enum backuptype): Rename none -> no_backups,
3552 simple -> simple_backups, numbered_existing ->
3553 numbered_existing_backups, numbered -> numbered_backups
3554 to avoid shadowing problems. All uses changed.
3555 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
3556 * backupfile.c (check_extension, numbered_backup):
3557 Rename locals to avoid shadowing 'basename'.
3558 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
3561 * .cppi-disable: Add getopt_.h, getopt_int.h.
3562 * .cvsignore: Add getopt.h.
3564 2004-10-04 Simon Josefsson <jas@extundo.com>
3566 * memmem.h: New file.
3567 * memmem.c: New file, taken from glibc.
3569 2004-10-02 Jim Meyering <jim@meyering.net>
3571 * dirfd.h, getpagesize.h: Add copyright notice.
3573 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
3575 * snprintf.c: Remove comments as to why each header is needed.
3577 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
3579 * strsep.h: New file.
3580 * strsep.c: New file.
3582 2004-10-01 Simon Josefsson <jas@extundo.com>
3584 * snprintf.c (snprintf): Handle size==0.
3586 2004-10-01 Simon Josefsson <jas@extundo.com>
3587 Bruno Haible <bruno@clisp.org>
3589 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
3590 (snprintf): Declare 'args'.
3592 2004-09-30 Simon Josefsson <jas@extundo.com>
3594 * snprintf.h, snprintf.c: New files.
3596 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3598 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
3599 (hol_entry_help): Never translate an empty string.
3600 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
3601 * argp.h (OPTION_NO_TRANS): New option.
3603 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
3605 * xvasprintf.c: Include xalloc.h.
3606 (xvasprintf): Use xalloc_die, not xmalloc_die.
3608 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
3610 * dummy.c: Change copyright notice to FSF, and license to GPL.
3612 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
3614 * argp-pvh.c (argp_program_version_hook): Provide initial value.
3615 Problem reported by Bruno Haible in:
3616 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
3618 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
3620 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
3621 in case some system header has #define'd it. Problem reported by
3622 Soeren D. Schulze in
3623 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
3625 2004-09-08 Bruno Haible <bruno@clisp.org>
3627 * stdint_.h: New file, taken from GNU clisp.
3629 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
3631 * xvasprintf.h: New file.
3632 * xvasprintf.c: New file.
3633 * xasprintf.c: New file.
3635 2004-09-08 Bruno Haible <bruno@clisp.org>
3637 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
3639 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
3641 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
3643 Import from coreutils.
3644 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
3645 strings on unbounded length. alloca's performance benefits aren't
3646 that important here.
3648 (parse_with_separator): New function, with most of the internals
3649 of the old parse_user_spec. Allow user to omit both user and group,
3650 for compatibility with FreeBSD.
3651 Clone only the user name, not the entire spec.
3652 Do not set *uid, *gid unless entirely successful.
3653 Avoid memory leak in some failing cases.
3654 Fix regression for USER.GROUP reported by Dmitry V. Levin in
3655 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
3656 (parse_user_spec): Rewrite to use parse_with_separator.
3658 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
3660 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
3661 its complicated substitute.
3662 * argp-help.c: Include <errno.h>, for program_invocation_short_name
3663 and program_invocation_name.
3664 (__argp_basename) [!_LIBC]: Remove; the only use was
3665 replaced by its body.
3666 (__argp_short_program_name): Change condition from
3667 !defined __argp_short_program_name to
3668 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
3669 to match argp-namefrob.h.
3670 (__argp_failure): Don't assume strerror_r returns char *.
3671 * argp-parse.c (N_): Define unconditionally.
3672 (argp_default_options): Fill out initializers with 0 to avoid
3675 2004-08-12 Simon Josefsson <jas@extundo.com>
3677 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
3678 * getopt_.h: Renamed from getopt.h.
3680 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
3682 Merge from coreutils.
3684 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
3685 wmemchr or wmemcpy. Problem reported by Robert Dahlem
3686 for Reliant Unix 5.43.
3688 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
3689 (union fooround): Use uintmax_t, not long int.
3690 The rest is a merge from libc:
3691 [defined _LIBC]: Include <shlib-compat.h>.
3692 (_obstack) [defined _LIBC]: Remove after 2.3.4.
3694 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
3696 * strverscmp.c: Convert to UTF-8.
3698 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
3700 * obstack.h (obstack_empty_p):
3701 Don't assume that chunk->contents is suitably aligned.
3702 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
3703 Likewise. Problem reported by Benno in
3704 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
3706 * chown.c (rpl_chown): Work even if the file is writeable but not
3707 readable. This could be improved further but it'd take some work.
3709 2004-08-08 Simon Josefsson <jas@extundo.com>
3711 * xgethostname.c: Don't include error.h (not used).
3714 * getpass.c: Include getpass.h first.
3716 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
3718 * xalloc-die.c: New files.
3719 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
3721 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
3722 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
3723 (_, N_, xalloc_die): Move to xalloc-die.c.
3724 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
3725 so that we needn't mess with xalloc_msg_memory_exhausted.
3727 * sha1.h: Renamed from sha.h.
3728 (SHA1_H): Renamed from _SHA_H.
3729 (sha1_ctx): Renamed from sha_ctx.
3730 (sha1_init_ctx): Renamed from sha_init_ctx.
3731 (sha1_process_block): Renamed from sha_process_block.
3732 (sha1_process_bytes): Renamed from sha_process_bytes.
3733 (sha1_finish_ctx): Renamed from sha_finish_ctx.
3734 (sha1_read_ctx): Renamed from sha_read_ctx.
3735 (sha1_stream): Renamed from sha_stream.
3736 (sha1_buffer): Renamed from sha_buffer.
3737 * sha1.c: Likewise; renamed from sha.c.
3738 Do not include <sys/types.h>.
3739 Include <stddef.h> rather than <stdlib.h>.
3741 2004-08-08 Bruno Haible <bruno@clisp.org>
3743 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
3744 FILESYSTEM_PREFIX_LEN.
3745 * progreloc.c: Likewise.
3746 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
3748 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
3751 * argp-help.c (make_hol, hol_append): Don't assume that
3752 SIZE_MAX is a valid preprocessor constant.
3753 (__argp_basename): Change from "#ifndef _LIBC"
3754 to "#ifndef __argp_short_program_name", so that
3755 we don't compile these functions for tar.
3757 More merges from coreutils.
3758 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
3759 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
3761 * addext.c: Remove; no longer needed.
3762 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
3763 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
3764 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
3765 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
3766 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
3767 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
3768 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
3769 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
3770 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
3771 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
3772 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
3773 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
3774 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
3775 Import changes from coreutils.
3777 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
3779 Merge from coreutils.
3781 * .gdb-history: Remove; this doesn't belong here.
3783 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
3784 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
3785 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
3787 * dirname.h: Include <stdbool.h>.
3788 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
3789 for consistency with POSIX terminology. All uses changed.
3790 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
3791 (strip_trailing_slashes): Use bool for booleans.
3792 * stripslash.c (strip_trailing_slashes): Likewise.
3794 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
3795 sometimes returns a positive errno value even when it succeeds.
3796 (print_errno_message) [!LIBC]: Fall back on strerror if
3799 * path-concat.c (mempcpy): Don't define if a system header defines it.
3800 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
3801 (longest_relative_suffix): New function.
3802 (path_concat): Use it. Assume first argument is not NULL.
3803 Port to DOS. Omit redundant separators.
3804 Report an error instead of returning NULL.
3805 Use mempcpy instead of memcpy.
3806 (xpath_concat): Remove: not declared or used.
3808 * same.h: Include <stdbool.h>
3809 (same_name): Return bool, not int.
3810 * same.c (same_name): Likewise.
3811 (errno): Don't declare; we assume C89 or better now.
3813 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
3814 if not already defined.
3816 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
3817 * dup-safer.c (errno): Likewise.
3819 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
3821 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
3824 2004-08-03 Simon Josefsson <jas@extundo.com>
3826 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
3827 * progname.h: Don't include stdbool.h.
3829 2004-08-02 Simon Josefsson <jas@extundo.com>
3831 * getsubopt.h: New file, with comments from Bruno Haible.
3832 * getsubopt.c: New file, from glibc, but slightly modified based on
3833 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
3835 2004-08-01 Simon Josefsson <jas@extundo.com>
3837 * xgetdomainname.c: Include stdlib.h, for free().
3839 2004-07-16 Simon Josefsson <jas@extundo.com>
3841 * dummy.c: New file.
3843 2004-07-16 Bruno Haible <bruno@clisp.org>
3845 * backupfile.h: Add extern "C" for C++.
3846 * closeout.h: Likewise.
3847 * copy-file.h: Likewise.
3848 * findprog.h: Likewise.
3849 * full-write.h: Likewise.
3850 * pathname.h: Likewise.
3851 * progname.h: Likewise.
3852 * stpcpy.h: Likewise.
3853 * stpncpy.h: Likewise.
3854 * strcase.h: Likewise.
3855 * strstr.h: Likewise.
3856 * xalloc.h: Likewise.
3858 * mbswidth.h: Add extern "C" for C++.
3859 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
3861 2004-07-09 Simon Josefsson <jas@extundo.com>
3863 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
3864 failed without this.)
3866 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
3868 * fchown-stub.c: New file.
3870 2004-06-24 Jim Meyering <jim@meyering.net>
3872 * obstack.h (obstack_base): Cast to (void *), per documentation.
3874 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
3876 * argz.c, argz_.h: New files, which are autoupdated from libtool.
3878 2004-06-01 Jim Meyering <jim@meyering.net>
3880 * calloc.c: New file.
3882 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
3884 * getdate.y (yylex): Allow space between sign and number.
3885 Problem reported by Dan Jacobson.
3887 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
3888 and Jim Meyering <jim@meyering.net>
3890 Merge from coreutils CVS.
3892 * stat-macros.h: New file, with contents from file-type.h
3893 and coreutils' system.h.
3894 * file-type.c: Include "stat-macros.h".
3895 * file-type.h (file_type): Move all macro definitions to new file,
3898 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
3899 Wrap old code with this conditional.
3900 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
3901 function that does not dereference symlinks.
3902 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
3904 * xreadlink.c: Include xreadlink.h first, to catch .h file
3905 dependency problems.
3906 (xreadlink): Accept new arg SIZE, for efficiency.
3907 All decls and uses changed.
3908 * xreadlink.h: Include <stddef.h>, for size_t.
3910 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
3911 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
3913 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
3915 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
3917 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
3918 macros to be defined.
3919 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
3920 the allocator returns NULL because the requested size is zero.
3922 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3924 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
3925 var. Add comment explaining why libc still defines it. This
3926 merges the following patch from glibc:
3927 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
3929 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
3931 * obstack.c (_obstack): Remove unused variable. It hasn't been
3932 present in glibc since revision 1.1 of this file.
3933 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
3934 obstack_alignment_mask, obstack_alloc, obstack_base,
3935 obstack_blank, obstack_blank_fast, obstack_chunk_size,
3936 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
3937 obstack_grow0, obstack_init, obstack_int_grow,
3938 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
3939 obstack_next_free, obstack_object_size, obstack_ptr_grow,
3940 obstack_ptr_grow_fast, obstack_room): Remove declarations of
3941 nonexistent functions.
3943 2004-05-17 Derek R. Price <derek@ximbiot.com>
3944 Paul Eggert <eggert@cs.ucla.edu>
3946 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
3948 2004-05-14 Bruno Haible <bruno@clisp.org>
3950 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
3951 that consists of a '.' followed by an empty digit string.
3952 Patch by Tor Lillqvist <tml@iki.fi>.
3954 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
3956 Port obstack to the AS/400, where pointers are 16 bytes wide and
3957 you cannot cast an integer to a valid pointer. This patch is
3958 currently waiting to be integrated into glibc; see
3959 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
3961 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
3962 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
3963 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
3964 (struct obstack): temp member is now a union of a pointer and
3965 an integer, instead of an integer. All integer uses changed.
3966 This does not affect the physical layout of struct obstack,
3967 except on hosts (like the AS/400) where the size or alignment of
3968 void * is greater than that of ptrdiff_t.
3969 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
3970 __STDC__)]: Store temporary in pointer member of union, not
3972 * obstack.c: Include <stddef.h>, for offsetof.
3973 (struct fooalign): Remove; it doesn't need a name.
3974 (union fooround): Change double to long double, and add void *.
3975 (DEFAULT_ALIGNMENT): Use offsetof to compute.
3976 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
3977 not a macro. Hence the values are always int; so remove all
3978 casts-to-int in uses.
3980 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
3981 Derek Price <derek@ximbiot.com>
3983 * alloca.c: Include <alloca.h>, to get our interface.
3984 * alloca_.h: Use __alloca on AIX, so that we don't have to
3985 include <alloca.h> first. Use C89 prototype for alloca; this
3986 requires including <stddef.h> for size_t. Use extern "C" if C++.
3987 Use #elif for simplicity, since we can assume C89 now.
3988 Don't try to source the system alloca.h since it will not be found
3989 and to prevent recursively including its replacement.
3990 * fnmatch.c: Include <alloca.h> instead of opencoding.
3991 * regex.c: Likewise.
3993 2004-05-16 Derek Price <derek@ximbiot.com>
3994 Paul Eggert <eggert@cs.ucla.edu>
3996 getline cleanup. This changes the getndelim2 API: both order of
3997 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
4000 * getline.c: Don't include stddef.h or stdio.h, since our
4001 interface does that.
4002 (getline): Always use getdelim, so that we don't have two
4003 copies of this code.
4004 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
4006 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
4007 (GETNDELIM2_MAXIMUM): New macro.
4008 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
4009 instead of the old practice of delim2==0. All callers changed.
4010 Return -1 on overflow, instead of returning junk.
4011 Do not set *linesize unless allocation succeeds.
4012 * getndelim2.h: Do not include stddef.h; no longer needed, now
4013 that we include sys/types.h.
4014 * getnline.h: Likewise.
4015 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
4016 (getndelim2): Reorder arguments.
4017 * getnline.c (getnline, getndelim):
4018 Don't discard the NMAX argument.
4019 (getnline): Invoke getndelim, to avoid code duplication.
4020 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
4021 of (size_t) -1 by callers of the getnline family.
4023 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
4025 * nanosleep.c (suspended): Change its type from int to
4026 sig_atomic_t volatile.
4027 (first_call): Make it private to rpl_nanosleep, and have it
4028 be zero initially as that's a bit faster.
4029 (my_usleep): Round up fractional times instead of truncating them,
4030 as this is the usual meaning for 'sleep'.
4032 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
4034 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
4035 (ENOSYS): Define if not defined.
4036 (settime): Fall back on stime if it exists and settimeofday fails.
4037 But don't bother with fallbacks if a method fails with errno == EPERM.
4039 2004-05-11 Jim Meyering <jim@meyering.net>
4041 Prior to this change, the save_cwd caller required read access to the
4042 current directory on most systems (ones with the fchdir function).
4044 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
4045 fails, try write-only, and finally, resort to using xgetcwd.
4047 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
4049 * obstack.c, obstack.h: Import changes from libc.
4051 2004-04-28 Bruno Haible <bruno@clisp.org>
4053 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
4054 implicitly appends .exe to executables.
4055 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
4056 accepts Windows pathnames.
4057 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
4058 Cygwin like Windows, since it now accepts Windows pathnames.
4059 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
4060 Cygwin like Windows, since it now accepts Windows pathnames.
4061 Reported by Derek Robert Price <derek@ximbiot.com>.
4063 2004-04-20 Jim Meyering <jim@meyering.net>
4065 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
4067 2004-04-20 Jim Meyering <jim@meyering.net>
4068 Bruno Haible <bruno@clisp.org>
4070 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
4071 memory when realloc fails.
4073 2004-04-18 Jim Meyering <jim@meyering.net>
4075 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
4076 don't leak memory and do call END_UTMP_ENT.
4078 2004-04-11 Paul Eggert <eggert@twinsun.com>
4080 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
4081 (CHAR_BIT): Remove, since we assume C89.
4082 Include <stdint.h> if available, as per current Autoconf CVS advice.
4084 2004-03-30 Paul Eggert <eggert@twinsun.com>
4086 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
4087 not bool, to be more consistent with Unix conventions.
4088 Suggested by Bruno Haible.
4090 Merge from coreutils.
4092 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
4095 * getdate.h: Include stdbool.h, and timespec.h instead of
4096 the usual <time.h> dance.
4097 (get_date): Change signature to support fractional time stamps.
4098 All callers changed.
4099 * getdate.y: Include "getdate.h" first, as we can now
4100 assume C89 and don't need to worry about 'const'.
4101 Similarly, include "unlocked-io.h" near start, not in middle.
4103 (textint.value): Use long int rather than int.
4104 (textint.digits): Use size_t rather than int.
4105 (BILLION, LOG10_BILLION): New constants.
4106 (parser_control): New member rel_ns. Members day_ordinal,
4107 time_zone, month, day, hour, minutes, rel_year, rel_month,
4108 rel_day, rel_hour, rel_minutes, rel_seconds
4109 are now long int, not int. Member seconds is now struct timespec,
4110 not int. New member timespec_seen. Members dates_seen, days_seen,
4111 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
4113 (%union.intval): Now long int, not int.
4114 New member timespec.
4115 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
4116 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
4117 (spec): Now is a timespec or an item list.
4118 (timespec, items): New nonterminals.
4119 (time, rel, relunit, number, get_date):
4120 Add support for fractional seconds.
4121 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
4122 (gmtime, localtime, mktime): Remove decls; not needed with C89.
4123 (to_hour): First arg is now long int, not int.
4124 (to_year): Returns long int, not int.
4125 Don't treat year -70 like 70.
4126 (tm_diff): Returns long int, not int.
4127 (lookup_word): Use bool instead of int when appropriate.
4128 (yylex): Use size_t for count, not int.
4129 Detect overflow when parsing large integer constants.
4130 Add support for fractions.
4131 (get_date): Make pointers 'const' if possible.
4132 Use more-portable code to detect integer overflow.
4133 (main) [TEST]: Adjust to above changes. Test for localtime failure.
4134 Don't use ctime; it's not reliable if the year has >4 digits.
4136 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
4137 This is for compatibility with BSD.
4139 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
4140 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
4141 From coreutils' system.h.
4143 * userspec.c: Don't include "posixver.h".
4144 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
4145 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
4146 compatible extension. Simplify code by removing a boolean int
4147 that was always nonzero if a string was nonnull.
4149 2004-03-30 Jim Meyering <jim@meyering.net>
4151 Merge from coreutils.
4153 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
4155 * readtokens.c (readtoken): Don't leak 64 bytes when reading
4156 an empty input stream.
4158 * readtokens.c: Include <stdbool.h>.
4159 (readtoken): Use `size_t' rather than int/long.
4160 All callers adjusted.
4161 Use `bool' rather than `int' where appropriate.
4162 Use memset rather than an explicit loop.
4163 Use x2nrealloc rather than xrealloc.
4164 Allow the use of `\0' as a delimiter.
4165 (readtokens): Likewise.
4166 * readtokens.h (readtoken, readtokens): Update prototypes.
4168 2004-03-30 Bruno Haible <bruno@clisp.org>
4170 * getloadavg.c (getloadavg): Don't assume setlocale returns
4173 2004-03-29 Paul Eggert <eggert@twinsun.com>
4175 Merge changes to getloadavg.c from coreutils and Emacs.
4177 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
4178 Define to an expression, not to the empty string.
4179 Include cloexec.h and xalloc.h.
4180 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
4181 Use set_cloexec_flag rather than rolling our own.
4182 * cloexec.c, cloexec.h: New files.
4184 2004-03-18 Paul Eggert <eggert@twinsun.com>
4186 * getopt.h: Sync with libc CVS.
4188 2004-03-18 Paul Eggert <eggert@twinsun.com>
4189 Bruno Haible <bruno@clisp.org>
4191 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
4192 not on all platforms that have <wchar.h>.
4193 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
4195 2004-03-09 Paul Eggert <eggert@twinsun.com>
4197 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
4199 * getopt_int.h: New file, also synced from libc.
4201 2004-03-07 Paul Eggert <eggert@twinsun.com>
4203 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
4204 '#if' expressions. Unlike the code it replaces, it does not
4205 depend on (defined _SC_PAGESIZE). However, it does depend on
4206 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
4207 first reported by Jason Andrade in
4208 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
4210 2004-01-18 Simon Josefsson <jas@extundo.com>
4212 * strdup.h: New file.
4213 * strdup.c: Include it.
4214 * path-concat.c: Include strdup.h. Drop strdup declaration.
4215 * userspec.c: Include strdup.h. Drop strdup declaration.
4217 2004-02-06 Karl Berry <karl@gnu.org>
4219 * config.charset: update from gettext 0.14.1.
4221 2004-02-05 Paul Eggert <eggert@twinsun.com>
4223 Add comments and code, prompted by suggestions from Bruno Haible
4225 * quotearg.h (quotearg_alloc): New decl. Improve the comments
4226 describing the enum quoting_style values.
4227 * quotearg.c (quotearg_alloc): New function.
4228 (quotearg_buffer_restyled): Treat lone { and } as special.
4229 Treat = as special. Work around bug with older shells
4230 that "see" a '\' that is really the 2nd byte of a multibyte char.
4231 Quote empty string with shell_quoting_style.
4233 2004-02-03 Bruno Haible <bruno@clisp.org>
4235 * pipe.h: New file, from GNU gettext.
4236 * pipe.c: New file, from GNU gettext.
4238 2004-01-27 Bruno Haible <bruno@clisp.org>
4240 * execute.h: New file, from GNU gettext.
4241 * execute.c: New file, from GNU gettext.
4242 * w32spawn.h: New file, from GNU gettext.
4244 2004-01-23 Paul Eggert <eggert@twinsun.com>
4246 Exit-status fix from coreutils.
4248 Use exit_failure consistently in place of EXIT_FAILURE,
4249 so that program exit statuses are consistent on failure.
4251 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
4252 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
4253 * argmatch.h: Comment fix to match the above.
4254 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
4255 Now a macro referring to exit_failure, instead of a separate
4256 variable. Include "exitfail.h" to get it.
4257 * xstrtol.h: Include "exitfail.h".
4258 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
4260 * long-options.c (parse_long_options): Use prototype
4261 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
4264 2004-01-21 Jim Meyering <jim@meyering.net>
4266 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
4267 so as not to conflict with a different-sized __mktime_internal
4268 function in GNU libc.
4269 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
4270 Problem building statically-linked `ls' reported by Michael Brunnbauer.
4272 2004-01-18 Paul Eggert <eggert@twinsun.com>
4274 Merge from diffutils.
4276 * file-type.c (file_type): Add typed memory objects.
4277 * file-type.h (S_TYPEISTMO): New macro.
4279 * c-stack.h (c_stack_action): Remove argv argument.
4280 * c-stack.c (c_stack_action): Likewise. All uses changed.
4281 (die): Don't calculate message unless segv_action returns.
4282 (get_stack_location, min_address_from_argv, max_address_from_argv,
4283 volatile stack_base, volatile_stack_size): Remove.
4284 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
4285 that every segmentation violation is a stack overflow. (Ouch!)
4286 See Debian bug 136249 (still outstanding) for more info about why
4287 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
4289 2003-11-30 Bruno Haible <bruno@clisp.org>
4291 Safer stack allocation.
4292 * setenv.c: Include allocsa.h.
4293 (alloca): Remove fallback definition.
4294 (freea): Remove macro.
4295 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
4298 2003-10-17 Bruno Haible <bruno@clisp.org>
4300 * binary-io.h: Avoid warnings on Cygwin.
4302 2003-12-28 Bruno Haible <bruno@clisp.org>
4304 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
4305 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
4307 2003-11-28 Bruno Haible <bruno@clisp.org>
4309 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
4311 2003-11-27 Bruno Haible <bruno@clisp.org>
4313 * wait-process.c: On Windows, include windows.h. Needed on mingw.
4315 2003-11-17 Bruno Haible <bruno@clisp.org>
4317 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
4319 2003-11-24 Bruno Haible <bruno@clisp.org>
4321 * xallocsa.h: New file, from GNU gettext.
4322 * xallocsa.c: New file, from GNU gettext.
4324 2003-11-24 Bruno Haible <bruno@clisp.org>
4326 * allocsa.h: New file, from GNU gettext.
4327 * allocsa.c: New file, from GNU gettext.
4329 2003-11-24 Bruno Haible <bruno@clisp.org>
4331 * eealloc.h: New file.
4333 2004-01-15 Jim Meyering <jim@meyering.net>
4335 Merge from coreutils.
4337 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
4338 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
4339 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
4341 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
4342 optional configure-time default.
4344 * version-etc.c (version_etc_copyright): Update copyright date.
4346 * xreadlink.c (xreadlink): Correct outdated comment.
4348 2004-01-15 Paul Eggert <eggert@twinsun.com>
4350 Merge from coreutils.
4352 * posixver.c: Include posixver.h.
4354 * same.c: Include <stdbool.h>, <limits.h>.
4355 (_POSIX_NAME_MAX): Define if not defined.
4357 (same_name): If file names are silently truncated, report
4358 that the file names are the same if they are the same after
4359 the silent truncation.
4361 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
4362 conversion function.
4363 * xstrtod.c (xstrtod): Likewise. All callers changed to
4364 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
4367 2004-01-14 Paul Eggert <eggert@twinsun.com>
4369 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
4370 with like-named macro in fnmatch.c.
4371 (EXT): Use an internal constant instead.
4373 Merge fnmatch patches from glibc.
4374 * fnmatch.c (mbsinit): Remove define.
4375 Add libc_hidden_ver (__fnmatch, fnmatch).
4376 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
4377 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
4379 2003-12-14 Karl Berry <karl@gnu.org>
4381 * config.charset: update from gettext-runtime.
4383 2003-12-03 Paul Eggert <eggert@twinsun.com>
4385 * getgroups.c (getgroups): xmalloc takes one argument, not two.
4386 Bug reported by Alfred M. Szmidt.
4388 2003-11-29 Karl Berry <karl@gnu.org>
4390 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
4392 2003-11-23 Paul Eggert <eggert@twinsun.com>
4393 Bruno Haible <bruno@clisp.org>
4395 * printf-parse.h: Don't include sys/types.h.
4396 (ARG_NONE): New macro.
4397 (char_directive): Change type of *arg_index fields to size_t.
4398 * printf-parse.c: Don't include sys/types.h.
4399 (SSIZE_MAX): Remove macro.
4400 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
4401 Remove unnecessary overflow check.
4402 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
4405 2003-11-24 Paul Eggert <eggert@twinsun.com>
4407 * alloca.c: Remove dependency on xalloc module.
4408 (xalloc_die): Remove.
4409 (memory_full) [!defined emacs]: New macro.
4410 [!defined emacs]: Don't include xalloc.h.
4411 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
4412 address arithmetic overflows. Change datatypes a bit to avoid
4415 2003-11-22 Jim Meyering <jim@meyering.net>
4417 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
4419 2003-11-17 Bruno Haible <bruno@clisp.org>
4421 * vasnprintf.c (alloca): Remove fallback definition.
4422 (freea): Remove definition.
4423 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
4424 Reported by Paul Eggert.
4426 2003-11-17 Jim Meyering <jim@meyering.net>
4428 On systems without utime and without a utimes function capable of
4429 dealing with a NULL struct utimbuf* argument, this utime replacement
4430 could -- in unusual circumstances -- leak a file descriptor.
4431 * utime.c: Include <unistd.h> and <errno.h>.
4432 (utime_null): Be sure to close `fd' and to preserve errno.
4433 Reported by Geoff Collyer via Arnold Robbins.
4435 2003-11-16 Paul Eggert <eggert@twinsun.com>
4436 Bruno Haible <bruno@clisp.org>
4438 Protect against address arithmetic overflow.
4439 * printf-args.h: Include stddef.h.
4440 (arguments): Change type of field 'count' to size_t.
4441 * printf-args.c (printf_fetchargs): Use size_t instead of
4442 'unsigned int' where appropriate.
4443 * printf-parse.h: Include sys/types.h.
4444 (char_directive): Change type of *arg_index fields to ssize_t.
4445 (char_directives): Change type of fields 'count', max_*_length to
4447 * printf-parse.c: Include sys/types.h and xsize.h.
4448 (SSIZE_MAX): Define fallback value.
4449 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
4450 instead of 'int' where appropriate. Check a_allocated, d_allocated
4451 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
4452 * vasnprintf.c: Include xsize.h.
4453 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
4454 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
4455 overflow. Avoid wraparound when converting a width or precision from
4458 2003-11-16 Bruno Haible <bruno@clisp.org>
4460 Update from GNU gettext.
4461 * printf-parse.c: Generalize to it can be compiled for wide strings.
4462 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
4463 * vasnprintf.c: Generalize to it can be compiled for wide strings.
4464 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
4465 SNPRINTF): New macros.
4466 Don't include <alloca.h> if the file is used inside libintl.
4467 (local_wcslen): New function, for Solaris 2.5.1.
4468 (VASNPRINTF): Use it instead of wcslen.
4470 2003-11-16 Bruno Haible <bruno@clisp.org>
4472 * xsize.h (xmax): New function.
4473 (xsum, xsum3, xsum4): Declare as "pure" functions.
4475 2003-11-12 Paul Eggert <eggert@twinsun.com>
4477 * xalloc.h: Do not include <limits.h> or <stdint.h>.
4478 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
4479 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
4480 heuristic is just as accurate as far as we know, and it removes a
4481 dependency on size_max.m4 and ptrdiff_max.m4.
4483 2003-11-12 Paul Eggert <eggert@twinsun.com>
4485 * xstrtol.c (__xstrtol): Remove "break" immediately after
4486 "return", to pacify some unknown compiler. Problem reported
4489 2003-11-11 Bruno Haible <bruno@clisp.org>
4491 * xsize.h (SIZE_MAX): Remove fallback definition.
4492 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
4495 2003-11-10 Paul Eggert <eggert@twinsun.com>
4497 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
4498 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
4499 rejected some allocations of exactly SIZE_MAX - 2 bytes.
4501 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
4502 not (size_t) -1, since it's defined here.
4504 2003-11-06 Paul Eggert <eggert@twinsun.com>
4506 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
4507 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
4508 Reject sizes of exactly SIZE_MAX bytes.
4509 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
4510 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
4512 2003-11-05 Bruno Haible <bruno@clisp.org>
4514 * xsize.h: Include limits.h, to avoid a possible collision with
4515 SIZE_MAX defined in <limits.h> on Solaris.
4517 2003-11-04 Bruno Haible <bruno@clisp.org>
4519 * xsize.h: New file.
4520 * linebreak.c: Include xsize.h.
4521 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
4522 argument for overflow.
4523 Suggested by Paul Eggert.
4525 2003-10-31 Bruno Haible <bruno@clisp.org>
4527 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
4528 to avoid (extremely rare) race condition.
4529 Suggested by Paul Eggert.
4531 2003-11-03 Jim Meyering <jim@meyering.net>
4533 * userspec.c: Include "userspec.h".
4534 * userspec.h: New file.
4536 2003-10-31 Paul Eggert <eggert@twinsun.com>
4538 * mountlist.h (struct mount_entry.me_type_malloced): New member.
4539 * mountlist.c (SIZE_MAX): Define if not defined already.
4540 (read_filesystem_list): Set and use me_type_malloced.
4541 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
4542 whatever the type happens to be), for brevity and consistency.
4543 Check for size calculation overflow on Alphas running OSF/1.
4545 2003-10-31 Jim Meyering <jim@meyering.net>
4547 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
4549 * linebuffer.c: Include <string.h> for declaration of memset.
4551 2003-10-30 Paul Eggert <eggert@twinsun.com>
4552 Bruno Haible <bruno@clisp.org>
4554 * vasprintf.c: Include <limits.h>, <stdlib.h>.
4555 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
4557 2003-10-29 Paul Eggert <eggert@twinsun.com>
4559 * xalloc.h (xalloc_oversized): Now a macro, not a function,
4560 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
4562 * quotearg.c (quotearg_n_options): Use it.
4563 * group-member.c: Include <stdbool.h>.
4564 (free_group_info): Arg is now const *; don't free arg.
4565 (get_group_info): Now returns bool and accepts struct group_info *,
4566 rather than returning a malloc'ed struct group_info *.
4567 All uses changed. Check for overflow in internal size calculation.
4569 * getusershell.c (readname): Simplify the code by using x2nrealloc
4570 rather than xmalloc/xrealloc.
4571 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
4572 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
4573 conformance bug: the old code used a pointer after freeing the
4574 storage that it addressed.
4575 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
4576 rather than doing it by hand.
4577 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
4578 the buffer preserved. Use free and xmalloc instead.
4579 * quotearg.c (quotearg_n_options): Likewise.
4580 Use a simpler test for size overflow. Don't use xalloc_oversized
4581 because unsigned int might be wider than size_t (!); this suggests
4582 that we should switch from unsigned int to size_t for slot numbers.
4584 2003-10-27 Bruno Haible <bruno@clisp.org>
4586 * stdbool_.h: Better support for BeOS.
4588 2003-10-27 Paul Eggert <eggert@twinsun.com>
4590 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
4591 to allocate the returned structure. Do not allocate a subarray,
4592 as x2nrealloc will do that.
4593 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
4594 instead of xnrealloc.
4595 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
4597 2003-10-26 Paul Eggert <eggert@twinsun.com>
4599 * xalloc.h (xalloc_oversized): New static inline function, for
4600 callers that want to do their own size-overflow checking. Include
4601 <stdbool.h>, since xalloc_oversized returns bool.
4602 * xalloc.c (array_size_overflow): Remove. All callers changed
4603 to use xalloc_oversized.
4605 Add two functions x2realloc, x2nrealloc, for programs that grow
4606 arrays dynamically by doubling their sizes.
4607 * xalloc.h (x2realloc, x2nrealloc): New decls.
4608 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
4611 Port to C99 semantics for 'inline' of external functions.
4612 Bug reported by Bruno Haible.
4613 * xmalloc.c (xnmalloc_inline): New static inline function,
4614 with the old contents of xnmalloc.
4615 (xnmalloc, xmalloc): Use it.
4616 (xnrealloc_inline): New static inline function,
4617 with the old contents of xnrealloc.
4618 (xnrealloc, xrealloc): Use it.
4620 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
4622 2003-10-25 Paul Eggert <eggert@twinsun.com>
4624 Fix several address-calculation bugs in the hash modules,
4625 plus some minor code cleanup.
4627 * hash.h: Include <stdbool.h>, for bool.
4628 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
4629 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
4630 hash_get_n_entries, hash_get_max_bucket_length,
4631 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
4632 hash_rehash): Use size_t rather than unsigned.
4633 * hash.c (struct hash_table, hash_get_n_buckets,
4634 hash_get_n_buckets_used, hash_get_n_entries,
4635 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
4636 hash_get_entries, hash_do_for_each, hash_string, is_prime,
4637 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
4639 (SIZE_MAX): Define if not defined.
4640 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
4641 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
4643 Use const * when possible.
4644 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
4645 (check_tuning): Fix bug: if tuning parameters were very close to
4646 0 or 1, rounding errors could have caused subscript violations.
4647 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
4648 (hash_initialize): Add 'fail:' label
4649 to free table and return NULL, and use it to simplify code.
4650 Use calloc rather than clearing the storage ourself.
4651 (hash_initialize, hash_rehash): Check for arithmetic overflow in
4652 buffer size calculations.
4653 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
4654 Include <stddef.h>, for size_t.
4655 * hash-pjw.c (hash_pjw): Likewise.
4656 Switch to method described by Bruno Haible.
4657 Include <limits.h>, for CHAR_BIT.
4658 (SIZE_BITS): New macro.
4660 2003-10-21 Paul Eggert <eggert@twinsun.com>
4662 * getndelim2.c (getndelim2): When size calculation overflows,
4663 ceiling the allocation at NMAX bytes rather than silently
4664 discarding input bytes before NMAX is reached. This makes
4665 a difference only if NMAX exceeds SIZE_MAX / 2.
4667 * obstack.c: Merge from glibc.
4668 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
4669 Add libc_hidden_def (_obstack_newchunk).
4670 (_obstack_free) [! defined _LIBC]: Remove.
4671 [defined _LIBC]: Make a strong alias from obstack_free, rather than
4672 a clone of the function body.
4673 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
4674 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
4676 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
4677 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
4680 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
4681 (obstack_ptr_grow_fast, obstack_int_grow_fast):
4682 Don't use lvalue casts, as GCC plans to remove support for them
4683 in GCC 3.5. Reported by Joseph S. Myers. This bug
4684 was also present in the non-GCC version, indicating that this
4685 code had always been buggy and had never been widely used.
4686 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
4687 Use the fast variant of each macro, rather than copying the
4688 definiens of the fast variant; that way, we'll be more likely to
4689 catch future bugs in the fast variants.
4691 2003-10-20 Bruno Haible <bruno@clisp.org>
4693 * wait-process.h: New file, from GNU gettext.
4694 * wait-process.c: New file, from GNU gettext.
4696 2003-10-19 Jim Meyering <jim@meyering.net>
4698 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
4700 2003-10-16 Paul Eggert <eggert@twinsun.com>
4702 * getgroups.c: Include <errno.h>, <stdlib.h>.
4703 (getgroups): First arg is int, not size_t.
4704 Don't let 'free' mangle errno.
4706 2003-10-16 Jim Meyering <jim@meyering.net>
4708 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
4710 2003-10-15 Paul Eggert <eggert@twinsun.com>
4712 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
4714 (new_exclude, add_exclude_file): Initial size no longer needs to
4716 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
4717 our own address arithmetic overflow checking.
4719 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
4720 (fnmatch): Do not alloca more than 2000 wide characters;
4721 instead, use malloc for large buffers.
4722 Check for address arithmetic overflow, and return -1
4723 with errno set to ENOMEM in that case.
4724 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
4725 (NEW_PATTERN): Do not alloca more than 8000 bytes;
4726 instead, return -1. Check for address arithmetic overflow.
4728 2003-10-14 Paul Eggert <eggert@twinsun.com>
4730 Handle invalid suffixes and overflow independently, so that
4731 callers can treat them independently as needed. Fix some bugs in
4732 suffix handling, e.g., "100k@" was not diagnosed as an invalid
4733 suffix for a human-readable blocksize. The major caller-visible
4734 change is the addition of a new
4735 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
4736 that both overflow and suffix chars were found.
4738 * human.c (humblock): Don't check separately for invalid suffix
4739 char; that is xstrtoumax's job (now that its bug is fixed).
4740 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
4741 INTMAX_MAX]: New macros.
4742 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
4743 TYPE_MAXIMUM): New macros.
4744 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
4745 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
4746 if overflow occurs, as it's what __strtol does and it's more useful
4748 (__xstrtol): If __strtol reports some error other than ERANGE,
4749 reflect it to the caller as LONGINT_INVALID. If it reports
4750 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
4751 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
4752 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
4754 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
4755 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
4756 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
4757 [defined UINTMAX_MAX]: New macros.
4759 2003-10-14 Bruno Haible <bruno@clisp.org>
4761 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
4762 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
4763 Also use volatile where needed.
4765 2003-10-12 Paul Eggert <eggert@twinsun.com>
4767 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
4768 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
4769 and define in terms of the other primitives.
4770 * xmalloc.c: Include stdbool.h; do not include exit.h.
4771 (SIZE_MAX): Define if not already defined.
4772 (array_size_overflow): New function.
4773 (xalloc_die): Abort instead of exiting if 'error' returns.
4774 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
4775 (xmalloc, xrealloc): Use them.
4776 (xcalloc): Check for address arithmetic overflow.
4777 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
4778 a bit faster than strcpy.
4780 2003-10-08 Paul Eggert <eggert@twinsun.com>
4782 Merge getpass from libc, plus a few fixes.
4784 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
4785 Include <stdbool.h>.
4786 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
4787 __fsetlocking to empty.
4788 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
4789 do include <bits/libc-lock.h>.
4790 Do not include <fcntl.h>; not needed.
4791 [_LIBC]: Include <wchar.h>.
4792 (NOTCANCEL_MODE): New macro.
4793 (flockfile, funlockfile) [_LIBC]: New macros.
4794 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
4795 [!_LIBC]: New macros.
4796 (call_fclose): New function.
4797 (getpass): Use it. Save tty stream separately; this simplifies the
4798 code and makes it more reliable if stdin happens to equal stdout.
4799 Invoke __fsetlocking on tty.
4800 Handle thread cancellation if needed.
4801 Namespace cleanup (use __tcgetattr, __getline).
4802 Use bool for Booleans.
4803 [USE_IN_LIBIO]: Handle wide streams.
4804 [!_LIBC]: Unconditionally do the fseek, since we don't know what
4805 stream might go where.
4807 * unlocked-io.h: Include <stdio.h>, so that the caller
4808 doesn't have to include <stdio.h> before us.
4809 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4810 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4811 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4812 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4813 if not declared, so that we can use getpass.c code from libc without
4815 (flockfile, ftrylockfile, funlockfile): New macros.
4817 2003-10-06 Bruno Haible <bruno@clisp.org>
4819 * version-etc-2.h: Remove file.
4820 * version-etc-2.c: Remove file.
4822 2003-09-25 Jim Meyering <jim@meyering.net>
4823 Bruno Haible <bruno@clisp.org>
4825 This lets translators provide better translations for the
4826 "Written by ..." part of --version output.
4827 * version-etc.h: Include stdarg.h.
4828 (version_etc_copyright): Declare as readonly.
4829 (version_etc): Make this function variadic with a NULL-terminated list
4830 of author name strings.
4831 (version_etc_va): New declaration.
4832 * version-etc.c: Include stdarg.h, stdlib.h.
4833 (version_etc_copyright): Declare as readonly.
4834 (version_etc_va): New function. Provide a different translatable string
4835 for each possible number of authors < 10. Abbreviate when there are 10
4837 (version_etc): Make this function variadic. Call version_etc_va.
4838 Suggestion from Gary V. Vaughan.
4840 * long-options.h (parse_long_options): Change prototype: the authors
4841 string is moved to the end and becomes variadic.
4842 * long-options.c: Include stdarg.h.
4843 (parse_long_options): Make this function variadic, too.
4844 Call version_etc_va, not version_etc.
4846 2003-10-06 Bruno Haible <bruno@clisp.org>
4848 * fatal-signal.h: New file, from GNU gettext.
4849 * fatal-signal.c: New file, from GNU gettext.
4851 2003-10-04 Karl Berry <karl@gnu.org>
4853 * argp*: update from libc.
4855 2003-10-01 Larry Jones <lawrence.jones@eds.com>
4857 * getpass.c (getpass): Use a no-op fseek when switching from input to
4858 output mode on the same stream.
4860 2003-09-29 Paul Eggert <eggert@twinsun.com>
4862 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4863 Fix arg typo in previous patch.
4865 2003-09-28 Jim Meyering <jim@meyering.net>
4867 * error.c: Correct cpp indentation.
4869 2003-09-27 Paul Eggert <eggert@twinsun.com>
4871 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
4872 Omit the special code that used __typeof__, since we worry that
4873 it could be more trouble than it's worth. See:
4874 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
4875 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
4879 2003-09-26 Jim Meyering <jim@meyering.net>
4881 * error.c (error_tail): Move some declarations
4882 into inner scope where the local variables are used.
4884 2003-09-26 Bruno Haible <bruno@clisp.org>
4886 * stpncpy.h (gnu_stpncpy): New declaration.
4887 (stpncpy): Define as alias for gnu_stpncpy.
4888 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
4890 2003-09-26 Paul Eggert <eggert@twinsun.com>
4892 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
4893 (error_tail): Do not loop, reallocating temporary buffer, since
4894 the output cannot contain more wide characters than the input
4895 contains bytes, the size must be big enough already. This avoids
4896 one potential size overflow calculation. Check for size overflow
4897 when calculating temporary buffer size. Free temporary buffer
4898 when done, if it was allocated with malloc; this plugs a memory
4899 leak. Remove casts from void * to pointers, that are no longer
4900 needed now that we're assuming C89 or better.
4902 Merge error changes from glibc.
4904 * error.c, error.h: Update copyright notice header to match glibc.
4905 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
4906 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
4907 Disable cancellation while printing error.
4908 * error.h: Prepend __ to parameter names.
4910 2003-09-25 Karl Berry <karl@gnu.org>
4912 * argp-fmtstream.c, argp-help.c: update from libc.
4914 2003-09-25 Bruno Haible <bruno@clisp.org>
4916 * version-etc-2.h: New file, from version-etc.h with modifications.
4917 * version-etc-2.c: New file, from version-etc.c with modifications.
4919 2003-09-25 Simon Josefsson <jas@extundo.com>
4921 * xgetdomainname.h: New file.
4922 * xgetdomainname.c: New file.
4924 2003-09-25 Simon Josefsson <jas@extundo.com>
4925 Bruno Haible <bruno@clisp.org>
4927 * getdomainname.h: New file.
4928 * getdomainname.c: New file.
4930 2003-09-24 Paul Eggert <eggert@twinsun.com>
4932 * linebuffer.c (freebuffer): Don't free the argument, just
4933 the buffer associated with the argument. Bug reported by
4936 2003-09-19 Karl Berry <karl@gnu.org>
4938 * argp.h: update from libc.
4940 2003-09-16 Paul Eggert <eggert@twinsun.com>
4942 * linebuffer.c (readlinebuffer): Return NULL immediately upon
4943 input error, instead of returning NULL the next time we are called
4944 (and therefore losing track of errno).
4946 2003-09-15 Paul Eggert <eggert@twinsun.com>
4948 * getndelim2.c (getndelim2): Don't trash errno when a read
4949 fails, so that the caller gets the proper errno.
4951 * readutmp.c (read_utmp): Likewise.
4952 Check for fstat error. Close stream and free storage
4955 2003-09-14 Bruno Haible <bruno@clisp.org>
4957 * fwriteerror.h: New file.
4958 * fwriteerror.c: New file.
4960 2003-09-14 Jim Meyering <jim@meyering.net>
4962 * getloadavg.c: Correct cpp indentation.
4963 * strdup.c: Likewise.
4964 * vasnprintf.c: Likewise.
4966 2003-09-12 Paul Eggert <eggert@twinsun.com>
4968 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
4969 * obstack.c [!defined _LIBC]: Likewise.
4970 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4971 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4972 * exitfail.c: Don't include stdlib.h; no longer needed.
4974 More changes to assume C89 or better.
4976 * error.c (error_tail): Assume vprintf.
4978 * argmatch.c (getenv): Remove decl.
4979 * progreloc.c (get_full_program_name): Define via prototype.
4980 * setenv.c (clearenv): Likewise.
4981 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
4983 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
4984 (malloc, memcpy): Remove decls.
4985 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
4986 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
4987 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4988 (memcpy): Remove macro.
4989 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
4990 (__P): Remove. All uses removed.
4991 (PTR): Remove. All uses changed to void *.
4992 (CHAR_BIT, NULL): Remove.
4993 (spaces, zeros, memset_space, memset_zero)
4994 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
4996 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
4997 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
4998 Define with prototype.
4999 Remove now-unnecessary prototype decl.
5000 (extra_args_spec): Assume ANSI C. All uses changed.
5001 (extra_args_spec_iso): Remove.
5002 (my_strftime, emacs_strftimeu): Define via prototype.
5003 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
5005 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
5006 * strtoimax.c: Include <stdlib.h> unconditionally.
5007 (strtoul, strtol): Remove decls.
5008 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
5010 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
5011 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
5012 (LOCALE_PARAM_PROTO): New macro.
5013 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
5014 (INTERNAL (strtol), strtol): Define with a prototype.
5015 (PARAMS): Remove. All uses removed.
5016 * tempname.c: Include <string.h> unconditionally.
5017 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
5018 * xgethostname.c (main): Define with a prototype.
5019 * xmalloc.c: Include "xalloc.h" first, to check interface.
5020 Include <stdlib.h> unconditionally.
5021 (calloc, malloc, realloc, free): Remove decls.
5022 * xstrtod.c: Include "xstrtod.h" first, to check interface.
5023 Include <stdlib.h> unconditionally. Sort include file names.
5025 (xstrtod): Define with a prototype.
5026 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
5027 (strtol, strtoul): Remove decls.
5029 2003-09-11 Paul Eggert <eggert@twinsun.com>
5031 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
5032 Include <stdlib.h>, <string.h> unconditionally.
5033 Remove now-unnecessary cast to char *.
5034 * strnlen.c: Include <string.h> unconditionally.
5035 * yesno.c (yesno): Define with a prototype.
5037 2003-09-10 Bruno Haible <bruno@clisp.org>
5039 * strcspn.c: Include <string.h> unconditionally.
5040 * strpbrk.c: Include <string.h> unconditionally.
5041 * strstr.c: Include <string.h> unconditionally.
5042 * unicodeio.c: Include <string.h> unconditionally.
5043 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
5044 * unsetenv.c: Likewise.
5045 * xreadlink.c: Include <stdlib.h> unconditionally.
5046 * yesno.c: Include <stdlib.h> unconditionally.
5047 (rpmatch): Add prototype.
5049 2003-09-10 Jim Meyering <jim@meyering.net>
5051 * error.c: Correct indentation of cpp directives.
5053 2003-09-09 Paul Eggert <eggert@twinsun.com>
5057 * acosl.c (main): Use a prototype.
5058 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
5061 * getloadavg.c (getloadavg, main): Define via prototypes.
5063 * getopt.h (struct option.name): Assume C89, and use 'const'.
5064 (getopt, etopt_long, getopt_long_only, _getopt_internal)
5065 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
5067 * getopt.c (const): Remove macro.
5068 Include <string.h> unconditionally.
5069 (my_index): Remove; all uses changed to strchr.
5070 (strlen): Remove decl.
5071 (exchange): Remove forward decl; no longer needed.
5072 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
5073 Define with prototype.
5074 * getopt1.c (const): Remove macro.
5075 (getopt_long, getopt_long_only, main): Define with prototype.
5077 * getugroups.c: Include <string.h> unconditionally.
5079 * getusershell.c: Include <stdlib.h> unconditionally.
5080 (getusershell, setusershell, endusershell, readname, main):
5081 Define with prototypes.
5083 * group-member.c: Include group-member.h first.
5084 Include <stdlib.h> unconditionally.
5086 * hard-locale.c: Include hard-locale.h first.
5087 Include <stdlib.h>, <string.h> unconditionally.
5089 * hash.c (free, malloc): Remove decls.
5090 Include <stdlib.h> unconditionally.
5092 * human.c: Include <stdlib.h>, <string.h> unconditionally.
5093 (getenv): Do not declare.
5095 * idcache.c: Include <string.h> unconditionally.
5097 * long-options.c: Include long-options.h first, to test interface.
5098 Include <stdlib.h> unconditionally.
5100 * makepath.c: Include makepath.h first, to test interface.
5101 Include <stdlib.h> and <string.h> unconditionally.
5103 * linebuffer.c: Include <stdlib.h>.
5104 (free): Remove decl.
5106 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
5107 rpl_malloc returns void *, not char *.
5108 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
5110 * md5.h: Include <limits.h> unconditionally.
5111 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
5112 (__P): Remove; all uses removed.
5113 * md5.c: Include "md5.h" first.
5114 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
5115 md5_buffer, md5_process_bytes, md5_process_block):
5116 Define with prototypes.
5117 * sha.h (__P): Remove all uses. (It wasn't defined??)
5118 * sha.c: Include "sha.h" first.
5119 Include <stdlib.h>, <string.h> unconditionally.
5121 * memchr.c (__ptr_t): Remove; all uses changed to void *.
5122 * memcmp.c (__ptr_t): Likewise.
5123 * memrchr.c (__ptr_t): Likewise.
5124 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
5125 Include <string.h> unconditionally.
5126 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
5127 * memchr.c: Include <stdlib.h> unconditionally.
5128 * memchr.c (LONG_MAX): Remove.
5129 * memrchr.c (LONG_MAX): Likewise.
5130 * memchr.c (__memchr): Define via a prototype.
5131 * memrchr.c (__memrchr): Likewise.
5132 * memcmp.c (__P): Remove, and remove all uses.
5133 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
5134 Remove forward decls; no longer needed.
5135 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
5136 Use types required by C89 in prototype.
5138 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
5139 * savedir.c: Likewise.
5140 * mkdir.c (free): Remove decl.
5141 * rmdir.c (rmdir): Define with a prototype.
5142 * savedir.c: Include savedir.h first, to test interface.
5144 * mktime.c (STDC_HEADERS): Remove.
5145 Include <stdlib.h>, <string.h> unconditionally.
5147 * modechange.c: Include <stdlib.h> unconditionally.
5148 (malloc): Remove decl.
5150 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
5151 (free): Remove decl.
5153 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
5154 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
5155 (This type really should be intptr_t, but that's a C99ism.)
5156 (_obstack_memcpy): Remove: all uses changed to memcpy.
5157 Include <string.h> unconditionally.
5158 (struct obstack): Assume __STDC__ for types of members
5159 chunkfun, freefun, extra_arg.
5160 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
5161 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
5162 obstack_begin, obstack_specify_allocation,
5163 obstack_specify_allocation_with_arg, obstack_chunkfun,
5164 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
5165 Remove unprototyped decls and the macros that use them.
5166 * obstack.c (POINTER): Remove. All uses changed to void *.
5167 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
5168 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
5169 (defined __STDC__ && __STDC__)]:
5170 Remove nonprototyped code.
5171 Include <stdlib.h> unconditionally.
5172 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
5173 _obstack_allocated_p, _obstack_free, obstack_free,
5174 _obstack_memory_used, print_and_abort):
5175 Define using prototypes.
5176 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
5177 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
5178 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
5179 obstack_next_free, obstack_object_size, obstack_room) [0]:
5180 Remove unused, unprototyped code.
5182 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
5184 * physmem.c (physmem_total, physmem_available, main): Define
5187 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
5188 (main): Define with a prototype.
5190 * posixver.c (getenv): Remove decl.
5192 * putenv.c (malloc): Returns void *, not char *.
5193 Include <string.h> unconditionally.
5194 (strchr, memcpy, NULL): Do not define.
5196 * readtokens.c: Include readtokens.h first, to test interface.
5197 Include <stdlib.h>, <string.h> unconditionally.
5198 (init_tokenbuffer): Define with a prototype.
5200 * regex.c (PARAMS): Remove. All uses removed.
5201 All uses of _RE_ARGS removed, too.
5202 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
5204 (bzero): Assume memset exists.
5205 (memcmp, memcpy, NULL): Remove.
5206 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
5207 char, or assignments to local vars of type signed char.
5208 (init_syntax_once, PREFIX(extract_number_and_incr),
5209 PREFIX(print_partial_compiled_pattern),
5210 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
5211 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
5212 PREFIX(regex_grow_registers), PREFIX(regex_compile),
5213 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
5214 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
5215 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
5216 wcs_compile_range, byte_compile_range, truncate_wchar,
5217 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
5218 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
5219 count_mbs_length, wcs_re_match_2_internal,
5220 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
5221 PREFIX(alt_match_null_string_p),
5222 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
5223 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
5224 regfree, PREFIX(extract_number)): Define with prototype. Remove
5225 now-unnecessary declaration, if any.
5226 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
5228 Remove now-unnecessary casts among pointer types.
5229 * regex.h (_RE_ARGS): Remove. All uses removed.
5231 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
5232 (free): Remove decl.
5234 * rpmatch.c: Include <stdlib.h> unconditionally.
5236 * same.c: Include <stdlib.h>, <string.h> unconditionally.
5237 (free): Remove decl.
5239 * save-cwd.c: Include <stdlib.h> unconditionally.
5240 * xgetcwd.c: Likewise.
5242 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
5243 (free): Remove decl.
5245 * strchrnul.c (strchrnul): Define with a prototype.
5246 Fix bug: c_in was not converted to char before searching.
5248 The following changes are not K&R related:
5250 * group-member.h: Include <sys/types.h>, so that this file is
5252 * makepath.h: Likewise.
5254 * getusershell.c (readname, default_index, line_size, readname):
5255 Use size_t, not int, for sizes.
5256 (readname): If the size overflows, report an error instead of
5259 2003-09-09 Derek Robert Price <derek@ximbiot.com>
5261 * getndelim2.c: Assume stdlib.h per the C89 spec.
5263 2003-09-08 Paul Eggert <eggert@twinsun.com>
5265 Assume C89 or better; remove K&R cruft.
5266 A few of these changes were first proposed by Derek Robert Price
5267 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
5269 * addext.c: Include <string.h> unconditionally.
5270 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
5271 Don't declare getenv or malloc.
5273 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
5274 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
5276 (find_stack_direction, alloca): Use prototypes.
5278 * atexit.c (atexit): Define using a prototype.
5280 * basename.c, dirname.c, stripslash.c:
5281 Include <string.h> unconditionally.
5283 * bcopy.c: Include <stddef.h>.
5284 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
5286 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
5288 * error.h (error, error_at_line, error_print_progname)
5289 [! (defined (__STDC__) && __STDC__)]: Remove decls.
5290 * error.c: Include error.h first, to check interface.
5291 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
5292 (VA_START): Remove; all uses changeed to va_start.
5293 (exit, strerror): Remove decls.
5294 (error_print_progname): Prototype uncondionally.
5295 Don't include <errno.h>; no longer needed.
5296 (private_strerror): Remove.
5297 (error_tail): Always define.
5298 (error, error_at_line): Assume C89 or better; always use prototypes.
5299 * fatal.c: Include "fatal.h" first, to test interface.
5300 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
5301 (VA_START): Remove; all uses changed to va_start.
5302 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
5304 (exit): Remove decl.
5305 (fatal): Prototype unconditionally. Assume va_start works.
5306 Abort at end, to pacify gcc.
5308 * euidaccess.c (main): Define with a prototype.
5310 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
5312 * exitfail.c: Include <stdlib.h> unconditionally.
5314 * fnmatch_.h (__P): Remove. All uses changed to assume
5316 * fnmatch.c: Include fnmatch.h first, to test interface.
5317 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
5318 (getenv): Remove decl.
5319 (fnmatch): Define using a prototype.
5320 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
5321 (FCT): Define using a prototype.
5323 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
5325 * gethostname.c: Include <stddef.h>.
5326 (gethostname): Define with prototype. Length is size_t, not int.
5328 2003-09-08 Paul Eggert <eggert@twinsun.com>
5330 * getversion.c: Remove; was migrated to backupfile.c in 1997.
5331 getversion.c should have been removed then, but was accidentally
5334 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
5335 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
5337 2003-09-07 Paul Eggert <eggert@twinsun.com>
5339 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
5340 copy_tm_result. Bug reported by Simon Josefsson in
5341 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
5343 2003-09-06 Paul Eggert <eggert@twinsun.com>
5345 * time_r.c, time_r.h: New files.
5347 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
5349 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
5350 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
5352 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
5354 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
5355 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
5358 * timegm.c: Switch to glibc implementation, with the following changes:
5359 [defined HAVE_CONFIG_H]: Include <config.h>.
5360 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
5361 (__mktime_internal) [!defined _LIBC]: New decl.
5362 (__gmtime_r) [!defined _LIBC]: New macro and function.
5363 (timegm): Use a prototype, since gnulib assumes C89.
5364 Do not bother declaring tmp to be const, as it's not really usefu.
5365 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
5366 (timegm): Declare only if HAVE_DECL_TIMEGM.
5368 2003-09-03 Paul Eggert <eggert@twinsun.com>
5370 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
5371 Bug reported by Lute Kamstra in
5372 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
5374 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
5375 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
5376 course with correspondingly smaller numbers for tomorrow and
5377 yesterday. From Tadayoshi Funaba. Originally installed into
5378 sh-utils on 1999-08-07, but the patch got lost (I guess during the
5381 2003-08-31 Simon Josefsson <jas@extundo.com>
5383 * timegm.h: New file.
5384 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
5386 2003-08-31 Karl Berry <karl@gnu.org>
5388 * argp.h: update from libc.
5390 2003-08-28 Bruno Haible <bruno@clisp.org>
5392 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
5393 warning on QNX, which defines O_BINARY to 000000.
5395 2003-08-24 Bruno Haible <bruno@clisp.org>
5397 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
5398 MSVC7 <stdio.h> is included later.
5400 2003-08-20 Bruno Haible <bruno@clisp.org>
5402 * progname.h: New file, from GNU gettext.
5403 * progname.c: New file, from GNU gettext.
5404 * progreloc.c: New file, from GNU gettext.
5406 2003-08-19 Bruno Haible <bruno@clisp.org>
5408 * xstrdup.c: Assume <string.h> exists.
5410 2003-08-18 Jim Meyering <jim@meyering.net>
5412 * setenv.h: Indent nested cpp directive.
5413 * vasnprintf.c: Remove trailing blanks.
5415 2003-08-17 Simon Josefsson <jas@extundo.com>
5416 Bruno Haible <bruno@clisp.org>
5418 * xstrndup.h: New file.
5419 * xstrndup.c: New file.
5421 2003-08-17 Bruno Haible <bruno@clisp.org>
5423 * strndup.h: New file.
5425 2003-08-16 Paul Eggert <eggert@twinsun.com>
5427 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
5428 space, undoing this 2003-08-12 change:
5429 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
5431 2003-08-16 Jim Meyering <jim@meyering.net>
5433 Merge from coreutils.
5434 * xstrtoimax.c: #else #if -> #elif.
5435 * xstrtoumax.c: Likewise.
5437 2003-08-15 Paul Eggert <eggert@twinsun.com>
5439 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
5440 rather than tab, after '#' in shell-script copyright notices.
5441 Suggested by Bruno Haible.
5443 2003-08-15 Jim Meyering <jim@meyering.net>
5444 and Paul Eggert <eggert@twinsun.com>
5446 Merge from coreutils.
5447 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
5448 member but strut utmpx does not. Needed for AIX 4.3.3.
5449 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
5451 2003-08-15 Jim Meyering <jim@meyering.net>
5453 Merge from coreutils.
5454 * xgethostname.c: Include <stdlib.h>.
5455 (xghostname): Don't exit for anything other than memory-related
5456 failure; just return NULL.
5457 * userspec.c: Include "posixver.h".
5458 (parse_user_spec): Accept `.' as a separator only
5459 in pre-POSIX-200112 mode.
5460 * strtoimax.c: Use #elif rather than #else #if.
5461 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
5462 Remove function, now that we can rely on a working tzset function.
5463 [!_LIBC]: Ensure that the required autoconf test has been run.
5464 [!defined _NL_CURRENT && HAVE_STRFTIME]:
5465 Use underlying_strftime for %r.
5466 * sha.c: Merge in some clean-up and optimization changes from glibc.
5467 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
5468 Ensure that it is a multiple of 64.
5469 Rearrange loop exit tests so as to avoid performing an
5470 additional fread after encountering an error or EOF.
5471 * realloc.c: Update copyright date.
5473 2003-08-14 Jim Meyering <jim@meyering.net>
5475 Merge from coreutils.
5476 * obstack.h: Whitespace changes.
5477 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
5478 and xcalloc return values.
5479 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
5480 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
5481 hang on OSF/1 5.1 for DIR on both local and remote file systems.
5482 Reported by (and fix confirmed by) Nelson H. F. Beebe.
5483 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5485 Use mntctl's return value to drive the entry-processing loop, since
5486 we can't rely on the value of the vmt_length member in the last
5487 entry. On some systems doing so could result in exhausting
5488 virtual memory. Based in part on a patch from Mike Jetzer.
5490 2003-08-14 Jim Meyering <jim@meyering.net>
5491 and Paul Eggert <eggert@twinsun.com>
5493 Merges from coreutils, plus other fixes.
5494 * physmem.c: Merge in portability changes from gcc/libiberty
5495 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
5496 for credits and details. Thanks to Kaveh Ghazi for helping
5497 to keep these files in sync.
5498 (ARRAY_SIZE): Define it.
5499 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
5500 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
5501 (memcasecmp): Don't assume size_t fits in unsigned int.
5502 Remove casts and duplicate code.
5503 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
5504 (memcpy): Remove definition.
5505 Merge in some clean-up and optimization changes from glibc.
5506 [BLOCKSIZE]: Move definition to top of file.
5507 Ensure that it is a multiple of 64.
5508 Rearrange loop exit tests so as to avoid performing an
5509 additional fread after encountering an error or EOF.
5510 * md5.h (md5_uintptr): Define.
5511 * makepath.c (CLEANUP_CWD): Report an error if we failed to
5512 return to the initial working directory. Preserve errno
5514 * idcache.c: Include "xalloc.h".
5515 (xmalloc, xrealloc): Remove decls.
5516 (getuser): Remove casts no longer required in C89.
5517 * human.c: Include stdio.h, for sprintf.
5518 * group-member.c: Include "xalloc.h".
5519 (xmalloc, xrealloc): Remove decls.
5520 (get_group_info): Remove casts no longer required in C89.
5521 * getusershell.c (readname): Remove casts no longer required in C89.
5522 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
5523 * getline.c: Whitespace fix, from coreutils.
5525 2003-08-13 Paul Eggert <eggert@twinsun.com>
5527 * exclude.c: Include <ctype.h>
5528 (IN_CTYPE_DOMAIN): New macro.
5530 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
5533 * argp-help.c, argp-parse.c, config.charset, getopt.h:
5534 Undo previous (whitespace-only) change.
5536 2003-08-12 Paul Eggert <eggert@twinsun.com>
5538 * argp-help.c, argp-parse.c, config.charset, getopt.h:
5539 Normalize leading white space and remove trailing white space.
5540 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
5541 notice, as per ../config/srclist-update.
5543 Merge from coreutils.
5544 * euidaccess.h: New file.
5545 * euidaccess.c: Include it.
5546 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
5547 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
5548 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
5550 2003-08-11 Bruno Haible <bruno@clisp.org>
5552 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
5553 (vasnprintf): Use it instead of wcslen.
5555 2003-08-11 Bruno Haible <bruno@clisp.org>
5557 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
5558 value to ensure that _Bool promotes to int. Use #define for _Bool when
5559 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
5561 2003-08-10 Karl Berry <karl@gnu.org>
5563 * regex.h: update from libc (whitespace fix).
5565 2003-08-09 Paul Eggert <eggert@twinsun.com>
5567 Merge some files from coreutils. These changes were
5568 originally made by Jim Meyering.
5569 * acl.c: Include <sys/types.h> before <sys/stat.h>;
5570 many older Unixes require this.
5571 * alloca.c (alloca): Remove cast to argument of free;
5572 no longer needed in C89.
5573 * alloca_.h, regex.h: Fix white space to match
5574 what GNU indent does.
5576 2003-08-05 Paul Eggert <eggert@twinsun.com>
5578 * bumpalloc.h: Remove.
5580 2003-08-04 Paul Eggert <eggert@twinsun.com>
5582 * getloadavg.c: Change copyright notice and spacing to conform to
5585 Merge from coreutils.
5586 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
5588 * getdate.y (date): Also accept dates like May-23-2003; suggestion
5589 from Karl Berry, implemented by Jim Meyering.
5590 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
5591 from Dmitry V. Levin.
5592 Remove anachronistic cast of xrealloc.
5593 * fnmatch_.h (__const): Remove. Use 'const'.
5594 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
5595 type. Otherwise, it wouldn't compile with at least /bin/cc on
5596 ymp-cray-unicos9.0.2.X.
5597 Combine two mostly-identical uses of alloca into one.
5598 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
5600 2003-08-04 Dave Love <d.love@dl.ac.uk>
5604 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
5605 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
5606 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
5607 obsolete NLIST_NAME_UNION.
5608 [__GNU__]: Undef BSD and FSCALE.
5609 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
5611 2003-08-03 Paul Eggert <eggert@twinsun.com>
5613 * stdbool_.h (_Bool): Make it signed char, instead of
5614 an enum type, so that it's guaranteed to promote to int. See:
5615 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
5617 2003-07-31 Paul Eggert <eggert@twinsun.com>
5619 * strerror.c: Include config.h, limits.h. Declare sprintf.
5620 (strerror): Don't assume that a printable int fits in 14 bytes.
5622 2003-07-24 Derek Robert Price <derek@ximbiot.com>
5623 Bruno Haible <bruno@clisp.org>
5625 * getline.h (getline, getdelim): Change return type to ssize_t.
5626 * getline.c (getline, getdelim): Likewise.
5627 Remove _GNU_SOURCE define; now it's defined in config.h through
5630 2003-07-22 Paul Eggert <eggert@twinsun.com>
5632 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
5633 over-parenthesization in macros.
5635 Sync with coreutils.
5637 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
5640 Use `exit_failure' for xalloc and xmemcoll instead of their own
5641 private exit-failure variables.
5642 * xalloc.h (xalloc_exit_failure): Remove.
5643 * xmalloc.c: Likewise. Include exitfail.h.
5644 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
5645 * xmemcoll.h (xmemcoll_exit_failure): Remove.
5646 * xmemcoll.c: Likewise. Include exitfail.h.
5647 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
5649 2003-07-18 Paul Eggert <eggert@twinsun.com>
5651 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
5652 * closeout.c: Likewise. Include "closeout.h" right after config.h,
5653 to test that it can stand by itself. Include "exitfail.h".
5654 Clients should set exit_failure instead.
5655 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
5657 2003-07-18 Andreas Schwab <schwab@suse.de>
5659 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
5661 2003-07-18 Bruno Haible <bruno@clisp.org>
5663 * getndelim2.h: New file.
5664 * getndelim2.c: Make into a module of its own. Include config.h,
5666 (getndelim2): Make non-static. Change return type to ssize_t.
5667 * getline.h: Change argument names.
5668 * getline.c: Include getndelim2.h instead of getndelim2.c.
5669 * getnline.c: Include getndelim2.h.
5671 2003-07-17 Bruno Haible <bruno@clisp.org>
5673 * Makefile.am: Remove file.
5674 * Makefile.in: Remove file.
5676 2003-07-17 Bruno Haible <bruno@clisp.org>
5678 * getnline.h: New file.
5679 * getnline.c: New file.
5680 * getndelim2.c: New file, extracted from getline.c.
5681 (getndelim2): Renamed from getdelim2, with added nmax argument.
5682 * getline.c: Include getndelim2.c.
5683 (getdelim2): Moved out to getndelim2.c.
5684 (getline, getdelim): Update.
5686 2003-07-15 <karl@gnu.org>
5688 * vasnprintf.c: update from gettext.
5690 2003-07-15 Jim Meyering <jim@meyering.net>
5692 * makepath.c (make_path): Enclose diagnostic in _(...).
5694 2003-07-14 Paul Eggert <eggert@twinsun.com>
5696 * asnprintf.c, asprintf.c, config.charset, gettext.h,
5697 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
5698 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
5699 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
5700 vasprintf.c, vasprintf.h: Regenerate. These files are now being
5701 updated automatically by ../config/srclist-update. This changes
5702 their license from LPGL to GPL.
5704 2003-07-14 Jim Meyering <jim@meyering.net>
5706 Don't emit diagnostics. Let callers do that.
5707 * save-cwd.c: Don't include "error.h".
5708 (save_cwd): Don't call error. Ensure that errno is valid
5709 when returning nonzero.
5711 * save-cwd.h (restore_cwd): Update prototype.
5712 * save-cwd.c (restore_cwd): Remove two parameters.
5713 Simplify. Don't call error upon failure. Let callers do that.
5714 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
5715 when auditing is enabled. But don't bother updating the #if.
5717 2003-07-14 Simon Josefsson <jas@extundo.com>
5719 * mempcpy.h: New file.
5720 * mempcpy.c: New file.
5722 2003-07-14 Paul Eggert <eggert@twinsun.com>
5724 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
5725 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
5726 unicodeio.c, unicodeio.h, unlocked-io.h:
5727 Switch from LGPL to GPL.
5729 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
5731 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
5732 it breaks C++ compilation.
5733 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
5735 2003-07-10 Jim Meyering <jim@meyering.net>
5737 * vasnprintf.c: Remove trailing blanks.
5738 Make cpp indentation consistent.
5740 2003-07-09 Paul Eggert <eggert@twinsun.com>
5742 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
5743 posixver.c, strftime.c, strnlen.c, strverscmp.c:
5744 Switch from LGPL to GPL.
5746 2003-07-07 Paul Eggert <eggert@twinsun.com>
5748 * mktime.c: Fix some boundary cases and remove need for floating point.
5750 Issue a compile-time diagnostic if time_t is floating point, or if
5751 two's complement arithmetic is not in effect, or if arithmetic
5752 right shift does not propagate the sign. These assumptions were
5753 all in the original code but they weren't checked.
5755 (TIME_T_MIDPOINT, verify): New macros.
5756 (__isleap): Remove; it has integer overflow problems.
5757 (leapyear): New function, without those problems.
5758 (ydhms_tm_diff): Remove; splitting into two parts.
5759 (ydhms_diff): New function, containing the arithmetic part of
5760 the old ydhms_tm_diff function. Issue a compile-time
5761 diagnostic if we are not using C99 integer division.
5762 Avoid casts when possible.
5763 (guess_time_tm): New function, containing the checking part of
5764 the old ydhms_tm_diff function. Return the new value, rather than
5765 the difference between it and the old. Accept a new argument T
5766 so that *T specifies the old value. Check for overflow in the result.
5768 (__mktime_internal): Use a time_t offset, not a long int offset.
5769 This undoes the 2003-06-04 change, which is no longer needed now
5770 that we have better overflow checking.
5771 (localtime_offset): Likewise.
5773 (__mktime_internal): Avoid harmful overflow on hosts where time_t
5774 and long are 64-bit but int is only 32-bit.
5775 (ydhms_diff): Use long int to store year1 and yday1.
5776 Issue a compile-time diagnostic if long int is not wide enough.
5778 (__mktime_internal): Use long int to store adjusted year and yday.
5779 Use plain C rather than preprocessor commands, if that doesn't
5781 Check for overflow (and try to repair) after each probe
5782 rather than checking only at the very end. This avoids some bugs
5783 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
5784 does not equal GMT offset at maximum time).
5785 Use integer to check for overflow rather than floating point; this
5786 is more portable to non-IEEE hosts, and is a tad faster.
5787 When we detect that we are oscillating between two values,
5788 don't check whether tm_isdst has the requested value, since
5789 we already know the answer. When tm_isdst has the wrong value,
5790 use a different heuristic to find the right one, based on the
5791 extreme values actually observed in practice in tz2003a,
5792 rather than the (overly optimistic) "previous 3 calendar quarters".
5794 (not_equal_tm, print_tm, check_result): Use "const T" rather than
5795 "T const" to accommodate glibc style.
5796 (check_result): Use less-confusing report format. "long" -> "long int.
5798 Don't loop if the iteration overflows time_t.
5799 Allow a negative step in the iteration.
5801 2003-07-01 Paul Eggert <eggert@twinsun.com>
5803 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5804 having it depend on HAVE_SYS_TYPES_H.
5806 2003-06-25 Bruno Haible <bruno@clisp.org>
5808 * readlink.c: New file.
5810 2003-06-20 Bruno Haible <bruno@clisp.org>
5812 Assume C89, so PARAMS isn't needed.
5813 * unicodeio.h (PARAMS): Remove.
5814 * unicodeio.c: Don't use PARAMS.
5816 2003-06-18 Jim Meyering <jim@meyering.net>
5818 Merge changes from coreutils.
5819 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5820 Remove explicit declarations of xmalloc and realloc.
5822 (read_utmp): Remove anachronistic cast of xmalloc.
5824 2003-06-17 Paul Eggert <eggert@twinsun.com>
5826 Assume C89, so PARAMS isn't needed.
5827 * backupfile.h (PARAMS): Remove. All uses removed.
5828 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5829 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5830 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5831 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5832 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5833 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5834 xstrtol.h: Likewise.
5835 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
5836 same.h, strverscmp.h: Do not include config.h; no longer needed.
5837 Anyway, config.h should always be included before any other file.
5839 2003-06-11 Simon Josefsson <jas@extundo.com>
5841 * sysexit_.h: New file.
5843 2003-05-20 Derek Price <derek@ximbiot.com>
5845 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5847 2003-06-10 Simon Josefsson <jas@extundo.com>
5849 * strchrnul.h: New file.
5850 * strchrnul.c: New file.
5852 2003-06-10 Simon Josefsson <jas@extundo.com>
5854 * argp.h: New file, from glibc.
5855 * argp-ba.c: New file, from glibc.
5856 * argp-eexst.c: New file, from glibc.
5857 * argp-fmtstream.c: New file, from glibc.
5858 * argp-fmtstream.h: New file, from glibc.
5859 * argp-fs-xinl.c: New file, from glibc.
5860 * argp-help.c: New file, from glibc.
5861 * argp-namefrob.h: New file, from glibc.
5862 * argp-parse.c: New file, from glibc.
5863 * argp-pv.c: New file, from glibc.
5864 * argp-pvh.c: New file, from glibc.
5865 * argp-xinl.c: New file, from glibc.
5867 2003-06-07 Jim Meyering <jim@meyering.net>
5869 * readtokens.h: Put `Free Software Foundation, Inc.'
5870 in place of my name in the copyright comment.
5871 Remove definition and uses of __P.
5874 * stat.c: Don't declare xmalloc explicitly.
5875 Instead, include "xalloc.h".
5876 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
5877 xrealloc, and xcalloc return values.
5878 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
5880 * xgetcwd.h: Remove definition/uses of PARAMS.
5882 2003-06-06 Jim Meyering <jim@meyering.net>
5884 * stdbool_.h: Renamed from stdbool.h.in.
5886 2003-06-06 Jim Meyering <jim@meyering.net>
5888 Merge from coreutils.
5889 * same.c: (same_name): Declare *_basename locals to be `const'.
5890 Consolidate declarations and initializations of *_base* locals.
5892 Merge from coreutils.
5893 This avoids a core dump on systems without GNU putenv,
5894 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5895 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5896 (unsetenv): New static function, from GNU libc.
5897 (rpl_putenv): Use it.
5899 * modechange.c: Remove trailing blanks.
5901 Merge from coreutils.
5902 * fsusage.c: Remove declaration of statfs.
5903 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5905 * posixtm.c: Include <stdbool.h> unconditionally.
5907 2003-06-05 Paul Eggert <eggert@twinsun.com>
5909 * mktime.c (__mktime_internal): When resolving a tm_isdst
5910 mismatch, look in future quarters as well as past. This fixes a
5911 bug when processing fall-backwards gaps immediately after a long
5912 period of daylight-saving time.
5914 * mktime.c: Assume freestanding C89 or better.
5915 (HAVE_LIMITS_H): Remove. Assume it's 1.
5916 (__P): Remove; not used.
5917 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5918 (mktime, not_equal_tm, print_tm, check_result,
5919 main): Use prototypes. Use const * where appropriate.
5920 (main): Fix typo in testing code that uncovered by above changes.
5921 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5923 2003-06-04 Paul Eggert <eggert@twinsun.com>
5925 * mktime.c: Fix Debian bug 177940
5926 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
5927 (localtime_offset): Now long int, not time_t, because we want it
5928 to be guaranteed to be signed. All uses changed.
5929 (__mktime_internal): If overflow would occur when adding offset,
5932 Merge 'human' changes from coreutils. Rewrite to support
5933 locale-specific notations like thousands separators.
5934 * human.c: Simplify authorship notice.
5935 Include human.h immediately after config.h.
5936 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
5937 <limits.h>: Do not include, since human.h does.
5938 (SIZE_MAX, UINTMAX_MAX): New macros.
5939 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
5940 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
5941 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
5942 (power_letter): Renamed from suffixes.
5943 (generate_suffix_backwards): Remove.
5944 (adjust_value): Now takes int style (because of human.h changes)
5945 and long double value (for greater precision on some platforms).
5946 (group_number): New function.
5947 (human_readable): Use it. Use integer options, not enum.
5948 Put the options before the sizes in the arg list.
5949 Support all the new options.
5950 The old human_readable function has been removed;
5951 use inttostr.h instead.
5952 (human_readable, default_block_size, humblock):
5953 Use uintmax_t, not int, for block sizes.
5954 (human_readable_inexact, block_size_types): Remove.
5955 (block_size_opts): New constant.
5956 (human_options): Renamed from human_block_size, with new signature
5957 that allows block sizes up to UINTMAX_MAX. All callers changed.
5958 * human.h: Add copyright and authorship notice.
5959 Include <limits.h> and <stdbool.h> unconditionally.
5960 (PARAMS): Remove. All uses removed.
5961 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
5962 (enum human_inexact_style): Remove tag; now a nameless enum.
5963 (human_floor, human_ceiling, human_round_to_even): Now have
5964 values 2, 0, 1 rather than -1, 1, 0.
5965 (human_group_digits, human_suppress_point_zero, human_autoscale,
5966 human_base_1024, human_SI, human_B): New constants.
5967 (human_readable_inexact, human_block_size): Remove.
5968 (human_readable): Size args are now uintmax_t, not int.
5969 (human_options): New decl.
5971 * exclude.c: (new_exclude, add_exclude): Remove casts that are
5972 unnecessary now that we assume C89 or better. This change
5973 imported from coreutils.
5975 * mktime.c (__mktime_internal): Do not reject negative timestamps
5976 arbitrarily. This is the same patch as 2003-05-28, but it got lost
5977 in the 2003-05-30 sync from glibc.
5979 .h files should stand alone, but we shouldn't include <sys/types.h>
5980 if we can get away with just <stddef.h>.
5982 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
5983 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
5984 rather than <sys/types.h>, as we merely need size_t.
5985 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
5987 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
5988 Include <stdio.h>, to get FILE.
5989 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
5990 memcasecmp.h has included <stddef.h> and all we need is size_t.
5991 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5992 our interface, instead of including <sys/types.h>
5994 2003-06-02 Paul Eggert <eggert@twinsun.com>
5997 Fix some minor time-related bugs with POSIX time arguments.
5998 Some valid time stamps were being rejected (notably -1, and
5999 time stamps before 1900 on 64-bit hosts). And some invalid
6000 time stamps were being accepted, e.g. September 31.
6002 * posixtm.h (posixtime): Return bool instead of time_t, so
6003 that we can return (time_t) -1 successfully.
6004 * posixtm.c: Likewise.
6005 [HAVE_STDBOOL_H]: Include <stdbool.h>.
6006 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
6007 (t): Remove static var.
6008 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
6009 of static var. All uses changed.
6010 (year): Do not reject years before 1900; they can occur with
6012 (posix_time_parse): Do not check for out-of-range components;
6013 that is now the caller's responsibility, since our checks were
6014 only approximations.
6015 (posixtime): Use mktime to check for out-of-range components,
6016 since it knows them exactly.
6017 If mktime returns (time_t) -1, check whether an error actually occurred
6018 by invoking localtime on -1.
6019 (main) [TEST_POSIXTIME]: Check for input data errors, and report
6020 posixtime failures better.
6021 Improve the test data (in comments only).
6023 2003-05-30 <karl@gnu.org>
6025 * mktime.c: update from libc.
6027 2003-05-30 Bruno Haible <bruno@clisp.org>
6029 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
6030 * localcharset.h: Likewise.
6031 * localcharset.c: Likewise.
6033 2003-05-28 Paul Eggert <eggert@twinsun.com>
6035 Assume the headers required for C89 freestanding compilers.
6036 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
6037 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
6038 without checking for HAVE_LIMITS_H.
6039 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
6040 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
6042 * fatal.c: Include <stdarg.h> without checking for __STDC__.
6043 * exclude.c: Include <stdbool.h> unconditionally.
6044 * tempname.c: Include <stddef.h> unconditionally.
6045 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
6046 * modechange.c, rpmatch.c (NULL): Don't define, since
6047 <stddef.h> does that.
6048 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
6049 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
6050 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
6051 * xstrtol.c: Likewise.
6052 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
6053 * savedir.c: Include <stddef.h> instead of defining NULL.
6055 * addext.c (addext): Use assignment rather than cast, to avoid
6056 warnings on some platforms.
6058 * mktime.c (__mktime_internal): Do not reject negative timestamps
6061 2003-05-10 Bruno Haible <bruno@clisp.org>
6063 * linebreak.c (iconv_string_length): Don't return -1 just because the
6064 string is longer than 4 KB.
6066 2003-05-12 Jim Meyering <jim@meyering.net>
6068 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
6069 the space-padded-by-default conversion specifiers, %e, %k, %l.
6071 2003-05-03 Bruno Haible <bruno@clisp.org>
6073 Upgrade to Unicode-4.0.
6074 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
6075 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
6076 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
6077 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
6078 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
6079 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
6080 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
6081 Change width of U+E0100..U+E01EF from 1 to 0.
6083 2003-04-25 Bruno Haible <bruno@clisp.org>
6085 * copy-file.c: Include <stddef.h>, for size_t.
6087 2003-04-25 Jim Meyering <jim@meyering.net>
6089 * copy-file.c (copy_file_preserving): Declare buf_size to be
6090 of type size_t, not int.
6092 2003-04-11 Jim Meyering <jim@meyering.net>
6094 Merge changes from Coreutils.
6096 2003-03-22 Jim Meyering <jim@meyering.net>
6098 * strftime.c (widen): Cast alloca return value to proper type.
6100 2003-01-19 Ulrich Drepper <drepper@redhat.com>
6103 * strftime.c (my_strftime): Handle very large width
6104 specifications for numeric values correctly. Improve checks for
6107 2003-01-19 Jim Meyering <jim@meyering.net>
6109 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
6110 (nl_get_alt_digit) [! defined my_strftime]: Define.
6111 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
6112 _nl_get_alt_digit and _nl_get_walt_digit.
6114 * strftime.c (my_strftime): Merge in locale-related changes from libc.
6115 These changes have no effect outside of _LIBC.
6117 2003-04-10 Bruno Haible <bruno@clisp.org>
6119 * findprog.h: New file, from GNU gettext.
6120 * findprog.c: New file, from GNU gettext.
6122 2003-04-05 Jim Meyering <jim@meyering.net>
6124 Merge changes from Coreutils.
6126 * exclude.h (PARAMS): Remove definition and uses.
6127 * exclude.c: Remove uses of `PARAMS'.
6129 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
6130 Add test-cases for DOS filenames. Declare program_name.
6131 (main): Set up program_name. Patch by Rich Dawe.
6133 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6135 Use mntctl's return value to drive the entry-processing loop, since
6136 we can't rely on the value of the vmt_length member in the last
6137 entry. On some systems doing so could result in exhausting
6138 virtual memory. Based in part on a patch from Mike Jetzer.
6140 2003-04-04 Bruno Haible <bruno@clisp.org>
6142 * linebreak.h: New file, from GNU gettext.
6143 * linebreak.c: New file, from GNU gettext with slight modifications.
6144 * lbrkprop.h: New file, from GNU gettext.
6146 2003-04-03 Bruno Haible <bruno@clisp.org>
6148 * utf8-ucs4.h: New file, from GNU gettext.
6149 * utf16-ucs4.h: New file, from GNU gettext.
6150 * ucs4-utf8.h: New file, from GNU gettext.
6151 * ucs4-utf16.h: New file, from GNU gettext.
6153 2003-04-02 Bruno Haible <bruno@clisp.org>
6155 * binary-io.h: New file, from GNU gettext.
6157 2003-04-01 Bruno Haible <bruno@clisp.org>
6159 * pathname.h: New file, from GNU gettext.
6160 * concatpath.c: New file, from GNU gettext.
6162 2003-03-30 Bruno Haible <bruno@clisp.org>
6164 * copy-file.c (copy_file_preserving): Don't set owner if the function
6165 chown() doesn't exist.
6167 2003-03-28 Bruno Haible <bruno@clisp.org>
6169 * copy-file.h: New file, from GNU gettext.
6170 * copy-file.c: New file, from GNU gettext.
6172 2003-03-18 Jim Meyering <jim@meyering.net>
6174 * quote.c (quote_n): Fix typo in comment.
6176 2003-03-14 Jim Meyering <jim@meyering.net>
6178 Merge changes from Coreutils.
6179 * obstack.h (obstack_object_size): Declare temporary, __o,
6180 to be const, in order to avoid warnings.
6181 (obstack_room): Likewise.
6182 (obstack_empty_p): Likewise.
6184 2003-03-13 Paul Eggert <eggert@twinsun.com>
6186 Merge changes from Bison.
6187 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
6188 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
6189 when compiling Bison 1.875's `bitset bset = obstack_alloc
6190 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
6191 * hash.c: Include <stdbool.h> unconditionally.
6193 2003-03-09 Paul Eggert <eggert@twinsun.com>
6195 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
6196 Reported by Bruce Becker; see:
6197 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
6199 2003-03-03 Paul Eggert <eggert@twinsun.com>
6200 Bruno Haible <bruno@clisp.org>
6202 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
6203 Reported by John Hughes, see
6204 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
6206 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
6208 * poll_.h: New file.
6211 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
6213 * mathl.h: New file.
6214 * acosl.c: New file.
6215 * asinl.c: New file.
6216 * atanl.c: New file.
6217 * ceill.c: New file.
6220 * floorl.c: New file.
6221 * frexpl.c: New file.
6222 * ldexpl.c: New file.
6224 * sincosl.c: New file.
6226 * sqrtl.c: New file.
6228 * trigl.c: New file.
6229 * trigl.h: New file.
6231 2003-02-17 Bruno Haible <bruno@clisp.org>
6233 * mkdtemp.h: New file, from GNU gettext.
6234 * mkdtemp.c: New file, from GNU gettext.
6236 2003-01-31 Bruno Haible <bruno@clisp.org>
6238 * rename.c: #undef rename before defining rpl_rename.
6239 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
6241 2003-01-30 Bruno Haible <bruno@clisp.org>
6243 * printf-args.h: New file, from GNU gettext.
6244 * printf-args.c: New file, from GNU gettext.
6245 * printf-parse.h: New file, from GNU gettext.
6246 * printf-parse.c: New file, from GNU gettext.
6247 * vasnprintf.h: New file, from GNU gettext.
6248 * vasnprintf.c: New file, from GNU gettext.
6249 * asnprintf.c: New file, from GNU gettext.
6250 * vasprintf.h: New file, from GNU gettext with modifications.
6251 * vasprintf.c: New file, from GNU gettext.
6252 * asprintf.c: New file, from GNU gettext.
6254 2003-01-29 Bruno Haible <bruno@clisp.org>
6256 * stpncpy.h: New file, from GNU gettext with modifications.
6257 * stpncpy.c: New file, from GNU gettext with modifications.
6259 2003-01-28 Bruno Haible <bruno@clisp.org>
6261 * c-ctype.h: New file, from GNU gettext, with changes suggested by
6263 * c-ctype.c: New file, from GNU gettext, with changes suggested by
6266 2003-01-27 Bruno Haible <bruno@clisp.org>
6268 * xsetenv.h: New file, from GNU gettext.
6269 * xsetenv.c: New file, from GNU gettext.
6271 2003-01-23 Bruno Haible <bruno@clisp.org>
6273 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
6275 2003-01-22 Bruno Haible <bruno@clisp.org>
6277 * exit.h: New file, from GNU gettext.
6279 2003-01-11 Bruno Haible <bruno@clisp.org>
6281 * stpcpy.h (stpcpy): Use ANSI C function declarations.
6282 * strcase.h (strcasecmp, strncasecmp): Likewise.
6284 2003-01-14 Jim Meyering <jim@meyering.net>
6286 * same.c (same_name): Tweak a comment.
6288 2003-01-11 Bruno Haible <bruno@clisp.org>
6290 * same.c (same_name): Reorder tests so as to avoid calling stat()
6291 when a string comparison is sufficient.
6293 2003-01-11 Bruno Haible <bruno@clisp.org>
6295 * readtokens.c (readtoken): Cast character to 'unsigned char', not
6298 2003-01-11 Bruno Haible <bruno@clisp.org>
6300 * hash-pjw.c: Add comment about low quality of this function.
6302 2003-01-12 Paul Eggert <eggert@twinsun.com>
6304 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
6305 to avoid collisions with libcurses and libreadline.
6307 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
6308 * getstr.h, getstr.c: Remove.
6309 * getline.c: Include "getline.h", to check interface.
6310 Move body of old getstr.c here: this defines MIN_CHUNK and
6311 declares getdelim2, which is renamed from getstr.
6312 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
6314 * linebuffer.c (readlinebuffer): Renamed from readline.
6316 * linebuffer.h: Likewise.
6317 (readline): Remove backward-compatibility macro.
6319 2003-01-12 Jim Meyering <jim@meyering.net>
6321 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
6323 2003-01-10 Bruno Haible <bruno@clisp.org>
6325 * alloca_.h: New file.
6326 * getdate.y: Unconditionally include alloca.h.
6327 * makepath.c: Likewise.
6328 * setenv.c: Likewise.
6329 * userspec.c: Likewise.
6331 2003-01-09 Bruno Haible <bruno@clisp.org>
6333 * stdbool.h.in: New file.
6335 2003-01-08 Bruno Haible <bruno@clisp.org>
6337 * safe-read.c: Include specification header first, to ensure its
6339 * full-write.c: Likewise.
6341 2003-01-08 Jim Meyering <jim@meyering.net>
6343 * full-write.c: Undefine and define-away `const' after inclusion
6344 of errno.h, not before. Suggestion from Bruno Haible.
6346 2003-01-07 Jim Meyering <jim@meyering.net>
6348 * full-write.c: Rework so that it may serve to define full_read, too.
6349 * full-read.c: Simply #define FULL_READ and include full-write.c.
6351 2003-01-06 Jim Meyering <jim@meyering.net>
6353 * version-etc.c: Update year in translatable copyright string.
6355 2002-12-25 Bruno Haible <bruno@clisp.org>
6357 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
6358 * xstrtol.h: Likewise.
6359 * xstrtoimax.c: Likewise.
6360 * xstrtoumax.c: Likewise.
6361 * human.h: Likewise.
6363 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
6364 on systems that have <inttypes.h> but not <stdint.h>.
6366 2002-12-31 Paul Eggert <eggert@twinsun.com>
6368 * memcoll.c (memcoll): Fall back on a simple algorithm using
6369 memcmp if strcoll doesn't work.
6371 2002-12-23 Bruno Haible <bruno@clisp.org>
6373 * localcharset.h: New file.
6374 * localcharset.c: Include it.
6375 * unicodeio.c: Likewise.
6377 2002-12-22 Bruno Haible <bruno@clisp.org>
6379 * utime.c (utime_null): No need to call ftruncate if the file was
6382 2002-12-23 Bruno Haible <bruno@clisp.org>
6384 * memcoll.c (STRCOLL): New macro.
6387 2002-12-22 Bruno Haible <bruno@clisp.org>
6389 * getstr.h (getstr): Define, to avoid clash with libcurses.
6390 * linebuffer.h (readline): Define, to avoid clash with libreadline.
6392 2002-12-22 Bruno Haible <bruno@clisp.org>
6394 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
6396 2002-12-23 Bruno Haible <bruno@clisp.org>
6398 * getline.h: Include <stddef.h>, for size_t.
6400 * unicodeio.h: Include <stddef.h>, for size_t.
6401 * unicodeio.c: Don't include <stddef.h>.
6403 2002-12-17 Bruno Haible <bruno@clisp.org>
6405 * canon-host.c (strdup): Remove unused declaration.
6407 * fsusage.c: Include full_read.h.
6408 (get_fs_usage): Use full_read instead of safe_read.
6410 * utime.c (utime_null): Use SAFE_READ_ERROR.
6412 2002-12-11 Bruno Haible <bruno@clisp.org>
6414 * setenv.h: Rewritten to cope with systems that have setenv() but not
6416 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
6419 2002-12-11 Bruno Haible <bruno@clisp.org>
6421 * setenv.c (alloca): Fall back to malloc.
6423 (setenv): Use freea() to free memory allocated with alloca().
6425 2002-11-13 Bruno Haible <bruno@clisp.org>
6427 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
6428 function declarations.
6429 * unsetenv.c (unsetenv): Likewise.
6431 2002-03-04 Bruno Haible <bruno@clisp.org>
6433 Portability to AIX 4.3.3.
6434 * unsetenv.c: New file, extracted from setenv.c.
6435 * setenv.c: Move the unsetenv() function to unsetenv.c.
6437 2001-12-20 Bruno Haible <bruno@clisp.org>
6439 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
6440 use malloc instead. For SunOS 4.
6442 2001-12-11 Bruno Haible <bruno@clisp.org>
6444 * setenv.c: Declare alloca.
6445 (compar_fn_t): New typedef.
6446 (KNOWN_VALUE, STORE_VALUE): Use it.
6448 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
6451 2002-12-10 Paul Eggert <eggert@twinsun.com>
6453 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
6454 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
6455 Choose values that are less likely to collide with system fnmatch
6457 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
6458 defined (e.g., a pure POSIX system).
6459 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
6460 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
6462 2002-12-06 Jim Meyering <jim@meyering.net>
6464 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
6466 Merge in changes from libc's misc/error.c, in preparation
6467 for the merge of gnulib's changes back into libc.
6469 * error.c (_): Define only if not already defined.
6470 Move definition to follow all #include directives.
6471 Include unlocked-io.h only if !_LIBC.
6472 [_LIBC]: Include <libio/libioP.h>.
6473 [USE_IN_LIBIO]: Include <libio/iolibio.h>
6474 (fflush): Tweak definition to use INTUSE.
6477 2002-12-05 Paul Eggert <eggert@twinsun.com>
6479 * alloca.c [defined emacs]: Include "lisp.h".
6480 (xalloc_die) [defined emacs]: New macro.
6481 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
6482 [! defined emacs]: Include <xalloc.h>.
6483 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
6484 (pointer): Typedef to POINTER_TYPE *.
6485 (malloc): Remove decl; we now always use xmalloc.
6486 (alloca): Use old-style definition, since Emacs needs this.
6487 Check for arithmetic overflow when computing combined size.
6489 2002-12-04 Paul Eggert <eggert@twinsun.com>
6491 Do not generate unlocked-io.h automatically, since it's easier to
6492 maintain it by hand.
6494 * unlocked-io.h: New file, from GNU diffutils,
6495 but with proper copyright notice and attribution.
6497 * Makefile.am: Add copyright notice.
6498 (libfetish_a_SOURCES): Add unlocked-io.h.
6499 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
6500 (DISTCLEANFILES, io_functions): Remove macros.
6501 (EXTRA_DIST): Remove gen_uio.
6502 (unlocked-io.h): Remove rule.
6504 2002-12-04 Jim Meyering <jim@meyering.net>
6506 Reflect the fact that stat.c and lstat.c are no longer generated.
6507 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
6508 (DISTCLEANFILES): Likewise.
6509 (EXTRA_DIST): Likewise.
6510 (all_local): Don't depend on stat.c or lstat.c.
6511 (stat.c, lstat.c): Remove rules.
6512 (EXTRA_DIST): Remove xstat.in.
6514 * xstat.in: Remove file. Contents moved into stat.c.
6515 * stat.c: New file. Contents mostly from xstat.in.
6516 * stat.c: Rework so that it may serve to define rpl_lstat, too.
6517 * lstat.c: New file. Simply #define LSTAT and include stat.c.
6519 * safe-read.c: Rework so that it may serve to define safe_write, too.
6520 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
6522 2002-12-03 Jim Meyering <jim@meyering.net>
6524 * safe-read.c, safe-write.c: Change variable names and comments, but
6525 not semantics, to minimize the differences between these two files.
6526 (safe_read): Change comment to mention SAFE_READ_ERROR.
6528 * safe-read.c (IS_EINTR): Define.
6529 (safe_read): Use IS_EINTR in place of in-function cpp directives.
6531 2002-12-02 Bruno Haible <bruno@clisp.org>
6533 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
6534 Define, taken from safe-read.c.
6535 (INT_MAX): Provide fallback.
6536 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
6537 * safe-write.h (SAFE_WRITE_ERROR): Define.
6539 * safe-read.c (EINTR): Remove definition.
6540 (safe_read): Don't use EINTR if it is absent.
6542 2002-12-02 Jim Meyering <jim@meyering.net>
6544 * safe-read.c (EINTR): Define.
6545 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6546 (INT_MAX): Provide fallback.
6547 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
6549 * safe-read.h (SAFE_READ_ERROR): Define.
6551 2002-12-01 Jim Meyering <jim@meyering.net>
6553 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
6554 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
6556 2002-11-27 Paul Eggert <eggert@twinsun.com>
6558 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6559 hash_rehash): Replace `if (limit <= value) abort ();' with
6560 `if (! (value < limit)) abort ();', for readability.
6562 2002-11-26 <karl@gnu.org>
6564 * strdup.c: copy from libc again, with jim's ok.
6565 * .cppi-disable: re-add strdup.c
6567 2002-11-25 <karl@gnu.org>
6569 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
6570 instead of "strtol.c".
6572 2002-11-25 Jim Meyering <jim@meyering.net>
6574 * mktime.c: Sync from libc, now that it has the latest fix.
6576 2002-11-24 <karl@gnu.org>
6578 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
6579 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
6581 2002-11-24 Jim Meyering <jim@meyering.net>
6583 Update from coreutils:
6585 * mktime.c: Merge in changes from libc.
6587 Avoid a link-time failure on some Linux systems.
6588 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
6589 (__mon_yday): Declare with the STATIC attribute.
6590 (__mktime_internal): Likewise.
6591 Based on a report from Greg Schafer.
6593 2002-11-23 Jim Meyering <jim@meyering.net>
6595 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
6596 Use `unsigned', not `int', as type of index.
6598 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
6600 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
6602 2002-11-22 Paul Eggert <eggert@twinsun.com>
6604 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
6605 hint that one should use `if (! x) abort ();' rather than `assert
6606 (x);', and anyway it's one less thing to worry about configuring.
6607 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
6608 hash_rehash, hash_insert): Use abort rather than assert.
6610 2002-11-22 Paul Eggert <eggert@twinsun.com>
6612 * quotearg.h: Allow multiple inclusion by surrounding with
6613 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
6614 so that we can be included first.
6615 (PARAMS): Remove; we now assume C89 or later. All uses removed.
6616 * quotearg.c: Include quotearg.h immediately after config.h.
6617 No need to include stddef.h or sys/types.h any more.
6618 Surround local include files with "", not "<>".
6619 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
6620 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
6621 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
6622 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
6623 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
6624 (ISPRINT): Remove; no longer needed now that we assume C89.
6626 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
6629 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
6630 quotearg_char): Use SIZE_MAX rather than
6631 (size_t) -1 when we are talking about "infinity".
6633 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
6635 2002-11-22 Bruno Haible <bruno@clisp.org>
6637 * safe-read.h: Assume C89. Add comments.
6638 (safe_read): Change return type to size_t.
6639 * safe-read.c (safe_read): Change return type to size_t. Handle byte
6640 counts > SSIZE_MAX correctly.
6641 * safe-write.h: New file.
6642 * safe-write.c: New file.
6643 * full-read.h: New file.
6644 * full-read.c: New file.
6645 * full-write.h: Assume C89. Add comments.
6646 * full-write.c: Include safe-write.h.
6647 (full_write): Rewritten to use safe_write.
6648 Suggested by Jim Meyering and Paul Eggert.
6650 2002-11-21 Bruno Haible <bruno@clisp.org>
6652 Remove case insensitive option matching.
6653 * argmatch.h (argcasematch): Remove declaration.
6654 (ARGCASEMATCH): Remove macro.
6655 (__xargmatch_internal): Remove case_sensitive argument.
6656 (XARGMATCH): Update.
6657 (XARGCASEMATCH): Remove macro.
6658 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
6659 case_sensitive argument.
6660 (argcasematch): Remove function.
6661 (__xargmatch_internal): Remove case_sensitive argument.
6662 (main): Use XARGMATCH instead of XARGCASEMATCH.
6664 * xmalloc.c: Change compile-time error message. Add comment about
6665 required autoconf version.
6667 2002-11-21 Jim Meyering <jim@meyering.net>
6669 * strdup.c (strdup): Tweak comment and initial #if/#include.
6671 Merge in changes from the coreutils.
6673 2002-09-25 Paul Eggert <eggert@twinsun.com>
6674 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
6675 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
6676 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
6677 int. Work more efficiently if X is the same width as uintmax_t.
6678 Do not compare X to -1, to avoid bogus compiler warning.
6679 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
6680 Don't assume that f_frsize and f_bsize are the same type.
6682 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
6685 * makepath.c (make_path): Restore umask *before* creating the final
6687 (make_path): Minor reformatting.
6689 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
6690 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
6692 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
6693 ones. At least on GNU/Linux systems, `auto' means something else.
6696 2002-11-20 Paul Eggert <eggert@twinsun.com>
6698 Merge argmatch cleanups from Bison. Assume C89.
6700 * argmatch.c: Include config.h here, not in argmatch.h.
6701 Include stdlib.h, for EXIT_FAILURE.
6702 Always include <string.h>, since we assume C89.
6703 (EXIT_FAILURE): Remove pre-C89 bug workaround.
6704 * argmatch.h: Do not include <config.h> or <sys/types.h>.
6705 Include <stddef.h> instead, since it's all we need for size_t.
6706 (PARAMS): Remove. All uses removed.
6707 (ARRAY_CARDINALITY): Do not bother to #undef.
6708 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
6709 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6710 Remove unnecessary parentheses.
6711 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6712 Insert necessary parentheses.
6713 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
6714 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
6716 2002-11-19 Bruno Haible <bruno@clisp.org>
6718 * mbswidth.c: Include mbswidth.h right at the beginning.
6719 * mbswidth.h: Include <stddef.h>, for size_t.
6721 * mbswidth.h (PARAMS): Remove macro.
6722 (mbswidth, mbsnwidth): Use ANSI C function declarations.
6723 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
6725 * gcd.h (PARAMS): Remove macro.
6726 (gcd): Use ANSI C function declarations.
6727 * gcd.c (gcd): Likewise.
6729 2002-11-15 Bruno Haible <bruno@clisp.org>
6731 * strcspn.c: Include <stddef.h>.
6732 (strcspn): Use ANSI C function declaration. Change return type to
6734 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
6735 (strpbrk): Use NULL.
6736 * strpbrk.h (PARAMS): Remove macro.
6737 (strpbrk): Use ANSI C function declaration.
6738 * strstr.c: Don't include <sys/types.h>.
6739 * strstr.h (PARAMS): Remove macro.
6740 (strstr): Use ANSI C function declarations.
6742 2002-11-06 Bruno Haible <bruno@clisp.org>
6744 * gcd.h (gcd): Change argument type to 'unsigned long'.
6745 * gcd.c (gcd): Likewise.
6747 2002-11-05 Bruno Haible <bruno@clisp.org>
6749 * gcd.h: New file, from gettext-0.11.5.
6750 * gcd.c: New file, from gettext-0.11.5.
6752 2002-11-05 Bruno Haible <bruno@clisp.org>
6754 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6755 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6756 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6757 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6759 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6760 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6762 * closeout.c: Include gettext.h instead of <libintl.h>.
6763 * human.c: Include gettext.h instead of <libintl.h>.
6764 * quotearg.c: Include gettext.h instead of <libintl.h>.
6765 * rpmatch.c: Include gettext.h instead of <libintl.h>.
6766 * unicodeio.c: Include gettext.h instead of <libintl.h>.
6767 * userspec.c: Include gettext.h instead of <libintl.h>.
6768 * version-etc.c: Include gettext.h instead of <libintl.h>.
6769 * xmalloc.c: Include gettext.h instead of <libintl.h>.
6770 (textdomain): Remove definition.
6771 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
6773 * long-options.c: Remove include of <libintl.h> and definition of _.
6774 * same.c: Remove include of <libintl.h> and definition of _.
6776 2002-11-04 Bruno Haible <bruno@clisp.org>
6778 * stpcpy.h: New file, from GNU gettext-0.11.5.
6779 * strcase.h: New file, from GNU gettext-0.11.5.
6780 * strpbrk.h: New file, from GNU gettext-0.11.5.
6781 * strstr.h: New file, from GNU gettext-0.11.5.
6782 * xgetcwd.h: New file, from GNU gettext-0.11.5.
6784 2002-05-09 Bruno Haible <bruno@clisp.org>
6786 * config.charset: Update for newest glibc. Add canonical names
6787 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
6789 2002-05-09 Bruno Haible <bruno@clisp.org>
6791 * localcharset.c (get_charset_aliases): Add more Windows specific
6794 2002-05-08 Owen Taylor <otaylor@redhat.com>
6796 * config.charset: A few additions for Solaris.
6798 2001-12-05 Bruno Haible <bruno@clisp.org>
6800 * localcharset.c (locale_charset): Don't return an empty string.
6802 2001-10-23 Bruno Haible <haible@clisp.cons.org>
6804 * config.charset: msdos in uk_UA uses CP1125.
6806 2001-08-05 Bruno Haible <haible@clisp.cons.org>
6808 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
6809 * localcharset.c (locale_charset): Declare as extern "C".
6811 2002-02-15 Bruno Haible <bruno@clisp.org>
6813 * config.charset [msdosdjgpp]: For Russian, use CP866.
6815 2002-02-11 Bruno Haible <bruno@clisp.org>
6817 * config.charset: Add support for NetBSD.
6819 2002-09-25 <karl@gnu.org>
6821 * strdup.c: copy from libc/string (via ../config/srclist*).
6822 * getopt*: copy from libc/posix.
6823 * gettext.h: copy from gettext.
6824 * .cppi-disable: add strdup.c, gettext.h.
6826 2002-07-01 Jim Meyering <meyering@lucent.com>
6828 * c-stack.c: Include sys/time.h.
6829 From Volker Borchert.
6831 2002-06-11 Paul Eggert <eggert@twinsun.com>
6833 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6834 New macro. Use it uniformly instead of
6835 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6836 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6837 reported by Vin Shelton.
6839 2002-06-22 Jim Meyering <meyering@lucent.com>
6841 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6842 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6844 2002-06-22 Paul Eggert <eggert@twinsun.com>
6846 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6847 Do not assume SA_SIGINFO behavior.
6848 Bug reported by Jim Meyering on NetBSD 1.5.2.
6850 2002-06-22 Jim Meyering <meyering@lucent.com>
6852 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6854 * exitfail.c, exitfail.h: Likewise.
6855 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6857 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6859 (EXTRA_DIST): Add fnmatch_loop.c.
6860 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6862 * fnmatch_loop.c: New file, from diffutils-2.8.2.
6863 * fnmatch.c: Update from diffutils-2.8.2.
6864 * fnmatch_.h: New file. From diffutils-2.8.2.
6865 * fnmatch.h: Remove file.
6867 2002-06-18 Paul Eggert <eggert@twinsun.com>
6869 * file-type.h: Report an error if neither S_ISREG nor
6870 S_IFREG is defined, instead of using a test specific to glibc
6871 2.2. This should be safe, since POSIX requires S_ISREG and
6872 Unix Version 7 had S_IFREG. We don't need to check for
6873 <sys/types.h> since we don't use any symbols that it defines.
6875 2002-06-15 Jim Meyering <meyering@lucent.com>
6877 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6878 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6879 have been included before this file.
6881 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
6883 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6884 so that each temporary file name is unique and valid in the first
6885 8 characters, for operation under DOS.
6887 2002-06-15 Jim Meyering <meyering@lucent.com>
6889 Work even with DJGPP 2.03, which lacks support for symlinks.
6891 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6893 * lchown.c (S_ISLNK): Likewise.
6895 2002-06-14 Jim Meyering <meyering@lucent.com>
6897 * file-type.h: Use the version from diffutils-2.8.2.
6898 * file-type.c: Likewise.
6900 2002-05-27 Jim Meyering <meyering@lucent.com>
6902 Fix a problem seen only on nonconforming systems whereby ls.c's
6903 use of localtime, and then of gettimeofday would cause trouble:
6904 the localtime call used to initialize rpl_gettimeofday's save
6905 mechanism would clobber ls's current local time information so
6906 that in any long listing the first file would always be listed
6907 with date 1970-01-01. Analysis by Volker Borchert.
6909 * gettimeofday.c (localtime): Undefine.
6910 (rpl_localtime): New function.
6912 2002-05-22 Jim Meyering <meyering@lucent.com>
6914 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6915 * file-type.h: New file.
6916 * file-type.c (file_type): New file/function. Extracted from diffutils.
6918 2002-04-29 Paul Eggert <eggert@twinsun.com>
6920 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6922 2002-04-28 Paul Eggert <eggert@twinsun.com>
6924 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6925 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
6926 of 127, since 64 is the largest conceivable number for ancient
6928 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6930 2002-04-28 Jim Meyering <meyering@lucent.com>
6932 * sig2str.c (WTERMSIG): Remove definition (unused).
6934 2002-04-28 Paul Eggert <eggert@twinsun.com>
6936 * sig2str.h, sig2str.c: New files.
6937 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6939 2002-04-24 Jim Meyering <meyering@lucent.com>
6941 * gettext.h: New file, from Gettext.
6942 * Makefile.am (INCLUDES): Remove -I../intl.
6943 (libfetish_a_SOURCES): Add gettext.h.
6945 2002-04-16 Jim Meyering <meyering@lucent.com>
6947 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6948 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6949 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6951 2002-04-12 Jim Meyering <meyering@lucent.com>
6953 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6955 2002-03-10 Jim Meyering <meyering@lucent.com>
6957 * makepath.c (make_path): Remove a comma from a diagnostic.
6958 Suggestion from Santiago Vila.
6960 2002-03-08 Jim Meyering <meyering@lucent.com>
6962 * rename.c: Mention that this wrapper is needed also on
6963 mips-dec-ultrix4.4 systems.
6965 2002-03-02 Jim Meyering <meyering@lucent.com>
6967 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6968 not HAVE_CLOCK_SETTIME.
6970 2002-02-27 Paul Eggert <eggert@twinsun.com>
6972 * nanosleep.h: Rename to....
6973 * timespec.h: New name for nanosleep.h. All uses changed.
6975 * gettime.c: New file.
6976 * settime.c: New file.
6979 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6980 timespec.h. Remove nanosleep.h.
6982 2002-02-25 Paul Eggert <eggert@twinsun.com>
6984 * acl.c, acl.h: New files.
6985 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6987 2002-02-24 Jim Meyering <meyering@lucent.com>
6989 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6990 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6991 cause trouble. Reported by Nelson Beebe.
6993 2002-02-23 Paul Eggert <eggert@twinsun.com>
6995 * path-concat.c (xpath_concat): Reorder code to pacify
6996 compilers that don't know that xalloc_die never returns.
6998 2002-02-20 Jim Meyering <meyering@lucent.com>
7000 * getdate.c: Regenerate using bison-1.33.
7002 2002-02-15 Paul Eggert <eggert@twinsun.com>
7004 * posixver.c, posixver.h: New files.
7005 * Makefile.am (libfetish_a_SOURCES): Add them.
7007 2002-02-02 Paul Eggert <eggert@twinsun.com>
7008 Bruno Haible <bruno@clisp.org>
7010 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
7011 (fwrite_success_callback): New declaration.
7012 * unicodeio.c (unicode_to_mb): New function, extracted from
7013 print_unicode_char. Call failure callback instead of error.
7014 (fwrite_success_callback): New function.
7015 (exit_failure_callback): New function.
7016 (fallback_failure_callback): New function.
7017 (print_unicode_char): Call unicode_to_mb.
7019 2002-01-26 Jim Meyering <meyering@lucent.com>
7021 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
7023 2002-01-22 Jim Meyering <meyering@lucent.com>
7025 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
7026 Otherwise, some versions of automake would omit the rule that makes
7027 Makefile from Makefile.in.
7029 2001-01-21 Paul Eggert <eggert@twinsun.com>
7031 * xmemcoll.h, xmemcoll.c: New files.
7032 * Makefile.am (libfetish_a_SOURCES): Add them.
7033 * memcoll.c: Include errno.h, and declare errno if not defined.
7034 (memcoll): Set errno to zero if there is no error.
7036 * quotearg.c (quotearg_buffer_restyled):
7037 Fix bug with quoting buffers containing NUL when backslashing escapes.
7038 This bug was exposed by the other changes in this patch.
7039 (quotearg_n_options): New arg ARGSIZE.
7040 All callers changed.
7041 (quoting_options_from_style): New function.
7042 (quotearg_n_style): Use it.
7043 (quotearg_n_style_mem): New function.
7045 * quotearg.h (quotearg_n_style_mem): New function.
7047 2002-01-16 Jim Meyering <meyering@lucent.com>
7049 * getdate.y: Add three semicolons, each just before a closing brace.
7050 Bison (as of version 1.31) no longer papers over that mistake.
7052 2002-02-14 Paul Eggert <eggert@twinsun.com>
7054 * backupfile.c (ISDIGIT): Comment fix.
7055 * getdate.y (ISDIGIT): Likewise.
7056 * posixtm.c (ISDIGIT, year): Likewise.
7057 * strverscmp.c (ISDIGIT): Likewise.
7058 * userspec.c (ISDIGIT): Likewise.
7060 2002-01-05 Jim Meyering <meyering@lucent.com>
7062 * version-etc.c (version_etc_copyright): Update copyright year.
7064 2001-01-19 Paul Eggert <eggert@twinsun.com>
7066 * closeout.c (close_stdout_status): If ferror (stdout), do
7067 not silently exit merely because the output buffer happens to
7068 have nothing pending.
7070 2001-12-18 Paul Eggert <eggert@twinsun.com>
7072 See the big note in ../ChangeLog.
7073 * human.c (suffixes): Prefer K to k for 1024.
7074 (generate_suffix_backwards): New function.
7075 (human_readable_inexact): Use it.
7076 * xstrtol.c (__xstrtol): If there is no number but there
7077 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
7078 Accept 'K' as well as 'k'.
7080 2001-12-15 Jim Meyering <meyering@lucent.com>
7082 * regex.h (__restrict_arr): Update from libc.
7084 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
7085 as `remote' if the name starts with `//'. Suggested by Michael Stone.
7088 2001-12-10 Jim Meyering <meyering@lucent.com>
7090 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
7091 Instead, include "xalloc.h".
7092 (initbuffer): Don't cast xmalloc return value to char*.
7093 (readline): Reword comment.
7094 Don't cast xrealloc return value to char*
7097 2001-12-09 Jim Meyering <meyering@lucent.com>
7099 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
7100 `signed and unsigned type in conditional expression'.
7101 * posixtm.c (posix_time_parse): Likewise.
7103 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
7105 * readtokens.c (readtoken): Declare an index to be of type unsigned
7106 to avoid a pedantic warning.
7108 * getstr.c: Don't include assert.h.
7109 (getstr): Remove warning-evoking assertions.
7110 Return -1 if offset parameter is out of bounds.
7111 Change the type of a local from int to size_t.
7113 * strftime.c (my_strftime_localtime_r): Include this function
7114 definition in the `#if ! HAVE_TM_GMTOFF' block.
7116 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
7117 Include xalloc.h instead.
7119 2001-12-02 Jim Meyering <meyering@lucent.com>
7121 * tempname.c: Don't declare getenv, thus reverting the change of
7122 2001-11-18. It's no longer necessary, now that stdlib.h is always
7125 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
7126 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
7128 2001-11-30 Akim Demaille <akim@epita.fr>
7130 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
7131 before being defined.
7133 2001-11-27 Paul Eggert <eggert@twinsun.com>
7135 * quotearg.h (quotearg_n, quotearg_n_style):
7136 First arg is int, not unsigned.
7137 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
7138 (SIZE_MAX, UINT_MAX): New macros.
7139 (quotearg_n_options): Abort if N is negative.
7140 Avoid overflow check on hosts where size_t is 64 bits and int
7141 is 32 bits, as overflow is impossible there.
7142 Fix off-by-one typo that caused unnecessary reallocation.
7144 2001-11-27 Jim Meyering <meyering@lucent.com>
7146 * tempname.c: Merge with version from libc.
7147 * regex.c: Likewise.
7149 * tempname.c: Include stdlib.h unconditionally. On some old systems
7150 for which STDC_HEADERS is 0, it was not included, resulting in a
7151 warning about an integer-to-pointer conversion problem with getenv.
7152 Reported by Volker Borchert.
7154 2001-11-26 Jim Meyering <meyering@lucent.com>
7156 * gtod.h: Remove file.
7157 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
7158 * gettimeofday.c: Don't include gtod.h.
7159 (GTOD_init): Remove function.
7160 (rpl_gettimeofday): Do its job here instead, rather than aborting.
7161 Suggestion from Volker Borchert.
7163 2001-11-23 Jim Meyering <meyering@lucent.com>
7165 * hash.h (struct hash_table): Don't define here. Merely declare it.
7166 * hash.c (struct hash_table): Define it here instead.
7168 2001-11-22 Jim Meyering <meyering@lucent.com>
7170 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
7172 2001-11-18 Paul Eggert <eggert@twinsun.com>
7174 * tempname.c (TMP_MAX): Remove; no longer needed.
7175 (TEMPORARIES): New macro.
7176 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
7177 removes an artificial limitation (e.g. HP-UX 10.20, where
7180 2001-11-18 Jim Meyering <meyering@lucent.com>
7182 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
7185 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
7186 files will be created before anything else.
7188 2001-11-17 Jim Meyering <meyering@lucent.com>
7190 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
7191 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
7192 rather than group writable. Patch by Juan F. Codagnone.
7194 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
7195 Instead, include "xalloc.h".
7197 * mountlist.c: Include unlocked-io.h after all system headers.
7198 Remove explicit declarations of xmalloc, xrealloc,
7199 and xstrdup. Instead, include "xalloc.h".
7201 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
7202 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
7203 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
7205 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
7206 Reported by Padraig Brady.
7208 * mkstemp.c: #undef mkstemp.
7210 (rpl_mkstemp): Rename from mkstemp.
7213 2001-11-16 Jim Meyering <meyering@lucent.com>
7215 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
7216 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
7217 determine the amount of total physical memory, use pstat_getstatic.
7218 HPUX-11 doesn't define _SC_PHYS_PAGES.
7219 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
7220 If sysconf couldn't be used to determine the amount of available
7221 physical memory, use both pstat_getstatic and pstat_getdynamic.
7222 Based on a patch from Bob Proulx.
7224 2001-11-05 Jim Meyering <meyering@lucent.com>
7226 * xstat.in (slash_aware_lstat): Correct a misleading comment.
7228 2001-11-03 Jim Meyering <meyering@lucent.com>
7230 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
7231 in argmatch_to_argument call.
7233 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
7236 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
7237 e.g., a fault due to an attempt to free a NULL pointer.
7239 2001-11-01 Jim Meyering <meyering@lucent.com>
7241 * dirfd.c, dirfd.h: New files.
7242 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
7244 * hash.c (hash_print) [TESTING]: Clean up.
7246 2001-10-22 Paul Eggert <eggert@twinsun.com>
7248 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
7249 to avoid a warning if -Wall.
7251 2001-10-21 Paul Eggert <eggert@twinsun.com>
7253 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
7255 2001-10-21 Jim Meyering <meyering@lucent.com>
7257 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
7258 this code would end up calling gettext even in packages built
7260 * getopt.c (_): Likewise.
7261 * regex.c (_): Likewise.
7263 2001-10-20 Paul Eggert <eggert@twinsun.com>
7265 * error.c (strerror_r): Do not declare unless !_LIBC.
7266 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
7267 Use strerror_r that is only a macro, even if it is not a function.
7268 (strerror): Check for HAVE_DECL_STRERROR before declaring.
7269 (private_strerror): Use prototypes, not old-style function definition.
7270 (print_errno_message): New function.
7271 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
7273 (error_tail, error, error_at_line): Use it.
7275 2001-10-11 Jim Meyering <meyering@lucent.com>
7277 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
7278 and quote_n (1, ... to avoid clobbering a buffer.
7280 2001-10-05 Jim Meyering <meyering@lucent.com>
7282 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
7283 * hash-pjw.c: New file (factored out of fileutils' remove.c).
7284 * hash-pjw.h: New file.
7286 2001-09-30 Jim Meyering <meyering@lucent.com>
7288 * mountlist.c [MOUNTED_GETFSSTAT]:
7289 Include <sys/ucred.h>, for Apple Darwin.
7290 Include sys/mount.h and sys/fs_types.h only if available.
7292 (read_filesystem_list): Use FS_TYPE.
7294 2001-09-29 Paul Eggert <eggert@twinsun.com>
7296 * exclude.c (excluded_filename): 0 -> false, since it's
7299 2001-09-28 Paul Eggert <eggert@twinsun.com>
7301 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
7302 #defines strtoimax. Also treat the other strto* functions
7305 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
7306 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
7307 (strtoimax, strtoumax): Do not declare if already defined as a macro.
7309 2001-09-26 Jim Meyering <meyering@lucent.com>
7311 Most macros in unlocked-io.h had the wrong number of arguments.
7312 * gen-uio: New script.
7313 (USE_UNLOCKED_IO): Define to 1 if not already defined.
7314 * unlocked-io.hin: Remove file.
7315 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
7316 rather than trying to embed it here.
7317 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
7318 Reported by Padraig Brady.
7320 2001-09-25 Volker Borchert <bt@teknon.de>
7322 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
7324 2001-09-23 Jim Meyering <meyering@lucent.com>
7326 * mountlist.c: Remove useless parentheses in #if directives.
7327 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
7328 the deprecated MOUNTED symbol is no longer defined in mntent.h.
7330 2001-09-22 Jim Meyering <meyering@lucent.com>
7332 * localcharset.c: Update from latest gettext.
7333 * config.charset: Likewise.
7335 2001-09-20 Jim Meyering <meyering@lucent.com>
7337 * xstrtol.c (strtoimax): Guard declaration with
7338 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
7339 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
7340 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
7341 (strtoumax): Likewise, for completeness (it wasn't necessary).
7343 2001-09-06 Paul Eggert <eggert@twinsun.com>
7345 * strtoimax.c (HAVE_LONG_LONG):
7346 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
7347 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
7348 to work around bug in IBM C compiler.
7350 2001-09-16 Jim Meyering <meyering@lucent.com>
7352 * mkdir.c: New file.
7354 2001-09-04 Paul Eggert <eggert@twinsun.com>
7356 * xgetcwd.c: Revert some of the previous change; intead,
7357 fix the HAVE_GETCWD_NULL code to behave more like the
7358 !HAVE_GETCWD_NULL code used to.
7361 (xgetcwd): Do not return NULL when memory is exhausted; instead,
7364 2001-09-04 Paul Eggert <eggert@twinsun.com>
7366 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
7367 Use ssize_t, not int, to store result of readlink.
7368 Check for ssize_t overflow as well as size_t overflow,
7369 as POSIX says the result of readlink is implementation-defined
7370 when ssize_t overflows.
7371 Remove unnecessary cast to char*.
7372 Use free+malloc instead of realloc, as the storage doesn't need
7373 to be preserved and it's clearer and can be more efficient that way.
7374 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
7375 * xreadlink.h (xreadlink): Update prototype.
7377 2001-09-03 Paul Eggert <eggert@twinsun.com>
7379 * exclude.c (fnmatch_no_wildcards): Fix confusion between
7380 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
7381 spotted by Jim Meyering.
7383 2001-09-03 Jim Meyering <meyering@lucent.com>
7385 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
7387 2001-09-03 Paul Eggert <eggert@twinsun.com>
7389 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
7390 like the HAVE_GETCWD_NULL code.
7391 Include pathmax.h if not HAVE_GETCWD.
7392 Do not include xalloc.h.
7393 (INITIAL_BUFFER_SIZE): New symbol.
7394 Do not use xmalloc / xrealloc, since the caller is responsible for
7395 handling errors. Preserve errno around `free' during failure.
7396 Do not overrun buffer when using getwd.
7398 2001-09-03 Paul Eggert <eggert@twinsun.com>
7400 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
7401 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
7403 2001-09-02 Jim Meyering <meyering@lucent.com>
7405 * error.c: Update from GNU libc.
7407 2001-09-01 Jim Meyering <meyering@lucent.com>
7409 * xreadlink.c: New file.
7410 * xreadlink.h: New file.
7411 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
7413 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
7414 doesn't conflict with sparc Solaris 7's definition in
7415 /usr/include/sys/int_types.h.
7417 * exclude.c: Use `""', not `<>' to #include non-system header files.
7418 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
7419 and strncasecmp as r-values. Unixware didn't have declarations.
7421 2001-08-31 Jim Meyering <meyering@lucent.com>
7423 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
7424 Use an initial, malloc'd, buffer of length 128 rather than
7425 a statically allocated one of length 1024.
7427 2001-08-30 Paul Eggert <eggert@twinsun.com>
7429 * xgetcwd.c: Don't include pathmax.h.
7430 Include stdlib.h and unistd.h if available.
7432 (xmalloc, xstrdup, free): Remove decls.
7433 (xgetcwd): Don't assume sizes fit in unsigned.
7434 Check for overflow when computing sizes.
7435 Simplify reallocation code.
7437 2001-08-28 Paul Eggert <eggert@twinsun.com>
7439 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
7441 * strtoimax.c: Renamed from strtoxmax.c, removing the
7444 Also, make the following further changes to make this file's
7445 configuration more similar to that of strtol.c:
7446 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
7447 (strtoumax, uintmax_t, strtoull, strtol): Remove.
7448 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
7449 (strtoimax): Renamed from strtoumax. All uses of unsigned values
7450 changed to signed values.
7452 And make the following changes as well:
7453 Fix copyright notice, as 1999 was missing.
7454 (verify): New macro.
7455 (strtoimax): Check sizes at compile-time, not run-time.
7456 Prefer strtol to strtoll if both work.
7457 (main): Remove; it was not that useful and was a pain to maintain.
7459 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
7461 2001-08-30 Paul Eggert <eggert@twinsun.com>
7463 * savedir.c (savedir): Remove size parameter, as POSIX says that
7464 a directory's st_size can have an arbitrary value, so the old
7465 usage could waste an arbitrary amount of memory. All uses
7467 * savedir.h: Update prototype.
7469 2001-08-30 Paul Eggert <eggert@twinsun.com>
7471 * xstrtol.c (strtoimax): New decl.
7473 2001-08-28 Paul Eggert <eggert@twinsun.com>
7475 * xstrtol.h: Add copyright notice.
7476 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
7477 LONGINT_INVALID_SUFFIX_CHAR.
7479 2001-08-30 Paul Eggert <eggert@twinsun.com>
7481 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
7484 2001-08-30 Paul Eggert <eggert@twinsun.com>
7486 * hash.c: Remove '2001' from copyright notice.
7488 2001-08-30 Paul Eggert <eggert@twinsun.com>
7490 * full-write.h: New file.
7491 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
7492 * full-write.c: Correct credits, as cccp.c no longer
7493 exists and anyway it was so heavily changed from the old cccp
7494 code as to be unrecognizable. Include full-write.h.
7495 (full_write) Return size_t, with short writes meaning failure.
7496 All callers changed. This fixes a bug with large buffers
7498 * utime.c: Include full-write.h.
7500 2001-08-30 Paul Eggert <eggert@twinsun.com>
7502 Merge 'exclude' changes from tar 1.13.22.
7503 This fixes one or two unlikely storage allocation overflow bugs,
7504 but doesn't change user-visible behavior otherwise.
7506 2001-08-30 Paul Eggert <eggert@twinsun.com>
7508 * exclude.c (bool): Declare, perhaps by including stdbool.h.
7509 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
7510 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
7511 Include if available.
7512 (<xalloc.h>): Include
7513 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
7514 (verify): New macro. Use it to verify that EXCLUDE macros do not
7515 collide with FNM macros.
7516 (struct patopts): New struct.
7517 (struct exclude): Use it, as exclude patterns now come with options.
7518 (new_exclude): Support above changes.
7519 (new_exclude, add_exclude_file):
7520 Initial size must now be a power of two to simplify overflow checking.
7521 (free_exclude, fnmatch_no_wildcards): New function.
7522 (excluded_filename): No longer requires options arg, as the options
7523 are determined by add_exclude. Now returns bool, not int.
7524 (excluded_filename, add_exclude):
7525 Add support for the fancy new exclusion options.
7526 (add_exclude, add_exclude_file): Now takes int options arg.
7527 Check for arithmetic overflow when computing sizes.
7528 (add_exclude_file): xrealloc might modify errno, so don't
7529 realloc until after errno might be used.
7531 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
7533 (free_exclude): New decl.
7534 (add_exclude, add_exclude_file): Now takes int options arg.
7535 (excluded_filename): No longer requires options arg, as the options
7536 are determined by add_exclude. Now returns bool, not int.
7538 2001-08-30 Paul Eggert <eggert@twinsun.com>
7540 * alloca.c (alloca): Arg is of type size_t, not unsigned.
7542 2001-08-27 Jim Meyering <meyering@lucent.com>
7544 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
7546 * version-etc.c (N_): Remove definition.
7547 Revert most of last change.
7548 Instead, simply don't mark the `Copyright...' string for translation.
7549 Based on advice from Paul Eggert.
7551 * strtoxmax.c: Tweak comment.
7553 2001-08-26 Jim Meyering <meyering@lucent.com>
7555 * version-etc.c (version_etc_copyright_fmt): Replace literal year
7556 of copyright with `%s' so translators don't get an untranslated
7558 (COPYRIGHT_YEAR): Define.
7559 (version_etc): Use fprintf rather than fputs.
7560 Suggestion from Ulrich Drepper.
7562 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
7564 * strtoll.c: New file, from GNU libc.
7565 * xstrtoimax.c: New file.
7567 * xstrtol.h: Add xstrtoimax.
7568 * strtoumax.c: New file. Simply include "strtoumax.c".
7569 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
7571 * strtoumax.c: Factor to work both for unsigned and signed types, ...
7572 * strtoxmax.c: ... then renamed to this.
7574 2001-08-13 Paul Eggert <eggert@twinsun.com>
7576 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
7577 Port to Solaris 8, where 'sed' requires a space after the 'r'
7578 command, and where sh dislikes "$/". Clean up the spacing a bit.
7579 Redirect output to $tmp just once.
7581 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
7583 * addext.c (<errno.h>): Include.
7584 (errno): Declare if not defined.
7585 (addext): Work correctly when pathconf returns -1 and leaves
7586 errno alone because there is no limit. Also, work even if
7587 pathconf returns a value greater than SIZE_MAX.
7589 2001-08-12 Jim Meyering <meyering@lucent.com>
7591 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
7592 Simply `return getcwd (NULL, 0);'.
7593 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
7594 Use 1300 as initial value for length, not PATH_MAX.
7596 * pathmax.h: Clean up cpp syntax.
7598 2001-08-12 Jim Meyering <meyering@lucent.com>
7600 * gettimeofday.c: New file.
7602 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
7604 2001-08-04 Jim Meyering <meyering@lucent.com>
7606 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
7607 to get in sync with glibc.
7609 2001-08-03 Paul Eggert <eggert@twinsun.com>
7611 The following changes are from gettext 0.10.39 as maintained by
7614 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
7615 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
7616 with inverted sense. All uses changed.
7618 * mbswidth.c: Don't include <limits.h>.
7619 Include <stdlib.h> and <string.h> unconditionally.
7620 (iswcntrl, mbsinit, ISCNTRL): New macros.
7621 (mbsnwidth): Use K&R style function declarations.
7622 Don't bother checking for MB_LEN_MAX == 1, since the compiler
7623 can optimize it when MB_CUR_MAX == 1.
7624 The width of control characters is zero, not 1.
7626 2001-07-15 Jim Meyering <meyering@lucent.com>
7628 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
7629 (BUILT_SOURCES): Add unlocked-io.h.
7630 (io_functions): Define.
7631 (unlocked-io.h): New rule.
7632 (DISTCLEANFILES): Add unlocked-io.h.
7633 (all-local): Depend on unlocked-io.h, to ensure it is created.
7635 * unlocked-io.hin: New file
7637 * regex.c: Update from glibc.
7639 2001-07-05 Jim Meyering <meyering@lucent.com>
7641 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
7643 (libfetish_a_SOURCES): Put all .h files here instead.
7644 Remove a thus-exposed (better checks in automake) duplicate and
7645 two unnecessary .h files.
7647 2001-06-11 Jim Meyering <meyering@lucent.com>
7649 * regex.c: Update from GNU libc.
7651 2001-05-27 Jim Meyering <meyering@lucent.com>
7653 * readutmp.h (UT_TYPE): Define.
7655 2001-05-24 Jim Meyering <meyering@lucent.com>
7657 * argmatch.c: Include "quote.h".
7658 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
7659 quote function. Reported by Göran Uddeborg.
7661 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
7663 * dirname.c (dir_name): Compute append_dot using path, not newpath
7664 which is not yet declared.
7666 2001-05-11 Paul Eggert <eggert@twinsun.com>
7668 * Makefile.am (libfetish_a_SOURCES):
7669 Add strftime.c, since we now compile it on all hosts.
7671 * strftime.c (my_strftime):
7672 Define to nstrftime if emacs, but only if my_strftime is not defined.
7673 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
7674 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
7675 Add one more extra argument: a nanoseconds value.
7678 (my_strftime function): Add %N format.
7679 (emacs_strftimeu): Renamed from emacs_strftime,
7680 with extra ut argument.
7682 2001-05-11 Paul Eggert <eggert@twinsun.com>
7684 dirname code cleanup. base_name now behaves more compatibly
7685 with POSIX basename when given file names that have trailing
7686 slashes, and similarly for dir_name. Add new primitives
7687 base_len and dir_len. Put the directory-name-related decls
7690 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
7691 * backupfile.c (base_name): Likewise.
7692 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
7693 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
7694 * makepath.c (strip_trailing_slashes): Likewise.
7695 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
7697 * rename.c (strip_trailing_slashes): Likewise.
7698 * same.c (base_name): Likewise.
7699 * stripslash.c (ISSLASH): Likewise.
7701 * addext.c: Include <dirname.h> after size_t is defined.
7702 * backupfile.c: Likewise.
7704 * addext.c (addext): Use base_len to trim redundant
7705 trailing slashes instead of doing it ourselves.
7706 But do not trim the last slash if it is not redundant.
7708 * backupfile.c (find_backup_file_name,
7709 max_backup_version): Use base_len instead of rolling it ourselves.
7710 Handle the case of "" and (on DOS) "C:" correctly.
7712 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
7713 Include <string.h>, <dirname.h>.
7714 (base_name): Allow file names ending in slashes, other than names
7715 that are all slashes. In this case, return the basename followed
7716 by the slashes. This is more general, and can be used in places
7717 where the original base_name purposely had an assertion failure.
7718 (base_len): New function.
7720 * dirname.c: Include <string.h> instead of <stdlib.h>.
7721 Do not include <assert.h>; no longer needed.
7723 (memrchr): Remove decl.
7724 (dir_name_r): Remove.
7725 (dir_len): Renamed from dirlen. All callers changed.
7726 Rewrite in terms of base_name, for simplicity and consistency.
7727 (dir_name): Never return NULL. All callers changed.
7728 Do not include <stdlib.h> in test program; no longer needed.
7729 return 0; is fine for test program.
7731 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
7733 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
7735 * path-concat.c (path_concat): Use base_len to compute
7736 base length, not strlen; this means we cannot rely on memcpy
7739 * same.c (STREQ): Remove.
7740 (same_name): Handle the case where the basename ends in trailing '/'.
7742 * stripslash.c (strip_trailing_slashes): Return nonzero if
7743 a slash was stripped. Do not strip the last slash after a
7746 2001-04-08 Jim Meyering <meyering@lucent.com>
7748 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
7749 recomputed; that's necessary when the offset spans a DST transition.
7750 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
7752 2001-04-02 Jim Meyering <meyering@lucent.com>
7754 * regex.h, regex.c: Update from GNU libc.
7756 2001-03-19 Paul Eggert <eggert@twinsun.com>
7758 * version-etc.c (version_etc_copyright): Update to 2001.
7760 2001-03-16 Paul Eggert <eggert@twinsun.com>
7762 * tempname.c (uint64_t): Define to uintmax_t if
7763 not defined, and if UINT64_MAX is not defined.
7764 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
7765 Reported by John David Anglin.
7767 2001-03-10 Bruno Haible <haible@clisp.cons.org>
7769 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
7770 alias if codeset is empty.
7771 * config.charset (BeOS): Use wildcard syntax.
7773 2001-03-13 Jim Meyering <meyering@lucent.com>
7775 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
7776 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
7779 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7781 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
7783 * unicodeio.c (print_unicode_char): Simplify accordingly.
7785 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7787 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
7788 support for DOS/DJGPP.
7790 2001-02-28 Paul Eggert <eggert@twinsun.com>
7792 * Makefile.am (libfetish_a_SOURCES):
7793 Add dup-safer.c, fopen-safer.c.
7794 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
7796 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
7798 2001-02-25 Paul Eggert <eggert@twinsun.com>
7800 The mkstemp replacement is taken from glibc 2.2.2, with some
7801 portability fixes for use outside glibc, as follows:
7803 * tempname.c (struct_stat64): New macro.
7804 (direxists, __gen_tempname): Use it.
7805 This avoids a portability problem with Solaris 8.
7807 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7808 (<stddef.h>, <stdint.h>, <string.h>):
7809 Include only if STDC_HEADERS || _LIBC.
7810 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7811 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7812 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7813 (__set_errno): Define this macro if <errno.h> doesn't.
7814 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7815 Define these macros if <stdio.h> doesn't.
7816 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7817 Define these macros if <sys/stat.h>
7818 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7819 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7820 __xstat64): Define if not _LIBC.
7821 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7822 (__gen_tempname): Invoke gettimeofday only if
7823 HAVE_GETTIMEOFDAY || _LIBC;
7824 otherwise, fall back on plain "time".
7825 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7827 * mkstemp.c (__GT_FILE): Define to zero if not defined.
7829 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7831 2001-02-17 Jim Meyering <meyering@lucent.com>
7833 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
7834 around included file name.
7836 * strnlen.c (__strnlen): Merge in a change from GNU libc.
7838 * strftime.c: Update from GNU libc (the only changes were to comments).
7840 2001-02-13 Bruno Haible <haible@clisp.cons.org>
7842 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7844 2001-02-17 Paul Eggert <eggert@twinsun.com>
7846 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7847 Remove workaround macros for hosts that have mbrtowc but not
7848 mbstate_t, as we now insist on proper declarations for both
7849 before using mbrtowc.
7851 2001-02-17 Jim Meyering <meyering@lucent.com>
7853 * regex.c: Update from libc.
7855 2001-02-16 Paul Eggert <eggert@twinsun.com>
7857 * alloca.c (malloc): Undef before defining, since stdlib.h
7858 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
7859 Reported by Mark Hounschell via Paul Eggert.
7861 2001-01-30 Bruno Haible <haible@clisp.cons.org>
7863 * config.charset: Update for FreeBSD 4.2.
7865 2001-01-26 Jim Meyering <meyering@lucent.com>
7867 * quotearg.c: Include stddef.h.
7868 * quote.c: Include stddef.h.
7869 Reported by Axel Kittenberger.
7871 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7872 line in double quotes so that it evokes a better diagnostic.
7873 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7874 Reported by Axel Kittenberger.
7876 2001-01-15 Bruno Haible <haible@clisp.cons.org>
7878 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7879 to avoid a warning. Add back 'const' to inptr.
7881 2001-01-16 Jim Meyering <meyering@lucent.com>
7883 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7886 2001-01-14 Jim Meyering <meyering@lucent.com>
7888 * rename.c: New file. From Volker Borchert.
7889 Include stdlib.h, string.h or strings.h, and xalloc.h.
7890 Use strip_trailing_slashes rather than open-coding it.
7892 2001-01-03 Paul Eggert <eggert@twinsun.com>
7894 * strftime.c: Sync with glibc time/strftime.c 1.81.
7896 2001-01-03 Jim Meyering <meyering@lucent.com>
7898 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7899 local `inptr' to avoid warning with some system declarations of iconv.
7901 2000-12-29 Paul Eggert <eggert@twinsun.com>
7903 * modechange.c: Do not assume that mode_t uses the
7904 traditional octal encoding. E.g. "chmod 1 FOO" should set
7905 the other-execute bit of FOO even if S_IXOTH != 1.
7907 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7908 WOTH, XOTH, ALLM): New macros.
7909 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7910 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7912 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7913 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7915 No need to use uintmax_t; unsigned long is long enough.
7916 Don't bother to get suffix since we don't use it.
7918 2000-12-24 Jim Meyering <meyering@lucent.com>
7920 * hash.c (is_prime): Return explicit boolean values.
7921 (hash_get_first): Return NULL to appease Irix5.6's 89.
7922 Reported by Nelson Beebe.
7924 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7926 * localcharset.c (locale_charset): Add support for Win32.
7928 2000-12-18 Paul Eggert <eggert@twinsun.com>
7930 * physmem.h, physmem.c: New files.
7932 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7933 (noinst_HEADERS): Add physmem.h.
7935 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7936 't' for compatibility with Solaris 8 sort.
7938 2000-12-18 Bruno Haible <haible@clisp.cons.org>
7940 * config.charset: Add support for BeOS.
7942 2000-12-16 Jim Meyering <meyering@lucent.com>
7944 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7945 SHELLS_FILE to a file name that's useful on djgpp systems.
7947 (ADDITIONAL_DEFAULT_SHELLS): Define.
7948 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7949 Based mostly on a patch from Prashant TR.
7951 2000-12-16 Jim Meyering <meyering@lucent.com>
7953 This bug had a serious impact on chown: `chown N:M FILE' (for integer
7954 N and M) would have treated it like `chown N:N FILE'.
7956 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7958 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7960 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7961 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7962 to the list of canonical encodings. Rename EUC-CN to GB2312.
7964 2000-12-08 Andreas Schwab <schwab@suse.de>
7966 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7967 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7969 2000-12-07 Jim Meyering <meyering@lucent.com>
7971 * stripslash.c (ISSLASH): Define.
7972 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7975 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7976 (dir_name_r): Declare this function as static.
7977 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7978 manifest itself on a name containing a mix of slashes and
7980 Make this function work with names starting with a DOS-style
7981 drive letter and colon prefix.
7982 (dir_name): Append `.' if necessary.
7983 Based mostly on patches from Prashant TR and Eli Zaretskii.
7985 * dirname.h (dir_name_r): Remove prototype.
7987 2000-12-05 Jim Meyering <meyering@lucent.com>
7989 * dirname.c (dir_name_r): Add `const' in a few local declarations.
7991 2000-12-04 Jim Meyering <meyering@lucent.com>
7993 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7994 Also include memory.h, stdlib.h, unistd.h if appropriate.
7995 Reported by Andreas Jaeger (conflicting declaration of malloc).
7997 2000-12-02 Jim Meyering <meyering@lucent.com>
7999 * closeout.h: Make idempotent, to avoid some obscure warnings.
8001 2000-12-01 Paul Eggert <eggert@twinsun.com>
8003 * memrchr.c: Include <config.h> before any system include file.
8005 2000-11-29 Paul Eggert <eggert@twinsun.com>
8007 * dirname.c (dir_name_r): Fix typo: int -> size_t.
8009 2000-11-26 Jim Meyering <meyering@lucent.com>
8011 * memcoll.c: Include sys/types.h. From Werner Almesberger.
8013 2000-11-22 Paul Eggert <eggert@twinsun.com>
8015 * strftime.c (my_strftime): Do not invoke mbrlen with a
8016 size of (size_t) -1; it's not portable.
8018 2000-11-17 Akim Demaille <akim@epita.fr>
8020 * obstack.h: Formatting changes.
8021 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
8022 prevent type checking.
8023 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
8024 cast the value to (void *): assigning a `foo *' to a `void *'
8026 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
8028 2000-11-17 Jim Meyering <meyering@lucent.com>
8030 * strstr.c: Update from GNU libc.
8032 2000-11-16 Jim Meyering <meyering@lucent.com>
8034 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
8036 2000-11-11 Jim Meyering <meyering@lucent.com>
8038 * error.c: Add a couple #includes, merging from GNU libc version.
8040 2000-11-10 Jim Meyering <meyering@lucent.com>
8042 * obstack.h: Update from GNU libc.
8043 * obstack.c: Likewise.
8045 2000-11-06 Paul Eggert <eggert@twinsun.com>
8047 * getusershell.c (setusershell): Use rewind rather than
8048 fseek/fseeko, to avoid configuration hassles with fseeko.
8049 Don't bother opening SHELLS_FILE if shellstream is NULL;
8052 2000-11-05 Jim Meyering <meyering@lucent.com>
8054 * makepath.h (make_dir): Declare.
8055 * makepath.c (make_dir): Remove `static' attribute.
8058 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
8060 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
8061 last one in a bucket, advance to the next bucket.
8063 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
8065 * fnmatch.c: Do not comment out all the code if we are using
8066 the GNU C library, because in some cases we are replacing buggy
8067 code in the GNU C library itself.
8069 2000-10-30 Paul Eggert <eggert@twinsun.com>
8071 * error.h, getline.h, modechange.h:
8072 Remove "2000" from Copyright line, as the file hasn't been
8073 changed this year other than in the copyright notice.
8075 * xalloc.h: Add "2000" to Copyright line, as this file
8076 was changed this year.
8078 2000-10-30 Paul Eggert <eggert@twinsun.com>
8080 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
8081 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
8082 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
8084 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
8086 * regex.h (__restrict_arr): Move definition out of #ifndef block.
8087 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
8088 doesn't define __restrict_arr.
8090 2000-10-29 Jim Meyering <meyering@lucent.com>
8092 * xstat.in: Fix grammar in comment.
8094 2000-10-28 Jim Meyering <meyering@lucent.com>
8096 * memchr.c: Update from libc.
8097 Adjust for portability:
8098 [HAVE_STDLIB_H]: Include stdlib.h.
8099 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
8100 Undef __memchr, too.
8101 [!weak_alias]: Define __memchr to memchr.
8103 * regex.c: Update from libc.
8104 * regex.h: Likewise.
8105 * getopt1.c: Likewise.
8106 * memcmp.c: Likewise.
8108 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
8109 Avoid using fseek, when possible -- it's broken by design.
8110 Patch by Ulrich Drepper.
8112 2000-10-26 Jim Meyering <meyering@lucent.com>
8114 * strftime.c: Update from libc.
8116 2000-10-25 Jim Meyering <meyering@lucent.com>
8118 * obstack.c: Update from libc.
8120 2000-10-23 Jim Meyering <meyering@lucent.com>
8122 * hard-locale.c (hard_locale): Revert last change -- it was simply
8123 wrong. That set_locale call must not have any side effects.
8126 2000-10-22 Jim Meyering <meyering@lucent.com>
8128 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
8129 [CYCLIC]: Remove now-unused definition.
8131 * save-cwd.c (O_DIRECTORY): Define, if needed.
8132 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
8133 Suggestion from Ulrich Drepper.
8135 2000-10-21 Jim Meyering <meyering@lucent.com>
8137 * dirname.c (dir_name_r): New function, factored out of dir_name.
8138 (dir_name): Use dir_name_r.
8139 * dirname.h (dir_name_r): Declare it.
8141 2000-10-21 Jim Meyering <meyering@lucent.com>
8143 * dirname.c (memrchr): Declare if necessary.
8144 (dir_name): Remove the restriction that there be no
8145 trailing slashes. Now, this code skips past them, effectively
8147 [TEST_DIRNAME] (main): New unit tests.
8149 * memrchr.c: New file from GNU libc.
8150 Undef __memrchr, too.
8151 [!weak_alias]: Define __memrchr to memrchr.
8152 Guard weak_alias use with `#ifdef weak_alias'.
8154 2000-10-17 Jim Meyering <meyering@lucent.com>
8156 * quote.h (PARAMS): Define and use.
8157 Reported by Akim Demaille.
8159 * getopt.c: Update from libc.
8161 2000-10-16 Jim Meyering <meyering@lucent.com>
8163 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
8166 2000-09-25 Jim Meyering <meyering@lucent.com>
8168 * md5.h (rol): Define (from GnuPG).
8170 * sha.c: Give credit (GnuPG) where due.
8171 (M): Use rol rather than open-coding it.
8172 Add a FIXME comment.
8174 2000-09-21 Jim Meyering <meyering@lucent.com>
8176 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
8177 Reported by Michael Stone.
8179 2000-09-20 Jim Meyering <meyering@lucent.com>
8181 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
8182 (noinst_HEADERS): Add sha.h.
8183 Based on code from Scott G. Miller and from GnuPG.
8185 2000-09-15 Jim Meyering <meyering@lucent.com>
8187 * regex.c: Update from libc.
8189 2000-09-10 Jim Meyering <meyering@lucent.com>
8191 * getopt.c (_getopt_internal): Update from glibc.
8193 2000-09-09 Jim Meyering <meyering@lucent.com>
8195 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
8196 think it should be used as a general replacement for isascii.
8197 * fnmatch.c: Likewise.
8198 * mbswidth.c: Likewise
8199 * regex.c: Likewise.
8202 * userspec.c: Include sys/param.h and limits.h.
8204 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8205 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
8206 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
8207 UID, GID. Check range.
8209 2000-09-06 Jim Meyering <meyering@lucent.com>
8211 * getopt.c (_getopt_internal): Update from glibc.
8213 2000-08-30 Jim Meyering <meyering@lucent.com>
8215 * strftime.c: Merge in changes from GNU libc.
8217 2000-08-26 Jim Meyering <meyering@lucent.com>
8219 * closeout.c: Include "__fpending.h".
8220 (close_stdout_status): Return right away if there's nothing to flush.
8222 * Makefile.am (noinst_HEADERS): Add __fpending.h.
8223 * __fpending.c: New file.
8224 * __fpending.h: New file.
8226 2000-08-07 Paul Eggert <eggert@twinsun.com>
8228 Standardize on "memory exhausted" instead of "Memory exhausted"
8229 or "virtual memory exhausted".
8230 * obstack.c (print_and_abort): Use "memory exhausted", not
8231 "virtual memory exhausted".
8232 * same.c (same_name): Invoke xalloc_die instead of printing
8234 * userspec.c (parse_user_spec): Likewise.
8235 * bumpalloc.h: comment fix
8236 * same.c, userspec.c: Include xalloc.h.
8238 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
8239 not char *const and pointing to a constant array.
8240 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
8241 (xrealloc): Comment fix.
8243 * userspec.c (parse_user_spec):
8244 Don't translate a message until just before returning,
8245 to avoid unnecessary translation.
8247 2000-08-07 Jim Meyering <meyering@lucent.com>
8249 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
8250 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
8251 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
8252 getgroups.c, gethostname.c, getopt.h, group-member.c,
8253 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
8254 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
8255 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
8256 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
8257 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
8258 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
8259 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
8260 yesno.c: Back out Copyright date changes for each file with no change
8261 this year. This eases coordination with other programs using the same
8262 source code modules. From Paul Eggert.
8264 2000-08-03 Greg McGary <greg@mcgary.org>
8266 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
8267 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
8268 (EXTEND_BUFFER): Use them.
8270 2000-08-01 Jim Meyering <meyering@lucent.com>
8272 * dirname.c (ISSLASH): Define.
8273 (BACKSLASH_IS_PATH_SEPARATOR): Define.
8274 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
8275 both `\' and `/' may be use as path separators.
8276 Based on a patch from Prashant TR.
8278 2000-07-31 Paul Eggert <eggert@twinsun.com>
8280 * quotearg.c (quotearg_n_options): Don't make the initial
8281 slot vector a constant, since it might get modified.
8283 2000-07-31 Jim Meyering <meyering@lucent.com>
8285 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
8286 * obstack.c (print_and_abort): Likewise.
8288 2000-07-30 Paul Eggert <eggert@twinsun.com>
8290 * quotearg.c (quotearg_n_options): Preallocate a slot 0
8291 buffer, so that the caller can always quote one small
8292 component of a "memory exhausted" message in slot 0.
8293 From a suggestion by Jim Meyering.
8295 2000-07-30 Jim Meyering <meyering@lucent.com>
8297 * makepath.c (make_path): Quote the other instance, too.
8299 * quotearg.c (N_STATIC_SLOTVECS): Define.
8300 (STATIC_BUF_SIZE): Define.
8301 (quotearg_n_options): Use only statically allocated storage when
8302 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
8303 than STATIC_BUF_SIZE.
8305 2000-07-29 Jim Meyering <meyering@lucent.com>
8307 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
8308 * dirname.c (dir_name): Likewise.
8310 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
8312 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
8313 (dir_name): Assert that there are no trailing slashes.
8315 2000-07-18 Bruno Haible <haible@clisp.cons.org>
8317 * mbswidth.h (mbswidth): Add a flags argument.
8318 (mbswidth): New declaration.
8319 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
8320 * mbswidth.c (mbswidth): Add a flags argument.
8321 (mbsnwidth): New function.
8323 2000-07-24 Jim Meyering <meyering@lucent.com>
8325 * mbswidth.c: Remove useless #else. From Bruno Haible.
8327 2000-07-23 Paul Eggert <eggert@twinsun.com>
8329 * mbswidth.c (_XOPEN_SOURCE):
8330 Don't define; this causes problems on Solaris 7.
8331 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
8333 2000-07-23 Paul Eggert <eggert@twinsun.com>
8336 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
8337 so that mbstate_t is always defined.
8339 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
8340 be 1 in at least one GCC installation, and this configuration
8341 error is likely to be common. Ignoring MB_LEN_MAX hurts
8342 performance on hosts that have mbrtowc but have only unibyte
8343 locales, but I assume these hosts are rare.
8345 2000-07-23 Paul Eggert <eggert@twinsun.com>
8347 * quotearg.c: Streamline by invoking multibyte code only if needed.
8348 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
8349 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
8350 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
8351 invoke multibyte primitives.
8353 2000-07-23 Jim Meyering <meyering@lucent.com>
8355 * basename.c (base_name): Add an assertion.
8357 2000-07-15 Bruno Haible <clisp.cons.org>
8359 * quotearg.c: When the system forces us to redefine mbstate_t,
8360 shadow its mbsinit function.
8362 2000-07-16 Bruno Haible <haible@clisp.cons.org>
8364 * mbswidth.h: New file.
8365 * mbswidth.c: New file.
8366 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
8367 (noinst_HEADERS): Add mbswidth.h.
8369 2000-07-17 Bruno Haible <haible@clisp.cons.org>
8371 * config.charset: Add support for FreeBSD. Improve support for HP-UX
8374 2000-07-15 Jim Meyering <meyering@lucent.com>
8376 * makepath.c: Include quote.h.
8377 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
8378 corresponding argument in a `quote (...)' call.
8379 Give better diagnostics.
8381 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
8382 (noinst_HEADERS): Add quote.h.
8384 * quote.c (quote, quote_n): New file. Two functions taken verbatim
8385 from tar's src/misc.c.
8386 * quote.h: New file. Prototypes for same.
8388 2000-07-10 Paul Eggert <eggert@twinsun.com>
8390 From a suggestion by Bruno Haible.
8391 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
8392 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
8393 to decide whether to define the BeOS workaround macro;
8394 this adjusts to the change to AC_MBSTATE_T.
8396 2000-07-13 Paul Eggert <eggert@twinsun.com>
8398 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
8400 * quotearg.c (quoting_style_args, quoting_style_vals,
8401 quotearg_buffer_restyled): Add support for
8402 clocale_quoting_style. Undo previous change to
8403 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
8404 and "{RIGHT QUOTATION MARK}" msgids.
8406 2000-07-05 Paul Eggert <eggert@twinsun.com>
8408 The old behavior of quoting `like this' doesn't look good with
8409 newer, ISO-style fonts. See:
8410 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
8412 Instead, quote "like this" by default. Let the translator
8413 tailor the locale-specific quoting behavior by providing
8414 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
8416 * quotearg.c (N_): New macro.
8417 (gettext_default): New function.
8418 (quotearg_buffer_restyled): Use
8419 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
8420 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
8422 2000-07-09 Jim Meyering <meyering@lucent.com>
8424 * Most files: Update copyright dates to include 2000.
8426 2000-07-08 Jim Meyering <meyering@lucent.com>
8428 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
8430 (xgethostname): Remove now-unnecessary #ifdef.
8431 Move declaration of `err' into loop where it's used.
8433 2000-07-05 Bruno Haible <haible@clisp.cons.org>
8435 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
8436 by allocating a larger buffer. Test the gethostname return value for
8437 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
8438 returns an error and ENAMETOOLONG isn't defined.
8440 2000-07-05 Paul Eggert <eggert@twinsun.com>
8441 and Bruno Haible <haible@clisp.cons.org>
8443 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
8445 2000-07-05 Bruno Haible <haible@clisp.cons.org>
8447 * quotearg.c (struct quoting_options): Simplify quote_these_too
8450 2000-07-03 Jim Meyering <meyering@lucent.com>
8452 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
8453 Reported by Bruno Haible.
8455 2000-07-04 Jim Meyering <meyering@lucent.com>
8457 * quotearg.c: Make inclusion of <wchar.h> independent of whether
8458 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
8461 2000-07-03 Paul Eggert <eggert@twinsun.com>
8462 and Bruno Haible <haible@clisp.cons.org>
8464 * quotearg.c (mbrtowc):
8465 Assign to *pwc, and return 1 only if result is nonzero.
8466 (iswprint): Use ISPRINT when substituting our own mbrtowc.
8468 2000-07-03 Jim Meyering <meyering@lucent.com>
8470 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
8471 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
8474 2000-07-02 Jim Meyering <meyering@lucent.com>
8476 * quotearg.c (mbstate_t): Don't define here.
8478 2000-07-02 Jim Meyering <meyering@lucent.com>
8480 * nanosleep.c (SIGCONT): Define if not already defined.
8482 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8484 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
8485 per change in ../m4/ls-mntd-fs.m4.
8486 (read_filesystem_list): Ignore symbolic links.
8488 2000-06-29 Jim Meyering <meyering@lucent.com>
8490 * same.c: Include <string.h> or <strings.h>, as appropriate,
8491 for declaration of strcmp.
8493 * long-options.c: Include <stdlib.h>, for declaration of exit.
8495 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
8496 Avoid warning by casting result to `char *' to remove `const'.
8498 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8500 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
8502 2000-06-26 Paul Eggert <eggert@twinsun.com>
8504 savedir now sets errno on failure and invokes xmalloc to get memory.
8505 Fix a couple of other minor bugs while we're at it.
8507 * savedir.c (<unistd.h>): Do not include; there's no need.
8508 (NAMLEN): Remove macro.
8509 (malloc, realloc): Remove decls.
8511 ("xalloc.h"): Include.
8512 (NAME_SIZE_DEFAULT): New macro.
8513 (savedir): Use xmalloc / xrealloc to allocate memory.
8514 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
8515 Skip "" directory entries.
8516 Use strlen to calculate directory entry length, since the old method
8517 is rarely used these days and isn't worth supporting.
8518 Don't use a pointer after freeing it.
8519 Check for integer overflow when calculating allocation size.
8520 Use memcpy to copy entries, instead of stpcpy.
8521 Set errno properly when returning NULL.
8522 Check for readdir error.
8524 2000-06-26 Jim Meyering <meyering@lucent.com>
8526 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
8528 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8530 * getusershell.c (xmalloc, xrealloc): Remove functions.
8532 Don't include <stdlib.h>. Don't declare malloc, realloc.
8534 2000-06-23 Bruno Haible <haible@clisp.cons.org>
8536 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
8538 2000-06-24 Jim Meyering <meyering@lucent.com>
8540 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
8542 2000-06-21 Jim Meyering <meyering@lucent.com>
8544 * getpass.c: New file, from Bruno Haible. Required for BeOS.
8546 2000-06-19 Paul Eggert <eggert@twinsun.com>
8548 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
8549 (mbrtowc, mbstate_t): Define substitutes if
8550 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
8551 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
8552 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
8554 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8556 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
8557 than 1024, return a memory chunk of least possible size, instead
8558 of size PATH_MAX + 2. In the loop, increment the size proportionally.
8559 Use free/xmalloc instead of xrealloc to avoid copying for very long
8562 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8564 * canon-host.c (canon_host): Use malloc and memcpy to copy an
8565 address, not strdup. Include <stdlib.h> and don't declare free().
8567 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8569 * path-concat.c (path_concat): Don't access dir[-1] if dir is
8572 2000-06-21 Jim Meyering <meyering@lucent.com>
8574 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
8575 (noinst_HEADERS): Add getstr.h.
8577 * getline.c (getstr): Move into a separate file.
8578 * getstr.c (getstr): New file, extracted from getline.c, with
8579 the following changes: new parameter, delim2; both delim[12]
8580 parameters have type `int', not `char'. The latter would lose
8581 with 8-bit delimiters.
8582 * getstr.h: New file.
8584 2000-06-19 Jim Meyering <meyering@lucent.com>
8586 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
8588 2000-06-18 Jim Meyering <meyering@lucent.com>
8590 * mkdir.c: Remove file, due mainly to copyright incompatibility.
8591 Besides, these days every porting target provides a mkdir function.
8593 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
8594 (this snippet comes from src/system.h).
8596 2000-06-15 Paul Eggert <eggert@twinsun.com>
8598 * human.c (adjust_value): New function.
8599 (human_readable_inexact): Apply rounding style even when
8600 printing approximate values.
8602 2000-06-14 Paul Eggert <eggert@twinsun.com>
8604 * human.c (human_readable_inexact): Allow an input block
8605 size that is not a multiple of the output block size, and vice versa.
8606 Reported by Piergiorgio Sartor.
8608 2000-06-14 Paul Eggert <eggert@twinsun.com>
8610 * getdate.y (get_date): Apply relative times after time
8611 zone indicator, not before. Reported by Todd A. Jacobs.
8613 2000-06-13 Jim Meyering <meyering@lucent.com>
8615 * Makefile.am (all-local): Depend on lstat.c and stat.c.
8617 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
8619 2000-06-12 Paul Eggert <eggert@twinsun.com>
8621 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
8623 2000-06-04 Paul Eggert <eggert@twinsun.com>
8625 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
8627 2000-06-04 Jim Meyering <meyering@lucent.com>
8629 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
8630 SunOS 4.1.4 for which gid_t is an unsigned type.
8632 2000-06-03 Jim Meyering <meyering@lucent.com>
8634 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
8636 2000-05-26 Bruno Haible <haible@clisp.cons.org>
8638 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
8639 newer, don't install charset.alias.
8640 * config.charset: Change the Linux/glibc rules so they become empty
8641 on glibc-2.1 or newer.
8643 2000-06-02 Jim Meyering <meyering@lucent.com>
8645 * mountlist.c: Back out last change. Instead, do this...
8646 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
8647 member using the same `ignore'-testing code.
8648 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
8652 2000-05-29 Jim Meyering <meyering@lucent.com>
8654 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
8655 with the `ignore' attribute. Based on a patch from Mark D. Roth.
8657 2000-05-22 Jim Meyering <meyering@lucent.com>
8659 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
8661 2000-05-18 Jim Meyering <meyering@lucent.com>
8663 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
8664 back, too, since it may have been modified by allocate_entry.
8665 (hash_delete): Rewrite to use neither the assignment operator
8666 nor the comma operator in an if-expression.
8668 2000-05-15 Paul Eggert <eggert@twinsun.com>
8671 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
8672 Remove; no longer needed.
8673 "quotearg.h": Add include.
8674 (file_name): Do not bother to explicitly initialize to NULL; it's less
8675 efficient on some hosts.
8676 (close_stdout_status): Remove test as to whether stdout was already
8677 closed; it breaks for the case "echo x | sort >&-".
8678 Quote file name colons.
8679 Do not assume that _("write error") lacks format strings.
8681 2000-05-15 Jim Meyering <meyering@lucent.com>
8683 * version-etc.c (version_etc_copyright): Update the copyright string
8684 used in all --version output.
8686 2000-05-14 Jim Meyering <meyering@lucent.com>
8688 * closeout.c (close_stdout_set_file_name): New function.
8689 (close_stdout_status): Use new file-scoped global.
8690 Return right away if fstat says the stdout file descriptor is invalid.
8691 * closeout.h (close_stdout_set_file_name): Declare.
8693 2000-05-10 Jim Meyering <meyering@lucent.com>
8695 * closeout.c [default_exit_status]: New file-scoped variable.
8696 (close_stdout_set_status): New function.
8697 * closeout.h (close_stdout_set_status): Declare.
8699 2000-05-08 Jim Meyering <meyering@lucent.com>
8701 * long-options.c: Don't include closeout.h.
8702 (parse_long_options): Don't call close_stdout for --version.
8704 2000-05-06 Jim Meyering <meyering@lucent.com>
8706 * strnlen.c: Undefine __strnlen and strnlen.
8707 [!weak_alias]: Define __strnlen to strnlen.
8709 * atexit.c: New file, from libiberty.
8711 2000-05-06 Jim Meyering <meyering@lucent.com>
8713 * closeout.c (close_stdout_status): Also check for errors on the
8716 2000-05-05 Bruno Haible <haible@clisp.cons.org>
8718 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
8719 instead of xmalloc, xrealloc, path_concat.
8720 (locale_charset): Treat empty environment variables as absent.
8721 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
8723 2000-05-04 Jim Meyering <meyering@lucent.com>
8725 * getopt.c: Update from glibc.
8726 * obstack.c: Likewise.
8727 * obstack.h: Likewise.
8728 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
8730 * regex.h: Likewise.
8731 * strndup.c: Likewise.
8732 * strnlen.c: New file, from glibc.
8734 2000-05-01 Jim Meyering <meyering@lucent.com>
8736 * full-write.c (full_write): Remove `FIXME' part of comment.
8738 2000-04-29 Jim Meyering <meyering@lucent.com>
8740 * path-concat.c: Declare strdup only if it's not defined.
8741 * canon-host.c: Likewise.
8743 2000-04-28 Jim Meyering <meyering@lucent.com>
8745 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
8746 redefinition warning on some systems (HPUX). Otherwise, regex.h is
8747 included first, then limits.h is included by locale.h by libintl.h.
8748 From John David Anglin.
8750 2000-04-25 Jim Meyering <meyering@lucent.com>
8752 * makepath.c (S_IRWXUGO): Define.
8753 (make_path): Always perform explicit chmod if MODE specifies any
8754 of the `special' permission bits. Prompted by a bug report against
8755 install from Mate Wierdl and Joost van Baal.
8757 2000-04-18 Jim Meyering <meyering@lucent.com>
8761 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
8762 getpagesize. For BeOS. Based on a patch from Bruno Haible.
8764 2000-04-17 Jim Meyering <meyering@lucent.com>
8766 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
8767 the definition of it to rpl_strftime also defined-away the system's
8770 2000-04-15 Jim Meyering <meyering@lucent.com>
8772 Use `C' to denote so-called `contiguous' files, the same way
8774 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
8775 (ftypelet): Use S_ISCTG.
8776 From Michael Deutschmann.
8778 2000-04-14 Jim Meyering <meyering@lucent.com>
8780 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
8782 2000-04-08 Jim Meyering <meyering@lucent.com>
8784 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
8785 names don't conflict. Reported by Eli Zaretskii.
8787 2000-03-28 Bruno Haible <haible@clisp.cons.org>
8789 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
8790 bug. Deal with the different error behavior of Irix iconv.
8792 2000-04-07 Jim Meyering <meyering@lucent.com>
8794 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
8795 to work around system header problems on AIX 3.2.5. From Bruno Haible.
8797 2000-04-05 Jim Meyering <meyering@lucent.com>
8799 Portability tweaks required for ultrix4.3.
8800 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8801 * readutmp.c: Include sys/types.h before sys/stat.h.
8802 * canon-host.c: Declare strdup.
8803 * path-concat.c: Likewise.
8804 From John David Anglin.
8806 2000-04-04 Jim Meyering <meyering@lucent.com>
8808 Be more DOS 8.3-friendly.
8809 * ref-add.sin: Renamed from ref-add.sed.in.
8810 * ref-del.sin: Renamed from ref-del.sed.in.
8811 * Makefile.am: Reflect renaming.
8812 Reported by Eli Zaretskii.
8814 Use a temporary file name that won't clash with `charset.alias'
8815 in the DOS 8.3 name space.
8816 * Makefile.am (charset_tmp): Define.
8817 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8818 (uninstall-local): Likewise.
8819 Reported by Eli Zaretskii.
8821 2000-03-29 Paul Eggert <eggert@twinsun.com>
8823 * time/strftime.c (my_strftime): Make sure we call the system
8824 strftime, not ourselves, when invoking the underlying strftime.
8826 2000-03-24 Jim Meyering <meyering@lucent.com>
8828 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8829 (charset_alias): Define.
8830 (install-exec-local): Factor out common code.
8831 (uninstall-local): Split lines longer than 80.
8832 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8834 (.sed.in.sed): New rule. Don't redirect directly to $@.
8835 (CLEANFILES): Add ref-add.sed and ref-del.sed.
8837 2000-03-19 Bruno Haible <haible@clisp.cons.org>
8839 * config.charset: Output a line containing "Packages using this file".
8840 * ref-add.sed.in, ref-del.sed.in: New files.
8841 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8842 ref-del.sed): New rules.
8844 2000-03-17 Jim Meyering <meyering@lucent.com>
8846 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8847 Otherwise, include <strings.h>
8849 2000-03-17 Bruno Haible <haible@clisp.cons.org>
8851 * unicodeio.c (utf8_wctomb): New function.
8852 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8853 format instead of in UCS-4 with platform dependent endianness.
8855 2000-03-07 Paul Eggert <eggert@twinsun.com>
8857 * savedir.c (savedir): Work even if directory size is
8858 negative; this can happen with some screwy NFS configurations.
8860 2000-03-06 Jim Meyering <meyering@lucent.com>
8862 * localcharset.c (get_charset_aliases): Don't try to free file_name
8863 if it's NULL (because we ran out of memory). From Bruno Haible.
8865 2000-03-05 Jim Meyering <meyering@lucent.com>
8867 * localcharset.c ("path-concat.h"): Include.
8868 (get_charset_aliases): Use path_concat instead of ANSI string
8871 * unicodeio.h (PARAMS): Define.
8872 Use it to guard prototype.
8874 2000-03-04 Jim Meyering <meyering@lucent.com>
8876 * Makefile.am (install-exec-local): Create $(libdir) before installing
8878 (uninstall-local): Uncomment this rule so `make distcheck' works
8881 * unicodeio.c (<errno.h>): Include it.
8882 (errno): Declare if not defined.
8884 * localcharset.c: Add Bruno's comment justifying use of volatile.
8886 * config.charset: New version, incorporating remarks from a linux
8887 i18n mailing list. From Bruno Haible.
8889 2000-03-02 Jim Meyering <meyering@lucent.com>
8891 * Makefile.am (EXTRA_DIST): Add config.charset.
8893 2000-03-01 Jim Meyering <meyering@lucent.com>
8895 * localcharset.c: Guard some #includes with `#if HAVE_...'.
8896 * unicodeio.c: Likewise.
8898 2000-02-02 Bruno Haible <haible@clisp.cons.org>
8900 * config.charset: New file.
8901 * localcharset.c: New file.
8902 * unicodeio.h, unicodeio.c: New files.
8903 * Makefile.am (DEFS): Add -DLIBDIR=...
8904 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8905 (noinst_HEADERS): Add unicodeio.h.
8906 (all-local, install-exec-local, charset.alias): New targets.
8908 2000-02-28 Paul Eggert <eggert@twinsun.com>
8910 * quotearg.c (ALERT_CHAR): New macro.
8911 (quotearg_buffer_restyled): Use it.
8913 2000-02-27 Jim Meyering <meyering@lucent.com>
8915 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8916 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8918 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8919 not `#if STDC_HEADERS'.
8920 Declare malloc if needed.
8922 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8923 now that autoconf always defines the HAVE_DECL_ symbols.
8924 * human.c: Likewise.
8926 * strtoumax.c: Likewise.
8928 * backupfile.c: Arrange for cpp to fail if the configure-time
8929 declaration check was not run.
8931 * human.c: Likewise.
8933 * strtoumax.c: Likewise.
8935 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8936 then first look up the entire `.'-containing string as a login name.
8938 2000-02-18 Paul Eggert <eggert@twinsun.com>
8940 * getdate.y: Handle two-digit years with leading zeros correctly.
8941 (textint): New typedef.
8942 (parser_control): Member year changed from int to textint.
8944 (YYSTYPE): Removed; replaced by %union with int and textint members.
8945 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8946 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8947 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8948 (tSNUMBER, tUNUMBER): Now of type <textintval>.
8949 (date, number, to_year): Use width of number in digits, not its value,
8950 to determine whether it's a 2-digit year, or a 2-digit time.
8951 (yylex): Store number of digits of numeric tokens.
8952 Reported by John Kendall.
8954 (parser_control): Changed from struct parser_control to typedef (for
8955 consistency). All uses changed.
8957 (tID): Removed; not used.
8958 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8960 2000-02-14 Paul Eggert <eggert@twinsun.com>
8962 * getpagesize.h (getpagesize): Port to VMS for Alpha;
8963 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8965 2000-02-12 Jim Meyering <meyering@lucent.com>
8967 * userspec.c (ISDIGIT): Define it.
8968 (isdigit): Remove definition.
8969 (is_number): Use ISDIGIT, not isdigit.
8970 <libintl.h>: Include.
8972 (parse_user_spec): Mark translatable strings.
8974 2000-02-10 Jim Meyering <meyering@lucent.com>
8976 With these changes, nanosleep.[ch] are finally enough like the other
8977 lib/* replacement files to compile on a few more losing systems.
8979 * nanosleep.h: Don't include config.h.
8980 Remove prototype from declaration of nanosleep.
8981 (PARAMS): Remove now-unneeded definition.
8982 * nanosleep.c: #undef nanosleep.
8983 (rpl_nanosleep): Rename from nanosleep.
8985 2000-02-03 Jim Meyering <meyering@lucent.com>
8987 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8988 rather than with `#if HAVE_UTMPNAME'.
8990 2000-02-01 Jim Meyering <meyering@lucent.com>
8992 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
8994 2000-01-31 Jim Meyering <meyering@lucent.com>
8996 * nanosleep.h (nanosleep): Guard declaration with
8997 `#if ! HAVE_DECL_NANOSLEEP'.
8998 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8999 the declaration in that vendor's sys/timers.h.
9000 Reported by Christian Krackowizer.
9002 * quotearg.c (ISASCII): Add #undef and move definition to follow
9003 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
9004 (ISPRINT): Likewise.
9005 Reported by Tom Tromey.
9007 2000-01-30 Jim Meyering <meyering@lucent.com>
9009 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
9010 uses of ->ut_name. The latter doesn't work with new Linux header files
9011 where only utmpx.ut_user is declared.
9013 * readutmp.h (UT_USER): Define.
9015 2000-01-23 Jim Meyering <meyering@lucent.com>
9017 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
9020 2000-01-22 Jim Meyering <meyering@lucent.com>
9022 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
9023 [! HAVE_DECL_STRTOULL]: Declare strtoull.
9024 Required for some AIX systems. Reported by Christian Krackowizer.
9025 [TESTING] (main): New function.
9027 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
9028 * dirname.c (dir_name): Support for DOS-style file names with drive
9031 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
9033 * strverscmp.c (ISDIGIT): Define.
9034 (strverscmp): Use ISDIGIT, not isdigit.
9036 2000-01-17 Paul Eggert <eggert@twinsun.com>
9038 * nanosleep.c (nanosleep):
9039 Don't use SA_INTERRUPT to decide whether to call sigaction, as
9040 POSIX.1 doesn't require SA_INTERRUPT and some systems
9041 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
9042 it's been part of POSIX.1 since day 1 (in 1988).
9044 2000-01-17 Jim Meyering <meyering@lucent.com>
9046 * interlock: Remove unused file. Reported by François Pinard.
9048 2000-01-16 Paul Eggert <eggert@twinsun.com>
9050 * quotearg.c (quotearg_buffer_restyled): Do not quote
9051 alert, backslash, formfeed, and vertical tab unnecessarily in
9052 shell quoting style.
9055 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
9056 Free Software Foundation, Inc.
9057 Copying and distribution of this file, with or without modification,
9058 are permitted provided the copyright notice and this notice are preserved.