1 2006-09-26 Eric Blake <ebb9@byu.net>
3 * verror.c: Include <config.h> unconditionally.
5 2006-09-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7 * gl_anylinked_list2.h [lint] (gl_linked_iterator)
8 (gl_linked_iterator_from_to): Initialize struct completely.
9 * gl_anytree_list2.h [lint] (gl_tree_iterator): Likewise.
10 (gl_tree_iterator_from_to): Likewise
11 * gl_anytree_oset.h [lint] (gl_tree_iterator): Likewise.
12 * gl_array_list.c [lint] (gl_array_iterator)
13 (gl_array_iterator_from_to): Likewise.
14 * gl_array_oset.c [lint] (gl_array_iterator): Likewise.
15 * gl_carray_list.c [lint] (gl_carray_iterator)
16 (gl_carray_iterator_from_to): Likewise.
18 * gc-gnulib.c [GC_USE_HMAC_SHA1]: include hmac.h for hmac_sha1.
19 * md4.c (md4_process_block): Remove unused variable.
20 * rijndael-api-fst.c (rijndaelBlockDecrypt): GCC suggests
21 parentheses for clarity.
23 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
25 Import this patch from libc:
27 2006-09-06 Jakub Jelinek <jakub@redhat.com>
29 * regex_internal.c (re_string_reconstruct): Handle
30 offset < pstr->valid_raw_len && pstr->offsets_needed case.
31 Ensure no bytes read before raw_mbs array. Pass a saved copy of
32 pstr->valid_len - 1 rather than pstr->valid_raw_len - 1 to
35 2006-09-20 Bruno Haible <bruno@clisp.org>
37 * mkdtemp.c: Import from libc.
38 2006-04-07 Ulrich Drepper <drepper@redhat.com>
39 * sysdeps/posix/tempname.c (__gen_tempname): Change
40 attempts_min into a macro. Use preprocessor to decide how to
41 initialize attempts [Coverity CID 67].
42 2001-11-27 Paul Eggert <eggert@twinsun.com>
43 * sysdeps/posix/tempname.c (__gen_tempname): Try at least
44 ATTEMPTS_MIN or TMP_MAX times, whichever is greater.
46 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
48 * mkstemp.h: New file, since some standard headers
50 * mkstemp.c: Revamp to put the !_LIBC code together.
52 Make the _LIBC code resemble glibc original more,
54 * mkstemp-safer.c: Include "mkstemp.h" instead of <stdlib.h>.
55 (mkstemp): Remove, since mkstemp.h does this for us.
56 * stdlib--.h: Include mkstemp.h.
58 Import this patch from libc:
60 2006-04-07 Ulrich Drepper <drepper@redhat.com>
62 * tempname.c (__gen_tempname): Change attempts_min
63 into a macro. Use preprocessor to decide how to initialize
64 attempts [Coverity CID 67].
66 2006-09-18 Bruno Haible <bruno@clisp.org>
68 * javaversion.c: Include configmake.h.
70 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
72 * getaddrinfo.c (getaddrinfo) [defined HAVE_IPV6]: Fix typo
73 that prevented coreutils 6.1 from building. Problem reported
74 by Petter Reinholdtsen.
76 2006-09-18 Jim Meyering <jim@meyering.net>
78 * savewd.c (savewd_restore): Don't shadow: s/status/child_status/.
80 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
82 * dirchownmod.c: Don't include fcntl.h; no longer needed.
83 (dirchownmod): New arg FD. All callers changed.
84 Use FD rather than opening the directory ourself, as opening is
85 now the caller's responsibility.
86 * dirchownmod.h: Likewise.
87 * mkancesdirs.c: Include <sys/types.h>, for portability to older
88 hosts that require <sys/types.h> before <sys/stat.h>. Include
89 fcntl.h, savewd.h, and unistd.h, not dirname.h and stat-macros.h.
91 (mkancesdirs): Return length of prefix of FILE that has already
92 been made, or -2 if there is a child doing the work. Redo
93 algorithm so that it is O(N) rather than O(N**2). Optimize away
94 ".", and treat ".." specially since it might stray back into
95 already-created areas. Use a subprocess if necessary. New arg
96 WD; all users changed. MAKE_DIR function should now return 1
97 if it creates a directory that is not readable. Return -2 if
98 a child process is spun off.
99 * mkancesdirs.h: Include <stddef.h>, for ptrdiff_t.
100 Adjust signature to match code.
101 * mkdir-p.c: Include dirname.h, for IS_ABSOLUTE_FILE_NAME.
102 (make_dir_parents): Use a subprocess if necessary. New arg WD;
104 * savewd.c, savewd.h: New files.
106 2006-09-15 Jim Meyering <jim@meyering.net>
108 * rename-dest-slash.c (has_trailing_slash): Use
109 FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems.
110 (rpl_rename_dest_slash): Perform the cheaper trailing slash
111 test before testing whether SRC is a directory.
112 Suggestions from Bruno Haible.
114 Avoid a warning about an unused variable.
115 * regex_internal.c (re_dfa_add_node): Move declaration of "type"
116 into the #ifdef block where it's used.
118 * rename-dest-slash.c: New file.
120 2006-09-14 Bruno Haible <bruno@clisp.org>
122 * allocsa.c: Include <config.h> unconditionally.
123 * asnprintf.c: Likewise.
124 * asprintf.c: Likewise.
125 * c-strcasecmp.c: Likewise.
126 * c-strcasestr.c: Likewise.
127 * c-strncasecmp.c: Likewise.
128 * c-strstr.c: Likewise.
129 * classpath.c: Likewise.
130 * clean-temp.c: Likewise.
131 * concatpath.c: Likewise.
132 * copy-file.c: Likewise.
133 * csharpcomp.c: Likewise.
134 * csharpexec.c: Likewise.
135 * execute.c: Likewise.
136 * fatal-signal.c: Likewise.
137 * findprog.c: Likewise.
138 * fwriteerror.c: Likewise.
139 * gl_array_list.c: Likewise.
140 * gl_array_oset.c: Likewise.
141 * gl_avltree_list.c: Likewise.
142 * gl_avltree_oset.c: Likewise.
143 * gl_avltreehash_list.c: Likewise.
144 * gl_carray_list.c: Likewise.
145 * gl_linked_list.c: Likewise.
146 * gl_linkedhash_list.c: Likewise.
147 * gl_list.c: Likewise.
148 * gl_oset.c: Likewise.
149 * gl_rbtree_list.c: Likewise.
150 * gl_rbtree_oset.c: Likewise.
151 * gl_rbtreehash_list.c: Likewise.
152 * imaxabs.c: Likewise.
153 * imaxdiv.c: Likewise.
154 * javacomp.c: Likewise.
155 * javaexec.c: Likewise.
156 * javaversion.c: Likewise.
157 * linebreak.c: Likewise.
158 * localcharset.c: Likewise.
160 * mbchar.c: Likewise.
161 * mbswidth.c: Likewise.
162 * mkdtemp.c: Likewise.
164 * printf-args.c: Likewise.
165 * printf-parse.c: Likewise.
166 * progname.c: Likewise.
167 * progreloc.c: Likewise.
168 * readlink.c: Likewise.
169 * sh-quote.c: Likewise.
170 * stpcpy.c: Likewise.
171 * stpncpy.c: Likewise.
172 * strcasecmp.c: Likewise.
173 * strcasestr.c: Likewise.
174 * strcspn.c: Likewise.
175 * striconv.c: Likewise.
176 * strncasecmp.c: Likewise.
177 * strnlen1.c: Likewise.
178 * strstr.c: Likewise.
179 * strtok_r.c: Likewise.
181 * tmpdir.c: Likewise.
182 * unicodeio.c: Likewise.
183 * unsetenv.c: Likewise.
184 * vasnprintf.c: Likewise.
185 * vasprintf.c: Likewise.
186 * wait-process.c: Likewise.
187 * xallocsa.c: Likewise.
188 * xsetenv.c: Likewise.
189 * xstriconv.c: Likewise.
191 2006-09-13 Eric Blake <ebb9@byu.net>
193 * getopt.c: Fix typo in last commit.
195 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
197 * _fpending.c: Include <config.h> unconditionally, since we no
198 longer worry about uses that don't define HAVE_CONFIG_H.
199 * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
200 * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
201 * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
202 * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
203 * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
204 * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
205 * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
206 * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
207 * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
208 * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
209 * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
210 * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
211 * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
212 * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
213 * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
214 * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
215 * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
216 * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
217 * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
218 * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
219 * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
220 * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
221 * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
222 * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
223 * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
224 * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
225 * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
226 * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
227 * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
228 * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
229 * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
230 * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
231 * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
232 * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
235 2006-09-12 Jim Meyering <jim@meyering.net>
237 * nanosleep.c: Include <sys/types.h> before sys/select.h, to avoid
238 compilation failure (due to use of pid_t in latter) on NetBSD 1.6.
239 Reported by Nelson H. F. Beebe.
241 2006-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
243 * argp-help.c (argp_doc): Make sure NULL is not passed to
246 2006-09-10 Bruno Haible <bruno@clisp.org>
248 * mkdtemp.c: Include <stdint.h> always. Don't include <inttypes.h>.
250 2006-09-10 Sergey Poznyakoff <gray@gnu.org.ua>
252 * argp-parse.c (__argp_parse) [!_LIBC]: Make sure
253 program_invocation_name and program_invocation_short_name are
255 * argp-namefrob.h: Move declarations of program_invocation_name
256 and program_invocation_short_name to argp.h, so they are visible
260 2006-09-09 Sergey Poznyakoff <gray@gnu.org.ua>
262 * argp.h (struct argp): Document the N_("..") "\v" N_("..")
263 convention. Text proposed by Bruno Haible.
264 (struct argp_option): Document the use of N_() wrappers.
266 * argp-help.c (argp_doc): Split the untranslated doc string on '\v',
267 and translate the two parts separately, instead of feeding
268 the whole string to gettext. This allows to exclude
269 '\v' from the strings visible to the translator by writing doc
270 strings as N_("..") "\v" N_("..").
272 2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
274 * mktime.c (guess_time_tm): Fix bug where mktime
275 returned the maximum time_t value rather than (time_t) -1.
276 Problem originally reported by William Bardwell
277 <http://sourceware.org/bugzilla/show_bug.cgi?id=2821>.
279 * isapipe.h (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
281 * isapipe.c (HAVE_FIFO_PIPES) [!defined HAVE_FIFO_PIPES]:
284 2006-09-06 Bruno Haible <bruno@clisp.org>
286 * striconv.h: New file.
287 * striconv.c: New file, merging iconvme.c with GNU gettext's
289 * xstriconv.h: New file.
290 * xstriconv.c: New file.
292 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
294 * argz_.h: Sync from Libtool.
296 2006-09-04 George Bosilca <bosilca@cs.utk.edu>
297 and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
299 * libltdl/argz_.h: It's __cplusplus, not _cplusplus.
301 2006-09-05 Davide Angelocola <davide.angelocola@tiscali.it>
306 2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
308 * getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
309 Problem reported by Ralf Wildenhues in
310 <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
312 * mountlist.c: All uses of HAVE_F_FSTYPENAME_IN_STATFS replaced by
313 HAVE_STRUCT_STATFS_F_FSTYPENAME.
315 2006-08-31 Paul Eggert <eggert@cs.ucla.edu>
317 * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
318 or stdbool.h, because they might not exist while configuring.
320 * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
321 Don't include unistd.h or limits.h; not needed, since chdir-long.h
323 (O_DIRECTORY): Remove.
325 2006-08-30 Paul Eggert <eggert@cs.ucla.edu>
327 Work around a bug in both the Linux and SunOS 64-bit kernels:
328 nanosleep mishandles sleeps for longer than 2**31 seconds.
329 Problem reported by Frank v Waveren in
330 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
331 * nanosleep.c (BILLION): New constant.
332 (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
333 (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
335 2006-08-30 Jim Meyering <jim@meyering.net>
337 * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
340 2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
342 * isapipe.c, isapipe.h: New files.
344 2006-08-29 Eric Blake <ebb9@byu.net>
346 * error.c (error_at_line, print_errno_message): Match libc, after
347 resolution of upstream bug 3044.
349 2006-08-29 Bruno Haible <bruno@clisp.org>
351 * localcharset.c: Include configmake.h in order to get LIBDIR defined.
353 2006-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
357 2006-08-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
359 * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
360 sharing with gnulib. Report by Eric Blake.
362 2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
364 * fcntl_.h: New file.
365 * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
367 * dirchownmod.c: Likewise.
370 * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
371 Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
372 * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
373 just before including <inttypes.h>, to avoid circular inclusion.
375 2006-08-28 Bruno Haible <bruno@clisp.org>
377 * inttypes_.h (SCNX*): Remove definitions.
378 Reported by Eric Blake.
380 2006-08-26 Bruno Haible <bruno@clisp.org>
382 * vasnprintf.c (EOVERFLOW): Remove definition.
383 (VASNPRINTF): Return a string of length > INT_MAX without failing.
384 * vasprintf.c: Include errno.h, limits.h.
385 (EOVERFLOW): New fallback definition.
386 (vasprintf): Test here whether the string length is > INT_MAX.
387 * vsnprintf.c: Include errno.h, limits.h.
388 (EOVERFLOW): New fallback definition.
389 (vsnprintf): Fix bug when generated string was too long for the buffer.
390 Test here whether the string length is > INT_MAX.
392 2006-08-26 Bruno Haible <bruno@clisp.org>
393 Simon Josefsson <jas@extundo.com>
396 * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
398 2006-08-28 Bruno Haible <bruno@clisp.org>
400 * c-strstr.h: New file, from GNU gettext.
401 * c-strstr.c: New file, from GNU gettext.
403 2006-08-26 Bruno Haible <bruno@clisp.org>
405 * inttypes_.h: New file.
406 * inttypes.h: Remove file.
407 * stdint_.h: Include <inttypes.h> through its absolute filename.
409 * imaxabs.c: New file.
411 * imaxdiv.c: New file.
413 2006-08-22 Bruno Haible <bruno@clisp.org>
415 * readutmp.h: Skip most definitions if neither <utmp.h> nor
418 2006-08-21 Paul Eggert <eggert@cs.ucla.edu>
421 * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
422 Problem reported by Bruno Haible.
424 2006-08-21 Bruno Haible <bruno@clisp.org>
427 * mbchar.h: Include <wctype.h> only if it exists.
429 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
431 * cycle-check.h: Include <stdint.h> unconditionally, since we
432 now assume the stdint module. Do not include inttypes.h.
433 * fsusage.h: Likewise.
434 * getndelim2.c: Likewise.
436 * inttostr.h: Likewise.
437 * obstack.c: Likewise.
438 * regex_internal.h: Likewise.
439 * tempname.c: Likewise.
440 * utimecmp.c: Likewise.
441 * xstrtol.h: Likewise.
443 * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
445 * strtoimax.c: Adjust to macro name changes in Autoconf,
446 e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
449 2006-08-19 Paul Eggert <eggert@cs.ucla.edu>
451 * fchmodat.c: New file, from coreutils. This was inadvertently
452 omitted in the 2006-08-17 update. Problem reported by Jay Youngman.
454 2006-08-18 Bruno Haible <bruno@clisp.org>
456 * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
457 (ME_DUMMY): Treat "kernfs" as a dummy.
458 (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
460 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
462 Update from coreutils.
464 * __fpending.h: Add copyright notice.
465 * fprintftime.h: Likewise.
466 * savedir.c: Use (C) in copyright notice.
467 * savedir.h: Likewise.
469 2006-08-15 Jim Meyering <jim@meyering.net>
471 * at-func.c: New file, with the logic of all emulated at-functions.
472 * openat-priv.h: Include <errno.h> and define ENOSYS,
473 in support of the EXPECTED_ERRNO macro.
474 * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
475 Instead, define the appropriate symbols and include "at-func.c".
476 * mkdirat.c (mkdirat): Likewise.
477 * fchmodat.c (fchmodat): Likewise.
478 (ENOSYS): Remove definition.
479 * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
480 Don't include "unistd--.h" -- it wasn't ever used.
482 2006-01-17 Jim Meyering <jim@meyering.net>
484 Rewrite fts.c not to change the current working directory,
485 by using openat, fstatat, fdopendir, etc..
487 * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
488 (HAVE_OPENAT_SUPPORT): Define.
489 [_LIBC] (fchdir): Don't undef or define; no longer used.
490 (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
491 Now, this `function' always succeeds, and consumes its file descriptor
492 parameter -- so callers must not close such FDs. Update callers.
493 (diropen_fd, opendirat, cwd_advance_fd): New functions.
494 (diropen): Add parameter, SP. Adjust all callers.
495 Implement using diropen_fd, rather than open.
496 (fts_open): Initialize new member, fts_cwd_fd.
497 Remove fts_rft-setting code.
498 (fts_close): Close fts_cwd_fd, if necessary.
499 (__opendir2): Define in terms of opendir or opendirat,
500 depending on whether the FST_NOCHDIR flag is set.
501 (fts_build): Since fts_safe_changedir consumes its FD, and since
502 this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
503 and close the dup'd file descriptor upon failure.
504 (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
505 (fts_safe_changedir): Tweak semantics to reflect that this function
506 now calls cwd_advance_fd and hence consumes its FD argument.
507 * fts_.h [struct FTS] (fts_cwd_fd): New member.
508 [struct FTS] (fts_rft): Remove now-unused member.
509 [struct FTS] (fts_cycle.state): Improve comment.
511 * openat.c (openat_needs_fchdir): New function.
512 * openat.h (openat_needs_fchdir): Declare it.
514 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
516 * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
517 Problem and fix reported by Pádraig Brady in
518 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
520 2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
522 * memcoll.c (memcoll): Optimize for the common case where the
523 arguments are bytewise equal.
525 2006-08-14 Paul Eggert <eggert@cs.ucla.edu>
527 Change copyright notice from LGPL 2 to GPL 2, since that's the
528 standard form used in the gnulib repository.
529 * lock.c: LGPL -> GPL.
531 * strnlen1.c: Likewise.
532 * strnlen1.h: Likewise.
535 * tmpdir.c: Likewise.
537 * TODO: Remove; this belongs only in coreutils.
539 2006-08-14 Eric Blake <ebb9@byu.net>
541 Import the following change from libc:
543 2006-08-12 Ulrich Drepper <drepper@redhat.com>
546 * misc/error.c: Add space between program name and message if file
549 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
551 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
552 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
554 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
555 in wchar_t. Problem reported by Eric Blake.
557 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
558 LEN is smaller than SIZE. Suggested by Bruno Haible.
559 Also, help the compiler to keep LEN in a register.
561 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
563 * .cppi-disable: Add snprintf.h, socket_.h.
564 * snprintf.c: Include <errno.h> and <limits.h>.
565 (EOVERFLOW): Define if the system does not.
566 Do not include "minmax.h"; it wasn't used.
567 (snprintf): Don't assume size_t promotes to an unsigned type.
568 Fix bug when generated string was too long for the buffer: the
569 buffer's contents are supposed to be the initial prefix of the
570 output. Don't assume vasnprintf returns EOVERFLOW if the size
571 exceeds INT_MAX; do the check ourselves.
573 Import the following changes from libc:
575 2006-06-02 Jakub Jelinek <jakub@redhat.com>
577 * posix/regex_internal.c (re_string_skip_chars): If no character has
578 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
579 to the byte which couldn't be converted.
580 (re_string_reconstruct): Don't clear valid_raw_len before calling
581 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
582 tip_context using re_string_context_at.
584 2006-05-02 Ulrich Drepper <drepper@redhat.com>
586 * posix/regex.h: g++ still cannot handled [restrict].
588 2006-04-21 Ulrich Drepper <drepper@redhat.com>
590 * posix/regex.h: Remove special handling for VMS.
592 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
596 2006-07-19 Mike Frysinger <vapier@gentoo.org>
598 * mountlist.c [ME_REMOTE]: Filter out cifs.
599 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
601 2006-08-08 Eric Blake <ebb9@byu.net>
603 * verror.c (verror_at_line): Work around glibc bug 2997, so that
604 verror_at_line output complies with GNU Coding Standards even when
607 2006-08-08 Eric Blake <ebb9@byu.net>
609 * verror.h, verror.c: New files.
611 2006-08-07 Bruno Haible <bruno@clisp.org>
613 * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
615 Reported by Ralf Wildenhues.
617 2006-08-06 Eric Blake <ebb9@byu.net>
619 * error.h: Fold in some upstream changes from glibc.
622 2006-07-29 Bruno Haible <bruno@clisp.org>
624 * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
626 2006-07-29 Bruno Haible <bruno@clisp.org>
628 * setenv.c: Undo unintended modification done on 2006-02-27.
630 2006-07-28 Eric Blake <ebb9@byu.net>
632 * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
635 2006-07-28 Simon Josefsson <jas@extundo.com>
637 * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
640 2006-07-28 Simon Josefsson <jas@extundo.com>
642 * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
645 2006-07-28 Bruno Haible <bruno@clisp.org>
647 * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
649 2006-07-28 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
651 * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
654 2006-07-28 Bruno Haible <bruno@clisp.org>
656 * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
657 iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
659 Avoids link error on FreeBSD 4.x.
660 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
662 * wcwidth.h (iswprint): Assume an ASCII compatible wide character
664 * mbswidth.c (iswcntrl): Likewise.
666 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
668 * modechange.c (mode_compile): Numeric modes now affect setuid and
669 setgid on directories only if they set these bits.
670 * modechange.h: Remove obsolete comment about masks.
672 2006-07-27 Bruno Haible <bruno@clisp.org>
674 * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
675 __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
678 2006-07-26 Eric Blake <ebb9@byu.net>
680 * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
681 like mingw that lack mkstemp.
682 * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
683 avoid compilation warning on mingw.
685 2006-07-25 Bruno Haible <bruno@clisp.org>
687 * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
688 <stdarg.h> or config.h.
690 2006-07-24 Bruno Haible <bruno@clisp.org>
692 * clean-temp.h: New file, from GNU gettext.
693 * clean-temp.c: New file, from GNU gettext.
695 2006-07-24 Bruno Haible <bruno@clisp.org>
697 * tmpdir.h: New file, from GNU gettext.
698 * tmpdir.c: New file, from GNU gettext.
700 2006-07-23 Bruno Haible <bruno@clisp.org>
702 * gl_anylinked_list2.h (ASYNCSAFE): New macro.
703 (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
704 gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
705 gl_linked_remove_at): Use it.
707 2006-07-23 Eric Blake <ebb9@byu.net>
709 * tmpfile-safer.c: New file.
710 * stdio-safer.h (fopen_safer): Add prototype.
711 * stdio--.h (tmpfile): Make safer.
713 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
715 * close-stream.c, close-stream.h: New files.
717 2006-07-22 Bruno Haible <bruno@clisp.org>
719 Merge from GNU gettext 0.15.
721 2005-07-05 Bruno Haible <bruno@clisp.org>
723 * printf-args.c (printf_fetchargs): Work around broken
724 definition of wint_t on mingw.
726 2005-02-12 Bruno Haible <bruno@clisp.org>
728 * xallocsa.h: Add extern "C" for C++.
730 2006-05-17 Bruno Haible <bruno@clisp.org>
733 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
735 2006-04-30 Bruno Haible <bruno@clisp.org>
737 * progreloc.c: Include <mach-o/dyld.h> if available.
738 (find_executable): Use _NSGetExecutablePath when possible.
740 2006-05-06 Charles Wilson <cygwin@cwilson.fastmail.fm>
742 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
745 2005-12-29 Bruno Haible <bruno@clisp.org>
747 * progreloc.c (set_program_name_and_installdir): Fix
750 2005-12-04 Bruno Haible <bruno@clisp.org>
753 * progreloc.c: Include <windows.h> also on Cygwin.
754 (find_executable): Add support for Cygwin.
755 (set_program_name_and_installdir): Handle also platforms with
758 2006-07-11 Bruno Haible <bruno@clisp.org>
760 * javacomp.c: Fix a comment.
761 Reported by Jim Meyering.
763 2006-04-30 Bruno Haible <bruno@clisp.org>
765 * javacomp.h (compile_java_class): Add source_version,
766 target_version arguments.
767 * javacomp.c: Rewritten to choose only a compiler that
768 respects the specified source_version and target_version.
770 2006-06-27 Bruno Haible <bruno@clisp.org>
772 Assume correct S_ISDIR macro.
773 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
775 2006-07-22 Bruno Haible <bruno@clisp.org>
777 * javaversion.h: New file, from GNU gettext.
778 * javaversion.c: New file, from GNU gettext.
779 * javaversion.java: New file, from GNU gettext.
780 * javaversion.class: New file, from GNU gettext.
782 2006-05-17 Bruno Haible <bruno@clisp.org>
785 * javaexec.c (execute_java_class): Test for jview program
788 2006-04-09 Bruno Haible <bruno@clisp.org>
790 * fatal-signal.c: Don't include string.h.
791 (at_fatal_signal): Use a copying loop instead of memcpy.
793 2005-12-04 Bruno Haible <bruno@clisp.org>
795 * csharpexec.c: Add support for 'clix' launcher (untested).
796 (execute_csharp_using_sscli): New function.
797 (execute_csharp_program): Call it.
799 2006-06-21 Bruno Haible <bruno@clisp.org>
801 Avoid warnings from recent versions of mcs.
802 * csharpcomp.c (compile_csharp_using_mono): Don't use options
803 -o, -L, -r any more. Use options documented since mcs-1.0
804 instead. Similarly for -g.
806 2005-07-09 Bruno Haible <bruno@clisp.org>
808 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
810 Reported by Mark Junker <mjscod@gmx.de>.
812 2006-06-17 Bruno Haible <bruno@clisp.org>
814 * config.charset: Update for NetBSD 3.0.
816 2006-05-17 Bruno Haible <bruno@clisp.org>
819 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
821 2006-05-16 Bruno Haible <bruno@clisp.org>
823 * localcharset.c [CYGWIN]: Include <windows.h>.
824 (get_charset_aliases): For Cygwin, return the same CPxxx
825 aliases list as under WIN32.
826 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
827 the environment variables. Fall back to GetACP().
829 2006-04-05 Bruno Haible <bruno@clisp.org>
831 * config.charset: Update Juan Manuel Guerrero's address.
833 2005-02-12 Bruno Haible <bruno@clisp.org>
835 * allocsa.h: Add extern "C" for C++.
837 2005-02-10 Bruno Haible <bruno@clisp.org>
839 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
840 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
842 2006-07-22 Bruno Haible <bruno@clisp.org>
844 * gettext.h: Update to GNU gettext-0.15.
846 2006-07-22 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
847 and Simon Josefsson <jas@extundo.com>
849 * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
851 * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
853 2006-07-21 Eric Blake <ebb9@byu.net>
855 * stdlib-safer.h: New file from coreutils, required by
858 2006-07-19 Derek R. Price <derek@ximbiot.com>
860 * getaddrinfo.h: Don't define unimplemented AI_* flags.
861 Reindent and repaginate.
863 2006-07-17 Bruno Haible <bruno@clisp.org>
865 * gl_list.h: New file.
866 * gl_list.c: New file.
867 * gl_array_list.h: New file.
868 * gl_array_list.c: New file.
869 * gl_carray_list.h: New file.
870 * gl_carray_list.c: New file.
871 * gl_linked_list.h: New file.
872 * gl_linked_list.c: New file.
873 * gl_anylinked_list1.h: New file.
874 * gl_anylinked_list2.h: New file.
875 * gl_avltree_list.h: New file.
876 * gl_avltree_list.c: New file.
877 * gl_anyavltree_list1.h: New file.
878 * gl_anyavltree_list2.h: New file.
879 * gl_rbtree_list.h: New file.
880 * gl_rbtree_list.c: New file.
881 * gl_anyrbtree_list1.h: New file.
882 * gl_anyrbtree_list2.h: New file.
883 * gl_anytree_list1.h: New file.
884 * gl_anytree_list2.h: New file.
885 * gl_linkedhash_list.h: New file.
886 * gl_linkedhash_list.c: New file.
887 * gl_anyhash_list1.h: New file.
888 * gl_anyhash_list2.h: New file.
889 * gl_avltreehash_list.h: New file.
890 * gl_avltreehash_list.c: New file.
891 * gl_rbtreehash_list.h: New file.
892 * gl_rbtreehash_list.c: New file.
893 * gl_anytreehash_list1.h: New file.
894 * gl_anytreehash_list2.h: New file.
896 * gl_oset.h: New file.
897 * gl_oset.c: New file.
898 * gl_array_oset.h: New file.
899 * gl_array_oset.c: New file.
900 * gl_avltree_oset.h: New file.
901 * gl_avltree_oset.c: New file.
902 * gl_rbtree_oset.h: New file.
903 * gl_rbtree_oset.c: New file.
904 * gl_anytree_oset.h: New file.
906 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
908 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
910 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
911 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
912 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
913 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
914 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
915 callers changed. Revamp internals significantly, by not
916 attempting to create directories that are temporarily more
917 permissive than the final results. Do not attempt to use
918 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
919 This removes some race conditions, fixes some bugs, and simplifies
920 things. Use new dirchownmod function to do owner and mode changes.
921 * mkdir-p.h: Likewise.
922 * modechange.c (octal_to_mode): New function.
923 (struct mode_change): New member mentioned.
924 (make_node_op_equals): New arg mentioned. All callers changed.
925 (mode_compile): Keep track of which mode bits the user has explicitly
927 (mode_adjust): New arg DIR, so that we implement the X op correctly.
928 New arg PMODE_BITS, to keep track of which mode bits the user
929 mentioned; it treats S_ISUID and S_ISGID speciall.
931 * modechange.h: Likewise.
933 2006-07-11 Derek R. Price <derek@ximbiot.com>
935 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
937 2006-07-10 Derek R. Price <derek@ximbiot.com>
939 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
940 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
941 macros into the GNU _D_EXACT_NAMLEN.
942 * savedir.c: Likewise.
943 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
945 2006-07-09 Jim Meyering <jim@meyering.net>
947 * argp-pv.c: Remove a doubled word in a comment.
948 * check-version.c (check_version): Likewise.
949 * javacomp.c (compile_java_class): Likewise.
951 2006-07-08 Jim Meyering <jim@meyering.net>
953 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
955 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
957 * getaddrinfo.c: Changes to compile under MSVC6: changed
958 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
959 brackets. Other minor changes to suppress some compiler
962 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
964 * getloadavg.c: Use __VMS, not VMS.
965 * getopt.c: Likewise.
966 * getpagesize.h: Likewise.
967 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
968 probably does not work.
970 2006-07-06 Derek R. Price <derek@ximbiot.com>
971 and Paul Eggert <eggert@cs.ucla.edu>
973 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
974 Don't worry about this obsolete case any more.
975 (HAVE_DIR): Remove. All uses removed; we now assume you can read
977 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
978 worry about this obsolete case any more.
980 * getcwd.c: Likewise.
982 * savedir.c: Likewise.
984 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
986 * .cppi-disable: Add wcwidth.
987 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
988 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
989 (ISGRAPH): Remove. All uses changed to isgraph.
990 (FOLD) [!defined _LIBC]: Remove special case.
991 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
992 * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
994 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
996 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
998 * strtod.c (strtod): cast the argument of tolower to unsigned char.
1000 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
1002 * memcasecmp.c: Include <limits.h>.
1003 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
1004 * strtod.c (strtod): Don't assume isspace works on negative chars.
1005 Don't assume isdigit succeeds only on '0' through '9'.
1007 2006-07-05 Derek R. Price <derek@ximbiot.com>
1009 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
1010 All uses of is_space replaced by isspace.
1011 * exit.h: Don't talk about STDC_HEADERS.
1012 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
1013 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
1014 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
1015 replaced by isprint etc.
1016 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
1017 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1018 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
1019 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
1020 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
1021 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
1023 2006-07-05 Eric Blake <ebb9@byu.net>
1025 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
1026 missing from netdb.h.
1027 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
1029 2006-06-27 Bruno Haible <bruno@clisp.org>
1031 Assume ANSI C header files and <ctype.h> functions.
1032 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
1033 (mbsnwidth): Use isprint, iscntrl instead.
1035 2006-07-03 Jim Meyering <jim@meyering.net>
1037 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
1038 macro is used before the first cycle_check call.
1040 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
1042 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
1043 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
1044 reported by Mark D. Baushke, one in
1045 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
1047 Merge from coreutils.
1049 * .cppi-disable: Add stdint_.h.
1050 * .cvsignore: Add stdint.h.
1052 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
1054 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
1055 both double and long double versions.
1056 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
1057 * xstrtold.c: New file.
1058 * xstrtod.h (xstrtold): New decl.
1060 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1062 * filemode.c (setst): Remove.
1063 (strmode): Rewrite to avoid setst. This makes the code shorter,
1064 (arguably) clearer, and the generated code is a bit smaller on my
1065 Debian GNU/Linux stable x86 host.
1067 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
1069 * filemode.c: Include "filemode.h" first, to test the interface.
1070 Assume that filemode.h includes sys/types.h and sys/stat.h.
1071 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
1072 (ftypelet): Reorder to put common cases first, for efficiency.
1073 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
1075 (strmode): Renamed from mode_string, and now stores 12 bytes instead
1076 of 10, for compatibility with FreeBSD. All callers changed.
1077 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
1078 that can't be deduced solely from st_mode. First arg is now a const
1080 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
1081 (strmode): Renamed from mode_string.
1082 (filemodestring): New decl.
1083 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
1084 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
1085 (S_ISPORT, S_ISWHT): New macros, if not already defined.
1087 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
1089 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
1090 fsusage.h now does that. Include fsusage.h first, to test interface.
1091 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
1092 at most one method (the old code could have generated decls that
1093 didn't conform to C89, not that this was ever exercised).
1094 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
1096 2006-03-19 Jim Meyering <jim@meyering.net>
1098 Work even in a chroot where d_ino values for entries in "/"
1099 don't match the stat.st_ino values for the same names.
1100 * getcwd.c (__getcwd): When no d_ino value matches the target inode
1101 number, iterate through all entries again, using lstat instead.
1102 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1103 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1105 * getcwd.c (__getcwd): Clarify a comment.
1106 Use memcpy in place of a call to strcpy.
1108 2006-03-12 Jim Meyering <jim@meyering.net>
1110 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1111 that of the current directory (which we're about to chdir ".." out of),
1112 then save the dev-ino of the parent, instead.
1114 * same-inode.h (SAME_INODE): New file/macro.
1115 * chdir-safer.c (SAME_INODE): Remove definition.
1116 Include "same-inode.h", instead.
1118 * cycle-check.h: Include "same-inode.h".
1119 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1120 * cycle-check.c (SAME_INODE): Remove definition.
1121 * root-dev-ino.h: Include "same-inode.h".
1123 2006-03-11 Eric Blake <ebb9@byu.net>
1125 * same.c (same_name): s/base_name/last_component/
1126 * backupfile.c (check_extension, numbered_backup): Likewise.
1127 * filenamecat.c (file_name_concat): Likewise.
1129 2006-03-11 Eric Blake <ebb9@byu.net>,
1130 Paul Eggert <eggert@cs.ucla.edu>
1132 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1133 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1135 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1136 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1137 (last_component): New method.
1138 * dirname.c (dir_len): Determine when drive letters need a
1139 subsequent slash. Preserve // when it is special.
1140 (dir_name): Don't append dot when drive letter is absolute.
1141 [TEST_DIRNAME]: Move into a full-blown gnulib test.
1142 * basename.c (base_name): New semantics - malloc the result.
1143 Preserve // when it is special. Preserve relative files that look
1145 (base_len): Preserve // when it is special.
1146 (last_component): New method, similar to old base_name semantics.
1147 * stripslash.c (strip_trailing_slashes): Use last_component, not
1148 base_name. Strip redundant slashes from ///.
1150 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
1152 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
1153 both are 64 bits, since this seems to be the tradition, and this
1154 prevents gcc -Wformat from warning about usages with PRIuMAX. If
1155 we ever run into a host that prefers long long to long in this
1156 case, we'll need another configure-time test. Problem reported by
1159 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
1161 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
1162 possible collision with system files.
1163 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
1164 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
1165 WCHAR_MIN and WCHAR_MAX in this case.
1166 (<stddef.h>): Do not include; no longer needed.
1167 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
1168 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
1169 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
1170 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
1171 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
1172 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
1173 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
1174 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
1175 !defined(__c99))]: Include in this case too, since it's harmless
1177 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
1179 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
1180 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
1181 (_STDINT_MIN, _STDINT_MAX): New macros.
1182 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
1183 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
1184 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
1185 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
1186 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
1187 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
1188 macros, not typedefs; this simplifies things quite a bit.
1189 Use long int for all types narrower than int64_t.
1190 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
1191 Define in terms of long long int or int64_t or long int,
1192 not int64_t or int32_t. This saves some compile-time testing.
1193 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
1194 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
1195 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
1196 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
1197 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
1198 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
1199 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
1200 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
1201 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
1202 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
1203 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1204 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1205 undef any previous version and define our own version, for
1206 simplicity and consistency with the new macros for types.
1207 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
1208 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
1209 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
1210 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
1211 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
1212 @WINT_T_SUFFIX@ to keep things simple here.
1213 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
1214 Simplify by assuming typical 8/16/32/64 host, since we're
1215 already doing that elsewhere anyway.
1216 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
1217 and assume long long int is 64 bits if available. This
1218 speeds up 'configure'.
1220 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
1222 * getaddrinfo.c: fixed typo
1224 2006-06-29 Eric Blake <ebb9@byu.net>
1226 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
1227 unused static function.
1229 2006-06-29 Eric Blake <ebb9@byu.net>
1231 * stat_.h: New file.
1233 2006-06-29 Derek R. Price <derek@ximbiot.com>
1235 * strftime.c: Assume strftime() exists.
1237 2006-06-28 Bruno Haible <bruno@clisp.org>
1239 * getaddrinfo.h: Fix POSIX URL.
1240 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
1241 (use_win32_p): Make static.
1242 (getaddrinfo): Reject service name if it is empty or does not consist
1243 solely of decimal digits, or if its value is > 65535.
1244 (getnameinfo): Remove useless casts.
1246 2006-06-28 Derek R. Price <derek@ximbiot.com>
1248 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
1249 Autoconf 2.60 says this stuff was obsolete.
1251 2006-05-12 Bruno Haible <bruno@clisp.org>
1253 * mkdtemp.c [MINGW]: Include <io.h>.
1254 (mkdir): Define using _mkdir.
1256 2006-06-28 Bruno Haible <bruno@clisp.org>
1258 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
1259 declaration for wcwidth.
1260 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
1262 2006-06-28 Eric Blake <ebb9@byu.net>
1264 * xvasprintf.h: Fix comments.
1266 2006-06-28 Eric Blake <ebb9@byu.net>
1268 * mbchar.h (wcwidth): Include wcwidth.h.
1269 * mbswidth.c (wcwidth): Move from here...
1270 * wcwidth.h: ...to this new file.
1272 2006-06-28 Simon Josefsson <jas@extundo.com>
1274 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
1275 functions there. It will succeed on Windows XP, but on Windows
1276 2000 and (presumably) earlier, it will fail, and use the internal
1278 (use_win32_p): New function.
1279 (getaddrinfo): Use strtoul on servname, to support numeric ports.
1280 Support AI_NUMERICSERV to disable getservbyname.
1281 (getnameinfo): New function, only supports
1282 NI_NUMERICHOST|NI_NUMERICSERV for now.
1284 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
1285 only have some of them. Add AI_NUMERICSERV. Add prototype for
1288 2006-06-27 Bruno Haible <bruno@clisp.org>
1290 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
1292 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
1294 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
1295 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
1296 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
1298 2006-06-26 Bruno Haible <bruno@clisp.org>
1300 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
1302 Reported by Mark D. Baushke and Larry Jones.
1304 2006-06-26 Bruno Haible <bruno@clisp.org>
1306 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
1308 Suggested by Mark D. Baushke and Larry Jones.
1310 2006-06-23 Mark D. Baushke <mdb@gnu.org>
1312 * stdint_.h: Treat BSD/OS like OpenBSD.
1314 2006-06-23 Bruno Haible <bruno@clisp.org>
1316 * stdint_.h: Treat IRIX like OpenBSD.
1318 2006-06-23 Bruno Haible <bruno@clisp.org>
1320 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1321 ISO C 99 Technical Corrigendum 1.
1323 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
1325 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1326 Some compiler complained about some of them. Problem reported by
1328 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1330 2006-06-21 Simon Josefsson <jas@extundo.com>
1332 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1335 * socket_.h: Don't define WINVER.
1337 * inet_pton.h, inet_pton.c: New file, taken from glibc but
1338 slightly modified to work in gnulib.
1340 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1342 * read-file.c (fread_file): Start with buffer allocation of
1343 0 bytes rather than 1 byte; this simplifies the code.
1344 Don't invoke feof; it's not needed. Refactor to avoid duplicate
1345 code to free buffer and save/restore errno.
1346 (internal_read_file): Remove unused local.
1348 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
1350 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1351 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1352 Problem reported by Denis Excoffier in
1353 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1355 2006-06-19 Simon Josefsson <jas@extundo.com>
1357 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1359 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1361 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1363 2006-06-17 Bruno Haible <bruno@clisp.org>
1365 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1367 2006-06-17 Bruno Haible <bruno@clisp.org>
1369 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1370 problem on Solaris 2.5.1.
1372 2006-06-16 Eric Blake <ebb9@byu.net>
1374 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1375 * unicodeio.c [!defined errno]: Likewise.
1376 * strtol.c [!defined errno]: Likewise.
1377 * strtod.c [!defined errno]: Likewise.
1379 2006-06-15 Bruno Haible <bruno@clisp.org>
1381 * stdint_.h: Rewritten to be fully auto-configured.
1382 Fixes bug on HP-UX/IA64.
1384 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1386 * getdate.y (__attribute__): Don't define if already defined.
1387 Problem reported by Larry Jones.
1388 * utimens.c (__attribute__): Likewise.
1390 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
1392 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1393 reported by Andreas Schwab.
1395 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1396 Bruno Haible <bruno@clisp.org>
1398 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1400 2006-05-26 Martin Lambers <marlam@marlam.de>
1402 * getpass.c: Updates the test for the native W32 API, and adds
1403 missing includes, thus fixing compilation warnings.
1405 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
1407 * tempname.c (small_open, large_open): New macros.
1408 (__open, __open64) [!_LIBC]: Remove.
1409 (__gen_tempname): Use small_open and large_open instead of __open
1410 and __open64. This fixes a portability bug on HP-UX 11.11i
1411 reported by Simon Wing-Tang in
1412 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1414 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
1416 * exclude.c (exclude_fnmatch): New function.
1417 (excluded_file_name): Call exclude_fnmatch.
1418 * exclude.h (excluded_file_name): New prototype
1420 2006-05-24 Bruno Haible <bruno@clisp.org>
1422 * printf-args.c (printf_fetchargs): Turn NULL pointers for
1423 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1424 Reported by Thorsten Maerz <torte@netztorte.de> via
1425 Aaron Stone <aaron@serendipity.cx>.
1427 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1429 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1430 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1431 (my_usleep): Don't mishandle maximum value.
1433 2006-05-19 Jim Meyering <jim@meyering.net>
1435 * getugroups.c: Correct an outdated comment. From Bruno Haible.
1437 2006-05-17 Bruno Haible <bruno@clisp.org>
1440 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1442 2006-05-17 Bruno Haible <bruno@clisp.org>
1444 * stdint_.h: Fix recognition of Cygwin.
1446 2006-05-11 Jim Meyering <jim@meyering.net>
1448 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
1450 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
1452 * crc.c (crc32_update): Remove unnecessary L suffix.
1453 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1454 unwanted sign propagation, e.g., on hosts with 64-bit int.
1455 There still are some problems with reeelly weird theoretical hosts
1456 (e.g., 33-bit int) but it's not worth worrying about now.
1457 * sha1.c (rol): Likewise.
1458 (K1, K2, K3, K4): Remove unnecessary L suffix.
1460 2006-05-10 Bruno Haible <bruno@clisp.org>
1462 * des.c: Cast to avoid warnings.
1464 2006-05-10 Simon Josefsson <jas@extundo.com>
1466 * md4.c: Typo fix, update copyright years.
1467 (K1, K2): Don't use L because it turn computations into 64-bit on
1470 2006-05-09 Bruno Haible <bruno@clisp.org>
1472 * xvasprintf.c: Include limits.h, string.h, xsize.h.
1473 (EOVERFLOW): Define fallback value.
1474 (xstrcat): New function.
1475 (xvasprintf): Recognize the special case of a string concatenation.
1477 2006-05-01 Bruno Haible <bruno@clisp.org>
1479 * stdint_.h: Shorter URL.
1480 * inttypes.h: Likewise.
1482 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
1484 * verify.h: Document the internals better. Most of this change
1485 was written by Bruno Haible.
1487 2006-04-29 Bruno Haible <bruno@clisp.org>
1489 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1490 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1492 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1494 * getdate.y (get_date): When adding relative date, start with the
1495 initial time, not with the result of the first mktime call.
1497 2006-04-23 Bruno Haible <bruno@clisp.org>
1499 * copy-file.c: Include <unistd.h> unconditionally.
1500 * execute.c: Likewise.
1501 * fatal-signal.c: Likewise.
1502 * findprog.c: Likewise.
1503 * mkdtemp.c: Likewise.
1506 * wait-process.h: Likewise.
1508 2006-04-23 Bruno Haible <bruno@clisp.org>
1510 * fwriteerror.c (fwriteerror): Call fclose also when an error
1511 condition was already detected.
1512 Reported by Ben Pfaff <blp@cs.stanford.edu>.
1514 2006-04-19 Derek Price <derek@ximbiot.com>
1515 Eric Blake <ebb9@byu.net>
1517 * inttypes.h: Correct grammar in comment.
1519 2006-04-18 Derek Price <derek@ximbiot.com>
1520 Paul Eggert <eggert@cs.ucla.edu>
1522 * inttypes.h: New file.
1523 * strtoimax.c: Assume <inttypes.h>.
1525 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
1527 * utimens.c (futimens): glibc futimesat messes up if /proc
1528 isn't mounted. Problem reported by Kir Kolyshkin.
1530 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
1532 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1533 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
1534 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1536 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
1538 Merge regex changes from libc, removing some of our
1539 POSIX-conformance changes that were rejected and redoing them in a
1542 * regcomp.c (re_compile_internal, init_dfa):
1543 Length arg is now size_t, not Idx. All uses changed.
1544 (peek_token): Forward decl now says internal_function.
1545 (__re_error_msgid, __re_error_msgid_idx):
1546 Now static rather than extern with attribute_hidden.
1547 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1548 For some reason libc prefers K&R style defns for external functions.
1549 (regerror) [!defined _LIBC]: Likewise.
1550 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1551 (seek_collating_symbol_entry, lookup_collation_sequence_value):
1552 (build_range_exp, build_collating_symbol):
1554 (re_compile_fastmap): Use '\0' to memset, not 0.
1555 (utf8_sb_map): Make the calculations more obvious.
1556 (init_dfa, parse_bracket_exp, build_charclass_op):
1557 Call calloc and cast result, as glibc does.
1558 (init_word_char, fetch_token, peek_token, peek_token_bracket):
1559 (build_range_exp, build_collating_symbol):
1560 Now internal functions.
1562 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1564 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
1565 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1566 Don't depend on VMS; depend on __VMS instead, for POSIX
1567 namespace cleanness.
1568 (regoff_t): Define to ssize_t, not long int.
1570 Remove the REG_ macros named below. Instead, make the old names
1571 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1573 (REG_BACKSLASH_ESCAPE_IN_LISTS):
1574 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1575 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1576 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1577 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1578 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1579 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1580 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1581 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1582 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1583 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1584 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1585 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1586 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1587 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1588 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1589 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1591 Remove. All uses replaced by the old RE_* names.
1592 (RE_BACKSLASH_ESCAPE_IN_LISTS):
1593 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1594 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1595 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1596 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1597 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1598 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1599 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1600 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1601 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1602 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1603 Don't bother having these macros be independent of each others'
1604 values, since they no longer exist in the POSIX name space.
1606 Rename the following member names back to their old names,
1607 unless !__USE_GNU_REGEX. All uses changed back.
1608 (buffer): Renamed from re_buffer.
1609 (allocated): Renamed from re_allocated.
1610 (used): Renamed from re_used.
1611 (syntax): Renamed from re_syntax.
1612 (fastmap): Renamed from re_fastmap.
1613 (translate): Renamed from re_translate.
1614 (can_be_null): Renamed from re_can_be_null.
1615 (regs_allocated): Renamed from re_regs_allocated.
1616 (fastmap_accurate): Renamed from re_fastmap_accurate.
1617 (no_sub): Renamed from re_no_sub.
1618 (not_bol): Renamed from re_not_bol.
1619 (not_eol): Renamed from re_not_eol.
1620 (newline_anchor): Renamed from re_newline_anchor.
1621 (num_regs): Renamed from rm_num_regs.
1622 (start): Renamed from rm_start.
1623 (end): Renamed from rm_end.
1625 (free_state): Move up a bit.
1627 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1628 #define to be empty.
1629 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1630 when that is what is intended.
1631 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1632 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1634 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1635 All uses changed back to re_malloc, etc. It's now the caller's
1636 responsibility to check for overflow; all callers changed.
1637 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1638 (re_x2nrealloc): Remove.
1639 (free_state): Remove decl.
1641 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1642 (re_set_registers, re_exec):
1645 2006-01-31 Roland McGrath <roland@redhat.com>
1647 * regcomp.c (calc_eclosure_iter): Remove dead variables.
1648 Reported by Mike Frysinger <vapier@gentoo.org>.
1650 2006-01-15 Andreas Jaeger <aj@suse.de>
1653 * regex_internal.c (re_string_reconstruct): Adjust for
1654 build_wcs_upper_buffer change.
1655 (build_wcs_upper_buffer): Change return type.
1657 2005-12-10 Ulrich Drepper <drepper@redhat.com>
1659 * regex_internal.h: Include <stdint.h> if available.
1661 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
1663 * regex_internal.h (SIZE_MAX): Provide a default definition.
1665 2005-10-14 Ulrich Drepper <drepper@redhat.com>
1667 * regcomp.c: Adjust for changed secondary hash function.
1669 2005-09-30 Ulrich Drepper <drepper@redhat.com>
1671 * regex.h: Pretty printing.
1672 Clean up namespace a bit.
1674 2005-09-30 Jakub Jelinek <jakub@redhat.com>
1676 * regexec.c (update_cur_sifted_state, check_arrival,
1677 check_arrival_add_next_nodes): Avoid using uninitialized variable.
1679 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1680 Ulrich Drepper <drepper@redhat.com>
1683 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
1684 (bitset_word_t): Renamed from bitset_word. All uses changed.
1686 2005-09-22 Ulrich Drepper <drepper@redhat.com>
1689 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1690 * regcomp.c: Remove unnecessary uses of
1691 unsigned RE_TRANSLATE_TYPE.
1692 * regex_internal.h: Likewise.
1693 * regex_internal.c: Likewise.
1694 * regexec.c: Likewise.
1695 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1697 2005-09-07 Ulrich Drepper <drepper@redhat.com>
1699 * regexec.c (find_recover_state): Remove unnecessary
1701 (transit_state_bkref): Make DFA a const pointer.
1702 (get_subexp): Likewise.
1703 (check_arrival): Likewise.
1704 (update_cur_sifted_state): Likewise.
1705 (re_search_internal): Likewise.
1706 (prune_impossible_nodes): Likewise.
1707 (acquire_init_state_context): Likewise.
1708 (proceed_next_node): Likewise.
1709 (set_regs): Likewise.
1710 (free_fail_stack_return): Likewise.
1711 (check_arrival_expand_ecl): Mark DFA parameter as const.
1712 (check_arrival_expand_ecl_sub): Likewise.
1713 (check_subexp_limits): Likewise.
1714 (sub_epsilon_src_nodes): Likewise.
1715 (add_epsilon_src_nodes): Likewise.
1716 (merge_state_array): Likewise.
1717 (update_regs): Likewise.
1718 (build_trtable): Likewise.
1719 (sift_states_backward): Mark MCTX parameter as const.
1720 (build_sifted_states): Likewise.
1721 (update_cur_sifted_state): Likewise.
1722 (sift_states_mkref): Likewise.
1723 (check_arrival_expand_ecl): Mark eclosure as const.
1724 (check_dst_limits_calc_pos_1): Likewise.
1725 * regex_internal.h (re_match_context_t): Make dfa a const
1728 2005-09-06 Ulrich Drepper <drepper@redhat.com>
1730 * regexec.c (merge_state_with_log): Define dfa as const pointer.
1731 (transit_state_sb): Likewise.
1732 (transit_state_mb): Likewise.
1733 (sift_states_iter_mb): Likewise.
1734 (check_arrival_add_next_nodes): Likewise.
1735 (check_node_accept_bytes): Change first parameter to pointer-to-const.
1736 [_LIBC] (re_search_2_stub): Use mempcpy.
1738 * regex_internal.c (re_string_reconstruct): Avoid calling
1739 mbrtowc for very simple UTF-8 case.
1741 * regex_internal.c (re_acquire_state): Make DFA pointer arg
1743 (re_acquire_state_context): Likewise.
1744 * regex_internal.h: Adjust prototypes.
1746 * regex.c: Prevent using C++ compilers.
1748 * regex_internal.c (re_acquire_state): Minor code rearrangement.
1749 (re_acquire_state_context): Likewise.
1751 2006-03-29 Mark D. Baushke <mdb@gnu.org>
1752 Bruno Haible <bruno@clisp.org>
1754 * stdint_.h: On OpenBSD, don't redefine types already included in
1755 <sys/types.h> and <inttypes.h>.
1757 2006-03-24 Eric Blake <ebb9@byu.net>
1759 * time_r.c (copy_string_result): Remove, as it is no longer used.
1761 2006-03-24 Simon Josefsson <jas@extundo.com>
1763 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1764 including some doc fixes.
1765 (base64_encode_alloc): Fix +1 bug on allocation failures.
1767 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1769 * base64.c (base64_encode): Do not read past end of array with
1770 unsanitized input on systems with CHAR_BIT > 8.
1772 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
1774 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1775 Typedef to long int, not to off_, as POSIX will likely change
1778 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
1780 * argp-help.c (validate_uparams): Fix typo
1781 * argp-parse.c (argp_default_options): Consistently begin help
1782 messages with a lowercase letter.
1784 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
1786 * time_r.h (asctime_r, ctime_r): Remove. These functions can
1787 overrun buffers and shouldn't be used (much as gets shouldn't be
1789 * time_r.c (asctime_r, ctime_r): Likewise.
1791 2006-03-08 Simon Josefsson <jas@extundo.com>
1793 * gc-gnulib.c (randomize): Don't open files called 'no', they
1794 signal that configure disabled the device.
1796 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
1798 * c-stack.c: Include unistd.h unconditionally, since we now assume
1800 * getlogin_r.c: Likewise.
1801 * getlogin_r.h: Likewise.
1803 * pagealign_alloc.c: Likewise.
1804 * unistd_.h: Remove; no longer needed.
1806 2006-03-07 Simon Josefsson <jas@extundo.com>
1808 * unistd_.h: New file.
1810 2006-03-07 Simon Josefsson <jas@extundo.com>
1812 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1814 2006-03-01 Simon Josefsson <jas@extundo.com>
1816 * readline.c: Fix typo, tiny patch from Stepan Kasal
1819 2006-02-28 Simon Josefsson <jas@extundo.com>
1821 * getopt.c: Protect #include of unistd.h, for MSVS.
1823 2006-02-27 Simon Josefsson <jas@extundo.com>
1825 * base64.h: Indent #define's. From Jim Meyering
1828 2006-02-27 Jim Meyering <jim@meyering.net>
1830 Revert the change of 2006-02-24, so these files can continue
1831 to be sync'd from gettext.
1832 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1835 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
1837 * glob.c: Say "invalid" rather than "illegal" in comments.
1839 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1841 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1843 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
1845 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1846 AT_FDCWD exceeds INT_MAX.
1847 * openat.h (AT_FDCWD): Likewise.
1849 2006-02-14 Jim Meyering <jim@meyering.net>
1851 Sync from coreutils.
1853 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1854 failure on deficient systems, and simplify gnulib lgpl dependencies.
1855 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1856 xmalloc/lstat combination. Based on a patch from Bruno Haible.
1858 * xalloc-die.c: Remove unused definition of N_.
1860 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
1862 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1864 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
1866 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1867 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1869 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
1871 * argp-namefrob.h: Restore changes accidentally lost during the
1872 "autoupdate" on 2005-12-12.
1874 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
1876 * fnmatch.c (L_): Renamed from L, to work around a bug in
1877 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1878 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1881 2006-01-26 Simon Josefsson <jas@extundo.com>
1883 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1884 prototype is visible on mingw32.
1886 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1889 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1892 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
1894 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
1895 attempt to open for write; this always fails, at least on POSIX
1896 hosts. This reinstates the 2006-01-09 change, which was
1897 inadvertently removed.
1899 2006-01-26 Bruno Haible <bruno@clisp.org>
1900 Paul Eggert <eggert@cs.ucla.edu>
1902 * stdbool_.h (_Bool)
1903 [(! (defined __cplusplus || defined __BEOS__)
1904 && !defined __GNUC__
1905 && !(defined __HP_cc || defined __xlc__
1906 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1907 || defined __sgi))]:
1908 #define to signed char in these cases too; this simplifies
1909 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1910 etc., separately) and makes it more conservative.
1912 2006-01-21 Jim Meyering <jim@meyering.net>
1914 Sync from the stable (b5) branch of coreutils:
1916 * fts.c (fts_children): Don't let close() clobber errno from
1919 * fts.c (fts_stat): When following a symlink-to-directory,
1920 don't necessarily interpret stat-fails+lstat-succeeds as indicating
1921 a dangling symlink. That can also happen at least for ELOOP.
1922 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1923 FYI, this bug predates the inclusion of fts.c in coreutils.
1925 * fts.c (fts_open): Put new maxarglen declaration and uses
1926 in their own block, so pre-c99 compilers don't object.
1928 Avoid the double-free (first in fts_read, second in fts_close) that
1929 would occur when an `active' directory is made inaccessible (e.g.,
1930 via chmod a-x) during a traversal.
1931 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1932 before returning. Reproduce this failure by
1933 mkdir -p a/b; cd a; chmod a-x . b
1934 Reported by Stavros Passas.
1936 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
1938 * argp-namefrob.h: Bugfix. Remove stray #
1940 2006-01-25 Bruno Haible <bruno@clisp.org>
1942 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1944 Reported by Paul Eggert.
1946 2006-01-25 Jim Meyering <jim@meyering.net>
1948 * fileblocks.c: Remove more useless parentheses.
1949 * readutmp.h: Likewise.
1951 2006-01-24 Bruno Haible <bruno@clisp.org>
1953 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1955 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
1958 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1959 to avoid problems with the built-in _Bool type.
1960 Reported by Paul Eggert on 2005-11-26.
1962 2006-01-24 Jim Meyering <jim@meyering.net>
1964 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1966 2006-01-24 Simon Josefsson <jas@extundo.com>
1968 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1971 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
1973 Work around porting bugs reported by Dieter in
1974 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1975 * getopt.c (_NOPROTO): Remove; no longer needed.
1976 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1977 Include "getopt.h" first, to check interface.
1978 (getenv): Declare only if defined HAVE_DECL_GETENV &&
1980 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1981 (__strndup): Revert to K&R-style function dfns, the glibc style.
1982 * strnlen.c: Don't claim it's taken from glibc; it's not.
1983 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1984 Include strnlen.h first, to get prototype properly.
1985 (strnlen): Renamed from __strnlen.
1988 2006-01-23 Ulrich Drepper <drepper@redhat.com>
1990 These changes imported from libc.
1991 * getopt.c: Use __fxprintf instead of inline stream orientation
1992 test and two separate function calls.
1993 * strndup.c (__strndup): Add libc_hidden_def.
1995 2006-01-22 Bruno Haible <bruno@clisp.org>
1997 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1998 temporary buffer for sprintf, take into account the precision also
1999 for 'd', 'i', 'u', 'o', 'x', 'X'.
2001 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2003 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
2004 to pacify gcc -Wswitch-default.
2006 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
2008 * argp-help.c (usage_long_opt): Do not print DOC options.
2009 (__argp_base_name): Removed
2010 * argp-namefrob.h (__argp_basename): Removed definition. Was a
2012 (__argp_base_name): Provide macro definition or extern declaration
2013 depending on the configuration
2015 2006-01-20 Simon Josefsson <jas@extundo.com>
2017 * inet_ntop.h: Unconditionally include sys/socket.h.
2019 2006-01-19 Simon Josefsson <jas@extundo.com>
2021 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
2023 2006-01-12 Simon Josefsson <jas@extundo.com>
2025 * base64.c: Fix warning, reported by Bruno Haible
2026 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
2028 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
2030 Sync from coreutils.
2031 * md5.c: Fix commentary typos.
2032 (alignof, UNALIGNED_P): No need for a GCC-specific version.
2033 * md5.h (__attribute__): Remove; unused.
2034 * sha1.c: Fix commentary to match md5 better.
2035 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
2036 so that we don't need to worry about alignment. All uses changed.
2037 This merges the 2005-10-28 md5 change into sha1.
2039 2006-01-11 Jim Meyering <jim@meyering.net>
2041 Sync from coreutils.
2042 * md5.c (OP): Fix spacing.
2044 2006-01-11 Simon Josefsson <jas@extundo.com>
2046 * stdint_.h (SIZE_MAX): Add missing (.
2048 2006-01-10 Bruno Haible <bruno@clisp.org>
2050 * argp.h (__const): Remove macro. Use const instead.
2051 * argp-fmtstream.h (__const): Likewise.
2052 * glob_.h (__const): Remove macro.
2053 * glob-libc.h: Use const instead of __const.
2055 2006-01-10 Jim Meyering <jim@meyering.net>
2057 Avoid the double-free (first in fts_read, second in fts_close) that
2058 would occur when an `active' directory is made inaccessible (e.g.,
2059 via chmod a-x) during a traversal.
2060 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
2061 before returning. Reproduce this failure by
2062 mkdir -p a/b; cd a; chmod a-x . b
2063 Reported by Stavros Passas.
2065 Sync from coreutils.
2066 * sha1.c: Tweak grammar in a comment.
2068 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
2070 * regex_internal.h (BITSET_WORD_BITS):
2071 Work around a bug in 64-bit PGC (before version 6.1-2), where the
2072 preprocessor mishandles large unsigned values as if they were signed.
2073 Problem reported by Claudio Fontana in
2074 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
2076 2006-01-10 Simon Josefsson <jas@extundo.com>
2078 * socket_.h: New file.
2080 2006-01-10 Bruno Haible <bruno@clisp.org>
2082 * localcharset.c: Update from GNU gettext.
2084 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
2086 Sync from coreutils.
2087 * chdir-long.c (cdb_free): Don't bother trying to open directory
2088 for write access: POSIX says that must fail.
2089 * fts.c (diropen): Likewise.
2090 * save-cwd.c (save_cwd): Likewise.
2091 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
2092 well, for minor improvements on hosts that lack O_DIRECTORY.
2093 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
2094 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2095 Fall back on chown if open failed with EACCES.
2097 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
2098 Report an error at compile-time if only a 1-second nominal clock
2099 resolution is found.
2101 * lchmod.h: New file.
2102 * mkdir-p.c: Include lchmod.h, lchown.h.
2103 (make_dir_parents): Use lchown rather than chown, and
2104 lchmod rather than chmod.
2106 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
2107 too. Problem with "none" reported by Bob Proulx. Problem with
2108 "proc" reported by n0dalus.
2110 * mountlist.c: Include <limits.h>.
2111 (dev_from_mount_options)
2112 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
2113 New function. It no longer assumes "dev=" has the System V meaning
2114 on Linux (since it doesn't). It also parses "dev=" more carefully.
2115 (read_file_system_list)
2116 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
2117 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
2120 * posixtm.h (PDS_PRE_2000): New macro.
2121 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
2122 All usages changed. Reject dates outside the range 1969-1999 if
2123 PDS_PRE_2000 is used.
2125 2006-01-09 Jim Meyering <jim@meyering.net>
2127 Sync from coreutils.
2129 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
2131 * chdir-safer.h, chdir-safer.c: New files.
2133 * modechange.c (mode_compile): Reject an invalid mode string
2134 that starts with an octal digit. From Andreas Gruenbacher.
2136 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
2137 and dup to open_safer and dup_safer, respectively.
2138 (openat_permissive): Fix typo in comment.
2140 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
2141 "gettext.h"; either no longer needed or are guaranteed by openat.h.
2142 (_): Remove; no longer needed.
2143 (openat): Renamed from rpl_openat; no need for rpl_openat
2144 since openat.h renames openat for us.
2145 Replace most of the body with a call to openat_permissive,
2146 to avoid duplicate code.
2147 Port to (probably hypothetical) environments were mode_t is
2149 (openat_permissive): Require mode arg, so that we can check
2150 types better. Put it just after flags. Change cwd failure
2151 indicator from pointer-to-bool to pointer-to-errno-value.
2152 All callers changed.
2153 Invoke openat_save_fail and/or openat_restore_fail if
2154 cwd_errno is null, so that openat can call us.
2155 (openat_permissive, fdopendir, fstatat, unlinkat):
2156 Simplify errno handling to avoid some duplicate code,
2157 as it's OK to set errno on success.
2158 * openat.h: Revamp code so that function macros depend on
2159 __OPENAT_PREFIX only, not also on AT_FDCWD.
2160 (openat_ro): Remove. Caller changed to use openat_permissive.
2161 (openat_permissive): Now a macro, if not a function.
2162 (openat_restore_fail, openat_save_fail): Now always functions,
2163 since mkdirat needs them even if __OPENAT_PREFIX is defined.
2165 * openat-priv.h: New file, defining macros used by mkdirat.c
2167 * mkdirat.c: Include openat-priv.h.
2168 Remove definitions of macros defined therein.
2169 * openat.c: Likewise.
2171 * mkdirat.c (mkdirat): New file and function.
2172 * openat.h (mkdirat): Declare.
2174 * openat.c (fdopendir): Don't change errno when returning non-NULL.
2176 * openat.h (openat_permissive): Declare.
2177 (openat_ro): Define.
2179 * openat.c (EXPECTED_ERRNO): New macro.
2180 (openat_permissive): New function -- used in remove.c rewrite.
2181 (all functions): Set errno just before returning, only if there
2182 was an actual failure.
2183 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2185 Emulate openat-family functions using Linux's procfs, if possible.
2186 Idea and some code based on Ulrich Drepper's glibc changes.
2188 * openat.c: (BUILD_PROC_NAME): New macro.
2189 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
2190 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
2191 before falling back on save_cwd and restore_cwd.
2192 (fdopendir, fstatat, unlinkat): Likewise.
2194 * openat.c (fstatat, unlinkat): Perform the syscall directly,
2195 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2197 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
2198 as second argument to va_arg. Otherwise, some versions of gcc
2199 warn that `if this code is reached, the program will abort'.
2201 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
2203 Sync from coreutils.
2205 Add POSIX ACL support
2206 * acl.h (copy_acl, set_acl): Add declarations.
2207 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
2208 systems other than Linux.
2209 (chmod_or_fchmod): New function: use fchmod when possible,
2210 and chmod otherwise.
2211 (file_has_acl): Add a POSIX ACL implementation, with a
2212 Linux-specific subcase.
2213 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
2214 S_ISVTX from one file to another. Fall back to fchmod/chmod when
2215 acls are unsupported.
2216 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
2217 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
2220 2006-01-09 Bruno Haible <bruno@clisp.org>
2222 * sysexit_.h (EX_OK): New macro.
2223 Suggested by Martin Lambers <marlam@marlam.de>.
2225 2006-01-09 Bruno Haible <bruno@clisp.org>
2227 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
2228 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
2229 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
2230 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
2232 2006-01-09 Bruno Haible <bruno@clisp.org>
2234 * stdint_.h (SIZE_MAX): Write the value without involving negative
2237 2005-10-16 Bruno Haible <bruno@clisp.org>
2239 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
2240 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
2242 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2244 * strftime.c (tzname): Don't declare if it is already #defined.
2245 Problem reported for Mingw by Mark Junker.
2247 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2249 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
2250 long int, not int, for nanosecond counts, so that people who are
2251 used to POSIX struct timespec won't be surprised. Reported by Jim
2254 2005-12-16 Jim Meyering <jim@meyering.net>
2256 * fprintftime.c, fprintftime.h: New files.
2258 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
2260 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
2261 * argp-help.c (fill_in_uparams): Check if the constructed
2262 struct uparams is valid. Fall back to the default values if it is
2265 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
2267 * argp-help.c (__argp_base_name): New function
2268 (__argp_short_program_name): Rewrite using __argp_base_name
2269 * argp-namefrob.h: Define program_invocation_name and
2270 program_invocation_short_name if requested
2271 (__argp_base_name): Add prototype
2272 * argp-parse.c (argp_def): Use gettext wrappers
2273 (argp_default_parser): Use __argp_base_name
2274 * argp-pin.c: New file. Defines program_invocation_name and
2275 program_invocation_short_name on systems that lack them.
2277 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2279 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
2280 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
2281 porting problem reported by Georg Schwarz in
2282 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
2284 2005-07-09 Bruno Haible <bruno@clisp.org>
2286 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
2287 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
2288 Reported by Mark Junker <mjscod@gmx.de>.
2290 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
2292 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
2293 (uintmax_t) [defined uintmax_t]: Do not declare.
2294 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
2295 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
2296 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
2297 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
2298 sake of portability to weird hosts that C allows (though we don't
2299 know of any practical examples).
2301 * savedir.h (fdsavedir): New decl.
2302 * savedir.c (fdsavedir, savedirstream): New functions; the latter
2303 contains most of the former guts of savedir.
2304 (savedir): Use savedirstream.
2307 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
2309 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
2310 coreutils no longer futzes with rounding modes.
2312 2005-11-14 Jim Meyering <jim@meyering.net>
2314 * mkstemp-safer.c: Include <config.h>, required for possible
2315 replacement of mkstemp.
2317 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
2319 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2321 (gethrxtime) [! (HAVE_NANOUPTIME
2322 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2323 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2324 our own approximation.
2326 2005-11-10 Simon Josefsson <jas@extundo.com>
2328 * readline.c: Remove EOL.
2330 2005-11-08 Eric Blake <ebb9@byu.net>
2332 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2334 2005-11-08 Eric Blake <ebb9@byu.net>
2336 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2338 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2340 Fix porting problem reported by Theodoros V. Kalamatianos.
2341 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2342 Don't assume that futimes failing means we must fail.
2344 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
2346 * getcwd.c (__getcwd): Don't assume that system calls after readdir
2347 leave errno alone. Problem reported by Dmitry V. Levin.
2349 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
2351 * savedir.c (savedir): Don't assume that xrealloc etc. leave
2352 errno alone. Problem reported by Frederic Jolliton.
2354 2005-10-28 Simon Josefsson <jas@extundo.com>
2356 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2357 "restrict" keywords, as per POSIX. Protect the function
2358 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2359 Don't use K&R prototypes. Check the sprintf return values.
2360 Re-define EAFNOSUPPORT if not present. Indent.
2362 * md5.h, md5.c: Simplify buffer handling visavi alignment,
2363 suggested by Bruno Haible <bruno@clisp.org>.
2365 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2367 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
2369 * gc-libgcrypt.c: Add MD2 (which is not available through
2372 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
2374 * md2.h, md2.c: New files.
2376 2005-10-24 Simon Josefsson <jas@extundo.com>
2378 * md4.h: Shrink buffer size, now that we changed the type.
2380 2005-10-22 Simon Josefsson <jas@extundo.com>
2382 * arcfour.h, arcfour.c: Use fixed size indices in the
2383 arcfour_context struct (simplify test vector testing in GNU
2386 2005-10-22 Simon Josefsson <jas@extundo.com>
2388 * md4.h, md4.c: Simplify buffer handling visavi alignment,
2389 suggested by Bruno Haible <bruno@clisp.org>.
2391 2005-10-22 Simon Josefsson <jas@extundo.com>
2393 * crc.h: Include stddef.h, for size_t.
2395 2005-10-21 Simon Josefsson <jas@extundo.com>
2397 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2398 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2400 2005-10-21 Simon Josefsson <jas@extundo.com>
2402 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2405 2005-10-21 Simon Josefsson <jas@extundo.com>
2407 * gc-gnulib.c: Support ARCTWO in CBC mode.
2409 2005-10-21 Simon Josefsson <jas@extundo.com>
2411 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2414 * hmac-sha1.c (hmac_sha1): Likewise.
2416 * crc.c (crc32_update): Actually use crc parameter, suggested by
2417 Bruno Haible <bruno@clisp.org>.
2419 * crc.h: Include stdint.h directly, suggested by Bruno Haible
2422 2005-10-21 Simon Josefsson <jas@extundo.com>
2424 * des.h, des.c: New files.
2426 * gc-gnulib.c: Support DES.c
2428 2005-10-21 Simon Josefsson <jas@extundo.com>
2430 * arctwo.h, arctwo.c: New files.
2432 * gc-gnulib.c: Support ARCTWO.
2434 2005-10-21 Simon Josefsson <jas@extundo.com>
2436 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2438 2005-10-19 Simon Josefsson <jas@extundo.com>
2440 * gc-gnulib.c: Support ARCFOUR.
2442 2005-10-19 Simon Josefsson <jas@extundo.com>
2444 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2447 * gc.h: Add ECB enum type.
2449 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2451 2005-10-19 Simon Josefsson <jas@extundo.com>
2453 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2455 2005-10-18 Simon Josefsson <jas@extundo.com>
2457 * md4.h, md4.c: New files, based on md5.?.
2459 2005-10-17 Simon Josefsson <jas@extundo.com>
2461 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2463 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2465 2005-10-17 Simon Josefsson <jas@extundo.com>
2467 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2469 2005-10-17 Simon Josefsson <jas@extundo.com>
2471 * gc.h, gc-libgcrypt.c: Add ciphers.
2473 2005-10-17 Simon Josefsson <jas@extundo.com>
2475 * sha1.c: Use uint32_t instead of md5_uint32.t
2477 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2480 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
2482 * md5.h: Use stdint.h and uint32_t. Doc fix.
2484 2005-10-15 Simon Josefsson <jas@extundo.com>
2486 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2488 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2490 2005-10-14 Simon Josefsson <jas@extundo.com>
2492 * arcfour.h, arcfour.c: New files.
2494 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
2496 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2497 include <wchar.h>; no longer needed.
2499 2005-10-14 Jakub Jelinek <jakub@redhat.com>
2500 and Ulrich Drepper <drepper@redhat.com>
2503 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2504 instead of inline stream orientation test and two separate
2505 function calls. Pay no attention to USE_IN_LIBIO.
2507 2005-10-14 Roland McGrath <roland@redhat.com>
2509 Import from libc. [BZ #1331]
2510 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2512 Reported by Matej Vela <vela@debian.org>.
2514 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2516 * mkdir-p.c (make_dir_parents): Don't report an error if an
2517 intermediate directory is in a read-only file system. Problem
2518 reported by Eric Blake.
2520 2005-10-13 Simon Josefsson <jas@extundo.com>
2522 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2523 Move memory allocation outside of loop.
2525 2005-10-12 Simon Josefsson <jas@extundo.com>
2527 * gc-pbkdf2-sha1.c: New file.
2529 * gc.h: Add gc_pbkdf2_sha1 prototype.
2531 2005-10-12 Simon Josefsson <jas@extundo.com>
2533 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2534 suggested by Bruno Haible <bruno@clisp.org>.
2536 2005-10-12 Simon Josefsson <jas@extundo.com>
2538 * gc-libgcrypt.c (gc_hmac_sha1): New function.
2540 * gc-gnulib.c (gc_hmac_sha1): New function.
2542 2005-10-12 Simon Josefsson <jas@extundo.com>
2544 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2546 2005-10-12 Simon Josefsson <jas@extundo.com>
2548 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2549 GC_USE_HMAC_MD5, respectively.
2551 * gc-libgcrypt.c (gc_md5): Fix assert call.
2554 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2556 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2558 * gc-gnulib.c (gc_hash_buffer): Ditto.
2560 2005-10-11 Bruno Haible <bruno@clisp.org>
2562 * c-strcasestr.h: New file, from GNU gettext.
2563 * c-strcasestr.c: New file, from GNU gettext.
2565 2005-10-11 Bruno Haible <bruno@clisp.org>
2567 * c-strcase.h: New file, from GNU gettext.
2568 * c-strcasecmp.c: New file, from GNU gettext.
2569 * c-strncasecmp.c: New file, from GNU gettext.
2571 2005-10-11 Simon Josefsson <jas@extundo.com>
2573 * crc.h, crc.c: New files.
2575 * gc.h (gc_hash_buffer): Add doc.
2577 2005-10-08 Simon Josefsson <jas@extundo.com>
2579 * gc.h: Add gc_hash and gc_hash_buffer.
2581 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
2583 * gc-libgcrypt.c (gc_hash_buffer): Add.
2585 2005-10-11 Bruno Haible <bruno@clisp.org>
2587 * strcasecmp.c: Include limits.h.
2588 (strcasecmp): Avoid integer overflow on exotic platforms.
2589 * strncasecmp.c: Include limits.h.
2590 (strncasecmp): Avoid integer overflow on exotic platforms.
2591 Reported by Paul Eggert.
2593 2005-10-06 Simon Josefsson <jas@extundo.com>
2595 * hmac-md5.c: New file.
2599 2005-10-06 Simon Josefsson <jas@extundo.com>
2601 * memxor.c (memxor): Avoid casts and warnings.
2603 2005-10-05 Derek Price <derek@ximbiot.com>
2605 * getdelim.c (SIZE_MAX): New macro, if not already defined.
2607 2005-10-05 Simon Josefsson <jas@extundo.com>
2609 * memxor.c (memxor): Fix compiler error.
2611 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2612 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2614 * memxor.h, memxor.c: New files.
2616 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2617 we assume all systems have it, suggested by Jim Meyering
2618 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
2619 any systems lack sys/socket.h; mingw32 is known to lack it, but we
2620 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
2623 2005-10-04 Bruno Haible <bruno@clisp.org>
2625 * verify.h (verify_true): Provide alternative definition for C++.
2627 2005-10-04 Simon Josefsson <jas@extundo.com>
2629 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2630 D. Baushke" <mdb@gnu.org>.
2632 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
2634 * getdelim.c: Include getdelim.h first. Include <limits.h>.
2635 (SSIZE_MAX): New macro, if not already defined.
2636 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2639 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2641 * exclude.c: Include verify.h.
2642 (verify): Remove. All callers changed to use verify.h's version.
2643 * strtoimax.c: Likewise.
2644 * utimecmp.c: Likewis.e
2646 Sync from coreutils.
2647 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2648 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2649 * .cvsignore: Add fts.h, search.h, t-fpending.
2650 * settime.c (settime): Fix { typo in previous patch. Also, don't
2651 bother returning ENOSYS if settimeofday or stime fails; just let
2652 them return whatever errno they want to return.
2653 * utimens.c: Include unistd.h, for dup2.
2654 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2655 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2657 2005-10-02 Jim Meyering <jim@meyering.net>
2659 Sync from coreutils.
2660 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2661 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2662 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2663 Remove AT_FDCWD test.
2664 Do not consume the fd unless successful.
2665 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2666 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2667 block, so that we don't even try to compile it if settimeofday is
2668 available. This works around a compilation failure on OSF1 V5.1,
2669 due to stime requiring a `long int*' while tv_sec is `int'.
2671 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
2673 * getdelim.c (getdelim): Remove unused variables.
2675 2005-10-01 Simon Josefsson <jas@extundo.com>
2677 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2678 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
2679 AI_* and EAI_* definitions. Protect function declarations.
2681 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2683 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2684 so that the code works even with ancient cpp. Portability problem
2685 with GCC 2.7.2.1 reported by Thomas M.Ott.
2687 2005-09-27 Jim Meyering <jim@meyering.net>
2689 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2691 * intprops.h (signed_type_or_expr__): Define.
2692 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2695 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2697 * verify.h (verify_expr): Remove, replacing with:
2698 (verify_true): New macro that returns true instead of void.
2699 (verify_type__): Remove.
2700 (verify): Use verify_true rather than verify_type__.
2702 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
2704 * utimens.c (ENOSYS): Define if not already defined.
2705 (futimens): Support having a null PATH if the file descriptor
2708 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2710 (__attribute): Define to empty unless GCC 3.1 or later.
2711 This works around a core dump on OpenBSD 3.4, which has GCC
2712 2.95.3, which dumps core when given __attribute__(()). It also
2713 simplifies other tests, since we really don't want to bother with
2714 worrying about which ancient version of GCC supported what.
2715 Original problem reported by Yoann Vandoorselaere, with part of
2716 the fix suggested by Derek Price.
2718 2005-09-24 Jim Meyering <jim@meyering.net>
2720 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2721 so we can once again use a positive bitfield width of 1 -- now we
2722 don't have to explain why we were using a bitfield width of 2.
2724 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
2726 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2727 Problem reported by Eric Blake.
2728 (getaddrinfo): Initialize se so that it's not garbage.
2729 Redo internal storage allocation so that it doesn't make unportable
2730 assumptions about alignment.
2733 * utimens.c (futimens): Use futimesat if available.
2734 Prefer it to futimes since it doesn't have the futimes bug.
2736 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2737 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2738 Instead, declare a function that returns a pointer to an array,
2739 and use verify_type__ to declare the size of the array.
2740 Problem and germ of a solution reported by Bruno Haible.
2741 (verify_type__): Use 2, not 1, for bitfield size, to avoid
2742 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
2744 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
2746 Sync from coreutils.
2748 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2750 * argmatch.h: Include verify.h
2751 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2752 (ARGMATCH_ASSERT): Remove; unused.
2753 * canonicalize.c: Assume STDC_HEADERS.
2754 * exclude.c: Include "strcase.h".
2755 * regex_internal.h [!defined _LIBC]: Likewise.
2756 * getusershell.c: Include stdio--.h rather than stdio.h
2758 (getusershell): Call fopen, not fopen_safer.
2759 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2760 Do not include unistd-safer.h.
2761 (save_cwd): Don't call fd_safer; no longer needed
2762 now that we include fcntl--.h.
2764 * getdate.y (relative_time): New type.
2765 (RELATIVE_TIME_0): New constant.
2766 (parser_control): Use relative_time instead of doing it ourselves.
2767 (%union): Add new relative_time rel member.
2768 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2770 (relunit, relunit_snumber): Now of type rel.
2771 (zone, rel, relunit, get_date): Adjust to above changes.
2773 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2774 Do not include unistd-safer.h.
2775 (getloadavg): Don't call fd_safer; no longer needed
2776 now that we include fcntl--.h.
2778 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2779 (make_dir_parents): Treat ENOSYS like EEXIST.
2781 Improve quality of diagnostics on restore_cwd failure.
2782 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
2783 (make_dir_parents): Last arg is now int * (for errno), not bool *.
2784 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2785 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2786 each time through the loop. Do not diagnose restore_cwd failure;
2787 that is the caller's job (and perhaps the caller does not care).
2789 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2790 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2791 If the file already exists but is not a directory, don't bother
2792 to try to make its parents.
2793 Close potential file descriptor leak if we can't chdir("/") (!).
2794 Don't always return true if chdir($PWD) fails; return true only
2795 if the requested action was done successfully (except for the
2797 Don't log final directory unless we actually made it.
2798 Refactor to avoid duplicate code to fix up permissions.
2799 Don't attempt to fix up parent permissions if chdir($PWD) fails.
2801 * strftime.c (my_strftime): Rewrite the previous change slightly,
2802 to make it a bit faster and (I hope) clearer.
2803 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2804 Fix bug in formats like %2N.
2806 * verify.h: New file.
2808 2005-09-22 Jim Meyering <jim@meyering.net>
2810 Sync from coreutils.
2812 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2814 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2815 the .tm_year member, since otherwise gcc-4.0 would now warn about
2816 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2818 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2819 order to avoid an unsuppressible warning from gcc on 64-bit systems.
2821 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2822 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2823 when run in a time zone for which daylight savings time is in effect
2824 for the starting date.
2826 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2827 stop us from restricting permissions of just-created absolute-named
2829 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2830 to restore initial working directory.
2831 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2832 to tell caller if/when we change the working directory and are
2833 unable to return to the initial one.
2834 * mkdir-p.h (make_dir_parents): Update prototype.
2835 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2836 `return false'. This fixes a bug introduced on 2004-07-30.
2838 * openat.c (fdopendir): Be sure to close the supplied
2839 file descriptor before returning. This makes our replacement
2840 implementation a little closer to Solaris's, where fdopendir
2841 ties the file descriptor to the returned DIR* pointer.
2842 * openat.c (unlinkat): New function.
2843 * openat.h (unlinkat): Add prototype.
2844 * openat-die.c (openat_save_fail): Rename from openat_save_die.
2845 (openat_restore_fail): Rename from openat_restore_die.
2846 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2848 Provide an alternative to exiting immediately upon save_cwd or
2849 restore_cwd failure. Now, an application can arrange e.g.,
2850 to perform a longjump in that case.
2851 * openat.c: Include dirname.h.
2852 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2853 (rpl_openat, fdopendir, fstatat): Call openat_save_die
2854 and openat_restore_die rather than calling error directly.
2855 Don't include "error.h" or "exitfail.h"; they're no longer needed.
2857 * openat-die.c (openat_save_die, openat_restore_die): New file.
2858 * openat.h (openat_save_die, openat_restore_die): Declare and define.
2860 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2861 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2862 int utc, int nanoseconds);
2864 date should not have to allocate a megabyte of virtual memory to
2865 handle a format argument like +%1048575T. When implemented with
2866 strftime, it must allocate such a buffer, use strftime to fill it
2867 in, print it, then free it.
2868 With fprintftime, it simply prints everything and exits.
2869 With no need for memory allocation, that's one fewer way to fail.
2870 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2871 optional field width, not before, so we accept %9:z, not %:9z.
2872 (my_strftime): Be sure to use L_('x') for literals.
2874 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2875 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2876 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2877 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2878 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2879 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2880 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2881 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2882 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2884 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2885 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2886 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2887 and don't include <sys/file.h>).
2889 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
2891 Sync from coreutils.
2893 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2894 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2895 [!LDAV_DONE]: Avoid unused variable warning.
2897 2005-09-21 Bruno Haible <bruno@clisp.org>
2899 * unicodeio.h (unicode_to_mb): New declaration.
2901 2005-09-20 Derek Price <derek@ximbiot.com>
2903 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2905 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2907 Use a consistent style for including <config.h>.
2908 * __fpending.c, acl.c, argmatch.c,
2909 argp-help.c, argp-parse.c,
2910 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2911 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2912 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2913 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2914 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2915 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2916 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2917 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2918 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2919 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2920 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2921 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2922 modechange.c, mountlist.c, open-safer.c, physmem.c,
2923 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2924 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2925 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2926 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2927 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2928 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2929 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2930 userspec.c, utimecmp.c, version-etc-fsf.c,
2931 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2932 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2933 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2934 Standardize inclusion of config.h.
2935 * __fpending.h, dirfd.h, getdate.h, human.h,
2936 inttostr.h: Removed inclusion of config.h from header files.
2937 * inttostr.c: Adjusted in-tree users.
2938 * timespec.h: Remove superfluous warning to include config.h.
2939 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2940 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2941 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2942 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2944 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
2946 * stat-time.h: New file.
2947 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2948 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
2950 (timespec_cmp): New function.
2951 * utimecmp.c: Include stat-time.h.
2952 (SYSCALL_RESOLUTION): Depend on whether various struct stat
2953 members exist, not on the obsolescent ST_MTIM_NSEC.
2954 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2956 2005-09-15 Derek Price <derek@ximbiot.com>
2957 Paul Eggert <eggert@cs.ucla.edu>
2959 * regcomp.c, regexec.c, regex_internal.c: Back out previous
2960 changes, consolidating in...
2961 * regex_internal.h: ...this file.
2963 2005-09-15 Derek Price <derek@ximbiot.com>
2965 * regex_internal.h: Blank `pure' for GNUC < 3.
2966 * regex_internal.c: Ditto, using this...
2967 (__GNUC_PREREQ): ...new macro.
2968 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2969 (__GNUC_PREREQ): ...this new macro.
2971 * strstr.h: Include string.h. Define strstr as a macro here.
2973 2005-09-13 Derek Price <derek@ximbiot.com>
2975 * canon-host.c (canon_host_r): Set *cherror on memory allocation
2977 Reported by Jim Meyering <jim@meyering.net>.
2979 2005-09-13 Jim Meyering <jim@meyering.net>
2981 * canon-host.c: Filter through gnu indent and reword comments slightly.
2982 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2984 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2987 (base64_encode): Put b64str in initialized data section.
2989 2005-09-12 Derek Price <derek@ximbiot.com>
2991 Return usable errors from canon-host.
2992 * canon-host.h: New file.
2993 * canon-host.c (canon_host): Wrap...
2994 (canon_host_r): ...this new function, which now relies exclusively on
2996 (ch_strerror): New function.
2997 (last_cherror): New global.
2998 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2999 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
3001 (freeaddrinfo): Free ai->ai_canonname when set.
3003 2005-09-12 Derek Price <derek@ximbiot.com>
3004 Paul Eggert <eggert@cs.ucla.edu>
3006 * glob-libc.h: Renamed from glob_.h. The new version is
3007 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
3008 protecting things that should be done only in gnulib contexts.
3009 * glob_.h: New file, containing only the glob things needed for
3011 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
3012 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
3013 (glob, globfree, glob_pattern_p): Now defined simply in terms of
3014 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
3015 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
3016 and to respect the namespace rules better.
3018 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
3020 Merge glibc and coreutils changes into gnulib, plus a few
3022 * md5.c: Use #error rather than a string.
3023 (CYCLIC): New macro, from glibc source. Use it instead of rol.
3024 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
3025 (__attribute__): Define to empty for non recent-GCC.
3026 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
3027 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
3028 Renamed from their non-__ counterparts, with new macros replacing
3029 them if not _LIBC. Add __THROW attribute.
3031 (struct md5_ctx): Align buffer if using GCC.
3032 * sha1.h (struct sha1_ctx): Likewise.
3033 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
3034 The old name was backwards.
3035 (NOTSWAP): Remove; not used.
3036 (rol): New macro, moved here from md5.h.
3037 (sha1_process_block): Remove a FIXME that doesn't make sense.
3039 2005-09-12 Derek Price <derek@ximbiot.com>
3041 * gai_strerror.c: Include config.h when available. Include
3042 getaddrinfo.h before other headers to test interface.
3043 Reported by Larry Jones <lawrence.jones@ugs.com>.
3045 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3047 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
3048 definitions, since that's the preferred style in glibc.
3049 Fix a minor spacing issue, and update copyright notice to match glibc's.
3051 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
3053 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
3055 2005-09-06 Simon Josefsson <jas@extundo.com>
3057 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
3058 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
3060 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
3062 Change bitset word type from unsigned int to unsigned long int,
3063 as this has better performance on typical 64-bit hosts.
3064 Port bitset code to hosts with unusual word sizes.
3065 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
3066 (build_collating_symbol):
3067 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
3068 argument is a bitset. This is merely a style issue, but it makes
3069 it clearer that an entire array is expected.
3070 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
3071 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
3072 Port to the case where bitset_word is not the same as unsigned int.
3073 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
3074 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
3076 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3077 (build_trtable, group_nodes_into_DFAstates):
3079 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
3080 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
3081 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
3082 * regexec.c (group_nodes_into_DFAstates): Likewise.
3083 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
3084 * regcomp.c (optimize_subexps, lower_subexp):
3085 Work even if bitset_word has holes in its bitwise representation.
3086 * regex_internal.h (BITSET_WORD_BITS): Likewise.
3087 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3089 * regex_internal.c (re_string_reconstruct):
3090 Don't assume UCHAR_MAX == 255.
3091 * regex_internal.h (bitset_set_all): Likewise.
3092 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
3094 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
3095 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
3097 (BITSET_WORD_MAX): New macro.
3098 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
3099 (bitset_set_all, bitset_copy): Now inline functions, not macros.
3100 (bitset_empty, bitset_copy):
3101 Prefer sizeof (bitset) to multiplying it out ourselves.
3102 (bitset_not_merge): Remove; unused.
3103 (bitset_contain): Return bool, not unsigned int with one bit on.
3104 All callers changed.
3105 * regexec.c (build_trtable): Don't assume bitset has no stricter
3106 alignment than re_node_set; do this by defining a new internal
3107 type struct dests_alloc and using it to allocate memory.
3109 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
3111 Check for arithmetic overflow when calculating sizes, to prevent
3112 some buffer-overflow issues. These patches are conservative, in the
3113 sense that when I couldn't determine whether an overflow was possible,
3114 I inserted a run-time check.
3115 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
3116 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
3117 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
3118 (re_xnrealloc, re_x2nrealloc): New inline functions.
3119 * regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
3120 (build_equiv_class, build_charclass): Check for arithmetic overflow
3121 in size expression calculations.
3122 * regex_internal.c (re_string_realloc_buffers):
3123 (build_wcs_upper_buffer, re_node_set_add_intersect):
3124 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
3125 (re_dfa_add_node, register_state): Likewise.
3126 * regexec.c (re_search_stub, re_copy_regs, re_search_internal):
3127 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
3128 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
3129 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
3131 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
3133 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
3134 to avoid a collision with bits/local_lim.h in glibc.
3135 All uses changed. Problem reported by Dmitry V. Levin in
3136 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
3138 * regex_internal.c (build_wcs_upper_buffer): Fix portability
3139 bugs in int versus size_t comparisons.
3140 (re_string_context_at): Fix bug where the code assumed that
3143 Use bool where appropriate.
3144 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
3145 All callers changed.
3146 (calc_eclosure_iter): Likewise, for ROOT arg.
3147 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
3148 (build_charclass_op): Likewise, for NON_MATCH arg.
3149 * regex_internal.c (re_string_allocate, re_string_construct):
3150 (re_string_construct_common): Likewise, for ICASE arg.
3151 * regexec.c (re_search_2_stub, re_search_stub):
3152 Likewise, for RET_LEN arg.
3153 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
3154 (set_regs): Likewise, for FL_BACKTRACK arg.
3155 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
3156 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
3157 (calc_eclosure_iter, parse_bracket_exp):
3158 Use bool for internal variables that are booleans.
3159 * regexec.c (re_search_internal, check_matching, proceed_next_node):
3160 (set_regs, build_sifted_states, sift_states_bkref):
3161 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
3162 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3163 (find_collation_sequence_value):
3165 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
3166 (re_node_set_compare):
3167 Return bool, not int. All callers changed.
3168 * regexec.c (check_halt_node_context, check_dst_limits):
3169 (build_trtable, check_node_accept): Likewise.
3170 * regex_internal.h: Include stdbool.h.
3172 Fix bugs uncovered when converting to bool.
3173 * regcomp.c (calc_eclosure_iter): Check for storage allocation
3174 failure instead of charging ahead blindly.
3175 * regex_internal.c (register_state): Likewise.
3176 * regexec.c (re_search_2_stub): Use simpler method than boolean
3177 for freeing internal storage.
3178 (group_nodes_into_DFA_states): Use unsigned int, not int, for
3179 bitset pieces used as boolean, to avoid undefined behavior
3180 on hosts that do int overflow checking.
3182 2005-08-31 Derek Price <derek@ximbiot.com>
3184 * getdelim.c (getdelim): Return EOF on EOF.
3185 Reported by Larry Jones <lawrence.jones@ugs.com>.
3187 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3189 * regex_internal.c (re_string_reconstruct): Don't assume buffer
3190 lengths fit in regoff_t; this isn't true if regoff_t is the same
3192 * regex.c (re_search_internal): 5th arg is LAST_START
3193 (= START + RANGE) instead of RANGE. This avoids overflow
3194 problems when regoff_t is the same width as size_t.
3195 All callers changed.
3196 (re_search_2_stub): Check for overflow when adding the
3197 sizes of the two strings.
3198 (re_search_stub): Check for overflow when adding START
3199 to RANGE; if it occurs, substitute the extreme value.
3201 2005-08-31 Jim Meyering <jim@meyering.net>
3203 * regcomp.c (search_duplicated_node): Make first pointer arg
3205 * regex_internal.c (create_ci_newstate, create_cd_newstate):
3206 (register_state): Likewise.
3207 * regexec.c (search_cur_bkref_entry, check_dst_limits):
3208 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3209 (group_nodes_into_DFAstates): Likewise.
3211 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
3213 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
3214 old glibc regex code mishandles strings longer than 2**31 bytes.
3215 This patch fixes this when the regex code is used in gnulib
3216 (i.e., outside glibc).
3218 This patch should not affect the use of the regex code inside
3219 glibc. No doubt this problem also needs to be handled for glibc
3220 as well, but the result will be an incompatible change to the
3221 glibc ABI, and the old ABI will have to be supported too. That
3222 can be the the subject for another patch.
3224 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
3225 governing whether the rest of this patch is active. By default,
3226 the macro is disabled and the patch has no effect.
3227 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
3228 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
3229 (struct re_pattern_buffer, re_search, re_search_2, re_match):
3230 (re_match_2, re_set_registers): Use the new types.
3231 * regex_internal.h (Idx, re_hashval_t): New types.
3232 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
3234 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
3235 (re_string_context_at, bin_tree_t, re_dfastate_t):
3236 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
3237 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
3238 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
3239 (re_string_char_size_at, re_string_wchar_at):
3240 (re_string_elem_size_at):
3241 Use the new types and macros to port to 64-bit hosts.
3242 Use unsigned types for internal values, so that the code
3243 mostly works even for arrays larger than SSIZE_MAX.
3244 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
3245 (search_duplicated_node, calc_eclosure_iter, fetch_number):
3246 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
3247 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
3248 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
3249 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
3250 (calc_inveclosure, parse_dup_op, build_range_exp):
3251 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
3252 (fetch_number, create_token_tree, mark_opt_subexp):
3254 * regex_internal.c (re_string_construct_common, create_ci_newstate):
3255 (create_cd_newstate, re_string_allocate, re_string_construct):
3256 (re_string_realloc_buffers, build_wcs_upper_buffer):
3257 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3258 (re_string_reconstruct, re_string_peek_byte_case):
3259 (re_string_fetch_byte_case, re_string_context_at):
3260 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3261 (re_node_set_init_copy, re_node_set_add_intersect):
3262 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3263 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3264 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3265 (re_acquire_state, re_acquire_state_context, register_state):
3267 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
3268 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
3269 (re_search_internal, re_search_2_stub, re_search_stub)
3270 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
3271 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
3272 (update_cur_sifted_state, check_dst_limits):
3273 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
3274 (check_subexp_limits, sift_states_bkref, merge_state_array):
3275 (check_subexp_matching_top, get_subexp, get_subexp_sub):
3276 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
3277 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3278 (expand_bkref_cache, check_node_accept_bytes):
3279 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
3280 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
3281 (acquire_init_state_context, check_halt_node_context):
3282 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
3283 (sift_states_backward, clean_state_log_if_needed):
3284 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
3285 (find_recover_state, transit_state_sb, transit_state_mb):
3286 (transit_state_bkref, build_trtable, match_ctx_clean):
3288 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
3289 to work around an assumption that REG_MISSING is negative.
3291 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
3292 (seek_collating_symbol_entry) [defined _LIBC]:
3293 (lookup_collation_sequence_value) [defined _LIBC]:
3294 (build_range_exp, build_collating_symbol) [defined _LIBC]:
3295 Use prototypes rather than old-style function definitions.
3296 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
3297 (transit_state_sb) [0]:
3298 (find_collation_sequence_value) [defined _LIBC]: Likewise.
3300 * regexec.c (re_search_internal): Simplify update of rm_so and
3303 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
3304 (optimize_subexps, lower_subexp):
3305 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
3306 since the signed shift might overflow. Use 1u<<31 instead.
3307 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
3308 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
3311 * regcomp.c (optimize_subexps, lower_subexp):
3312 Use CHAR_BIT rather than 8, for clarity.
3313 * regexec.c (check_dst_limits_calc_pos_1):
3314 (check_subexp_matching_top): Likewise.
3315 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3316 have to worry about portability issues when shifting it left.
3317 Remove no-longer-needed test for table_size > 0.
3318 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3319 in a word, as the resulting behavior is undefined.
3320 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3321 in one case, a <= should have been an <, and in another case the
3322 whole test was missing.
3323 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
3324 the standard name CHAR_BIT.
3325 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3326 this is not true on one's complement and signed-magnitude hosts.
3328 * regex_internal.h (re_sub_match_top_t): Remove unused member
3330 (struct re_dfa_t): Remove unused member states_alloc.
3331 * regcomp.c (init_dfa): Don't initialize unused members.
3333 2005-08-31 Bruno Haible <bruno@clisp.org>
3335 * strstr.c: Include <stddef.h>, for NULL.
3336 * strcasestr.c: Likewise.
3337 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3339 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
3341 * iconvme.h: Add prototype for iconv_alloc.
3343 2005-08-29 Simon Josefsson <jas@extundo.com>
3345 * iconvme.c: Fix errno.
3347 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
3349 * iconvme.c: Split iconv_string into iconv_alloc.
3351 2005-08-27 Jim Meyering <jim@meyering.net>
3353 * fopen-safer.c: Merge minor changes from coreutils.
3354 * dup-safer.c: Likewise.
3355 * fd-safer.c: Likewise.
3357 Merge from coreutils.
3358 * stdio--.h: New file.
3359 * stdlib--.h: New file.
3360 * mkstemp-safer.c: New file.
3362 GNU tar needs these.
3363 * pipe-safer.c: New file.
3364 * creat-safer.c: New file.
3365 * fcntl--.h (creat): Define to creat_safer.
3366 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3367 * unistd--.h (pipe): Define to pipe_safer.
3368 * unistd-safer.h: Declare pipe_safer.
3370 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3372 * regex_internal.h: Remove all references to
3373 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3375 (bitset_not, bitset_merge, bitset_not_merge):
3376 (bitset_mask, re_string_allocate, re_string_construct):
3377 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3378 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3379 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3380 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3381 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3382 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3383 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3384 (re_acquire_state_context):
3385 Remove unnecessary forward decls.
3386 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3387 Put __attribute at function definition,
3388 now that the function decl has been removed.
3389 * regex_internal.c (re_string_peek_byte_case):
3390 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3393 2005-08-26 Simon Josefsson <jas@extundo.com>
3395 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3396 Haible <bruno@clisp.org>.
3398 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3400 * regexec.c (set_regs): Don't alloca with an unbounded size.
3402 alloca modernization/simplification for regex.
3403 * regex.c: Remove portability cruft for alloca. This no longer
3404 needs to be at the start of the file, and can be moved into
3405 regex_internal.h and simplified.
3406 * regex_internal.h: Include <alloca.h>.
3407 (__libc_use_alloca) [!defined _LIBC]: New macro.
3408 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3409 now works outside glibc.
3411 2005-08-24 Simon Josefsson <jas@extundo.com>
3413 * getpass.c: Add WIN32 implementation. Conditionalize use of
3414 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
3415 GLIBC specific code.
3417 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3419 Make regex safe for g++. This fixes one real bug (an "err"
3420 that should have been "*err"). g++ problem reported by
3422 * regex_internal.h (re_calloc): New macro, consistent with
3423 re_malloc etc. All callers of calloc changed to use re_calloc.
3424 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3425 not int. All callers changed.
3426 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3427 just use an array of size MB_LEN_MAX.
3428 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3429 (find_recover_state): Change "err" to "*err"; this fixes what
3430 appears to be a real bug.
3431 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3434 2005-08-25 Jim Meyering <jim@meyering.net>
3436 * open-safer.c: Include <config.h>.
3437 Otherwise, we'd lose LARGEFILE support in any file using
3440 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3442 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3443 * regex.h (regerror): Likewise.
3445 * regex.c: Do not include <sys/types.h>, as POSIX no longer
3446 requires this. (The code never needed it.)
3448 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3449 All uses of recently-renamed identifiers changed to use the new,
3450 POSIX-compliant names. The code will build and run just fine
3451 without these changes, but it's better to eat our own dog food
3452 and use the standard-conforming names.
3454 * regex.h: Fix a multitude of POSIX name space violations.
3455 These changes have an effect only for programs that define
3456 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3457 do not change anything for programs compiled in the normal way.
3458 Also, there is no effect on the ABI.
3460 (_REGEX_SOURCE): New macro.
3461 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3462 defined and _GNU_SOURCE is not; this fixes a name space violation.
3464 Rename the following macros to obey POSIX requirements.
3465 The old names are still visible as macros if _REGEX_SOURCE is defined.
3466 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3467 RE_BACKSLASH_ESCAPE_IN_LISTS.
3468 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3469 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3470 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3471 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3472 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3473 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3474 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3475 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3476 (REG_INTERVALS): renamed from RE_INTERVALS.
3477 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3478 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3479 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3480 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3481 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3482 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3483 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3484 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3485 RE_UNMATCHED_RIGHT_PAREN_ORD.
3486 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3487 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3488 (REG_DEBUG): renamed from RE_DEBUG.
3489 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3490 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
3491 unusual, since we can't clash with the POSIX REG_ICASE.
3492 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3493 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3494 (REG_NO_SUB): renamed from RE_NO_SUB.
3495 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3496 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3497 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3498 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3499 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3500 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3501 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3502 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3503 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3504 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3505 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3506 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3507 RE_SYNTAX_POSIX_MINIMAL_BASIC.
3508 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3509 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3510 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3511 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
3512 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3513 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3514 (REG_FIXED): Renamed from REGS_FIXED.
3515 (REG_NREGS): Renamed from RE_NREGS.
3517 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3518 of other REG_* macros, since POSIX says the user is allowed to
3519 #undef these macros selectively.
3521 (reg_errcode_t): Update comment stating what other tables need
3524 Rename the following enum values to obey POSIX requirements.
3525 The old names are still visible as macros.
3526 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
3527 is not defined, since GNU is supposed to be a superset of POSIX as
3528 much as possible, and since we want reg_errcode_t to be a signed
3529 type for implementation consistency.
3530 (_REG_NOERROR): Renamed from REG_NOERROR.
3531 (_REG_NOMATCH): Renamed from REG_NOMATCH.
3532 (_REG_BADPAT): Renamed from REG_BADPAT.
3533 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3534 (_REG_ECTYPE): Renamed from REG_ECTYPE.
3535 (_REG_EESCAPE): Renamed from REG_EESCAPE.
3536 (_REG_ESUBREG): Renamed from REG_ESUBREG.
3537 (_REG_EBRACK): Renamed from REG_EBRACK.
3538 (_REG_EPAREN): Renamed from REG_EPAREN.
3539 (_REG_EBRACE): Renamed from REG_EBRACE.
3540 (_REG_BADBR): Renamed from REG_BADBR.
3541 (_REG_ERANGE): Renamed from REG_ERANGE.
3542 (_REG_ESPACE): Renamed from REG_ESPACE.
3543 (_REG_BADRPT): Renamed from REG_BADRPT.
3544 (_REG_EEND): Renamed from REG_EEND.
3545 (_REG_ESIZE): Renamed from REG_ESIZE.
3546 (_REG_ERPAREN): Renamed from REG_ERPAREN.
3547 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3548 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3549 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3550 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3552 (_REG_RE_NAME, _REG_RM_NAME): New macros.
3553 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
3554 changed. But support the old name if the new one is not defined
3555 and if _REGEX_SOURCE.
3557 Change the following member names in struct re_pattern_buffer.
3558 The old names are still supported if !_REGEX_SOURCE.
3559 The new names are always supported, regardless of _REGEX_SOURCE.
3560 (re_buffer): Renamed from buffer.
3561 (re_allocated): Renamed from allocated.
3562 (re_used): Renamed from used.
3563 (re_syntax): Renamed from syntax.
3564 (re_fastmap): Renamed from fastmap.
3565 (re_translate): Renamed from translate.
3566 (re_can_be_null): Renamed from can_be_null.
3567 (re_regs_allocated): Renamed from regs_allocated.
3568 (re_fastmap_accurate): Renamed from fastmap_accurate.
3569 (re_no_sub): Renamed from no_sub.
3570 (re_not_bol): Renamed from not_bol.
3571 (re_not_eol): Renamed from not_eol.
3572 (re_newline_anchor): Renamed from newline_anchor.
3574 Change the following member names in struct re_registers.
3575 The old names are still supported if !_REGEX_SOURCE.
3576 The new names are always supported, regardless of _REGEX_SOURCE.
3577 (rm_num_regs): Renamed from num_regs.
3578 (rm_start): Renamed from start.
3579 (rm_end): Renamed from end.
3581 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3582 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3583 Prepend __ to parameter names.
3585 Undo yesterday's changes.
3587 2005-08-24 Jim Meyering <jim@meyering.net>
3589 Sync from coreutils.
3590 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3592 2005-08-21 Bruno Haible <bruno@clisp.org>
3594 * lock.h: Add multiple inclusion guard.
3595 * tls.h: Add multiple inclusion guard.
3597 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
3599 * regex.h (REG_NOSYS)
3600 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3601 Define, since POSIX requires it as of 2001.
3602 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3603 New private symbol, used to keep the enum signed in all cases.
3604 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3605 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3607 * regex_internal.c (re_string_skip_chars, register_state):
3609 Remove forward decls; no longer needed now that we use prototypes.
3610 * regexec.c (acquire_init_state_context, check_halt_node_context):
3611 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3612 (clean_state_log_if_needed): Likewise.
3614 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3616 Fix problems reported by Sam Steingold in
3617 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3618 * regexec.c (sift_states_bkref): Fix portability bug: the code
3619 assumed that reg_errcode_t is a signed type, which is not
3620 necessarily true if _XOPEN_SOURCE is not defined.
3621 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3622 some compilers warn about it otherwise.
3624 2005-08-20 Jim Meyering <jim@meyering.net>
3626 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3627 of unused local, dfa.
3629 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
3631 * regcomp.c (create_initial_state): Remove duplicate decl.
3632 (init_word_char, create_initial_state, duplicate_node_closure):
3633 (fetch_token, peek_token_bracket, build_range_exp):
3634 (build_collating_symbol): Remove forward decls; no longer needed
3635 now that we use prototypes.
3638 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3639 (re_compile_fastmap_iter, regcomp, regerror, regfree):
3640 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3641 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3642 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3643 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3644 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3645 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3646 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3647 (build_range_exp, build_collating_symbol, parse_bracket_exp):
3648 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3649 (build_charclass, build_charclass_op, fetch_number, create_tree):
3650 (create_token_tree, mark_opt_subexp, duplicate_tree):
3651 Use prototypes rather than old-style definitions.
3654 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3655 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3656 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3657 (re_string_reconstruct, re_string_peek_byte_case):
3658 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3659 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3660 (re_node_set_init_copy, re_node_set_add_intersect):
3661 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3662 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3663 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3664 (re_acquire_state, re_acquire_state_context, register_state):
3665 (create_ci_newstate, create_cd_newstate, free_state):
3667 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3668 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3669 (re_search_internal, prune_impossible_nodes):
3670 (acquire_init_state_context, check_matching, static):
3671 (check_halt_node_context, check_halt_state_context, proceed_next_node):
3672 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3673 (update_regs, sift_states_backward, build_sifted_states):
3674 (clean_state_log_if_needed, merge_state_array):
3675 (update_cur_sifted_state, add_epsilon_src_nodes):
3676 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3677 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3678 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3679 (find_recover_state, check_subexp_matching_top, transit_state_mb):
3680 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3681 (check_arrival, check_arrival_add_next_nodes):
3682 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3683 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3684 (check_node_accept_bytes, check_node_accept, extend_buffers):
3685 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3686 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3691 (re_string_allocate, re_string_construct, re_string_reconstruct):
3692 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3693 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3694 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3695 (re_string_context_at, re_string_peek_byte_case):
3696 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3697 is defined, since we now use prototypes always.
3699 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
3700 C89 or better. All uses removed.
3702 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3704 * regex_internal.c (re_acquire_state, re_acquire_state_context)
3705 [defined lint]: Suppress bogus uninitialized-variable warnings.
3707 * regcomp.c (duplicate_node): Return new index, not an error code,
3708 and let the caller return REG_ESPACE if out of space. This
3709 removes an uninitialied-variable warning with GCC 4.0.1, and also
3710 avoids taking the address of a local variable. All callers
3713 2005-08-19 Jim Meyering <jim@meyering.net>
3715 * regexec.c (proceed_next_node): Redo local variables to
3716 avoid GCC shadowing warnings.
3718 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
3720 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3721 (re_node_set_insert_last, re_dfa_add_node):
3722 Rename local variables to avoid GCC shadowing warnings.
3724 2005-08-18 Bruno Haible <bruno@clisp.org>
3726 * strstr.c (strstr): Fix return value in multibyte case.
3727 * strcasestr.c (strcasestr): Likewise.
3729 2005-08-17 Jim Meyering <jim@meyering.net>
3731 Make the %s format (seconds since the epoch) work for a negative
3732 number and when used with a zero-padded field width, e.g. %015s.
3734 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3735 label so that it precedes the code to set `digits'. Otherwise,
3736 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
3737 print `00-22'. Now, it prints `-0022', as it should.
3739 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
3741 * regex.h: Remove useless space-before-tab. From coreutils.
3743 2005-08-17 Bruno Haible <bruno@clisp.org>
3745 * strcasestr.h: New file.
3746 * strcasestr.c: New file.
3748 2005-08-17 Bruno Haible <bruno@clisp.org>
3750 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3751 * strstr.c: Completely rewritten, with multibyte locale support.
3753 2005-08-17 Bruno Haible <bruno@clisp.org>
3755 * strcasecmp.c: Use mbuiter.h.
3757 2005-08-17 Bruno Haible <bruno@clisp.org>
3759 * mbuiter.h: New file.
3761 2005-08-16 Bruno Haible <bruno@clisp.org>
3763 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3765 (mbi_avail, mbi_advance): Let the iteration end before the terminating
3766 NUL byte, not after it.
3768 2005-08-16 Bruno Haible <bruno@clisp.org>
3770 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3771 the valid ones. Makes the comparison operations transitive:
3772 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3773 * strcasecmp.c (strcasecmp): Use mb_casecmp.
3775 2005-08-16 Bruno Haible <bruno@clisp.org>
3777 * strcase.h (strcasecmp): Add note in comments.
3778 * strncasecmp.c: Use code from strcasecmp.c.
3779 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3780 (strcasecmp): Work correctly in multibyte locales.
3782 2005-08-16 Bruno Haible <bruno@clisp.org>
3784 * strnlen1.h: New file.
3785 * strnlen1.c: New file.
3787 2005-08-16 Bruno Haible <bruno@clisp.org>
3789 * mbfile.h: New file.
3791 2005-08-16 Bruno Haible <bruno@clisp.org>
3793 * mbiter.h: New file.
3795 2005-08-16 Bruno Haible <bruno@clisp.org>
3797 * mbchar.h: New file.
3798 * mbchar.c: New file.
3800 2005-08-16 Bruno Haible <bruno@clisp.org>
3802 * tls.h: New file, from GNU gettext.
3803 * tls.c: New file, from GNU gettext.
3805 2005-08-15 Bruno Haible <bruno@clisp.org>
3807 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3810 2005-08-14 Jim Meyering <jim@meyering.net>
3812 Sync from coreutils.
3814 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3815 Use the hash-table-based cycle-detection code not just when
3816 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3817 Reported by James Youngman in
3818 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3819 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3820 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3821 This lets us compile with -DFTS_DEBUG, once again.
3822 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3823 * fts.c (fd_safer): Remove decl.
3824 Include fcntl--.h rather than unistd-safer.h
3825 (fts_safe_changedir): Don't call fd_safer; no longer needed
3826 now that we include fcntl--.h.
3828 2005-08-11 Simon Josefsson <jas@extundo.com>
3830 * readline.h, readline.c: New file.
3832 2005-08-11 Bruno Haible <bruno@clisp.org>
3834 * strnlen.h (strnlen): Change parameter name to match comment.
3836 2005-08-10 Simon Josefsson <jas@extundo.com>
3838 * strndup.c: Use strnlen.h.
3840 * strnlen.h: New file.
3842 2005-08-02 Simon Josefsson <jas@extundo.com>
3844 * getline.h, getline.c: Rewrite.
3846 * getdelim.h, getdelim.c: New files, ported from glibc.
3848 2005-07-31 Bruno Haible <bruno@clisp.org>
3850 * lock.h (gl_lock_initializer): New macro.
3851 (gl_lock_define_initialized): Use it.
3852 (gl_rwlock_initializer): New macro.
3853 (gl_rwlock_define_initialized): Use it.
3854 (gl_recursive_lock_initializer): New macro.
3855 (gl_recursive_lock_define_initialized): Use it.
3857 2005-07-26 Bruno Haible <bruno@clisp.org>
3859 * lock.h: Update from GNU gettext.
3860 * lock.c: Update from GNU gettext.
3862 2005-07-18 Bruno Haible <bruno@clisp.org>
3864 * lock.h (gl_once_t): New type.
3865 (gl_once_define, gl_once): New macros.
3866 * lock.c (fresh_once): New variable.
3867 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3870 2005-07-18 Simon Josefsson <jas@extundo.com>
3872 * check-version.c (check_version): Accept identical versions too.
3874 2005-07-18 Bruno Haible <bruno@clisp.org>
3876 * lock.h: New file, from GNU gettext.
3877 * lock.c: New file, from GNU gettext.
3879 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
3881 * quotearg.c: Add translator comment suggested by Bruno Haible,
3882 with a minor change.
3884 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
3886 * version-etc-fsf.c (version_etc_copyright): Parameterize the
3887 copyright symbol and the year.
3888 * version-etc.c (COPYRIGHT_YEAR): New constant.
3889 (version_etc_va): Use parameterized copyright notice.
3890 Reword to conform to the current GNU coding standards.
3892 2005-07-11 Simon Josefsson <jas@extundo.com>
3894 * size_max.h: New file.
3896 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
3898 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3901 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
3902 and Paul Eggert <eggert@cs.ucla.edu>
3904 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3905 in wint_t, not wchar_t. Remove now-unnecessary cast.
3907 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
3909 * regex.c, regex.h: Sync from libc.
3910 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3911 New files, synced from libc, except that regex_internal.h
3912 currently has a small porting fix.
3914 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
3916 Remove the dependency of the strftime module on the tzset module.
3917 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3918 Copy the input structure, to work around some of the bug with
3919 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
3920 Solaris releases, you should also use the tzset module, but we won't
3921 require it as a dependency any more since we don't want LGPLed code
3922 to depend on GPLed code.
3924 2005-07-02 Jim Meyering <jim@meyering.net>
3926 * backupfile.c (backup_args): Change a `0' to NULL.
3928 2005-07-01 Jim Meyering <jim@meyering.net>
3930 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3931 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3932 * save-cwd.c, tempname.c:
3933 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3934 and don't include <sys/file.h>).
3936 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
3938 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3939 declares only 'struct timespec;' (!).
3941 2005-06-29 Jim Meyering <jim@meyering.net>
3943 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3944 type name. Use the variable name instead.
3945 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3947 2005-06-28 Simon Josefsson <jas@extundo.com>
3949 * check-version.h, check-version.c: New files.
3951 2005-06-28 Simon Josefsson <jas@extundo.com>
3953 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
3954 collision with global variable. Better indentation. Don't
3955 increment buffer pointer beyond buffer end. Based on comments
3956 from Paul Eggert <eggert@cs.ucla.edu>.
3960 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
3962 * canon-host.c (canon-host): Append trailing "," to 0 in
3963 initializer of struct addrinfo, as an indication that we don't
3964 care how many members the structure has.
3966 2005-06-24 Derek Price <derek@ximbiot.com>
3967 and Bruno Haible <bruno@clisp.org>
3969 Remove stat module & update lstat.
3970 * stat.c: Remove this file...
3971 (slash_aware_lstat): ...moving this content and its support...
3972 * lstat.c (rpl_lstat): ...into here.
3973 * lstat.h: New file.
3975 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
3977 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
3978 (ranged_convert): Don't save conversion in a temporary struct.
3979 This causes a warning with GCC 4.0.0, and anyway in the typical
3980 case it's not worth the extra 100 bytes or so of code.
3981 (ranged_convert, __mktime_internal): When calling a function via a
3982 pointer P, use P () rather than (*P) (), as we now assume C89 or
3985 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
3987 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3988 "who -r" failed to give output. Problem reported by Tim Waugh.
3990 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3991 (xcalloc): Use it to avoid needless tests.
3992 Problem reported by Jim Meyering.
3994 2005-06-16 Jim Meyering <jim@meyering.net>
3996 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3997 when either N or S is zero.
3999 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4001 * argp.h (__option_is_short): Check upper limit of
4002 __key. Isprint() requires its argument to have the value
4003 of an unsigned char or EOF.
4005 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
4007 * fnmatch.c (fnmatch): If there is an encoding error in a
4008 multibyte string or pattern, fall back on unibyte matching.
4009 Problem reported by James Youngman.
4011 2005-06-08 Bruno Haible <bruno@clisp.org>
4013 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
4016 2005-06-08 Bruno Haible <bruno@clisp.org>
4018 * csharpcomp.h: New file, from GNU gettext.
4019 * csharpcomp.c: New file, from GNU gettext.
4020 * csharpcomp.sh.in: New file, from GNU gettext.
4022 2005-06-07 Derek Price <derek@ximbiot.com>
4025 * glob_.h: Indent nested #ifdef.
4027 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
4029 Sync from coreutils.
4030 Use "file name" when talking about file names, instead of "filename"
4031 or "path", as per the GNU coding standards.
4032 * mkdir-p.c: Renamed from makepath.c.
4033 (make_dir_parents): Renamed from make_path. All callers changed.
4034 * mkdir-p.h: Likewise. All includers changed.
4035 * filenamecat.c: Renamed from path-concat.c.
4036 (file_name_concat): Renamed from path_concat. All callers changed.
4037 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
4038 * filenamecat.h: Likewise. All includers changed.
4039 * acl.c: Don't use "path" or "filename" to mean "file name"
4040 in comments or local variable names.
4041 * basename.c: Likewise.
4042 * canonicalize.c, canonicalize.h: Likewise.
4043 * dirname.c, dirname.h: Likewise.
4044 * euidaccess.c: Likewise.
4045 * exclude.c: Likewise
4046 * fnmatch_.h, fnmatch_loop.c: Likewise.
4047 * fsusage.c, fsuage.h: Likewise.
4048 * fts.c, fts_.h: Likewise.
4049 * getcwd.c: Likewise.
4050 * getloadavg.c: Likewise.
4051 * mkstemp.c: Likewise.
4052 * mountlist.c, mountlist.h: Likewise.
4053 * openat.c, openat.h: Likewise.
4054 * readlink-stub.c: Likewise.
4055 * readutmp.c, readutmp.h: Likewise.
4056 * rename.c: Likewise.
4057 * rmdir.c: Likewise.
4059 * savedir.c: Likewise.
4060 * stripslash.c: Likewise.
4061 * tempname.c: Likewise.
4062 * xreadlink.c: Likewise.
4063 * exclude.c (excluded_file_name): Renamed from excluded_filename.
4065 * exclude.h: Likewise.
4067 * euidaccess.c (getuid, getgid, getuid, getegid)
4068 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4069 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
4070 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4071 * pathmax.h: Include <limits.h> unconditionally, since other
4072 files have been getting away with it for years (MORE/BSD 4.3
4074 * userspec.c (getpwnam, getgrnam, getgrgid)
4075 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
4077 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
4078 Define to 256, not 255, as per modern POSIX.
4080 2005-06-01 Bruno Haible <bruno@clisp.org>
4082 * csharpexec.h: New file, from GNU gettext.
4083 * csharpexec.c: New file, from GNU gettext.
4084 * csharpexec.sh.in: New file, from GNU gettext.
4086 2005-05-31 Derek Price <derek@ximbiot.com>
4087 Paul Eggert <eggert@cs.ucla.edu>
4090 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
4092 2005-05-29 Derek Price <derek@ximbiot.com>
4093 Paul Eggert <eggert@cs.ucla.edu>
4095 * glob_.h, glob.c: New files.
4097 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4099 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
4101 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
4102 the configuration hassle isn't worth it.
4103 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
4104 (LONGEST_MODIFIER, PRIuMAX): Remove.
4106 2005-05-27 Bruno Haible <bruno@clisp.org>
4108 * getlogin_r.h: Remove second include of <stddef.h>.
4110 2005-05-25 Bruno Haible <bruno@clisp.org>
4111 Derek Price <derek@ximbiot.com>
4113 * getlogin_r.h: Simplify API documentation.
4115 2005-05-25 Derek Price <derek@ximbiot.com>
4116 Paul Eggert <eggert@cs.ucla.edu>
4118 * getlogin_r.c, getlogin_r.h: New files.
4120 2005-05-22 Bruno Haible <bruno@clisp.org>
4122 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
4123 Also include <sys/param.h> if it defines MIN, MAX.
4124 Based on a patch by Derek Price <derek@ximbiot.com>.
4126 2005-05-22 Bruno Haible <bruno@clisp.org>
4128 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
4129 (INT64_MIN): Fix definition.
4130 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4132 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
4133 NEED_SIGNED_INT_TYPES.
4135 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
4136 HAVE_SYSTEM_INTTYPES.
4138 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4140 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
4141 so that unistd-safer.h (GPL'ed code) need not be included.
4143 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
4146 * fts.c: Don't include "cycle-check.h" or "hash.h".
4147 (setup_dir, free_dir): New functions.
4148 (enter_dir, leave_dir): Define trivial
4149 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
4150 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
4151 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
4152 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
4153 Move to fts-cycle.c.
4154 (fts_open): Use setup_dir.
4155 (fts_close): Use free_dir.
4156 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
4157 This adds a label and some gotos, but the alternatives were messier.
4158 Check for memory allocation failure when entering a dir.
4159 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
4160 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
4161 (FTS): New member fts_cycle, that is a union that contains the
4162 old active_dir_ht and cycle_state. All uses changed to mention
4163 fts_cycle.ht and fts_cycle.state.
4164 * fts-cycle.c: New file, containing GPL'ed code migrated out of
4165 fts.c, with the following changes:
4166 (setup_dir, free_dir): New functions.
4167 (enter_dir): Now returns bool. Return true if successful, false
4168 if memory exhausted. All callers changed.
4169 Do not bother partly cleaning up on
4170 memory allocation failure; that is free_dir's job.
4171 However, free ad if hash_insert fails, to avoid memory leak.
4172 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
4173 fts->fts_options to see which union member to use.
4175 2005-05-20 Jim Meyering <jim@meyering.net>
4177 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
4178 Now a macro, to pacify GCC.
4180 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
4182 * chown.c (rpl_chown): Return -1 on failure.
4184 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
4186 * canonicalize.c: Include canonicalize.h first, to test interface.
4187 Include <stddef.h> unconditionally, since we assume C89 now.
4188 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
4189 * fts.c: Include fts_.h first, to check interface.
4190 Do not include intprops.h; no longer needed.
4191 Include cycle-check.h and hash.h, since fts_.h no longer does.
4192 Remove unnecessary casts of closedir to void.
4193 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
4194 decide whether to decrement nlinks.
4195 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
4196 (FTS): Use struct hash_table * instead of Hash_table, so that
4197 we no longer need to include hash.h here.
4199 2005-05-17 Jim Meyering <jim@meyering.net>
4201 * fts.c, fts_.h: New files, from coreutils.
4203 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
4205 Sync from coreutils.
4206 * unlinkdir.c, unlinkdir.h: New files.
4207 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
4208 regex.h, unlocked-io.h, xtime.h:
4209 White space changes only.
4210 * makepath.c (make_path): Port to hosts where leading "//" is special.
4211 * yesno.c: Include getline.h, not ctype.h.
4212 (yesno): Don't remove leading white space; POSIX doesn't allow it.
4213 Use getline to remove arbitrary restriction on response length.
4215 2005-05-13 Bruno Haible <bruno@clisp.org>
4217 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
4218 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
4219 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
4220 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
4221 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
4222 Add support for 64-bit integers in the MSVC compiler.
4224 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4226 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
4227 Change the initial comment to refer to GPL, not LGPL.
4228 gnulib-tool will change it to LGPL as needed.
4230 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
4231 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
4232 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
4233 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
4234 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
4235 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
4236 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
4237 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
4238 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
4239 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
4240 concatpath.c, config.charset, copy-file.c, copy-file.h,
4241 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
4242 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
4243 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
4244 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
4245 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
4246 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
4247 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
4248 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
4249 full-read.c, full-read.h, full-write.c, full-write.h,
4250 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
4251 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
4252 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
4253 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
4254 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
4255 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
4256 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
4257 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
4258 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
4259 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
4260 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
4261 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
4262 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
4263 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
4264 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
4265 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
4266 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
4267 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
4268 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
4269 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
4270 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
4271 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
4272 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
4273 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
4274 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
4275 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
4276 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
4277 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
4278 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
4279 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
4280 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
4281 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
4282 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
4283 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
4284 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
4285 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
4286 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
4287 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
4288 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
4289 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
4290 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
4291 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
4292 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
4293 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
4294 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
4295 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
4296 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
4297 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
4298 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
4299 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
4300 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
4301 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
4302 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
4303 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
4304 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
4305 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
4306 Update FSF postal mail address.
4308 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4310 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
4311 specified in ai_socktype. Fix invalid ai_protocol
4312 check. ai_protocol is usually set to 0 or depending on
4313 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
4314 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
4315 ai_socktype / ai_protocol in the returned addrinfo structure.
4317 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4318 Bruno Haible <bruno@clisp.org>
4320 * inet_ntop.h: New file.
4321 * inet_ntop.c: New file, from glibc with modifications.
4323 2005-05-08 Jim Meyering <jim@meyering.net>
4325 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4327 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4329 Merge from coreutils. Among other things,
4330 add bulletproofing for cases where stdin, stdout, or stderr are closed.
4331 * fd-safer.c: New file.
4332 * fcntl-safer.h, open-safer.c: Remove.
4333 * chdir-long.c: Fix comment "fetish" -> "coreutils".
4334 * dup-safer.c: Include unistd-safer.h first.
4335 Don't include errno.h.
4336 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4337 * file-type.h: Don't assume invoker included sys/stat.h first.
4338 * file-type.c: Rely on file-type.h change.
4339 * getloadavg.c: Include unistd-safer.h.
4340 (getloadavg): Use safer open.
4341 * getusershell.c: Include "stdio-safer.h".
4342 (getusershell): Use safer fopen.
4343 * long-options.c (long_options): Use NULL rather than 0.
4344 * modechange.h (mode_free): Remove; all callers changed to invoke
4346 * modechange.c: Likewise.
4347 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4348 (MODE_DONE): New constant.
4349 (struct mode_change): Remove 'next' member.
4350 (make_node_op_equals): New function; like the old one of the
4351 same name, except it allocates an array.
4352 (mode_compile, mode_create_from_ref): Use it.
4353 (mode_compile): Allocate result as an array, not a linked list.
4354 Parse octal string ourself, so that we catch mistakes like "+0".
4355 (mode_adjust): Arg is an array, not a linked list.
4356 * modechange.c: Include stat-macros.h, xalloc.h.
4357 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4358 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4359 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4360 Remove. This is now stat-macros.h's job.
4361 (talloc): Remove. All callers replaced by xalloc, so that
4362 our invokers don't have to worry about reporting memory failures.
4363 (make_node_op_equals): Remove.
4364 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4366 (struct mode_change): Moved here from modechange.h.
4367 (mode_append_entry): Remove.
4368 (mode_compile): Remove MASKED_OPS arg, since it encouraged
4369 apps to have incorrect behavior. Use simpler algorithm for head
4370 and tail. Don't futz with umask; that's now the job of mode_adjust.
4371 Detect more invalid usages rather than having somewhat-random behavior.
4372 Don't insert an "a=" action, as that leads to incorrect behavior.
4373 (mode_compile, mode_create_from_ref): Return NULL on error instead
4374 of an enum, since now there's only one way to have an error. All
4376 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4377 at the correct time. Simplify calculation of "+u" and its ilk.
4378 Don't mishandle "+X".
4379 (mode_free): Remove "register" and localize decls.
4380 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4381 (struct mode_change): Move to modechange.c; callers don't
4382 need to see this stuff.
4383 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4384 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4385 (mode_change, mode_adjust): Reflect the new signatures noted above.
4386 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4387 that might redefine system include files.
4388 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4389 (my_usleep): Use NULL rather than (void *) 0.
4390 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4391 Use siginterrupt to specify that system calls should be interrupted.
4392 (rpl_nanosleep): Move initialization of suspended closer to call of
4394 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
4395 * readutmp.c: Likewise. Include signal.h, stdbool.h.
4396 (desirable_utmp_entry): New function.
4397 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4398 using x2nrealloc, to simplify logic.
4399 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4400 size calculation. Do not assume utmp file is a regular file.
4401 * readutmp.h (UT_PID): Moved here from ../src/who.c.
4402 (READ_UTMP_CHECK_PIDS): New constant.
4403 * save-cwd.c: Include unistd-safer.h.
4404 (save_cwd): Use fd_safer.
4405 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4406 [!_LIBC] Include "stat-macros.h" instead.
4407 * unistd-safer.h (fd_safer): New decl.
4409 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
4411 * byteswap_.h: New file.
4413 2005-04-25 Albert Chin <china@thewrittenword.com>
4415 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4418 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4420 * getdate.y (zone): Allow relunit_snumber after tZONE, so
4421 that "UTC +1 second" continues to work. Problem reported
4423 (relunit_snumber): New rule.
4426 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4428 * getdate.y (universal_time_zone_table): New constant.
4429 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4430 universal_time_zone_table.
4431 (lookup_zone): Prefer universal_time_zone_table to
4432 local_time_zone_table, so that "GMT" time stamps are allowed in
4433 London during the summer. Problem reported by Ian Abbott.
4435 2005-04-12 Jim Meyering <jim@meyering.net>
4437 * human.c (humblock): Set *options even when returning due to
4438 xstrtoumax conversion failure. Thanks to a used-uninitialized
4441 2005-04-09 Jim Meyering <jim@meyering.net>
4443 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4444 -Wuninitialized: initialize tm0.tm_year.
4446 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
4448 * getdate.y (parser_control): rels_seen is now a boolean, not a
4449 count, since there's no maximum. All uses changed.
4450 Add member dsts_seen.
4451 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4453 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4454 Use pc_rels_seen to decide whther a date is absolute.
4456 * getdate.y (number): Don't overwrite year.
4457 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4460 2005-04-02 Simon Josefsson <jas@extundo.com>
4462 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4463 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4465 2005-03-27 Jim Meyering <jim@meyering.net>
4467 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4469 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
4471 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4472 "one's complement" -> "ones' complement" in comment, as per Knuth.
4473 "value of type" -> "type or expression" in comment.
4474 * mktime.c, strftime.c: Propagate intprops.h comment nits.
4476 2005-03-26 Jim Meyering <jim@meyering.net>
4479 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4480 Correct typos: s/or/of/.
4482 2005-03-23 Jim Meyering <jim@meyering.net>
4484 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4486 2005-03-21 Jim Meyering <jim@meyering.net>
4488 Changes imported from coreutils.
4490 * cycle-check.c: Don't include xalloc.h.
4492 * path-concat.c: Don't include assert.h.
4493 (path_concat): Remove assertion that would have triggered
4494 for ABASE starting with more than one slash.
4495 Reported by Andreas Schwab.
4497 * path-concat.c (path_concat): Set *BASE_IN_RESULT
4498 properly when ABASE is an absolute file name.
4499 Correct the description of this function.
4501 Add an assertion and a test driver.
4502 This fixes a bug introduced on 2004-07-02.
4503 Andreas Schwab reported the resulting failure of cp --parents:
4504 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4506 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4508 * strftime.c (my_strftime): If the underlying strftime returns 0
4509 (which shouldn't happen), generate nothing instead of returning 0
4510 immediately, so that nstrftime (NULL, ...) doesn't return 0.
4512 2005-03-16 Bruno Haible <bruno@clisp.org>
4514 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4516 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4518 * strftime.c (my_strftime): Prepend space to format so that we can
4519 reliably distinguish strftime failure from empty output on POSIX
4522 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
4524 * iconvme.c (SIZE_MAX): New macro, if not already defined.
4525 (iconv_string): Don't guess a size-zero buffer, as that might cause
4526 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
4527 result would be 'too large', where 'too large' is (heuristically)
4528 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4529 overflow concerns. This will prevent some unwanted malloc failures
4530 when the inputs are very large.
4532 2005-03-15 Bruno Haible <bruno@clisp.org>
4534 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4537 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4540 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4542 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
4544 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4545 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4547 * strtol.c: Likewise.
4549 2005-03-14 Simon Josefsson <jas@extundo.com>
4551 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4554 2005-03-14 Jim Meyering <jim@meyering.net>
4556 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4557 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4558 to be nonzero so that we (and caller) can detect the difference
4559 between a valid zero-length expansion and an error return, even
4560 when the underlying strftime fails before writing anything into
4563 2005-03-10 Jim Meyering <jim@meyering.net>
4565 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4566 so that this module works on systems without fchdir.
4568 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
4570 Factor int-properties macros into a single file, except for
4571 glibc-related files.
4572 * intprops.h: New file.
4573 * getloadavg.c: Include it instead of limits.h.
4574 (INT_STRLEN_BOUND): Remove.
4575 * human.c: Include intprops.h.
4576 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4577 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4578 * inttostr.h: Include intprops.h instead of limits.h.
4579 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4580 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4581 for consistency with intprops.h.
4582 (time_t_is_integer, twos_complement_arithmetic): Use them.
4583 * sig2str.h: Include <signal.h>, intprops.h.
4584 (INT_STRLEN_BOUND): Remove.
4585 * strftime.c (TYPE_SIGNED): Remove.
4586 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4587 * strtol.c: Adjust comments to match intprops.h.
4588 * userspec.c: Include intprops.h.
4589 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4590 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4591 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4592 instead of rolling our own expressions.
4593 * xstrtol.c: Include xstrtol.h first, to test interface.
4595 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
4597 (my_strftime): Do not mishandle years close to INT_MAX, by doing
4598 the right thing even if adding 1900 would overflow. Similarly
4599 for tm_mon + 1 and tm_yday + 1.
4600 Make %Y always equivalent to %C%y, and similarly for %G and %g.
4601 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4602 (DO_SIGNED_NUMBER): New macro.
4603 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4605 2005-03-07 Bruno Haible <bruno@clisp.org>
4607 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4609 2005-03-03 Derek R. Price <derek@ximbiot.com>
4610 Bruno Haible <bruno@clisp.org>
4612 * pagealign_alloc.h: New file.
4613 * pagealign_alloc.c: New file.
4615 2005-01-28 Bruno Haible <bruno@clisp.org>
4617 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4620 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
4622 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4623 The workaround isn't strictly needed for POSIX conformance, and
4624 it's too much of a pain to configure and maintain. We'll ask
4625 people to fix their kernels instead.
4626 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4627 (NANOSLEEP_BUG_WORKAROUND): Remove.
4628 (xnanosleep): Remove the workaround.
4630 2005-02-12 Bruno Haible <bruno@clisp.org>
4632 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4634 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
4636 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4637 * timespec.h (gettime): Return void, since it always
4638 succeeds now. All uses changed.
4639 * gettime.c (gettime) Likewise.
4640 [HAVE_NANOTIME]: Prefer nanotime.
4641 Assume gettimeofday succeeds, as POSIX requires.
4642 Assime time () succeeds, since other code already does.
4643 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4644 (timespec_subtract): Remove.
4645 (NANOSLEEP_BUG_WORKAROUND): New constant.
4646 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4647 things considerably. Use it only on GNU/Linux hosts, since the
4648 workaround shouldn't be needed elsewhere.
4650 2005-02-24 Bruno Haible <bruno@clisp.org>
4652 * gettext.h: Update from GNU gettext 0.14.2.
4654 2005-02-24 Bruno Haible <bruno@clisp.org>
4656 * localcharset.c: Update from GNU gettext 0.14.2.
4657 * config.charset: Update from GNU gettext 0.14.2.
4659 2005-02-22 Simon Josefsson <jas@extundo.com>
4661 * iconvme.h, iconvme.c: New files, from libc.
4663 2005-02-20 Neil Conway <neilc@samurai.com>
4665 * xgethostname.c (xgethostname): Check for ENOMEM, which is
4666 returned by OSX/Darwin if the specified buffer is not large
4667 enough for the hostname.
4669 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
4671 * memrchr.h: New file.
4672 * chdir-long.c: Include it.
4673 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4674 Don't bother including stddef.h.
4676 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4678 * argp-help.c (__argp_help): Create a fake struct argp_state and
4679 pass it to _help, otherwise the latter coredumps trying to
4680 dereference state.root_argp.
4682 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
4684 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4686 Include <sys/types.h>, for dev_t.
4687 (ME_DUMMY, ME_REMOTE): Move from here....
4688 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4689 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
4691 Include mountlist.h first, to test the interface.
4693 2005-01-29 Bruno Haible <bruno@clisp.org>
4695 * progname.c (program_name): Initialize.
4696 Needed when linking statically on MacOS X.
4698 2005-01-28 Bruno Haible <bruno@clisp.org>
4700 * javacomp.sh.in: New file, from GNU gettext.
4701 * javacomp.h: New file, from GNU gettext.
4702 * javacomp.c: New file, from GNU gettext.
4704 2005-01-26 Bruno Haible <bruno@clisp.org>
4706 * javaexec.sh.in: New file, from GNU gettext.
4707 * javaexec.h: New file, from GNU gettext.
4708 * javaexec.c: New file, from GNU gettext.
4710 2005-01-26 Simon Josefsson <jas@extundo.com>
4712 * gai_strerror.c: Use GPL in header.
4714 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4716 * argp-help.c (hol_entry_help): Avoid using non-constant
4717 initializers for struct pentry_state.
4718 (__argp_error): Check return value of __asprintf
4719 (__argp_failure): Translate error message
4721 * argp-parse.c: Removed braces around the expansion of N_()
4723 2005-01-21 Jim Meyering <jim@meyering.net>
4725 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4726 same value as for Solaris 9.
4728 * chdir-long.c (chdir_long): Rewrite to remove limitation on
4729 component length. This included changing the parameter to be
4730 of type `char *' rather than `char const *'.
4731 * chdir-long.h (chdir_long): Update prototype.
4733 * openat.c (fdopendir, fstatat): New functions.
4734 * openat.h: Include headers required for use of DIR and struct stat.
4735 [AT_SYMLINK_NOFOLLOW]: Define.
4736 (fdopendir, fstatat): Add prototypes.
4738 2005-01-21 Bruno Haible <bruno@clisp.org>
4740 * classpath.h: New file, from GNU gettext.
4741 * classpath.c: New file, from GNU gettext.
4743 2005-01-20 Simon Josefsson <jas@extundo.com>
4745 * version-etc-fsf.c: New file, with version_etc_copyright.
4746 * version-etc.c: Remove version_etc_copyright.
4747 * version-etc.h (version_etc_copyright): Use [] instead of * in
4748 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4750 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
4752 * save-cwd.c (save_cwd): Remove code to support the case
4753 where fchdir is missing or flaky.
4755 2005-01-20 Simon Josefsson <jas@extundo.com>
4757 * base64.h (isbase64): Add.
4759 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4760 using a unsigned prototype, don't inline.
4761 (base64_decode): Use it.
4763 2005-01-19 Bruno Haible <bruno@clisp.org>
4765 * sh-quote.h: New file, from GNU gettext.
4766 * sh-quote.c: New file, from GNU gettext.
4768 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
4770 Merge changes from coreutils, as described below in several
4771 changelogs dated today.
4773 * save-cwd.c: Include "save-cwd.h" before other include files.
4774 (O_DIRECTORY): Remove; not needed here, since "." must be
4775 a directory. All uses removed.
4776 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
4777 universal on Suns, and we also need to test for IRIX.
4778 Revamp code to use 'if' rather than '#if'.
4779 Avoid unnecessary comparison of cwd->desc to 0.
4781 * utimens.c (futimens): Robustify the previous patch, by checking
4782 for known valid error numbers rather than observed invalid ones.
4784 2005-01-18 Jim Meyering <jim@meyering.net>
4786 * version-etc.c (version_etc_copyright): Update copyright date.
4788 * utimens.c (futimens): Account for the fact that futimes
4789 can also fail with errno == ENOSYS or errno == ENOENT.
4790 Patch from Dmitry V. Levin.
4792 Change the name of the robust chdir function from chdir to chdir_long.
4793 * save-cwd.c: Include chdir-long.h rather than chdir.h.
4794 (restore_cwd): Use chdir_long, not chdir.
4795 * chdir-long.c: Renamed from chdir.c.
4796 * chdir-long.h: Renamed from chdir.h.
4797 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4800 2005-01-18 Bob Proulx <bob@proulx.com>
4802 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4803 offsetof() macro construct to avoid compile failure with native HP-UX
4804 11.0 ANSI C compiler.
4806 2005-01-06 Bruno Haible <bruno@clisp.org>
4808 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4809 because stpncpy.m4 takes care of it.
4811 2004-01-24 Bruno Haible <bruno@clisp.org>
4813 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4815 2003-10-09 Bruno Haible <bruno@clisp.org>
4817 * progreloc.c: Include xalloc.h instead of xmalloc.h.
4819 2005-01-06 Bruno Haible <bruno@clisp.org>
4821 * fwriteerror.h (fwriteerror): Change specification to include fclose.
4822 * fwriteerror.c: Include <stdbool.h>.
4823 (fwriteerror): At the end, close the file stream. Record whether
4824 stdout was already closed.
4826 2004-05-27 Bruno Haible <bruno@clisp.org>
4828 * execute.c (environ): Declare if needed.
4829 * pipe.c (environ): Likewise.
4830 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4832 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
4834 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4835 definitions to be after all include files, to avoid collisions.
4836 Problem reported by Bob Proulx.
4838 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
4840 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4841 not needed. This removes a dependency on the gettext module.
4842 [defined _LIBC]: Do not include <libintl.h>; not needed.
4844 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
4846 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4849 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
4851 * argp-parse.c: Include <stddef.h>.
4852 (alignof, alignto): New macros.
4853 (parser_init): Don't assume that void * is aligned sufficiently
4856 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4857 need to extend the stack.
4858 (YYINITDEPTH): New macro, so that the initial stack isn't overly
4861 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4863 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4865 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4867 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4868 Remove now-obsolete comment about AIX.
4869 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4870 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4871 (YYMAXDEPTH): New macro.
4873 2004-12-18 Bruno Haible <bruno@clisp.org>
4875 * fatal-signal.c (fatal_signals): Make non-const.
4876 (init_fatal_signals): New function.
4877 (uninstall_handlers, install_handlers): Ignore signals that were set to
4879 (at_fatal_signal): Call init_fatal_signals.
4880 (init_fatal_signal_set): Likewise. Ignore signals that were set to
4882 Reported by Paul Eggert.
4884 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
4886 * getdate.y (textint): New member "negative".
4887 (time_zone_hhmm): New function.
4888 Expect 14 shift-reduce conflicts, not 13.
4889 (o_colon_minutes): New rule.
4890 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4891 (yylex): Set the "negative" member of signed numbers.
4893 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
4895 Changes imported from coreutils.
4896 * hard-locale.c: Assume <locale.h> exists.
4898 (GLIBC_VERSION): New macro.
4899 (hard_locale): Assume setlocale exists.
4900 Rewrite to avoid #ifdef.
4901 Use strdup rather than malloc + strcpy.
4902 * human.c: Assume <locale.h> exists.
4903 (human_readable): Assume localeconv exists.
4905 2004-12-01 Jakub Jelinek <jakub@redhat.com>
4907 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4908 convert T2, not T. (Imported from libc.)
4910 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
4912 * getcwd.c (is_ENAMETOOLONG): New macro.
4913 (__getcwd.c): Don't restore errno; glibc doesn't.
4914 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4915 first, falling back to our code only if its results look suspicious.
4916 Ensure that the resulting buffer is only as large as necessary.
4918 * readutmp.c: Include readutmp.h first.
4919 Include <errno.h>, since readutmp.h no longer does that.
4920 * readutmp.h: Don't include <errno.h>,
4921 <sys/param.h>, <time.h>; not needed to establish interface.
4922 (errno): Remove decl.
4923 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4924 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4925 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4927 2004-11-28 Simon Josefsson <jas@extundo.com>
4929 * base64.h, base64.c: New file.
4931 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
4933 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4935 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
4937 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4938 HP's ANSI C compiler.
4939 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4940 Declaring int functions causes warnings on some modern systems and
4941 shouldn't be needed to compile on ancient ones.
4942 * same.c (MIN) [defined MIN]: Don't define, since it's already
4945 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4946 with the following changes.
4947 (__set_errno): Parenthesize properly.
4948 Include <stdbool.h>.
4949 (MIN, MAX, MATCHING_INO): New macros.
4950 (__getcwd): Define with prototype, not K&R form.
4951 Use heuristics to allocate default buffer on stack if possible.
4952 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4953 behavior, and to avoid the PATH_MAX limit when computing
4955 Use MATCHING_INO to compare inode number to file.
4956 Check for arithmetic overflow in size calculations.
4957 Fix bug in reallocation of dot array that caused getcwd to fail
4958 on directories nested deeper than 75.
4959 Be more careful about saving errno on error.
4960 Do not use realloc; use only free+malloc, as this is a bit
4961 more flexible and avoids a needless copy operation.
4962 Do not inspect st_dev and st_ino for symbolic links; POSIX
4963 doesn't specify the latter.
4964 Check for closedir errors.
4965 Avoid needless casts.
4966 Use "#ifdef weak_alias" around weak_alias, to be like other
4968 The following changes to getcwd.c have effect only when used in
4969 gnulib; they have no effect inside glibc proper.
4970 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4971 as alloca isn't used.
4972 (alloca, __alloca): Likewise.
4973 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4974 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4975 unconditionally, as gnulib assumes C89 or better.
4976 Do not include <sys/param.h>.
4977 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4978 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4980 (NULL) [!defined NULL]: Remove; we assume C89 or better.
4981 Include <dirent.h> in a way that is compatible with modern Autoconf.
4982 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4983 New macros, if not already defined.
4984 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4985 Use "_LIBC", not "defined _LIBC", for consistency.
4986 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4988 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4989 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
4990 * xgetcwd.c: David MacKenzie's old code was removed, so give
4991 credit only to Jim Meyering and adjust the copyright dates.
4992 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4993 <stdlib.h>, <unistd.h>, "pathmax.h".
4994 Instead, include "xgetcwd.h" (first) and "getcwd.h".
4995 (INITIAL_BUFFER_SIZE): Remove.
4996 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4998 2004-11-23 Jim Meyering <jim@meyering.net>
5000 * getopt_.h: Remove trailing blanks.
5002 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5004 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
5005 (futimens): New function, which uses futimes if available.
5006 (futimens, utimens): Support timespec==NULL, with same semantics
5007 as utime and utimens.
5008 * utimens.h (futimens): New decl.
5010 2004-11-23 Jim Meyering <jim@meyering.net>
5012 * __fpending.c: Add comment.
5014 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5016 * getopt_.h: Re-addition of __getopt_argv_const caused
5017 redefinition warnings. To avoid them, include the defines
5018 in `#if !defined __need_getopt ... #endif'. The only place
5019 where __getopt_argv_const is used is in definitions
5020 of getopt_long and getopt_long_only below, which are as well
5021 protected by `#ifndef __need_getopt'.
5022 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
5023 __need_getopt after including <stdio.h> and <unistd.h> These
5024 headers might have defined it.
5026 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
5028 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
5030 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
5031 optopt): Use them instead of invoking ## directly; otherwise, the
5032 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
5034 2004-11-19 Bruno Haible <bruno@clisp.org>
5036 * strtok_r.c: Move comments from here...
5037 * strtok_r.h: ... to here.
5039 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
5041 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
5042 might fail. Problem reported by Yoann Vandoorselaere.
5043 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
5044 that mishandle size_t overflow.
5046 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
5048 * canon-host.c: Include "strdup.h".
5049 (canon_host): Use getaddrinfo if available, so that IPv6 works.
5050 Use strdup instead of malloc/strcpy to duplicate strings.
5052 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
5053 (human_space_before_unit): New constant.
5054 * human.c (human_readable): Support it.
5056 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
5057 (xgetcwd): Set errno correctly when failing.
5058 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
5059 the failure is actually due to a PATH_MAX problem.
5061 Further getopt changes to make it more likely that glibc will
5062 buy the changes back.
5063 * getopt.c (POSIXLY_CORRECT): New constant.
5064 (getopt): Use it, so to preserve glibc semantic
5065 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
5066 when compiling for libc.
5067 * getopt_.h (__getopt_argv_const): Bring it back.
5068 (getopt_long, getopt_long_only): Use it.
5070 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
5071 New arg POSIXLY_CORRECT. All callers changed.
5072 (getopt): Argv is now char * const *, as per standard.
5073 (_getopt_internal_r, _getopt_internal): Argv is now char **,
5074 not char *__getopt_argv_const *.
5075 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5076 _getopt_long_only_r): Likewise.
5077 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
5078 * getopt_int.h (_getopt_internal, _getopt_internal_r,
5079 _getopt_long_r, _getopt_long_only_r): Likewise.
5080 * getopt_.h (__getopt_argv_const): Remove.
5081 (getopt): Argv is now char * const *, as per standard.
5083 * getdate.y (tORDINAL): New token.
5084 (day, relunit): Allow it for relative times.
5085 (relative_time_table): Use tORDINAL for ordinals.
5087 2004-11-15 Jim Meyering <jim@meyering.net>
5089 * closeout.c: Include "__fpending.h" once again.
5090 Include <stdbool.h>.
5091 (close_stdout): Don't fail just because stdout was closed initially,
5092 since some programs don't write to stdout in the normal course of
5093 operation (other than --version and --help), and we don't want this
5094 function to make e.g. `touch file >&-' fail.
5095 But do fail if it was closed and someone has tried to write to it.
5096 E.g., `printf foo >&-' must fail.
5098 2004-11-11 Simon Josefsson <jas@extundo.com>
5100 * strtok_r.h, strtok_r.c: New file.
5102 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
5104 * getopt_.h (__getopt_argv_const): New macro, to be used so that
5105 we can stop lying to compilers about the constness of argv when we
5106 are compiled outside glibc.
5107 (getopt, getopt_long, getopt_long_only): Use it.
5108 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
5110 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
5111 _getopt_long_only_r): Likewise.
5112 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
5113 _getopt_long_only_r): Likewise.
5115 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
5116 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
5117 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
5118 the other external symbols.
5119 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
5120 declaration, since the above renaming now works around collisions.
5122 2004-11-11 Jim Meyering <jim@meyering.net>
5124 * linebreak.c: Remove trailing blanks.
5125 * alloca_.h: Likewise.
5126 * acosl.c: Likewise.
5127 * euidaccess.c: Likewise.
5128 * allocsa.h: Likewise.
5130 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
5132 * mktime.c (SHR): New macro, which is a portable
5133 substitute for >> that should work even on Crays.
5134 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
5135 Problem reported by Mark D. Baushke in
5136 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
5137 * getdate.y (SHR): Likewise.
5139 * strftime.c (SHR): Likewise.
5141 * quotearg.c (struct quoting_options): Use unsigned int for
5142 quote_these_too, so that right shifts are well defined. All uses
5145 2004-11-10 Simon Josefsson <jas@extundo.com>
5147 * getaddrinfo.h, getaddrinfo.c: New files.
5149 2004-11-10 Jim Meyering <jim@meyering.net>
5151 Ensure that no close failure goes unreported.
5152 * closeout.c (close_stdout): Always close stdout. I.e., don't
5153 return early when it seems there's nothing to flush.
5154 Don't include __fpending.h.
5156 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
5158 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
5160 2004-11-05 Bruno Haible <bruno@clisp.org>
5162 * readlink.c: Include stddef.h, needed for size_t on Woe32.
5163 Reported by Mark D. Baushke <mdb@cvshome.org>.
5165 2004-11-04 Bruno Haible <bruno@clisp.org>
5167 2004-09-11 Bruno Haible <bruno@clisp.org>
5168 * allocsa.valgrind: New file.
5169 2004-02-06 Bruno Haible <bruno@clisp.org>
5170 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
5171 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
5172 Reported by Christopher Seip <chris.seip@hp.com>.
5174 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
5176 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
5177 with errno == ERANGE if the buffer is too small.
5178 Problem reported by Mark D. Baushke.
5180 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
5182 * xreadlink.c (MAXSIZE): New macro.
5183 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
5184 size does not exceed MAXSIZE. Avoid cast.
5185 As suggested by Mark D. Baushke in
5186 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
5187 if readlink fails with buffer size just under MAXSIZE, try again
5190 2004-11-02 Derek R. Price <derek@ximbiot.com>
5191 and Paul Eggert <eggert@cs.ucla.edu>
5193 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
5194 (get_date): Overparenthesize to avoid GCC warning.
5196 2004-11-02 Bruno Haible <bruno@clisp.org>
5198 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
5199 function returns void.
5201 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
5203 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5204 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
5207 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
5209 * getdate.y: Add support for TZ="foo" within a date string.
5210 Fix some bugs near time_t boundaries. Reject dates with
5211 out-of-range components, e.g., "Sept 31".
5212 Include <stdlib.h>, "setenv.h", "xalloc.h".
5213 (ISDIGIT_LOCALE): Remove; unused.
5214 Note that the TZ and time functions used here are not reentrant.
5215 (mktime_ok, get_tz): New functions.
5216 (TZBUFSIZE): New constant.
5217 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
5218 This requires that we sometimes generate our own TZ="XXX..." setting.
5220 2004-10-27 Derek R. Price <derek@ximbiot.com>
5222 * mktime.c (not_equal_tm): Remove redundant check.
5224 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
5226 * getdate.y: Use Bison 1.875 features, and some minor
5227 code cleanups. This change does not affect semantics.
5228 Don't include <stdlib.h>; no longer needed.
5229 Don't include unlocked-io.h; only the "#if TEST" code uses
5230 stdio, and performance isn't crucial there.
5231 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
5232 Bison 1.875 features as described below.
5233 All uses of "PC." replaced by "pc->".
5234 (YYSTYPE): Add a forward declaration.
5235 (yylex, yyerror): Use full prototypes in forward decls.
5236 Use "%pure-parser" rather than obsolescent "%pure_parser".
5237 Use %parse-param and %lex-param instead of obsolescent
5238 YYPARSE_PARAM and YYLEX_PARAM.
5239 (meridian_table, month_and_day_table, time_units_table,
5240 relative_time_table, time_zone_table, military_table,
5241 lookup_zone, lookup_word, get_date):
5242 Use NULL instead of 0 where appropriate.
5243 (to_hour): Avoid abort (), to avoid a dependency on
5245 (yyerror, yylex): Now accepts parser_control * arg.
5246 (main) [TEST]: Use '\0' rather than 0 for char.
5248 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5250 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
5251 It's now the caller's responsibility to handle the case where
5252 !HAVE_GETPAGESIZE && !defined getpagesize.
5254 * mktime.c (leapyear): Arg is long int, not int.
5256 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
5258 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
5260 2004-10-12 Simon Josefsson <jas@extundo.com>
5262 * getpass.c (fflush_unlocked, flockfile, funlockfile)
5263 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
5266 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
5268 * vsnprintf.h: New file.
5269 * vsnprintf.c: New file.
5271 2004-10-07 Bruno Haible <bruno@clisp.org>
5273 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
5274 into the provided buffer.
5276 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
5278 * diacrit.c, diacrit.h: Add GPL notice.
5280 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
5281 * atanl.c (atanl): Keep the code as similar to glibc as possible.
5282 * logl.c (logl): Keep the code as similar to glibc as possible.
5283 This avoids a potential constant-folding bug.
5285 2004-10-05 Bruno Haible <bruno@clisp.org>
5287 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
5289 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5291 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
5292 * xmalloc.c (xmemdup): Likewise.
5293 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
5294 XFREE): Remove these long-obsolescent macros.
5295 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
5296 * xstrdup.c: Remove.
5298 * regex.c (re_comp): Cast gettext return value to char *,
5299 Problem reported by Martin Neitzel via Mark D. Baushke.
5301 2004-10-04 Simon Josefsson <jas@extundo.com>
5303 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
5304 '#ifdef USE_UNLOCKED_IO'.
5306 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
5308 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
5309 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
5310 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
5311 regex.c, sha1.c, version-etc.c, yesno.c:
5312 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
5313 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5314 the includer's responsibility.
5316 Sync from coreutils.
5318 * modechange.c (mode_compile): Don't decrement a pointer that
5319 points to the start of a string, as the C Standard says the
5320 resulting behavior is undefined.
5322 * backupfile.h (enum backuptype): Rename none -> no_backups,
5323 simple -> simple_backups, numbered_existing ->
5324 numbered_existing_backups, numbered -> numbered_backups
5325 to avoid shadowing problems. All uses changed.
5326 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5327 * backupfile.c (check_extension, numbered_backup):
5328 Rename locals to avoid shadowing 'basename'.
5329 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5332 * .cppi-disable: Add getopt_.h, getopt_int.h.
5333 * .cvsignore: Add getopt.h.
5335 2004-10-04 Simon Josefsson <jas@extundo.com>
5337 * memmem.h: New file.
5338 * memmem.c: New file, taken from glibc.
5340 2004-10-02 Jim Meyering <jim@meyering.net>
5342 * dirfd.h, getpagesize.h: Add copyright notice.
5344 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
5346 * snprintf.c: Remove comments as to why each header is needed.
5348 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
5350 * strsep.h: New file.
5351 * strsep.c: New file.
5353 2004-10-01 Simon Josefsson <jas@extundo.com>
5355 * snprintf.c (snprintf): Handle size==0.
5357 2004-10-01 Simon Josefsson <jas@extundo.com>
5358 Bruno Haible <bruno@clisp.org>
5360 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5361 (snprintf): Declare 'args'.
5363 2004-09-30 Simon Josefsson <jas@extundo.com>
5365 * snprintf.h, snprintf.c: New files.
5367 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
5369 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5370 (hol_entry_help): Never translate an empty string.
5371 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5372 * argp.h (OPTION_NO_TRANS): New option.
5374 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
5376 * xvasprintf.c: Include xalloc.h.
5377 (xvasprintf): Use xalloc_die, not xmalloc_die.
5379 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
5381 * dummy.c: Change copyright notice to FSF, and license to GPL.
5383 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
5385 * argp-pvh.c (argp_program_version_hook): Provide initial value.
5386 Problem reported by Bruno Haible in:
5387 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5389 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
5391 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5392 in case some system header has #define'd it. Problem reported by
5393 Soeren D. Schulze in
5394 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5396 2004-09-08 Bruno Haible <bruno@clisp.org>
5398 * stdint_.h: New file, taken from GNU clisp.
5400 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
5402 * xvasprintf.h: New file.
5403 * xvasprintf.c: New file.
5404 * xasprintf.c: New file.
5406 2004-09-08 Bruno Haible <bruno@clisp.org>
5408 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5410 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5412 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
5414 Import from coreutils.
5415 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5416 strings on unbounded length. alloca's performance benefits aren't
5417 that important here.
5419 (parse_with_separator): New function, with most of the internals
5420 of the old parse_user_spec. Allow user to omit both user and group,
5421 for compatibility with FreeBSD.
5422 Clone only the user name, not the entire spec.
5423 Do not set *uid, *gid unless entirely successful.
5424 Avoid memory leak in some failing cases.
5425 Fix regression for USER.GROUP reported by Dmitry V. Levin in
5426 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5427 (parse_user_spec): Rewrite to use parse_with_separator.
5429 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
5431 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5432 its complicated substitute.
5433 * argp-help.c: Include <errno.h>, for program_invocation_short_name
5434 and program_invocation_name.
5435 (__argp_basename) [!_LIBC]: Remove; the only use was
5436 replaced by its body.
5437 (__argp_short_program_name): Change condition from
5438 !defined __argp_short_program_name to
5439 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5440 to match argp-namefrob.h.
5441 (__argp_failure): Don't assume strerror_r returns char *.
5442 * argp-parse.c (N_): Define unconditionally.
5443 (argp_default_options): Fill out initializers with 0 to avoid
5446 2004-08-12 Simon Josefsson <jas@extundo.com>
5448 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5449 * getopt_.h: Renamed from getopt.h.
5451 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
5453 Merge from coreutils.
5455 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5456 wmemchr or wmemcpy. Problem reported by Robert Dahlem
5457 for Reliant Unix 5.43.
5459 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5460 (union fooround): Use uintmax_t, not long int.
5461 The rest is a merge from libc:
5462 [defined _LIBC]: Include <shlib-compat.h>.
5463 (_obstack) [defined _LIBC]: Remove after 2.3.4.
5465 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5467 * strverscmp.c: Convert to UTF-8.
5469 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
5471 * obstack.h (obstack_empty_p):
5472 Don't assume that chunk->contents is suitably aligned.
5473 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5474 Likewise. Problem reported by Benno in
5475 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5477 * chown.c (rpl_chown): Work even if the file is writeable but not
5478 readable. This could be improved further but it'd take some work.
5480 2004-08-08 Simon Josefsson <jas@extundo.com>
5482 * xgethostname.c: Don't include error.h (not used).
5485 * getpass.c: Include getpass.h first.
5487 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
5489 * xalloc-die.c: New files.
5490 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5492 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5493 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5494 (_, N_, xalloc_die): Move to xalloc-die.c.
5495 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5496 so that we needn't mess with xalloc_msg_memory_exhausted.
5498 * sha1.h: Renamed from sha.h.
5499 (SHA1_H): Renamed from _SHA_H.
5500 (sha1_ctx): Renamed from sha_ctx.
5501 (sha1_init_ctx): Renamed from sha_init_ctx.
5502 (sha1_process_block): Renamed from sha_process_block.
5503 (sha1_process_bytes): Renamed from sha_process_bytes.
5504 (sha1_finish_ctx): Renamed from sha_finish_ctx.
5505 (sha1_read_ctx): Renamed from sha_read_ctx.
5506 (sha1_stream): Renamed from sha_stream.
5507 (sha1_buffer): Renamed from sha_buffer.
5508 * sha1.c: Likewise; renamed from sha.c.
5509 Do not include <sys/types.h>.
5510 Include <stddef.h> rather than <stdlib.h>.
5512 2004-08-08 Bruno Haible <bruno@clisp.org>
5514 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5515 FILESYSTEM_PREFIX_LEN.
5516 * progreloc.c: Likewise.
5517 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5519 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
5522 * argp-help.c (make_hol, hol_append): Don't assume that
5523 SIZE_MAX is a valid preprocessor constant.
5524 (__argp_basename): Change from "#ifndef _LIBC"
5525 to "#ifndef __argp_short_program_name", so that
5526 we don't compile these functions for tar.
5528 More merges from coreutils.
5529 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5530 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5532 * addext.c: Remove; no longer needed.
5533 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5534 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5535 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5536 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5537 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5538 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5539 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5540 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5541 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5542 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5543 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5544 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5545 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5546 Import changes from coreutils.
5548 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
5550 Merge from coreutils.
5552 * .gdb-history: Remove; this doesn't belong here.
5554 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5555 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5556 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5558 * dirname.h: Include <stdbool.h>.
5559 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5560 for consistency with POSIX terminology. All uses changed.
5561 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5562 (strip_trailing_slashes): Use bool for booleans.
5563 * stripslash.c (strip_trailing_slashes): Likewise.
5565 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5566 sometimes returns a positive errno value even when it succeeds.
5567 (print_errno_message) [!LIBC]: Fall back on strerror if
5570 * path-concat.c (mempcpy): Don't define if a system header defines it.
5571 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5572 (longest_relative_suffix): New function.
5573 (path_concat): Use it. Assume first argument is not NULL.
5574 Port to DOS. Omit redundant separators.
5575 Report an error instead of returning NULL.
5576 Use mempcpy instead of memcpy.
5577 (xpath_concat): Remove: not declared or used.
5579 * same.h: Include <stdbool.h>
5580 (same_name): Return bool, not int.
5581 * same.c (same_name): Likewise.
5582 (errno): Don't declare; we assume C89 or better now.
5584 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5585 if not already defined.
5587 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5588 * dup-safer.c (errno): Likewise.
5590 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
5592 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5595 2004-08-03 Simon Josefsson <jas@extundo.com>
5597 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5598 * progname.h: Don't include stdbool.h.
5600 2004-08-02 Simon Josefsson <jas@extundo.com>
5602 * getsubopt.h: New file, with comments from Bruno Haible.
5603 * getsubopt.c: New file, from glibc, but slightly modified based on
5604 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5606 2004-08-01 Simon Josefsson <jas@extundo.com>
5608 * xgetdomainname.c: Include stdlib.h, for free().
5610 2004-07-16 Simon Josefsson <jas@extundo.com>
5612 * dummy.c: New file.
5614 2004-07-16 Bruno Haible <bruno@clisp.org>
5616 * backupfile.h: Add extern "C" for C++.
5617 * closeout.h: Likewise.
5618 * copy-file.h: Likewise.
5619 * findprog.h: Likewise.
5620 * full-write.h: Likewise.
5621 * pathname.h: Likewise.
5622 * progname.h: Likewise.
5623 * stpcpy.h: Likewise.
5624 * stpncpy.h: Likewise.
5625 * strcase.h: Likewise.
5626 * strstr.h: Likewise.
5627 * xalloc.h: Likewise.
5629 * mbswidth.h: Add extern "C" for C++.
5630 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5632 2004-07-09 Simon Josefsson <jas@extundo.com>
5634 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
5635 failed without this.)
5637 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
5639 * fchown-stub.c: New file.
5641 2004-06-24 Jim Meyering <jim@meyering.net>
5643 * obstack.h (obstack_base): Cast to (void *), per documentation.
5645 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
5647 * argz.c, argz_.h: New files, which are autoupdated from libtool.
5649 2004-06-01 Jim Meyering <jim@meyering.net>
5651 * calloc.c: New file.
5653 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
5655 * getdate.y (yylex): Allow space between sign and number.
5656 Problem reported by Dan Jacobson.
5658 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
5659 and Jim Meyering <jim@meyering.net>
5661 Merge from coreutils CVS.
5663 * stat-macros.h: New file, with contents from file-type.h
5664 and coreutils' system.h.
5665 * file-type.c: Include "stat-macros.h".
5666 * file-type.h (file_type): Move all macro definitions to new file,
5669 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5670 Wrap old code with this conditional.
5671 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5672 function that does not dereference symlinks.
5673 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5675 * xreadlink.c: Include xreadlink.h first, to catch .h file
5676 dependency problems.
5677 (xreadlink): Accept new arg SIZE, for efficiency.
5678 All decls and uses changed.
5679 * xreadlink.h: Include <stddef.h>, for size_t.
5681 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5682 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5684 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5686 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
5688 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5689 macros to be defined.
5690 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5691 the allocator returns NULL because the requested size is zero.
5693 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
5695 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5696 var. Add comment explaining why libc still defines it. This
5697 merges the following patch from glibc:
5698 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5700 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
5702 * obstack.c (_obstack): Remove unused variable. It hasn't been
5703 present in glibc since revision 1.1 of this file.
5704 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5705 obstack_alignment_mask, obstack_alloc, obstack_base,
5706 obstack_blank, obstack_blank_fast, obstack_chunk_size,
5707 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5708 obstack_grow0, obstack_init, obstack_int_grow,
5709 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5710 obstack_next_free, obstack_object_size, obstack_ptr_grow,
5711 obstack_ptr_grow_fast, obstack_room): Remove declarations of
5712 nonexistent functions.
5714 2004-05-17 Derek R. Price <derek@ximbiot.com>
5715 Paul Eggert <eggert@cs.ucla.edu>
5717 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5719 2004-05-14 Bruno Haible <bruno@clisp.org>
5721 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5722 that consists of a '.' followed by an empty digit string.
5723 Patch by Tor Lillqvist <tml@iki.fi>.
5725 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
5727 Port obstack to the AS/400, where pointers are 16 bytes wide and
5728 you cannot cast an integer to a valid pointer. This patch is
5729 currently waiting to be integrated into glibc; see
5730 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5732 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5733 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5734 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5735 (struct obstack): temp member is now a union of a pointer and
5736 an integer, instead of an integer. All integer uses changed.
5737 This does not affect the physical layout of struct obstack,
5738 except on hosts (like the AS/400) where the size or alignment of
5739 void * is greater than that of ptrdiff_t.
5740 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5741 __STDC__)]: Store temporary in pointer member of union, not
5743 * obstack.c: Include <stddef.h>, for offsetof.
5744 (struct fooalign): Remove; it doesn't need a name.
5745 (union fooround): Change double to long double, and add void *.
5746 (DEFAULT_ALIGNMENT): Use offsetof to compute.
5747 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5748 not a macro. Hence the values are always int; so remove all
5749 casts-to-int in uses.
5751 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
5752 Derek Price <derek@ximbiot.com>
5754 * alloca.c: Include <alloca.h>, to get our interface.
5755 * alloca_.h: Use __alloca on AIX, so that we don't have to
5756 include <alloca.h> first. Use C89 prototype for alloca; this
5757 requires including <stddef.h> for size_t. Use extern "C" if C++.
5758 Use #elif for simplicity, since we can assume C89 now.
5759 Don't try to source the system alloca.h since it will not be found
5760 and to prevent recursively including its replacement.
5761 * fnmatch.c: Include <alloca.h> instead of opencoding.
5762 * regex.c: Likewise.
5764 2004-05-16 Derek Price <derek@ximbiot.com>
5765 Paul Eggert <eggert@cs.ucla.edu>
5767 getline cleanup. This changes the getndelim2 API: both order of
5768 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5771 * getline.c: Don't include stddef.h or stdio.h, since our
5772 interface does that.
5773 (getline): Always use getdelim, so that we don't have two
5774 copies of this code.
5775 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5777 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5778 (GETNDELIM2_MAXIMUM): New macro.
5779 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
5780 instead of the old practice of delim2==0. All callers changed.
5781 Return -1 on overflow, instead of returning junk.
5782 Do not set *linesize unless allocation succeeds.
5783 * getndelim2.h: Do not include stddef.h; no longer needed, now
5784 that we include sys/types.h.
5785 * getnline.h: Likewise.
5786 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5787 (getndelim2): Reorder arguments.
5788 * getnline.c (getnline, getndelim):
5789 Don't discard the NMAX argument.
5790 (getnline): Invoke getndelim, to avoid code duplication.
5791 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5792 of (size_t) -1 by callers of the getnline family.
5794 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
5796 * nanosleep.c (suspended): Change its type from int to
5797 sig_atomic_t volatile.
5798 (first_call): Make it private to rpl_nanosleep, and have it
5799 be zero initially as that's a bit faster.
5800 (my_usleep): Round up fractional times instead of truncating them,
5801 as this is the usual meaning for 'sleep'.
5803 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5805 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5806 (ENOSYS): Define if not defined.
5807 (settime): Fall back on stime if it exists and settimeofday fails.
5808 But don't bother with fallbacks if a method fails with errno == EPERM.
5810 2004-05-11 Jim Meyering <jim@meyering.net>
5812 Prior to this change, the save_cwd caller required read access to the
5813 current directory on most systems (ones with the fchdir function).
5815 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5816 fails, try write-only, and finally, resort to using xgetcwd.
5818 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5820 * obstack.c, obstack.h: Import changes from libc.
5822 2004-04-28 Bruno Haible <bruno@clisp.org>
5824 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5825 implicitly appends .exe to executables.
5826 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5827 accepts Windows pathnames.
5828 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5829 Cygwin like Windows, since it now accepts Windows pathnames.
5830 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5831 Cygwin like Windows, since it now accepts Windows pathnames.
5832 Reported by Derek Robert Price <derek@ximbiot.com>.
5834 2004-04-20 Jim Meyering <jim@meyering.net>
5836 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5838 2004-04-20 Jim Meyering <jim@meyering.net>
5839 Bruno Haible <bruno@clisp.org>
5841 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5842 memory when realloc fails.
5844 2004-04-18 Jim Meyering <jim@meyering.net>
5846 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5847 don't leak memory and do call END_UTMP_ENT.
5849 2004-04-11 Paul Eggert <eggert@twinsun.com>
5851 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5852 (CHAR_BIT): Remove, since we assume C89.
5853 Include <stdint.h> if available, as per current Autoconf CVS advice.
5855 2004-03-30 Paul Eggert <eggert@twinsun.com>
5857 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5858 not bool, to be more consistent with Unix conventions.
5859 Suggested by Bruno Haible.
5861 Merge from coreutils.
5863 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5866 * getdate.h: Include stdbool.h, and timespec.h instead of
5867 the usual <time.h> dance.
5868 (get_date): Change signature to support fractional time stamps.
5869 All callers changed.
5870 * getdate.y: Include "getdate.h" first, as we can now
5871 assume C89 and don't need to worry about 'const'.
5872 Similarly, include "unlocked-io.h" near start, not in middle.
5874 (textint.value): Use long int rather than int.
5875 (textint.digits): Use size_t rather than int.
5876 (BILLION, LOG10_BILLION): New constants.
5877 (parser_control): New member rel_ns. Members day_ordinal,
5878 time_zone, month, day, hour, minutes, rel_year, rel_month,
5879 rel_day, rel_hour, rel_minutes, rel_seconds
5880 are now long int, not int. Member seconds is now struct timespec,
5881 not int. New member timespec_seen. Members dates_seen, days_seen,
5882 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5884 (%union.intval): Now long int, not int.
5885 New member timespec.
5886 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5887 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5888 (spec): Now is a timespec or an item list.
5889 (timespec, items): New nonterminals.
5890 (time, rel, relunit, number, get_date):
5891 Add support for fractional seconds.
5892 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5893 (gmtime, localtime, mktime): Remove decls; not needed with C89.
5894 (to_hour): First arg is now long int, not int.
5895 (to_year): Returns long int, not int.
5896 Don't treat year -70 like 70.
5897 (tm_diff): Returns long int, not int.
5898 (lookup_word): Use bool instead of int when appropriate.
5899 (yylex): Use size_t for count, not int.
5900 Detect overflow when parsing large integer constants.
5901 Add support for fractions.
5902 (get_date): Make pointers 'const' if possible.
5903 Use more-portable code to detect integer overflow.
5904 (main) [TEST]: Adjust to above changes. Test for localtime failure.
5905 Don't use ctime; it's not reliable if the year has >4 digits.
5907 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5908 This is for compatibility with BSD.
5910 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5911 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5912 From coreutils' system.h.
5914 * userspec.c: Don't include "posixver.h".
5915 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5916 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5917 compatible extension. Simplify code by removing a boolean int
5918 that was always nonzero if a string was nonnull.
5920 2004-03-30 Jim Meyering <jim@meyering.net>
5922 Merge from coreutils.
5924 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5926 * readtokens.c (readtoken): Don't leak 64 bytes when reading
5927 an empty input stream.
5929 * readtokens.c: Include <stdbool.h>.
5930 (readtoken): Use `size_t' rather than int/long.
5931 All callers adjusted.
5932 Use `bool' rather than `int' where appropriate.
5933 Use memset rather than an explicit loop.
5934 Use x2nrealloc rather than xrealloc.
5935 Allow the use of `\0' as a delimiter.
5936 (readtokens): Likewise.
5937 * readtokens.h (readtoken, readtokens): Update prototypes.
5939 2004-03-30 Bruno Haible <bruno@clisp.org>
5941 * getloadavg.c (getloadavg): Don't assume setlocale returns
5944 2004-03-29 Paul Eggert <eggert@twinsun.com>
5946 Merge changes to getloadavg.c from coreutils and Emacs.
5948 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5949 Define to an expression, not to the empty string.
5950 Include cloexec.h and xalloc.h.
5951 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5952 Use set_cloexec_flag rather than rolling our own.
5953 * cloexec.c, cloexec.h: New files.
5955 2004-03-18 Paul Eggert <eggert@twinsun.com>
5957 * getopt.h: Sync with libc CVS.
5959 2004-03-18 Paul Eggert <eggert@twinsun.com>
5960 Bruno Haible <bruno@clisp.org>
5962 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5963 not on all platforms that have <wchar.h>.
5964 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5966 2004-03-09 Paul Eggert <eggert@twinsun.com>
5968 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5970 * getopt_int.h: New file, also synced from libc.
5972 2004-03-07 Paul Eggert <eggert@twinsun.com>
5974 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
5975 '#if' expressions. Unlike the code it replaces, it does not
5976 depend on (defined _SC_PAGESIZE). However, it does depend on
5977 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5978 first reported by Jason Andrade in
5979 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5981 2004-01-18 Simon Josefsson <jas@extundo.com>
5983 * strdup.h: New file.
5984 * strdup.c: Include it.
5985 * path-concat.c: Include strdup.h. Drop strdup declaration.
5986 * userspec.c: Include strdup.h. Drop strdup declaration.
5988 2004-02-06 Karl Berry <karl@gnu.org>
5990 * config.charset: update from gettext 0.14.1.
5992 2004-02-05 Paul Eggert <eggert@twinsun.com>
5994 Add comments and code, prompted by suggestions from Bruno Haible
5996 * quotearg.h (quotearg_alloc): New decl. Improve the comments
5997 describing the enum quoting_style values.
5998 * quotearg.c (quotearg_alloc): New function.
5999 (quotearg_buffer_restyled): Treat lone { and } as special.
6000 Treat = as special. Work around bug with older shells
6001 that "see" a '\' that is really the 2nd byte of a multibyte char.
6002 Quote empty string with shell_quoting_style.
6004 2004-02-03 Bruno Haible <bruno@clisp.org>
6006 * pipe.h: New file, from GNU gettext.
6007 * pipe.c: New file, from GNU gettext.
6009 2004-01-27 Bruno Haible <bruno@clisp.org>
6011 * execute.h: New file, from GNU gettext.
6012 * execute.c: New file, from GNU gettext.
6013 * w32spawn.h: New file, from GNU gettext.
6015 2004-01-23 Paul Eggert <eggert@twinsun.com>
6017 Exit-status fix from coreutils.
6019 Use exit_failure consistently in place of EXIT_FAILURE,
6020 so that program exit statuses are consistent on failure.
6022 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
6023 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
6024 * argmatch.h: Comment fix to match the above.
6025 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
6026 Now a macro referring to exit_failure, instead of a separate
6027 variable. Include "exitfail.h" to get it.
6028 * xstrtol.h: Include "exitfail.h".
6029 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
6031 * long-options.c (parse_long_options): Use prototype
6032 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
6035 2004-01-21 Jim Meyering <jim@meyering.net>
6037 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
6038 so as not to conflict with a different-sized __mktime_internal
6039 function in GNU libc.
6040 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
6041 Problem building statically-linked `ls' reported by Michael Brunnbauer.
6043 2004-01-18 Paul Eggert <eggert@twinsun.com>
6045 Merge from diffutils.
6047 * file-type.c (file_type): Add typed memory objects.
6048 * file-type.h (S_TYPEISTMO): New macro.
6050 * c-stack.h (c_stack_action): Remove argv argument.
6051 * c-stack.c (c_stack_action): Likewise. All uses changed.
6052 (die): Don't calculate message unless segv_action returns.
6053 (get_stack_location, min_address_from_argv, max_address_from_argv,
6054 volatile stack_base, volatile_stack_size): Remove.
6055 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
6056 that every segmentation violation is a stack overflow. (Ouch!)
6057 See Debian bug 136249 (still outstanding) for more info about why
6058 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
6060 2003-11-30 Bruno Haible <bruno@clisp.org>
6062 Safer stack allocation.
6063 * setenv.c: Include allocsa.h.
6064 (alloca): Remove fallback definition.
6065 (freea): Remove macro.
6066 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
6069 2003-10-17 Bruno Haible <bruno@clisp.org>
6071 * binary-io.h: Avoid warnings on Cygwin.
6073 2003-12-28 Bruno Haible <bruno@clisp.org>
6075 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
6076 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
6078 2003-11-28 Bruno Haible <bruno@clisp.org>
6080 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
6082 2003-11-27 Bruno Haible <bruno@clisp.org>
6084 * wait-process.c: On Windows, include windows.h. Needed on mingw.
6086 2003-11-17 Bruno Haible <bruno@clisp.org>
6088 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
6090 2003-11-24 Bruno Haible <bruno@clisp.org>
6092 * xallocsa.h: New file, from GNU gettext.
6093 * xallocsa.c: New file, from GNU gettext.
6095 2003-11-24 Bruno Haible <bruno@clisp.org>
6097 * allocsa.h: New file, from GNU gettext.
6098 * allocsa.c: New file, from GNU gettext.
6100 2003-11-24 Bruno Haible <bruno@clisp.org>
6102 * eealloc.h: New file.
6104 2004-01-15 Jim Meyering <jim@meyering.net>
6106 Merge from coreutils.
6108 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
6109 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
6110 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
6112 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
6113 optional configure-time default.
6115 * version-etc.c (version_etc_copyright): Update copyright date.
6117 * xreadlink.c (xreadlink): Correct outdated comment.
6119 2004-01-15 Paul Eggert <eggert@twinsun.com>
6121 Merge from coreutils.
6123 * posixver.c: Include posixver.h.
6125 * same.c: Include <stdbool.h>, <limits.h>.
6126 (_POSIX_NAME_MAX): Define if not defined.
6128 (same_name): If file names are silently truncated, report
6129 that the file names are the same if they are the same after
6130 the silent truncation.
6132 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
6133 conversion function.
6134 * xstrtod.c (xstrtod): Likewise. All callers changed to
6135 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
6138 2004-01-14 Paul Eggert <eggert@twinsun.com>
6140 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
6141 with like-named macro in fnmatch.c.
6142 (EXT): Use an internal constant instead.
6144 Merge fnmatch patches from glibc.
6145 * fnmatch.c (mbsinit): Remove define.
6146 Add libc_hidden_ver (__fnmatch, fnmatch).
6147 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
6148 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
6150 2003-12-14 Karl Berry <karl@gnu.org>
6152 * config.charset: update from gettext-runtime.
6154 2003-12-03 Paul Eggert <eggert@twinsun.com>
6156 * getgroups.c (getgroups): xmalloc takes one argument, not two.
6157 Bug reported by Alfred M. Szmidt.
6159 2003-11-29 Karl Berry <karl@gnu.org>
6161 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
6163 2003-11-23 Paul Eggert <eggert@twinsun.com>
6164 Bruno Haible <bruno@clisp.org>
6166 * printf-parse.h: Don't include sys/types.h.
6167 (ARG_NONE): New macro.
6168 (char_directive): Change type of *arg_index fields to size_t.
6169 * printf-parse.c: Don't include sys/types.h.
6170 (SSIZE_MAX): Remove macro.
6171 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
6172 Remove unnecessary overflow check.
6173 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
6176 2003-11-24 Paul Eggert <eggert@twinsun.com>
6178 * alloca.c: Remove dependency on xalloc module.
6179 (xalloc_die): Remove.
6180 (memory_full) [!defined emacs]: New macro.
6181 [!defined emacs]: Don't include xalloc.h.
6182 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
6183 address arithmetic overflows. Change datatypes a bit to avoid
6186 2003-11-22 Jim Meyering <jim@meyering.net>
6188 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
6190 2003-11-17 Bruno Haible <bruno@clisp.org>
6192 * vasnprintf.c (alloca): Remove fallback definition.
6193 (freea): Remove definition.
6194 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
6195 Reported by Paul Eggert.
6197 2003-11-17 Jim Meyering <jim@meyering.net>
6199 On systems without utime and without a utimes function capable of
6200 dealing with a NULL struct utimbuf* argument, this utime replacement
6201 could -- in unusual circumstances -- leak a file descriptor.
6202 * utime.c: Include <unistd.h> and <errno.h>.
6203 (utime_null): Be sure to close `fd' and to preserve errno.
6204 Reported by Geoff Collyer via Arnold Robbins.
6206 2003-11-16 Paul Eggert <eggert@twinsun.com>
6207 Bruno Haible <bruno@clisp.org>
6209 Protect against address arithmetic overflow.
6210 * printf-args.h: Include stddef.h.
6211 (arguments): Change type of field 'count' to size_t.
6212 * printf-args.c (printf_fetchargs): Use size_t instead of
6213 'unsigned int' where appropriate.
6214 * printf-parse.h: Include sys/types.h.
6215 (char_directive): Change type of *arg_index fields to ssize_t.
6216 (char_directives): Change type of fields 'count', max_*_length to
6218 * printf-parse.c: Include sys/types.h and xsize.h.
6219 (SSIZE_MAX): Define fallback value.
6220 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
6221 instead of 'int' where appropriate. Check a_allocated, d_allocated
6222 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
6223 * vasnprintf.c: Include xsize.h.
6224 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
6225 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
6226 overflow. Avoid wraparound when converting a width or precision from
6229 2003-11-16 Bruno Haible <bruno@clisp.org>
6231 Update from GNU gettext.
6232 * printf-parse.c: Generalize to it can be compiled for wide strings.
6233 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
6234 * vasnprintf.c: Generalize to it can be compiled for wide strings.
6235 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
6236 SNPRINTF): New macros.
6237 Don't include <alloca.h> if the file is used inside libintl.
6238 (local_wcslen): New function, for Solaris 2.5.1.
6239 (VASNPRINTF): Use it instead of wcslen.
6241 2003-11-16 Bruno Haible <bruno@clisp.org>
6243 * xsize.h (xmax): New function.
6244 (xsum, xsum3, xsum4): Declare as "pure" functions.
6246 2003-11-12 Paul Eggert <eggert@twinsun.com>
6248 * xalloc.h: Do not include <limits.h> or <stdint.h>.
6249 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
6250 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
6251 heuristic is just as accurate as far as we know, and it removes a
6252 dependency on size_max.m4 and ptrdiff_max.m4.
6254 2003-11-12 Paul Eggert <eggert@twinsun.com>
6256 * xstrtol.c (__xstrtol): Remove "break" immediately after
6257 "return", to pacify some unknown compiler. Problem reported
6260 2003-11-11 Bruno Haible <bruno@clisp.org>
6262 * xsize.h (SIZE_MAX): Remove fallback definition.
6263 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
6266 2003-11-10 Paul Eggert <eggert@twinsun.com>
6268 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
6269 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
6270 rejected some allocations of exactly SIZE_MAX - 2 bytes.
6272 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
6273 not (size_t) -1, since it's defined here.
6275 2003-11-06 Paul Eggert <eggert@twinsun.com>
6277 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
6278 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
6279 Reject sizes of exactly SIZE_MAX bytes.
6280 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
6281 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
6283 2003-11-05 Bruno Haible <bruno@clisp.org>
6285 * xsize.h: Include limits.h, to avoid a possible collision with
6286 SIZE_MAX defined in <limits.h> on Solaris.
6288 2003-11-04 Bruno Haible <bruno@clisp.org>
6290 * xsize.h: New file.
6291 * linebreak.c: Include xsize.h.
6292 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
6293 argument for overflow.
6294 Suggested by Paul Eggert.
6296 2003-10-31 Bruno Haible <bruno@clisp.org>
6298 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
6299 to avoid (extremely rare) race condition.
6300 Suggested by Paul Eggert.
6302 2003-11-03 Jim Meyering <jim@meyering.net>
6304 * userspec.c: Include "userspec.h".
6305 * userspec.h: New file.
6307 2003-10-31 Paul Eggert <eggert@twinsun.com>
6309 * mountlist.h (struct mount_entry.me_type_malloced): New member.
6310 * mountlist.c (SIZE_MAX): Define if not defined already.
6311 (read_filesystem_list): Set and use me_type_malloced.
6312 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
6313 whatever the type happens to be), for brevity and consistency.
6314 Check for size calculation overflow on Alphas running OSF/1.
6316 2003-10-31 Jim Meyering <jim@meyering.net>
6318 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6320 * linebuffer.c: Include <string.h> for declaration of memset.
6322 2003-10-30 Paul Eggert <eggert@twinsun.com>
6323 Bruno Haible <bruno@clisp.org>
6325 * vasprintf.c: Include <limits.h>, <stdlib.h>.
6326 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6328 2003-10-29 Paul Eggert <eggert@twinsun.com>
6330 * xalloc.h (xalloc_oversized): Now a macro, not a function,
6331 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
6333 * quotearg.c (quotearg_n_options): Use it.
6334 * group-member.c: Include <stdbool.h>.
6335 (free_group_info): Arg is now const *; don't free arg.
6336 (get_group_info): Now returns bool and accepts struct group_info *,
6337 rather than returning a malloc'ed struct group_info *.
6338 All uses changed. Check for overflow in internal size calculation.
6340 * getusershell.c (readname): Simplify the code by using x2nrealloc
6341 rather than xmalloc/xrealloc.
6342 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6343 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
6344 conformance bug: the old code used a pointer after freeing the
6345 storage that it addressed.
6346 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6347 rather than doing it by hand.
6348 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6349 the buffer preserved. Use free and xmalloc instead.
6350 * quotearg.c (quotearg_n_options): Likewise.
6351 Use a simpler test for size overflow. Don't use xalloc_oversized
6352 because unsigned int might be wider than size_t (!); this suggests
6353 that we should switch from unsigned int to size_t for slot numbers.
6355 2003-10-27 Bruno Haible <bruno@clisp.org>
6357 * stdbool_.h: Better support for BeOS.
6359 2003-10-27 Paul Eggert <eggert@twinsun.com>
6361 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6362 to allocate the returned structure. Do not allocate a subarray,
6363 as x2nrealloc will do that.
6364 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6365 instead of xnrealloc.
6366 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6368 2003-10-26 Paul Eggert <eggert@twinsun.com>
6370 * xalloc.h (xalloc_oversized): New static inline function, for
6371 callers that want to do their own size-overflow checking. Include
6372 <stdbool.h>, since xalloc_oversized returns bool.
6373 * xalloc.c (array_size_overflow): Remove. All callers changed
6374 to use xalloc_oversized.
6376 Add two functions x2realloc, x2nrealloc, for programs that grow
6377 arrays dynamically by doubling their sizes.
6378 * xalloc.h (x2realloc, x2nrealloc): New decls.
6379 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6382 Port to C99 semantics for 'inline' of external functions.
6383 Bug reported by Bruno Haible.
6384 * xmalloc.c (xnmalloc_inline): New static inline function,
6385 with the old contents of xnmalloc.
6386 (xnmalloc, xmalloc): Use it.
6387 (xnrealloc_inline): New static inline function,
6388 with the old contents of xnrealloc.
6389 (xnrealloc, xrealloc): Use it.
6391 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6393 2003-10-25 Paul Eggert <eggert@twinsun.com>
6395 Fix several address-calculation bugs in the hash modules,
6396 plus some minor code cleanup.
6398 * hash.h: Include <stdbool.h>, for bool.
6399 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6400 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6401 hash_get_n_entries, hash_get_max_bucket_length,
6402 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6403 hash_rehash): Use size_t rather than unsigned.
6404 * hash.c (struct hash_table, hash_get_n_buckets,
6405 hash_get_n_buckets_used, hash_get_n_entries,
6406 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6407 hash_get_entries, hash_do_for_each, hash_string, is_prime,
6408 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6410 (SIZE_MAX): Define if not defined.
6411 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6412 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6414 Use const * when possible.
6415 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6416 (check_tuning): Fix bug: if tuning parameters were very close to
6417 0 or 1, rounding errors could have caused subscript violations.
6418 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6419 (hash_initialize): Add 'fail:' label
6420 to free table and return NULL, and use it to simplify code.
6421 Use calloc rather than clearing the storage ourself.
6422 (hash_initialize, hash_rehash): Check for arithmetic overflow in
6423 buffer size calculations.
6424 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6425 Include <stddef.h>, for size_t.
6426 * hash-pjw.c (hash_pjw): Likewise.
6427 Switch to method described by Bruno Haible.
6428 Include <limits.h>, for CHAR_BIT.
6429 (SIZE_BITS): New macro.
6431 2003-10-21 Paul Eggert <eggert@twinsun.com>
6433 * getndelim2.c (getndelim2): When size calculation overflows,
6434 ceiling the allocation at NMAX bytes rather than silently
6435 discarding input bytes before NMAX is reached. This makes
6436 a difference only if NMAX exceeds SIZE_MAX / 2.
6438 * obstack.c: Merge from glibc.
6439 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6440 Add libc_hidden_def (_obstack_newchunk).
6441 (_obstack_free) [! defined _LIBC]: Remove.
6442 [defined _LIBC]: Make a strong alias from obstack_free, rather than
6443 a clone of the function body.
6444 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6445 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6447 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6448 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6451 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6452 (obstack_ptr_grow_fast, obstack_int_grow_fast):
6453 Don't use lvalue casts, as GCC plans to remove support for them
6454 in GCC 3.5. Reported by Joseph S. Myers. This bug
6455 was also present in the non-GCC version, indicating that this
6456 code had always been buggy and had never been widely used.
6457 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6458 Use the fast variant of each macro, rather than copying the
6459 definiens of the fast variant; that way, we'll be more likely to
6460 catch future bugs in the fast variants.
6462 2003-10-20 Bruno Haible <bruno@clisp.org>
6464 * wait-process.h: New file, from GNU gettext.
6465 * wait-process.c: New file, from GNU gettext.
6467 2003-10-19 Jim Meyering <jim@meyering.net>
6469 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6471 2003-10-16 Paul Eggert <eggert@twinsun.com>
6473 * getgroups.c: Include <errno.h>, <stdlib.h>.
6474 (getgroups): First arg is int, not size_t.
6475 Don't let 'free' mangle errno.
6477 2003-10-16 Jim Meyering <jim@meyering.net>
6479 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6481 2003-10-15 Paul Eggert <eggert@twinsun.com>
6483 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6485 (new_exclude, add_exclude_file): Initial size no longer needs to
6487 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6488 our own address arithmetic overflow checking.
6490 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6491 (fnmatch): Do not alloca more than 2000 wide characters;
6492 instead, use malloc for large buffers.
6493 Check for address arithmetic overflow, and return -1
6494 with errno set to ENOMEM in that case.
6495 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6496 (NEW_PATTERN): Do not alloca more than 8000 bytes;
6497 instead, return -1. Check for address arithmetic overflow.
6499 2003-10-14 Paul Eggert <eggert@twinsun.com>
6501 Handle invalid suffixes and overflow independently, so that
6502 callers can treat them independently as needed. Fix some bugs in
6503 suffix handling, e.g., "100k@" was not diagnosed as an invalid
6504 suffix for a human-readable blocksize. The major caller-visible
6505 change is the addition of a new
6506 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6507 that both overflow and suffix chars were found.
6509 * human.c (humblock): Don't check separately for invalid suffix
6510 char; that is xstrtoumax's job (now that its bug is fixed).
6511 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6512 INTMAX_MAX]: New macros.
6513 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6514 TYPE_MAXIMUM): New macros.
6515 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6516 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6517 if overflow occurs, as it's what __strtol does and it's more useful
6519 (__xstrtol): If __strtol reports some error other than ERANGE,
6520 reflect it to the caller as LONGINT_INVALID. If it reports
6521 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6522 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6523 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6525 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
6526 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6527 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6528 [defined UINTMAX_MAX]: New macros.
6530 2003-10-14 Bruno Haible <bruno@clisp.org>
6532 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6533 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6534 Also use volatile where needed.
6536 2003-10-12 Paul Eggert <eggert@twinsun.com>
6538 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6539 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6540 and define in terms of the other primitives.
6541 * xmalloc.c: Include stdbool.h; do not include exit.h.
6542 (SIZE_MAX): Define if not already defined.
6543 (array_size_overflow): New function.
6544 (xalloc_die): Abort instead of exiting if 'error' returns.
6545 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6546 (xmalloc, xrealloc): Use them.
6547 (xcalloc): Check for address arithmetic overflow.
6548 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6549 a bit faster than strcpy.
6551 2003-10-08 Paul Eggert <eggert@twinsun.com>
6553 Merge getpass from libc, plus a few fixes.
6555 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6556 Include <stdbool.h>.
6557 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6558 __fsetlocking to empty.
6559 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6560 do include <bits/libc-lock.h>.
6561 Do not include <fcntl.h>; not needed.
6562 [_LIBC]: Include <wchar.h>.
6563 (NOTCANCEL_MODE): New macro.
6564 (flockfile, funlockfile) [_LIBC]: New macros.
6565 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6566 [!_LIBC]: New macros.
6567 (call_fclose): New function.
6568 (getpass): Use it. Save tty stream separately; this simplifies the
6569 code and makes it more reliable if stdin happens to equal stdout.
6570 Invoke __fsetlocking on tty.
6571 Handle thread cancellation if needed.
6572 Namespace cleanup (use __tcgetattr, __getline).
6573 Use bool for Booleans.
6574 [USE_IN_LIBIO]: Handle wide streams.
6575 [!_LIBC]: Unconditionally do the fseek, since we don't know what
6576 stream might go where.
6578 * unlocked-io.h: Include <stdio.h>, so that the caller
6579 doesn't have to include <stdio.h> before us.
6580 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6581 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6582 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6583 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6584 if not declared, so that we can use getpass.c code from libc without
6586 (flockfile, ftrylockfile, funlockfile): New macros.
6588 2003-10-06 Bruno Haible <bruno@clisp.org>
6590 * version-etc-2.h: Remove file.
6591 * version-etc-2.c: Remove file.
6593 2003-09-25 Jim Meyering <jim@meyering.net>
6594 Bruno Haible <bruno@clisp.org>
6596 This lets translators provide better translations for the
6597 "Written by ..." part of --version output.
6598 * version-etc.h: Include stdarg.h.
6599 (version_etc_copyright): Declare as readonly.
6600 (version_etc): Make this function variadic with a NULL-terminated list
6601 of author name strings.
6602 (version_etc_va): New declaration.
6603 * version-etc.c: Include stdarg.h, stdlib.h.
6604 (version_etc_copyright): Declare as readonly.
6605 (version_etc_va): New function. Provide a different translatable string
6606 for each possible number of authors < 10. Abbreviate when there are 10
6608 (version_etc): Make this function variadic. Call version_etc_va.
6609 Suggestion from Gary V. Vaughan.
6611 * long-options.h (parse_long_options): Change prototype: the authors
6612 string is moved to the end and becomes variadic.
6613 * long-options.c: Include stdarg.h.
6614 (parse_long_options): Make this function variadic, too.
6615 Call version_etc_va, not version_etc.
6617 2003-10-06 Bruno Haible <bruno@clisp.org>
6619 * fatal-signal.h: New file, from GNU gettext.
6620 * fatal-signal.c: New file, from GNU gettext.
6622 2003-10-04 Karl Berry <karl@gnu.org>
6624 * argp*: update from libc.
6626 2003-10-01 Larry Jones <lawrence.jones@eds.com>
6628 * getpass.c (getpass): Use a no-op fseek when switching from input to
6629 output mode on the same stream.
6631 2003-09-29 Paul Eggert <eggert@twinsun.com>
6633 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6634 Fix arg typo in previous patch.
6636 2003-09-28 Jim Meyering <jim@meyering.net>
6638 * error.c: Correct cpp indentation.
6640 2003-09-27 Paul Eggert <eggert@twinsun.com>
6642 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6643 Omit the special code that used __typeof__, since we worry that
6644 it could be more trouble than it's worth. See:
6645 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6646 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6650 2003-09-26 Jim Meyering <jim@meyering.net>
6652 * error.c (error_tail): Move some declarations
6653 into inner scope where the local variables are used.
6655 2003-09-26 Bruno Haible <bruno@clisp.org>
6657 * stpncpy.h (gnu_stpncpy): New declaration.
6658 (stpncpy): Define as alias for gnu_stpncpy.
6659 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6661 2003-09-26 Paul Eggert <eggert@twinsun.com>
6663 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6664 (error_tail): Do not loop, reallocating temporary buffer, since
6665 the output cannot contain more wide characters than the input
6666 contains bytes, the size must be big enough already. This avoids
6667 one potential size overflow calculation. Check for size overflow
6668 when calculating temporary buffer size. Free temporary buffer
6669 when done, if it was allocated with malloc; this plugs a memory
6670 leak. Remove casts from void * to pointers, that are no longer
6671 needed now that we're assuming C89 or better.
6673 Merge error changes from glibc.
6675 * error.c, error.h: Update copyright notice header to match glibc.
6676 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6677 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6678 Disable cancellation while printing error.
6679 * error.h: Prepend __ to parameter names.
6681 2003-09-25 Karl Berry <karl@gnu.org>
6683 * argp-fmtstream.c, argp-help.c: update from libc.
6685 2003-09-25 Bruno Haible <bruno@clisp.org>
6687 * version-etc-2.h: New file, from version-etc.h with modifications.
6688 * version-etc-2.c: New file, from version-etc.c with modifications.
6690 2003-09-25 Simon Josefsson <jas@extundo.com>
6692 * xgetdomainname.h: New file.
6693 * xgetdomainname.c: New file.
6695 2003-09-25 Simon Josefsson <jas@extundo.com>
6696 Bruno Haible <bruno@clisp.org>
6698 * getdomainname.h: New file.
6699 * getdomainname.c: New file.
6701 2003-09-24 Paul Eggert <eggert@twinsun.com>
6703 * linebuffer.c (freebuffer): Don't free the argument, just
6704 the buffer associated with the argument. Bug reported by
6707 2003-09-19 Karl Berry <karl@gnu.org>
6709 * argp.h: update from libc.
6711 2003-09-16 Paul Eggert <eggert@twinsun.com>
6713 * linebuffer.c (readlinebuffer): Return NULL immediately upon
6714 input error, instead of returning NULL the next time we are called
6715 (and therefore losing track of errno).
6717 2003-09-15 Paul Eggert <eggert@twinsun.com>
6719 * getndelim2.c (getndelim2): Don't trash errno when a read
6720 fails, so that the caller gets the proper errno.
6722 * readutmp.c (read_utmp): Likewise.
6723 Check for fstat error. Close stream and free storage
6726 2003-09-14 Bruno Haible <bruno@clisp.org>
6728 * fwriteerror.h: New file.
6729 * fwriteerror.c: New file.
6731 2003-09-14 Jim Meyering <jim@meyering.net>
6733 * getloadavg.c: Correct cpp indentation.
6734 * strdup.c: Likewise.
6735 * vasnprintf.c: Likewise.
6737 2003-09-12 Paul Eggert <eggert@twinsun.com>
6739 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6740 * obstack.c [!defined _LIBC]: Likewise.
6741 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6742 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6743 * exitfail.c: Don't include stdlib.h; no longer needed.
6745 More changes to assume C89 or better.
6747 * error.c (error_tail): Assume vprintf.
6749 * argmatch.c (getenv): Remove decl.
6750 * progreloc.c (get_full_program_name): Define via prototype.
6751 * setenv.c (clearenv): Likewise.
6752 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6754 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6755 (malloc, memcpy): Remove decls.
6756 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6757 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6758 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6759 (memcpy): Remove macro.
6760 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6761 (__P): Remove. All uses removed.
6762 (PTR): Remove. All uses changed to void *.
6763 (CHAR_BIT, NULL): Remove.
6764 (spaces, zeros, memset_space, memset_zero)
6765 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6767 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6768 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6769 Define with prototype.
6770 Remove now-unnecessary prototype decl.
6771 (extra_args_spec): Assume ANSI C. All uses changed.
6772 (extra_args_spec_iso): Remove.
6773 (my_strftime, emacs_strftimeu): Define via prototype.
6774 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6776 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6777 * strtoimax.c: Include <stdlib.h> unconditionally.
6778 (strtoul, strtol): Remove decls.
6779 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6781 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6782 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
6783 (LOCALE_PARAM_PROTO): New macro.
6784 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6785 (INTERNAL (strtol), strtol): Define with a prototype.
6786 (PARAMS): Remove. All uses removed.
6787 * tempname.c: Include <string.h> unconditionally.
6788 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6789 * xgethostname.c (main): Define with a prototype.
6790 * xmalloc.c: Include "xalloc.h" first, to check interface.
6791 Include <stdlib.h> unconditionally.
6792 (calloc, malloc, realloc, free): Remove decls.
6793 * xstrtod.c: Include "xstrtod.h" first, to check interface.
6794 Include <stdlib.h> unconditionally. Sort include file names.
6796 (xstrtod): Define with a prototype.
6797 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6798 (strtol, strtoul): Remove decls.
6800 2003-09-11 Paul Eggert <eggert@twinsun.com>
6802 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6803 Include <stdlib.h>, <string.h> unconditionally.
6804 Remove now-unnecessary cast to char *.
6805 * strnlen.c: Include <string.h> unconditionally.
6806 * yesno.c (yesno): Define with a prototype.
6808 2003-09-10 Bruno Haible <bruno@clisp.org>
6810 * strcspn.c: Include <string.h> unconditionally.
6811 * strpbrk.c: Include <string.h> unconditionally.
6812 * strstr.c: Include <string.h> unconditionally.
6813 * unicodeio.c: Include <string.h> unconditionally.
6814 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6815 * unsetenv.c: Likewise.
6816 * xreadlink.c: Include <stdlib.h> unconditionally.
6817 * yesno.c: Include <stdlib.h> unconditionally.
6818 (rpmatch): Add prototype.
6820 2003-09-10 Jim Meyering <jim@meyering.net>
6822 * error.c: Correct indentation of cpp directives.
6824 2003-09-09 Paul Eggert <eggert@twinsun.com>
6828 * acosl.c (main): Use a prototype.
6829 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6832 * getloadavg.c (getloadavg, main): Define via prototypes.
6834 * getopt.h (struct option.name): Assume C89, and use 'const'.
6835 (getopt, etopt_long, getopt_long_only, _getopt_internal)
6836 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6838 * getopt.c (const): Remove macro.
6839 Include <string.h> unconditionally.
6840 (my_index): Remove; all uses changed to strchr.
6841 (strlen): Remove decl.
6842 (exchange): Remove forward decl; no longer needed.
6843 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6844 Define with prototype.
6845 * getopt1.c (const): Remove macro.
6846 (getopt_long, getopt_long_only, main): Define with prototype.
6848 * getugroups.c: Include <string.h> unconditionally.
6850 * getusershell.c: Include <stdlib.h> unconditionally.
6851 (getusershell, setusershell, endusershell, readname, main):
6852 Define with prototypes.
6854 * group-member.c: Include group-member.h first.
6855 Include <stdlib.h> unconditionally.
6857 * hard-locale.c: Include hard-locale.h first.
6858 Include <stdlib.h>, <string.h> unconditionally.
6860 * hash.c (free, malloc): Remove decls.
6861 Include <stdlib.h> unconditionally.
6863 * human.c: Include <stdlib.h>, <string.h> unconditionally.
6864 (getenv): Do not declare.
6866 * idcache.c: Include <string.h> unconditionally.
6868 * long-options.c: Include long-options.h first, to test interface.
6869 Include <stdlib.h> unconditionally.
6871 * makepath.c: Include makepath.h first, to test interface.
6872 Include <stdlib.h> and <string.h> unconditionally.
6874 * linebuffer.c: Include <stdlib.h>.
6875 (free): Remove decl.
6877 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6878 rpl_malloc returns void *, not char *.
6879 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
6881 * md5.h: Include <limits.h> unconditionally.
6882 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6883 (__P): Remove; all uses removed.
6884 * md5.c: Include "md5.h" first.
6885 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6886 md5_buffer, md5_process_bytes, md5_process_block):
6887 Define with prototypes.
6888 * sha.h (__P): Remove all uses. (It wasn't defined??)
6889 * sha.c: Include "sha.h" first.
6890 Include <stdlib.h>, <string.h> unconditionally.
6892 * memchr.c (__ptr_t): Remove; all uses changed to void *.
6893 * memcmp.c (__ptr_t): Likewise.
6894 * memrchr.c (__ptr_t): Likewise.
6895 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6896 Include <string.h> unconditionally.
6897 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6898 * memchr.c: Include <stdlib.h> unconditionally.
6899 * memchr.c (LONG_MAX): Remove.
6900 * memrchr.c (LONG_MAX): Likewise.
6901 * memchr.c (__memchr): Define via a prototype.
6902 * memrchr.c (__memrchr): Likewise.
6903 * memcmp.c (__P): Remove, and remove all uses.
6904 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6905 Remove forward decls; no longer needed.
6906 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6907 Use types required by C89 in prototype.
6909 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6910 * savedir.c: Likewise.
6911 * mkdir.c (free): Remove decl.
6912 * rmdir.c (rmdir): Define with a prototype.
6913 * savedir.c: Include savedir.h first, to test interface.
6915 * mktime.c (STDC_HEADERS): Remove.
6916 Include <stdlib.h>, <string.h> unconditionally.
6918 * modechange.c: Include <stdlib.h> unconditionally.
6919 (malloc): Remove decl.
6921 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6922 (free): Remove decl.
6924 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6925 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6926 (This type really should be intptr_t, but that's a C99ism.)
6927 (_obstack_memcpy): Remove: all uses changed to memcpy.
6928 Include <string.h> unconditionally.
6929 (struct obstack): Assume __STDC__ for types of members
6930 chunkfun, freefun, extra_arg.
6931 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6932 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6933 obstack_begin, obstack_specify_allocation,
6934 obstack_specify_allocation_with_arg, obstack_chunkfun,
6935 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6936 Remove unprototyped decls and the macros that use them.
6937 * obstack.c (POINTER): Remove. All uses changed to void *.
6938 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6939 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6940 (defined __STDC__ && __STDC__)]:
6941 Remove nonprototyped code.
6942 Include <stdlib.h> unconditionally.
6943 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6944 _obstack_allocated_p, _obstack_free, obstack_free,
6945 _obstack_memory_used, print_and_abort):
6946 Define using prototypes.
6947 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6948 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6949 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6950 obstack_next_free, obstack_object_size, obstack_room) [0]:
6951 Remove unused, unprototyped code.
6953 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6955 * physmem.c (physmem_total, physmem_available, main): Define
6958 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6959 (main): Define with a prototype.
6961 * posixver.c (getenv): Remove decl.
6963 * putenv.c (malloc): Returns void *, not char *.
6964 Include <string.h> unconditionally.
6965 (strchr, memcpy, NULL): Do not define.
6967 * readtokens.c: Include readtokens.h first, to test interface.
6968 Include <stdlib.h>, <string.h> unconditionally.
6969 (init_tokenbuffer): Define with a prototype.
6971 * regex.c (PARAMS): Remove. All uses removed.
6972 All uses of _RE_ARGS removed, too.
6973 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6975 (bzero): Assume memset exists.
6976 (memcmp, memcpy, NULL): Remove.
6977 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6978 char, or assignments to local vars of type signed char.
6979 (init_syntax_once, PREFIX(extract_number_and_incr),
6980 PREFIX(print_partial_compiled_pattern),
6981 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6982 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6983 PREFIX(regex_grow_registers), PREFIX(regex_compile),
6984 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6985 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6986 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6987 wcs_compile_range, byte_compile_range, truncate_wchar,
6988 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6989 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6990 count_mbs_length, wcs_re_match_2_internal,
6991 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6992 PREFIX(alt_match_null_string_p),
6993 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6994 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6995 regfree, PREFIX(extract_number)): Define with prototype. Remove
6996 now-unnecessary declaration, if any.
6997 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6999 Remove now-unnecessary casts among pointer types.
7000 * regex.h (_RE_ARGS): Remove. All uses removed.
7002 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
7003 (free): Remove decl.
7005 * rpmatch.c: Include <stdlib.h> unconditionally.
7007 * same.c: Include <stdlib.h>, <string.h> unconditionally.
7008 (free): Remove decl.
7010 * save-cwd.c: Include <stdlib.h> unconditionally.
7011 * xgetcwd.c: Likewise.
7013 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
7014 (free): Remove decl.
7016 * strchrnul.c (strchrnul): Define with a prototype.
7017 Fix bug: c_in was not converted to char before searching.
7019 The following changes are not K&R related:
7021 * group-member.h: Include <sys/types.h>, so that this file is
7023 * makepath.h: Likewise.
7025 * getusershell.c (readname, default_index, line_size, readname):
7026 Use size_t, not int, for sizes.
7027 (readname): If the size overflows, report an error instead of
7030 2003-09-09 Derek Robert Price <derek@ximbiot.com>
7032 * getndelim2.c: Assume stdlib.h per the C89 spec.
7034 2003-09-08 Paul Eggert <eggert@twinsun.com>
7036 Assume C89 or better; remove K&R cruft.
7037 A few of these changes were first proposed by Derek Robert Price
7038 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
7040 * addext.c: Include <string.h> unconditionally.
7041 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
7042 Don't declare getenv or malloc.
7044 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
7045 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
7047 (find_stack_direction, alloca): Use prototypes.
7049 * atexit.c (atexit): Define using a prototype.
7051 * basename.c, dirname.c, stripslash.c:
7052 Include <string.h> unconditionally.
7054 * bcopy.c: Include <stddef.h>.
7055 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
7057 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
7059 * error.h (error, error_at_line, error_print_progname)
7060 [! (defined (__STDC__) && __STDC__)]: Remove decls.
7061 * error.c: Include error.h first, to check interface.
7062 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7063 (VA_START): Remove; all uses changeed to va_start.
7064 (exit, strerror): Remove decls.
7065 (error_print_progname): Prototype uncondionally.
7066 Don't include <errno.h>; no longer needed.
7067 (private_strerror): Remove.
7068 (error_tail): Always define.
7069 (error, error_at_line): Assume C89 or better; always use prototypes.
7070 * fatal.c: Include "fatal.h" first, to test interface.
7071 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
7072 (VA_START): Remove; all uses changed to va_start.
7073 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
7075 (exit): Remove decl.
7076 (fatal): Prototype unconditionally. Assume va_start works.
7077 Abort at end, to pacify gcc.
7079 * euidaccess.c (main): Define with a prototype.
7081 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
7083 * exitfail.c: Include <stdlib.h> unconditionally.
7085 * fnmatch_.h (__P): Remove. All uses changed to assume
7087 * fnmatch.c: Include fnmatch.h first, to test interface.
7088 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
7089 (getenv): Remove decl.
7090 (fnmatch): Define using a prototype.
7091 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
7092 (FCT): Define using a prototype.
7094 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
7096 * gethostname.c: Include <stddef.h>.
7097 (gethostname): Define with prototype. Length is size_t, not int.
7099 2003-09-08 Paul Eggert <eggert@twinsun.com>
7101 * getversion.c: Remove; was migrated to backupfile.c in 1997.
7102 getversion.c should have been removed then, but was accidentally
7105 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
7106 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
7108 2003-09-07 Paul Eggert <eggert@twinsun.com>
7110 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
7111 copy_tm_result. Bug reported by Simon Josefsson in
7112 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
7114 2003-09-06 Paul Eggert <eggert@twinsun.com>
7116 * time_r.c, time_r.h: New files.
7118 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
7120 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
7121 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
7123 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
7125 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
7126 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
7129 * timegm.c: Switch to glibc implementation, with the following changes:
7130 [defined HAVE_CONFIG_H]: Include <config.h>.
7131 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
7132 (__mktime_internal) [!defined _LIBC]: New decl.
7133 (__gmtime_r) [!defined _LIBC]: New macro and function.
7134 (timegm): Use a prototype, since gnulib assumes C89.
7135 Do not bother declaring tmp to be const, as it's not really usefu.
7136 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
7137 (timegm): Declare only if HAVE_DECL_TIMEGM.
7139 2003-09-03 Paul Eggert <eggert@twinsun.com>
7141 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
7142 Bug reported by Lute Kamstra in
7143 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
7145 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
7146 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
7147 course with correspondingly smaller numbers for tomorrow and
7148 yesterday. From Tadayoshi Funaba. Originally installed into
7149 sh-utils on 1999-08-07, but the patch got lost (I guess during the
7152 2003-08-31 Simon Josefsson <jas@extundo.com>
7154 * timegm.h: New file.
7155 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
7157 2003-08-31 Karl Berry <karl@gnu.org>
7159 * argp.h: update from libc.
7161 2003-08-28 Bruno Haible <bruno@clisp.org>
7163 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
7164 warning on QNX, which defines O_BINARY to 000000.
7166 2003-08-24 Bruno Haible <bruno@clisp.org>
7168 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
7169 MSVC7 <stdio.h> is included later.
7171 2003-08-20 Bruno Haible <bruno@clisp.org>
7173 * progname.h: New file, from GNU gettext.
7174 * progname.c: New file, from GNU gettext.
7175 * progreloc.c: New file, from GNU gettext.
7177 2003-08-19 Bruno Haible <bruno@clisp.org>
7179 * xstrdup.c: Assume <string.h> exists.
7181 2003-08-18 Jim Meyering <jim@meyering.net>
7183 * setenv.h: Indent nested cpp directive.
7184 * vasnprintf.c: Remove trailing blanks.
7186 2003-08-17 Simon Josefsson <jas@extundo.com>
7187 Bruno Haible <bruno@clisp.org>
7189 * xstrndup.h: New file.
7190 * xstrndup.c: New file.
7192 2003-08-17 Bruno Haible <bruno@clisp.org>
7194 * strndup.h: New file.
7196 2003-08-16 Paul Eggert <eggert@twinsun.com>
7198 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
7199 space, undoing this 2003-08-12 change:
7200 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
7202 2003-08-16 Jim Meyering <jim@meyering.net>
7204 Merge from coreutils.
7205 * xstrtoimax.c: #else #if -> #elif.
7206 * xstrtoumax.c: Likewise.
7208 2003-08-15 Paul Eggert <eggert@twinsun.com>
7210 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
7211 rather than tab, after '#' in shell-script copyright notices.
7212 Suggested by Bruno Haible.
7214 2003-08-15 Jim Meyering <jim@meyering.net>
7215 and Paul Eggert <eggert@twinsun.com>
7217 Merge from coreutils.
7218 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
7219 member but strut utmpx does not. Needed for AIX 4.3.3.
7220 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
7222 2003-08-15 Jim Meyering <jim@meyering.net>
7224 Merge from coreutils.
7225 * xgethostname.c: Include <stdlib.h>.
7226 (xghostname): Don't exit for anything other than memory-related
7227 failure; just return NULL.
7228 * userspec.c: Include "posixver.h".
7229 (parse_user_spec): Accept `.' as a separator only
7230 in pre-POSIX-200112 mode.
7231 * strtoimax.c: Use #elif rather than #else #if.
7232 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
7233 Remove function, now that we can rely on a working tzset function.
7234 [!_LIBC]: Ensure that the required autoconf test has been run.
7235 [!defined _NL_CURRENT && HAVE_STRFTIME]:
7236 Use underlying_strftime for %r.
7237 * sha.c: Merge in some clean-up and optimization changes from glibc.
7238 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
7239 Ensure that it is a multiple of 64.
7240 Rearrange loop exit tests so as to avoid performing an
7241 additional fread after encountering an error or EOF.
7242 * realloc.c: Update copyright date.
7244 2003-08-14 Jim Meyering <jim@meyering.net>
7246 Merge from coreutils.
7247 * obstack.h: Whitespace changes.
7248 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
7249 and xcalloc return values.
7250 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
7251 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
7252 hang on OSF/1 5.1 for DIR on both local and remote file systems.
7253 Reported by (and fix confirmed by) Nelson H. F. Beebe.
7254 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7256 Use mntctl's return value to drive the entry-processing loop, since
7257 we can't rely on the value of the vmt_length member in the last
7258 entry. On some systems doing so could result in exhausting
7259 virtual memory. Based in part on a patch from Mike Jetzer.
7261 2003-08-14 Jim Meyering <jim@meyering.net>
7262 and Paul Eggert <eggert@twinsun.com>
7264 Merges from coreutils, plus other fixes.
7265 * physmem.c: Merge in portability changes from gcc/libiberty
7266 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
7267 for credits and details. Thanks to Kaveh Ghazi for helping
7268 to keep these files in sync.
7269 (ARRAY_SIZE): Define it.
7270 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
7271 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
7272 (memcasecmp): Don't assume size_t fits in unsigned int.
7273 Remove casts and duplicate code.
7274 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
7275 (memcpy): Remove definition.
7276 Merge in some clean-up and optimization changes from glibc.
7277 [BLOCKSIZE]: Move definition to top of file.
7278 Ensure that it is a multiple of 64.
7279 Rearrange loop exit tests so as to avoid performing an
7280 additional fread after encountering an error or EOF.
7281 * md5.h (md5_uintptr): Define.
7282 * makepath.c (CLEANUP_CWD): Report an error if we failed to
7283 return to the initial working directory. Preserve errno
7285 * idcache.c: Include "xalloc.h".
7286 (xmalloc, xrealloc): Remove decls.
7287 (getuser): Remove casts no longer required in C89.
7288 * human.c: Include stdio.h, for sprintf.
7289 * group-member.c: Include "xalloc.h".
7290 (xmalloc, xrealloc): Remove decls.
7291 (get_group_info): Remove casts no longer required in C89.
7292 * getusershell.c (readname): Remove casts no longer required in C89.
7293 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
7294 * getline.c: Whitespace fix, from coreutils.
7296 2003-08-13 Paul Eggert <eggert@twinsun.com>
7298 * exclude.c: Include <ctype.h>
7299 (IN_CTYPE_DOMAIN): New macro.
7301 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
7304 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7305 Undo previous (whitespace-only) change.
7307 2003-08-12 Paul Eggert <eggert@twinsun.com>
7309 * argp-help.c, argp-parse.c, config.charset, getopt.h:
7310 Normalize leading white space and remove trailing white space.
7311 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
7312 notice, as per ../config/srclist-update.
7314 Merge from coreutils.
7315 * euidaccess.h: New file.
7316 * euidaccess.c: Include it.
7317 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7318 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
7319 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7321 2003-08-11 Bruno Haible <bruno@clisp.org>
7323 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7324 (vasnprintf): Use it instead of wcslen.
7326 2003-08-11 Bruno Haible <bruno@clisp.org>
7328 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7329 value to ensure that _Bool promotes to int. Use #define for _Bool when
7330 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7332 2003-08-10 Karl Berry <karl@gnu.org>
7334 * regex.h: update from libc (whitespace fix).
7336 2003-08-09 Paul Eggert <eggert@twinsun.com>
7338 Merge some files from coreutils. These changes were
7339 originally made by Jim Meyering.
7340 * acl.c: Include <sys/types.h> before <sys/stat.h>;
7341 many older Unixes require this.
7342 * alloca.c (alloca): Remove cast to argument of free;
7343 no longer needed in C89.
7344 * alloca_.h, regex.h: Fix white space to match
7345 what GNU indent does.
7347 2003-08-05 Paul Eggert <eggert@twinsun.com>
7349 * bumpalloc.h: Remove.
7351 2003-08-04 Paul Eggert <eggert@twinsun.com>
7353 * getloadavg.c: Change copyright notice and spacing to conform to
7356 Merge from coreutils.
7357 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7359 * getdate.y (date): Also accept dates like May-23-2003; suggestion
7360 from Karl Berry, implemented by Jim Meyering.
7361 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7362 from Dmitry V. Levin.
7363 Remove anachronistic cast of xrealloc.
7364 * fnmatch_.h (__const): Remove. Use 'const'.
7365 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7366 type. Otherwise, it wouldn't compile with at least /bin/cc on
7367 ymp-cray-unicos9.0.2.X.
7368 Combine two mostly-identical uses of alloca into one.
7369 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7371 2003-08-04 Dave Love <d.love@dl.ac.uk>
7375 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
7376 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
7377 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7378 obsolete NLIST_NAME_UNION.
7379 [__GNU__]: Undef BSD and FSCALE.
7380 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7382 2003-08-03 Paul Eggert <eggert@twinsun.com>
7384 * stdbool_.h (_Bool): Make it signed char, instead of
7385 an enum type, so that it's guaranteed to promote to int. See:
7386 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7388 2003-07-31 Paul Eggert <eggert@twinsun.com>
7390 * strerror.c: Include config.h, limits.h. Declare sprintf.
7391 (strerror): Don't assume that a printable int fits in 14 bytes.
7393 2003-07-24 Derek Robert Price <derek@ximbiot.com>
7394 Bruno Haible <bruno@clisp.org>
7396 * getline.h (getline, getdelim): Change return type to ssize_t.
7397 * getline.c (getline, getdelim): Likewise.
7398 Remove _GNU_SOURCE define; now it's defined in config.h through
7401 2003-07-22 Paul Eggert <eggert@twinsun.com>
7403 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7404 over-parenthesization in macros.
7406 Sync with coreutils.
7408 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7411 Use `exit_failure' for xalloc and xmemcoll instead of their own
7412 private exit-failure variables.
7413 * xalloc.h (xalloc_exit_failure): Remove.
7414 * xmalloc.c: Likewise. Include exitfail.h.
7415 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7416 * xmemcoll.h (xmemcoll_exit_failure): Remove.
7417 * xmemcoll.c: Likewise. Include exitfail.h.
7418 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7420 2003-07-18 Paul Eggert <eggert@twinsun.com>
7422 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7423 * closeout.c: Likewise. Include "closeout.h" right after config.h,
7424 to test that it can stand by itself. Include "exitfail.h".
7425 Clients should set exit_failure instead.
7426 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
7428 2003-07-18 Andreas Schwab <schwab@suse.de>
7430 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7432 2003-07-18 Bruno Haible <bruno@clisp.org>
7434 * getndelim2.h: New file.
7435 * getndelim2.c: Make into a module of its own. Include config.h,
7437 (getndelim2): Make non-static. Change return type to ssize_t.
7438 * getline.h: Change argument names.
7439 * getline.c: Include getndelim2.h instead of getndelim2.c.
7440 * getnline.c: Include getndelim2.h.
7442 2003-07-17 Bruno Haible <bruno@clisp.org>
7444 * Makefile.am: Remove file.
7445 * Makefile.in: Remove file.
7447 2003-07-17 Bruno Haible <bruno@clisp.org>
7449 * getnline.h: New file.
7450 * getnline.c: New file.
7451 * getndelim2.c: New file, extracted from getline.c.
7452 (getndelim2): Renamed from getdelim2, with added nmax argument.
7453 * getline.c: Include getndelim2.c.
7454 (getdelim2): Moved out to getndelim2.c.
7455 (getline, getdelim): Update.
7457 2003-07-15 <karl@gnu.org>
7459 * vasnprintf.c: update from gettext.
7461 2003-07-15 Jim Meyering <jim@meyering.net>
7463 * makepath.c (make_path): Enclose diagnostic in _(...).
7465 2003-07-14 Paul Eggert <eggert@twinsun.com>
7467 * asnprintf.c, asprintf.c, config.charset, gettext.h,
7468 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7469 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7470 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7471 vasprintf.c, vasprintf.h: Regenerate. These files are now being
7472 updated automatically by ../config/srclist-update. This changes
7473 their license from LPGL to GPL.
7475 2003-07-14 Jim Meyering <jim@meyering.net>
7477 Don't emit diagnostics. Let callers do that.
7478 * save-cwd.c: Don't include "error.h".
7479 (save_cwd): Don't call error. Ensure that errno is valid
7480 when returning nonzero.
7482 * save-cwd.h (restore_cwd): Update prototype.
7483 * save-cwd.c (restore_cwd): Remove two parameters.
7484 Simplify. Don't call error upon failure. Let callers do that.
7485 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7486 when auditing is enabled. But don't bother updating the #if.
7488 2003-07-14 Simon Josefsson <jas@extundo.com>
7490 * mempcpy.h: New file.
7491 * mempcpy.c: New file.
7493 2003-07-14 Paul Eggert <eggert@twinsun.com>
7495 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7496 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7497 unicodeio.c, unicodeio.h, unlocked-io.h:
7498 Switch from LGPL to GPL.
7500 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
7502 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7503 it breaks C++ compilation.
7504 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7506 2003-07-10 Jim Meyering <jim@meyering.net>
7508 * vasnprintf.c: Remove trailing blanks.
7509 Make cpp indentation consistent.
7511 2003-07-09 Paul Eggert <eggert@twinsun.com>
7513 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7514 posixver.c, strftime.c, strnlen.c, strverscmp.c:
7515 Switch from LGPL to GPL.
7517 2003-07-07 Paul Eggert <eggert@twinsun.com>
7519 * mktime.c: Fix some boundary cases and remove need for floating point.
7521 Issue a compile-time diagnostic if time_t is floating point, or if
7522 two's complement arithmetic is not in effect, or if arithmetic
7523 right shift does not propagate the sign. These assumptions were
7524 all in the original code but they weren't checked.
7526 (TIME_T_MIDPOINT, verify): New macros.
7527 (__isleap): Remove; it has integer overflow problems.
7528 (leapyear): New function, without those problems.
7529 (ydhms_tm_diff): Remove; splitting into two parts.
7530 (ydhms_diff): New function, containing the arithmetic part of
7531 the old ydhms_tm_diff function. Issue a compile-time
7532 diagnostic if we are not using C99 integer division.
7533 Avoid casts when possible.
7534 (guess_time_tm): New function, containing the checking part of
7535 the old ydhms_tm_diff function. Return the new value, rather than
7536 the difference between it and the old. Accept a new argument T
7537 so that *T specifies the old value. Check for overflow in the result.
7539 (__mktime_internal): Use a time_t offset, not a long int offset.
7540 This undoes the 2003-06-04 change, which is no longer needed now
7541 that we have better overflow checking.
7542 (localtime_offset): Likewise.
7544 (__mktime_internal): Avoid harmful overflow on hosts where time_t
7545 and long are 64-bit but int is only 32-bit.
7546 (ydhms_diff): Use long int to store year1 and yday1.
7547 Issue a compile-time diagnostic if long int is not wide enough.
7549 (__mktime_internal): Use long int to store adjusted year and yday.
7550 Use plain C rather than preprocessor commands, if that doesn't
7552 Check for overflow (and try to repair) after each probe
7553 rather than checking only at the very end. This avoids some bugs
7554 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7555 does not equal GMT offset at maximum time).
7556 Use integer to check for overflow rather than floating point; this
7557 is more portable to non-IEEE hosts, and is a tad faster.
7558 When we detect that we are oscillating between two values,
7559 don't check whether tm_isdst has the requested value, since
7560 we already know the answer. When tm_isdst has the wrong value,
7561 use a different heuristic to find the right one, based on the
7562 extreme values actually observed in practice in tz2003a,
7563 rather than the (overly optimistic) "previous 3 calendar quarters".
7565 (not_equal_tm, print_tm, check_result): Use "const T" rather than
7566 "T const" to accommodate glibc style.
7567 (check_result): Use less-confusing report format. "long" -> "long int.
7569 Don't loop if the iteration overflows time_t.
7570 Allow a negative step in the iteration.
7572 2003-07-01 Paul Eggert <eggert@twinsun.com>
7574 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7575 having it depend on HAVE_SYS_TYPES_H.
7577 2003-06-25 Bruno Haible <bruno@clisp.org>
7579 * readlink.c: New file.
7581 2003-06-20 Bruno Haible <bruno@clisp.org>
7583 Assume C89, so PARAMS isn't needed.
7584 * unicodeio.h (PARAMS): Remove.
7585 * unicodeio.c: Don't use PARAMS.
7587 2003-06-18 Jim Meyering <jim@meyering.net>
7589 Merge changes from coreutils.
7590 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7591 Remove explicit declarations of xmalloc and realloc.
7593 (read_utmp): Remove anachronistic cast of xmalloc.
7595 2003-06-17 Paul Eggert <eggert@twinsun.com>
7597 Assume C89, so PARAMS isn't needed.
7598 * backupfile.h (PARAMS): Remove. All uses removed.
7599 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7600 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7601 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7602 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7603 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7604 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7605 xstrtol.h: Likewise.
7606 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7607 same.h, strverscmp.h: Do not include config.h; no longer needed.
7608 Anyway, config.h should always be included before any other file.
7610 2003-06-11 Simon Josefsson <jas@extundo.com>
7612 * sysexit_.h: New file.
7614 2003-05-20 Derek Price <derek@ximbiot.com>
7616 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7618 2003-06-10 Simon Josefsson <jas@extundo.com>
7620 * strchrnul.h: New file.
7621 * strchrnul.c: New file.
7623 2003-06-10 Simon Josefsson <jas@extundo.com>
7625 * argp.h: New file, from glibc.
7626 * argp-ba.c: New file, from glibc.
7627 * argp-eexst.c: New file, from glibc.
7628 * argp-fmtstream.c: New file, from glibc.
7629 * argp-fmtstream.h: New file, from glibc.
7630 * argp-fs-xinl.c: New file, from glibc.
7631 * argp-help.c: New file, from glibc.
7632 * argp-namefrob.h: New file, from glibc.
7633 * argp-parse.c: New file, from glibc.
7634 * argp-pv.c: New file, from glibc.
7635 * argp-pvh.c: New file, from glibc.
7636 * argp-xinl.c: New file, from glibc.
7638 2003-06-07 Jim Meyering <jim@meyering.net>
7640 * readtokens.h: Put `Free Software Foundation, Inc.'
7641 in place of my name in the copyright comment.
7642 Remove definition and uses of __P.
7645 * stat.c: Don't declare xmalloc explicitly.
7646 Instead, include "xalloc.h".
7647 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7648 xrealloc, and xcalloc return values.
7649 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7651 * xgetcwd.h: Remove definition/uses of PARAMS.
7653 2003-06-06 Jim Meyering <jim@meyering.net>
7655 * stdbool_.h: Renamed from stdbool.h.in.
7657 2003-06-06 Jim Meyering <jim@meyering.net>
7659 Merge from coreutils.
7660 * same.c: (same_name): Declare *_basename locals to be `const'.
7661 Consolidate declarations and initializations of *_base* locals.
7663 Merge from coreutils.
7664 This avoids a core dump on systems without GNU putenv,
7665 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7666 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7667 (unsetenv): New static function, from GNU libc.
7668 (rpl_putenv): Use it.
7670 * modechange.c: Remove trailing blanks.
7672 Merge from coreutils.
7673 * fsusage.c: Remove declaration of statfs.
7674 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7676 * posixtm.c: Include <stdbool.h> unconditionally.
7678 2003-06-05 Paul Eggert <eggert@twinsun.com>
7680 * mktime.c (__mktime_internal): When resolving a tm_isdst
7681 mismatch, look in future quarters as well as past. This fixes a
7682 bug when processing fall-backwards gaps immediately after a long
7683 period of daylight-saving time.
7685 * mktime.c: Assume freestanding C89 or better.
7686 (HAVE_LIMITS_H): Remove. Assume it's 1.
7687 (__P): Remove; not used.
7688 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7689 (mktime, not_equal_tm, print_tm, check_result,
7690 main): Use prototypes. Use const * where appropriate.
7691 (main): Fix typo in testing code that uncovered by above changes.
7692 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7694 2003-06-04 Paul Eggert <eggert@twinsun.com>
7696 * mktime.c: Fix Debian bug 177940
7697 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7698 (localtime_offset): Now long int, not time_t, because we want it
7699 to be guaranteed to be signed. All uses changed.
7700 (__mktime_internal): If overflow would occur when adding offset,
7703 Merge 'human' changes from coreutils. Rewrite to support
7704 locale-specific notations like thousands separators.
7705 * human.c: Simplify authorship notice.
7706 Include human.h immediately after config.h.
7707 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7708 <limits.h>: Do not include, since human.h does.
7709 (SIZE_MAX, UINTMAX_MAX): New macros.
7710 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7711 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7712 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7713 (power_letter): Renamed from suffixes.
7714 (generate_suffix_backwards): Remove.
7715 (adjust_value): Now takes int style (because of human.h changes)
7716 and long double value (for greater precision on some platforms).
7717 (group_number): New function.
7718 (human_readable): Use it. Use integer options, not enum.
7719 Put the options before the sizes in the arg list.
7720 Support all the new options.
7721 The old human_readable function has been removed;
7722 use inttostr.h instead.
7723 (human_readable, default_block_size, humblock):
7724 Use uintmax_t, not int, for block sizes.
7725 (human_readable_inexact, block_size_types): Remove.
7726 (block_size_opts): New constant.
7727 (human_options): Renamed from human_block_size, with new signature
7728 that allows block sizes up to UINTMAX_MAX. All callers changed.
7729 * human.h: Add copyright and authorship notice.
7730 Include <limits.h> and <stdbool.h> unconditionally.
7731 (PARAMS): Remove. All uses removed.
7732 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7733 (enum human_inexact_style): Remove tag; now a nameless enum.
7734 (human_floor, human_ceiling, human_round_to_even): Now have
7735 values 2, 0, 1 rather than -1, 1, 0.
7736 (human_group_digits, human_suppress_point_zero, human_autoscale,
7737 human_base_1024, human_SI, human_B): New constants.
7738 (human_readable_inexact, human_block_size): Remove.
7739 (human_readable): Size args are now uintmax_t, not int.
7740 (human_options): New decl.
7742 * exclude.c: (new_exclude, add_exclude): Remove casts that are
7743 unnecessary now that we assume C89 or better. This change
7744 imported from coreutils.
7746 * mktime.c (__mktime_internal): Do not reject negative timestamps
7747 arbitrarily. This is the same patch as 2003-05-28, but it got lost
7748 in the 2003-05-30 sync from glibc.
7750 .h files should stand alone, but we shouldn't include <sys/types.h>
7751 if we can get away with just <stddef.h>.
7753 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7754 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7755 rather than <sys/types.h>, as we merely need size_t.
7756 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7758 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7759 Include <stdio.h>, to get FILE.
7760 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7761 memcasecmp.h has included <stddef.h> and all we need is size_t.
7762 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7763 our interface, instead of including <sys/types.h>
7765 2003-06-02 Paul Eggert <eggert@twinsun.com>
7768 Fix some minor time-related bugs with POSIX time arguments.
7769 Some valid time stamps were being rejected (notably -1, and
7770 time stamps before 1900 on 64-bit hosts). And some invalid
7771 time stamps were being accepted, e.g. September 31.
7773 * posixtm.h (posixtime): Return bool instead of time_t, so
7774 that we can return (time_t) -1 successfully.
7775 * posixtm.c: Likewise.
7776 [HAVE_STDBOOL_H]: Include <stdbool.h>.
7777 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7778 (t): Remove static var.
7779 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7780 of static var. All uses changed.
7781 (year): Do not reject years before 1900; they can occur with
7783 (posix_time_parse): Do not check for out-of-range components;
7784 that is now the caller's responsibility, since our checks were
7785 only approximations.
7786 (posixtime): Use mktime to check for out-of-range components,
7787 since it knows them exactly.
7788 If mktime returns (time_t) -1, check whether an error actually occurred
7789 by invoking localtime on -1.
7790 (main) [TEST_POSIXTIME]: Check for input data errors, and report
7791 posixtime failures better.
7792 Improve the test data (in comments only).
7794 2003-05-30 <karl@gnu.org>
7796 * mktime.c: update from libc.
7798 2003-05-30 Bruno Haible <bruno@clisp.org>
7800 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7801 * localcharset.h: Likewise.
7802 * localcharset.c: Likewise.
7804 2003-05-28 Paul Eggert <eggert@twinsun.com>
7806 Assume the headers required for C89 freestanding compilers.
7807 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7808 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7809 without checking for HAVE_LIMITS_H.
7810 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7811 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7813 * fatal.c: Include <stdarg.h> without checking for __STDC__.
7814 * exclude.c: Include <stdbool.h> unconditionally.
7815 * tempname.c: Include <stddef.h> unconditionally.
7816 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7817 * modechange.c, rpmatch.c (NULL): Don't define, since
7818 <stddef.h> does that.
7819 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7820 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7821 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7822 * xstrtol.c: Likewise.
7823 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7824 * savedir.c: Include <stddef.h> instead of defining NULL.
7826 * addext.c (addext): Use assignment rather than cast, to avoid
7827 warnings on some platforms.
7829 * mktime.c (__mktime_internal): Do not reject negative timestamps
7832 2003-05-10 Bruno Haible <bruno@clisp.org>
7834 * linebreak.c (iconv_string_length): Don't return -1 just because the
7835 string is longer than 4 KB.
7837 2003-05-12 Jim Meyering <jim@meyering.net>
7839 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7840 the space-padded-by-default conversion specifiers, %e, %k, %l.
7842 2003-05-03 Bruno Haible <bruno@clisp.org>
7844 Upgrade to Unicode-4.0.
7845 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7846 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7847 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7848 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7849 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7850 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7851 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7852 Change width of U+E0100..U+E01EF from 1 to 0.
7854 2003-04-25 Bruno Haible <bruno@clisp.org>
7856 * copy-file.c: Include <stddef.h>, for size_t.
7858 2003-04-25 Jim Meyering <jim@meyering.net>
7860 * copy-file.c (copy_file_preserving): Declare buf_size to be
7861 of type size_t, not int.
7863 2003-04-11 Jim Meyering <jim@meyering.net>
7865 Merge changes from Coreutils.
7867 2003-03-22 Jim Meyering <jim@meyering.net>
7869 * strftime.c (widen): Cast alloca return value to proper type.
7871 2003-01-19 Ulrich Drepper <drepper@redhat.com>
7874 * strftime.c (my_strftime): Handle very large width
7875 specifications for numeric values correctly. Improve checks for
7878 2003-01-19 Jim Meyering <jim@meyering.net>
7880 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7881 (nl_get_alt_digit) [! defined my_strftime]: Define.
7882 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7883 _nl_get_alt_digit and _nl_get_walt_digit.
7885 * strftime.c (my_strftime): Merge in locale-related changes from libc.
7886 These changes have no effect outside of _LIBC.
7888 2003-04-10 Bruno Haible <bruno@clisp.org>
7890 * findprog.h: New file, from GNU gettext.
7891 * findprog.c: New file, from GNU gettext.
7893 2003-04-05 Jim Meyering <jim@meyering.net>
7895 Merge changes from Coreutils.
7897 * exclude.h (PARAMS): Remove definition and uses.
7898 * exclude.c: Remove uses of `PARAMS'.
7900 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7901 Add test-cases for DOS filenames. Declare program_name.
7902 (main): Set up program_name. Patch by Rich Dawe.
7904 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7906 Use mntctl's return value to drive the entry-processing loop, since
7907 we can't rely on the value of the vmt_length member in the last
7908 entry. On some systems doing so could result in exhausting
7909 virtual memory. Based in part on a patch from Mike Jetzer.
7911 2003-04-04 Bruno Haible <bruno@clisp.org>
7913 * linebreak.h: New file, from GNU gettext.
7914 * linebreak.c: New file, from GNU gettext with slight modifications.
7915 * lbrkprop.h: New file, from GNU gettext.
7917 2003-04-03 Bruno Haible <bruno@clisp.org>
7919 * utf8-ucs4.h: New file, from GNU gettext.
7920 * utf16-ucs4.h: New file, from GNU gettext.
7921 * ucs4-utf8.h: New file, from GNU gettext.
7922 * ucs4-utf16.h: New file, from GNU gettext.
7924 2003-04-02 Bruno Haible <bruno@clisp.org>
7926 * binary-io.h: New file, from GNU gettext.
7928 2003-04-01 Bruno Haible <bruno@clisp.org>
7930 * pathname.h: New file, from GNU gettext.
7931 * concatpath.c: New file, from GNU gettext.
7933 2003-03-30 Bruno Haible <bruno@clisp.org>
7935 * copy-file.c (copy_file_preserving): Don't set owner if the function
7936 chown() doesn't exist.
7938 2003-03-28 Bruno Haible <bruno@clisp.org>
7940 * copy-file.h: New file, from GNU gettext.
7941 * copy-file.c: New file, from GNU gettext.
7943 2003-03-18 Jim Meyering <jim@meyering.net>
7945 * quote.c (quote_n): Fix typo in comment.
7947 2003-03-14 Jim Meyering <jim@meyering.net>
7949 Merge changes from Coreutils.
7950 * obstack.h (obstack_object_size): Declare temporary, __o,
7951 to be const, in order to avoid warnings.
7952 (obstack_room): Likewise.
7953 (obstack_empty_p): Likewise.
7955 2003-03-13 Paul Eggert <eggert@twinsun.com>
7957 Merge changes from Bison.
7958 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7959 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7960 when compiling Bison 1.875's `bitset bset = obstack_alloc
7961 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7962 * hash.c: Include <stdbool.h> unconditionally.
7964 2003-03-09 Paul Eggert <eggert@twinsun.com>
7966 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7967 Reported by Bruce Becker; see:
7968 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7970 2003-03-03 Paul Eggert <eggert@twinsun.com>
7971 Bruno Haible <bruno@clisp.org>
7973 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7974 Reported by John Hughes, see
7975 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7977 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
7979 * poll_.h: New file.
7982 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
7984 * mathl.h: New file.
7985 * acosl.c: New file.
7986 * asinl.c: New file.
7987 * atanl.c: New file.
7988 * ceill.c: New file.
7991 * floorl.c: New file.
7992 * frexpl.c: New file.
7993 * ldexpl.c: New file.
7995 * sincosl.c: New file.
7997 * sqrtl.c: New file.
7999 * trigl.c: New file.
8000 * trigl.h: New file.
8002 2003-02-17 Bruno Haible <bruno@clisp.org>
8004 * mkdtemp.h: New file, from GNU gettext.
8005 * mkdtemp.c: New file, from GNU gettext.
8007 2003-01-31 Bruno Haible <bruno@clisp.org>
8009 * rename.c: #undef rename before defining rpl_rename.
8010 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
8012 2003-01-30 Bruno Haible <bruno@clisp.org>
8014 * printf-args.h: New file, from GNU gettext.
8015 * printf-args.c: New file, from GNU gettext.
8016 * printf-parse.h: New file, from GNU gettext.
8017 * printf-parse.c: New file, from GNU gettext.
8018 * vasnprintf.h: New file, from GNU gettext.
8019 * vasnprintf.c: New file, from GNU gettext.
8020 * asnprintf.c: New file, from GNU gettext.
8021 * vasprintf.h: New file, from GNU gettext with modifications.
8022 * vasprintf.c: New file, from GNU gettext.
8023 * asprintf.c: New file, from GNU gettext.
8025 2003-01-29 Bruno Haible <bruno@clisp.org>
8027 * stpncpy.h: New file, from GNU gettext with modifications.
8028 * stpncpy.c: New file, from GNU gettext with modifications.
8030 2003-01-28 Bruno Haible <bruno@clisp.org>
8032 * c-ctype.h: New file, from GNU gettext, with changes suggested by
8034 * c-ctype.c: New file, from GNU gettext, with changes suggested by
8037 2003-01-27 Bruno Haible <bruno@clisp.org>
8039 * xsetenv.h: New file, from GNU gettext.
8040 * xsetenv.c: New file, from GNU gettext.
8042 2003-01-23 Bruno Haible <bruno@clisp.org>
8044 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
8046 2003-01-22 Bruno Haible <bruno@clisp.org>
8048 * exit.h: New file, from GNU gettext.
8050 2003-01-11 Bruno Haible <bruno@clisp.org>
8052 * stpcpy.h (stpcpy): Use ANSI C function declarations.
8053 * strcase.h (strcasecmp, strncasecmp): Likewise.
8055 2003-01-14 Jim Meyering <jim@meyering.net>
8057 * same.c (same_name): Tweak a comment.
8059 2003-01-11 Bruno Haible <bruno@clisp.org>
8061 * same.c (same_name): Reorder tests so as to avoid calling stat()
8062 when a string comparison is sufficient.
8064 2003-01-11 Bruno Haible <bruno@clisp.org>
8066 * readtokens.c (readtoken): Cast character to 'unsigned char', not
8069 2003-01-11 Bruno Haible <bruno@clisp.org>
8071 * hash-pjw.c: Add comment about low quality of this function.
8073 2003-01-12 Paul Eggert <eggert@twinsun.com>
8075 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
8076 to avoid collisions with libcurses and libreadline.
8078 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
8079 * getstr.h, getstr.c: Remove.
8080 * getline.c: Include "getline.h", to check interface.
8081 Move body of old getstr.c here: this defines MIN_CHUNK and
8082 declares getdelim2, which is renamed from getstr.
8083 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
8085 * linebuffer.c (readlinebuffer): Renamed from readline.
8087 * linebuffer.h: Likewise.
8088 (readline): Remove backward-compatibility macro.
8090 2003-01-12 Jim Meyering <jim@meyering.net>
8092 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
8094 2003-01-10 Bruno Haible <bruno@clisp.org>
8096 * alloca_.h: New file.
8097 * getdate.y: Unconditionally include alloca.h.
8098 * makepath.c: Likewise.
8099 * setenv.c: Likewise.
8100 * userspec.c: Likewise.
8102 2003-01-09 Bruno Haible <bruno@clisp.org>
8104 * stdbool.h.in: New file.
8106 2003-01-08 Bruno Haible <bruno@clisp.org>
8108 * safe-read.c: Include specification header first, to ensure its
8110 * full-write.c: Likewise.
8112 2003-01-08 Jim Meyering <jim@meyering.net>
8114 * full-write.c: Undefine and define-away `const' after inclusion
8115 of errno.h, not before. Suggestion from Bruno Haible.
8117 2003-01-07 Jim Meyering <jim@meyering.net>
8119 * full-write.c: Rework so that it may serve to define full_read, too.
8120 * full-read.c: Simply #define FULL_READ and include full-write.c.
8122 2003-01-06 Jim Meyering <jim@meyering.net>
8124 * version-etc.c: Update year in translatable copyright string.
8126 2002-12-25 Bruno Haible <bruno@clisp.org>
8128 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
8129 * xstrtol.h: Likewise.
8130 * xstrtoimax.c: Likewise.
8131 * xstrtoumax.c: Likewise.
8132 * human.h: Likewise.
8134 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
8135 on systems that have <inttypes.h> but not <stdint.h>.
8137 2002-12-31 Paul Eggert <eggert@twinsun.com>
8139 * memcoll.c (memcoll): Fall back on a simple algorithm using
8140 memcmp if strcoll doesn't work.
8142 2002-12-23 Bruno Haible <bruno@clisp.org>
8144 * localcharset.h: New file.
8145 * localcharset.c: Include it.
8146 * unicodeio.c: Likewise.
8148 2002-12-22 Bruno Haible <bruno@clisp.org>
8150 * utime.c (utime_null): No need to call ftruncate if the file was
8153 2002-12-23 Bruno Haible <bruno@clisp.org>
8155 * memcoll.c (STRCOLL): New macro.
8158 2002-12-22 Bruno Haible <bruno@clisp.org>
8160 * getstr.h (getstr): Define, to avoid clash with libcurses.
8161 * linebuffer.h (readline): Define, to avoid clash with libreadline.
8163 2002-12-22 Bruno Haible <bruno@clisp.org>
8165 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
8167 2002-12-23 Bruno Haible <bruno@clisp.org>
8169 * getline.h: Include <stddef.h>, for size_t.
8171 * unicodeio.h: Include <stddef.h>, for size_t.
8172 * unicodeio.c: Don't include <stddef.h>.
8174 2002-12-17 Bruno Haible <bruno@clisp.org>
8176 * canon-host.c (strdup): Remove unused declaration.
8178 * fsusage.c: Include full_read.h.
8179 (get_fs_usage): Use full_read instead of safe_read.
8181 * utime.c (utime_null): Use SAFE_READ_ERROR.
8183 2002-12-11 Bruno Haible <bruno@clisp.org>
8185 * setenv.h: Rewritten to cope with systems that have setenv() but not
8187 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
8190 2002-12-11 Bruno Haible <bruno@clisp.org>
8192 * setenv.c (alloca): Fall back to malloc.
8194 (setenv): Use freea() to free memory allocated with alloca().
8196 2002-11-13 Bruno Haible <bruno@clisp.org>
8198 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
8199 function declarations.
8200 * unsetenv.c (unsetenv): Likewise.
8202 2002-03-04 Bruno Haible <bruno@clisp.org>
8204 Portability to AIX 4.3.3.
8205 * unsetenv.c: New file, extracted from setenv.c.
8206 * setenv.c: Move the unsetenv() function to unsetenv.c.
8208 2001-12-20 Bruno Haible <bruno@clisp.org>
8210 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
8211 use malloc instead. For SunOS 4.
8213 2001-12-11 Bruno Haible <bruno@clisp.org>
8215 * setenv.c: Declare alloca.
8216 (compar_fn_t): New typedef.
8217 (KNOWN_VALUE, STORE_VALUE): Use it.
8219 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
8222 2002-12-10 Paul Eggert <eggert@twinsun.com>
8224 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
8225 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
8226 Choose values that are less likely to collide with system fnmatch
8228 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
8229 defined (e.g., a pure POSIX system).
8230 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
8231 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
8233 2002-12-06 Jim Meyering <jim@meyering.net>
8235 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
8237 Merge in changes from libc's misc/error.c, in preparation
8238 for the merge of gnulib's changes back into libc.
8240 * error.c (_): Define only if not already defined.
8241 Move definition to follow all #include directives.
8242 Include unlocked-io.h only if !_LIBC.
8243 [_LIBC]: Include <libio/libioP.h>.
8244 [USE_IN_LIBIO]: Include <libio/iolibio.h>
8245 (fflush): Tweak definition to use INTUSE.
8248 2002-12-05 Paul Eggert <eggert@twinsun.com>
8250 * alloca.c [defined emacs]: Include "lisp.h".
8251 (xalloc_die) [defined emacs]: New macro.
8252 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
8253 [! defined emacs]: Include <xalloc.h>.
8254 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
8255 (pointer): Typedef to POINTER_TYPE *.
8256 (malloc): Remove decl; we now always use xmalloc.
8257 (alloca): Use old-style definition, since Emacs needs this.
8258 Check for arithmetic overflow when computing combined size.
8260 2002-12-04 Paul Eggert <eggert@twinsun.com>
8262 Do not generate unlocked-io.h automatically, since it's easier to
8263 maintain it by hand.
8265 * unlocked-io.h: New file, from GNU diffutils,
8266 but with proper copyright notice and attribution.
8268 * Makefile.am: Add copyright notice.
8269 (libfetish_a_SOURCES): Add unlocked-io.h.
8270 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
8271 (DISTCLEANFILES, io_functions): Remove macros.
8272 (EXTRA_DIST): Remove gen_uio.
8273 (unlocked-io.h): Remove rule.
8275 2002-12-04 Jim Meyering <jim@meyering.net>
8277 Reflect the fact that stat.c and lstat.c are no longer generated.
8278 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
8279 (DISTCLEANFILES): Likewise.
8280 (EXTRA_DIST): Likewise.
8281 (all_local): Don't depend on stat.c or lstat.c.
8282 (stat.c, lstat.c): Remove rules.
8283 (EXTRA_DIST): Remove xstat.in.
8285 * xstat.in: Remove file. Contents moved into stat.c.
8286 * stat.c: New file. Contents mostly from xstat.in.
8287 * stat.c: Rework so that it may serve to define rpl_lstat, too.
8288 * lstat.c: New file. Simply #define LSTAT and include stat.c.
8290 * safe-read.c: Rework so that it may serve to define safe_write, too.
8291 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
8293 2002-12-03 Jim Meyering <jim@meyering.net>
8295 * safe-read.c, safe-write.c: Change variable names and comments, but
8296 not semantics, to minimize the differences between these two files.
8297 (safe_read): Change comment to mention SAFE_READ_ERROR.
8299 * safe-read.c (IS_EINTR): Define.
8300 (safe_read): Use IS_EINTR in place of in-function cpp directives.
8302 2002-12-02 Bruno Haible <bruno@clisp.org>
8304 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
8305 Define, taken from safe-read.c.
8306 (INT_MAX): Provide fallback.
8307 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
8308 * safe-write.h (SAFE_WRITE_ERROR): Define.
8310 * safe-read.c (EINTR): Remove definition.
8311 (safe_read): Don't use EINTR if it is absent.
8313 2002-12-02 Jim Meyering <jim@meyering.net>
8315 * safe-read.c (EINTR): Define.
8316 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8317 (INT_MAX): Provide fallback.
8318 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8320 * safe-read.h (SAFE_READ_ERROR): Define.
8322 2002-12-01 Jim Meyering <jim@meyering.net>
8324 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8325 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8327 2002-11-27 Paul Eggert <eggert@twinsun.com>
8329 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8330 hash_rehash): Replace `if (limit <= value) abort ();' with
8331 `if (! (value < limit)) abort ();', for readability.
8333 2002-11-26 <karl@gnu.org>
8335 * strdup.c: copy from libc again, with jim's ok.
8336 * .cppi-disable: re-add strdup.c
8338 2002-11-25 <karl@gnu.org>
8340 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8341 instead of "strtol.c".
8343 2002-11-25 Jim Meyering <jim@meyering.net>
8345 * mktime.c: Sync from libc, now that it has the latest fix.
8347 2002-11-24 <karl@gnu.org>
8349 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8350 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8352 2002-11-24 Jim Meyering <jim@meyering.net>
8354 Update from coreutils:
8356 * mktime.c: Merge in changes from libc.
8358 Avoid a link-time failure on some Linux systems.
8359 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8360 (__mon_yday): Declare with the STATIC attribute.
8361 (__mktime_internal): Likewise.
8362 Based on a report from Greg Schafer.
8364 2002-11-23 Jim Meyering <jim@meyering.net>
8366 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8367 Use `unsigned', not `int', as type of index.
8369 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8371 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8373 2002-11-22 Paul Eggert <eggert@twinsun.com>
8375 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8376 hint that one should use `if (! x) abort ();' rather than `assert
8377 (x);', and anyway it's one less thing to worry about configuring.
8378 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8379 hash_rehash, hash_insert): Use abort rather than assert.
8381 2002-11-22 Paul Eggert <eggert@twinsun.com>
8383 * quotearg.h: Allow multiple inclusion by surrounding with
8384 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
8385 so that we can be included first.
8386 (PARAMS): Remove; we now assume C89 or later. All uses removed.
8387 * quotearg.c: Include quotearg.h immediately after config.h.
8388 No need to include stddef.h or sys/types.h any more.
8389 Surround local include files with "", not "<>".
8390 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8391 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8392 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8393 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8394 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8395 (ISPRINT): Remove; no longer needed now that we assume C89.
8397 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8400 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8401 quotearg_char): Use SIZE_MAX rather than
8402 (size_t) -1 when we are talking about "infinity".
8404 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8406 2002-11-22 Bruno Haible <bruno@clisp.org>
8408 * safe-read.h: Assume C89. Add comments.
8409 (safe_read): Change return type to size_t.
8410 * safe-read.c (safe_read): Change return type to size_t. Handle byte
8411 counts > SSIZE_MAX correctly.
8412 * safe-write.h: New file.
8413 * safe-write.c: New file.
8414 * full-read.h: New file.
8415 * full-read.c: New file.
8416 * full-write.h: Assume C89. Add comments.
8417 * full-write.c: Include safe-write.h.
8418 (full_write): Rewritten to use safe_write.
8419 Suggested by Jim Meyering and Paul Eggert.
8421 2002-11-21 Bruno Haible <bruno@clisp.org>
8423 Remove case insensitive option matching.
8424 * argmatch.h (argcasematch): Remove declaration.
8425 (ARGCASEMATCH): Remove macro.
8426 (__xargmatch_internal): Remove case_sensitive argument.
8427 (XARGMATCH): Update.
8428 (XARGCASEMATCH): Remove macro.
8429 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8430 case_sensitive argument.
8431 (argcasematch): Remove function.
8432 (__xargmatch_internal): Remove case_sensitive argument.
8433 (main): Use XARGMATCH instead of XARGCASEMATCH.
8435 * xmalloc.c: Change compile-time error message. Add comment about
8436 required autoconf version.
8438 2002-11-21 Jim Meyering <jim@meyering.net>
8440 * strdup.c (strdup): Tweak comment and initial #if/#include.
8442 Merge in changes from the coreutils.
8444 2002-09-25 Paul Eggert <eggert@twinsun.com>
8445 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8446 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8447 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8448 int. Work more efficiently if X is the same width as uintmax_t.
8449 Do not compare X to -1, to avoid bogus compiler warning.
8450 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8451 Don't assume that f_frsize and f_bsize are the same type.
8453 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8456 * makepath.c (make_path): Restore umask *before* creating the final
8458 (make_path): Minor reformatting.
8460 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8461 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8463 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8464 ones. At least on GNU/Linux systems, `auto' means something else.
8467 2002-11-20 Paul Eggert <eggert@twinsun.com>
8469 Merge argmatch cleanups from Bison. Assume C89.
8471 * argmatch.c: Include config.h here, not in argmatch.h.
8472 Include stdlib.h, for EXIT_FAILURE.
8473 Always include <string.h>, since we assume C89.
8474 (EXIT_FAILURE): Remove pre-C89 bug workaround.
8475 * argmatch.h: Do not include <config.h> or <sys/types.h>.
8476 Include <stddef.h> instead, since it's all we need for size_t.
8477 (PARAMS): Remove. All uses removed.
8478 (ARRAY_CARDINALITY): Do not bother to #undef.
8479 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8480 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8481 Remove unnecessary parentheses.
8482 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8483 Insert necessary parentheses.
8484 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8485 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8487 2002-11-19 Bruno Haible <bruno@clisp.org>
8489 * mbswidth.c: Include mbswidth.h right at the beginning.
8490 * mbswidth.h: Include <stddef.h>, for size_t.
8492 * mbswidth.h (PARAMS): Remove macro.
8493 (mbswidth, mbsnwidth): Use ANSI C function declarations.
8494 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8496 * gcd.h (PARAMS): Remove macro.
8497 (gcd): Use ANSI C function declarations.
8498 * gcd.c (gcd): Likewise.
8500 2002-11-15 Bruno Haible <bruno@clisp.org>
8502 * strcspn.c: Include <stddef.h>.
8503 (strcspn): Use ANSI C function declaration. Change return type to
8505 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8506 (strpbrk): Use NULL.
8507 * strpbrk.h (PARAMS): Remove macro.
8508 (strpbrk): Use ANSI C function declaration.
8509 * strstr.c: Don't include <sys/types.h>.
8510 * strstr.h (PARAMS): Remove macro.
8511 (strstr): Use ANSI C function declarations.
8513 2002-11-06 Bruno Haible <bruno@clisp.org>
8515 * gcd.h (gcd): Change argument type to 'unsigned long'.
8516 * gcd.c (gcd): Likewise.
8518 2002-11-05 Bruno Haible <bruno@clisp.org>
8520 * gcd.h: New file, from gettext-0.11.5.
8521 * gcd.c: New file, from gettext-0.11.5.
8523 2002-11-05 Bruno Haible <bruno@clisp.org>
8525 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8526 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8527 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8528 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8530 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8531 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8533 * closeout.c: Include gettext.h instead of <libintl.h>.
8534 * human.c: Include gettext.h instead of <libintl.h>.
8535 * quotearg.c: Include gettext.h instead of <libintl.h>.
8536 * rpmatch.c: Include gettext.h instead of <libintl.h>.
8537 * unicodeio.c: Include gettext.h instead of <libintl.h>.
8538 * userspec.c: Include gettext.h instead of <libintl.h>.
8539 * version-etc.c: Include gettext.h instead of <libintl.h>.
8540 * xmalloc.c: Include gettext.h instead of <libintl.h>.
8541 (textdomain): Remove definition.
8542 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8544 * long-options.c: Remove include of <libintl.h> and definition of _.
8545 * same.c: Remove include of <libintl.h> and definition of _.
8547 2002-11-04 Bruno Haible <bruno@clisp.org>
8549 * stpcpy.h: New file, from GNU gettext-0.11.5.
8550 * strcase.h: New file, from GNU gettext-0.11.5.
8551 * strpbrk.h: New file, from GNU gettext-0.11.5.
8552 * strstr.h: New file, from GNU gettext-0.11.5.
8553 * xgetcwd.h: New file, from GNU gettext-0.11.5.
8555 2002-05-09 Bruno Haible <bruno@clisp.org>
8557 * config.charset: Update for newest glibc. Add canonical names
8558 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8560 2002-05-09 Bruno Haible <bruno@clisp.org>
8562 * localcharset.c (get_charset_aliases): Add more Windows specific
8565 2002-05-08 Owen Taylor <otaylor@redhat.com>
8567 * config.charset: A few additions for Solaris.
8569 2001-12-05 Bruno Haible <bruno@clisp.org>
8571 * localcharset.c (locale_charset): Don't return an empty string.
8573 2001-10-23 Bruno Haible <haible@clisp.cons.org>
8575 * config.charset: msdos in uk_UA uses CP1125.
8577 2001-08-05 Bruno Haible <haible@clisp.cons.org>
8579 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8580 * localcharset.c (locale_charset): Declare as extern "C".
8582 2002-02-15 Bruno Haible <bruno@clisp.org>
8584 * config.charset [msdosdjgpp]: For Russian, use CP866.
8586 2002-02-11 Bruno Haible <bruno@clisp.org>
8588 * config.charset: Add support for NetBSD.
8590 2002-09-25 <karl@gnu.org>
8592 * strdup.c: copy from libc/string (via ../config/srclist*).
8593 * getopt*: copy from libc/posix.
8594 * gettext.h: copy from gettext.
8595 * .cppi-disable: add strdup.c, gettext.h.
8597 2002-07-01 Jim Meyering <meyering@lucent.com>
8599 * c-stack.c: Include sys/time.h.
8600 From Volker Borchert.
8602 2002-06-11 Paul Eggert <eggert@twinsun.com>
8604 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8605 New macro. Use it uniformly instead of
8606 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8607 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8608 reported by Vin Shelton.
8610 2002-06-22 Jim Meyering <meyering@lucent.com>
8612 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8613 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8615 2002-06-22 Paul Eggert <eggert@twinsun.com>
8617 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8618 Do not assume SA_SIGINFO behavior.
8619 Bug reported by Jim Meyering on NetBSD 1.5.2.
8621 2002-06-22 Jim Meyering <meyering@lucent.com>
8623 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8625 * exitfail.c, exitfail.h: Likewise.
8626 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8628 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8630 (EXTRA_DIST): Add fnmatch_loop.c.
8631 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8633 * fnmatch_loop.c: New file, from diffutils-2.8.2.
8634 * fnmatch.c: Update from diffutils-2.8.2.
8635 * fnmatch_.h: New file. From diffutils-2.8.2.
8636 * fnmatch.h: Remove file.
8638 2002-06-18 Paul Eggert <eggert@twinsun.com>
8640 * file-type.h: Report an error if neither S_ISREG nor
8641 S_IFREG is defined, instead of using a test specific to glibc
8642 2.2. This should be safe, since POSIX requires S_ISREG and
8643 Unix Version 7 had S_IFREG. We don't need to check for
8644 <sys/types.h> since we don't use any symbols that it defines.
8646 2002-06-15 Jim Meyering <meyering@lucent.com>
8648 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8649 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8650 have been included before this file.
8652 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
8654 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8655 so that each temporary file name is unique and valid in the first
8656 8 characters, for operation under DOS.
8658 2002-06-15 Jim Meyering <meyering@lucent.com>
8660 Work even with DJGPP 2.03, which lacks support for symlinks.
8662 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8664 * lchown.c (S_ISLNK): Likewise.
8666 2002-06-14 Jim Meyering <meyering@lucent.com>
8668 * file-type.h: Use the version from diffutils-2.8.2.
8669 * file-type.c: Likewise.
8671 2002-05-27 Jim Meyering <meyering@lucent.com>
8673 Fix a problem seen only on nonconforming systems whereby ls.c's
8674 use of localtime, and then of gettimeofday would cause trouble:
8675 the localtime call used to initialize rpl_gettimeofday's save
8676 mechanism would clobber ls's current local time information so
8677 that in any long listing the first file would always be listed
8678 with date 1970-01-01. Analysis by Volker Borchert.
8680 * gettimeofday.c (localtime): Undefine.
8681 (rpl_localtime): New function.
8683 2002-05-22 Jim Meyering <meyering@lucent.com>
8685 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8686 * file-type.h: New file.
8687 * file-type.c (file_type): New file/function. Extracted from diffutils.
8689 2002-04-29 Paul Eggert <eggert@twinsun.com>
8691 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8693 2002-04-28 Paul Eggert <eggert@twinsun.com>
8695 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8696 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
8697 of 127, since 64 is the largest conceivable number for ancient
8699 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8701 2002-04-28 Jim Meyering <meyering@lucent.com>
8703 * sig2str.c (WTERMSIG): Remove definition (unused).
8705 2002-04-28 Paul Eggert <eggert@twinsun.com>
8707 * sig2str.h, sig2str.c: New files.
8708 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8710 2002-04-24 Jim Meyering <meyering@lucent.com>
8712 * gettext.h: New file, from Gettext.
8713 * Makefile.am (INCLUDES): Remove -I../intl.
8714 (libfetish_a_SOURCES): Add gettext.h.
8716 2002-04-16 Jim Meyering <meyering@lucent.com>
8718 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8719 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8720 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8722 2002-04-12 Jim Meyering <meyering@lucent.com>
8724 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8726 2002-03-10 Jim Meyering <meyering@lucent.com>
8728 * makepath.c (make_path): Remove a comma from a diagnostic.
8729 Suggestion from Santiago Vila.
8731 2002-03-08 Jim Meyering <meyering@lucent.com>
8733 * rename.c: Mention that this wrapper is needed also on
8734 mips-dec-ultrix4.4 systems.
8736 2002-03-02 Jim Meyering <meyering@lucent.com>
8738 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8739 not HAVE_CLOCK_SETTIME.
8741 2002-02-27 Paul Eggert <eggert@twinsun.com>
8743 * nanosleep.h: Rename to....
8744 * timespec.h: New name for nanosleep.h. All uses changed.
8746 * gettime.c: New file.
8747 * settime.c: New file.
8750 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8751 timespec.h. Remove nanosleep.h.
8753 2002-02-25 Paul Eggert <eggert@twinsun.com>
8755 * acl.c, acl.h: New files.
8756 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8758 2002-02-24 Jim Meyering <meyering@lucent.com>
8760 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8761 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8762 cause trouble. Reported by Nelson Beebe.
8764 2002-02-23 Paul Eggert <eggert@twinsun.com>
8766 * path-concat.c (xpath_concat): Reorder code to pacify
8767 compilers that don't know that xalloc_die never returns.
8769 2002-02-20 Jim Meyering <meyering@lucent.com>
8771 * getdate.c: Regenerate using bison-1.33.
8773 2002-02-15 Paul Eggert <eggert@twinsun.com>
8775 * posixver.c, posixver.h: New files.
8776 * Makefile.am (libfetish_a_SOURCES): Add them.
8778 2002-02-02 Paul Eggert <eggert@twinsun.com>
8779 Bruno Haible <bruno@clisp.org>
8781 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8782 (fwrite_success_callback): New declaration.
8783 * unicodeio.c (unicode_to_mb): New function, extracted from
8784 print_unicode_char. Call failure callback instead of error.
8785 (fwrite_success_callback): New function.
8786 (exit_failure_callback): New function.
8787 (fallback_failure_callback): New function.
8788 (print_unicode_char): Call unicode_to_mb.
8790 2002-01-26 Jim Meyering <meyering@lucent.com>
8792 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8794 2002-01-22 Jim Meyering <meyering@lucent.com>
8796 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8797 Otherwise, some versions of automake would omit the rule that makes
8798 Makefile from Makefile.in.
8800 2001-01-21 Paul Eggert <eggert@twinsun.com>
8802 * xmemcoll.h, xmemcoll.c: New files.
8803 * Makefile.am (libfetish_a_SOURCES): Add them.
8804 * memcoll.c: Include errno.h, and declare errno if not defined.
8805 (memcoll): Set errno to zero if there is no error.
8807 * quotearg.c (quotearg_buffer_restyled):
8808 Fix bug with quoting buffers containing NUL when backslashing escapes.
8809 This bug was exposed by the other changes in this patch.
8810 (quotearg_n_options): New arg ARGSIZE.
8811 All callers changed.
8812 (quoting_options_from_style): New function.
8813 (quotearg_n_style): Use it.
8814 (quotearg_n_style_mem): New function.
8816 * quotearg.h (quotearg_n_style_mem): New function.
8818 2002-01-16 Jim Meyering <meyering@lucent.com>
8820 * getdate.y: Add three semicolons, each just before a closing brace.
8821 Bison (as of version 1.31) no longer papers over that mistake.
8823 2002-02-14 Paul Eggert <eggert@twinsun.com>
8825 * backupfile.c (ISDIGIT): Comment fix.
8826 * getdate.y (ISDIGIT): Likewise.
8827 * posixtm.c (ISDIGIT, year): Likewise.
8828 * strverscmp.c (ISDIGIT): Likewise.
8829 * userspec.c (ISDIGIT): Likewise.
8831 2002-01-05 Jim Meyering <meyering@lucent.com>
8833 * version-etc.c (version_etc_copyright): Update copyright year.
8835 2001-01-19 Paul Eggert <eggert@twinsun.com>
8837 * closeout.c (close_stdout_status): If ferror (stdout), do
8838 not silently exit merely because the output buffer happens to
8839 have nothing pending.
8841 2001-12-18 Paul Eggert <eggert@twinsun.com>
8843 See the big note in ../ChangeLog.
8844 * human.c (suffixes): Prefer K to k for 1024.
8845 (generate_suffix_backwards): New function.
8846 (human_readable_inexact): Use it.
8847 * xstrtol.c (__xstrtol): If there is no number but there
8848 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
8849 Accept 'K' as well as 'k'.
8851 2001-12-15 Jim Meyering <meyering@lucent.com>
8853 * regex.h (__restrict_arr): Update from libc.
8855 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8856 as `remote' if the name starts with `//'. Suggested by Michael Stone.
8859 2001-12-10 Jim Meyering <meyering@lucent.com>
8861 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8862 Instead, include "xalloc.h".
8863 (initbuffer): Don't cast xmalloc return value to char*.
8864 (readline): Reword comment.
8865 Don't cast xrealloc return value to char*
8868 2001-12-09 Jim Meyering <meyering@lucent.com>
8870 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8871 `signed and unsigned type in conditional expression'.
8872 * posixtm.c (posix_time_parse): Likewise.
8874 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8876 * readtokens.c (readtoken): Declare an index to be of type unsigned
8877 to avoid a pedantic warning.
8879 * getstr.c: Don't include assert.h.
8880 (getstr): Remove warning-evoking assertions.
8881 Return -1 if offset parameter is out of bounds.
8882 Change the type of a local from int to size_t.
8884 * strftime.c (my_strftime_localtime_r): Include this function
8885 definition in the `#if ! HAVE_TM_GMTOFF' block.
8887 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8888 Include xalloc.h instead.
8890 2001-12-02 Jim Meyering <meyering@lucent.com>
8892 * tempname.c: Don't declare getenv, thus reverting the change of
8893 2001-11-18. It's no longer necessary, now that stdlib.h is always
8896 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8897 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
8899 2001-11-30 Akim Demaille <akim@epita.fr>
8901 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8902 before being defined.
8904 2001-11-27 Paul Eggert <eggert@twinsun.com>
8906 * quotearg.h (quotearg_n, quotearg_n_style):
8907 First arg is int, not unsigned.
8908 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8909 (SIZE_MAX, UINT_MAX): New macros.
8910 (quotearg_n_options): Abort if N is negative.
8911 Avoid overflow check on hosts where size_t is 64 bits and int
8912 is 32 bits, as overflow is impossible there.
8913 Fix off-by-one typo that caused unnecessary reallocation.
8915 2001-11-27 Jim Meyering <meyering@lucent.com>
8917 * tempname.c: Merge with version from libc.
8918 * regex.c: Likewise.
8920 * tempname.c: Include stdlib.h unconditionally. On some old systems
8921 for which STDC_HEADERS is 0, it was not included, resulting in a
8922 warning about an integer-to-pointer conversion problem with getenv.
8923 Reported by Volker Borchert.
8925 2001-11-26 Jim Meyering <meyering@lucent.com>
8927 * gtod.h: Remove file.
8928 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8929 * gettimeofday.c: Don't include gtod.h.
8930 (GTOD_init): Remove function.
8931 (rpl_gettimeofday): Do its job here instead, rather than aborting.
8932 Suggestion from Volker Borchert.
8934 2001-11-23 Jim Meyering <meyering@lucent.com>
8936 * hash.h (struct hash_table): Don't define here. Merely declare it.
8937 * hash.c (struct hash_table): Define it here instead.
8939 2001-11-22 Jim Meyering <meyering@lucent.com>
8941 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8943 2001-11-18 Paul Eggert <eggert@twinsun.com>
8945 * tempname.c (TMP_MAX): Remove; no longer needed.
8946 (TEMPORARIES): New macro.
8947 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
8948 removes an artificial limitation (e.g. HP-UX 10.20, where
8951 2001-11-18 Jim Meyering <meyering@lucent.com>
8953 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8956 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8957 files will be created before anything else.
8959 2001-11-17 Jim Meyering <meyering@lucent.com>
8961 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8962 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8963 rather than group writable. Patch by Juan F. Codagnone.
8965 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8966 Instead, include "xalloc.h".
8968 * mountlist.c: Include unlocked-io.h after all system headers.
8969 Remove explicit declarations of xmalloc, xrealloc,
8970 and xstrdup. Instead, include "xalloc.h".
8972 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8973 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8974 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8976 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8977 Reported by Padraig Brady.
8979 * mkstemp.c: #undef mkstemp.
8981 (rpl_mkstemp): Rename from mkstemp.
8984 2001-11-16 Jim Meyering <meyering@lucent.com>
8986 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8987 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8988 determine the amount of total physical memory, use pstat_getstatic.
8989 HPUX-11 doesn't define _SC_PHYS_PAGES.
8990 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8991 If sysconf couldn't be used to determine the amount of available
8992 physical memory, use both pstat_getstatic and pstat_getdynamic.
8993 Based on a patch from Bob Proulx.
8995 2001-11-05 Jim Meyering <meyering@lucent.com>
8997 * xstat.in (slash_aware_lstat): Correct a misleading comment.
8999 2001-11-03 Jim Meyering <meyering@lucent.com>
9001 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
9002 in argmatch_to_argument call.
9004 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
9007 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
9008 e.g., a fault due to an attempt to free a NULL pointer.
9010 2001-11-01 Jim Meyering <meyering@lucent.com>
9012 * dirfd.c, dirfd.h: New files.
9013 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
9015 * hash.c (hash_print) [TESTING]: Clean up.
9017 2001-10-22 Paul Eggert <eggert@twinsun.com>
9019 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
9020 to avoid a warning if -Wall.
9022 2001-10-21 Paul Eggert <eggert@twinsun.com>
9024 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
9026 2001-10-21 Jim Meyering <meyering@lucent.com>
9028 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
9029 this code would end up calling gettext even in packages built
9031 * getopt.c (_): Likewise.
9032 * regex.c (_): Likewise.
9034 2001-10-20 Paul Eggert <eggert@twinsun.com>
9036 * error.c (strerror_r): Do not declare unless !_LIBC.
9037 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
9038 Use strerror_r that is only a macro, even if it is not a function.
9039 (strerror): Check for HAVE_DECL_STRERROR before declaring.
9040 (private_strerror): Use prototypes, not old-style function definition.
9041 (print_errno_message): New function.
9042 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
9044 (error_tail, error, error_at_line): Use it.
9046 2001-10-11 Jim Meyering <meyering@lucent.com>
9048 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9049 and quote_n (1, ... to avoid clobbering a buffer.
9051 2001-10-05 Jim Meyering <meyering@lucent.com>
9053 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
9054 * hash-pjw.c: New file (factored out of fileutils' remove.c).
9055 * hash-pjw.h: New file.
9057 2001-09-30 Jim Meyering <meyering@lucent.com>
9059 * mountlist.c [MOUNTED_GETFSSTAT]:
9060 Include <sys/ucred.h>, for Apple Darwin.
9061 Include sys/mount.h and sys/fs_types.h only if available.
9063 (read_filesystem_list): Use FS_TYPE.
9065 2001-09-29 Paul Eggert <eggert@twinsun.com>
9067 * exclude.c (excluded_filename): 0 -> false, since it's
9070 2001-09-28 Paul Eggert <eggert@twinsun.com>
9072 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
9073 #defines strtoimax. Also treat the other strto* functions
9076 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
9077 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
9078 (strtoimax, strtoumax): Do not declare if already defined as a macro.
9080 2001-09-26 Jim Meyering <meyering@lucent.com>
9082 Most macros in unlocked-io.h had the wrong number of arguments.
9083 * gen-uio: New script.
9084 (USE_UNLOCKED_IO): Define to 1 if not already defined.
9085 * unlocked-io.hin: Remove file.
9086 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
9087 rather than trying to embed it here.
9088 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
9089 Reported by Padraig Brady.
9091 2001-09-25 Volker Borchert <bt@teknon.de>
9093 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
9095 2001-09-23 Jim Meyering <meyering@lucent.com>
9097 * mountlist.c: Remove useless parentheses in #if directives.
9098 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
9099 the deprecated MOUNTED symbol is no longer defined in mntent.h.
9101 2001-09-22 Jim Meyering <meyering@lucent.com>
9103 * localcharset.c: Update from latest gettext.
9104 * config.charset: Likewise.
9106 2001-09-20 Jim Meyering <meyering@lucent.com>
9108 * xstrtol.c (strtoimax): Guard declaration with
9109 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9110 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9111 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9112 (strtoumax): Likewise, for completeness (it wasn't necessary).
9114 2001-09-06 Paul Eggert <eggert@twinsun.com>
9116 * strtoimax.c (HAVE_LONG_LONG):
9117 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9118 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
9119 to work around bug in IBM C compiler.
9121 2001-09-16 Jim Meyering <meyering@lucent.com>
9123 * mkdir.c: New file.
9125 2001-09-04 Paul Eggert <eggert@twinsun.com>
9127 * xgetcwd.c: Revert some of the previous change; intead,
9128 fix the HAVE_GETCWD_NULL code to behave more like the
9129 !HAVE_GETCWD_NULL code used to.
9132 (xgetcwd): Do not return NULL when memory is exhausted; instead,
9135 2001-09-04 Paul Eggert <eggert@twinsun.com>
9137 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
9138 Use ssize_t, not int, to store result of readlink.
9139 Check for ssize_t overflow as well as size_t overflow,
9140 as POSIX says the result of readlink is implementation-defined
9141 when ssize_t overflows.
9142 Remove unnecessary cast to char*.
9143 Use free+malloc instead of realloc, as the storage doesn't need
9144 to be preserved and it's clearer and can be more efficient that way.
9145 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
9146 * xreadlink.h (xreadlink): Update prototype.
9148 2001-09-03 Paul Eggert <eggert@twinsun.com>
9150 * exclude.c (fnmatch_no_wildcards): Fix confusion between
9151 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
9152 spotted by Jim Meyering.
9154 2001-09-03 Jim Meyering <meyering@lucent.com>
9156 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
9158 2001-09-03 Paul Eggert <eggert@twinsun.com>
9160 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
9161 like the HAVE_GETCWD_NULL code.
9162 Include pathmax.h if not HAVE_GETCWD.
9163 Do not include xalloc.h.
9164 (INITIAL_BUFFER_SIZE): New symbol.
9165 Do not use xmalloc / xrealloc, since the caller is responsible for
9166 handling errors. Preserve errno around `free' during failure.
9167 Do not overrun buffer when using getwd.
9169 2001-09-03 Paul Eggert <eggert@twinsun.com>
9171 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
9172 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
9174 2001-09-02 Jim Meyering <meyering@lucent.com>
9176 * error.c: Update from GNU libc.
9178 2001-09-01 Jim Meyering <meyering@lucent.com>
9180 * xreadlink.c: New file.
9181 * xreadlink.h: New file.
9182 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
9184 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
9185 doesn't conflict with sparc Solaris 7's definition in
9186 /usr/include/sys/int_types.h.
9188 * exclude.c: Use `""', not `<>' to #include non-system header files.
9189 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9190 and strncasecmp as r-values. Unixware didn't have declarations.
9192 2001-08-31 Jim Meyering <meyering@lucent.com>
9194 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9195 Use an initial, malloc'd, buffer of length 128 rather than
9196 a statically allocated one of length 1024.
9198 2001-08-30 Paul Eggert <eggert@twinsun.com>
9200 * xgetcwd.c: Don't include pathmax.h.
9201 Include stdlib.h and unistd.h if available.
9203 (xmalloc, xstrdup, free): Remove decls.
9204 (xgetcwd): Don't assume sizes fit in unsigned.
9205 Check for overflow when computing sizes.
9206 Simplify reallocation code.
9208 2001-08-28 Paul Eggert <eggert@twinsun.com>
9210 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
9212 * strtoimax.c: Renamed from strtoxmax.c, removing the
9215 Also, make the following further changes to make this file's
9216 configuration more similar to that of strtol.c:
9217 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
9218 (strtoumax, uintmax_t, strtoull, strtol): Remove.
9219 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9220 (strtoimax): Renamed from strtoumax. All uses of unsigned values
9221 changed to signed values.
9223 And make the following changes as well:
9224 Fix copyright notice, as 1999 was missing.
9225 (verify): New macro.
9226 (strtoimax): Check sizes at compile-time, not run-time.
9227 Prefer strtol to strtoll if both work.
9228 (main): Remove; it was not that useful and was a pain to maintain.
9230 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
9232 2001-08-30 Paul Eggert <eggert@twinsun.com>
9234 * savedir.c (savedir): Remove size parameter, as POSIX says that
9235 a directory's st_size can have an arbitrary value, so the old
9236 usage could waste an arbitrary amount of memory. All uses
9238 * savedir.h: Update prototype.
9240 2001-08-30 Paul Eggert <eggert@twinsun.com>
9242 * xstrtol.c (strtoimax): New decl.
9244 2001-08-28 Paul Eggert <eggert@twinsun.com>
9246 * xstrtol.h: Add copyright notice.
9247 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
9248 LONGINT_INVALID_SUFFIX_CHAR.
9250 2001-08-30 Paul Eggert <eggert@twinsun.com>
9252 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
9255 2001-08-30 Paul Eggert <eggert@twinsun.com>
9257 * hash.c: Remove '2001' from copyright notice.
9259 2001-08-30 Paul Eggert <eggert@twinsun.com>
9261 * full-write.h: New file.
9262 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
9263 * full-write.c: Correct credits, as cccp.c no longer
9264 exists and anyway it was so heavily changed from the old cccp
9265 code as to be unrecognizable. Include full-write.h.
9266 (full_write) Return size_t, with short writes meaning failure.
9267 All callers changed. This fixes a bug with large buffers
9269 * utime.c: Include full-write.h.
9271 2001-08-30 Paul Eggert <eggert@twinsun.com>
9273 Merge 'exclude' changes from tar 1.13.22.
9274 This fixes one or two unlikely storage allocation overflow bugs,
9275 but doesn't change user-visible behavior otherwise.
9277 2001-08-30 Paul Eggert <eggert@twinsun.com>
9279 * exclude.c (bool): Declare, perhaps by including stdbool.h.
9280 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9281 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9282 Include if available.
9283 (<xalloc.h>): Include
9284 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9285 (verify): New macro. Use it to verify that EXCLUDE macros do not
9286 collide with FNM macros.
9287 (struct patopts): New struct.
9288 (struct exclude): Use it, as exclude patterns now come with options.
9289 (new_exclude): Support above changes.
9290 (new_exclude, add_exclude_file):
9291 Initial size must now be a power of two to simplify overflow checking.
9292 (free_exclude, fnmatch_no_wildcards): New function.
9293 (excluded_filename): No longer requires options arg, as the options
9294 are determined by add_exclude. Now returns bool, not int.
9295 (excluded_filename, add_exclude):
9296 Add support for the fancy new exclusion options.
9297 (add_exclude, add_exclude_file): Now takes int options arg.
9298 Check for arithmetic overflow when computing sizes.
9299 (add_exclude_file): xrealloc might modify errno, so don't
9300 realloc until after errno might be used.
9302 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9304 (free_exclude): New decl.
9305 (add_exclude, add_exclude_file): Now takes int options arg.
9306 (excluded_filename): No longer requires options arg, as the options
9307 are determined by add_exclude. Now returns bool, not int.
9309 2001-08-30 Paul Eggert <eggert@twinsun.com>
9311 * alloca.c (alloca): Arg is of type size_t, not unsigned.
9313 2001-08-27 Jim Meyering <meyering@lucent.com>
9315 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9317 * version-etc.c (N_): Remove definition.
9318 Revert most of last change.
9319 Instead, simply don't mark the `Copyright...' string for translation.
9320 Based on advice from Paul Eggert.
9322 * strtoxmax.c: Tweak comment.
9324 2001-08-26 Jim Meyering <meyering@lucent.com>
9326 * version-etc.c (version_etc_copyright_fmt): Replace literal year
9327 of copyright with `%s' so translators don't get an untranslated
9329 (COPYRIGHT_YEAR): Define.
9330 (version_etc): Use fprintf rather than fputs.
9331 Suggestion from Ulrich Drepper.
9333 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9335 * strtoll.c: New file, from GNU libc.
9336 * xstrtoimax.c: New file.
9338 * xstrtol.h: Add xstrtoimax.
9339 * strtoumax.c: New file. Simply include "strtoumax.c".
9340 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
9342 * strtoumax.c: Factor to work both for unsigned and signed types, ...
9343 * strtoxmax.c: ... then renamed to this.
9345 2001-08-13 Paul Eggert <eggert@twinsun.com>
9347 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9348 Port to Solaris 8, where 'sed' requires a space after the 'r'
9349 command, and where sh dislikes "$/". Clean up the spacing a bit.
9350 Redirect output to $tmp just once.
9352 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
9354 * addext.c (<errno.h>): Include.
9355 (errno): Declare if not defined.
9356 (addext): Work correctly when pathconf returns -1 and leaves
9357 errno alone because there is no limit. Also, work even if
9358 pathconf returns a value greater than SIZE_MAX.
9360 2001-08-12 Jim Meyering <meyering@lucent.com>
9362 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9363 Simply `return getcwd (NULL, 0);'.
9364 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9365 Use 1300 as initial value for length, not PATH_MAX.
9367 * pathmax.h: Clean up cpp syntax.
9369 2001-08-12 Jim Meyering <meyering@lucent.com>
9371 * gettimeofday.c: New file.
9373 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9375 2001-08-04 Jim Meyering <meyering@lucent.com>
9377 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9378 to get in sync with glibc.
9380 2001-08-03 Paul Eggert <eggert@twinsun.com>
9382 The following changes are from gettext 0.10.39 as maintained by
9385 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9386 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9387 with inverted sense. All uses changed.
9389 * mbswidth.c: Don't include <limits.h>.
9390 Include <stdlib.h> and <string.h> unconditionally.
9391 (iswcntrl, mbsinit, ISCNTRL): New macros.
9392 (mbsnwidth): Use K&R style function declarations.
9393 Don't bother checking for MB_LEN_MAX == 1, since the compiler
9394 can optimize it when MB_CUR_MAX == 1.
9395 The width of control characters is zero, not 1.
9397 2001-07-15 Jim Meyering <meyering@lucent.com>
9399 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9400 (BUILT_SOURCES): Add unlocked-io.h.
9401 (io_functions): Define.
9402 (unlocked-io.h): New rule.
9403 (DISTCLEANFILES): Add unlocked-io.h.
9404 (all-local): Depend on unlocked-io.h, to ensure it is created.
9406 * unlocked-io.hin: New file
9408 * regex.c: Update from glibc.
9410 2001-07-05 Jim Meyering <meyering@lucent.com>
9412 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9414 (libfetish_a_SOURCES): Put all .h files here instead.
9415 Remove a thus-exposed (better checks in automake) duplicate and
9416 two unnecessary .h files.
9418 2001-06-11 Jim Meyering <meyering@lucent.com>
9420 * regex.c: Update from GNU libc.
9422 2001-05-27 Jim Meyering <meyering@lucent.com>
9424 * readutmp.h (UT_TYPE): Define.
9426 2001-05-24 Jim Meyering <meyering@lucent.com>
9428 * argmatch.c: Include "quote.h".
9429 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
9430 quote function. Reported by Göran Uddeborg.
9432 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
9434 * dirname.c (dir_name): Compute append_dot using path, not newpath
9435 which is not yet declared.
9437 2001-05-11 Paul Eggert <eggert@twinsun.com>
9439 * Makefile.am (libfetish_a_SOURCES):
9440 Add strftime.c, since we now compile it on all hosts.
9442 * strftime.c (my_strftime):
9443 Define to nstrftime if emacs, but only if my_strftime is not defined.
9444 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9445 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9446 Add one more extra argument: a nanoseconds value.
9449 (my_strftime function): Add %N format.
9450 (emacs_strftimeu): Renamed from emacs_strftime,
9451 with extra ut argument.
9453 2001-05-11 Paul Eggert <eggert@twinsun.com>
9455 dirname code cleanup. base_name now behaves more compatibly
9456 with POSIX basename when given file names that have trailing
9457 slashes, and similarly for dir_name. Add new primitives
9458 base_len and dir_len. Put the directory-name-related decls
9461 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9462 * backupfile.c (base_name): Likewise.
9463 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9464 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9465 * makepath.c (strip_trailing_slashes): Likewise.
9466 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9468 * rename.c (strip_trailing_slashes): Likewise.
9469 * same.c (base_name): Likewise.
9470 * stripslash.c (ISSLASH): Likewise.
9472 * addext.c: Include <dirname.h> after size_t is defined.
9473 * backupfile.c: Likewise.
9475 * addext.c (addext): Use base_len to trim redundant
9476 trailing slashes instead of doing it ourselves.
9477 But do not trim the last slash if it is not redundant.
9479 * backupfile.c (find_backup_file_name,
9480 max_backup_version): Use base_len instead of rolling it ourselves.
9481 Handle the case of "" and (on DOS) "C:" correctly.
9483 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9484 Include <string.h>, <dirname.h>.
9485 (base_name): Allow file names ending in slashes, other than names
9486 that are all slashes. In this case, return the basename followed
9487 by the slashes. This is more general, and can be used in places
9488 where the original base_name purposely had an assertion failure.
9489 (base_len): New function.
9491 * dirname.c: Include <string.h> instead of <stdlib.h>.
9492 Do not include <assert.h>; no longer needed.
9494 (memrchr): Remove decl.
9495 (dir_name_r): Remove.
9496 (dir_len): Renamed from dirlen. All callers changed.
9497 Rewrite in terms of base_name, for simplicity and consistency.
9498 (dir_name): Never return NULL. All callers changed.
9499 Do not include <stdlib.h> in test program; no longer needed.
9500 return 0; is fine for test program.
9502 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9504 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9506 * path-concat.c (path_concat): Use base_len to compute
9507 base length, not strlen; this means we cannot rely on memcpy
9510 * same.c (STREQ): Remove.
9511 (same_name): Handle the case where the basename ends in trailing '/'.
9513 * stripslash.c (strip_trailing_slashes): Return nonzero if
9514 a slash was stripped. Do not strip the last slash after a
9517 2001-04-08 Jim Meyering <meyering@lucent.com>
9519 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9520 recomputed; that's necessary when the offset spans a DST transition.
9521 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
9523 2001-04-02 Jim Meyering <meyering@lucent.com>
9525 * regex.h, regex.c: Update from GNU libc.
9527 2001-03-19 Paul Eggert <eggert@twinsun.com>
9529 * version-etc.c (version_etc_copyright): Update to 2001.
9531 2001-03-16 Paul Eggert <eggert@twinsun.com>
9533 * tempname.c (uint64_t): Define to uintmax_t if
9534 not defined, and if UINT64_MAX is not defined.
9535 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9536 Reported by John David Anglin.
9538 2001-03-10 Bruno Haible <haible@clisp.cons.org>
9540 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9541 alias if codeset is empty.
9542 * config.charset (BeOS): Use wildcard syntax.
9544 2001-03-13 Jim Meyering <meyering@lucent.com>
9546 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9547 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9550 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9552 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9554 * unicodeio.c (print_unicode_char): Simplify accordingly.
9556 2001-03-06 Bruno Haible <haible@clisp.cons.org>
9558 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9559 support for DOS/DJGPP.
9561 2001-02-28 Paul Eggert <eggert@twinsun.com>
9563 * Makefile.am (libfetish_a_SOURCES):
9564 Add dup-safer.c, fopen-safer.c.
9565 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9567 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9569 2001-02-25 Paul Eggert <eggert@twinsun.com>
9571 The mkstemp replacement is taken from glibc 2.2.2, with some
9572 portability fixes for use outside glibc, as follows:
9574 * tempname.c (struct_stat64): New macro.
9575 (direxists, __gen_tempname): Use it.
9576 This avoids a portability problem with Solaris 8.
9578 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9579 (<stddef.h>, <stdint.h>, <string.h>):
9580 Include only if STDC_HEADERS || _LIBC.
9581 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9582 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9583 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9584 (__set_errno): Define this macro if <errno.h> doesn't.
9585 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9586 Define these macros if <stdio.h> doesn't.
9587 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9588 Define these macros if <sys/stat.h>
9589 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9590 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9591 __xstat64): Define if not _LIBC.
9592 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9593 (__gen_tempname): Invoke gettimeofday only if
9594 HAVE_GETTIMEOFDAY || _LIBC;
9595 otherwise, fall back on plain "time".
9596 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9598 * mkstemp.c (__GT_FILE): Define to zero if not defined.
9600 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9602 2001-02-17 Jim Meyering <meyering@lucent.com>
9604 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
9605 around included file name.
9607 * strnlen.c (__strnlen): Merge in a change from GNU libc.
9609 * strftime.c: Update from GNU libc (the only changes were to comments).
9611 2001-02-13 Bruno Haible <haible@clisp.cons.org>
9613 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9615 2001-02-17 Paul Eggert <eggert@twinsun.com>
9617 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9618 Remove workaround macros for hosts that have mbrtowc but not
9619 mbstate_t, as we now insist on proper declarations for both
9620 before using mbrtowc.
9622 2001-02-17 Jim Meyering <meyering@lucent.com>
9624 * regex.c: Update from libc.
9626 2001-02-16 Paul Eggert <eggert@twinsun.com>
9628 * alloca.c (malloc): Undef before defining, since stdlib.h
9629 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
9630 Reported by Mark Hounschell via Paul Eggert.
9632 2001-01-30 Bruno Haible <haible@clisp.cons.org>
9634 * config.charset: Update for FreeBSD 4.2.
9636 2001-01-26 Jim Meyering <meyering@lucent.com>
9638 * quotearg.c: Include stddef.h.
9639 * quote.c: Include stddef.h.
9640 Reported by Axel Kittenberger.
9642 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9643 line in double quotes so that it evokes a better diagnostic.
9644 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9645 Reported by Axel Kittenberger.
9647 2001-01-15 Bruno Haible <haible@clisp.cons.org>
9649 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9650 to avoid a warning. Add back 'const' to inptr.
9652 2001-01-16 Jim Meyering <meyering@lucent.com>
9654 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9657 2001-01-14 Jim Meyering <meyering@lucent.com>
9659 * rename.c: New file. From Volker Borchert.
9660 Include stdlib.h, string.h or strings.h, and xalloc.h.
9661 Use strip_trailing_slashes rather than open-coding it.
9663 2001-01-03 Paul Eggert <eggert@twinsun.com>
9665 * strftime.c: Sync with glibc time/strftime.c 1.81.
9667 2001-01-03 Jim Meyering <meyering@lucent.com>
9669 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9670 local `inptr' to avoid warning with some system declarations of iconv.
9672 2000-12-29 Paul Eggert <eggert@twinsun.com>
9674 * modechange.c: Do not assume that mode_t uses the
9675 traditional octal encoding. E.g. "chmod 1 FOO" should set
9676 the other-execute bit of FOO even if S_IXOTH != 1.
9678 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9679 WOTH, XOTH, ALLM): New macros.
9680 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9681 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9683 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9684 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9686 No need to use uintmax_t; unsigned long is long enough.
9687 Don't bother to get suffix since we don't use it.
9689 2000-12-24 Jim Meyering <meyering@lucent.com>
9691 * hash.c (is_prime): Return explicit boolean values.
9692 (hash_get_first): Return NULL to appease Irix5.6's 89.
9693 Reported by Nelson Beebe.
9695 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9697 * localcharset.c (locale_charset): Add support for Win32.
9699 2000-12-18 Paul Eggert <eggert@twinsun.com>
9701 * physmem.h, physmem.c: New files.
9703 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9704 (noinst_HEADERS): Add physmem.h.
9706 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9707 't' for compatibility with Solaris 8 sort.
9709 2000-12-18 Bruno Haible <haible@clisp.cons.org>
9711 * config.charset: Add support for BeOS.
9713 2000-12-16 Jim Meyering <meyering@lucent.com>
9715 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9716 SHELLS_FILE to a file name that's useful on djgpp systems.
9718 (ADDITIONAL_DEFAULT_SHELLS): Define.
9719 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9720 Based mostly on a patch from Prashant TR.
9722 2000-12-16 Jim Meyering <meyering@lucent.com>
9724 This bug had a serious impact on chown: `chown N:M FILE' (for integer
9725 N and M) would have treated it like `chown N:N FILE'.
9727 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9729 2000-10-31 Bruno Haible <haible@clisp.cons.org>
9731 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9732 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9733 to the list of canonical encodings. Rename EUC-CN to GB2312.
9735 2000-12-08 Andreas Schwab <schwab@suse.de>
9737 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9738 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9740 2000-12-07 Jim Meyering <meyering@lucent.com>
9742 * stripslash.c (ISSLASH): Define.
9743 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9746 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9747 (dir_name_r): Declare this function as static.
9748 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9749 manifest itself on a name containing a mix of slashes and
9751 Make this function work with names starting with a DOS-style
9752 drive letter and colon prefix.
9753 (dir_name): Append `.' if necessary.
9754 Based mostly on patches from Prashant TR and Eli Zaretskii.
9756 * dirname.h (dir_name_r): Remove prototype.
9758 2000-12-05 Jim Meyering <meyering@lucent.com>
9760 * dirname.c (dir_name_r): Add `const' in a few local declarations.
9762 2000-12-04 Jim Meyering <meyering@lucent.com>
9764 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9765 Also include memory.h, stdlib.h, unistd.h if appropriate.
9766 Reported by Andreas Jaeger (conflicting declaration of malloc).
9768 2000-12-02 Jim Meyering <meyering@lucent.com>
9770 * closeout.h: Make idempotent, to avoid some obscure warnings.
9772 2000-12-01 Paul Eggert <eggert@twinsun.com>
9774 * memrchr.c: Include <config.h> before any system include file.
9776 2000-11-29 Paul Eggert <eggert@twinsun.com>
9778 * dirname.c (dir_name_r): Fix typo: int -> size_t.
9780 2000-11-26 Jim Meyering <meyering@lucent.com>
9782 * memcoll.c: Include sys/types.h. From Werner Almesberger.
9784 2000-11-22 Paul Eggert <eggert@twinsun.com>
9786 * strftime.c (my_strftime): Do not invoke mbrlen with a
9787 size of (size_t) -1; it's not portable.
9789 2000-11-17 Akim Demaille <akim@epita.fr>
9791 * obstack.h: Formatting changes.
9792 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9793 prevent type checking.
9794 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9795 cast the value to (void *): assigning a `foo *' to a `void *'
9797 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9799 2000-11-17 Jim Meyering <meyering@lucent.com>
9801 * strstr.c: Update from GNU libc.
9803 2000-11-16 Jim Meyering <meyering@lucent.com>
9805 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9807 2000-11-11 Jim Meyering <meyering@lucent.com>
9809 * error.c: Add a couple #includes, merging from GNU libc version.
9811 2000-11-10 Jim Meyering <meyering@lucent.com>
9813 * obstack.h: Update from GNU libc.
9814 * obstack.c: Likewise.
9816 2000-11-06 Paul Eggert <eggert@twinsun.com>
9818 * getusershell.c (setusershell): Use rewind rather than
9819 fseek/fseeko, to avoid configuration hassles with fseeko.
9820 Don't bother opening SHELLS_FILE if shellstream is NULL;
9823 2000-11-05 Jim Meyering <meyering@lucent.com>
9825 * makepath.h (make_dir): Declare.
9826 * makepath.c (make_dir): Remove `static' attribute.
9829 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
9831 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
9832 last one in a bucket, advance to the next bucket.
9834 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
9836 * fnmatch.c: Do not comment out all the code if we are using
9837 the GNU C library, because in some cases we are replacing buggy
9838 code in the GNU C library itself.
9840 2000-10-30 Paul Eggert <eggert@twinsun.com>
9842 * error.h, getline.h, modechange.h:
9843 Remove "2000" from Copyright line, as the file hasn't been
9844 changed this year other than in the copyright notice.
9846 * xalloc.h: Add "2000" to Copyright line, as this file
9847 was changed this year.
9849 2000-10-30 Paul Eggert <eggert@twinsun.com>
9851 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9852 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9853 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9855 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
9857 * regex.h (__restrict_arr): Move definition out of #ifndef block.
9858 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9859 doesn't define __restrict_arr.
9861 2000-10-29 Jim Meyering <meyering@lucent.com>
9863 * xstat.in: Fix grammar in comment.
9865 2000-10-28 Jim Meyering <meyering@lucent.com>
9867 * memchr.c: Update from libc.
9868 Adjust for portability:
9869 [HAVE_STDLIB_H]: Include stdlib.h.
9870 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9871 Undef __memchr, too.
9872 [!weak_alias]: Define __memchr to memchr.
9874 * regex.c: Update from libc.
9875 * regex.h: Likewise.
9876 * getopt1.c: Likewise.
9877 * memcmp.c: Likewise.
9879 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9880 Avoid using fseek, when possible -- it's broken by design.
9881 Patch by Ulrich Drepper.
9883 2000-10-26 Jim Meyering <meyering@lucent.com>
9885 * strftime.c: Update from libc.
9887 2000-10-25 Jim Meyering <meyering@lucent.com>
9889 * obstack.c: Update from libc.
9891 2000-10-23 Jim Meyering <meyering@lucent.com>
9893 * hard-locale.c (hard_locale): Revert last change -- it was simply
9894 wrong. That set_locale call must not have any side effects.
9897 2000-10-22 Jim Meyering <meyering@lucent.com>
9899 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9900 [CYCLIC]: Remove now-unused definition.
9902 * save-cwd.c (O_DIRECTORY): Define, if needed.
9903 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9904 Suggestion from Ulrich Drepper.
9906 2000-10-21 Jim Meyering <meyering@lucent.com>
9908 * dirname.c (dir_name_r): New function, factored out of dir_name.
9909 (dir_name): Use dir_name_r.
9910 * dirname.h (dir_name_r): Declare it.
9912 2000-10-21 Jim Meyering <meyering@lucent.com>
9914 * dirname.c (memrchr): Declare if necessary.
9915 (dir_name): Remove the restriction that there be no
9916 trailing slashes. Now, this code skips past them, effectively
9918 [TEST_DIRNAME] (main): New unit tests.
9920 * memrchr.c: New file from GNU libc.
9921 Undef __memrchr, too.
9922 [!weak_alias]: Define __memrchr to memrchr.
9923 Guard weak_alias use with `#ifdef weak_alias'.
9925 2000-10-17 Jim Meyering <meyering@lucent.com>
9927 * quote.h (PARAMS): Define and use.
9928 Reported by Akim Demaille.
9930 * getopt.c: Update from libc.
9932 2000-10-16 Jim Meyering <meyering@lucent.com>
9934 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9937 2000-09-25 Jim Meyering <meyering@lucent.com>
9939 * md5.h (rol): Define (from GnuPG).
9941 * sha.c: Give credit (GnuPG) where due.
9942 (M): Use rol rather than open-coding it.
9943 Add a FIXME comment.
9945 2000-09-21 Jim Meyering <meyering@lucent.com>
9947 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9948 Reported by Michael Stone.
9950 2000-09-20 Jim Meyering <meyering@lucent.com>
9952 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9953 (noinst_HEADERS): Add sha.h.
9954 Based on code from Scott G. Miller and from GnuPG.
9956 2000-09-15 Jim Meyering <meyering@lucent.com>
9958 * regex.c: Update from libc.
9960 2000-09-10 Jim Meyering <meyering@lucent.com>
9962 * getopt.c (_getopt_internal): Update from glibc.
9964 2000-09-09 Jim Meyering <meyering@lucent.com>
9966 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9967 think it should be used as a general replacement for isascii.
9968 * fnmatch.c: Likewise.
9969 * mbswidth.c: Likewise
9970 * regex.c: Likewise.
9973 * userspec.c: Include sys/param.h and limits.h.
9975 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9976 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9977 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9978 UID, GID. Check range.
9980 2000-09-06 Jim Meyering <meyering@lucent.com>
9982 * getopt.c (_getopt_internal): Update from glibc.
9984 2000-08-30 Jim Meyering <meyering@lucent.com>
9986 * strftime.c: Merge in changes from GNU libc.
9988 2000-08-26 Jim Meyering <meyering@lucent.com>
9990 * closeout.c: Include "__fpending.h".
9991 (close_stdout_status): Return right away if there's nothing to flush.
9993 * Makefile.am (noinst_HEADERS): Add __fpending.h.
9994 * __fpending.c: New file.
9995 * __fpending.h: New file.
9997 2000-08-07 Paul Eggert <eggert@twinsun.com>
9999 Standardize on "memory exhausted" instead of "Memory exhausted"
10000 or "virtual memory exhausted".
10001 * obstack.c (print_and_abort): Use "memory exhausted", not
10002 "virtual memory exhausted".
10003 * same.c (same_name): Invoke xalloc_die instead of printing
10005 * userspec.c (parse_user_spec): Likewise.
10006 * bumpalloc.h: comment fix
10007 * same.c, userspec.c: Include xalloc.h.
10009 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
10010 not char *const and pointing to a constant array.
10011 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
10012 (xrealloc): Comment fix.
10014 * userspec.c (parse_user_spec):
10015 Don't translate a message until just before returning,
10016 to avoid unnecessary translation.
10018 2000-08-07 Jim Meyering <meyering@lucent.com>
10020 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
10021 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
10022 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
10023 getgroups.c, gethostname.c, getopt.h, group-member.c,
10024 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
10025 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
10026 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
10027 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
10028 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
10029 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
10030 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
10031 yesno.c: Back out Copyright date changes for each file with no change
10032 this year. This eases coordination with other programs using the same
10033 source code modules. From Paul Eggert.
10035 2000-08-03 Greg McGary <greg@mcgary.org>
10037 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
10038 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
10039 (EXTEND_BUFFER): Use them.
10041 2000-08-01 Jim Meyering <meyering@lucent.com>
10043 * dirname.c (ISSLASH): Define.
10044 (BACKSLASH_IS_PATH_SEPARATOR): Define.
10045 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
10046 both `\' and `/' may be use as path separators.
10047 Based on a patch from Prashant TR.
10049 2000-07-31 Paul Eggert <eggert@twinsun.com>
10051 * quotearg.c (quotearg_n_options): Don't make the initial
10052 slot vector a constant, since it might get modified.
10054 2000-07-31 Jim Meyering <meyering@lucent.com>
10056 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
10057 * obstack.c (print_and_abort): Likewise.
10059 2000-07-30 Paul Eggert <eggert@twinsun.com>
10061 * quotearg.c (quotearg_n_options): Preallocate a slot 0
10062 buffer, so that the caller can always quote one small
10063 component of a "memory exhausted" message in slot 0.
10064 From a suggestion by Jim Meyering.
10066 2000-07-30 Jim Meyering <meyering@lucent.com>
10068 * makepath.c (make_path): Quote the other instance, too.
10070 * quotearg.c (N_STATIC_SLOTVECS): Define.
10071 (STATIC_BUF_SIZE): Define.
10072 (quotearg_n_options): Use only statically allocated storage when
10073 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
10074 than STATIC_BUF_SIZE.
10076 2000-07-29 Jim Meyering <meyering@lucent.com>
10078 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
10079 * dirname.c (dir_name): Likewise.
10081 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
10083 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
10084 (dir_name): Assert that there are no trailing slashes.
10086 2000-07-18 Bruno Haible <haible@clisp.cons.org>
10088 * mbswidth.h (mbswidth): Add a flags argument.
10089 (mbswidth): New declaration.
10090 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
10091 * mbswidth.c (mbswidth): Add a flags argument.
10092 (mbsnwidth): New function.
10094 2000-07-24 Jim Meyering <meyering@lucent.com>
10096 * mbswidth.c: Remove useless #else. From Bruno Haible.
10098 2000-07-23 Paul Eggert <eggert@twinsun.com>
10100 * mbswidth.c (_XOPEN_SOURCE):
10101 Don't define; this causes problems on Solaris 7.
10102 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
10104 2000-07-23 Paul Eggert <eggert@twinsun.com>
10107 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10108 so that mbstate_t is always defined.
10110 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
10111 be 1 in at least one GCC installation, and this configuration
10112 error is likely to be common. Ignoring MB_LEN_MAX hurts
10113 performance on hosts that have mbrtowc but have only unibyte
10114 locales, but I assume these hosts are rare.
10116 2000-07-23 Paul Eggert <eggert@twinsun.com>
10118 * quotearg.c: Streamline by invoking multibyte code only if needed.
10119 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
10120 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
10121 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10122 invoke multibyte primitives.
10124 2000-07-23 Jim Meyering <meyering@lucent.com>
10126 * basename.c (base_name): Add an assertion.
10128 2000-07-15 Bruno Haible <clisp.cons.org>
10130 * quotearg.c: When the system forces us to redefine mbstate_t,
10131 shadow its mbsinit function.
10133 2000-07-16 Bruno Haible <haible@clisp.cons.org>
10135 * mbswidth.h: New file.
10136 * mbswidth.c: New file.
10137 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
10138 (noinst_HEADERS): Add mbswidth.h.
10140 2000-07-17 Bruno Haible <haible@clisp.cons.org>
10142 * config.charset: Add support for FreeBSD. Improve support for HP-UX
10145 2000-07-15 Jim Meyering <meyering@lucent.com>
10147 * makepath.c: Include quote.h.
10148 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
10149 corresponding argument in a `quote (...)' call.
10150 Give better diagnostics.
10152 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
10153 (noinst_HEADERS): Add quote.h.
10155 * quote.c (quote, quote_n): New file. Two functions taken verbatim
10156 from tar's src/misc.c.
10157 * quote.h: New file. Prototypes for same.
10159 2000-07-10 Paul Eggert <eggert@twinsun.com>
10161 From a suggestion by Bruno Haible.
10162 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10163 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10164 to decide whether to define the BeOS workaround macro;
10165 this adjusts to the change to AC_MBSTATE_T.
10167 2000-07-13 Paul Eggert <eggert@twinsun.com>
10169 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
10171 * quotearg.c (quoting_style_args, quoting_style_vals,
10172 quotearg_buffer_restyled): Add support for
10173 clocale_quoting_style. Undo previous change to
10174 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
10175 and "{RIGHT QUOTATION MARK}" msgids.
10177 2000-07-05 Paul Eggert <eggert@twinsun.com>
10179 The old behavior of quoting `like this' doesn't look good with
10180 newer, ISO-style fonts. See:
10181 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
10183 Instead, quote "like this" by default. Let the translator
10184 tailor the locale-specific quoting behavior by providing
10185 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
10187 * quotearg.c (N_): New macro.
10188 (gettext_default): New function.
10189 (quotearg_buffer_restyled): Use
10190 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
10191 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
10193 2000-07-09 Jim Meyering <meyering@lucent.com>
10195 * Most files: Update copyright dates to include 2000.
10197 2000-07-08 Jim Meyering <meyering@lucent.com>
10199 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
10201 (xgethostname): Remove now-unnecessary #ifdef.
10202 Move declaration of `err' into loop where it's used.
10204 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10206 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
10207 by allocating a larger buffer. Test the gethostname return value for
10208 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
10209 returns an error and ENAMETOOLONG isn't defined.
10211 2000-07-05 Paul Eggert <eggert@twinsun.com>
10212 and Bruno Haible <haible@clisp.cons.org>
10214 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10216 2000-07-05 Bruno Haible <haible@clisp.cons.org>
10218 * quotearg.c (struct quoting_options): Simplify quote_these_too
10221 2000-07-03 Jim Meyering <meyering@lucent.com>
10223 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
10224 Reported by Bruno Haible.
10226 2000-07-04 Jim Meyering <meyering@lucent.com>
10228 * quotearg.c: Make inclusion of <wchar.h> independent of whether
10229 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
10232 2000-07-03 Paul Eggert <eggert@twinsun.com>
10233 and Bruno Haible <haible@clisp.cons.org>
10235 * quotearg.c (mbrtowc):
10236 Assign to *pwc, and return 1 only if result is nonzero.
10237 (iswprint): Use ISPRINT when substituting our own mbrtowc.
10239 2000-07-03 Jim Meyering <meyering@lucent.com>
10241 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
10242 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
10245 2000-07-02 Jim Meyering <meyering@lucent.com>
10247 * quotearg.c (mbstate_t): Don't define here.
10249 2000-07-02 Jim Meyering <meyering@lucent.com>
10251 * nanosleep.c (SIGCONT): Define if not already defined.
10253 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10255 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
10256 per change in ../m4/ls-mntd-fs.m4.
10257 (read_filesystem_list): Ignore symbolic links.
10259 2000-06-29 Jim Meyering <meyering@lucent.com>
10261 * same.c: Include <string.h> or <strings.h>, as appropriate,
10262 for declaration of strcmp.
10264 * long-options.c: Include <stdlib.h>, for declaration of exit.
10266 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
10267 Avoid warning by casting result to `char *' to remove `const'.
10269 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10271 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
10273 2000-06-26 Paul Eggert <eggert@twinsun.com>
10275 savedir now sets errno on failure and invokes xmalloc to get memory.
10276 Fix a couple of other minor bugs while we're at it.
10278 * savedir.c (<unistd.h>): Do not include; there's no need.
10279 (NAMLEN): Remove macro.
10280 (malloc, realloc): Remove decls.
10281 (stpcpy): Likewise.
10282 ("xalloc.h"): Include.
10283 (NAME_SIZE_DEFAULT): New macro.
10284 (savedir): Use xmalloc / xrealloc to allocate memory.
10285 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
10286 Skip "" directory entries.
10287 Use strlen to calculate directory entry length, since the old method
10288 is rarely used these days and isn't worth supporting.
10289 Don't use a pointer after freeing it.
10290 Check for integer overflow when calculating allocation size.
10291 Use memcpy to copy entries, instead of stpcpy.
10292 Set errno properly when returning NULL.
10293 Check for readdir error.
10295 2000-06-26 Jim Meyering <meyering@lucent.com>
10297 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
10299 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10301 * getusershell.c (xmalloc, xrealloc): Remove functions.
10303 Don't include <stdlib.h>. Don't declare malloc, realloc.
10305 2000-06-23 Bruno Haible <haible@clisp.cons.org>
10307 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
10309 2000-06-24 Jim Meyering <meyering@lucent.com>
10311 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
10313 2000-06-21 Jim Meyering <meyering@lucent.com>
10315 * getpass.c: New file, from Bruno Haible. Required for BeOS.
10317 2000-06-19 Paul Eggert <eggert@twinsun.com>
10319 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10320 (mbrtowc, mbstate_t): Define substitutes if
10321 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10322 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10323 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10325 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10327 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10328 than 1024, return a memory chunk of least possible size, instead
10329 of size PATH_MAX + 2. In the loop, increment the size proportionally.
10330 Use free/xmalloc instead of xrealloc to avoid copying for very long
10333 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10335 * canon-host.c (canon_host): Use malloc and memcpy to copy an
10336 address, not strdup. Include <stdlib.h> and don't declare free().
10338 2000-06-17 Bruno Haible <haible@clisp.cons.org>
10340 * path-concat.c (path_concat): Don't access dir[-1] if dir is
10343 2000-06-21 Jim Meyering <meyering@lucent.com>
10345 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10346 (noinst_HEADERS): Add getstr.h.
10348 * getline.c (getstr): Move into a separate file.
10349 * getstr.c (getstr): New file, extracted from getline.c, with
10350 the following changes: new parameter, delim2; both delim[12]
10351 parameters have type `int', not `char'. The latter would lose
10352 with 8-bit delimiters.
10353 * getstr.h: New file.
10355 2000-06-19 Jim Meyering <meyering@lucent.com>
10357 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10359 2000-06-18 Jim Meyering <meyering@lucent.com>
10361 * mkdir.c: Remove file, due mainly to copyright incompatibility.
10362 Besides, these days every porting target provides a mkdir function.
10364 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10365 (this snippet comes from src/system.h).
10367 2000-06-15 Paul Eggert <eggert@twinsun.com>
10369 * human.c (adjust_value): New function.
10370 (human_readable_inexact): Apply rounding style even when
10371 printing approximate values.
10373 2000-06-14 Paul Eggert <eggert@twinsun.com>
10375 * human.c (human_readable_inexact): Allow an input block
10376 size that is not a multiple of the output block size, and vice versa.
10377 Reported by Piergiorgio Sartor.
10379 2000-06-14 Paul Eggert <eggert@twinsun.com>
10381 * getdate.y (get_date): Apply relative times after time
10382 zone indicator, not before. Reported by Todd A. Jacobs.
10384 2000-06-13 Jim Meyering <meyering@lucent.com>
10386 * Makefile.am (all-local): Depend on lstat.c and stat.c.
10388 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10390 2000-06-12 Paul Eggert <eggert@twinsun.com>
10392 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10394 2000-06-04 Paul Eggert <eggert@twinsun.com>
10396 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10398 2000-06-04 Jim Meyering <meyering@lucent.com>
10400 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10401 SunOS 4.1.4 for which gid_t is an unsigned type.
10403 2000-06-03 Jim Meyering <meyering@lucent.com>
10405 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10407 2000-05-26 Bruno Haible <haible@clisp.cons.org>
10409 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10410 newer, don't install charset.alias.
10411 * config.charset: Change the Linux/glibc rules so they become empty
10412 on glibc-2.1 or newer.
10414 2000-06-02 Jim Meyering <meyering@lucent.com>
10416 * mountlist.c: Back out last change. Instead, do this...
10417 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10418 member using the same `ignore'-testing code.
10419 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10423 2000-05-29 Jim Meyering <meyering@lucent.com>
10425 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10426 with the `ignore' attribute. Based on a patch from Mark D. Roth.
10428 2000-05-22 Jim Meyering <meyering@lucent.com>
10430 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10432 2000-05-18 Jim Meyering <meyering@lucent.com>
10434 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10435 back, too, since it may have been modified by allocate_entry.
10436 (hash_delete): Rewrite to use neither the assignment operator
10437 nor the comma operator in an if-expression.
10439 2000-05-15 Paul Eggert <eggert@twinsun.com>
10442 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10443 Remove; no longer needed.
10444 "quotearg.h": Add include.
10445 (file_name): Do not bother to explicitly initialize to NULL; it's less
10446 efficient on some hosts.
10447 (close_stdout_status): Remove test as to whether stdout was already
10448 closed; it breaks for the case "echo x | sort >&-".
10449 Quote file name colons.
10450 Do not assume that _("write error") lacks format strings.
10452 2000-05-15 Jim Meyering <meyering@lucent.com>
10454 * version-etc.c (version_etc_copyright): Update the copyright string
10455 used in all --version output.
10457 2000-05-14 Jim Meyering <meyering@lucent.com>
10459 * closeout.c (close_stdout_set_file_name): New function.
10460 (close_stdout_status): Use new file-scoped global.
10461 Return right away if fstat says the stdout file descriptor is invalid.
10462 * closeout.h (close_stdout_set_file_name): Declare.
10464 2000-05-10 Jim Meyering <meyering@lucent.com>
10466 * closeout.c [default_exit_status]: New file-scoped variable.
10467 (close_stdout_set_status): New function.
10468 * closeout.h (close_stdout_set_status): Declare.
10470 2000-05-08 Jim Meyering <meyering@lucent.com>
10472 * long-options.c: Don't include closeout.h.
10473 (parse_long_options): Don't call close_stdout for --version.
10475 2000-05-06 Jim Meyering <meyering@lucent.com>
10477 * strnlen.c: Undefine __strnlen and strnlen.
10478 [!weak_alias]: Define __strnlen to strnlen.
10480 * atexit.c: New file, from libiberty.
10482 2000-05-06 Jim Meyering <meyering@lucent.com>
10484 * closeout.c (close_stdout_status): Also check for errors on the
10487 2000-05-05 Bruno Haible <haible@clisp.cons.org>
10489 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10490 instead of xmalloc, xrealloc, path_concat.
10491 (locale_charset): Treat empty environment variables as absent.
10492 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10494 2000-05-04 Jim Meyering <meyering@lucent.com>
10496 * getopt.c: Update from glibc.
10497 * obstack.c: Likewise.
10498 * obstack.h: Likewise.
10499 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
10501 * regex.h: Likewise.
10502 * strndup.c: Likewise.
10503 * strnlen.c: New file, from glibc.
10505 2000-05-01 Jim Meyering <meyering@lucent.com>
10507 * full-write.c (full_write): Remove `FIXME' part of comment.
10509 2000-04-29 Jim Meyering <meyering@lucent.com>
10511 * path-concat.c: Declare strdup only if it's not defined.
10512 * canon-host.c: Likewise.
10514 2000-04-28 Jim Meyering <meyering@lucent.com>
10516 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10517 redefinition warning on some systems (HPUX). Otherwise, regex.h is
10518 included first, then limits.h is included by locale.h by libintl.h.
10519 From John David Anglin.
10521 2000-04-25 Jim Meyering <meyering@lucent.com>
10523 * makepath.c (S_IRWXUGO): Define.
10524 (make_path): Always perform explicit chmod if MODE specifies any
10525 of the `special' permission bits. Prompted by a bug report against
10526 install from Mate Wierdl and Joost van Baal.
10528 2000-04-18 Jim Meyering <meyering@lucent.com>
10530 * README: New file.
10532 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10533 getpagesize. For BeOS. Based on a patch from Bruno Haible.
10535 2000-04-17 Jim Meyering <meyering@lucent.com>
10537 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10538 the definition of it to rpl_strftime also defined-away the system's
10541 2000-04-15 Jim Meyering <meyering@lucent.com>
10543 Use `C' to denote so-called `contiguous' files, the same way
10545 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10546 (ftypelet): Use S_ISCTG.
10547 From Michael Deutschmann.
10549 2000-04-14 Jim Meyering <meyering@lucent.com>
10551 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10553 2000-04-08 Jim Meyering <meyering@lucent.com>
10555 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10556 names don't conflict. Reported by Eli Zaretskii.
10558 2000-03-28 Bruno Haible <haible@clisp.cons.org>
10560 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10561 bug. Deal with the different error behavior of Irix iconv.
10563 2000-04-07 Jim Meyering <meyering@lucent.com>
10565 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10566 to work around system header problems on AIX 3.2.5. From Bruno Haible.
10568 2000-04-05 Jim Meyering <meyering@lucent.com>
10570 Portability tweaks required for ultrix4.3.
10571 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10572 * readutmp.c: Include sys/types.h before sys/stat.h.
10573 * canon-host.c: Declare strdup.
10574 * path-concat.c: Likewise.
10575 From John David Anglin.
10577 2000-04-04 Jim Meyering <meyering@lucent.com>
10579 Be more DOS 8.3-friendly.
10580 * ref-add.sin: Renamed from ref-add.sed.in.
10581 * ref-del.sin: Renamed from ref-del.sed.in.
10582 * Makefile.am: Reflect renaming.
10583 Reported by Eli Zaretskii.
10585 Use a temporary file name that won't clash with `charset.alias'
10586 in the DOS 8.3 name space.
10587 * Makefile.am (charset_tmp): Define.
10588 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10589 (uninstall-local): Likewise.
10590 Reported by Eli Zaretskii.
10592 2000-03-29 Paul Eggert <eggert@twinsun.com>
10594 * time/strftime.c (my_strftime): Make sure we call the system
10595 strftime, not ourselves, when invoking the underlying strftime.
10597 2000-03-24 Jim Meyering <meyering@lucent.com>
10599 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10600 (charset_alias): Define.
10601 (install-exec-local): Factor out common code.
10602 (uninstall-local): Split lines longer than 80.
10603 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10604 (SUFFIXES): Define.
10605 (.sed.in.sed): New rule. Don't redirect directly to $@.
10606 (CLEANFILES): Add ref-add.sed and ref-del.sed.
10608 2000-03-19 Bruno Haible <haible@clisp.cons.org>
10610 * config.charset: Output a line containing "Packages using this file".
10611 * ref-add.sed.in, ref-del.sed.in: New files.
10612 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10613 ref-del.sed): New rules.
10615 2000-03-17 Jim Meyering <meyering@lucent.com>
10617 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10618 Otherwise, include <strings.h>
10620 2000-03-17 Bruno Haible <haible@clisp.cons.org>
10622 * unicodeio.c (utf8_wctomb): New function.
10623 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10624 format instead of in UCS-4 with platform dependent endianness.
10626 2000-03-07 Paul Eggert <eggert@twinsun.com>
10628 * savedir.c (savedir): Work even if directory size is
10629 negative; this can happen with some screwy NFS configurations.
10631 2000-03-06 Jim Meyering <meyering@lucent.com>
10633 * localcharset.c (get_charset_aliases): Don't try to free file_name
10634 if it's NULL (because we ran out of memory). From Bruno Haible.
10636 2000-03-05 Jim Meyering <meyering@lucent.com>
10638 * localcharset.c ("path-concat.h"): Include.
10639 (get_charset_aliases): Use path_concat instead of ANSI string
10642 * unicodeio.h (PARAMS): Define.
10643 Use it to guard prototype.
10645 2000-03-04 Jim Meyering <meyering@lucent.com>
10647 * Makefile.am (install-exec-local): Create $(libdir) before installing
10649 (uninstall-local): Uncomment this rule so `make distcheck' works
10652 * unicodeio.c (<errno.h>): Include it.
10653 (errno): Declare if not defined.
10655 * localcharset.c: Add Bruno's comment justifying use of volatile.
10657 * config.charset: New version, incorporating remarks from a linux
10658 i18n mailing list. From Bruno Haible.
10660 2000-03-02 Jim Meyering <meyering@lucent.com>
10662 * Makefile.am (EXTRA_DIST): Add config.charset.
10664 2000-03-01 Jim Meyering <meyering@lucent.com>
10666 * localcharset.c: Guard some #includes with `#if HAVE_...'.
10667 * unicodeio.c: Likewise.
10669 2000-02-02 Bruno Haible <haible@clisp.cons.org>
10671 * config.charset: New file.
10672 * localcharset.c: New file.
10673 * unicodeio.h, unicodeio.c: New files.
10674 * Makefile.am (DEFS): Add -DLIBDIR=...
10675 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10676 (noinst_HEADERS): Add unicodeio.h.
10677 (all-local, install-exec-local, charset.alias): New targets.
10679 2000-02-28 Paul Eggert <eggert@twinsun.com>
10681 * quotearg.c (ALERT_CHAR): New macro.
10682 (quotearg_buffer_restyled): Use it.
10684 2000-02-27 Jim Meyering <meyering@lucent.com>
10686 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10687 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10689 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10690 not `#if STDC_HEADERS'.
10691 Declare malloc if needed.
10693 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10694 now that autoconf always defines the HAVE_DECL_ symbols.
10695 * human.c: Likewise.
10696 * same.c: Likewise.
10697 * strtoumax.c: Likewise.
10699 * backupfile.c: Arrange for cpp to fail if the configure-time
10700 declaration check was not run.
10701 * hash.c: Likewise.
10702 * human.c: Likewise.
10703 * same.c: Likewise.
10704 * strtoumax.c: Likewise.
10706 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10707 then first look up the entire `.'-containing string as a login name.
10709 2000-02-18 Paul Eggert <eggert@twinsun.com>
10711 * getdate.y: Handle two-digit years with leading zeros correctly.
10712 (textint): New typedef.
10713 (parser_control): Member year changed from int to textint.
10715 (YYSTYPE): Removed; replaced by %union with int and textint members.
10716 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10717 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10718 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10719 (tSNUMBER, tUNUMBER): Now of type <textintval>.
10720 (date, number, to_year): Use width of number in digits, not its value,
10721 to determine whether it's a 2-digit year, or a 2-digit time.
10722 (yylex): Store number of digits of numeric tokens.
10723 Reported by John Kendall.
10725 (parser_control): Changed from struct parser_control to typedef (for
10726 consistency). All uses changed.
10728 (tID): Removed; not used.
10729 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10731 2000-02-14 Paul Eggert <eggert@twinsun.com>
10733 * getpagesize.h (getpagesize): Port to VMS for Alpha;
10734 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10736 2000-02-12 Jim Meyering <meyering@lucent.com>
10738 * userspec.c (ISDIGIT): Define it.
10739 (isdigit): Remove definition.
10740 (is_number): Use ISDIGIT, not isdigit.
10741 <libintl.h>: Include.
10742 (_ and N_): Define.
10743 (parse_user_spec): Mark translatable strings.
10745 2000-02-10 Jim Meyering <meyering@lucent.com>
10747 With these changes, nanosleep.[ch] are finally enough like the other
10748 lib/* replacement files to compile on a few more losing systems.
10750 * nanosleep.h: Don't include config.h.
10751 Remove prototype from declaration of nanosleep.
10752 (PARAMS): Remove now-unneeded definition.
10753 * nanosleep.c: #undef nanosleep.
10754 (rpl_nanosleep): Rename from nanosleep.
10756 2000-02-03 Jim Meyering <meyering@lucent.com>
10758 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10759 rather than with `#if HAVE_UTMPNAME'.
10761 2000-02-01 Jim Meyering <meyering@lucent.com>
10763 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
10765 2000-01-31 Jim Meyering <meyering@lucent.com>
10767 * nanosleep.h (nanosleep): Guard declaration with
10768 `#if ! HAVE_DECL_NANOSLEEP'.
10769 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10770 the declaration in that vendor's sys/timers.h.
10771 Reported by Christian Krackowizer.
10773 * quotearg.c (ISASCII): Add #undef and move definition to follow
10774 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10775 (ISPRINT): Likewise.
10776 Reported by Tom Tromey.
10778 2000-01-30 Jim Meyering <meyering@lucent.com>
10780 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10781 uses of ->ut_name. The latter doesn't work with new Linux header files
10782 where only utmpx.ut_user is declared.
10784 * readutmp.h (UT_USER): Define.
10786 2000-01-23 Jim Meyering <meyering@lucent.com>
10788 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10791 2000-01-22 Jim Meyering <meyering@lucent.com>
10793 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10794 [! HAVE_DECL_STRTOULL]: Declare strtoull.
10795 Required for some AIX systems. Reported by Christian Krackowizer.
10796 [TESTING] (main): New function.
10798 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
10799 * dirname.c (dir_name): Support for DOS-style file names with drive
10802 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10804 * strverscmp.c (ISDIGIT): Define.
10805 (strverscmp): Use ISDIGIT, not isdigit.
10807 2000-01-17 Paul Eggert <eggert@twinsun.com>
10809 * nanosleep.c (nanosleep):
10810 Don't use SA_INTERRUPT to decide whether to call sigaction, as
10811 POSIX.1 doesn't require SA_INTERRUPT and some systems
10812 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
10813 it's been part of POSIX.1 since day 1 (in 1988).
10815 2000-01-17 Jim Meyering <meyering@lucent.com>
10817 * interlock: Remove unused file. Reported by François Pinard.
10819 2000-01-16 Paul Eggert <eggert@twinsun.com>
10821 * quotearg.c (quotearg_buffer_restyled): Do not quote
10822 alert, backslash, formfeed, and vertical tab unnecessarily in
10823 shell quoting style.
10826 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10827 Free Software Foundation, Inc.
10828 Copying and distribution of this file, with or without modification,
10829 are permitted provided the copyright notice and this notice are preserved.