1 2006-07-19 Derek R. Price <derek@ximbiot.com>
3 * getaddrinfo.h: Don't define unimplemented AI_* flags.
4 Reindent and repaginate.
6 2006-07-17 Bruno Haible <bruno@clisp.org>
10 * gl_array_list.h: New file.
11 * gl_array_list.c: New file.
12 * gl_carray_list.h: New file.
13 * gl_carray_list.c: New file.
14 * gl_linked_list.h: New file.
15 * gl_linked_list.c: New file.
16 * gl_anylinked_list1.h: New file.
17 * gl_anylinked_list2.h: New file.
18 * gl_avltree_list.h: New file.
19 * gl_avltree_list.c: New file.
20 * gl_anyavltree_list1.h: New file.
21 * gl_anyavltree_list2.h: New file.
22 * gl_rbtree_list.h: New file.
23 * gl_rbtree_list.c: New file.
24 * gl_anyrbtree_list1.h: New file.
25 * gl_anyrbtree_list2.h: New file.
26 * gl_anytree_list1.h: New file.
27 * gl_anytree_list2.h: New file.
28 * gl_linkedhash_list.h: New file.
29 * gl_linkedhash_list.c: New file.
30 * gl_anyhash_list1.h: New file.
31 * gl_anyhash_list2.h: New file.
32 * gl_avltreehash_list.h: New file.
33 * gl_avltreehash_list.c: New file.
34 * gl_rbtreehash_list.h: New file.
35 * gl_rbtreehash_list.c: New file.
36 * gl_anytreehash_list1.h: New file.
37 * gl_anytreehash_list2.h: New file.
39 * gl_oset.h: New file.
40 * gl_oset.c: New file.
41 * gl_array_oset.h: New file.
42 * gl_array_oset.c: New file.
43 * gl_avltree_oset.h: New file.
44 * gl_avltree_oset.c: New file.
45 * gl_rbtree_oset.h: New file.
46 * gl_rbtree_oset.c: New file.
47 * gl_anytree_oset.h: New file.
49 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
51 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
53 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
54 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
55 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
56 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
57 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
58 callers changed. Revamp internals significantly, by not
59 attempting to create directories that are temporarily more
60 permissive than the final results. Do not attempt to use
61 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
62 This removes some race conditions, fixes some bugs, and simplifies
63 things. Use new dirchownmod function to do owner and mode changes.
64 * mkdir-p.h: Likewise.
65 * modechange.c (octal_to_mode): New function.
66 (struct mode_change): New member mentioned.
67 (make_node_op_equals): New arg mentioned. All callers changed.
68 (mode_compile): Keep track of which mode bits the user has explicitly
70 (mode_adjust): New arg DIR, so that we implement the X op correctly.
71 New arg PMODE_BITS, to keep track of which mode bits the user
72 mentioned; it treats S_ISUID and S_ISGID speciall.
74 * modechange.h: Likewise.
76 2006-07-11 Derek R. Price <derek@ximbiot.com>
78 * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
80 2006-07-10 Derek R. Price <derek@ximbiot.com>
82 * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
83 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
84 macros into the GNU _D_EXACT_NAMLEN.
85 * savedir.c: Likewise.
86 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
88 2006-07-09 Jim Meyering <jim@meyering.net>
90 * argp-pv.c: Remove a doubled word in a comment.
91 * check-version.c (check_version): Likewise.
92 * javacomp.c (compile_java_class): Likewise.
94 2006-07-08 Jim Meyering <jim@meyering.net>
96 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
98 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
100 * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
101 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
102 brackets. Other minor changes to suppress some compiler
105 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
107 * getloadavg.c: Use __VMS, not VMS.
108 * getopt.c: Likewise.
109 * getpagesize.h: Likewise.
110 * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
111 probably does not work.
113 2006-07-06 Derek R. Price <derek@ximbiot.com>
114 and Paul Eggert <eggert@cs.ucla.edu>
116 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
117 Don't worry about this obsolete case any more.
118 (HAVE_DIR): Remove. All uses removed; we now assume you can read
120 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
121 worry about this obsolete case any more.
123 * getcwd.c: Likewise.
125 * savedir.c: Likewise.
127 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
129 * .cppi-disable: Add wcwidth.
130 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
131 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
132 (ISGRAPH): Remove. All uses changed to isgraph.
133 (FOLD) [!defined _LIBC]: Remove special case.
134 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
135 * regext_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
137 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
139 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
141 * strtod.c (strtod): cast the argument of tolower to unsigned char.
143 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
145 * memcasecmp.c: Include <limits.h>.
146 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
147 * strtod.c (strtod): Don't assume isspace works on negative chars.
148 Don't assume isdigit succeeds only on '0' through '9'.
150 2006-07-05 Derek R. Price <derek@ximbiot.com>
152 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
153 All uses of is_space replaced by isspace.
154 * exit.h: Don't talk about STDC_HEADERS.
155 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
156 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
157 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
158 replaced by isprint etc.
159 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
160 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
161 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
162 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
163 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
164 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
166 2006-07-05 Eric Blake <ebb9@byu.net>
168 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
169 missing from netdb.h.
170 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
172 2006-06-27 Bruno Haible <bruno@clisp.org>
174 Assume ANSI C header files and <ctype.h> functions.
175 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
176 (mbsnwidth): Use isprint, iscntrl instead.
178 2006-07-03 Jim Meyering <jim@meyering.net>
180 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
181 macro is used before the first cycle_check call.
183 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
185 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
186 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
187 reported by Mark D. Baushke, one in
188 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
190 Merge from coreutils.
192 * .cppi-disable: Add stdint_.h.
193 * .cvsignore: Add stdint.h.
195 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
197 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
198 both double and long double versions.
199 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
200 * xstrtold.c: New file.
201 * xstrtod.h (xstrtold): New decl.
203 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
205 * filemode.c (setst): Remove.
206 (strmode): Rewrite to avoid setst. This makes the code shorter,
207 (arguably) clearer, and the generated code is a bit smaller on my
208 Debian GNU/Linux stable x86 host.
210 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
212 * filemode.c: Include "filemode.h" first, to test the interface.
213 Assume that filemode.h includes sys/types.h and sys/stat.h.
214 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
215 (ftypelet): Reorder to put common cases first, for efficiency.
216 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
218 (strmode): Renamed from mode_string, and now stores 12 bytes instead
219 of 10, for compatibility with FreeBSD. All callers changed.
220 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
221 that can't be deduced solely from st_mode. First arg is now a const
223 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
224 (strmode): Renamed from mode_string.
225 (filemodestring): New decl.
226 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
227 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
228 (S_ISPORT, S_ISWHT): New macros, if not already defined.
230 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
232 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
233 fsusage.h now does that. Include fsusage.h first, to test interface.
234 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
235 at most one method (the old code could have generated decls that
236 didn't conform to C89, not that this was ever exercised).
237 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
239 2006-03-19 Jim Meyering <jim@meyering.net>
241 Work even in a chroot where d_ino values for entries in "/"
242 don't match the stat.st_ino values for the same names.
243 * getcwd.c (__getcwd): When no d_ino value matches the target inode
244 number, iterate through all entries again, using lstat instead.
245 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
246 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
248 * getcwd.c (__getcwd): Clarify a comment.
249 Use memcpy in place of a call to strcpy.
251 2006-03-12 Jim Meyering <jim@meyering.net>
253 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
254 that of the current directory (which we're about to chdir ".." out of),
255 then save the dev-ino of the parent, instead.
257 * same-inode.h (SAME_INODE): New file/macro.
258 * chdir-safer.c (SAME_INODE): Remove definition.
259 Include "same-inode.h", instead.
261 * cycle-check.h: Include "same-inode.h".
262 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
263 * cycle-check.c (SAME_INODE): Remove definition.
264 * root-dev-ino.h: Include "same-inode.h".
266 2006-03-11 Eric Blake <ebb9@byu.net>
268 * same.c (same_name): s/base_name/last_component/
269 * backupfile.c (check_extension, numbered_backup): Likewise.
270 * filenamecat.c (file_name_concat): Likewise.
272 2006-03-11 Eric Blake <ebb9@byu.net>,
273 Paul Eggert <eggert@cs.ucla.edu>
275 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
276 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
278 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
279 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
280 (last_component): New method.
281 * dirname.c (dir_len): Determine when drive letters need a
282 subsequent slash. Preserve // when it is special.
283 (dir_name): Don't append dot when drive letter is absolute.
284 [TEST_DIRNAME]: Move into a full-blown gnulib test.
285 * basename.c (base_name): New semantics - malloc the result.
286 Preserve // when it is special. Preserve relative files that look
288 (base_len): Preserve // when it is special.
289 (last_component): New method, similar to old base_name semantics.
290 * stripslash.c (strip_trailing_slashes): Use last_component, not
291 base_name. Strip redundant slashes from ///.
293 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
295 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
296 both are 64 bits, since this seems to be the tradition, and this
297 prevents gcc -Wformat from warning about usages with PRIuMAX. If
298 we ever run into a host that prefers long long to long in this
299 case, we'll need another configure-time test. Problem reported by
302 2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
304 * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
305 possible collision with system files.
306 (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
307 __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
308 WCHAR_MIN and WCHAR_MAX in this case.
309 (<stddef.h>): Do not include; no longer needed.
310 (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
311 (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
312 (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
313 !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
314 && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
315 (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
316 __c99]: Define, to work around IRIX <stdint.h> incompatibility.
317 (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
318 !defined(__c99))]: Include in this case too, since it's harmless
320 (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
322 (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
323 @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
324 (_STDINT_MIN, _STDINT_MAX): New macros.
325 (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
326 (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
327 (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
328 (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
329 (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
330 (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
331 macros, not typedefs; this simplifies things quite a bit.
332 Use long int for all types narrower than int64_t.
333 (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
334 Define in terms of long long int or int64_t or long int,
335 not int64_t or int32_t. This saves some compile-time testing.
336 (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
337 (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
338 (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
339 (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
340 (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
341 (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
342 (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
343 (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
344 (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
345 (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
346 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
347 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
348 undef any previous version and define our own version, for
349 simplicity and consistency with the new macros for types.
350 (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
351 (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
352 Simplify definitions by using _STDINT_MIN and _STDINT_MAX
353 where appropriate. Rely on new symbols @PTRDIFF_T_SUFFIX@,
354 @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
355 @WINT_T_SUFFIX@ to keep things simple here.
356 (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
357 Simplify by assuming typical 8/16/32/64 host, since we're
358 already doing that elsewhere anyway.
359 Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
360 and assume long long int is 64 bits if available. This
361 speeds up 'configure'.
363 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
365 * getaddrinfo.c: fixed typo
367 2006-06-29 Eric Blake <ebb9@byu.net>
369 * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
370 unused static function.
372 2006-06-29 Eric Blake <ebb9@byu.net>
376 2006-06-29 Derek R. Price <derek@ximbiot.com>
378 * strftime.c: Assume strftime() exists.
380 2006-06-28 Bruno Haible <bruno@clisp.org>
382 * getaddrinfo.h: Fix POSIX URL.
383 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
384 (use_win32_p): Make static.
385 (getaddrinfo): Reject service name if it is empty or does not consist
386 solely of decimal digits, or if its value is > 65535.
387 (getnameinfo): Remove useless casts.
389 2006-06-28 Derek R. Price <derek@ximbiot.com>
391 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
392 Autoconf 2.60 says this stuff was obsolete.
394 2006-05-12 Bruno Haible <bruno@clisp.org>
396 * mkdtemp.c [MINGW]: Include <io.h>.
397 (mkdir): Define using _mkdir.
399 2006-06-28 Bruno Haible <bruno@clisp.org>
401 * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
402 declaration for wcwidth.
403 * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
405 2006-06-28 Eric Blake <ebb9@byu.net>
407 * xvasprintf.h: Fix comments.
409 2006-06-28 Eric Blake <ebb9@byu.net>
411 * mbchar.h (wcwidth): Include wcwidth.h.
412 * mbswidth.c (wcwidth): Move from here...
413 * wcwidth.h: ...to this new file.
415 2006-06-28 Simon Josefsson <jas@extundo.com>
417 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
418 functions there. It will succeed on Windows XP, but on Windows
419 2000 and (presumably) earlier, it will fail, and use the internal
421 (use_win32_p): New function.
422 (getaddrinfo): Use strtoul on servname, to support numeric ports.
423 Support AI_NUMERICSERV to disable getservbyname.
424 (getnameinfo): New function, only supports
425 NI_NUMERICHOST|NI_NUMERICSERV for now.
427 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
428 only have some of them. Add AI_NUMERICSERV. Add prototype for
431 2006-06-27 Bruno Haible <bruno@clisp.org>
433 * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
435 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
437 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
438 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
439 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
441 2006-06-26 Bruno Haible <bruno@clisp.org>
443 * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
445 Reported by Mark D. Baushke and Larry Jones.
447 2006-06-26 Bruno Haible <bruno@clisp.org>
449 * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
451 Suggested by Mark D. Baushke and Larry Jones.
453 2006-06-23 Mark D. Baushke <mdb@gnu.org>
455 * stdint_.h: Treat BSD/OS like OpenBSD.
457 2006-06-23 Bruno Haible <bruno@clisp.org>
459 * stdint_.h: Treat IRIX like OpenBSD.
461 2006-06-23 Bruno Haible <bruno@clisp.org>
463 * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
464 ISO C 99 Technical Corrigendum 1.
466 2006-06-22 Paul Eggert <eggert@cs.ucla.edu>
468 * glob.c (collated_compare): Remove 'const' uses that weren't needed.
469 Some compiler complained about some of them. Problem reported by
471 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
473 2006-06-21 Simon Josefsson <jas@extundo.com>
475 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
478 * socket_.h: Don't define WINVER.
480 * inet_pton.h, inet_pton.c: New file, taken from glibc but
481 slightly modified to work in gnulib.
483 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
485 * read-file.c (fread_file): Start with buffer allocation of
486 0 bytes rather than 1 byte; this simplifies the code.
487 Don't invoke feof; it's not needed. Refactor to avoid duplicate
488 code to free buffer and save/restore errno.
489 (internal_read_file): Remove unused local.
491 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
493 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
494 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
495 Problem reported by Denis Excoffier in
496 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
498 2006-06-19 Simon Josefsson <jas@extundo.com>
500 * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
502 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
504 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
506 2006-06-17 Bruno Haible <bruno@clisp.org>
508 * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
510 2006-06-17 Bruno Haible <bruno@clisp.org>
512 * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
513 problem on Solaris 2.5.1.
515 2006-06-16 Eric Blake <ebb9@byu.net>
517 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
518 * unicodeio.c [!defined errno]: Likewise.
519 * strtol.c [!defined errno]: Likewise.
520 * strtod.c [!defined errno]: Likewise.
522 2006-06-15 Bruno Haible <bruno@clisp.org>
524 * stdint_.h: Rewritten to be fully auto-configured.
525 Fixes bug on HP-UX/IA64.
527 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
529 * getdate.y (__attribute__): Don't define if already defined.
530 Problem reported by Larry Jones.
531 * utimens.c (__attribute__): Likewise.
533 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
535 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
536 reported by Andreas Schwab.
538 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
539 Bruno Haible <bruno@clisp.org>
541 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
543 2006-05-26 Martin Lambers <marlam@marlam.de>
545 * getpass.c: Updates the test for the native W32 API, and adds
546 missing includes, thus fixing compilation warnings.
548 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
550 * tempname.c (small_open, large_open): New macros.
551 (__open, __open64) [!_LIBC]: Remove.
552 (__gen_tempname): Use small_open and large_open instead of __open
553 and __open64. This fixes a portability bug on HP-UX 11.11i
554 reported by Simon Wing-Tang in
555 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
557 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
559 * exclude.c (exclude_fnmatch): New function.
560 (excluded_file_name): Call exclude_fnmatch.
561 * exclude.h (excluded_file_name): New prototype
563 2006-05-24 Bruno Haible <bruno@clisp.org>
565 * printf-args.c (printf_fetchargs): Turn NULL pointers for
566 TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
567 Reported by Thorsten Maerz <torte@netztorte.de> via
568 Aaron Stone <aaron@serendipity.cx>.
570 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
572 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
573 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
574 (my_usleep): Don't mishandle maximum value.
576 2006-05-19 Jim Meyering <jim@meyering.net>
578 * getugroups.c: Correct an outdated comment. From Bruno Haible.
580 2006-05-17 Bruno Haible <bruno@clisp.org>
583 * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
585 2006-05-17 Bruno Haible <bruno@clisp.org>
587 * stdint_.h: Fix recognition of Cygwin.
589 2006-05-11 Jim Meyering <jim@meyering.net>
591 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
593 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
595 * crc.c (crc32_update): Remove unnecessary L suffix.
596 * md4.c (rol): Cast right-shift arg to uint32_t to prevent
597 unwanted sign propagation, e.g., on hosts with 64-bit int.
598 There still are some problems with reeelly weird theoretical hosts
599 (e.g., 33-bit int) but it's not worth worrying about now.
600 * sha1.c (rol): Likewise.
601 (K1, K2, K3, K4): Remove unnecessary L suffix.
603 2006-05-10 Bruno Haible <bruno@clisp.org>
605 * des.c: Cast to avoid warnings.
607 2006-05-10 Simon Josefsson <jas@extundo.com>
609 * md4.c: Typo fix, update copyright years.
610 (K1, K2): Don't use L because it turn computations into 64-bit on
613 2006-05-09 Bruno Haible <bruno@clisp.org>
615 * xvasprintf.c: Include limits.h, string.h, xsize.h.
616 (EOVERFLOW): Define fallback value.
617 (xstrcat): New function.
618 (xvasprintf): Recognize the special case of a string concatenation.
620 2006-05-01 Bruno Haible <bruno@clisp.org>
622 * stdint_.h: Shorter URL.
623 * inttypes.h: Likewise.
625 2006-05-02 Paul Eggert <eggert@cs.ucla.edu>
627 * verify.h: Document the internals better. Most of this change
628 was written by Bruno Haible.
630 2006-04-29 Bruno Haible <bruno@clisp.org>
632 * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
633 Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
635 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
637 * getdate.y (get_date): When adding relative date, start with the
638 initial time, not with the result of the first mktime call.
640 2006-04-23 Bruno Haible <bruno@clisp.org>
642 * copy-file.c: Include <unistd.h> unconditionally.
643 * execute.c: Likewise.
644 * fatal-signal.c: Likewise.
645 * findprog.c: Likewise.
646 * mkdtemp.c: Likewise.
649 * wait-process.h: Likewise.
651 2006-04-23 Bruno Haible <bruno@clisp.org>
653 * fwriteerror.c (fwriteerror): Call fclose also when an error
654 condition was already detected.
655 Reported by Ben Pfaff <blp@cs.stanford.edu>.
657 2006-04-19 Derek Price <derek@ximbiot.com>
658 Eric Blake <ebb9@byu.net>
660 * inttypes.h: Correct grammar in comment.
662 2006-04-18 Derek Price <derek@ximbiot.com>
663 Paul Eggert <eggert@cs.ucla.edu>
665 * inttypes.h: New file.
666 * strtoimax.c: Assume <inttypes.h>.
668 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
670 * utimens.c (futimens): glibc futimesat messes up if /proc
671 isn't mounted. Problem reported by Kir Kolyshkin.
673 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
675 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
676 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
677 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
679 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
681 Merge regex changes from libc, removing some of our
682 POSIX-conformance changes that were rejected and redoing them in a
685 * regcomp.c (re_compile_internal, init_dfa):
686 Length arg is now size_t, not Idx. All uses changed.
687 (peek_token): Forward decl now says internal_function.
688 (__re_error_msgid, __re_error_msgid_idx):
689 Now static rather than extern with attribute_hidden.
690 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
691 For some reason libc prefers K&R style defns for external functions.
692 (regerror) [!defined _LIBC]: Likewise.
693 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
694 (seek_collating_symbol_entry, lookup_collation_sequence_value):
695 (build_range_exp, build_collating_symbol):
697 (re_compile_fastmap): Use '\0' to memset, not 0.
698 (utf8_sb_map): Make the calculations more obvious.
699 (init_dfa, parse_bracket_exp, build_charclass_op):
700 Call calloc and cast result, as glibc does.
701 (init_word_char, fetch_token, peek_token, peek_token_bracket):
702 (build_range_exp, build_collating_symbol):
703 Now internal functions.
705 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
707 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
708 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
709 Don't depend on VMS; depend on __VMS instead, for POSIX
711 (regoff_t): Define to ssize_t, not long int.
713 Remove the REG_ macros named below. Instead, make the old names
714 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
716 (REG_BACKSLASH_ESCAPE_IN_LISTS):
717 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
718 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
719 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
720 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
721 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
722 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
723 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
724 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
725 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
726 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
727 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
728 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
729 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
730 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
731 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
732 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
734 Remove. All uses replaced by the old RE_* names.
735 (RE_BACKSLASH_ESCAPE_IN_LISTS):
736 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
737 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
738 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
739 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
740 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
741 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
742 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
743 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
744 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
745 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
746 Don't bother having these macros be independent of each others'
747 values, since they no longer exist in the POSIX name space.
749 Rename the following member names back to their old names,
750 unless !__USE_GNU_REGEX. All uses changed back.
751 (buffer): Renamed from re_buffer.
752 (allocated): Renamed from re_allocated.
753 (used): Renamed from re_used.
754 (syntax): Renamed from re_syntax.
755 (fastmap): Renamed from re_fastmap.
756 (translate): Renamed from re_translate.
757 (can_be_null): Renamed from re_can_be_null.
758 (regs_allocated): Renamed from re_regs_allocated.
759 (fastmap_accurate): Renamed from re_fastmap_accurate.
760 (no_sub): Renamed from re_no_sub.
761 (not_bol): Renamed from re_not_bol.
762 (not_eol): Renamed from re_not_eol.
763 (newline_anchor): Renamed from re_newline_anchor.
764 (num_regs): Renamed from rm_num_regs.
765 (start): Renamed from rm_start.
766 (end): Renamed from rm_end.
768 (free_state): Move up a bit.
770 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
772 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
773 when that is what is intended.
774 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
775 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
777 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
778 All uses changed back to re_malloc, etc. It's now the caller's
779 responsibility to check for overflow; all callers changed.
780 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
781 (re_x2nrealloc): Remove.
782 (free_state): Remove decl.
784 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
785 (re_set_registers, re_exec):
788 2006-01-31 Roland McGrath <roland@redhat.com>
790 * regcomp.c (calc_eclosure_iter): Remove dead variables.
791 Reported by Mike Frysinger <vapier@gentoo.org>.
793 2006-01-15 Andreas Jaeger <aj@suse.de>
796 * regex_internal.c (re_string_reconstruct): Adjust for
797 build_wcs_upper_buffer change.
798 (build_wcs_upper_buffer): Change return type.
800 2005-12-10 Ulrich Drepper <drepper@redhat.com>
802 * regex_internal.h: Include <stdint.h> if available.
804 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
806 * regex_internal.h (SIZE_MAX): Provide a default definition.
808 2005-10-14 Ulrich Drepper <drepper@redhat.com>
810 * regcomp.c: Adjust for changed secondary hash function.
812 2005-09-30 Ulrich Drepper <drepper@redhat.com>
814 * regex.h: Pretty printing.
815 Clean up namespace a bit.
817 2005-09-30 Jakub Jelinek <jakub@redhat.com>
819 * regexec.c (update_cur_sifted_state, check_arrival,
820 check_arrival_add_next_nodes): Avoid using uninitialized variable.
822 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
823 Ulrich Drepper <drepper@redhat.com>
826 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
827 (bitset_word_t): Renamed from bitset_word. All uses changed.
829 2005-09-22 Ulrich Drepper <drepper@redhat.com>
832 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
833 * regcomp.c: Remove unnecessary uses of
834 unsigned RE_TRANSLATE_TYPE.
835 * regex_internal.h: Likewise.
836 * regex_internal.c: Likewise.
837 * regexec.c: Likewise.
838 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
840 2005-09-07 Ulrich Drepper <drepper@redhat.com>
842 * regexec.c (find_recover_state): Remove unnecessary
844 (transit_state_bkref): Make DFA a const pointer.
845 (get_subexp): Likewise.
846 (check_arrival): Likewise.
847 (update_cur_sifted_state): Likewise.
848 (re_search_internal): Likewise.
849 (prune_impossible_nodes): Likewise.
850 (acquire_init_state_context): Likewise.
851 (proceed_next_node): Likewise.
852 (set_regs): Likewise.
853 (free_fail_stack_return): Likewise.
854 (check_arrival_expand_ecl): Mark DFA parameter as const.
855 (check_arrival_expand_ecl_sub): Likewise.
856 (check_subexp_limits): Likewise.
857 (sub_epsilon_src_nodes): Likewise.
858 (add_epsilon_src_nodes): Likewise.
859 (merge_state_array): Likewise.
860 (update_regs): Likewise.
861 (build_trtable): Likewise.
862 (sift_states_backward): Mark MCTX parameter as const.
863 (build_sifted_states): Likewise.
864 (update_cur_sifted_state): Likewise.
865 (sift_states_mkref): Likewise.
866 (check_arrival_expand_ecl): Mark eclosure as const.
867 (check_dst_limits_calc_pos_1): Likewise.
868 * regex_internal.h (re_match_context_t): Make dfa a const
871 2005-09-06 Ulrich Drepper <drepper@redhat.com>
873 * regexec.c (merge_state_with_log): Define dfa as const pointer.
874 (transit_state_sb): Likewise.
875 (transit_state_mb): Likewise.
876 (sift_states_iter_mb): Likewise.
877 (check_arrival_add_next_nodes): Likewise.
878 (check_node_accept_bytes): Change first parameter to pointer-to-const.
879 [_LIBC] (re_search_2_stub): Use mempcpy.
881 * regex_internal.c (re_string_reconstruct): Avoid calling
882 mbrtowc for very simple UTF-8 case.
884 * regex_internal.c (re_acquire_state): Make DFA pointer arg
886 (re_acquire_state_context): Likewise.
887 * regex_internal.h: Adjust prototypes.
889 * regex.c: Prevent using C++ compilers.
891 * regex_internal.c (re_acquire_state): Minor code rearrangement.
892 (re_acquire_state_context): Likewise.
894 2006-03-29 Mark D. Baushke <mdb@gnu.org>
895 Bruno Haible <bruno@clisp.org>
897 * stdint_.h: On OpenBSD, don't redefine types already included in
898 <sys/types.h> and <inttypes.h>.
900 2006-03-24 Eric Blake <ebb9@byu.net>
902 * time_r.c (copy_string_result): Remove, as it is no longer used.
904 2006-03-24 Simon Josefsson <jas@extundo.com>
906 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
907 including some doc fixes.
908 (base64_encode_alloc): Fix +1 bug on allocation failures.
910 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
912 * base64.c (base64_encode): Do not read past end of array with
913 unsanitized input on systems with CHAR_BIT > 8.
915 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
917 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
918 Typedef to long int, not to off_, as POSIX will likely change
921 2006-03-13 Sergey Poznyakoff <gray@gnu.org.ua>
923 * argp-help.c (validate_uparams): Fix typo
924 * argp-parse.c (argp_default_options): Consistently begin help
925 messages with a lowercase letter.
927 2006-03-11 Paul Eggert <eggert@cs.ucla.edu>
929 * time_r.h (asctime_r, ctime_r): Remove. These functions can
930 overrun buffers and shouldn't be used (much as gets shouldn't be
932 * time_r.c (asctime_r, ctime_r): Likewise.
934 2006-03-08 Simon Josefsson <jas@extundo.com>
936 * gc-gnulib.c (randomize): Don't open files called 'no', they
937 signal that configure disabled the device.
939 2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
941 * c-stack.c: Include unistd.h unconditionally, since we now assume
943 * getlogin_r.c: Likewise.
944 * getlogin_r.h: Likewise.
946 * pagealign_alloc.c: Likewise.
947 * unistd_.h: Remove; no longer needed.
949 2006-03-07 Simon Josefsson <jas@extundo.com>
951 * unistd_.h: New file.
953 2006-03-07 Simon Josefsson <jas@extundo.com>
955 * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
957 2006-03-01 Simon Josefsson <jas@extundo.com>
959 * readline.c: Fix typo, tiny patch from Stepan Kasal
962 2006-02-28 Simon Josefsson <jas@extundo.com>
964 * getopt.c: Protect #include of unistd.h, for MSVS.
966 2006-02-27 Simon Josefsson <jas@extundo.com>
968 * base64.h: Indent #define's. From Jim Meyering
971 2006-02-27 Jim Meyering <jim@meyering.net>
973 Revert the change of 2006-02-24, so these files can continue
974 to be sync'd from gettext.
975 * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
978 2006-02-24 Paul Eggert <eggert@cs.ucla.edu>
980 * glob.c: Say "invalid" rather than "illegal" in comments.
982 2006-02-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
984 * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
986 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
988 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
989 AT_FDCWD exceeds INT_MAX.
990 * openat.h (AT_FDCWD): Likewise.
992 2006-02-14 Jim Meyering <jim@meyering.net>
996 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
997 failure on deficient systems, and simplify gnulib lgpl dependencies.
998 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
999 xmalloc/lstat combination. Based on a patch from Bruno Haible.
1001 * xalloc-die.c: Remove unused definition of N_.
1003 2006-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
1005 * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1007 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
1009 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1010 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1012 2006-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
1014 * argp-namefrob.h: Restore changes accidentally lost during the
1015 "autoupdate" on 2005-12-12.
1017 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
1019 * fnmatch.c (L_): Renamed from L, to work around a bug in
1020 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1021 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1024 2006-01-26 Simon Josefsson <jas@extundo.com>
1026 * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1027 prototype is visible on mingw32.
1029 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1032 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1035 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
1037 * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
1038 attempt to open for write; this always fails, at least on POSIX
1039 hosts. This reinstates the 2006-01-09 change, which was
1040 inadvertently removed.
1042 2006-01-26 Bruno Haible <bruno@clisp.org>
1043 Paul Eggert <eggert@cs.ucla.edu>
1045 * stdbool_.h (_Bool)
1046 [(! (defined __cplusplus || defined __BEOS__)
1047 && !defined __GNUC__
1048 && !(defined __HP_cc || defined __xlc__
1049 || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1050 || defined __sgi))]:
1051 #define to signed char in these cases too; this simplifies
1052 the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1053 etc., separately) and makes it more conservative.
1055 2006-01-21 Jim Meyering <jim@meyering.net>
1057 Sync from the stable (b5) branch of coreutils:
1059 * fts.c (fts_children): Don't let close() clobber errno from
1062 * fts.c (fts_stat): When following a symlink-to-directory,
1063 don't necessarily interpret stat-fails+lstat-succeeds as indicating
1064 a dangling symlink. That can also happen at least for ELOOP.
1065 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1066 FYI, this bug predates the inclusion of fts.c in coreutils.
1068 * fts.c (fts_open): Put new maxarglen declaration and uses
1069 in their own block, so pre-c99 compilers don't object.
1071 Avoid the double-free (first in fts_read, second in fts_close) that
1072 would occur when an `active' directory is made inaccessible (e.g.,
1073 via chmod a-x) during a traversal.
1074 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1075 before returning. Reproduce this failure by
1076 mkdir -p a/b; cd a; chmod a-x . b
1077 Reported by Stavros Passas.
1079 2006-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
1081 * argp-namefrob.h: Bugfix. Remove stray #
1083 2006-01-25 Bruno Haible <bruno@clisp.org>
1085 * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1087 Reported by Paul Eggert.
1089 2006-01-25 Jim Meyering <jim@meyering.net>
1091 * fileblocks.c: Remove more useless parentheses.
1092 * readutmp.h: Likewise.
1094 2006-01-24 Bruno Haible <bruno@clisp.org>
1096 * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1098 Report and patch by Albert Chin-A-Young <china@thewrittenword.com> on
1101 * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1102 to avoid problems with the built-in _Bool type.
1103 Reported by Paul Eggert on 2005-11-26.
1105 2006-01-24 Jim Meyering <jim@meyering.net>
1107 * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1109 2006-01-24 Simon Josefsson <jas@extundo.com>
1111 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1114 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
1116 Work around porting bugs reported by Dieter in
1117 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1118 * getopt.c (_NOPROTO): Remove; no longer needed.
1119 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1120 Include "getopt.h" first, to check interface.
1121 (getenv): Declare only if defined HAVE_DECL_GETENV &&
1123 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1124 (__strndup): Revert to K&R-style function dfns, the glibc style.
1125 * strnlen.c: Don't claim it's taken from glibc; it's not.
1126 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1127 Include strnlen.h first, to get prototype properly.
1128 (strnlen): Renamed from __strnlen.
1131 2006-01-23 Ulrich Drepper <drepper@redhat.com>
1133 These changes imported from libc.
1134 * getopt.c: Use __fxprintf instead of inline stream orientation
1135 test and two separate function calls.
1136 * strndup.c (__strndup): Add libc_hidden_def.
1138 2006-01-22 Bruno Haible <bruno@clisp.org>
1140 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1141 temporary buffer for sprintf, take into account the precision also
1142 for 'd', 'i', 'u', 'o', 'x', 'X'.
1144 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
1146 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1147 to pacify gcc -Wswitch-default.
1149 2006-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
1151 * argp-help.c (usage_long_opt): Do not print DOC options.
1152 (__argp_base_name): Removed
1153 * argp-namefrob.h (__argp_basename): Removed definition. Was a
1155 (__argp_base_name): Provide macro definition or extern declaration
1156 depending on the configuration
1158 2006-01-20 Simon Josefsson <jas@extundo.com>
1160 * inet_ntop.h: Unconditionally include sys/socket.h.
1162 2006-01-19 Simon Josefsson <jas@extundo.com>
1164 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1166 2006-01-12 Simon Josefsson <jas@extundo.com>
1168 * base64.c: Fix warning, reported by Bruno Haible
1169 <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1171 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
1173 Sync from coreutils.
1174 * md5.c: Fix commentary typos.
1175 (alignof, UNALIGNED_P): No need for a GCC-specific version.
1176 * md5.h (__attribute__): Remove; unused.
1177 * sha1.c: Fix commentary to match md5 better.
1178 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1179 so that we don't need to worry about alignment. All uses changed.
1180 This merges the 2005-10-28 md5 change into sha1.
1182 2006-01-11 Jim Meyering <jim@meyering.net>
1184 Sync from coreutils.
1185 * md5.c (OP): Fix spacing.
1187 2006-01-11 Simon Josefsson <jas@extundo.com>
1189 * stdint_.h (SIZE_MAX): Add missing (.
1191 2006-01-10 Bruno Haible <bruno@clisp.org>
1193 * argp.h (__const): Remove macro. Use const instead.
1194 * argp-fmtstream.h (__const): Likewise.
1195 * glob_.h (__const): Remove macro.
1196 * glob-libc.h: Use const instead of __const.
1198 2006-01-10 Jim Meyering <jim@meyering.net>
1200 Avoid the double-free (first in fts_read, second in fts_close) that
1201 would occur when an `active' directory is made inaccessible (e.g.,
1202 via chmod a-x) during a traversal.
1203 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1204 before returning. Reproduce this failure by
1205 mkdir -p a/b; cd a; chmod a-x . b
1206 Reported by Stavros Passas.
1208 Sync from coreutils.
1209 * sha1.c: Tweak grammar in a comment.
1211 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
1213 * regex_internal.h (BITSET_WORD_BITS):
1214 Work around a bug in 64-bit PGC (before version 6.1-2), where the
1215 preprocessor mishandles large unsigned values as if they were signed.
1216 Problem reported by Claudio Fontana in
1217 <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1219 2006-01-10 Simon Josefsson <jas@extundo.com>
1221 * socket_.h: New file.
1223 2006-01-10 Bruno Haible <bruno@clisp.org>
1225 * localcharset.c: Update from GNU gettext.
1227 2006-01-09 Paul Eggert <eggert@cs.ucla.edu>
1229 Sync from coreutils.
1230 * chdir-long.c (cdb_free): Don't bother trying to open directory
1231 for write access: POSIX says that must fail.
1232 * fts.c (diropen): Likewise.
1233 * save-cwd.c (save_cwd): Likewise.
1234 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1235 well, for minor improvements on hosts that lack O_DIRECTORY.
1236 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1237 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1238 Fall back on chown if open failed with EACCES.
1240 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1241 Report an error at compile-time if only a 1-second nominal clock
1242 resolution is found.
1244 * lchmod.h: New file.
1245 * mkdir-p.c: Include lchmod.h, lchown.h.
1246 (make_dir_parents): Use lchown rather than chown, and
1247 lchmod rather than chmod.
1249 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1250 too. Problem with "none" reported by Bob Proulx. Problem with
1251 "proc" reported by n0dalus.
1253 * mountlist.c: Include <limits.h>.
1254 (dev_from_mount_options)
1255 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1256 New function. It no longer assumes "dev=" has the System V meaning
1257 on Linux (since it doesn't). It also parses "dev=" more carefully.
1258 (read_file_system_list)
1259 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1260 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1263 * posixtm.h (PDS_PRE_2000): New macro.
1264 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1265 All usages changed. Reject dates outside the range 1969-1999 if
1266 PDS_PRE_2000 is used.
1268 2006-01-09 Jim Meyering <jim@meyering.net>
1270 Sync from coreutils.
1272 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1274 * chdir-safer.h, chdir-safer.c: New files.
1276 * modechange.c (mode_compile): Reject an invalid mode string
1277 that starts with an octal digit. From Andreas Gruenbacher.
1279 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1280 and dup to open_safer and dup_safer, respectively.
1281 (openat_permissive): Fix typo in comment.
1283 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1284 "gettext.h"; either no longer needed or are guaranteed by openat.h.
1285 (_): Remove; no longer needed.
1286 (openat): Renamed from rpl_openat; no need for rpl_openat
1287 since openat.h renames openat for us.
1288 Replace most of the body with a call to openat_permissive,
1289 to avoid duplicate code.
1290 Port to (probably hypothetical) environments were mode_t is
1292 (openat_permissive): Require mode arg, so that we can check
1293 types better. Put it just after flags. Change cwd failure
1294 indicator from pointer-to-bool to pointer-to-errno-value.
1295 All callers changed.
1296 Invoke openat_save_fail and/or openat_restore_fail if
1297 cwd_errno is null, so that openat can call us.
1298 (openat_permissive, fdopendir, fstatat, unlinkat):
1299 Simplify errno handling to avoid some duplicate code,
1300 as it's OK to set errno on success.
1301 * openat.h: Revamp code so that function macros depend on
1302 __OPENAT_PREFIX only, not also on AT_FDCWD.
1303 (openat_ro): Remove. Caller changed to use openat_permissive.
1304 (openat_permissive): Now a macro, if not a function.
1305 (openat_restore_fail, openat_save_fail): Now always functions,
1306 since mkdirat needs them even if __OPENAT_PREFIX is defined.
1308 * openat-priv.h: New file, defining macros used by mkdirat.c
1310 * mkdirat.c: Include openat-priv.h.
1311 Remove definitions of macros defined therein.
1312 * openat.c: Likewise.
1314 * mkdirat.c (mkdirat): New file and function.
1315 * openat.h (mkdirat): Declare.
1317 * openat.c (fdopendir): Don't change errno when returning non-NULL.
1319 * openat.h (openat_permissive): Declare.
1320 (openat_ro): Define.
1322 * openat.c (EXPECTED_ERRNO): New macro.
1323 (openat_permissive): New function -- used in remove.c rewrite.
1324 (all functions): Set errno just before returning, only if there
1325 was an actual failure.
1326 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1328 Emulate openat-family functions using Linux's procfs, if possible.
1329 Idea and some code based on Ulrich Drepper's glibc changes.
1331 * openat.c: (BUILD_PROC_NAME): New macro.
1332 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1333 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1334 before falling back on save_cwd and restore_cwd.
1335 (fdopendir, fstatat, unlinkat): Likewise.
1337 * openat.c (fstatat, unlinkat): Perform the syscall directly,
1338 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1340 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1341 as second argument to va_arg. Otherwise, some versions of gcc
1342 warn that `if this code is reached, the program will abort'.
1344 2006-01-09 Andreas Gruenbacher <agruen@suse.de>
1346 Sync from coreutils.
1348 Add POSIX ACL support
1349 * acl.h (copy_acl, set_acl): Add declarations.
1350 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1351 systems other than Linux.
1352 (chmod_or_fchmod): New function: use fchmod when possible,
1353 and chmod otherwise.
1354 (file_has_acl): Add a POSIX ACL implementation, with a
1355 Linux-specific subcase.
1356 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1357 S_ISVTX from one file to another. Fall back to fchmod/chmod when
1358 acls are unsupported.
1359 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1360 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
1363 2006-01-09 Bruno Haible <bruno@clisp.org>
1365 * sysexit_.h (EX_OK): New macro.
1366 Suggested by Martin Lambers <marlam@marlam.de>.
1368 2006-01-09 Bruno Haible <bruno@clisp.org>
1370 * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1371 * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1372 * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1373 * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1375 2006-01-09 Bruno Haible <bruno@clisp.org>
1377 * stdint_.h (SIZE_MAX): Write the value without involving negative
1380 2005-10-16 Bruno Haible <bruno@clisp.org>
1382 * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1383 don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1385 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
1387 * strftime.c (tzname): Don't declare if it is already #defined.
1388 Problem reported for Mingw by Mark Junker.
1390 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
1392 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1393 long int, not int, for nanosecond counts, so that people who are
1394 used to POSIX struct timespec won't be surprised. Reported by Jim
1397 2005-12-16 Jim Meyering <jim@meyering.net>
1399 * fprintftime.c, fprintftime.h: New files.
1401 2005-12-10 Sergey Poznyakoff <gray@gnu.org.ua>
1403 * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1404 * argp-help.c (fill_in_uparams): Check if the constructed
1405 struct uparams is valid. Fall back to the default values if it is
1408 2005-12-09 Sergey Poznyakoff <gray@gnu.org.ua>
1410 * argp-help.c (__argp_base_name): New function
1411 (__argp_short_program_name): Rewrite using __argp_base_name
1412 * argp-namefrob.h: Define program_invocation_name and
1413 program_invocation_short_name if requested
1414 (__argp_base_name): Add prototype
1415 * argp-parse.c (argp_def): Use gettext wrappers
1416 (argp_default_parser): Use __argp_base_name
1417 * argp-pin.c: New file. Defines program_invocation_name and
1418 program_invocation_short_name on systems that lack them.
1420 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
1422 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1423 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1424 porting problem reported by Georg Schwarz in
1425 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1427 2005-07-09 Bruno Haible <bruno@clisp.org>
1429 * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1430 * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1431 Reported by Mark Junker <mjscod@gmx.de>.
1433 2005-11-29 Paul Eggert <eggert@cs.ucla.edu>
1435 * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1436 (uintmax_t) [defined uintmax_t]: Do not declare.
1437 (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1438 This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1439 and/or size_max.m4 are also used. Problem reported by Mark D. Baushke.
1440 (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1441 sake of portability to weird hosts that C allows (though we don't
1442 know of any practical examples).
1444 * savedir.h (fdsavedir): New decl.
1445 * savedir.c (fdsavedir, savedirstream): New functions; the latter
1446 contains most of the former guts of savedir.
1447 (savedir): Use savedirstream.
1450 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
1452 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1453 coreutils no longer futzes with rounding modes.
1455 2005-11-14 Jim Meyering <jim@meyering.net>
1457 * mkstemp-safer.c: Include <config.h>, required for possible
1458 replacement of mkstemp.
1460 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
1462 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1464 (gethrxtime) [! (HAVE_NANOUPTIME
1465 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1466 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1467 our own approximation.
1469 2005-11-10 Simon Josefsson <jas@extundo.com>
1471 * readline.c: Remove EOL.
1473 2005-11-08 Eric Blake <ebb9@byu.net>
1475 * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1477 2005-11-08 Eric Blake <ebb9@byu.net>
1479 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1481 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
1483 Fix porting problem reported by Theodoros V. Kalamatianos.
1484 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1485 Don't assume that futimes failing means we must fail.
1487 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
1489 * getcwd.c (__getcwd): Don't assume that system calls after readdir
1490 leave errno alone. Problem reported by Dmitry V. Levin.
1492 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
1494 * savedir.c (savedir): Don't assume that xrealloc etc. leave
1495 errno alone. Problem reported by Frederic Jolliton.
1497 2005-10-28 Simon Josefsson <jas@extundo.com>
1499 * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
1500 "restrict" keywords, as per POSIX. Protect the function
1501 declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
1502 Don't use K&R prototypes. Check the sprintf return values.
1503 Re-define EAFNOSUPPORT if not present. Indent.
1505 * md5.h, md5.c: Simplify buffer handling visavi alignment,
1506 suggested by Bruno Haible <bruno@clisp.org>.
1508 * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
1510 * gc.h: Add MD2 and RMD160 length defines. Add prototypes.
1512 * gc-libgcrypt.c: Add MD2 (which is not available through
1515 * gc-gnulib.c: Add MD2. Implement gc_hash_* API.
1517 * md2.h, md2.c: New files.
1519 2005-10-24 Simon Josefsson <jas@extundo.com>
1521 * md4.h: Shrink buffer size, now that we changed the type.
1523 2005-10-22 Simon Josefsson <jas@extundo.com>
1525 * arcfour.h, arcfour.c: Use fixed size indices in the
1526 arcfour_context struct (simplify test vector testing in GNU
1529 2005-10-22 Simon Josefsson <jas@extundo.com>
1531 * md4.h, md4.c: Simplify buffer handling visavi alignment,
1532 suggested by Bruno Haible <bruno@clisp.org>.
1534 2005-10-22 Simon Josefsson <jas@extundo.com>
1536 * crc.h: Include stddef.h, for size_t.
1538 2005-10-21 Simon Josefsson <jas@extundo.com>
1540 * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
1541 suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
1543 2005-10-21 Simon Josefsson <jas@extundo.com>
1545 * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
1548 2005-10-21 Simon Josefsson <jas@extundo.com>
1550 * gc-gnulib.c: Support ARCTWO in CBC mode.
1552 2005-10-21 Simon Josefsson <jas@extundo.com>
1554 * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
1557 * hmac-sha1.c (hmac_sha1): Likewise.
1559 * crc.c (crc32_update): Actually use crc parameter, suggested by
1560 Bruno Haible <bruno@clisp.org>.
1562 * crc.h: Include stdint.h directly, suggested by Bruno Haible
1565 2005-10-21 Simon Josefsson <jas@extundo.com>
1567 * des.h, des.c: New files.
1569 * gc-gnulib.c: Support DES.c
1571 2005-10-21 Simon Josefsson <jas@extundo.com>
1573 * arctwo.h, arctwo.c: New files.
1575 * gc-gnulib.c: Support ARCTWO.
1577 2005-10-21 Simon Josefsson <jas@extundo.com>
1579 * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
1581 2005-10-19 Simon Josefsson <jas@extundo.com>
1583 * gc-gnulib.c: Support ARCFOUR.
1585 2005-10-19 Simon Josefsson <jas@extundo.com>
1587 * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
1590 * gc.h: Add ECB enum type.
1592 * hmac-md5.c, hmac-sha1.c: Include memxor.h.
1594 2005-10-19 Simon Josefsson <jas@extundo.com>
1596 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
1598 2005-10-18 Simon Josefsson <jas@extundo.com>
1600 * md4.h, md4.c: New files, based on md5.?.
1602 2005-10-17 Simon Josefsson <jas@extundo.com>
1604 * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
1606 * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
1608 2005-10-17 Simon Josefsson <jas@extundo.com>
1610 * gc.h, gc-libgcrypt.c: Add more hash types/functions.
1612 2005-10-17 Simon Josefsson <jas@extundo.com>
1614 * gc.h, gc-libgcrypt.c: Add ciphers.
1616 2005-10-17 Simon Josefsson <jas@extundo.com>
1618 * sha1.c: Use uint32_t instead of md5_uint32.t
1620 * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
1623 * md5.c: Use uin32_t. Fix non-gcc UNALIGNED_P macro.
1625 * md5.h: Use stdint.h and uint32_t. Doc fix.
1627 2005-10-15 Simon Josefsson <jas@extundo.com>
1629 * rijndael-api-fst.h, rijndael-api-fst.c: New files.
1631 * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
1633 2005-10-14 Simon Josefsson <jas@extundo.com>
1635 * arcfour.h, arcfour.c: New files.
1637 2005-10-14 Paul Eggert <eggert@cs.ucla.edu>
1639 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
1640 include <wchar.h>; no longer needed.
1642 2005-10-14 Jakub Jelinek <jakub@redhat.com>
1643 and Ulrich Drepper <drepper@redhat.com>
1646 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
1647 instead of inline stream orientation test and two separate
1648 function calls. Pay no attention to USE_IN_LIBIO.
1650 2005-10-14 Roland McGrath <roland@redhat.com>
1652 Import from libc. [BZ #1331]
1653 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
1655 Reported by Matej Vela <vela@debian.org>.
1657 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
1659 * mkdir-p.c (make_dir_parents): Don't report an error if an
1660 intermediate directory is in a read-only file system. Problem
1661 reported by Eric Blake.
1663 2005-10-13 Simon Josefsson <jas@extundo.com>
1665 * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
1666 Move memory allocation outside of loop.
1668 2005-10-12 Simon Josefsson <jas@extundo.com>
1670 * gc-pbkdf2-sha1.c: New file.
1672 * gc.h: Add gc_pbkdf2_sha1 prototype.
1674 2005-10-12 Simon Josefsson <jas@extundo.com>
1676 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
1677 suggested by Bruno Haible <bruno@clisp.org>.
1679 2005-10-12 Simon Josefsson <jas@extundo.com>
1681 * gc-libgcrypt.c (gc_hmac_sha1): New function.
1683 * gc-gnulib.c (gc_hmac_sha1): New function.
1685 2005-10-12 Simon Josefsson <jas@extundo.com>
1687 * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
1689 2005-10-12 Simon Josefsson <jas@extundo.com>
1691 * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
1692 GC_USE_HMAC_MD5, respectively.
1694 * gc-libgcrypt.c (gc_md5): Fix assert call.
1697 * gc.h (gc_hash_buffer): Use gc_hash in prototype.
1699 * gc-libgcrypt.c (gc_hash_buffer): Ditto.
1701 * gc-gnulib.c (gc_hash_buffer): Ditto.
1703 2005-10-11 Bruno Haible <bruno@clisp.org>
1705 * c-strcasestr.h: New file, from GNU gettext.
1706 * c-strcasestr.c: New file, from GNU gettext.
1708 2005-10-11 Bruno Haible <bruno@clisp.org>
1710 * c-strcase.h: New file, from GNU gettext.
1711 * c-strcasecmp.c: New file, from GNU gettext.
1712 * c-strncasecmp.c: New file, from GNU gettext.
1714 2005-10-11 Simon Josefsson <jas@extundo.com>
1716 * crc.h, crc.c: New files.
1718 * gc.h (gc_hash_buffer): Add doc.
1720 2005-10-08 Simon Josefsson <jas@extundo.com>
1722 * gc.h: Add gc_hash and gc_hash_buffer.
1724 * gc-gnulib.c (gc_hash_buffer): Add. Reorder #include's.
1726 * gc-libgcrypt.c (gc_hash_buffer): Add.
1728 2005-10-11 Bruno Haible <bruno@clisp.org>
1730 * strcasecmp.c: Include limits.h.
1731 (strcasecmp): Avoid integer overflow on exotic platforms.
1732 * strncasecmp.c: Include limits.h.
1733 (strncasecmp): Avoid integer overflow on exotic platforms.
1734 Reported by Paul Eggert.
1736 2005-10-06 Simon Josefsson <jas@extundo.com>
1738 * hmac-md5.c: New file.
1742 2005-10-06 Simon Josefsson <jas@extundo.com>
1744 * memxor.c (memxor): Avoid casts and warnings.
1746 2005-10-05 Derek Price <derek@ximbiot.com>
1748 * getdelim.c (SIZE_MAX): New macro, if not already defined.
1750 2005-10-05 Simon Josefsson <jas@extundo.com>
1752 * memxor.c (memxor): Fix compiler error.
1754 * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
1755 <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
1757 * memxor.h, memxor.c: New files.
1759 * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
1760 we assume all systems have it, suggested by Jim Meyering
1761 <jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
1762 any systems lack sys/socket.h; mingw32 is known to lack it, but we
1763 don't support it yet anyway. Also remove HAVE_NETDB_H test, for
1766 2005-10-04 Bruno Haible <bruno@clisp.org>
1768 * verify.h (verify_true): Provide alternative definition for C++.
1770 2005-10-04 Simon Josefsson <jas@extundo.com>
1772 * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
1773 D. Baushke" <mdb@gnu.org>.
1775 2005-10-03 Paul Eggert <eggert@cs.ucla.edu>
1777 * getdelim.c: Include getdelim.h first. Include <limits.h>.
1778 (SSIZE_MAX): New macro, if not already defined.
1779 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
1782 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
1784 * exclude.c: Include verify.h.
1785 (verify): Remove. All callers changed to use verify.h's version.
1786 * strtoimax.c: Likewise.
1787 * utimecmp.c: Likewis.e
1789 Sync from coreutils.
1790 * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
1791 mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
1792 * .cvsignore: Add fts.h, search.h, t-fpending.
1793 * settime.c (settime): Fix { typo in previous patch. Also, don't
1794 bother returning ENOSYS if settimeofday or stime fails; just let
1795 them return whatever errno they want to return.
1796 * utimens.c: Include unistd.h, for dup2.
1797 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
1798 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
1800 2005-10-02 Jim Meyering <jim@meyering.net>
1802 Sync from coreutils.
1803 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
1804 * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
1805 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
1806 Remove AT_FDCWD test.
1807 Do not consume the fd unless successful.
1808 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
1809 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
1810 block, so that we don't even try to compile it if settimeofday is
1811 available. This works around a compilation failure on OSF1 V5.1,
1812 due to stime requiring a `long int*' while tv_sec is `int'.
1814 2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
1816 * getdelim.c (getdelim): Remove unused variables.
1818 2005-10-01 Simon Josefsson <jas@extundo.com>
1820 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
1821 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
1822 AI_* and EAI_* definitions. Protect function declarations.
1824 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
1826 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
1827 so that the code works even with ancient cpp. Portability problem
1828 with GCC 2.7.2.1 reported by Thomas M.Ott.
1830 2005-09-27 Jim Meyering <jim@meyering.net>
1832 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
1834 * intprops.h (signed_type_or_expr__): Define.
1835 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
1838 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
1840 * verify.h (verify_expr): Remove, replacing with:
1841 (verify_true): New macro that returns true instead of void.
1842 (verify_type__): Remove.
1843 (verify): Use verify_true rather than verify_type__.
1845 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
1847 * utimens.c (ENOSYS): Define if not already defined.
1848 (futimens): Support having a null PATH if the file descriptor
1851 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
1853 (__attribute): Define to empty unless GCC 3.1 or later.
1854 This works around a core dump on OpenBSD 3.4, which has GCC
1855 2.95.3, which dumps core when given __attribute__(()). It also
1856 simplifies other tests, since we really don't want to bother with
1857 worrying about which ancient version of GCC supported what.
1858 Original problem reported by Yoann Vandoorselaere, with part of
1859 the fix suggested by Derek Price.
1861 2005-09-24 Jim Meyering <jim@meyering.net>
1863 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
1864 so we can once again use a positive bitfield width of 1 -- now we
1865 don't have to explain why we were using a bitfield width of 2.
1867 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
1869 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
1870 Problem reported by Eric Blake.
1871 (getaddrinfo): Initialize se so that it's not garbage.
1872 Redo internal storage allocation so that it doesn't make unportable
1873 assumptions about alignment.
1876 * utimens.c (futimens): Use futimesat if available.
1877 Prefer it to futimes since it doesn't have the futimes bug.
1879 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
1880 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
1881 Instead, declare a function that returns a pointer to an array,
1882 and use verify_type__ to declare the size of the array.
1883 Problem and germ of a solution reported by Bruno Haible.
1884 (verify_type__): Use 2, not 1, for bitfield size, to avoid
1885 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
1887 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
1889 Sync from coreutils.
1891 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
1893 * argmatch.h: Include verify.h
1894 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
1895 (ARGMATCH_ASSERT): Remove; unused.
1896 * canonicalize.c: Assume STDC_HEADERS.
1897 * exclude.c: Include "strcase.h".
1898 * regex_internal.h [!defined _LIBC]: Likewise.
1899 * getusershell.c: Include stdio--.h rather than stdio.h
1901 (getusershell): Call fopen, not fopen_safer.
1902 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
1903 Do not include unistd-safer.h.
1904 (save_cwd): Don't call fd_safer; no longer needed
1905 now that we include fcntl--.h.
1907 * getdate.y (relative_time): New type.
1908 (RELATIVE_TIME_0): New constant.
1909 (parser_control): Use relative_time instead of doing it ourselves.
1910 (%union): Add new relative_time rel member.
1911 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
1913 (relunit, relunit_snumber): Now of type rel.
1914 (zone, rel, relunit, get_date): Adjust to above changes.
1916 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
1917 Do not include unistd-safer.h.
1918 (getloadavg): Don't call fd_safer; no longer needed
1919 now that we include fcntl--.h.
1921 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
1922 (make_dir_parents): Treat ENOSYS like EEXIST.
1924 Improve quality of diagnostics on restore_cwd failure.
1925 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
1926 (make_dir_parents): Last arg is now int * (for errno), not bool *.
1927 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
1928 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
1929 each time through the loop. Do not diagnose restore_cwd failure;
1930 that is the caller's job (and perhaps the caller does not care).
1932 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
1933 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
1934 If the file already exists but is not a directory, don't bother
1935 to try to make its parents.
1936 Close potential file descriptor leak if we can't chdir("/") (!).
1937 Don't always return true if chdir($PWD) fails; return true only
1938 if the requested action was done successfully (except for the
1940 Don't log final directory unless we actually made it.
1941 Refactor to avoid duplicate code to fix up permissions.
1942 Don't attempt to fix up parent permissions if chdir($PWD) fails.
1944 * strftime.c (my_strftime): Rewrite the previous change slightly,
1945 to make it a bit faster and (I hope) clearer.
1946 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
1947 Fix bug in formats like %2N.
1949 * verify.h: New file.
1951 2005-09-22 Jim Meyering <jim@meyering.net>
1953 Sync from coreutils.
1955 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
1957 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
1958 the .tm_year member, since otherwise gcc-4.0 would now warn about
1959 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
1961 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
1962 order to avoid an unsuppressible warning from gcc on 64-bit systems.
1964 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
1965 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
1966 when run in a time zone for which daylight savings time is in effect
1967 for the starting date.
1969 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
1970 stop us from restricting permissions of just-created absolute-named
1972 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
1973 to restore initial working directory.
1974 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
1975 to tell caller if/when we change the working directory and are
1976 unable to return to the initial one.
1977 * mkdir-p.h (make_dir_parents): Update prototype.
1978 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
1979 `return false'. This fixes a bug introduced on 2004-07-30.
1981 * openat.c (fdopendir): Be sure to close the supplied
1982 file descriptor before returning. This makes our replacement
1983 implementation a little closer to Solaris's, where fdopendir
1984 ties the file descriptor to the returned DIR* pointer.
1985 * openat.c (unlinkat): New function.
1986 * openat.h (unlinkat): Add prototype.
1987 * openat-die.c (openat_save_fail): Rename from openat_save_die.
1988 (openat_restore_fail): Rename from openat_restore_die.
1989 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
1991 Provide an alternative to exiting immediately upon save_cwd or
1992 restore_cwd failure. Now, an application can arrange e.g.,
1993 to perform a longjump in that case.
1994 * openat.c: Include dirname.h.
1995 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
1996 (rpl_openat, fdopendir, fstatat): Call openat_save_die
1997 and openat_restore_die rather than calling error directly.
1998 Don't include "error.h" or "exitfail.h"; they're no longer needed.
2000 * openat-die.c (openat_save_die, openat_restore_die): New file.
2001 * openat.h (openat_save_die, openat_restore_die): Declare and define.
2003 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2004 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2005 int utc, int nanoseconds);
2007 date should not have to allocate a megabyte of virtual memory to
2008 handle a format argument like +%1048575T. When implemented with
2009 strftime, it must allocate such a buffer, use strftime to fill it
2010 in, print it, then free it.
2011 With fprintftime, it simply prints everything and exits.
2012 With no need for memory allocation, that's one fewer way to fail.
2013 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2014 optional field width, not before, so we accept %9:z, not %:9z.
2015 (my_strftime): Be sure to use L_('x') for literals.
2017 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2018 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2019 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2020 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2021 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2022 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2023 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2024 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2025 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2027 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2028 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2029 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2030 and don't include <sys/file.h>).
2032 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
2034 Sync from coreutils.
2036 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2037 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2038 [!LDAV_DONE]: Avoid unused variable warning.
2040 2005-09-21 Bruno Haible <bruno@clisp.org>
2042 * unicodeio.h (unicode_to_mb): New declaration.
2044 2005-09-20 Derek Price <derek@ximbiot.com>
2046 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2048 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2050 Use a consistent style for including <config.h>.
2051 * __fpending.c, acl.c, argmatch.c,
2052 argp-help.c, argp-parse.c,
2053 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2054 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2055 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2056 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2057 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2058 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2059 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2060 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2061 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2062 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2063 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2064 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2065 modechange.c, mountlist.c, open-safer.c, physmem.c,
2066 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2067 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2068 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2069 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2070 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2071 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2072 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2073 userspec.c, utimecmp.c, version-etc-fsf.c,
2074 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2075 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2076 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2077 Standardize inclusion of config.h.
2078 * __fpending.h, dirfd.h, getdate.h, human.h,
2079 inttostr.h: Removed inclusion of config.h from header files.
2080 * inttostr.c: Adjusted in-tree users.
2081 * timespec.h: Remove superfluous warning to include config.h.
2082 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2083 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2084 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2085 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2087 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
2089 * stat-time.h: New file.
2090 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2091 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
2093 (timespec_cmp): New function.
2094 * utimecmp.c: Include stat-time.h.
2095 (SYSCALL_RESOLUTION): Depend on whether various struct stat
2096 members exist, not on the obsolescent ST_MTIM_NSEC.
2097 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2099 2005-09-15 Derek Price <derek@ximbiot.com>
2100 Paul Eggert <eggert@cs.ucla.edu>
2102 * regcomp.c, regexec.c, regex_internal.c: Back out previous
2103 changes, consolidating in...
2104 * regex_internal.h: ...this file.
2106 2005-09-15 Derek Price <derek@ximbiot.com>
2108 * regex_internal.h: Blank `pure' for GNUC < 3.
2109 * regex_internal.c: Ditto, using this...
2110 (__GNUC_PREREQ): ...new macro.
2111 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2112 (__GNUC_PREREQ): ...this new macro.
2114 * strstr.h: Include string.h. Define strstr as a macro here.
2116 2005-09-13 Derek Price <derek@ximbiot.com>
2118 * canon-host.c (canon_host_r): Set *cherror on memory allocation
2120 Reported by Jim Meyering <jim@meyering.net>.
2122 2005-09-13 Jim Meyering <jim@meyering.net>
2124 * canon-host.c: Filter through gnu indent and reword comments slightly.
2125 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2127 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2129 * lib/base64.c: Typo.
2130 (base64_encode): Put b64str in initialized data section.
2132 2005-09-12 Derek Price <derek@ximbiot.com>
2134 Return usable errors from canon-host.
2135 * canon-host.h: New file.
2136 * canon-host.c (canon_host): Wrap...
2137 (canon_host_r): ...this new function, which now relies exclusively on
2139 (ch_strerror): New function.
2140 (last_cherror): New global.
2141 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2142 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
2144 (freeaddrinfo): Free ai->ai_canonname when set.
2146 2005-09-12 Derek Price <derek@ximbiot.com>
2147 Paul Eggert <eggert@cs.ucla.edu>
2149 * glob-libc.h: Renamed from glob_.h. The new version is
2150 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2151 protecting things that should be done only in gnulib contexts.
2152 * glob_.h: New file, containing only the glob things needed for
2154 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
2155 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2156 (glob, globfree, glob_pattern_p): Now defined simply in terms of
2157 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2158 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2159 and to respect the namespace rules better.
2161 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
2163 Merge glibc and coreutils changes into gnulib, plus a few
2165 * md5.c: Use #error rather than a string.
2166 (CYCLIC): New macro, from glibc source. Use it instead of rol.
2167 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2168 (__attribute__): Define to empty for non recent-GCC.
2169 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2170 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2171 Renamed from their non-__ counterparts, with new macros replacing
2172 them if not _LIBC. Add __THROW attribute.
2174 (struct md5_ctx): Align buffer if using GCC.
2175 * sha1.h (struct sha1_ctx): Likewise.
2176 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
2177 The old name was backwards.
2178 (NOTSWAP): Remove; not used.
2179 (rol): New macro, moved here from md5.h.
2180 (sha1_process_block): Remove a FIXME that doesn't make sense.
2182 2005-09-12 Derek Price <derek@ximbiot.com>
2184 * gai_strerror.c: Include config.h when available. Include
2185 getaddrinfo.h before other headers to test interface.
2186 Reported by Larry Jones <lawrence.jones@ugs.com>.
2188 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
2190 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2191 definitions, since that's the preferred style in glibc.
2192 Fix a minor spacing issue, and update copyright notice to match glibc's.
2194 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
2196 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2198 2005-09-06 Simon Josefsson <jas@extundo.com>
2200 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2201 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
2203 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
2205 Change bitset word type from unsigned int to unsigned long int,
2206 as this has better performance on typical 64-bit hosts.
2207 Port bitset code to hosts with unusual word sizes.
2208 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2209 (build_collating_symbol):
2210 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2211 argument is a bitset. This is merely a style issue, but it makes
2212 it clearer that an entire array is expected.
2213 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2214 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2215 Port to the case where bitset_word is not the same as unsigned int.
2216 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2217 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2219 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2220 (build_trtable, group_nodes_into_DFAstates):
2222 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2223 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2224 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2225 * regexec.c (group_nodes_into_DFAstates): Likewise.
2226 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2227 * regcomp.c (optimize_subexps, lower_subexp):
2228 Work even if bitset_word has holes in its bitwise representation.
2229 * regex_internal.h (BITSET_WORD_BITS): Likewise.
2230 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2232 * regex_internal.c (re_string_reconstruct):
2233 Don't assume UCHAR_MAX == 255.
2234 * regex_internal.h (bitset_set_all): Likewise.
2235 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2237 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
2238 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2240 (BITSET_WORD_MAX): New macro.
2241 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2242 (bitset_set_all, bitset_copy): Now inline functions, not macros.
2243 (bitset_empty, bitset_copy):
2244 Prefer sizeof (bitset) to multiplying it out ourselves.
2245 (bitset_not_merge): Remove; unused.
2246 (bitset_contain): Return bool, not unsigned int with one bit on.
2247 All callers changed.
2248 * regexec.c (build_trtable): Don't assume bitset has no stricter
2249 alignment than re_node_set; do this by defining a new internal
2250 type struct dests_alloc and using it to allocate memory.
2252 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
2254 Check for arithmetic overflow when calculating sizes, to prevent
2255 some buffer-overflow issues. These patches are conservative, in the
2256 sense that when I couldn't determine whether an overflow was possible,
2257 I inserted a run-time check.
2258 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2259 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2260 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2261 (re_xnrealloc, re_x2nrealloc): New inline functions.
2262 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2263 (build_equiv_class, build_charclass): Check for arithmetic overflow
2264 in size expression calculations.
2265 * lib/regex_internal.c (re_string_realloc_buffers):
2266 (build_wcs_upper_buffer, re_node_set_add_intersect):
2267 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2268 (re_dfa_add_node, register_state): Likewise.
2269 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2270 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2271 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2272 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2274 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
2276 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2277 to avoid a collision with bits/local_lim.h in glibc.
2278 All uses changed. Problem reported by Dmitry V. Levin in
2279 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2281 * regex_internal.c (build_wcs_upper_buffer): Fix portability
2282 bugs in int versus size_t comparisons.
2283 (re_string_context_at): Fix bug where the code assumed that
2286 Use bool where appropriate.
2287 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2288 All callers changed.
2289 (calc_eclosure_iter): Likewise, for ROOT arg.
2290 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2291 (build_charclass_op): Likewise, for NON_MATCH arg.
2292 * regex_internal.c (re_string_allocate, re_string_construct):
2293 (re_string_construct_common): Likewise, for ICASE arg.
2294 * regexec.c (re_search_2_stub, re_search_stub):
2295 Likewise, for RET_LEN arg.
2296 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2297 (set_regs): Likewise, for FL_BACKTRACK arg.
2298 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2299 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2300 (calc_eclosure_iter, parse_bracket_exp):
2301 Use bool for internal variables that are booleans.
2302 * regexec.c (re_search_internal, check_matching, proceed_next_node):
2303 (set_regs, build_sifted_states, sift_states_bkref):
2304 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2305 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2306 (find_collation_sequence_value):
2308 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2309 (re_node_set_compare):
2310 Return bool, not int. All callers changed.
2311 * regexec.c (check_halt_node_context, check_dst_limits):
2312 (build_trtable, check_node_accept): Likewise.
2313 * regex_internal.h: Include stdbool.h.
2315 Fix bugs uncovered when converting to bool.
2316 * regcomp.c (calc_eclosure_iter): Check for storage allocation
2317 failure instead of charging ahead blindly.
2318 * regex_internal.c (register_state): Likewise.
2319 * regexec.c (re_search_2_stub): Use simpler method than boolean
2320 for freeing internal storage.
2321 (group_nodes_into_DFA_states): Use unsigned int, not int, for
2322 bitset pieces used as boolean, to avoid undefined behavior
2323 on hosts that do int overflow checking.
2325 2005-08-31 Derek Price <derek@ximbiot.com>
2327 * getdelim.c (getdelim): Return EOF on EOF.
2328 Reported by Larry Jones <lawrence.jones@ugs.com>.
2330 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
2332 * regex_internal.c (re_string_reconstruct): Don't assume buffer
2333 lengths fit in regoff_t; this isn't true if regoff_t is the same
2335 * regex.c (re_search_internal): 5th arg is LAST_START
2336 (= START + RANGE) instead of RANGE. This avoids overflow
2337 problems when regoff_t is the same width as size_t.
2338 All callers changed.
2339 (re_search_2_stub): Check for overflow when adding the
2340 sizes of the two strings.
2341 (re_search_stub): Check for overflow when adding START
2342 to RANGE; if it occurs, substitute the extreme value.
2344 2005-08-31 Jim Meyering <jim@meyering.net>
2346 * regcomp.c (search_duplicated_node): Make first pointer arg
2348 * regex_internal.c (create_ci_newstate, create_cd_newstate):
2349 (register_state): Likewise.
2350 * regexec.c (search_cur_bkref_entry, check_dst_limits):
2351 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2352 (group_nodes_into_DFAstates): Likewise.
2354 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
2356 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2357 old glibc regex code mishandles strings longer than 2**31 bytes.
2358 This patch fixes this when the regex code is used in gnulib
2359 (i.e., outside glibc).
2361 This patch should not affect the use of the regex code inside
2362 glibc. No doubt this problem also needs to be handled for glibc
2363 as well, but the result will be an incompatible change to the
2364 glibc ABI, and the old ABI will have to be supported too. That
2365 can be the the subject for another patch.
2367 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2368 governing whether the rest of this patch is active. By default,
2369 the macro is disabled and the patch has no effect.
2370 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2371 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2372 (struct re_pattern_buffer, re_search, re_search_2, re_match):
2373 (re_match_2, re_set_registers): Use the new types.
2374 * regex_internal.h (Idx, re_hashval_t): New types.
2375 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2377 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2378 (re_string_context_at, bin_tree_t, re_dfastate_t):
2379 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2380 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2381 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2382 (re_string_char_size_at, re_string_wchar_at):
2383 (re_string_elem_size_at):
2384 Use the new types and macros to port to 64-bit hosts.
2385 Use unsigned types for internal values, so that the code
2386 mostly works even for arrays larger than SSIZE_MAX.
2387 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2388 (search_duplicated_node, calc_eclosure_iter, fetch_number):
2389 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2390 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2391 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2392 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2393 (calc_inveclosure, parse_dup_op, build_range_exp):
2394 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2395 (fetch_number, create_token_tree, mark_opt_subexp):
2397 * regex_internal.c (re_string_construct_common, create_ci_newstate):
2398 (create_cd_newstate, re_string_allocate, re_string_construct):
2399 (re_string_realloc_buffers, build_wcs_upper_buffer):
2400 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2401 (re_string_reconstruct, re_string_peek_byte_case):
2402 (re_string_fetch_byte_case, re_string_context_at):
2403 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2404 (re_node_set_init_copy, re_node_set_add_intersect):
2405 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2406 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2407 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2408 (re_acquire_state, re_acquire_state_context, register_state):
2410 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2411 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2412 (re_search_internal, re_search_2_stub, re_search_stub)
2413 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2414 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2415 (update_cur_sifted_state, check_dst_limits):
2416 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2417 (check_subexp_limits, sift_states_bkref, merge_state_array):
2418 (check_subexp_matching_top, get_subexp, get_subexp_sub):
2419 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2420 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2421 (expand_bkref_cache, check_node_accept_bytes):
2422 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2423 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2424 (acquire_init_state_context, check_halt_node_context):
2425 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2426 (sift_states_backward, clean_state_log_if_needed):
2427 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2428 (find_recover_state, transit_state_sb, transit_state_mb):
2429 (transit_state_bkref, build_trtable, match_ctx_clean):
2431 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2432 to work around an assumption that REG_MISSING is negative.
2434 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2435 (seek_collating_symbol_entry) [defined _LIBC]:
2436 (lookup_collation_sequence_value) [defined _LIBC]:
2437 (build_range_exp, build_collating_symbol) [defined _LIBC]:
2438 Use prototypes rather than old-style function definitions.
2439 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2440 (transit_state_sb) [0]:
2441 (find_collation_sequence_value) [defined _LIBC]: Likewise.
2443 * regexec.c (re_search_internal): Simplify update of rm_so and
2446 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2447 (optimize_subexps, lower_subexp):
2448 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2449 since the signed shift might overflow. Use 1u<<31 instead.
2450 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2451 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2454 * regcomp.c (optimize_subexps, lower_subexp):
2455 Use CHAR_BIT rather than 8, for clarity.
2456 * regexec.c (check_dst_limits_calc_pos_1):
2457 (check_subexp_matching_top): Likewise.
2458 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
2459 have to worry about portability issues when shifting it left.
2460 Remove no-longer-needed test for table_size > 0.
2461 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
2462 in a word, as the resulting behavior is undefined.
2463 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
2464 in one case, a <= should have been an <, and in another case the
2465 whole test was missing.
2466 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
2467 the standard name CHAR_BIT.
2468 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
2469 this is not true on one's complement and signed-magnitude hosts.
2471 * regex_internal.h (re_sub_match_top_t): Remove unused member
2473 (struct re_dfa_t): Remove unused member states_alloc.
2474 * regcomp.c (init_dfa): Don't initialize unused members.
2476 2005-08-31 Bruno Haible <bruno@clisp.org>
2478 * strstr.c: Include <stddef.h>, for NULL.
2479 * strcasestr.c: Likewise.
2480 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
2482 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
2484 * iconvme.h: Add prototype for iconv_alloc.
2486 2005-08-29 Simon Josefsson <jas@extundo.com>
2488 * iconvme.c: Fix errno.
2490 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
2492 * iconvme.c: Split iconv_string into iconv_alloc.
2494 2005-08-27 Jim Meyering <jim@meyering.net>
2496 * fopen-safer.c: Merge minor changes from coreutils.
2497 * dup-safer.c: Likewise.
2498 * fd-safer.c: Likewise.
2500 Merge from coreutils.
2501 * stdio--.h: New file.
2502 * stdlib--.h: New file.
2503 * mkstemp-safer.c: New file.
2505 GNU tar needs these.
2506 * pipe-safer.c: New file.
2507 * creat-safer.c: New file.
2508 * fcntl--.h (creat): Define to creat_safer.
2509 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
2510 * unistd--.h (pipe): Define to pipe_safer.
2511 * unistd-safer.h: Declare pipe_safer.
2513 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
2515 * regex_internal.h: Remove all references to
2516 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
2518 (bitset_not, bitset_merge, bitset_not_merge):
2519 (bitset_mask, re_string_allocate, re_string_construct):
2520 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
2521 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
2522 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
2523 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
2524 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2525 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2526 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
2527 (re_acquire_state_context):
2528 Remove unnecessary forward decls.
2529 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
2530 Put __attribute at function definition,
2531 now that the function decl has been removed.
2532 * lib/regex_internal.c (re_string_peek_byte_case):
2533 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
2536 2005-08-26 Simon Josefsson <jas@extundo.com>
2538 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
2539 Haible <bruno@clisp.org>.
2541 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
2543 * regexec.c (set_regs): Don't alloca with an unbounded size.
2545 alloca modernization/simplification for regex.
2546 * regex.c: Remove portability cruft for alloca. This no longer
2547 needs to be at the start of the file, and can be moved into
2548 regex_internal.h and simplified.
2549 * regex_internal.h: Include <alloca.h>.
2550 (__libc_use_alloca) [!defined _LIBC]: New macro.
2551 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
2552 now works outside glibc.
2554 2005-08-24 Simon Josefsson <jas@extundo.com>
2556 * getpass.c: Add WIN32 implementation. Conditionalize use of
2557 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
2558 GLIBC specific code.
2560 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
2562 Make regex safe for g++. This fixes one real bug (an "err"
2563 that should have been "*err"). g++ problem reported by
2565 * regex_internal.h (re_calloc): New macro, consistent with
2566 re_malloc etc. All callers of calloc changed to use re_calloc.
2567 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
2568 not int. All callers changed.
2569 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
2570 just use an array of size MB_LEN_MAX.
2571 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
2572 (find_recover_state): Change "err" to "*err"; this fixes what
2573 appears to be a real bug.
2574 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
2577 2005-08-25 Jim Meyering <jim@meyering.net>
2579 * open-safer.c: Include <config.h>.
2580 Otherwise, we'd lose LARGEFILE support in any file using
2583 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
2585 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
2586 * regex.h (regerror): Likewise.
2588 * regex.c: Do not include <sys/types.h>, as POSIX no longer
2589 requires this. (The code never needed it.)
2591 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
2592 All uses of recently-renamed identifiers changed to use the new,
2593 POSIX-compliant names. The code will build and run just fine
2594 without these changes, but it's better to eat our own dog food
2595 and use the standard-conforming names.
2597 * regex.h: Fix a multitude of POSIX name space violations.
2598 These changes have an effect only for programs that define
2599 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
2600 do not change anything for programs compiled in the normal way.
2601 Also, there is no effect on the ABI.
2603 (_REGEX_SOURCE): New macro.
2604 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
2605 defined and _GNU_SOURCE is not; this fixes a name space violation.
2607 Rename the following macros to obey POSIX requirements.
2608 The old names are still visible as macros if _REGEX_SOURCE is defined.
2609 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
2610 RE_BACKSLASH_ESCAPE_IN_LISTS.
2611 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
2612 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
2613 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
2614 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
2615 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
2616 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
2617 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
2618 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
2619 (REG_INTERVALS): renamed from RE_INTERVALS.
2620 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
2621 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
2622 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
2623 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
2624 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
2625 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
2626 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
2627 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
2628 RE_UNMATCHED_RIGHT_PAREN_ORD.
2629 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
2630 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
2631 (REG_DEBUG): renamed from RE_DEBUG.
2632 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
2633 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
2634 unusual, since we can't clash with the POSIX REG_ICASE.
2635 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
2636 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
2637 (REG_NO_SUB): renamed from RE_NO_SUB.
2638 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
2639 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
2640 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
2641 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
2642 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
2643 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
2644 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
2645 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
2646 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
2647 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
2648 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
2649 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
2650 RE_SYNTAX_POSIX_MINIMAL_BASIC.
2651 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
2652 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
2653 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
2654 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
2655 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
2656 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
2657 (REG_FIXED): Renamed from REGS_FIXED.
2658 (REG_NREGS): Renamed from RE_NREGS.
2660 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
2661 of other REG_* macros, since POSIX says the user is allowed to
2662 #undef these macros selectively.
2664 (reg_errcode_t): Update comment stating what other tables need
2667 Rename the following enum values to obey POSIX requirements.
2668 The old names are still visible as macros.
2669 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
2670 is not defined, since GNU is supposed to be a superset of POSIX as
2671 much as possible, and since we want reg_errcode_t to be a signed
2672 type for implementation consistency.
2673 (_REG_NOERROR): Renamed from REG_NOERROR.
2674 (_REG_NOMATCH): Renamed from REG_NOMATCH.
2675 (_REG_BADPAT): Renamed from REG_BADPAT.
2676 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
2677 (_REG_ECTYPE): Renamed from REG_ECTYPE.
2678 (_REG_EESCAPE): Renamed from REG_EESCAPE.
2679 (_REG_ESUBREG): Renamed from REG_ESUBREG.
2680 (_REG_EBRACK): Renamed from REG_EBRACK.
2681 (_REG_EPAREN): Renamed from REG_EPAREN.
2682 (_REG_EBRACE): Renamed from REG_EBRACE.
2683 (_REG_BADBR): Renamed from REG_BADBR.
2684 (_REG_ERANGE): Renamed from REG_ERANGE.
2685 (_REG_ESPACE): Renamed from REG_ESPACE.
2686 (_REG_BADRPT): Renamed from REG_BADRPT.
2687 (_REG_EEND): Renamed from REG_EEND.
2688 (_REG_ESIZE): Renamed from REG_ESIZE.
2689 (_REG_ERPAREN): Renamed from REG_ERPAREN.
2690 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
2691 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
2692 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
2693 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
2695 (_REG_RE_NAME, _REG_RM_NAME): New macros.
2696 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
2697 changed. But support the old name if the new one is not defined
2698 and if _REGEX_SOURCE.
2700 Change the following member names in struct re_pattern_buffer.
2701 The old names are still supported if !_REGEX_SOURCE.
2702 The new names are always supported, regardless of _REGEX_SOURCE.
2703 (re_buffer): Renamed from buffer.
2704 (re_allocated): Renamed from allocated.
2705 (re_used): Renamed from used.
2706 (re_syntax): Renamed from syntax.
2707 (re_fastmap): Renamed from fastmap.
2708 (re_translate): Renamed from translate.
2709 (re_can_be_null): Renamed from can_be_null.
2710 (re_regs_allocated): Renamed from regs_allocated.
2711 (re_fastmap_accurate): Renamed from fastmap_accurate.
2712 (re_no_sub): Renamed from no_sub.
2713 (re_not_bol): Renamed from not_bol.
2714 (re_not_eol): Renamed from not_eol.
2715 (re_newline_anchor): Renamed from newline_anchor.
2717 Change the following member names in struct re_registers.
2718 The old names are still supported if !_REGEX_SOURCE.
2719 The new names are always supported, regardless of _REGEX_SOURCE.
2720 (rm_num_regs): Renamed from num_regs.
2721 (rm_start): Renamed from start.
2722 (rm_end): Renamed from end.
2724 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
2725 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
2726 Prepend __ to parameter names.
2728 Undo yesterday's changes.
2730 2005-08-24 Jim Meyering <jim@meyering.net>
2732 Sync from coreutils.
2733 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
2735 2005-08-21 Bruno Haible <bruno@clisp.org>
2737 * lock.h: Add multiple inclusion guard.
2738 * tls.h: Add multiple inclusion guard.
2740 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
2742 * regex.h (REG_NOSYS)
2743 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
2744 Define, since POSIX requires it as of 2001.
2745 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
2746 New private symbol, used to keep the enum signed in all cases.
2747 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
2748 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
2750 * regex_internal.c (re_string_skip_chars, register_state):
2752 Remove forward decls; no longer needed now that we use prototypes.
2753 * regexec.c (acquire_init_state_context, check_halt_node_context):
2754 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
2755 (clean_state_log_if_needed): Likewise.
2757 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
2759 Fix problems reported by Sam Steingold in
2760 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
2761 * regexec.c (sift_states_bkref): Fix portability bug: the code
2762 assumed that reg_errcode_t is a signed type, which is not
2763 necessarily true if _XOPEN_SOURCE is not defined.
2764 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
2765 some compilers warn about it otherwise.
2767 2005-08-20 Jim Meyering <jim@meyering.net>
2769 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
2770 of unused local, dfa.
2772 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
2774 * regcomp.c (create_initial_state): Remove duplicate decl.
2775 (init_word_char, create_initial_state, duplicate_node_closure):
2776 (fetch_token, peek_token_bracket, build_range_exp):
2777 (build_collating_symbol): Remove forward decls; no longer needed
2778 now that we use prototypes.
2781 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
2782 (re_compile_fastmap_iter, regcomp, regerror, regfree):
2783 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
2784 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
2785 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
2786 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
2787 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
2788 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
2789 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
2790 (build_range_exp, build_collating_symbol, parse_bracket_exp):
2791 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
2792 (build_charclass, build_charclass_op, fetch_number, create_tree):
2793 (create_token_tree, mark_opt_subexp, duplicate_tree):
2794 Use prototypes rather than old-style definitions.
2797 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
2798 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
2799 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2800 (re_string_reconstruct, re_string_peek_byte_case):
2801 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
2802 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2803 (re_node_set_init_copy, re_node_set_add_intersect):
2804 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2805 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2806 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2807 (re_acquire_state, re_acquire_state_context, register_state):
2808 (create_ci_newstate, create_cd_newstate, free_state):
2810 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
2811 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
2812 (re_search_internal, prune_impossible_nodes):
2813 (acquire_init_state_context, check_matching, static):
2814 (check_halt_node_context, check_halt_state_context, proceed_next_node):
2815 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
2816 (update_regs, sift_states_backward, build_sifted_states):
2817 (clean_state_log_if_needed, merge_state_array):
2818 (update_cur_sifted_state, add_epsilon_src_nodes):
2819 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
2820 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
2821 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
2822 (find_recover_state, check_subexp_matching_top, transit_state_mb):
2823 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
2824 (check_arrival, check_arrival_add_next_nodes):
2825 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2826 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2827 (check_node_accept_bytes, check_node_accept, extend_buffers):
2828 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
2829 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
2834 (re_string_allocate, re_string_construct, re_string_reconstruct):
2835 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
2836 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
2837 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
2838 (re_string_context_at, re_string_peek_byte_case):
2839 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
2840 is defined, since we now use prototypes always.
2842 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
2843 C89 or better. All uses removed.
2845 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
2847 * regex_internal.c (re_acquire_state, re_acquire_state_context)
2848 [defined lint]: Suppress bogus uninitialized-variable warnings.
2850 * regcomp.c (duplicate_node): Return new index, not an error code,
2851 and let the caller return REG_ESPACE if out of space. This
2852 removes an uninitialied-variable warning with GCC 4.0.1, and also
2853 avoids taking the address of a local variable. All callers
2856 2005-08-19 Jim Meyering <jim@meyering.net>
2858 * regexec.c (proceed_next_node): Redo local variables to
2859 avoid GCC shadowing warnings.
2861 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
2863 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
2864 (re_node_set_insert_last, re_dfa_add_node):
2865 Rename local variables to avoid GCC shadowing warnings.
2867 2005-08-18 Bruno Haible <bruno@clisp.org>
2869 * strstr.c (strstr): Fix return value in multibyte case.
2870 * strcasestr.c (strcasestr): Likewise.
2872 2005-08-17 Jim Meyering <jim@meyering.net>
2874 Make the %s format (seconds since the epoch) work for a negative
2875 number and when used with a zero-padded field width, e.g. %015s.
2877 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
2878 label so that it precedes the code to set `digits'. Otherwise,
2879 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
2880 print `00-22'. Now, it prints `-0022', as it should.
2882 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
2884 * regex.h: Remove useless space-before-tab. From coreutils.
2886 2005-08-17 Bruno Haible <bruno@clisp.org>
2888 * strcasestr.h: New file.
2889 * strcasestr.c: New file.
2891 2005-08-17 Bruno Haible <bruno@clisp.org>
2893 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
2894 * strstr.c: Completely rewritten, with multibyte locale support.
2896 2005-08-17 Bruno Haible <bruno@clisp.org>
2898 * strcasecmp.c: Use mbuiter.h.
2900 2005-08-17 Bruno Haible <bruno@clisp.org>
2902 * mbuiter.h: New file.
2904 2005-08-16 Bruno Haible <bruno@clisp.org>
2906 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
2908 (mbi_avail, mbi_advance): Let the iteration end before the terminating
2909 NUL byte, not after it.
2911 2005-08-16 Bruno Haible <bruno@clisp.org>
2913 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
2914 the valid ones. Makes the comparison operations transitive:
2915 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
2916 * strcasecmp.c (strcasecmp): Use mb_casecmp.
2918 2005-08-16 Bruno Haible <bruno@clisp.org>
2920 * strcase.h (strcasecmp): Add note in comments.
2921 * strncasecmp.c: Use code from strcasecmp.c.
2922 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
2923 (strcasecmp): Work correctly in multibyte locales.
2925 2005-08-16 Bruno Haible <bruno@clisp.org>
2927 * strnlen1.h: New file.
2928 * strnlen1.c: New file.
2930 2005-08-16 Bruno Haible <bruno@clisp.org>
2932 * mbfile.h: New file.
2934 2005-08-16 Bruno Haible <bruno@clisp.org>
2936 * mbiter.h: New file.
2938 2005-08-16 Bruno Haible <bruno@clisp.org>
2940 * mbchar.h: New file.
2941 * mbchar.c: New file.
2943 2005-08-16 Bruno Haible <bruno@clisp.org>
2945 * tls.h: New file, from GNU gettext.
2946 * tls.c: New file, from GNU gettext.
2948 2005-08-15 Bruno Haible <bruno@clisp.org>
2950 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
2953 2005-08-14 Jim Meyering <jim@meyering.net>
2955 Sync from coreutils.
2957 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
2958 Use the hash-table-based cycle-detection code not just when
2959 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
2960 Reported by James Youngman in
2961 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
2962 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
2963 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
2964 This lets us compile with -DFTS_DEBUG, once again.
2965 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
2966 * fts.c (fd_safer): Remove decl.
2967 Include fcntl--.h rather than unistd-safer.h
2968 (fts_safe_changedir): Don't call fd_safer; no longer needed
2969 now that we include fcntl--.h.
2971 2005-08-11 Simon Josefsson <jas@extundo.com>
2973 * readline.h, readline.c: New file.
2975 2005-08-11 Bruno Haible <bruno@clisp.org>
2977 * strnlen.h (strnlen): Change parameter name to match comment.
2979 2005-08-10 Simon Josefsson <jas@extundo.com>
2981 * strndup.c: Use strnlen.h.
2983 * strnlen.h: New file.
2985 2005-08-02 Simon Josefsson <jas@extundo.com>
2987 * getline.h, getline.c: Rewrite.
2989 * getdelim.h, getdelim.c: New files, ported from glibc.
2991 2005-07-31 Bruno Haible <bruno@clisp.org>
2993 * lock.h (gl_lock_initializer): New macro.
2994 (gl_lock_define_initialized): Use it.
2995 (gl_rwlock_initializer): New macro.
2996 (gl_rwlock_define_initialized): Use it.
2997 (gl_recursive_lock_initializer): New macro.
2998 (gl_recursive_lock_define_initialized): Use it.
3000 2005-07-26 Bruno Haible <bruno@clisp.org>
3002 * lock.h: Update from GNU gettext.
3003 * lock.c: Update from GNU gettext.
3005 2005-07-18 Bruno Haible <bruno@clisp.org>
3007 * lock.h (gl_once_t): New type.
3008 (gl_once_define, gl_once): New macros.
3009 * lock.c (fresh_once): New variable.
3010 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3013 2005-07-18 Simon Josefsson <jas@extundo.com>
3015 * check-version.c (check_version): Accept identical versions too.
3017 2005-07-18 Bruno Haible <bruno@clisp.org>
3019 * lock.h: New file, from GNU gettext.
3020 * lock.c: New file, from GNU gettext.
3022 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
3024 * quotearg.c: Add translator comment suggested by Bruno Haible,
3025 with a minor change.
3027 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
3029 * version-etc-fsf.c (version_etc_copyright): Parameterize the
3030 copyright symbol and the year.
3031 * version-etc.c (COPYRIGHT_YEAR): New constant.
3032 (version_etc_va): Use parameterized copyright notice.
3033 Reword to conform to the current GNU coding standards.
3035 2005-07-11 Simon Josefsson <jas@extundo.com>
3037 * size_max.h: New file.
3039 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
3041 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3044 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
3045 and Paul Eggert <eggert@cs.ucla.edu>
3047 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3048 in wint_t, not wchar_t. Remove now-unnecessary cast.
3050 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
3052 * regex.c, regex.h: Sync from libc.
3053 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3054 New files, synced from libc, except that regex_internal.h
3055 currently has a small porting fix.
3057 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
3059 Remove the dependency of the strftime module on the tzset module.
3060 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3061 Copy the input structure, to work around some of the bug with
3062 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
3063 Solaris releases, you should also use the tzset module, but we won't
3064 require it as a dependency any more since we don't want LGPLed code
3065 to depend on GPLed code.
3067 2005-07-02 Jim Meyering <jim@meyering.net>
3069 * backupfile.c (backup_args): Change a `0' to NULL.
3071 2005-07-01 Jim Meyering <jim@meyering.net>
3073 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3074 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3075 * save-cwd.c, tempname.c:
3076 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3077 and don't include <sys/file.h>).
3079 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
3081 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3082 declares only 'struct timespec;' (!).
3084 2005-06-29 Jim Meyering <jim@meyering.net>
3086 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3087 type name. Use the variable name instead.
3088 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3090 2005-06-28 Simon Josefsson <jas@extundo.com>
3092 * check-version.h, check-version.c: New files.
3094 2005-06-28 Simon Josefsson <jas@extundo.com>
3096 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
3097 collision with global variable. Better indentation. Don't
3098 increment buffer pointer beyond buffer end. Based on comments
3099 from Paul Eggert <eggert@cs.ucla.edu>.
3103 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
3105 * canon-host.c (canon-host): Append trailing "," to 0 in
3106 initializer of struct addrinfo, as an indication that we don't
3107 care how many members the structure has.
3109 2005-06-24 Derek Price <derek@ximbiot.com>
3110 and Bruno Haible <bruno@clisp.org>
3112 Remove stat module & update lstat.
3113 * stat.c: Remove this file...
3114 (slash_aware_lstat): ...moving this content and its support...
3115 * lstat.c (rpl_lstat): ...into here.
3116 * lstat.h: New file.
3118 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
3120 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
3121 (ranged_convert): Don't save conversion in a temporary struct.
3122 This causes a warning with GCC 4.0.0, and anyway in the typical
3123 case it's not worth the extra 100 bytes or so of code.
3124 (ranged_convert, __mktime_internal): When calling a function via a
3125 pointer P, use P () rather than (*P) (), as we now assume C89 or
3128 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
3130 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3131 "who -r" failed to give output. Problem reported by Tim Waugh.
3133 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3134 (xcalloc): Use it to avoid needless tests.
3135 Problem reported by Jim Meyering.
3137 2005-06-16 Jim Meyering <jim@meyering.net>
3139 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3140 when either N or S is zero.
3142 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3144 * argp.h (__option_is_short): Check upper limit of
3145 __key. Isprint() requires its argument to have the value
3146 of an unsigned char or EOF.
3148 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
3150 * fnmatch.c (fnmatch): If there is an encoding error in a
3151 multibyte string or pattern, fall back on unibyte matching.
3152 Problem reported by James Youngman.
3154 2005-06-08 Bruno Haible <bruno@clisp.org>
3156 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3159 2005-06-08 Bruno Haible <bruno@clisp.org>
3161 * csharpcomp.h: New file, from GNU gettext.
3162 * csharpcomp.c: New file, from GNU gettext.
3163 * csharpcomp.sh.in: New file, from GNU gettext.
3165 2005-06-07 Derek Price <derek@ximbiot.com>
3168 * glob_.h: Indent nested #ifdef.
3170 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
3172 Sync from coreutils.
3173 Use "file name" when talking about file names, instead of "filename"
3174 or "path", as per the GNU coding standards.
3175 * mkdir-p.c: Renamed from makepath.c.
3176 (make_dir_parents): Renamed from make_path. All callers changed.
3177 * mkdir-p.h: Likewise. All includers changed.
3178 * filenamecat.c: Renamed from path-concat.c.
3179 (file_name_concat): Renamed from path_concat. All callers changed.
3180 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3181 * filenamecat.h: Likewise. All includers changed.
3182 * acl.c: Don't use "path" or "filename" to mean "file name"
3183 in comments or local variable names.
3184 * basename.c: Likewise.
3185 * canonicalize.c, canonicalize.h: Likewise.
3186 * dirname.c, dirname.h: Likewise.
3187 * euidaccess.c: Likewise.
3188 * exclude.c: Likewise
3189 * fnmatch_.h, fnmatch_loop.c: Likewise.
3190 * fsusage.c, fsuage.h: Likewise.
3191 * fts.c, fts_.h: Likewise.
3192 * getcwd.c: Likewise.
3193 * getloadavg.c: Likewise.
3194 * mkstemp.c: Likewise.
3195 * mountlist.c, mountlist.h: Likewise.
3196 * openat.c, openat.h: Likewise.
3197 * readlink-stub.c: Likewise.
3198 * readutmp.c, readutmp.h: Likewise.
3199 * rename.c: Likewise.
3200 * rmdir.c: Likewise.
3202 * savedir.c: Likewise.
3203 * stripslash.c: Likewise.
3204 * tempname.c: Likewise.
3205 * xreadlink.c: Likewise.
3206 * exclude.c (excluded_file_name): Renamed from excluded_filename.
3208 * exclude.h: Likewise.
3210 * euidaccess.c (getuid, getgid, getuid, getegid)
3211 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3212 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3213 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3214 * pathmax.h: Include <limits.h> unconditionally, since other
3215 files have been getting away with it for years (MORE/BSD 4.3
3217 * userspec.c (getpwnam, getgrnam, getgrgid)
3218 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3220 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3221 Define to 256, not 255, as per modern POSIX.
3223 2005-06-01 Bruno Haible <bruno@clisp.org>
3225 * csharpexec.h: New file, from GNU gettext.
3226 * csharpexec.c: New file, from GNU gettext.
3227 * csharpexec.sh.in: New file, from GNU gettext.
3229 2005-05-31 Derek Price <derek@ximbiot.com>
3230 Paul Eggert <eggert@cs.ucla.edu>
3233 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3235 2005-05-29 Derek Price <derek@ximbiot.com>
3236 Paul Eggert <eggert@cs.ucla.edu>
3238 * glob_.h, glob.c: New files.
3240 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
3242 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3244 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3245 the configuration hassle isn't worth it.
3246 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3247 (LONGEST_MODIFIER, PRIuMAX): Remove.
3249 2005-05-27 Bruno Haible <bruno@clisp.org>
3251 * getlogin_r.h: Remove second include of <stddef.h>.
3253 2005-05-25 Bruno Haible <bruno@clisp.org>
3254 Derek Price <derek@ximbiot.com>
3256 * getlogin_r.h: Simplify API documentation.
3258 2005-05-25 Derek Price <derek@ximbiot.com>
3259 Paul Eggert <eggert@cs.ucla.edu>
3261 * getlogin_r.c, getlogin_r.h: New files.
3263 2005-05-22 Bruno Haible <bruno@clisp.org>
3265 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3266 Also include <sys/param.h> if it defines MIN, MAX.
3267 Based on a patch by Derek Price <derek@ximbiot.com>.
3269 2005-05-22 Bruno Haible <bruno@clisp.org>
3271 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3272 (INT64_MIN): Fix definition.
3273 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3275 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3276 NEED_SIGNED_INT_TYPES.
3278 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3279 HAVE_SYSTEM_INTTYPES.
3281 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
3283 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3284 so that unistd-safer.h (GPL'ed code) need not be included.
3286 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
3289 * fts.c: Don't include "cycle-check.h" or "hash.h".
3290 (setup_dir, free_dir): New functions.
3291 (enter_dir, leave_dir): Define trivial
3292 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
3293 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
3294 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3295 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3296 Move to fts-cycle.c.
3297 (fts_open): Use setup_dir.
3298 (fts_close): Use free_dir.
3299 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3300 This adds a label and some gotos, but the alternatives were messier.
3301 Check for memory allocation failure when entering a dir.
3302 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3303 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3304 (FTS): New member fts_cycle, that is a union that contains the
3305 old active_dir_ht and cycle_state. All uses changed to mention
3306 fts_cycle.ht and fts_cycle.state.
3307 * fts-cycle.c: New file, containing GPL'ed code migrated out of
3308 fts.c, with the following changes:
3309 (setup_dir, free_dir): New functions.
3310 (enter_dir): Now returns bool. Return true if successful, false
3311 if memory exhausted. All callers changed.
3312 Do not bother partly cleaning up on
3313 memory allocation failure; that is free_dir's job.
3314 However, free ad if hash_insert fails, to avoid memory leak.
3315 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3316 fts->fts_options to see which union member to use.
3318 2005-05-20 Jim Meyering <jim@meyering.net>
3320 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3321 Now a macro, to pacify GCC.
3323 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
3325 * chown.c (rpl_chown): Return -1 on failure.
3327 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
3329 * canonicalize.c: Include canonicalize.h first, to test interface.
3330 Include <stddef.h> unconditionally, since we assume C89 now.
3331 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3332 * fts.c: Include fts_.h first, to check interface.
3333 Do not include intprops.h; no longer needed.
3334 Include cycle-check.h and hash.h, since fts_.h no longer does.
3335 Remove unnecessary casts of closedir to void.
3336 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3337 decide whether to decrement nlinks.
3338 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3339 (FTS): Use struct hash_table * instead of Hash_table, so that
3340 we no longer need to include hash.h here.
3342 2005-05-17 Jim Meyering <jim@meyering.net>
3344 * fts.c, fts_.h: New files, from coreutils.
3346 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
3348 Sync from coreutils.
3349 * unlinkdir.c, unlinkdir.h: New files.
3350 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3351 regex.h, unlocked-io.h, xtime.h:
3352 White space changes only.
3353 * makepath.c (make_path): Port to hosts where leading "//" is special.
3354 * yesno.c: Include getline.h, not ctype.h.
3355 (yesno): Don't remove leading white space; POSIX doesn't allow it.
3356 Use getline to remove arbitrary restriction on response length.
3358 2005-05-13 Bruno Haible <bruno@clisp.org>
3360 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3361 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3362 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3363 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3364 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3365 Add support for 64-bit integers in the MSVC compiler.
3367 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
3369 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3370 Change the initial comment to refer to GPL, not LGPL.
3371 gnulib-tool will change it to LGPL as needed.
3373 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3374 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3375 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3376 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3377 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3378 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3379 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3380 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3381 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3382 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3383 concatpath.c, config.charset, copy-file.c, copy-file.h,
3384 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3385 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3386 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3387 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3388 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3389 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3390 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3391 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3392 full-read.c, full-read.h, full-write.c, full-write.h,
3393 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3394 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3395 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3396 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3397 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3398 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3399 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3400 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3401 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3402 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3403 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3404 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3405 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3406 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3407 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3408 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3409 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3410 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3411 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3412 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3413 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3414 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3415 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3416 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3417 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3418 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3419 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3420 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3421 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3422 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3423 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3424 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3425 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3426 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3427 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3428 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3429 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3430 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3431 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3432 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3433 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3434 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3435 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3436 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3437 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3438 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3439 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3440 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3441 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3442 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3443 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3444 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3445 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3446 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3447 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3448 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3449 Update FSF postal mail address.
3451 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3453 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3454 specified in ai_socktype. Fix invalid ai_protocol
3455 check. ai_protocol is usually set to 0 or depending on
3456 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
3457 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
3458 ai_socktype / ai_protocol in the returned addrinfo structure.
3460 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3461 Bruno Haible <bruno@clisp.org>
3463 * inet_ntop.h: New file.
3464 * inet_ntop.c: New file, from glibc with modifications.
3466 2005-05-08 Jim Meyering <jim@meyering.net>
3468 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
3470 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
3472 Merge from coreutils. Among other things,
3473 add bulletproofing for cases where stdin, stdout, or stderr are closed.
3474 * fd-safer.c: New file.
3475 * fcntl-safer.h, open-safer.c: Remove.
3476 * chdir-long.c: Fix comment "fetish" -> "coreutils".
3477 * dup-safer.c: Include unistd-safer.h first.
3478 Don't include errno.h.
3479 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
3480 * file-type.h: Don't assume invoker included sys/stat.h first.
3481 * file-type.c: Rely on file-type.h change.
3482 * getloadavg.c: Include unistd-safer.h.
3483 (getloadavg): Use safer open.
3484 * getusershell.c: Include "stdio-safer.h".
3485 (getusershell): Use safer fopen.
3486 * long-options.c (long_options): Use NULL rather than 0.
3487 * modechange.h (mode_free): Remove; all callers changed to invoke
3489 * modechange.c: Likewise.
3490 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
3491 (MODE_DONE): New constant.
3492 (struct mode_change): Remove 'next' member.
3493 (make_node_op_equals): New function; like the old one of the
3494 same name, except it allocates an array.
3495 (mode_compile, mode_create_from_ref): Use it.
3496 (mode_compile): Allocate result as an array, not a linked list.
3497 Parse octal string ourself, so that we catch mistakes like "+0".
3498 (mode_adjust): Arg is an array, not a linked list.
3499 * modechange.c: Include stat-macros.h, xalloc.h.
3500 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
3501 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
3502 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
3503 Remove. This is now stat-macros.h's job.
3504 (talloc): Remove. All callers replaced by xalloc, so that
3505 our invokers don't have to worry about reporting memory failures.
3506 (make_node_op_equals): Remove.
3507 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3509 (struct mode_change): Moved here from modechange.h.
3510 (mode_append_entry): Remove.
3511 (mode_compile): Remove MASKED_OPS arg, since it encouraged
3512 apps to have incorrect behavior. Use simpler algorithm for head
3513 and tail. Don't futz with umask; that's now the job of mode_adjust.
3514 Detect more invalid usages rather than having somewhat-random behavior.
3515 Don't insert an "a=" action, as that leads to incorrect behavior.
3516 (mode_compile, mode_create_from_ref): Return NULL on error instead
3517 of an enum, since now there's only one way to have an error. All
3519 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
3520 at the correct time. Simplify calculation of "+u" and its ilk.
3521 Don't mishandle "+X".
3522 (mode_free): Remove "register" and localize decls.
3523 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
3524 (struct mode_change): Move to modechange.c; callers don't
3525 need to see this stuff.
3526 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
3527 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
3528 (mode_change, mode_adjust): Reflect the new signatures noted above.
3529 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
3530 that might redefine system include files.
3531 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
3532 (my_usleep): Use NULL rather than (void *) 0.
3533 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
3534 Use siginterrupt to specify that system calls should be interrupted.
3535 (rpl_nanosleep): Move initialization of suspended closer to call of
3537 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
3538 * readutmp.c: Likewise. Include signal.h, stdbool.h.
3539 (desirable_utmp_entry): New function.
3540 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
3541 using x2nrealloc, to simplify logic.
3542 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
3543 size calculation. Do not assume utmp file is a regular file.
3544 * readutmp.h (UT_PID): Moved here from ../src/who.c.
3545 (READ_UTMP_CHECK_PIDS): New constant.
3546 * save-cwd.c: Include unistd-safer.h.
3547 (save_cwd): Use fd_safer.
3548 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
3549 [!_LIBC] Include "stat-macros.h" instead.
3550 * unistd-safer.h (fd_safer): New decl.
3552 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
3554 * byteswap_.h: New file.
3556 2005-04-25 Albert Chin <china@thewrittenword.com>
3558 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
3561 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
3563 * getdate.y (zone): Allow relunit_snumber after tZONE, so
3564 that "UTC +1 second" continues to work. Problem reported
3566 (relunit_snumber): New rule.
3569 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
3571 * getdate.y (universal_time_zone_table): New constant.
3572 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
3573 universal_time_zone_table.
3574 (lookup_zone): Prefer universal_time_zone_table to
3575 local_time_zone_table, so that "GMT" time stamps are allowed in
3576 London during the summer. Problem reported by Ian Abbott.
3578 2005-04-12 Jim Meyering <jim@meyering.net>
3580 * human.c (humblock): Set *options even when returning due to
3581 xstrtoumax conversion failure. Thanks to a used-uninitialized
3584 2005-04-09 Jim Meyering <jim@meyering.net>
3586 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
3587 -Wuninitialized: initialize tm0.tm_year.
3589 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
3591 * getdate.y (parser_control): rels_seen is now a boolean, not a
3592 count, since there's no maximum. All uses changed.
3593 Add member dsts_seen.
3594 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
3596 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
3597 Use pc_rels_seen to decide whther a date is absolute.
3599 * getdate.y (number): Don't overwrite year.
3600 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
3603 2005-04-02 Simon Josefsson <jas@extundo.com>
3605 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
3606 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
3608 2005-03-27 Jim Meyering <jim@meyering.net>
3610 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
3612 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
3614 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
3615 "one's complement" -> "ones' complement" in comment, as per Knuth.
3616 "value of type" -> "type or expression" in comment.
3617 * mktime.c, strftime.c: Propagate intprops.h comment nits.
3619 2005-03-26 Jim Meyering <jim@meyering.net>
3622 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
3623 Correct typos: s/or/of/.
3625 2005-03-23 Jim Meyering <jim@meyering.net>
3627 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
3629 2005-03-21 Jim Meyering <jim@meyering.net>
3631 Changes imported from coreutils.
3633 * cycle-check.c: Don't include xalloc.h.
3635 * path-concat.c: Don't include assert.h.
3636 (path_concat): Remove assertion that would have triggered
3637 for ABASE starting with more than one slash.
3638 Reported by Andreas Schwab.
3640 * path-concat.c (path_concat): Set *BASE_IN_RESULT
3641 properly when ABASE is an absolute file name.
3642 Correct the description of this function.
3644 Add an assertion and a test driver.
3645 This fixes a bug introduced on 2004-07-02.
3646 Andreas Schwab reported the resulting failure of cp --parents:
3647 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
3649 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
3651 * strftime.c (my_strftime): If the underlying strftime returns 0
3652 (which shouldn't happen), generate nothing instead of returning 0
3653 immediately, so that nstrftime (NULL, ...) doesn't return 0.
3655 2005-03-16 Bruno Haible <bruno@clisp.org>
3657 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
3659 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
3661 * strftime.c (my_strftime): Prepend space to format so that we can
3662 reliably distinguish strftime failure from empty output on POSIX
3665 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
3667 * iconvme.c (SIZE_MAX): New macro, if not already defined.
3668 (iconv_string): Don't guess a size-zero buffer, as that might cause
3669 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
3670 result would be 'too large', where 'too large' is (heuristically)
3671 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
3672 overflow concerns. This will prevent some unwanted malloc failures
3673 when the inputs are very large.
3675 2005-03-15 Bruno Haible <bruno@clisp.org>
3677 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
3680 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
3683 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
3685 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
3687 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
3688 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
3690 * strtol.c: Likewise.
3692 2005-03-14 Simon Josefsson <jas@extundo.com>
3694 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
3697 2005-03-14 Jim Meyering <jim@meyering.net>
3699 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
3700 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
3701 to be nonzero so that we (and caller) can detect the difference
3702 between a valid zero-length expansion and an error return, even
3703 when the underlying strftime fails before writing anything into
3706 2005-03-10 Jim Meyering <jim@meyering.net>
3708 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
3709 so that this module works on systems without fchdir.
3711 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
3713 Factor int-properties macros into a single file, except for
3714 glibc-related files.
3715 * intprops.h: New file.
3716 * getloadavg.c: Include it instead of limits.h.
3717 (INT_STRLEN_BOUND): Remove.
3718 * human.c: Include intprops.h.
3719 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
3720 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
3721 * inttostr.h: Include intprops.h instead of limits.h.
3722 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
3723 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
3724 for consistency with intprops.h.
3725 (time_t_is_integer, twos_complement_arithmetic): Use them.
3726 * sig2str.h: Include <signal.h>, intprops.h.
3727 (INT_STRLEN_BOUND): Remove.
3728 * strftime.c (TYPE_SIGNED): Remove.
3729 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
3730 * strtol.c: Adjust comments to match intprops.h.
3731 * userspec.c: Include intprops.h.
3732 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
3733 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
3734 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
3735 instead of rolling our own expressions.
3736 * xstrtol.c: Include xstrtol.h first, to test interface.
3738 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
3740 (my_strftime): Do not mishandle years close to INT_MAX, by doing
3741 the right thing even if adding 1900 would overflow. Similarly
3742 for tm_mon + 1 and tm_yday + 1.
3743 Make %Y always equivalent to %C%y, and similarly for %G and %g.
3744 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
3745 (DO_SIGNED_NUMBER): New macro.
3746 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
3748 2005-03-07 Bruno Haible <bruno@clisp.org>
3750 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
3752 2005-03-03 Derek R. Price <derek@ximbiot.com>
3753 Bruno Haible <bruno@clisp.org>
3755 * pagealign_alloc.h: New file.
3756 * pagealign_alloc.c: New file.
3758 2005-01-28 Bruno Haible <bruno@clisp.org>
3760 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
3763 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
3765 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
3766 The workaround isn't strictly needed for POSIX conformance, and
3767 it's too much of a pain to configure and maintain. We'll ask
3768 people to fix their kernels instead.
3769 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
3770 (NANOSLEEP_BUG_WORKAROUND): Remove.
3771 (xnanosleep): Remove the workaround.
3773 2005-02-12 Bruno Haible <bruno@clisp.org>
3775 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
3777 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
3779 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
3780 * timespec.h (gettime): Return void, since it always
3781 succeeds now. All uses changed.
3782 * gettime.c (gettime) Likewise.
3783 [HAVE_NANOTIME]: Prefer nanotime.
3784 Assume gettimeofday succeeds, as POSIX requires.
3785 Assime time () succeeds, since other code already does.
3786 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
3787 (timespec_subtract): Remove.
3788 (NANOSLEEP_BUG_WORKAROUND): New constant.
3789 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
3790 things considerably. Use it only on GNU/Linux hosts, since the
3791 workaround shouldn't be needed elsewhere.
3793 2005-02-24 Bruno Haible <bruno@clisp.org>
3795 * gettext.h: Update from GNU gettext 0.14.2.
3797 2005-02-24 Bruno Haible <bruno@clisp.org>
3799 * localcharset.c: Update from GNU gettext 0.14.2.
3800 * config.charset: Update from GNU gettext 0.14.2.
3802 2005-02-22 Simon Josefsson <jas@extundo.com>
3804 * iconvme.h, iconvme.c: New files, from libc.
3806 2005-02-20 Neil Conway <neilc@samurai.com>
3808 * xgethostname.c (xgethostname): Check for ENOMEM, which is
3809 returned by OSX/Darwin if the specified buffer is not large
3810 enough for the hostname.
3812 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
3814 * memrchr.h: New file.
3815 * chdir-long.c: Include it.
3816 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
3817 Don't bother including stddef.h.
3819 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3821 * argp-help.c (__argp_help): Create a fake struct argp_state and
3822 pass it to _help, otherwise the latter coredumps trying to
3823 dereference state.root_argp.
3825 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
3827 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
3829 Include <sys/types.h>, for dev_t.
3830 (ME_DUMMY, ME_REMOTE): Move from here....
3831 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
3832 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
3834 Include mountlist.h first, to test the interface.
3836 2005-01-29 Bruno Haible <bruno@clisp.org>
3838 * progname.c (program_name): Initialize.
3839 Needed when linking statically on MacOS X.
3841 2005-01-28 Bruno Haible <bruno@clisp.org>
3843 * javacomp.sh.in: New file, from GNU gettext.
3844 * javacomp.h: New file, from GNU gettext.
3845 * javacomp.c: New file, from GNU gettext.
3847 2005-01-26 Bruno Haible <bruno@clisp.org>
3849 * javaexec.sh.in: New file, from GNU gettext.
3850 * javaexec.h: New file, from GNU gettext.
3851 * javaexec.c: New file, from GNU gettext.
3853 2005-01-26 Simon Josefsson <jas@extundo.com>
3855 * gai_strerror.c: Use GPL in header.
3857 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3859 * argp-help.c (hol_entry_help): Avoid using non-constant
3860 initializers for struct pentry_state.
3861 (__argp_error): Check return value of __asprintf
3862 (__argp_failure): Translate error message
3864 * argp-parse.c: Removed braces around the expansion of N_()
3866 2005-01-21 Jim Meyering <jim@meyering.net>
3868 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
3869 same value as for Solaris 9.
3871 * chdir-long.c (chdir_long): Rewrite to remove limitation on
3872 component length. This included changing the parameter to be
3873 of type `char *' rather than `char const *'.
3874 * chdir-long.h (chdir_long): Update prototype.
3876 * openat.c (fdopendir, fstatat): New functions.
3877 * openat.h: Include headers required for use of DIR and struct stat.
3878 [AT_SYMLINK_NOFOLLOW]: Define.
3879 (fdopendir, fstatat): Add prototypes.
3881 2005-01-21 Bruno Haible <bruno@clisp.org>
3883 * classpath.h: New file, from GNU gettext.
3884 * classpath.c: New file, from GNU gettext.
3886 2005-01-20 Simon Josefsson <jas@extundo.com>
3888 * version-etc-fsf.c: New file, with version_etc_copyright.
3889 * version-etc.c: Remove version_etc_copyright.
3890 * version-etc.h (version_etc_copyright): Use [] instead of * in
3891 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
3893 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
3895 * save-cwd.c (save_cwd): Remove code to support the case
3896 where fchdir is missing or flaky.
3898 2005-01-20 Simon Josefsson <jas@extundo.com>
3900 * base64.h (isbase64): Add.
3902 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
3903 using a unsigned prototype, don't inline.
3904 (base64_decode): Use it.
3906 2005-01-19 Bruno Haible <bruno@clisp.org>
3908 * sh-quote.h: New file, from GNU gettext.
3909 * sh-quote.c: New file, from GNU gettext.
3911 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
3913 Merge changes from coreutils, as described below in several
3914 changelogs dated today.
3916 * save-cwd.c: Include "save-cwd.h" before other include files.
3917 (O_DIRECTORY): Remove; not needed here, since "." must be
3918 a directory. All uses removed.
3919 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
3920 universal on Suns, and we also need to test for IRIX.
3921 Revamp code to use 'if' rather than '#if'.
3922 Avoid unnecessary comparison of cwd->desc to 0.
3924 * utimens.c (futimens): Robustify the previous patch, by checking
3925 for known valid error numbers rather than observed invalid ones.
3927 2005-01-18 Jim Meyering <jim@meyering.net>
3929 * version-etc.c (version_etc_copyright): Update copyright date.
3931 * utimens.c (futimens): Account for the fact that futimes
3932 can also fail with errno == ENOSYS or errno == ENOENT.
3933 Patch from Dmitry V. Levin.
3935 Change the name of the robust chdir function from chdir to chdir_long.
3936 * save-cwd.c: Include chdir-long.h rather than chdir.h.
3937 (restore_cwd): Use chdir_long, not chdir.
3938 * chdir-long.c: Renamed from chdir.c.
3939 * chdir-long.h: Renamed from chdir.h.
3940 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
3943 2005-01-18 Bob Proulx <bob@proulx.com>
3945 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
3946 offsetof() macro construct to avoid compile failure with native HP-UX
3947 11.0 ANSI C compiler.
3949 2005-01-06 Bruno Haible <bruno@clisp.org>
3951 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
3952 because stpncpy.m4 takes care of it.
3954 2004-01-24 Bruno Haible <bruno@clisp.org>
3956 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
3958 2003-10-09 Bruno Haible <bruno@clisp.org>
3960 * progreloc.c: Include xalloc.h instead of xmalloc.h.
3962 2005-01-06 Bruno Haible <bruno@clisp.org>
3964 * fwriteerror.h (fwriteerror): Change specification to include fclose.
3965 * fwriteerror.c: Include <stdbool.h>.
3966 (fwriteerror): At the end, close the file stream. Record whether
3967 stdout was already closed.
3969 2004-05-27 Bruno Haible <bruno@clisp.org>
3971 * execute.c (environ): Declare if needed.
3972 * pipe.c (environ): Likewise.
3973 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
3975 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
3977 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
3978 definitions to be after all include files, to avoid collisions.
3979 Problem reported by Bob Proulx.
3981 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
3983 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
3984 not needed. This removes a dependency on the gettext module.
3985 [defined _LIBC]: Do not include <libintl.h>; not needed.
3987 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
3989 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
3992 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
3994 * argp-parse.c: Include <stddef.h>.
3995 (alignof, alignto): New macros.
3996 (parser_init): Don't assume that void * is aligned sufficiently
3999 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4000 need to extend the stack.
4001 (YYINITDEPTH): New macro, so that the initial stack isn't overly
4004 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4006 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4008 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4010 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4011 Remove now-obsolete comment about AIX.
4012 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4013 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4014 (YYMAXDEPTH): New macro.
4016 2004-12-18 Bruno Haible <bruno@clisp.org>
4018 * fatal-signal.c (fatal_signals): Make non-const.
4019 (init_fatal_signals): New function.
4020 (uninstall_handlers, install_handlers): Ignore signals that were set to
4022 (at_fatal_signal): Call init_fatal_signals.
4023 (init_fatal_signal_set): Likewise. Ignore signals that were set to
4025 Reported by Paul Eggert.
4027 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
4029 * getdate.y (textint): New member "negative".
4030 (time_zone_hhmm): New function.
4031 Expect 14 shift-reduce conflicts, not 13.
4032 (o_colon_minutes): New rule.
4033 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4034 (yylex): Set the "negative" member of signed numbers.
4036 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
4038 Changes imported from coreutils.
4039 * hard-locale.c: Assume <locale.h> exists.
4041 (GLIBC_VERSION): New macro.
4042 (hard_locale): Assume setlocale exists.
4043 Rewrite to avoid #ifdef.
4044 Use strdup rather than malloc + strcpy.
4045 * human.c: Assume <locale.h> exists.
4046 (human_readable): Assume localeconv exists.
4048 2004-12-01 Jakub Jelinek <jakub@redhat.com>
4050 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4051 convert T2, not T. (Imported from libc.)
4053 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
4055 * getcwd.c (is_ENAMETOOLONG): New macro.
4056 (__getcwd.c): Don't restore errno; glibc doesn't.
4057 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4058 first, falling back to our code only if its results look suspicious.
4059 Ensure that the resulting buffer is only as large as necessary.
4061 * readutmp.c: Include readutmp.h first.
4062 Include <errno.h>, since readutmp.h no longer does that.
4063 * readutmp.h: Don't include <errno.h>,
4064 <sys/param.h>, <time.h>; not needed to establish interface.
4065 (errno): Remove decl.
4066 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4067 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4068 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4070 2004-11-28 Simon Josefsson <jas@extundo.com>
4072 * base64.h, base64.c: New file.
4074 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
4076 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4078 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
4080 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4081 HP's ANSI C compiler.
4082 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4083 Declaring int functions causes warnings on some modern systems and
4084 shouldn't be needed to compile on ancient ones.
4085 * same.c (MIN) [defined MIN]: Don't define, since it's already
4088 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4089 with the following changes.
4090 (__set_errno): Parenthesize properly.
4091 Include <stdbool.h>.
4092 (MIN, MAX, MATCHING_INO): New macros.
4093 (__getcwd): Define with prototype, not K&R form.
4094 Use heuristics to allocate default buffer on stack if possible.
4095 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4096 behavior, and to avoid the PATH_MAX limit when computing
4098 Use MATCHING_INO to compare inode number to file.
4099 Check for arithmetic overflow in size calculations.
4100 Fix bug in reallocation of dot array that caused getcwd to fail
4101 on directories nested deeper than 75.
4102 Be more careful about saving errno on error.
4103 Do not use realloc; use only free+malloc, as this is a bit
4104 more flexible and avoids a needless copy operation.
4105 Do not inspect st_dev and st_ino for symbolic links; POSIX
4106 doesn't specify the latter.
4107 Check for closedir errors.
4108 Avoid needless casts.
4109 Use "#ifdef weak_alias" around weak_alias, to be like other
4111 The following changes to getcwd.c have effect only when used in
4112 gnulib; they have no effect inside glibc proper.
4113 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4114 as alloca isn't used.
4115 (alloca, __alloca): Likewise.
4116 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4117 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4118 unconditionally, as gnulib assumes C89 or better.
4119 Do not include <sys/param.h>.
4120 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4121 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4123 (NULL) [!defined NULL]: Remove; we assume C89 or better.
4124 Include <dirent.h> in a way that is compatible with modern Autoconf.
4125 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4126 New macros, if not already defined.
4127 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4128 Use "_LIBC", not "defined _LIBC", for consistency.
4129 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4131 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4132 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
4133 * xgetcwd.c: David MacKenzie's old code was removed, so give
4134 credit only to Jim Meyering and adjust the copyright dates.
4135 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4136 <stdlib.h>, <unistd.h>, "pathmax.h".
4137 Instead, include "xgetcwd.h" (first) and "getcwd.h".
4138 (INITIAL_BUFFER_SIZE): Remove.
4139 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4141 2004-11-23 Jim Meyering <jim@meyering.net>
4143 * getopt_.h: Remove trailing blanks.
4145 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
4147 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4148 (futimens): New function, which uses futimes if available.
4149 (futimens, utimens): Support timespec==NULL, with same semantics
4150 as utime and utimens.
4151 * utimens.h (futimens): New decl.
4153 2004-11-23 Jim Meyering <jim@meyering.net>
4155 * __fpending.c: Add comment.
4157 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4159 * getopt_.h: Re-addition of __getopt_argv_const caused
4160 redefinition warnings. To avoid them, include the defines
4161 in `#if !defined __need_getopt ... #endif'. The only place
4162 where __getopt_argv_const is used is in definitions
4163 of getopt_long and getopt_long_only below, which are as well
4164 protected by `#ifndef __need_getopt'.
4165 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4166 __need_getopt after including <stdio.h> and <unistd.h> These
4167 headers might have defined it.
4169 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
4171 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4173 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4174 optopt): Use them instead of invoking ## directly; otherwise, the
4175 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4177 2004-11-19 Bruno Haible <bruno@clisp.org>
4179 * strtok_r.c: Move comments from here...
4180 * strtok_r.h: ... to here.
4182 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
4184 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4185 might fail. Problem reported by Yoann Vandoorselaere.
4186 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4187 that mishandle size_t overflow.
4189 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
4191 * canon-host.c: Include "strdup.h".
4192 (canon_host): Use getaddrinfo if available, so that IPv6 works.
4193 Use strdup instead of malloc/strcpy to duplicate strings.
4195 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4196 (human_space_before_unit): New constant.
4197 * human.c (human_readable): Support it.
4199 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4200 (xgetcwd): Set errno correctly when failing.
4201 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4202 the failure is actually due to a PATH_MAX problem.
4204 Further getopt changes to make it more likely that glibc will
4205 buy the changes back.
4206 * getopt.c (POSIXLY_CORRECT): New constant.
4207 (getopt): Use it, so to preserve glibc semantic
4208 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4209 when compiling for libc.
4210 * getopt_.h (__getopt_argv_const): Bring it back.
4211 (getopt_long, getopt_long_only): Use it.
4213 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4214 New arg POSIXLY_CORRECT. All callers changed.
4215 (getopt): Argv is now char * const *, as per standard.
4216 (_getopt_internal_r, _getopt_internal): Argv is now char **,
4217 not char *__getopt_argv_const *.
4218 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4219 _getopt_long_only_r): Likewise.
4220 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4221 * getopt_int.h (_getopt_internal, _getopt_internal_r,
4222 _getopt_long_r, _getopt_long_only_r): Likewise.
4223 * getopt_.h (__getopt_argv_const): Remove.
4224 (getopt): Argv is now char * const *, as per standard.
4226 * getdate.y (tORDINAL): New token.
4227 (day, relunit): Allow it for relative times.
4228 (relative_time_table): Use tORDINAL for ordinals.
4230 2004-11-15 Jim Meyering <jim@meyering.net>
4232 * closeout.c: Include "__fpending.h" once again.
4233 Include <stdbool.h>.
4234 (close_stdout): Don't fail just because stdout was closed initially,
4235 since some programs don't write to stdout in the normal course of
4236 operation (other than --version and --help), and we don't want this
4237 function to make e.g. `touch file >&-' fail.
4238 But do fail if it was closed and someone has tried to write to it.
4239 E.g., `printf foo >&-' must fail.
4241 2004-11-11 Simon Josefsson <jas@extundo.com>
4243 * strtok_r.h, strtok_r.c: New file.
4245 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
4247 * getopt_.h (__getopt_argv_const): New macro, to be used so that
4248 we can stop lying to compilers about the constness of argv when we
4249 are compiled outside glibc.
4250 (getopt, getopt_long, getopt_long_only): Use it.
4251 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4253 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4254 _getopt_long_only_r): Likewise.
4255 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4256 _getopt_long_only_r): Likewise.
4258 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4259 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4260 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4261 the other external symbols.
4262 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4263 declaration, since the above renaming now works around collisions.
4265 2004-11-11 Jim Meyering <jim@meyering.net>
4267 * linebreak.c: Remove trailing blanks.
4268 * alloca_.h: Likewise.
4269 * acosl.c: Likewise.
4270 * euidaccess.c: Likewise.
4271 * allocsa.h: Likewise.
4273 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
4275 * mktime.c (SHR): New macro, which is a portable
4276 substitute for >> that should work even on Crays.
4277 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4278 Problem reported by Mark D. Baushke in
4279 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4280 * getdate.y (SHR): Likewise.
4282 * strftime.c (SHR): Likewise.
4284 * quotearg.c (struct quoting_options): Use unsigned int for
4285 quote_these_too, so that right shifts are well defined. All uses
4288 2004-11-10 Simon Josefsson <jas@extundo.com>
4290 * getaddrinfo.h, getaddrinfo.c: New files.
4292 2004-11-10 Jim Meyering <jim@meyering.net>
4294 Ensure that no close failure goes unreported.
4295 * closeout.c (close_stdout): Always close stdout. I.e., don't
4296 return early when it seems there's nothing to flush.
4297 Don't include __fpending.h.
4299 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
4301 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4303 2004-11-05 Bruno Haible <bruno@clisp.org>
4305 * readlink.c: Include stddef.h, needed for size_t on Woe32.
4306 Reported by Mark D. Baushke <mdb@cvshome.org>.
4308 2004-11-04 Bruno Haible <bruno@clisp.org>
4310 2004-09-11 Bruno Haible <bruno@clisp.org>
4311 * allocsa.valgrind: New file.
4312 2004-02-06 Bruno Haible <bruno@clisp.org>
4313 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4314 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4315 Reported by Christopher Seip <chris.seip@hp.com>.
4317 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
4319 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4320 with errno == ERANGE if the buffer is too small.
4321 Problem reported by Mark D. Baushke.
4323 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
4325 * xreadlink.c (MAXSIZE): New macro.
4326 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
4327 size does not exceed MAXSIZE. Avoid cast.
4328 As suggested by Mark D. Baushke in
4329 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4330 if readlink fails with buffer size just under MAXSIZE, try again
4333 2004-11-02 Derek R. Price <derek@ximbiot.com>
4334 and Paul Eggert <eggert@cs.ucla.edu>
4336 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4337 (get_date): Overparenthesize to avoid GCC warning.
4339 2004-11-02 Bruno Haible <bruno@clisp.org>
4341 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4342 function returns void.
4344 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
4346 * getpass.c (fflush_unlocked, flockfile, funlockfile)
4347 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4350 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
4352 * getdate.y: Add support for TZ="foo" within a date string.
4353 Fix some bugs near time_t boundaries. Reject dates with
4354 out-of-range components, e.g., "Sept 31".
4355 Include <stdlib.h>, "setenv.h", "xalloc.h".
4356 (ISDIGIT_LOCALE): Remove; unused.
4357 Note that the TZ and time functions used here are not reentrant.
4358 (mktime_ok, get_tz): New functions.
4359 (TZBUFSIZE): New constant.
4360 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
4361 This requires that we sometimes generate our own TZ="XXX..." setting.
4363 2004-10-27 Derek R. Price <derek@ximbiot.com>
4365 * mktime.c (not_equal_tm): Remove redundant check.
4367 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
4369 * getdate.y: Use Bison 1.875 features, and some minor
4370 code cleanups. This change does not affect semantics.
4371 Don't include <stdlib.h>; no longer needed.
4372 Don't include unlocked-io.h; only the "#if TEST" code uses
4373 stdio, and performance isn't crucial there.
4374 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4375 Bison 1.875 features as described below.
4376 All uses of "PC." replaced by "pc->".
4377 (YYSTYPE): Add a forward declaration.
4378 (yylex, yyerror): Use full prototypes in forward decls.
4379 Use "%pure-parser" rather than obsolescent "%pure_parser".
4380 Use %parse-param and %lex-param instead of obsolescent
4381 YYPARSE_PARAM and YYLEX_PARAM.
4382 (meridian_table, month_and_day_table, time_units_table,
4383 relative_time_table, time_zone_table, military_table,
4384 lookup_zone, lookup_word, get_date):
4385 Use NULL instead of 0 where appropriate.
4386 (to_hour): Avoid abort (), to avoid a dependency on
4388 (yyerror, yylex): Now accepts parser_control * arg.
4389 (main) [TEST]: Use '\0' rather than 0 for char.
4391 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
4393 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4394 It's now the caller's responsibility to handle the case where
4395 !HAVE_GETPAGESIZE && !defined getpagesize.
4397 * mktime.c (leapyear): Arg is long int, not int.
4399 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
4401 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4403 2004-10-12 Simon Josefsson <jas@extundo.com>
4405 * getpass.c (fflush_unlocked, flockfile, funlockfile)
4406 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4409 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
4411 * vsnprintf.h: New file.
4412 * vsnprintf.c: New file.
4414 2004-10-07 Bruno Haible <bruno@clisp.org>
4416 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4417 into the provided buffer.
4419 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
4421 * diacrit.c, diacrit.h: Add GPL notice.
4423 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4424 * atanl.c (atanl): Keep the code as similar to glibc as possible.
4425 * logl.c (logl): Keep the code as similar to glibc as possible.
4426 This avoids a potential constant-folding bug.
4428 2004-10-05 Bruno Haible <bruno@clisp.org>
4430 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4432 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
4434 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
4435 * xmalloc.c (xmemdup): Likewise.
4436 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4437 XFREE): Remove these long-obsolescent macros.
4438 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4439 * xstrdup.c: Remove.
4441 * regex.c (re_comp): Cast gettext return value to char *,
4442 Problem reported by Martin Neitzel via Mark D. Baushke.
4444 2004-10-04 Simon Josefsson <jas@extundo.com>
4446 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4447 '#ifdef USE_UNLOCKED_IO'.
4449 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
4451 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4452 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4453 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4454 regex.c, sha1.c, version-etc.c, yesno.c:
4455 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4456 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
4457 the includer's responsibility.
4459 Sync from coreutils.
4461 * modechange.c (mode_compile): Don't decrement a pointer that
4462 points to the start of a string, as the C Standard says the
4463 resulting behavior is undefined.
4465 * backupfile.h (enum backuptype): Rename none -> no_backups,
4466 simple -> simple_backups, numbered_existing ->
4467 numbered_existing_backups, numbered -> numbered_backups
4468 to avoid shadowing problems. All uses changed.
4469 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
4470 * backupfile.c (check_extension, numbered_backup):
4471 Rename locals to avoid shadowing 'basename'.
4472 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
4475 * .cppi-disable: Add getopt_.h, getopt_int.h.
4476 * .cvsignore: Add getopt.h.
4478 2004-10-04 Simon Josefsson <jas@extundo.com>
4480 * memmem.h: New file.
4481 * memmem.c: New file, taken from glibc.
4483 2004-10-02 Jim Meyering <jim@meyering.net>
4485 * dirfd.h, getpagesize.h: Add copyright notice.
4487 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
4489 * snprintf.c: Remove comments as to why each header is needed.
4491 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
4493 * strsep.h: New file.
4494 * strsep.c: New file.
4496 2004-10-01 Simon Josefsson <jas@extundo.com>
4498 * snprintf.c (snprintf): Handle size==0.
4500 2004-10-01 Simon Josefsson <jas@extundo.com>
4501 Bruno Haible <bruno@clisp.org>
4503 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
4504 (snprintf): Declare 'args'.
4506 2004-09-30 Simon Josefsson <jas@extundo.com>
4508 * snprintf.h, snprintf.c: New files.
4510 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
4512 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
4513 (hol_entry_help): Never translate an empty string.
4514 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
4515 * argp.h (OPTION_NO_TRANS): New option.
4517 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
4519 * xvasprintf.c: Include xalloc.h.
4520 (xvasprintf): Use xalloc_die, not xmalloc_die.
4522 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
4524 * dummy.c: Change copyright notice to FSF, and license to GPL.
4526 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
4528 * argp-pvh.c (argp_program_version_hook): Provide initial value.
4529 Problem reported by Bruno Haible in:
4530 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
4532 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
4534 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
4535 in case some system header has #define'd it. Problem reported by
4536 Soeren D. Schulze in
4537 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
4539 2004-09-08 Bruno Haible <bruno@clisp.org>
4541 * stdint_.h: New file, taken from GNU clisp.
4543 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
4545 * xvasprintf.h: New file.
4546 * xvasprintf.c: New file.
4547 * xasprintf.c: New file.
4549 2004-09-08 Bruno Haible <bruno@clisp.org>
4551 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
4553 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
4555 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
4557 Import from coreutils.
4558 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
4559 strings on unbounded length. alloca's performance benefits aren't
4560 that important here.
4562 (parse_with_separator): New function, with most of the internals
4563 of the old parse_user_spec. Allow user to omit both user and group,
4564 for compatibility with FreeBSD.
4565 Clone only the user name, not the entire spec.
4566 Do not set *uid, *gid unless entirely successful.
4567 Avoid memory leak in some failing cases.
4568 Fix regression for USER.GROUP reported by Dmitry V. Levin in
4569 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
4570 (parse_user_spec): Rewrite to use parse_with_separator.
4572 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
4574 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
4575 its complicated substitute.
4576 * argp-help.c: Include <errno.h>, for program_invocation_short_name
4577 and program_invocation_name.
4578 (__argp_basename) [!_LIBC]: Remove; the only use was
4579 replaced by its body.
4580 (__argp_short_program_name): Change condition from
4581 !defined __argp_short_program_name to
4582 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
4583 to match argp-namefrob.h.
4584 (__argp_failure): Don't assume strerror_r returns char *.
4585 * argp-parse.c (N_): Define unconditionally.
4586 (argp_default_options): Fill out initializers with 0 to avoid
4589 2004-08-12 Simon Josefsson <jas@extundo.com>
4591 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
4592 * getopt_.h: Renamed from getopt.h.
4594 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
4596 Merge from coreutils.
4598 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
4599 wmemchr or wmemcpy. Problem reported by Robert Dahlem
4600 for Reliant Unix 5.43.
4602 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
4603 (union fooround): Use uintmax_t, not long int.
4604 The rest is a merge from libc:
4605 [defined _LIBC]: Include <shlib-compat.h>.
4606 (_obstack) [defined _LIBC]: Remove after 2.3.4.
4608 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
4610 * strverscmp.c: Convert to UTF-8.
4612 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
4614 * obstack.h (obstack_empty_p):
4615 Don't assume that chunk->contents is suitably aligned.
4616 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
4617 Likewise. Problem reported by Benno in
4618 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
4620 * chown.c (rpl_chown): Work even if the file is writeable but not
4621 readable. This could be improved further but it'd take some work.
4623 2004-08-08 Simon Josefsson <jas@extundo.com>
4625 * xgethostname.c: Don't include error.h (not used).
4628 * getpass.c: Include getpass.h first.
4630 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
4632 * xalloc-die.c: New files.
4633 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
4635 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
4636 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
4637 (_, N_, xalloc_die): Move to xalloc-die.c.
4638 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
4639 so that we needn't mess with xalloc_msg_memory_exhausted.
4641 * sha1.h: Renamed from sha.h.
4642 (SHA1_H): Renamed from _SHA_H.
4643 (sha1_ctx): Renamed from sha_ctx.
4644 (sha1_init_ctx): Renamed from sha_init_ctx.
4645 (sha1_process_block): Renamed from sha_process_block.
4646 (sha1_process_bytes): Renamed from sha_process_bytes.
4647 (sha1_finish_ctx): Renamed from sha_finish_ctx.
4648 (sha1_read_ctx): Renamed from sha_read_ctx.
4649 (sha1_stream): Renamed from sha_stream.
4650 (sha1_buffer): Renamed from sha_buffer.
4651 * sha1.c: Likewise; renamed from sha.c.
4652 Do not include <sys/types.h>.
4653 Include <stddef.h> rather than <stdlib.h>.
4655 2004-08-08 Bruno Haible <bruno@clisp.org>
4657 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
4658 FILESYSTEM_PREFIX_LEN.
4659 * progreloc.c: Likewise.
4660 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
4662 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
4665 * argp-help.c (make_hol, hol_append): Don't assume that
4666 SIZE_MAX is a valid preprocessor constant.
4667 (__argp_basename): Change from "#ifndef _LIBC"
4668 to "#ifndef __argp_short_program_name", so that
4669 we don't compile these functions for tar.
4671 More merges from coreutils.
4672 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
4673 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
4675 * addext.c: Remove; no longer needed.
4676 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
4677 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
4678 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
4679 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
4680 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
4681 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
4682 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
4683 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
4684 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
4685 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
4686 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
4687 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
4688 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
4689 Import changes from coreutils.
4691 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
4693 Merge from coreutils.
4695 * .gdb-history: Remove; this doesn't belong here.
4697 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
4698 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
4699 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
4701 * dirname.h: Include <stdbool.h>.
4702 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
4703 for consistency with POSIX terminology. All uses changed.
4704 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
4705 (strip_trailing_slashes): Use bool for booleans.
4706 * stripslash.c (strip_trailing_slashes): Likewise.
4708 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
4709 sometimes returns a positive errno value even when it succeeds.
4710 (print_errno_message) [!LIBC]: Fall back on strerror if
4713 * path-concat.c (mempcpy): Don't define if a system header defines it.
4714 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
4715 (longest_relative_suffix): New function.
4716 (path_concat): Use it. Assume first argument is not NULL.
4717 Port to DOS. Omit redundant separators.
4718 Report an error instead of returning NULL.
4719 Use mempcpy instead of memcpy.
4720 (xpath_concat): Remove: not declared or used.
4722 * same.h: Include <stdbool.h>
4723 (same_name): Return bool, not int.
4724 * same.c (same_name): Likewise.
4725 (errno): Don't declare; we assume C89 or better now.
4727 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
4728 if not already defined.
4730 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
4731 * dup-safer.c (errno): Likewise.
4733 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
4735 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
4738 2004-08-03 Simon Josefsson <jas@extundo.com>
4740 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
4741 * progname.h: Don't include stdbool.h.
4743 2004-08-02 Simon Josefsson <jas@extundo.com>
4745 * getsubopt.h: New file, with comments from Bruno Haible.
4746 * getsubopt.c: New file, from glibc, but slightly modified based on
4747 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
4749 2004-08-01 Simon Josefsson <jas@extundo.com>
4751 * xgetdomainname.c: Include stdlib.h, for free().
4753 2004-07-16 Simon Josefsson <jas@extundo.com>
4755 * dummy.c: New file.
4757 2004-07-16 Bruno Haible <bruno@clisp.org>
4759 * backupfile.h: Add extern "C" for C++.
4760 * closeout.h: Likewise.
4761 * copy-file.h: Likewise.
4762 * findprog.h: Likewise.
4763 * full-write.h: Likewise.
4764 * pathname.h: Likewise.
4765 * progname.h: Likewise.
4766 * stpcpy.h: Likewise.
4767 * stpncpy.h: Likewise.
4768 * strcase.h: Likewise.
4769 * strstr.h: Likewise.
4770 * xalloc.h: Likewise.
4772 * mbswidth.h: Add extern "C" for C++.
4773 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
4775 2004-07-09 Simon Josefsson <jas@extundo.com>
4777 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
4778 failed without this.)
4780 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
4782 * fchown-stub.c: New file.
4784 2004-06-24 Jim Meyering <jim@meyering.net>
4786 * obstack.h (obstack_base): Cast to (void *), per documentation.
4788 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
4790 * argz.c, argz_.h: New files, which are autoupdated from libtool.
4792 2004-06-01 Jim Meyering <jim@meyering.net>
4794 * calloc.c: New file.
4796 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
4798 * getdate.y (yylex): Allow space between sign and number.
4799 Problem reported by Dan Jacobson.
4801 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
4802 and Jim Meyering <jim@meyering.net>
4804 Merge from coreutils CVS.
4806 * stat-macros.h: New file, with contents from file-type.h
4807 and coreutils' system.h.
4808 * file-type.c: Include "stat-macros.h".
4809 * file-type.h (file_type): Move all macro definitions to new file,
4812 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
4813 Wrap old code with this conditional.
4814 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
4815 function that does not dereference symlinks.
4816 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
4818 * xreadlink.c: Include xreadlink.h first, to catch .h file
4819 dependency problems.
4820 (xreadlink): Accept new arg SIZE, for efficiency.
4821 All decls and uses changed.
4822 * xreadlink.h: Include <stddef.h>, for size_t.
4824 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
4825 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
4827 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
4829 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
4831 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
4832 macros to be defined.
4833 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
4834 the allocator returns NULL because the requested size is zero.
4836 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
4838 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
4839 var. Add comment explaining why libc still defines it. This
4840 merges the following patch from glibc:
4841 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
4843 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
4845 * obstack.c (_obstack): Remove unused variable. It hasn't been
4846 present in glibc since revision 1.1 of this file.
4847 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
4848 obstack_alignment_mask, obstack_alloc, obstack_base,
4849 obstack_blank, obstack_blank_fast, obstack_chunk_size,
4850 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
4851 obstack_grow0, obstack_init, obstack_int_grow,
4852 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
4853 obstack_next_free, obstack_object_size, obstack_ptr_grow,
4854 obstack_ptr_grow_fast, obstack_room): Remove declarations of
4855 nonexistent functions.
4857 2004-05-17 Derek R. Price <derek@ximbiot.com>
4858 Paul Eggert <eggert@cs.ucla.edu>
4860 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
4862 2004-05-14 Bruno Haible <bruno@clisp.org>
4864 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
4865 that consists of a '.' followed by an empty digit string.
4866 Patch by Tor Lillqvist <tml@iki.fi>.
4868 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
4870 Port obstack to the AS/400, where pointers are 16 bytes wide and
4871 you cannot cast an integer to a valid pointer. This patch is
4872 currently waiting to be integrated into glibc; see
4873 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
4875 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
4876 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
4877 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
4878 (struct obstack): temp member is now a union of a pointer and
4879 an integer, instead of an integer. All integer uses changed.
4880 This does not affect the physical layout of struct obstack,
4881 except on hosts (like the AS/400) where the size or alignment of
4882 void * is greater than that of ptrdiff_t.
4883 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
4884 __STDC__)]: Store temporary in pointer member of union, not
4886 * obstack.c: Include <stddef.h>, for offsetof.
4887 (struct fooalign): Remove; it doesn't need a name.
4888 (union fooround): Change double to long double, and add void *.
4889 (DEFAULT_ALIGNMENT): Use offsetof to compute.
4890 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
4891 not a macro. Hence the values are always int; so remove all
4892 casts-to-int in uses.
4894 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
4895 Derek Price <derek@ximbiot.com>
4897 * alloca.c: Include <alloca.h>, to get our interface.
4898 * alloca_.h: Use __alloca on AIX, so that we don't have to
4899 include <alloca.h> first. Use C89 prototype for alloca; this
4900 requires including <stddef.h> for size_t. Use extern "C" if C++.
4901 Use #elif for simplicity, since we can assume C89 now.
4902 Don't try to source the system alloca.h since it will not be found
4903 and to prevent recursively including its replacement.
4904 * fnmatch.c: Include <alloca.h> instead of opencoding.
4905 * regex.c: Likewise.
4907 2004-05-16 Derek Price <derek@ximbiot.com>
4908 Paul Eggert <eggert@cs.ucla.edu>
4910 getline cleanup. This changes the getndelim2 API: both order of
4911 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
4914 * getline.c: Don't include stddef.h or stdio.h, since our
4915 interface does that.
4916 (getline): Always use getdelim, so that we don't have two
4917 copies of this code.
4918 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
4920 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
4921 (GETNDELIM2_MAXIMUM): New macro.
4922 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
4923 instead of the old practice of delim2==0. All callers changed.
4924 Return -1 on overflow, instead of returning junk.
4925 Do not set *linesize unless allocation succeeds.
4926 * getndelim2.h: Do not include stddef.h; no longer needed, now
4927 that we include sys/types.h.
4928 * getnline.h: Likewise.
4929 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
4930 (getndelim2): Reorder arguments.
4931 * getnline.c (getnline, getndelim):
4932 Don't discard the NMAX argument.
4933 (getnline): Invoke getndelim, to avoid code duplication.
4934 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
4935 of (size_t) -1 by callers of the getnline family.
4937 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
4939 * nanosleep.c (suspended): Change its type from int to
4940 sig_atomic_t volatile.
4941 (first_call): Make it private to rpl_nanosleep, and have it
4942 be zero initially as that's a bit faster.
4943 (my_usleep): Round up fractional times instead of truncating them,
4944 as this is the usual meaning for 'sleep'.
4946 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
4948 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
4949 (ENOSYS): Define if not defined.
4950 (settime): Fall back on stime if it exists and settimeofday fails.
4951 But don't bother with fallbacks if a method fails with errno == EPERM.
4953 2004-05-11 Jim Meyering <jim@meyering.net>
4955 Prior to this change, the save_cwd caller required read access to the
4956 current directory on most systems (ones with the fchdir function).
4958 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
4959 fails, try write-only, and finally, resort to using xgetcwd.
4961 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
4963 * obstack.c, obstack.h: Import changes from libc.
4965 2004-04-28 Bruno Haible <bruno@clisp.org>
4967 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
4968 implicitly appends .exe to executables.
4969 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
4970 accepts Windows pathnames.
4971 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
4972 Cygwin like Windows, since it now accepts Windows pathnames.
4973 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
4974 Cygwin like Windows, since it now accepts Windows pathnames.
4975 Reported by Derek Robert Price <derek@ximbiot.com>.
4977 2004-04-20 Jim Meyering <jim@meyering.net>
4979 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
4981 2004-04-20 Jim Meyering <jim@meyering.net>
4982 Bruno Haible <bruno@clisp.org>
4984 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
4985 memory when realloc fails.
4987 2004-04-18 Jim Meyering <jim@meyering.net>
4989 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
4990 don't leak memory and do call END_UTMP_ENT.
4992 2004-04-11 Paul Eggert <eggert@twinsun.com>
4994 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
4995 (CHAR_BIT): Remove, since we assume C89.
4996 Include <stdint.h> if available, as per current Autoconf CVS advice.
4998 2004-03-30 Paul Eggert <eggert@twinsun.com>
5000 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5001 not bool, to be more consistent with Unix conventions.
5002 Suggested by Bruno Haible.
5004 Merge from coreutils.
5006 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5009 * getdate.h: Include stdbool.h, and timespec.h instead of
5010 the usual <time.h> dance.
5011 (get_date): Change signature to support fractional time stamps.
5012 All callers changed.
5013 * getdate.y: Include "getdate.h" first, as we can now
5014 assume C89 and don't need to worry about 'const'.
5015 Similarly, include "unlocked-io.h" near start, not in middle.
5017 (textint.value): Use long int rather than int.
5018 (textint.digits): Use size_t rather than int.
5019 (BILLION, LOG10_BILLION): New constants.
5020 (parser_control): New member rel_ns. Members day_ordinal,
5021 time_zone, month, day, hour, minutes, rel_year, rel_month,
5022 rel_day, rel_hour, rel_minutes, rel_seconds
5023 are now long int, not int. Member seconds is now struct timespec,
5024 not int. New member timespec_seen. Members dates_seen, days_seen,
5025 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5027 (%union.intval): Now long int, not int.
5028 New member timespec.
5029 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5030 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5031 (spec): Now is a timespec or an item list.
5032 (timespec, items): New nonterminals.
5033 (time, rel, relunit, number, get_date):
5034 Add support for fractional seconds.
5035 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5036 (gmtime, localtime, mktime): Remove decls; not needed with C89.
5037 (to_hour): First arg is now long int, not int.
5038 (to_year): Returns long int, not int.
5039 Don't treat year -70 like 70.
5040 (tm_diff): Returns long int, not int.
5041 (lookup_word): Use bool instead of int when appropriate.
5042 (yylex): Use size_t for count, not int.
5043 Detect overflow when parsing large integer constants.
5044 Add support for fractions.
5045 (get_date): Make pointers 'const' if possible.
5046 Use more-portable code to detect integer overflow.
5047 (main) [TEST]: Adjust to above changes. Test for localtime failure.
5048 Don't use ctime; it's not reliable if the year has >4 digits.
5050 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5051 This is for compatibility with BSD.
5053 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5054 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5055 From coreutils' system.h.
5057 * userspec.c: Don't include "posixver.h".
5058 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5059 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5060 compatible extension. Simplify code by removing a boolean int
5061 that was always nonzero if a string was nonnull.
5063 2004-03-30 Jim Meyering <jim@meyering.net>
5065 Merge from coreutils.
5067 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5069 * readtokens.c (readtoken): Don't leak 64 bytes when reading
5070 an empty input stream.
5072 * readtokens.c: Include <stdbool.h>.
5073 (readtoken): Use `size_t' rather than int/long.
5074 All callers adjusted.
5075 Use `bool' rather than `int' where appropriate.
5076 Use memset rather than an explicit loop.
5077 Use x2nrealloc rather than xrealloc.
5078 Allow the use of `\0' as a delimiter.
5079 (readtokens): Likewise.
5080 * readtokens.h (readtoken, readtokens): Update prototypes.
5082 2004-03-30 Bruno Haible <bruno@clisp.org>
5084 * getloadavg.c (getloadavg): Don't assume setlocale returns
5087 2004-03-29 Paul Eggert <eggert@twinsun.com>
5089 Merge changes to getloadavg.c from coreutils and Emacs.
5091 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5092 Define to an expression, not to the empty string.
5093 Include cloexec.h and xalloc.h.
5094 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5095 Use set_cloexec_flag rather than rolling our own.
5096 * cloexec.c, cloexec.h: New files.
5098 2004-03-18 Paul Eggert <eggert@twinsun.com>
5100 * getopt.h: Sync with libc CVS.
5102 2004-03-18 Paul Eggert <eggert@twinsun.com>
5103 Bruno Haible <bruno@clisp.org>
5105 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5106 not on all platforms that have <wchar.h>.
5107 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5109 2004-03-09 Paul Eggert <eggert@twinsun.com>
5111 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5113 * getopt_int.h: New file, also synced from libc.
5115 2004-03-07 Paul Eggert <eggert@twinsun.com>
5117 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
5118 '#if' expressions. Unlike the code it replaces, it does not
5119 depend on (defined _SC_PAGESIZE). However, it does depend on
5120 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5121 first reported by Jason Andrade in
5122 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5124 2004-01-18 Simon Josefsson <jas@extundo.com>
5126 * strdup.h: New file.
5127 * strdup.c: Include it.
5128 * path-concat.c: Include strdup.h. Drop strdup declaration.
5129 * userspec.c: Include strdup.h. Drop strdup declaration.
5131 2004-02-06 Karl Berry <karl@gnu.org>
5133 * config.charset: update from gettext 0.14.1.
5135 2004-02-05 Paul Eggert <eggert@twinsun.com>
5137 Add comments and code, prompted by suggestions from Bruno Haible
5139 * quotearg.h (quotearg_alloc): New decl. Improve the comments
5140 describing the enum quoting_style values.
5141 * quotearg.c (quotearg_alloc): New function.
5142 (quotearg_buffer_restyled): Treat lone { and } as special.
5143 Treat = as special. Work around bug with older shells
5144 that "see" a '\' that is really the 2nd byte of a multibyte char.
5145 Quote empty string with shell_quoting_style.
5147 2004-02-03 Bruno Haible <bruno@clisp.org>
5149 * pipe.h: New file, from GNU gettext.
5150 * pipe.c: New file, from GNU gettext.
5152 2004-01-27 Bruno Haible <bruno@clisp.org>
5154 * execute.h: New file, from GNU gettext.
5155 * execute.c: New file, from GNU gettext.
5156 * w32spawn.h: New file, from GNU gettext.
5158 2004-01-23 Paul Eggert <eggert@twinsun.com>
5160 Exit-status fix from coreutils.
5162 Use exit_failure consistently in place of EXIT_FAILURE,
5163 so that program exit statuses are consistent on failure.
5165 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5166 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5167 * argmatch.h: Comment fix to match the above.
5168 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5169 Now a macro referring to exit_failure, instead of a separate
5170 variable. Include "exitfail.h" to get it.
5171 * xstrtol.h: Include "exitfail.h".
5172 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5174 * long-options.c (parse_long_options): Use prototype
5175 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
5178 2004-01-21 Jim Meyering <jim@meyering.net>
5180 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5181 so as not to conflict with a different-sized __mktime_internal
5182 function in GNU libc.
5183 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5184 Problem building statically-linked `ls' reported by Michael Brunnbauer.
5186 2004-01-18 Paul Eggert <eggert@twinsun.com>
5188 Merge from diffutils.
5190 * file-type.c (file_type): Add typed memory objects.
5191 * file-type.h (S_TYPEISTMO): New macro.
5193 * c-stack.h (c_stack_action): Remove argv argument.
5194 * c-stack.c (c_stack_action): Likewise. All uses changed.
5195 (die): Don't calculate message unless segv_action returns.
5196 (get_stack_location, min_address_from_argv, max_address_from_argv,
5197 volatile stack_base, volatile_stack_size): Remove.
5198 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5199 that every segmentation violation is a stack overflow. (Ouch!)
5200 See Debian bug 136249 (still outstanding) for more info about why
5201 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5203 2003-11-30 Bruno Haible <bruno@clisp.org>
5205 Safer stack allocation.
5206 * setenv.c: Include allocsa.h.
5207 (alloca): Remove fallback definition.
5208 (freea): Remove macro.
5209 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5212 2003-10-17 Bruno Haible <bruno@clisp.org>
5214 * binary-io.h: Avoid warnings on Cygwin.
5216 2003-12-28 Bruno Haible <bruno@clisp.org>
5218 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5219 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5221 2003-11-28 Bruno Haible <bruno@clisp.org>
5223 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5225 2003-11-27 Bruno Haible <bruno@clisp.org>
5227 * wait-process.c: On Windows, include windows.h. Needed on mingw.
5229 2003-11-17 Bruno Haible <bruno@clisp.org>
5231 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5233 2003-11-24 Bruno Haible <bruno@clisp.org>
5235 * xallocsa.h: New file, from GNU gettext.
5236 * xallocsa.c: New file, from GNU gettext.
5238 2003-11-24 Bruno Haible <bruno@clisp.org>
5240 * allocsa.h: New file, from GNU gettext.
5241 * allocsa.c: New file, from GNU gettext.
5243 2003-11-24 Bruno Haible <bruno@clisp.org>
5245 * eealloc.h: New file.
5247 2004-01-15 Jim Meyering <jim@meyering.net>
5249 Merge from coreutils.
5251 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
5252 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
5253 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5255 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5256 optional configure-time default.
5258 * version-etc.c (version_etc_copyright): Update copyright date.
5260 * xreadlink.c (xreadlink): Correct outdated comment.
5262 2004-01-15 Paul Eggert <eggert@twinsun.com>
5264 Merge from coreutils.
5266 * posixver.c: Include posixver.h.
5268 * same.c: Include <stdbool.h>, <limits.h>.
5269 (_POSIX_NAME_MAX): Define if not defined.
5271 (same_name): If file names are silently truncated, report
5272 that the file names are the same if they are the same after
5273 the silent truncation.
5275 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5276 conversion function.
5277 * xstrtod.c (xstrtod): Likewise. All callers changed to
5278 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
5281 2004-01-14 Paul Eggert <eggert@twinsun.com>
5283 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5284 with like-named macro in fnmatch.c.
5285 (EXT): Use an internal constant instead.
5287 Merge fnmatch patches from glibc.
5288 * fnmatch.c (mbsinit): Remove define.
5289 Add libc_hidden_ver (__fnmatch, fnmatch).
5290 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5291 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5293 2003-12-14 Karl Berry <karl@gnu.org>
5295 * config.charset: update from gettext-runtime.
5297 2003-12-03 Paul Eggert <eggert@twinsun.com>
5299 * getgroups.c (getgroups): xmalloc takes one argument, not two.
5300 Bug reported by Alfred M. Szmidt.
5302 2003-11-29 Karl Berry <karl@gnu.org>
5304 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5306 2003-11-23 Paul Eggert <eggert@twinsun.com>
5307 Bruno Haible <bruno@clisp.org>
5309 * printf-parse.h: Don't include sys/types.h.
5310 (ARG_NONE): New macro.
5311 (char_directive): Change type of *arg_index fields to size_t.
5312 * printf-parse.c: Don't include sys/types.h.
5313 (SSIZE_MAX): Remove macro.
5314 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5315 Remove unnecessary overflow check.
5316 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5319 2003-11-24 Paul Eggert <eggert@twinsun.com>
5321 * alloca.c: Remove dependency on xalloc module.
5322 (xalloc_die): Remove.
5323 (memory_full) [!defined emacs]: New macro.
5324 [!defined emacs]: Don't include xalloc.h.
5325 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5326 address arithmetic overflows. Change datatypes a bit to avoid
5329 2003-11-22 Jim Meyering <jim@meyering.net>
5331 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5333 2003-11-17 Bruno Haible <bruno@clisp.org>
5335 * vasnprintf.c (alloca): Remove fallback definition.
5336 (freea): Remove definition.
5337 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5338 Reported by Paul Eggert.
5340 2003-11-17 Jim Meyering <jim@meyering.net>
5342 On systems without utime and without a utimes function capable of
5343 dealing with a NULL struct utimbuf* argument, this utime replacement
5344 could -- in unusual circumstances -- leak a file descriptor.
5345 * utime.c: Include <unistd.h> and <errno.h>.
5346 (utime_null): Be sure to close `fd' and to preserve errno.
5347 Reported by Geoff Collyer via Arnold Robbins.
5349 2003-11-16 Paul Eggert <eggert@twinsun.com>
5350 Bruno Haible <bruno@clisp.org>
5352 Protect against address arithmetic overflow.
5353 * printf-args.h: Include stddef.h.
5354 (arguments): Change type of field 'count' to size_t.
5355 * printf-args.c (printf_fetchargs): Use size_t instead of
5356 'unsigned int' where appropriate.
5357 * printf-parse.h: Include sys/types.h.
5358 (char_directive): Change type of *arg_index fields to ssize_t.
5359 (char_directives): Change type of fields 'count', max_*_length to
5361 * printf-parse.c: Include sys/types.h and xsize.h.
5362 (SSIZE_MAX): Define fallback value.
5363 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5364 instead of 'int' where appropriate. Check a_allocated, d_allocated
5365 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5366 * vasnprintf.c: Include xsize.h.
5367 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5368 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5369 overflow. Avoid wraparound when converting a width or precision from
5372 2003-11-16 Bruno Haible <bruno@clisp.org>
5374 Update from GNU gettext.
5375 * printf-parse.c: Generalize to it can be compiled for wide strings.
5376 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5377 * vasnprintf.c: Generalize to it can be compiled for wide strings.
5378 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5379 SNPRINTF): New macros.
5380 Don't include <alloca.h> if the file is used inside libintl.
5381 (local_wcslen): New function, for Solaris 2.5.1.
5382 (VASNPRINTF): Use it instead of wcslen.
5384 2003-11-16 Bruno Haible <bruno@clisp.org>
5386 * xsize.h (xmax): New function.
5387 (xsum, xsum3, xsum4): Declare as "pure" functions.
5389 2003-11-12 Paul Eggert <eggert@twinsun.com>
5391 * xalloc.h: Do not include <limits.h> or <stdint.h>.
5392 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5393 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
5394 heuristic is just as accurate as far as we know, and it removes a
5395 dependency on size_max.m4 and ptrdiff_max.m4.
5397 2003-11-12 Paul Eggert <eggert@twinsun.com>
5399 * xstrtol.c (__xstrtol): Remove "break" immediately after
5400 "return", to pacify some unknown compiler. Problem reported
5403 2003-11-11 Bruno Haible <bruno@clisp.org>
5405 * xsize.h (SIZE_MAX): Remove fallback definition.
5406 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5409 2003-11-10 Paul Eggert <eggert@twinsun.com>
5411 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5412 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5413 rejected some allocations of exactly SIZE_MAX - 2 bytes.
5415 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5416 not (size_t) -1, since it's defined here.
5418 2003-11-06 Paul Eggert <eggert@twinsun.com>
5420 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5421 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5422 Reject sizes of exactly SIZE_MAX bytes.
5423 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5424 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5426 2003-11-05 Bruno Haible <bruno@clisp.org>
5428 * xsize.h: Include limits.h, to avoid a possible collision with
5429 SIZE_MAX defined in <limits.h> on Solaris.
5431 2003-11-04 Bruno Haible <bruno@clisp.org>
5433 * xsize.h: New file.
5434 * linebreak.c: Include xsize.h.
5435 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5436 argument for overflow.
5437 Suggested by Paul Eggert.
5439 2003-10-31 Bruno Haible <bruno@clisp.org>
5441 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5442 to avoid (extremely rare) race condition.
5443 Suggested by Paul Eggert.
5445 2003-11-03 Jim Meyering <jim@meyering.net>
5447 * userspec.c: Include "userspec.h".
5448 * userspec.h: New file.
5450 2003-10-31 Paul Eggert <eggert@twinsun.com>
5452 * mountlist.h (struct mount_entry.me_type_malloced): New member.
5453 * mountlist.c (SIZE_MAX): Define if not defined already.
5454 (read_filesystem_list): Set and use me_type_malloced.
5455 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5456 whatever the type happens to be), for brevity and consistency.
5457 Check for size calculation overflow on Alphas running OSF/1.
5459 2003-10-31 Jim Meyering <jim@meyering.net>
5461 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
5463 * linebuffer.c: Include <string.h> for declaration of memset.
5465 2003-10-30 Paul Eggert <eggert@twinsun.com>
5466 Bruno Haible <bruno@clisp.org>
5468 * vasprintf.c: Include <limits.h>, <stdlib.h>.
5469 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
5471 2003-10-29 Paul Eggert <eggert@twinsun.com>
5473 * xalloc.h (xalloc_oversized): Now a macro, not a function,
5474 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
5476 * quotearg.c (quotearg_n_options): Use it.
5477 * group-member.c: Include <stdbool.h>.
5478 (free_group_info): Arg is now const *; don't free arg.
5479 (get_group_info): Now returns bool and accepts struct group_info *,
5480 rather than returning a malloc'ed struct group_info *.
5481 All uses changed. Check for overflow in internal size calculation.
5483 * getusershell.c (readname): Simplify the code by using x2nrealloc
5484 rather than xmalloc/xrealloc.
5485 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
5486 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
5487 conformance bug: the old code used a pointer after freeing the
5488 storage that it addressed.
5489 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
5490 rather than doing it by hand.
5491 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
5492 the buffer preserved. Use free and xmalloc instead.
5493 * quotearg.c (quotearg_n_options): Likewise.
5494 Use a simpler test for size overflow. Don't use xalloc_oversized
5495 because unsigned int might be wider than size_t (!); this suggests
5496 that we should switch from unsigned int to size_t for slot numbers.
5498 2003-10-27 Bruno Haible <bruno@clisp.org>
5500 * stdbool_.h: Better support for BeOS.
5502 2003-10-27 Paul Eggert <eggert@twinsun.com>
5504 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
5505 to allocate the returned structure. Do not allocate a subarray,
5506 as x2nrealloc will do that.
5507 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
5508 instead of xnrealloc.
5509 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
5511 2003-10-26 Paul Eggert <eggert@twinsun.com>
5513 * xalloc.h (xalloc_oversized): New static inline function, for
5514 callers that want to do their own size-overflow checking. Include
5515 <stdbool.h>, since xalloc_oversized returns bool.
5516 * xalloc.c (array_size_overflow): Remove. All callers changed
5517 to use xalloc_oversized.
5519 Add two functions x2realloc, x2nrealloc, for programs that grow
5520 arrays dynamically by doubling their sizes.
5521 * xalloc.h (x2realloc, x2nrealloc): New decls.
5522 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
5525 Port to C99 semantics for 'inline' of external functions.
5526 Bug reported by Bruno Haible.
5527 * xmalloc.c (xnmalloc_inline): New static inline function,
5528 with the old contents of xnmalloc.
5529 (xnmalloc, xmalloc): Use it.
5530 (xnrealloc_inline): New static inline function,
5531 with the old contents of xnrealloc.
5532 (xnrealloc, xrealloc): Use it.
5534 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
5536 2003-10-25 Paul Eggert <eggert@twinsun.com>
5538 Fix several address-calculation bugs in the hash modules,
5539 plus some minor code cleanup.
5541 * hash.h: Include <stdbool.h>, for bool.
5542 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
5543 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
5544 hash_get_n_entries, hash_get_max_bucket_length,
5545 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
5546 hash_rehash): Use size_t rather than unsigned.
5547 * hash.c (struct hash_table, hash_get_n_buckets,
5548 hash_get_n_buckets_used, hash_get_n_entries,
5549 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
5550 hash_get_entries, hash_do_for_each, hash_string, is_prime,
5551 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
5553 (SIZE_MAX): Define if not defined.
5554 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
5555 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
5557 Use const * when possible.
5558 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
5559 (check_tuning): Fix bug: if tuning parameters were very close to
5560 0 or 1, rounding errors could have caused subscript violations.
5561 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
5562 (hash_initialize): Add 'fail:' label
5563 to free table and return NULL, and use it to simplify code.
5564 Use calloc rather than clearing the storage ourself.
5565 (hash_initialize, hash_rehash): Check for arithmetic overflow in
5566 buffer size calculations.
5567 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
5568 Include <stddef.h>, for size_t.
5569 * hash-pjw.c (hash_pjw): Likewise.
5570 Switch to method described by Bruno Haible.
5571 Include <limits.h>, for CHAR_BIT.
5572 (SIZE_BITS): New macro.
5574 2003-10-21 Paul Eggert <eggert@twinsun.com>
5576 * getndelim2.c (getndelim2): When size calculation overflows,
5577 ceiling the allocation at NMAX bytes rather than silently
5578 discarding input bytes before NMAX is reached. This makes
5579 a difference only if NMAX exceeds SIZE_MAX / 2.
5581 * obstack.c: Merge from glibc.
5582 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
5583 Add libc_hidden_def (_obstack_newchunk).
5584 (_obstack_free) [! defined _LIBC]: Remove.
5585 [defined _LIBC]: Make a strong alias from obstack_free, rather than
5586 a clone of the function body.
5587 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
5588 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
5590 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
5591 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
5594 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
5595 (obstack_ptr_grow_fast, obstack_int_grow_fast):
5596 Don't use lvalue casts, as GCC plans to remove support for them
5597 in GCC 3.5. Reported by Joseph S. Myers. This bug
5598 was also present in the non-GCC version, indicating that this
5599 code had always been buggy and had never been widely used.
5600 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
5601 Use the fast variant of each macro, rather than copying the
5602 definiens of the fast variant; that way, we'll be more likely to
5603 catch future bugs in the fast variants.
5605 2003-10-20 Bruno Haible <bruno@clisp.org>
5607 * wait-process.h: New file, from GNU gettext.
5608 * wait-process.c: New file, from GNU gettext.
5610 2003-10-19 Jim Meyering <jim@meyering.net>
5612 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
5614 2003-10-16 Paul Eggert <eggert@twinsun.com>
5616 * getgroups.c: Include <errno.h>, <stdlib.h>.
5617 (getgroups): First arg is int, not size_t.
5618 Don't let 'free' mangle errno.
5620 2003-10-16 Jim Meyering <jim@meyering.net>
5622 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
5624 2003-10-15 Paul Eggert <eggert@twinsun.com>
5626 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
5628 (new_exclude, add_exclude_file): Initial size no longer needs to
5630 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
5631 our own address arithmetic overflow checking.
5633 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
5634 (fnmatch): Do not alloca more than 2000 wide characters;
5635 instead, use malloc for large buffers.
5636 Check for address arithmetic overflow, and return -1
5637 with errno set to ENOMEM in that case.
5638 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
5639 (NEW_PATTERN): Do not alloca more than 8000 bytes;
5640 instead, return -1. Check for address arithmetic overflow.
5642 2003-10-14 Paul Eggert <eggert@twinsun.com>
5644 Handle invalid suffixes and overflow independently, so that
5645 callers can treat them independently as needed. Fix some bugs in
5646 suffix handling, e.g., "100k@" was not diagnosed as an invalid
5647 suffix for a human-readable blocksize. The major caller-visible
5648 change is the addition of a new
5649 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
5650 that both overflow and suffix chars were found.
5652 * human.c (humblock): Don't check separately for invalid suffix
5653 char; that is xstrtoumax's job (now that its bug is fixed).
5654 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
5655 INTMAX_MAX]: New macros.
5656 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
5657 TYPE_MAXIMUM): New macros.
5658 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
5659 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
5660 if overflow occurs, as it's what __strtol does and it's more useful
5662 (__xstrtol): If __strtol reports some error other than ERANGE,
5663 reflect it to the caller as LONGINT_INVALID. If it reports
5664 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
5665 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
5666 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
5668 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
5669 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
5670 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
5671 [defined UINTMAX_MAX]: New macros.
5673 2003-10-14 Bruno Haible <bruno@clisp.org>
5675 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
5676 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
5677 Also use volatile where needed.
5679 2003-10-12 Paul Eggert <eggert@twinsun.com>
5681 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
5682 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
5683 and define in terms of the other primitives.
5684 * xmalloc.c: Include stdbool.h; do not include exit.h.
5685 (SIZE_MAX): Define if not already defined.
5686 (array_size_overflow): New function.
5687 (xalloc_die): Abort instead of exiting if 'error' returns.
5688 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
5689 (xmalloc, xrealloc): Use them.
5690 (xcalloc): Check for address arithmetic overflow.
5691 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
5692 a bit faster than strcpy.
5694 2003-10-08 Paul Eggert <eggert@twinsun.com>
5696 Merge getpass from libc, plus a few fixes.
5698 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
5699 Include <stdbool.h>.
5700 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
5701 __fsetlocking to empty.
5702 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
5703 do include <bits/libc-lock.h>.
5704 Do not include <fcntl.h>; not needed.
5705 [_LIBC]: Include <wchar.h>.
5706 (NOTCANCEL_MODE): New macro.
5707 (flockfile, funlockfile) [_LIBC]: New macros.
5708 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
5709 [!_LIBC]: New macros.
5710 (call_fclose): New function.
5711 (getpass): Use it. Save tty stream separately; this simplifies the
5712 code and makes it more reliable if stdin happens to equal stdout.
5713 Invoke __fsetlocking on tty.
5714 Handle thread cancellation if needed.
5715 Namespace cleanup (use __tcgetattr, __getline).
5716 Use bool for Booleans.
5717 [USE_IN_LIBIO]: Handle wide streams.
5718 [!_LIBC]: Unconditionally do the fseek, since we don't know what
5719 stream might go where.
5721 * unlocked-io.h: Include <stdio.h>, so that the caller
5722 doesn't have to include <stdio.h> before us.
5723 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
5724 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
5725 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
5726 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
5727 if not declared, so that we can use getpass.c code from libc without
5729 (flockfile, ftrylockfile, funlockfile): New macros.
5731 2003-10-06 Bruno Haible <bruno@clisp.org>
5733 * version-etc-2.h: Remove file.
5734 * version-etc-2.c: Remove file.
5736 2003-09-25 Jim Meyering <jim@meyering.net>
5737 Bruno Haible <bruno@clisp.org>
5739 This lets translators provide better translations for the
5740 "Written by ..." part of --version output.
5741 * version-etc.h: Include stdarg.h.
5742 (version_etc_copyright): Declare as readonly.
5743 (version_etc): Make this function variadic with a NULL-terminated list
5744 of author name strings.
5745 (version_etc_va): New declaration.
5746 * version-etc.c: Include stdarg.h, stdlib.h.
5747 (version_etc_copyright): Declare as readonly.
5748 (version_etc_va): New function. Provide a different translatable string
5749 for each possible number of authors < 10. Abbreviate when there are 10
5751 (version_etc): Make this function variadic. Call version_etc_va.
5752 Suggestion from Gary V. Vaughan.
5754 * long-options.h (parse_long_options): Change prototype: the authors
5755 string is moved to the end and becomes variadic.
5756 * long-options.c: Include stdarg.h.
5757 (parse_long_options): Make this function variadic, too.
5758 Call version_etc_va, not version_etc.
5760 2003-10-06 Bruno Haible <bruno@clisp.org>
5762 * fatal-signal.h: New file, from GNU gettext.
5763 * fatal-signal.c: New file, from GNU gettext.
5765 2003-10-04 Karl Berry <karl@gnu.org>
5767 * argp*: update from libc.
5769 2003-10-01 Larry Jones <lawrence.jones@eds.com>
5771 * getpass.c (getpass): Use a no-op fseek when switching from input to
5772 output mode on the same stream.
5774 2003-09-29 Paul Eggert <eggert@twinsun.com>
5776 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
5777 Fix arg typo in previous patch.
5779 2003-09-28 Jim Meyering <jim@meyering.net>
5781 * error.c: Correct cpp indentation.
5783 2003-09-27 Paul Eggert <eggert@twinsun.com>
5785 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
5786 Omit the special code that used __typeof__, since we worry that
5787 it could be more trouble than it's worth. See:
5788 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
5789 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
5793 2003-09-26 Jim Meyering <jim@meyering.net>
5795 * error.c (error_tail): Move some declarations
5796 into inner scope where the local variables are used.
5798 2003-09-26 Bruno Haible <bruno@clisp.org>
5800 * stpncpy.h (gnu_stpncpy): New declaration.
5801 (stpncpy): Define as alias for gnu_stpncpy.
5802 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
5804 2003-09-26 Paul Eggert <eggert@twinsun.com>
5806 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
5807 (error_tail): Do not loop, reallocating temporary buffer, since
5808 the output cannot contain more wide characters than the input
5809 contains bytes, the size must be big enough already. This avoids
5810 one potential size overflow calculation. Check for size overflow
5811 when calculating temporary buffer size. Free temporary buffer
5812 when done, if it was allocated with malloc; this plugs a memory
5813 leak. Remove casts from void * to pointers, that are no longer
5814 needed now that we're assuming C89 or better.
5816 Merge error changes from glibc.
5818 * error.c, error.h: Update copyright notice header to match glibc.
5819 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
5820 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
5821 Disable cancellation while printing error.
5822 * error.h: Prepend __ to parameter names.
5824 2003-09-25 Karl Berry <karl@gnu.org>
5826 * argp-fmtstream.c, argp-help.c: update from libc.
5828 2003-09-25 Bruno Haible <bruno@clisp.org>
5830 * version-etc-2.h: New file, from version-etc.h with modifications.
5831 * version-etc-2.c: New file, from version-etc.c with modifications.
5833 2003-09-25 Simon Josefsson <jas@extundo.com>
5835 * xgetdomainname.h: New file.
5836 * xgetdomainname.c: New file.
5838 2003-09-25 Simon Josefsson <jas@extundo.com>
5839 Bruno Haible <bruno@clisp.org>
5841 * getdomainname.h: New file.
5842 * getdomainname.c: New file.
5844 2003-09-24 Paul Eggert <eggert@twinsun.com>
5846 * linebuffer.c (freebuffer): Don't free the argument, just
5847 the buffer associated with the argument. Bug reported by
5850 2003-09-19 Karl Berry <karl@gnu.org>
5852 * argp.h: update from libc.
5854 2003-09-16 Paul Eggert <eggert@twinsun.com>
5856 * linebuffer.c (readlinebuffer): Return NULL immediately upon
5857 input error, instead of returning NULL the next time we are called
5858 (and therefore losing track of errno).
5860 2003-09-15 Paul Eggert <eggert@twinsun.com>
5862 * getndelim2.c (getndelim2): Don't trash errno when a read
5863 fails, so that the caller gets the proper errno.
5865 * readutmp.c (read_utmp): Likewise.
5866 Check for fstat error. Close stream and free storage
5869 2003-09-14 Bruno Haible <bruno@clisp.org>
5871 * fwriteerror.h: New file.
5872 * fwriteerror.c: New file.
5874 2003-09-14 Jim Meyering <jim@meyering.net>
5876 * getloadavg.c: Correct cpp indentation.
5877 * strdup.c: Likewise.
5878 * vasnprintf.c: Likewise.
5880 2003-09-12 Paul Eggert <eggert@twinsun.com>
5882 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
5883 * obstack.c [!defined _LIBC]: Likewise.
5884 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
5885 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
5886 * exitfail.c: Don't include stdlib.h; no longer needed.
5888 More changes to assume C89 or better.
5890 * error.c (error_tail): Assume vprintf.
5892 * argmatch.c (getenv): Remove decl.
5893 * progreloc.c (get_full_program_name): Define via prototype.
5894 * setenv.c (clearenv): Likewise.
5895 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
5897 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
5898 (malloc, memcpy): Remove decls.
5899 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
5900 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
5901 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
5902 (memcpy): Remove macro.
5903 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
5904 (__P): Remove. All uses removed.
5905 (PTR): Remove. All uses changed to void *.
5906 (CHAR_BIT, NULL): Remove.
5907 (spaces, zeros, memset_space, memset_zero)
5908 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
5910 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
5911 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
5912 Define with prototype.
5913 Remove now-unnecessary prototype decl.
5914 (extra_args_spec): Assume ANSI C. All uses changed.
5915 (extra_args_spec_iso): Remove.
5916 (my_strftime, emacs_strftimeu): Define via prototype.
5917 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
5919 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
5920 * strtoimax.c: Include <stdlib.h> unconditionally.
5921 (strtoul, strtol): Remove decls.
5922 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
5924 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
5925 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
5926 (LOCALE_PARAM_PROTO): New macro.
5927 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
5928 (INTERNAL (strtol), strtol): Define with a prototype.
5929 (PARAMS): Remove. All uses removed.
5930 * tempname.c: Include <string.h> unconditionally.
5931 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
5932 * xgethostname.c (main): Define with a prototype.
5933 * xmalloc.c: Include "xalloc.h" first, to check interface.
5934 Include <stdlib.h> unconditionally.
5935 (calloc, malloc, realloc, free): Remove decls.
5936 * xstrtod.c: Include "xstrtod.h" first, to check interface.
5937 Include <stdlib.h> unconditionally. Sort include file names.
5939 (xstrtod): Define with a prototype.
5940 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
5941 (strtol, strtoul): Remove decls.
5943 2003-09-11 Paul Eggert <eggert@twinsun.com>
5945 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
5946 Include <stdlib.h>, <string.h> unconditionally.
5947 Remove now-unnecessary cast to char *.
5948 * strnlen.c: Include <string.h> unconditionally.
5949 * yesno.c (yesno): Define with a prototype.
5951 2003-09-10 Bruno Haible <bruno@clisp.org>
5953 * strcspn.c: Include <string.h> unconditionally.
5954 * strpbrk.c: Include <string.h> unconditionally.
5955 * strstr.c: Include <string.h> unconditionally.
5956 * unicodeio.c: Include <string.h> unconditionally.
5957 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
5958 * unsetenv.c: Likewise.
5959 * xreadlink.c: Include <stdlib.h> unconditionally.
5960 * yesno.c: Include <stdlib.h> unconditionally.
5961 (rpmatch): Add prototype.
5963 2003-09-10 Jim Meyering <jim@meyering.net>
5965 * error.c: Correct indentation of cpp directives.
5967 2003-09-09 Paul Eggert <eggert@twinsun.com>
5971 * acosl.c (main): Use a prototype.
5972 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
5975 * getloadavg.c (getloadavg, main): Define via prototypes.
5977 * getopt.h (struct option.name): Assume C89, and use 'const'.
5978 (getopt, etopt_long, getopt_long_only, _getopt_internal)
5979 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
5981 * getopt.c (const): Remove macro.
5982 Include <string.h> unconditionally.
5983 (my_index): Remove; all uses changed to strchr.
5984 (strlen): Remove decl.
5985 (exchange): Remove forward decl; no longer needed.
5986 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
5987 Define with prototype.
5988 * getopt1.c (const): Remove macro.
5989 (getopt_long, getopt_long_only, main): Define with prototype.
5991 * getugroups.c: Include <string.h> unconditionally.
5993 * getusershell.c: Include <stdlib.h> unconditionally.
5994 (getusershell, setusershell, endusershell, readname, main):
5995 Define with prototypes.
5997 * group-member.c: Include group-member.h first.
5998 Include <stdlib.h> unconditionally.
6000 * hard-locale.c: Include hard-locale.h first.
6001 Include <stdlib.h>, <string.h> unconditionally.
6003 * hash.c (free, malloc): Remove decls.
6004 Include <stdlib.h> unconditionally.
6006 * human.c: Include <stdlib.h>, <string.h> unconditionally.
6007 (getenv): Do not declare.
6009 * idcache.c: Include <string.h> unconditionally.
6011 * long-options.c: Include long-options.h first, to test interface.
6012 Include <stdlib.h> unconditionally.
6014 * makepath.c: Include makepath.h first, to test interface.
6015 Include <stdlib.h> and <string.h> unconditionally.
6017 * linebuffer.c: Include <stdlib.h>.
6018 (free): Remove decl.
6020 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6021 rpl_malloc returns void *, not char *.
6022 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
6024 * md5.h: Include <limits.h> unconditionally.
6025 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6026 (__P): Remove; all uses removed.
6027 * md5.c: Include "md5.h" first.
6028 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6029 md5_buffer, md5_process_bytes, md5_process_block):
6030 Define with prototypes.
6031 * sha.h (__P): Remove all uses. (It wasn't defined??)
6032 * sha.c: Include "sha.h" first.
6033 Include <stdlib.h>, <string.h> unconditionally.
6035 * memchr.c (__ptr_t): Remove; all uses changed to void *.
6036 * memcmp.c (__ptr_t): Likewise.
6037 * memrchr.c (__ptr_t): Likewise.
6038 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6039 Include <string.h> unconditionally.
6040 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6041 * memchr.c: Include <stdlib.h> unconditionally.
6042 * memchr.c (LONG_MAX): Remove.
6043 * memrchr.c (LONG_MAX): Likewise.
6044 * memchr.c (__memchr): Define via a prototype.
6045 * memrchr.c (__memrchr): Likewise.
6046 * memcmp.c (__P): Remove, and remove all uses.
6047 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6048 Remove forward decls; no longer needed.
6049 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6050 Use types required by C89 in prototype.
6052 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6053 * savedir.c: Likewise.
6054 * mkdir.c (free): Remove decl.
6055 * rmdir.c (rmdir): Define with a prototype.
6056 * savedir.c: Include savedir.h first, to test interface.
6058 * mktime.c (STDC_HEADERS): Remove.
6059 Include <stdlib.h>, <string.h> unconditionally.
6061 * modechange.c: Include <stdlib.h> unconditionally.
6062 (malloc): Remove decl.
6064 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6065 (free): Remove decl.
6067 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6068 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6069 (This type really should be intptr_t, but that's a C99ism.)
6070 (_obstack_memcpy): Remove: all uses changed to memcpy.
6071 Include <string.h> unconditionally.
6072 (struct obstack): Assume __STDC__ for types of members
6073 chunkfun, freefun, extra_arg.
6074 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6075 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6076 obstack_begin, obstack_specify_allocation,
6077 obstack_specify_allocation_with_arg, obstack_chunkfun,
6078 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6079 Remove unprototyped decls and the macros that use them.
6080 * obstack.c (POINTER): Remove. All uses changed to void *.
6081 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6082 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6083 (defined __STDC__ && __STDC__)]:
6084 Remove nonprototyped code.
6085 Include <stdlib.h> unconditionally.
6086 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6087 _obstack_allocated_p, _obstack_free, obstack_free,
6088 _obstack_memory_used, print_and_abort):
6089 Define using prototypes.
6090 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6091 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6092 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6093 obstack_next_free, obstack_object_size, obstack_room) [0]:
6094 Remove unused, unprototyped code.
6096 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6098 * physmem.c (physmem_total, physmem_available, main): Define
6101 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6102 (main): Define with a prototype.
6104 * posixver.c (getenv): Remove decl.
6106 * putenv.c (malloc): Returns void *, not char *.
6107 Include <string.h> unconditionally.
6108 (strchr, memcpy, NULL): Do not define.
6110 * readtokens.c: Include readtokens.h first, to test interface.
6111 Include <stdlib.h>, <string.h> unconditionally.
6112 (init_tokenbuffer): Define with a prototype.
6114 * regex.c (PARAMS): Remove. All uses removed.
6115 All uses of _RE_ARGS removed, too.
6116 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6118 (bzero): Assume memset exists.
6119 (memcmp, memcpy, NULL): Remove.
6120 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6121 char, or assignments to local vars of type signed char.
6122 (init_syntax_once, PREFIX(extract_number_and_incr),
6123 PREFIX(print_partial_compiled_pattern),
6124 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6125 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6126 PREFIX(regex_grow_registers), PREFIX(regex_compile),
6127 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6128 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6129 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6130 wcs_compile_range, byte_compile_range, truncate_wchar,
6131 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6132 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6133 count_mbs_length, wcs_re_match_2_internal,
6134 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6135 PREFIX(alt_match_null_string_p),
6136 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6137 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6138 regfree, PREFIX(extract_number)): Define with prototype. Remove
6139 now-unnecessary declaration, if any.
6140 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6142 Remove now-unnecessary casts among pointer types.
6143 * regex.h (_RE_ARGS): Remove. All uses removed.
6145 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6146 (free): Remove decl.
6148 * rpmatch.c: Include <stdlib.h> unconditionally.
6150 * same.c: Include <stdlib.h>, <string.h> unconditionally.
6151 (free): Remove decl.
6153 * save-cwd.c: Include <stdlib.h> unconditionally.
6154 * xgetcwd.c: Likewise.
6156 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6157 (free): Remove decl.
6159 * strchrnul.c (strchrnul): Define with a prototype.
6160 Fix bug: c_in was not converted to char before searching.
6162 The following changes are not K&R related:
6164 * group-member.h: Include <sys/types.h>, so that this file is
6166 * makepath.h: Likewise.
6168 * getusershell.c (readname, default_index, line_size, readname):
6169 Use size_t, not int, for sizes.
6170 (readname): If the size overflows, report an error instead of
6173 2003-09-09 Derek Robert Price <derek@ximbiot.com>
6175 * getndelim2.c: Assume stdlib.h per the C89 spec.
6177 2003-09-08 Paul Eggert <eggert@twinsun.com>
6179 Assume C89 or better; remove K&R cruft.
6180 A few of these changes were first proposed by Derek Robert Price
6181 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6183 * addext.c: Include <string.h> unconditionally.
6184 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6185 Don't declare getenv or malloc.
6187 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6188 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6190 (find_stack_direction, alloca): Use prototypes.
6192 * atexit.c (atexit): Define using a prototype.
6194 * basename.c, dirname.c, stripslash.c:
6195 Include <string.h> unconditionally.
6197 * bcopy.c: Include <stddef.h>.
6198 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6200 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6202 * error.h (error, error_at_line, error_print_progname)
6203 [! (defined (__STDC__) && __STDC__)]: Remove decls.
6204 * error.c: Include error.h first, to check interface.
6205 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6206 (VA_START): Remove; all uses changeed to va_start.
6207 (exit, strerror): Remove decls.
6208 (error_print_progname): Prototype uncondionally.
6209 Don't include <errno.h>; no longer needed.
6210 (private_strerror): Remove.
6211 (error_tail): Always define.
6212 (error, error_at_line): Assume C89 or better; always use prototypes.
6213 * fatal.c: Include "fatal.h" first, to test interface.
6214 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6215 (VA_START): Remove; all uses changed to va_start.
6216 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6218 (exit): Remove decl.
6219 (fatal): Prototype unconditionally. Assume va_start works.
6220 Abort at end, to pacify gcc.
6222 * euidaccess.c (main): Define with a prototype.
6224 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6226 * exitfail.c: Include <stdlib.h> unconditionally.
6228 * fnmatch_.h (__P): Remove. All uses changed to assume
6230 * fnmatch.c: Include fnmatch.h first, to test interface.
6231 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6232 (getenv): Remove decl.
6233 (fnmatch): Define using a prototype.
6234 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6235 (FCT): Define using a prototype.
6237 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6239 * gethostname.c: Include <stddef.h>.
6240 (gethostname): Define with prototype. Length is size_t, not int.
6242 2003-09-08 Paul Eggert <eggert@twinsun.com>
6244 * getversion.c: Remove; was migrated to backupfile.c in 1997.
6245 getversion.c should have been removed then, but was accidentally
6248 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6249 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6251 2003-09-07 Paul Eggert <eggert@twinsun.com>
6253 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6254 copy_tm_result. Bug reported by Simon Josefsson in
6255 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6257 2003-09-06 Paul Eggert <eggert@twinsun.com>
6259 * time_r.c, time_r.h: New files.
6261 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6263 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
6264 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6266 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6268 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6269 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6272 * timegm.c: Switch to glibc implementation, with the following changes:
6273 [defined HAVE_CONFIG_H]: Include <config.h>.
6274 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6275 (__mktime_internal) [!defined _LIBC]: New decl.
6276 (__gmtime_r) [!defined _LIBC]: New macro and function.
6277 (timegm): Use a prototype, since gnulib assumes C89.
6278 Do not bother declaring tmp to be const, as it's not really usefu.
6279 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6280 (timegm): Declare only if HAVE_DECL_TIMEGM.
6282 2003-09-03 Paul Eggert <eggert@twinsun.com>
6284 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6285 Bug reported by Lute Kamstra in
6286 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6288 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6289 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
6290 course with correspondingly smaller numbers for tomorrow and
6291 yesterday. From Tadayoshi Funaba. Originally installed into
6292 sh-utils on 1999-08-07, but the patch got lost (I guess during the
6295 2003-08-31 Simon Josefsson <jas@extundo.com>
6297 * timegm.h: New file.
6298 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
6300 2003-08-31 Karl Berry <karl@gnu.org>
6302 * argp.h: update from libc.
6304 2003-08-28 Bruno Haible <bruno@clisp.org>
6306 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6307 warning on QNX, which defines O_BINARY to 000000.
6309 2003-08-24 Bruno Haible <bruno@clisp.org>
6311 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6312 MSVC7 <stdio.h> is included later.
6314 2003-08-20 Bruno Haible <bruno@clisp.org>
6316 * progname.h: New file, from GNU gettext.
6317 * progname.c: New file, from GNU gettext.
6318 * progreloc.c: New file, from GNU gettext.
6320 2003-08-19 Bruno Haible <bruno@clisp.org>
6322 * xstrdup.c: Assume <string.h> exists.
6324 2003-08-18 Jim Meyering <jim@meyering.net>
6326 * setenv.h: Indent nested cpp directive.
6327 * vasnprintf.c: Remove trailing blanks.
6329 2003-08-17 Simon Josefsson <jas@extundo.com>
6330 Bruno Haible <bruno@clisp.org>
6332 * xstrndup.h: New file.
6333 * xstrndup.c: New file.
6335 2003-08-17 Bruno Haible <bruno@clisp.org>
6337 * strndup.h: New file.
6339 2003-08-16 Paul Eggert <eggert@twinsun.com>
6341 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6342 space, undoing this 2003-08-12 change:
6343 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6345 2003-08-16 Jim Meyering <jim@meyering.net>
6347 Merge from coreutils.
6348 * xstrtoimax.c: #else #if -> #elif.
6349 * xstrtoumax.c: Likewise.
6351 2003-08-15 Paul Eggert <eggert@twinsun.com>
6353 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6354 rather than tab, after '#' in shell-script copyright notices.
6355 Suggested by Bruno Haible.
6357 2003-08-15 Jim Meyering <jim@meyering.net>
6358 and Paul Eggert <eggert@twinsun.com>
6360 Merge from coreutils.
6361 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6362 member but strut utmpx does not. Needed for AIX 4.3.3.
6363 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6365 2003-08-15 Jim Meyering <jim@meyering.net>
6367 Merge from coreutils.
6368 * xgethostname.c: Include <stdlib.h>.
6369 (xghostname): Don't exit for anything other than memory-related
6370 failure; just return NULL.
6371 * userspec.c: Include "posixver.h".
6372 (parse_user_spec): Accept `.' as a separator only
6373 in pre-POSIX-200112 mode.
6374 * strtoimax.c: Use #elif rather than #else #if.
6375 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6376 Remove function, now that we can rely on a working tzset function.
6377 [!_LIBC]: Ensure that the required autoconf test has been run.
6378 [!defined _NL_CURRENT && HAVE_STRFTIME]:
6379 Use underlying_strftime for %r.
6380 * sha.c: Merge in some clean-up and optimization changes from glibc.
6381 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6382 Ensure that it is a multiple of 64.
6383 Rearrange loop exit tests so as to avoid performing an
6384 additional fread after encountering an error or EOF.
6385 * realloc.c: Update copyright date.
6387 2003-08-14 Jim Meyering <jim@meyering.net>
6389 Merge from coreutils.
6390 * obstack.h: Whitespace changes.
6391 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6392 and xcalloc return values.
6393 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6394 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
6395 hang on OSF/1 5.1 for DIR on both local and remote file systems.
6396 Reported by (and fix confirmed by) Nelson H. F. Beebe.
6397 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6399 Use mntctl's return value to drive the entry-processing loop, since
6400 we can't rely on the value of the vmt_length member in the last
6401 entry. On some systems doing so could result in exhausting
6402 virtual memory. Based in part on a patch from Mike Jetzer.
6404 2003-08-14 Jim Meyering <jim@meyering.net>
6405 and Paul Eggert <eggert@twinsun.com>
6407 Merges from coreutils, plus other fixes.
6408 * physmem.c: Merge in portability changes from gcc/libiberty
6409 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
6410 for credits and details. Thanks to Kaveh Ghazi for helping
6411 to keep these files in sync.
6412 (ARRAY_SIZE): Define it.
6413 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6414 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6415 (memcasecmp): Don't assume size_t fits in unsigned int.
6416 Remove casts and duplicate code.
6417 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6418 (memcpy): Remove definition.
6419 Merge in some clean-up and optimization changes from glibc.
6420 [BLOCKSIZE]: Move definition to top of file.
6421 Ensure that it is a multiple of 64.
6422 Rearrange loop exit tests so as to avoid performing an
6423 additional fread after encountering an error or EOF.
6424 * md5.h (md5_uintptr): Define.
6425 * makepath.c (CLEANUP_CWD): Report an error if we failed to
6426 return to the initial working directory. Preserve errno
6428 * idcache.c: Include "xalloc.h".
6429 (xmalloc, xrealloc): Remove decls.
6430 (getuser): Remove casts no longer required in C89.
6431 * human.c: Include stdio.h, for sprintf.
6432 * group-member.c: Include "xalloc.h".
6433 (xmalloc, xrealloc): Remove decls.
6434 (get_group_info): Remove casts no longer required in C89.
6435 * getusershell.c (readname): Remove casts no longer required in C89.
6436 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6437 * getline.c: Whitespace fix, from coreutils.
6439 2003-08-13 Paul Eggert <eggert@twinsun.com>
6441 * exclude.c: Include <ctype.h>
6442 (IN_CTYPE_DOMAIN): New macro.
6444 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6447 * argp-help.c, argp-parse.c, config.charset, getopt.h:
6448 Undo previous (whitespace-only) change.
6450 2003-08-12 Paul Eggert <eggert@twinsun.com>
6452 * argp-help.c, argp-parse.c, config.charset, getopt.h:
6453 Normalize leading white space and remove trailing white space.
6454 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6455 notice, as per ../config/srclist-update.
6457 Merge from coreutils.
6458 * euidaccess.h: New file.
6459 * euidaccess.c: Include it.
6460 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
6461 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
6462 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
6464 2003-08-11 Bruno Haible <bruno@clisp.org>
6466 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
6467 (vasnprintf): Use it instead of wcslen.
6469 2003-08-11 Bruno Haible <bruno@clisp.org>
6471 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
6472 value to ensure that _Bool promotes to int. Use #define for _Bool when
6473 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
6475 2003-08-10 Karl Berry <karl@gnu.org>
6477 * regex.h: update from libc (whitespace fix).
6479 2003-08-09 Paul Eggert <eggert@twinsun.com>
6481 Merge some files from coreutils. These changes were
6482 originally made by Jim Meyering.
6483 * acl.c: Include <sys/types.h> before <sys/stat.h>;
6484 many older Unixes require this.
6485 * alloca.c (alloca): Remove cast to argument of free;
6486 no longer needed in C89.
6487 * alloca_.h, regex.h: Fix white space to match
6488 what GNU indent does.
6490 2003-08-05 Paul Eggert <eggert@twinsun.com>
6492 * bumpalloc.h: Remove.
6494 2003-08-04 Paul Eggert <eggert@twinsun.com>
6496 * getloadavg.c: Change copyright notice and spacing to conform to
6499 Merge from coreutils.
6500 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
6502 * getdate.y (date): Also accept dates like May-23-2003; suggestion
6503 from Karl Berry, implemented by Jim Meyering.
6504 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
6505 from Dmitry V. Levin.
6506 Remove anachronistic cast of xrealloc.
6507 * fnmatch_.h (__const): Remove. Use 'const'.
6508 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
6509 type. Otherwise, it wouldn't compile with at least /bin/cc on
6510 ymp-cray-unicos9.0.2.X.
6511 Combine two mostly-identical uses of alloca into one.
6512 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
6514 2003-08-04 Dave Love <d.love@dl.ac.uk>
6518 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
6519 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
6520 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
6521 obsolete NLIST_NAME_UNION.
6522 [__GNU__]: Undef BSD and FSCALE.
6523 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
6525 2003-08-03 Paul Eggert <eggert@twinsun.com>
6527 * stdbool_.h (_Bool): Make it signed char, instead of
6528 an enum type, so that it's guaranteed to promote to int. See:
6529 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
6531 2003-07-31 Paul Eggert <eggert@twinsun.com>
6533 * strerror.c: Include config.h, limits.h. Declare sprintf.
6534 (strerror): Don't assume that a printable int fits in 14 bytes.
6536 2003-07-24 Derek Robert Price <derek@ximbiot.com>
6537 Bruno Haible <bruno@clisp.org>
6539 * getline.h (getline, getdelim): Change return type to ssize_t.
6540 * getline.c (getline, getdelim): Likewise.
6541 Remove _GNU_SOURCE define; now it's defined in config.h through
6544 2003-07-22 Paul Eggert <eggert@twinsun.com>
6546 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
6547 over-parenthesization in macros.
6549 Sync with coreutils.
6551 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
6554 Use `exit_failure' for xalloc and xmemcoll instead of their own
6555 private exit-failure variables.
6556 * xalloc.h (xalloc_exit_failure): Remove.
6557 * xmalloc.c: Likewise. Include exitfail.h.
6558 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
6559 * xmemcoll.h (xmemcoll_exit_failure): Remove.
6560 * xmemcoll.c: Likewise. Include exitfail.h.
6561 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
6563 2003-07-18 Paul Eggert <eggert@twinsun.com>
6565 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
6566 * closeout.c: Likewise. Include "closeout.h" right after config.h,
6567 to test that it can stand by itself. Include "exitfail.h".
6568 Clients should set exit_failure instead.
6569 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
6571 2003-07-18 Andreas Schwab <schwab@suse.de>
6573 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
6575 2003-07-18 Bruno Haible <bruno@clisp.org>
6577 * getndelim2.h: New file.
6578 * getndelim2.c: Make into a module of its own. Include config.h,
6580 (getndelim2): Make non-static. Change return type to ssize_t.
6581 * getline.h: Change argument names.
6582 * getline.c: Include getndelim2.h instead of getndelim2.c.
6583 * getnline.c: Include getndelim2.h.
6585 2003-07-17 Bruno Haible <bruno@clisp.org>
6587 * Makefile.am: Remove file.
6588 * Makefile.in: Remove file.
6590 2003-07-17 Bruno Haible <bruno@clisp.org>
6592 * getnline.h: New file.
6593 * getnline.c: New file.
6594 * getndelim2.c: New file, extracted from getline.c.
6595 (getndelim2): Renamed from getdelim2, with added nmax argument.
6596 * getline.c: Include getndelim2.c.
6597 (getdelim2): Moved out to getndelim2.c.
6598 (getline, getdelim): Update.
6600 2003-07-15 <karl@gnu.org>
6602 * vasnprintf.c: update from gettext.
6604 2003-07-15 Jim Meyering <jim@meyering.net>
6606 * makepath.c (make_path): Enclose diagnostic in _(...).
6608 2003-07-14 Paul Eggert <eggert@twinsun.com>
6610 * asnprintf.c, asprintf.c, config.charset, gettext.h,
6611 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
6612 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
6613 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
6614 vasprintf.c, vasprintf.h: Regenerate. These files are now being
6615 updated automatically by ../config/srclist-update. This changes
6616 their license from LPGL to GPL.
6618 2003-07-14 Jim Meyering <jim@meyering.net>
6620 Don't emit diagnostics. Let callers do that.
6621 * save-cwd.c: Don't include "error.h".
6622 (save_cwd): Don't call error. Ensure that errno is valid
6623 when returning nonzero.
6625 * save-cwd.h (restore_cwd): Update prototype.
6626 * save-cwd.c (restore_cwd): Remove two parameters.
6627 Simplify. Don't call error upon failure. Let callers do that.
6628 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
6629 when auditing is enabled. But don't bother updating the #if.
6631 2003-07-14 Simon Josefsson <jas@extundo.com>
6633 * mempcpy.h: New file.
6634 * mempcpy.c: New file.
6636 2003-07-14 Paul Eggert <eggert@twinsun.com>
6638 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
6639 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
6640 unicodeio.c, unicodeio.h, unlocked-io.h:
6641 Switch from LGPL to GPL.
6643 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
6645 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
6646 it breaks C++ compilation.
6647 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
6649 2003-07-10 Jim Meyering <jim@meyering.net>
6651 * vasnprintf.c: Remove trailing blanks.
6652 Make cpp indentation consistent.
6654 2003-07-09 Paul Eggert <eggert@twinsun.com>
6656 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
6657 posixver.c, strftime.c, strnlen.c, strverscmp.c:
6658 Switch from LGPL to GPL.
6660 2003-07-07 Paul Eggert <eggert@twinsun.com>
6662 * mktime.c: Fix some boundary cases and remove need for floating point.
6664 Issue a compile-time diagnostic if time_t is floating point, or if
6665 two's complement arithmetic is not in effect, or if arithmetic
6666 right shift does not propagate the sign. These assumptions were
6667 all in the original code but they weren't checked.
6669 (TIME_T_MIDPOINT, verify): New macros.
6670 (__isleap): Remove; it has integer overflow problems.
6671 (leapyear): New function, without those problems.
6672 (ydhms_tm_diff): Remove; splitting into two parts.
6673 (ydhms_diff): New function, containing the arithmetic part of
6674 the old ydhms_tm_diff function. Issue a compile-time
6675 diagnostic if we are not using C99 integer division.
6676 Avoid casts when possible.
6677 (guess_time_tm): New function, containing the checking part of
6678 the old ydhms_tm_diff function. Return the new value, rather than
6679 the difference between it and the old. Accept a new argument T
6680 so that *T specifies the old value. Check for overflow in the result.
6682 (__mktime_internal): Use a time_t offset, not a long int offset.
6683 This undoes the 2003-06-04 change, which is no longer needed now
6684 that we have better overflow checking.
6685 (localtime_offset): Likewise.
6687 (__mktime_internal): Avoid harmful overflow on hosts where time_t
6688 and long are 64-bit but int is only 32-bit.
6689 (ydhms_diff): Use long int to store year1 and yday1.
6690 Issue a compile-time diagnostic if long int is not wide enough.
6692 (__mktime_internal): Use long int to store adjusted year and yday.
6693 Use plain C rather than preprocessor commands, if that doesn't
6695 Check for overflow (and try to repair) after each probe
6696 rather than checking only at the very end. This avoids some bugs
6697 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
6698 does not equal GMT offset at maximum time).
6699 Use integer to check for overflow rather than floating point; this
6700 is more portable to non-IEEE hosts, and is a tad faster.
6701 When we detect that we are oscillating between two values,
6702 don't check whether tm_isdst has the requested value, since
6703 we already know the answer. When tm_isdst has the wrong value,
6704 use a different heuristic to find the right one, based on the
6705 extreme values actually observed in practice in tz2003a,
6706 rather than the (overly optimistic) "previous 3 calendar quarters".
6708 (not_equal_tm, print_tm, check_result): Use "const T" rather than
6709 "T const" to accommodate glibc style.
6710 (check_result): Use less-confusing report format. "long" -> "long int.
6712 Don't loop if the iteration overflows time_t.
6713 Allow a negative step in the iteration.
6715 2003-07-01 Paul Eggert <eggert@twinsun.com>
6717 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
6718 having it depend on HAVE_SYS_TYPES_H.
6720 2003-06-25 Bruno Haible <bruno@clisp.org>
6722 * readlink.c: New file.
6724 2003-06-20 Bruno Haible <bruno@clisp.org>
6726 Assume C89, so PARAMS isn't needed.
6727 * unicodeio.h (PARAMS): Remove.
6728 * unicodeio.c: Don't use PARAMS.
6730 2003-06-18 Jim Meyering <jim@meyering.net>
6732 Merge changes from coreutils.
6733 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
6734 Remove explicit declarations of xmalloc and realloc.
6736 (read_utmp): Remove anachronistic cast of xmalloc.
6738 2003-06-17 Paul Eggert <eggert@twinsun.com>
6740 Assume C89, so PARAMS isn't needed.
6741 * backupfile.h (PARAMS): Remove. All uses removed.
6742 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
6743 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
6744 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
6745 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
6746 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
6747 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
6748 xstrtol.h: Likewise.
6749 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
6750 same.h, strverscmp.h: Do not include config.h; no longer needed.
6751 Anyway, config.h should always be included before any other file.
6753 2003-06-11 Simon Josefsson <jas@extundo.com>
6755 * sysexit_.h: New file.
6757 2003-05-20 Derek Price <derek@ximbiot.com>
6759 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
6761 2003-06-10 Simon Josefsson <jas@extundo.com>
6763 * strchrnul.h: New file.
6764 * strchrnul.c: New file.
6766 2003-06-10 Simon Josefsson <jas@extundo.com>
6768 * argp.h: New file, from glibc.
6769 * argp-ba.c: New file, from glibc.
6770 * argp-eexst.c: New file, from glibc.
6771 * argp-fmtstream.c: New file, from glibc.
6772 * argp-fmtstream.h: New file, from glibc.
6773 * argp-fs-xinl.c: New file, from glibc.
6774 * argp-help.c: New file, from glibc.
6775 * argp-namefrob.h: New file, from glibc.
6776 * argp-parse.c: New file, from glibc.
6777 * argp-pv.c: New file, from glibc.
6778 * argp-pvh.c: New file, from glibc.
6779 * argp-xinl.c: New file, from glibc.
6781 2003-06-07 Jim Meyering <jim@meyering.net>
6783 * readtokens.h: Put `Free Software Foundation, Inc.'
6784 in place of my name in the copyright comment.
6785 Remove definition and uses of __P.
6788 * stat.c: Don't declare xmalloc explicitly.
6789 Instead, include "xalloc.h".
6790 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
6791 xrealloc, and xcalloc return values.
6792 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
6794 * xgetcwd.h: Remove definition/uses of PARAMS.
6796 2003-06-06 Jim Meyering <jim@meyering.net>
6798 * stdbool_.h: Renamed from stdbool.h.in.
6800 2003-06-06 Jim Meyering <jim@meyering.net>
6802 Merge from coreutils.
6803 * same.c: (same_name): Declare *_basename locals to be `const'.
6804 Consolidate declarations and initializations of *_base* locals.
6806 Merge from coreutils.
6807 This avoids a core dump on systems without GNU putenv,
6808 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
6809 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
6810 (unsetenv): New static function, from GNU libc.
6811 (rpl_putenv): Use it.
6813 * modechange.c: Remove trailing blanks.
6815 Merge from coreutils.
6816 * fsusage.c: Remove declaration of statfs.
6817 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
6819 * posixtm.c: Include <stdbool.h> unconditionally.
6821 2003-06-05 Paul Eggert <eggert@twinsun.com>
6823 * mktime.c (__mktime_internal): When resolving a tm_isdst
6824 mismatch, look in future quarters as well as past. This fixes a
6825 bug when processing fall-backwards gaps immediately after a long
6826 period of daylight-saving time.
6828 * mktime.c: Assume freestanding C89 or better.
6829 (HAVE_LIMITS_H): Remove. Assume it's 1.
6830 (__P): Remove; not used.
6831 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
6832 (mktime, not_equal_tm, print_tm, check_result,
6833 main): Use prototypes. Use const * where appropriate.
6834 (main): Fix typo in testing code that uncovered by above changes.
6835 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
6837 2003-06-04 Paul Eggert <eggert@twinsun.com>
6839 * mktime.c: Fix Debian bug 177940
6840 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
6841 (localtime_offset): Now long int, not time_t, because we want it
6842 to be guaranteed to be signed. All uses changed.
6843 (__mktime_internal): If overflow would occur when adding offset,
6846 Merge 'human' changes from coreutils. Rewrite to support
6847 locale-specific notations like thousands separators.
6848 * human.c: Simplify authorship notice.
6849 Include human.h immediately after config.h.
6850 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
6851 <limits.h>: Do not include, since human.h does.
6852 (SIZE_MAX, UINTMAX_MAX): New macros.
6853 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
6854 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
6855 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
6856 (power_letter): Renamed from suffixes.
6857 (generate_suffix_backwards): Remove.
6858 (adjust_value): Now takes int style (because of human.h changes)
6859 and long double value (for greater precision on some platforms).
6860 (group_number): New function.
6861 (human_readable): Use it. Use integer options, not enum.
6862 Put the options before the sizes in the arg list.
6863 Support all the new options.
6864 The old human_readable function has been removed;
6865 use inttostr.h instead.
6866 (human_readable, default_block_size, humblock):
6867 Use uintmax_t, not int, for block sizes.
6868 (human_readable_inexact, block_size_types): Remove.
6869 (block_size_opts): New constant.
6870 (human_options): Renamed from human_block_size, with new signature
6871 that allows block sizes up to UINTMAX_MAX. All callers changed.
6872 * human.h: Add copyright and authorship notice.
6873 Include <limits.h> and <stdbool.h> unconditionally.
6874 (PARAMS): Remove. All uses removed.
6875 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
6876 (enum human_inexact_style): Remove tag; now a nameless enum.
6877 (human_floor, human_ceiling, human_round_to_even): Now have
6878 values 2, 0, 1 rather than -1, 1, 0.
6879 (human_group_digits, human_suppress_point_zero, human_autoscale,
6880 human_base_1024, human_SI, human_B): New constants.
6881 (human_readable_inexact, human_block_size): Remove.
6882 (human_readable): Size args are now uintmax_t, not int.
6883 (human_options): New decl.
6885 * exclude.c: (new_exclude, add_exclude): Remove casts that are
6886 unnecessary now that we assume C89 or better. This change
6887 imported from coreutils.
6889 * mktime.c (__mktime_internal): Do not reject negative timestamps
6890 arbitrarily. This is the same patch as 2003-05-28, but it got lost
6891 in the 2003-05-30 sync from glibc.
6893 .h files should stand alone, but we shouldn't include <sys/types.h>
6894 if we can get away with just <stddef.h>.
6896 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
6897 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
6898 rather than <sys/types.h>, as we merely need size_t.
6899 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
6901 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
6902 Include <stdio.h>, to get FILE.
6903 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
6904 memcasecmp.h has included <stddef.h> and all we need is size_t.
6905 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
6906 our interface, instead of including <sys/types.h>
6908 2003-06-02 Paul Eggert <eggert@twinsun.com>
6911 Fix some minor time-related bugs with POSIX time arguments.
6912 Some valid time stamps were being rejected (notably -1, and
6913 time stamps before 1900 on 64-bit hosts). And some invalid
6914 time stamps were being accepted, e.g. September 31.
6916 * posixtm.h (posixtime): Return bool instead of time_t, so
6917 that we can return (time_t) -1 successfully.
6918 * posixtm.c: Likewise.
6919 [HAVE_STDBOOL_H]: Include <stdbool.h>.
6920 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
6921 (t): Remove static var.
6922 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
6923 of static var. All uses changed.
6924 (year): Do not reject years before 1900; they can occur with
6926 (posix_time_parse): Do not check for out-of-range components;
6927 that is now the caller's responsibility, since our checks were
6928 only approximations.
6929 (posixtime): Use mktime to check for out-of-range components,
6930 since it knows them exactly.
6931 If mktime returns (time_t) -1, check whether an error actually occurred
6932 by invoking localtime on -1.
6933 (main) [TEST_POSIXTIME]: Check for input data errors, and report
6934 posixtime failures better.
6935 Improve the test data (in comments only).
6937 2003-05-30 <karl@gnu.org>
6939 * mktime.c: update from libc.
6941 2003-05-30 Bruno Haible <bruno@clisp.org>
6943 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
6944 * localcharset.h: Likewise.
6945 * localcharset.c: Likewise.
6947 2003-05-28 Paul Eggert <eggert@twinsun.com>
6949 Assume the headers required for C89 freestanding compilers.
6950 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
6951 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
6952 without checking for HAVE_LIMITS_H.
6953 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
6954 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
6956 * fatal.c: Include <stdarg.h> without checking for __STDC__.
6957 * exclude.c: Include <stdbool.h> unconditionally.
6958 * tempname.c: Include <stddef.h> unconditionally.
6959 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
6960 * modechange.c, rpmatch.c (NULL): Don't define, since
6961 <stddef.h> does that.
6962 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
6963 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
6964 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
6965 * xstrtol.c: Likewise.
6966 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
6967 * savedir.c: Include <stddef.h> instead of defining NULL.
6969 * addext.c (addext): Use assignment rather than cast, to avoid
6970 warnings on some platforms.
6972 * mktime.c (__mktime_internal): Do not reject negative timestamps
6975 2003-05-10 Bruno Haible <bruno@clisp.org>
6977 * linebreak.c (iconv_string_length): Don't return -1 just because the
6978 string is longer than 4 KB.
6980 2003-05-12 Jim Meyering <jim@meyering.net>
6982 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
6983 the space-padded-by-default conversion specifiers, %e, %k, %l.
6985 2003-05-03 Bruno Haible <bruno@clisp.org>
6987 Upgrade to Unicode-4.0.
6988 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
6989 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
6990 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
6991 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
6992 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
6993 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
6994 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
6995 Change width of U+E0100..U+E01EF from 1 to 0.
6997 2003-04-25 Bruno Haible <bruno@clisp.org>
6999 * copy-file.c: Include <stddef.h>, for size_t.
7001 2003-04-25 Jim Meyering <jim@meyering.net>
7003 * copy-file.c (copy_file_preserving): Declare buf_size to be
7004 of type size_t, not int.
7006 2003-04-11 Jim Meyering <jim@meyering.net>
7008 Merge changes from Coreutils.
7010 2003-03-22 Jim Meyering <jim@meyering.net>
7012 * strftime.c (widen): Cast alloca return value to proper type.
7014 2003-01-19 Ulrich Drepper <drepper@redhat.com>
7017 * strftime.c (my_strftime): Handle very large width
7018 specifications for numeric values correctly. Improve checks for
7021 2003-01-19 Jim Meyering <jim@meyering.net>
7023 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7024 (nl_get_alt_digit) [! defined my_strftime]: Define.
7025 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7026 _nl_get_alt_digit and _nl_get_walt_digit.
7028 * strftime.c (my_strftime): Merge in locale-related changes from libc.
7029 These changes have no effect outside of _LIBC.
7031 2003-04-10 Bruno Haible <bruno@clisp.org>
7033 * findprog.h: New file, from GNU gettext.
7034 * findprog.c: New file, from GNU gettext.
7036 2003-04-05 Jim Meyering <jim@meyering.net>
7038 Merge changes from Coreutils.
7040 * exclude.h (PARAMS): Remove definition and uses.
7041 * exclude.c: Remove uses of `PARAMS'.
7043 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7044 Add test-cases for DOS filenames. Declare program_name.
7045 (main): Set up program_name. Patch by Rich Dawe.
7047 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7049 Use mntctl's return value to drive the entry-processing loop, since
7050 we can't rely on the value of the vmt_length member in the last
7051 entry. On some systems doing so could result in exhausting
7052 virtual memory. Based in part on a patch from Mike Jetzer.
7054 2003-04-04 Bruno Haible <bruno@clisp.org>
7056 * linebreak.h: New file, from GNU gettext.
7057 * linebreak.c: New file, from GNU gettext with slight modifications.
7058 * lbrkprop.h: New file, from GNU gettext.
7060 2003-04-03 Bruno Haible <bruno@clisp.org>
7062 * utf8-ucs4.h: New file, from GNU gettext.
7063 * utf16-ucs4.h: New file, from GNU gettext.
7064 * ucs4-utf8.h: New file, from GNU gettext.
7065 * ucs4-utf16.h: New file, from GNU gettext.
7067 2003-04-02 Bruno Haible <bruno@clisp.org>
7069 * binary-io.h: New file, from GNU gettext.
7071 2003-04-01 Bruno Haible <bruno@clisp.org>
7073 * pathname.h: New file, from GNU gettext.
7074 * concatpath.c: New file, from GNU gettext.
7076 2003-03-30 Bruno Haible <bruno@clisp.org>
7078 * copy-file.c (copy_file_preserving): Don't set owner if the function
7079 chown() doesn't exist.
7081 2003-03-28 Bruno Haible <bruno@clisp.org>
7083 * copy-file.h: New file, from GNU gettext.
7084 * copy-file.c: New file, from GNU gettext.
7086 2003-03-18 Jim Meyering <jim@meyering.net>
7088 * quote.c (quote_n): Fix typo in comment.
7090 2003-03-14 Jim Meyering <jim@meyering.net>
7092 Merge changes from Coreutils.
7093 * obstack.h (obstack_object_size): Declare temporary, __o,
7094 to be const, in order to avoid warnings.
7095 (obstack_room): Likewise.
7096 (obstack_empty_p): Likewise.
7098 2003-03-13 Paul Eggert <eggert@twinsun.com>
7100 Merge changes from Bison.
7101 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7102 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7103 when compiling Bison 1.875's `bitset bset = obstack_alloc
7104 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7105 * hash.c: Include <stdbool.h> unconditionally.
7107 2003-03-09 Paul Eggert <eggert@twinsun.com>
7109 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7110 Reported by Bruce Becker; see:
7111 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7113 2003-03-03 Paul Eggert <eggert@twinsun.com>
7114 Bruno Haible <bruno@clisp.org>
7116 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7117 Reported by John Hughes, see
7118 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7120 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
7122 * poll_.h: New file.
7125 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
7127 * mathl.h: New file.
7128 * acosl.c: New file.
7129 * asinl.c: New file.
7130 * atanl.c: New file.
7131 * ceill.c: New file.
7134 * floorl.c: New file.
7135 * frexpl.c: New file.
7136 * ldexpl.c: New file.
7138 * sincosl.c: New file.
7140 * sqrtl.c: New file.
7142 * trigl.c: New file.
7143 * trigl.h: New file.
7145 2003-02-17 Bruno Haible <bruno@clisp.org>
7147 * mkdtemp.h: New file, from GNU gettext.
7148 * mkdtemp.c: New file, from GNU gettext.
7150 2003-01-31 Bruno Haible <bruno@clisp.org>
7152 * rename.c: #undef rename before defining rpl_rename.
7153 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7155 2003-01-30 Bruno Haible <bruno@clisp.org>
7157 * printf-args.h: New file, from GNU gettext.
7158 * printf-args.c: New file, from GNU gettext.
7159 * printf-parse.h: New file, from GNU gettext.
7160 * printf-parse.c: New file, from GNU gettext.
7161 * vasnprintf.h: New file, from GNU gettext.
7162 * vasnprintf.c: New file, from GNU gettext.
7163 * asnprintf.c: New file, from GNU gettext.
7164 * vasprintf.h: New file, from GNU gettext with modifications.
7165 * vasprintf.c: New file, from GNU gettext.
7166 * asprintf.c: New file, from GNU gettext.
7168 2003-01-29 Bruno Haible <bruno@clisp.org>
7170 * stpncpy.h: New file, from GNU gettext with modifications.
7171 * stpncpy.c: New file, from GNU gettext with modifications.
7173 2003-01-28 Bruno Haible <bruno@clisp.org>
7175 * c-ctype.h: New file, from GNU gettext, with changes suggested by
7177 * c-ctype.c: New file, from GNU gettext, with changes suggested by
7180 2003-01-27 Bruno Haible <bruno@clisp.org>
7182 * xsetenv.h: New file, from GNU gettext.
7183 * xsetenv.c: New file, from GNU gettext.
7185 2003-01-23 Bruno Haible <bruno@clisp.org>
7187 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7189 2003-01-22 Bruno Haible <bruno@clisp.org>
7191 * exit.h: New file, from GNU gettext.
7193 2003-01-11 Bruno Haible <bruno@clisp.org>
7195 * stpcpy.h (stpcpy): Use ANSI C function declarations.
7196 * strcase.h (strcasecmp, strncasecmp): Likewise.
7198 2003-01-14 Jim Meyering <jim@meyering.net>
7200 * same.c (same_name): Tweak a comment.
7202 2003-01-11 Bruno Haible <bruno@clisp.org>
7204 * same.c (same_name): Reorder tests so as to avoid calling stat()
7205 when a string comparison is sufficient.
7207 2003-01-11 Bruno Haible <bruno@clisp.org>
7209 * readtokens.c (readtoken): Cast character to 'unsigned char', not
7212 2003-01-11 Bruno Haible <bruno@clisp.org>
7214 * hash-pjw.c: Add comment about low quality of this function.
7216 2003-01-12 Paul Eggert <eggert@twinsun.com>
7218 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7219 to avoid collisions with libcurses and libreadline.
7221 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7222 * getstr.h, getstr.c: Remove.
7223 * getline.c: Include "getline.h", to check interface.
7224 Move body of old getstr.c here: this defines MIN_CHUNK and
7225 declares getdelim2, which is renamed from getstr.
7226 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7228 * linebuffer.c (readlinebuffer): Renamed from readline.
7230 * linebuffer.h: Likewise.
7231 (readline): Remove backward-compatibility macro.
7233 2003-01-12 Jim Meyering <jim@meyering.net>
7235 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
7237 2003-01-10 Bruno Haible <bruno@clisp.org>
7239 * alloca_.h: New file.
7240 * getdate.y: Unconditionally include alloca.h.
7241 * makepath.c: Likewise.
7242 * setenv.c: Likewise.
7243 * userspec.c: Likewise.
7245 2003-01-09 Bruno Haible <bruno@clisp.org>
7247 * stdbool.h.in: New file.
7249 2003-01-08 Bruno Haible <bruno@clisp.org>
7251 * safe-read.c: Include specification header first, to ensure its
7253 * full-write.c: Likewise.
7255 2003-01-08 Jim Meyering <jim@meyering.net>
7257 * full-write.c: Undefine and define-away `const' after inclusion
7258 of errno.h, not before. Suggestion from Bruno Haible.
7260 2003-01-07 Jim Meyering <jim@meyering.net>
7262 * full-write.c: Rework so that it may serve to define full_read, too.
7263 * full-read.c: Simply #define FULL_READ and include full-write.c.
7265 2003-01-06 Jim Meyering <jim@meyering.net>
7267 * version-etc.c: Update year in translatable copyright string.
7269 2002-12-25 Bruno Haible <bruno@clisp.org>
7271 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7272 * xstrtol.h: Likewise.
7273 * xstrtoimax.c: Likewise.
7274 * xstrtoumax.c: Likewise.
7275 * human.h: Likewise.
7277 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7278 on systems that have <inttypes.h> but not <stdint.h>.
7280 2002-12-31 Paul Eggert <eggert@twinsun.com>
7282 * memcoll.c (memcoll): Fall back on a simple algorithm using
7283 memcmp if strcoll doesn't work.
7285 2002-12-23 Bruno Haible <bruno@clisp.org>
7287 * localcharset.h: New file.
7288 * localcharset.c: Include it.
7289 * unicodeio.c: Likewise.
7291 2002-12-22 Bruno Haible <bruno@clisp.org>
7293 * utime.c (utime_null): No need to call ftruncate if the file was
7296 2002-12-23 Bruno Haible <bruno@clisp.org>
7298 * memcoll.c (STRCOLL): New macro.
7301 2002-12-22 Bruno Haible <bruno@clisp.org>
7303 * getstr.h (getstr): Define, to avoid clash with libcurses.
7304 * linebuffer.h (readline): Define, to avoid clash with libreadline.
7306 2002-12-22 Bruno Haible <bruno@clisp.org>
7308 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7310 2002-12-23 Bruno Haible <bruno@clisp.org>
7312 * getline.h: Include <stddef.h>, for size_t.
7314 * unicodeio.h: Include <stddef.h>, for size_t.
7315 * unicodeio.c: Don't include <stddef.h>.
7317 2002-12-17 Bruno Haible <bruno@clisp.org>
7319 * canon-host.c (strdup): Remove unused declaration.
7321 * fsusage.c: Include full_read.h.
7322 (get_fs_usage): Use full_read instead of safe_read.
7324 * utime.c (utime_null): Use SAFE_READ_ERROR.
7326 2002-12-11 Bruno Haible <bruno@clisp.org>
7328 * setenv.h: Rewritten to cope with systems that have setenv() but not
7330 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7333 2002-12-11 Bruno Haible <bruno@clisp.org>
7335 * setenv.c (alloca): Fall back to malloc.
7337 (setenv): Use freea() to free memory allocated with alloca().
7339 2002-11-13 Bruno Haible <bruno@clisp.org>
7341 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7342 function declarations.
7343 * unsetenv.c (unsetenv): Likewise.
7345 2002-03-04 Bruno Haible <bruno@clisp.org>
7347 Portability to AIX 4.3.3.
7348 * unsetenv.c: New file, extracted from setenv.c.
7349 * setenv.c: Move the unsetenv() function to unsetenv.c.
7351 2001-12-20 Bruno Haible <bruno@clisp.org>
7353 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7354 use malloc instead. For SunOS 4.
7356 2001-12-11 Bruno Haible <bruno@clisp.org>
7358 * setenv.c: Declare alloca.
7359 (compar_fn_t): New typedef.
7360 (KNOWN_VALUE, STORE_VALUE): Use it.
7362 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7365 2002-12-10 Paul Eggert <eggert@twinsun.com>
7367 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7368 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7369 Choose values that are less likely to collide with system fnmatch
7371 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7372 defined (e.g., a pure POSIX system).
7373 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7374 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7376 2002-12-06 Jim Meyering <jim@meyering.net>
7378 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7380 Merge in changes from libc's misc/error.c, in preparation
7381 for the merge of gnulib's changes back into libc.
7383 * error.c (_): Define only if not already defined.
7384 Move definition to follow all #include directives.
7385 Include unlocked-io.h only if !_LIBC.
7386 [_LIBC]: Include <libio/libioP.h>.
7387 [USE_IN_LIBIO]: Include <libio/iolibio.h>
7388 (fflush): Tweak definition to use INTUSE.
7391 2002-12-05 Paul Eggert <eggert@twinsun.com>
7393 * alloca.c [defined emacs]: Include "lisp.h".
7394 (xalloc_die) [defined emacs]: New macro.
7395 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7396 [! defined emacs]: Include <xalloc.h>.
7397 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7398 (pointer): Typedef to POINTER_TYPE *.
7399 (malloc): Remove decl; we now always use xmalloc.
7400 (alloca): Use old-style definition, since Emacs needs this.
7401 Check for arithmetic overflow when computing combined size.
7403 2002-12-04 Paul Eggert <eggert@twinsun.com>
7405 Do not generate unlocked-io.h automatically, since it's easier to
7406 maintain it by hand.
7408 * unlocked-io.h: New file, from GNU diffutils,
7409 but with proper copyright notice and attribution.
7411 * Makefile.am: Add copyright notice.
7412 (libfetish_a_SOURCES): Add unlocked-io.h.
7413 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7414 (DISTCLEANFILES, io_functions): Remove macros.
7415 (EXTRA_DIST): Remove gen_uio.
7416 (unlocked-io.h): Remove rule.
7418 2002-12-04 Jim Meyering <jim@meyering.net>
7420 Reflect the fact that stat.c and lstat.c are no longer generated.
7421 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7422 (DISTCLEANFILES): Likewise.
7423 (EXTRA_DIST): Likewise.
7424 (all_local): Don't depend on stat.c or lstat.c.
7425 (stat.c, lstat.c): Remove rules.
7426 (EXTRA_DIST): Remove xstat.in.
7428 * xstat.in: Remove file. Contents moved into stat.c.
7429 * stat.c: New file. Contents mostly from xstat.in.
7430 * stat.c: Rework so that it may serve to define rpl_lstat, too.
7431 * lstat.c: New file. Simply #define LSTAT and include stat.c.
7433 * safe-read.c: Rework so that it may serve to define safe_write, too.
7434 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7436 2002-12-03 Jim Meyering <jim@meyering.net>
7438 * safe-read.c, safe-write.c: Change variable names and comments, but
7439 not semantics, to minimize the differences between these two files.
7440 (safe_read): Change comment to mention SAFE_READ_ERROR.
7442 * safe-read.c (IS_EINTR): Define.
7443 (safe_read): Use IS_EINTR in place of in-function cpp directives.
7445 2002-12-02 Bruno Haible <bruno@clisp.org>
7447 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7448 Define, taken from safe-read.c.
7449 (INT_MAX): Provide fallback.
7450 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7451 * safe-write.h (SAFE_WRITE_ERROR): Define.
7453 * safe-read.c (EINTR): Remove definition.
7454 (safe_read): Don't use EINTR if it is absent.
7456 2002-12-02 Jim Meyering <jim@meyering.net>
7458 * safe-read.c (EINTR): Define.
7459 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7460 (INT_MAX): Provide fallback.
7461 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
7463 * safe-read.h (SAFE_READ_ERROR): Define.
7465 2002-12-01 Jim Meyering <jim@meyering.net>
7467 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
7468 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
7470 2002-11-27 Paul Eggert <eggert@twinsun.com>
7472 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7473 hash_rehash): Replace `if (limit <= value) abort ();' with
7474 `if (! (value < limit)) abort ();', for readability.
7476 2002-11-26 <karl@gnu.org>
7478 * strdup.c: copy from libc again, with jim's ok.
7479 * .cppi-disable: re-add strdup.c
7481 2002-11-25 <karl@gnu.org>
7483 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
7484 instead of "strtol.c".
7486 2002-11-25 Jim Meyering <jim@meyering.net>
7488 * mktime.c: Sync from libc, now that it has the latest fix.
7490 2002-11-24 <karl@gnu.org>
7492 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
7493 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
7495 2002-11-24 Jim Meyering <jim@meyering.net>
7497 Update from coreutils:
7499 * mktime.c: Merge in changes from libc.
7501 Avoid a link-time failure on some Linux systems.
7502 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
7503 (__mon_yday): Declare with the STATIC attribute.
7504 (__mktime_internal): Likewise.
7505 Based on a report from Greg Schafer.
7507 2002-11-23 Jim Meyering <jim@meyering.net>
7509 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
7510 Use `unsigned', not `int', as type of index.
7512 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
7514 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
7516 2002-11-22 Paul Eggert <eggert@twinsun.com>
7518 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
7519 hint that one should use `if (! x) abort ();' rather than `assert
7520 (x);', and anyway it's one less thing to worry about configuring.
7521 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
7522 hash_rehash, hash_insert): Use abort rather than assert.
7524 2002-11-22 Paul Eggert <eggert@twinsun.com>
7526 * quotearg.h: Allow multiple inclusion by surrounding with
7527 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
7528 so that we can be included first.
7529 (PARAMS): Remove; we now assume C89 or later. All uses removed.
7530 * quotearg.c: Include quotearg.h immediately after config.h.
7531 No need to include stddef.h or sys/types.h any more.
7532 Surround local include files with "", not "<>".
7533 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
7534 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
7535 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
7536 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
7537 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
7538 (ISPRINT): Remove; no longer needed now that we assume C89.
7540 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
7543 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
7544 quotearg_char): Use SIZE_MAX rather than
7545 (size_t) -1 when we are talking about "infinity".
7547 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
7549 2002-11-22 Bruno Haible <bruno@clisp.org>
7551 * safe-read.h: Assume C89. Add comments.
7552 (safe_read): Change return type to size_t.
7553 * safe-read.c (safe_read): Change return type to size_t. Handle byte
7554 counts > SSIZE_MAX correctly.
7555 * safe-write.h: New file.
7556 * safe-write.c: New file.
7557 * full-read.h: New file.
7558 * full-read.c: New file.
7559 * full-write.h: Assume C89. Add comments.
7560 * full-write.c: Include safe-write.h.
7561 (full_write): Rewritten to use safe_write.
7562 Suggested by Jim Meyering and Paul Eggert.
7564 2002-11-21 Bruno Haible <bruno@clisp.org>
7566 Remove case insensitive option matching.
7567 * argmatch.h (argcasematch): Remove declaration.
7568 (ARGCASEMATCH): Remove macro.
7569 (__xargmatch_internal): Remove case_sensitive argument.
7570 (XARGMATCH): Update.
7571 (XARGCASEMATCH): Remove macro.
7572 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
7573 case_sensitive argument.
7574 (argcasematch): Remove function.
7575 (__xargmatch_internal): Remove case_sensitive argument.
7576 (main): Use XARGMATCH instead of XARGCASEMATCH.
7578 * xmalloc.c: Change compile-time error message. Add comment about
7579 required autoconf version.
7581 2002-11-21 Jim Meyering <jim@meyering.net>
7583 * strdup.c (strdup): Tweak comment and initial #if/#include.
7585 Merge in changes from the coreutils.
7587 2002-09-25 Paul Eggert <eggert@twinsun.com>
7588 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
7589 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
7590 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
7591 int. Work more efficiently if X is the same width as uintmax_t.
7592 Do not compare X to -1, to avoid bogus compiler warning.
7593 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
7594 Don't assume that f_frsize and f_bsize are the same type.
7596 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
7599 * makepath.c (make_path): Restore umask *before* creating the final
7601 (make_path): Minor reformatting.
7603 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
7604 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
7606 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
7607 ones. At least on GNU/Linux systems, `auto' means something else.
7610 2002-11-20 Paul Eggert <eggert@twinsun.com>
7612 Merge argmatch cleanups from Bison. Assume C89.
7614 * argmatch.c: Include config.h here, not in argmatch.h.
7615 Include stdlib.h, for EXIT_FAILURE.
7616 Always include <string.h>, since we assume C89.
7617 (EXIT_FAILURE): Remove pre-C89 bug workaround.
7618 * argmatch.h: Do not include <config.h> or <sys/types.h>.
7619 Include <stddef.h> instead, since it's all we need for size_t.
7620 (PARAMS): Remove. All uses removed.
7621 (ARRAY_CARDINALITY): Do not bother to #undef.
7622 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
7623 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7624 Remove unnecessary parentheses.
7625 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
7626 Insert necessary parentheses.
7627 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
7628 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
7630 2002-11-19 Bruno Haible <bruno@clisp.org>
7632 * mbswidth.c: Include mbswidth.h right at the beginning.
7633 * mbswidth.h: Include <stddef.h>, for size_t.
7635 * mbswidth.h (PARAMS): Remove macro.
7636 (mbswidth, mbsnwidth): Use ANSI C function declarations.
7637 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
7639 * gcd.h (PARAMS): Remove macro.
7640 (gcd): Use ANSI C function declarations.
7641 * gcd.c (gcd): Likewise.
7643 2002-11-15 Bruno Haible <bruno@clisp.org>
7645 * strcspn.c: Include <stddef.h>.
7646 (strcspn): Use ANSI C function declaration. Change return type to
7648 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
7649 (strpbrk): Use NULL.
7650 * strpbrk.h (PARAMS): Remove macro.
7651 (strpbrk): Use ANSI C function declaration.
7652 * strstr.c: Don't include <sys/types.h>.
7653 * strstr.h (PARAMS): Remove macro.
7654 (strstr): Use ANSI C function declarations.
7656 2002-11-06 Bruno Haible <bruno@clisp.org>
7658 * gcd.h (gcd): Change argument type to 'unsigned long'.
7659 * gcd.c (gcd): Likewise.
7661 2002-11-05 Bruno Haible <bruno@clisp.org>
7663 * gcd.h: New file, from gettext-0.11.5.
7664 * gcd.c: New file, from gettext-0.11.5.
7666 2002-11-05 Bruno Haible <bruno@clisp.org>
7668 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7669 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7670 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7671 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
7673 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7674 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
7676 * closeout.c: Include gettext.h instead of <libintl.h>.
7677 * human.c: Include gettext.h instead of <libintl.h>.
7678 * quotearg.c: Include gettext.h instead of <libintl.h>.
7679 * rpmatch.c: Include gettext.h instead of <libintl.h>.
7680 * unicodeio.c: Include gettext.h instead of <libintl.h>.
7681 * userspec.c: Include gettext.h instead of <libintl.h>.
7682 * version-etc.c: Include gettext.h instead of <libintl.h>.
7683 * xmalloc.c: Include gettext.h instead of <libintl.h>.
7684 (textdomain): Remove definition.
7685 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
7687 * long-options.c: Remove include of <libintl.h> and definition of _.
7688 * same.c: Remove include of <libintl.h> and definition of _.
7690 2002-11-04 Bruno Haible <bruno@clisp.org>
7692 * stpcpy.h: New file, from GNU gettext-0.11.5.
7693 * strcase.h: New file, from GNU gettext-0.11.5.
7694 * strpbrk.h: New file, from GNU gettext-0.11.5.
7695 * strstr.h: New file, from GNU gettext-0.11.5.
7696 * xgetcwd.h: New file, from GNU gettext-0.11.5.
7698 2002-05-09 Bruno Haible <bruno@clisp.org>
7700 * config.charset: Update for newest glibc. Add canonical names
7701 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
7703 2002-05-09 Bruno Haible <bruno@clisp.org>
7705 * localcharset.c (get_charset_aliases): Add more Windows specific
7708 2002-05-08 Owen Taylor <otaylor@redhat.com>
7710 * config.charset: A few additions for Solaris.
7712 2001-12-05 Bruno Haible <bruno@clisp.org>
7714 * localcharset.c (locale_charset): Don't return an empty string.
7716 2001-10-23 Bruno Haible <haible@clisp.cons.org>
7718 * config.charset: msdos in uk_UA uses CP1125.
7720 2001-08-05 Bruno Haible <haible@clisp.cons.org>
7722 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
7723 * localcharset.c (locale_charset): Declare as extern "C".
7725 2002-02-15 Bruno Haible <bruno@clisp.org>
7727 * config.charset [msdosdjgpp]: For Russian, use CP866.
7729 2002-02-11 Bruno Haible <bruno@clisp.org>
7731 * config.charset: Add support for NetBSD.
7733 2002-09-25 <karl@gnu.org>
7735 * strdup.c: copy from libc/string (via ../config/srclist*).
7736 * getopt*: copy from libc/posix.
7737 * gettext.h: copy from gettext.
7738 * .cppi-disable: add strdup.c, gettext.h.
7740 2002-07-01 Jim Meyering <meyering@lucent.com>
7742 * c-stack.c: Include sys/time.h.
7743 From Volker Borchert.
7745 2002-06-11 Paul Eggert <eggert@twinsun.com>
7747 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
7748 New macro. Use it uniformly instead of
7749 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
7750 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
7751 reported by Vin Shelton.
7753 2002-06-22 Jim Meyering <meyering@lucent.com>
7755 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
7756 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
7758 2002-06-22 Paul Eggert <eggert@twinsun.com>
7760 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
7761 Do not assume SA_SIGINFO behavior.
7762 Bug reported by Jim Meyering on NetBSD 1.5.2.
7764 2002-06-22 Jim Meyering <meyering@lucent.com>
7766 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
7768 * exitfail.c, exitfail.h: Likewise.
7769 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
7771 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
7773 (EXTRA_DIST): Add fnmatch_loop.c.
7774 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
7776 * fnmatch_loop.c: New file, from diffutils-2.8.2.
7777 * fnmatch.c: Update from diffutils-2.8.2.
7778 * fnmatch_.h: New file. From diffutils-2.8.2.
7779 * fnmatch.h: Remove file.
7781 2002-06-18 Paul Eggert <eggert@twinsun.com>
7783 * file-type.h: Report an error if neither S_ISREG nor
7784 S_IFREG is defined, instead of using a test specific to glibc
7785 2.2. This should be safe, since POSIX requires S_ISREG and
7786 Unix Version 7 had S_IFREG. We don't need to check for
7787 <sys/types.h> since we don't use any symbols that it defines.
7789 2002-06-15 Jim Meyering <meyering@lucent.com>
7791 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
7792 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
7793 have been included before this file.
7795 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
7797 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
7798 so that each temporary file name is unique and valid in the first
7799 8 characters, for operation under DOS.
7801 2002-06-15 Jim Meyering <meyering@lucent.com>
7803 Work even with DJGPP 2.03, which lacks support for symlinks.
7805 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
7807 * lchown.c (S_ISLNK): Likewise.
7809 2002-06-14 Jim Meyering <meyering@lucent.com>
7811 * file-type.h: Use the version from diffutils-2.8.2.
7812 * file-type.c: Likewise.
7814 2002-05-27 Jim Meyering <meyering@lucent.com>
7816 Fix a problem seen only on nonconforming systems whereby ls.c's
7817 use of localtime, and then of gettimeofday would cause trouble:
7818 the localtime call used to initialize rpl_gettimeofday's save
7819 mechanism would clobber ls's current local time information so
7820 that in any long listing the first file would always be listed
7821 with date 1970-01-01. Analysis by Volker Borchert.
7823 * gettimeofday.c (localtime): Undefine.
7824 (rpl_localtime): New function.
7826 2002-05-22 Jim Meyering <meyering@lucent.com>
7828 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
7829 * file-type.h: New file.
7830 * file-type.c (file_type): New file/function. Extracted from diffutils.
7832 2002-04-29 Paul Eggert <eggert@twinsun.com>
7834 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
7836 2002-04-28 Paul Eggert <eggert@twinsun.com>
7838 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
7839 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
7840 of 127, since 64 is the largest conceivable number for ancient
7842 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
7844 2002-04-28 Jim Meyering <meyering@lucent.com>
7846 * sig2str.c (WTERMSIG): Remove definition (unused).
7848 2002-04-28 Paul Eggert <eggert@twinsun.com>
7850 * sig2str.h, sig2str.c: New files.
7851 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
7853 2002-04-24 Jim Meyering <meyering@lucent.com>
7855 * gettext.h: New file, from Gettext.
7856 * Makefile.am (INCLUDES): Remove -I../intl.
7857 (libfetish_a_SOURCES): Add gettext.h.
7859 2002-04-16 Jim Meyering <meyering@lucent.com>
7861 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
7862 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
7863 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
7865 2002-04-12 Jim Meyering <meyering@lucent.com>
7867 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
7869 2002-03-10 Jim Meyering <meyering@lucent.com>
7871 * makepath.c (make_path): Remove a comma from a diagnostic.
7872 Suggestion from Santiago Vila.
7874 2002-03-08 Jim Meyering <meyering@lucent.com>
7876 * rename.c: Mention that this wrapper is needed also on
7877 mips-dec-ultrix4.4 systems.
7879 2002-03-02 Jim Meyering <meyering@lucent.com>
7881 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
7882 not HAVE_CLOCK_SETTIME.
7884 2002-02-27 Paul Eggert <eggert@twinsun.com>
7886 * nanosleep.h: Rename to....
7887 * timespec.h: New name for nanosleep.h. All uses changed.
7889 * gettime.c: New file.
7890 * settime.c: New file.
7893 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
7894 timespec.h. Remove nanosleep.h.
7896 2002-02-25 Paul Eggert <eggert@twinsun.com>
7898 * acl.c, acl.h: New files.
7899 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
7901 2002-02-24 Jim Meyering <meyering@lucent.com>
7903 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
7904 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
7905 cause trouble. Reported by Nelson Beebe.
7907 2002-02-23 Paul Eggert <eggert@twinsun.com>
7909 * path-concat.c (xpath_concat): Reorder code to pacify
7910 compilers that don't know that xalloc_die never returns.
7912 2002-02-20 Jim Meyering <meyering@lucent.com>
7914 * getdate.c: Regenerate using bison-1.33.
7916 2002-02-15 Paul Eggert <eggert@twinsun.com>
7918 * posixver.c, posixver.h: New files.
7919 * Makefile.am (libfetish_a_SOURCES): Add them.
7921 2002-02-02 Paul Eggert <eggert@twinsun.com>
7922 Bruno Haible <bruno@clisp.org>
7924 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
7925 (fwrite_success_callback): New declaration.
7926 * unicodeio.c (unicode_to_mb): New function, extracted from
7927 print_unicode_char. Call failure callback instead of error.
7928 (fwrite_success_callback): New function.
7929 (exit_failure_callback): New function.
7930 (fallback_failure_callback): New function.
7931 (print_unicode_char): Call unicode_to_mb.
7933 2002-01-26 Jim Meyering <meyering@lucent.com>
7935 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
7937 2002-01-22 Jim Meyering <meyering@lucent.com>
7939 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
7940 Otherwise, some versions of automake would omit the rule that makes
7941 Makefile from Makefile.in.
7943 2001-01-21 Paul Eggert <eggert@twinsun.com>
7945 * xmemcoll.h, xmemcoll.c: New files.
7946 * Makefile.am (libfetish_a_SOURCES): Add them.
7947 * memcoll.c: Include errno.h, and declare errno if not defined.
7948 (memcoll): Set errno to zero if there is no error.
7950 * quotearg.c (quotearg_buffer_restyled):
7951 Fix bug with quoting buffers containing NUL when backslashing escapes.
7952 This bug was exposed by the other changes in this patch.
7953 (quotearg_n_options): New arg ARGSIZE.
7954 All callers changed.
7955 (quoting_options_from_style): New function.
7956 (quotearg_n_style): Use it.
7957 (quotearg_n_style_mem): New function.
7959 * quotearg.h (quotearg_n_style_mem): New function.
7961 2002-01-16 Jim Meyering <meyering@lucent.com>
7963 * getdate.y: Add three semicolons, each just before a closing brace.
7964 Bison (as of version 1.31) no longer papers over that mistake.
7966 2002-02-14 Paul Eggert <eggert@twinsun.com>
7968 * backupfile.c (ISDIGIT): Comment fix.
7969 * getdate.y (ISDIGIT): Likewise.
7970 * posixtm.c (ISDIGIT, year): Likewise.
7971 * strverscmp.c (ISDIGIT): Likewise.
7972 * userspec.c (ISDIGIT): Likewise.
7974 2002-01-05 Jim Meyering <meyering@lucent.com>
7976 * version-etc.c (version_etc_copyright): Update copyright year.
7978 2001-01-19 Paul Eggert <eggert@twinsun.com>
7980 * closeout.c (close_stdout_status): If ferror (stdout), do
7981 not silently exit merely because the output buffer happens to
7982 have nothing pending.
7984 2001-12-18 Paul Eggert <eggert@twinsun.com>
7986 See the big note in ../ChangeLog.
7987 * human.c (suffixes): Prefer K to k for 1024.
7988 (generate_suffix_backwards): New function.
7989 (human_readable_inexact): Use it.
7990 * xstrtol.c (__xstrtol): If there is no number but there
7991 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
7992 Accept 'K' as well as 'k'.
7994 2001-12-15 Jim Meyering <meyering@lucent.com>
7996 * regex.h (__restrict_arr): Update from libc.
7998 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
7999 as `remote' if the name starts with `//'. Suggested by Michael Stone.
8002 2001-12-10 Jim Meyering <meyering@lucent.com>
8004 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8005 Instead, include "xalloc.h".
8006 (initbuffer): Don't cast xmalloc return value to char*.
8007 (readline): Reword comment.
8008 Don't cast xrealloc return value to char*
8011 2001-12-09 Jim Meyering <meyering@lucent.com>
8013 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8014 `signed and unsigned type in conditional expression'.
8015 * posixtm.c (posix_time_parse): Likewise.
8017 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8019 * readtokens.c (readtoken): Declare an index to be of type unsigned
8020 to avoid a pedantic warning.
8022 * getstr.c: Don't include assert.h.
8023 (getstr): Remove warning-evoking assertions.
8024 Return -1 if offset parameter is out of bounds.
8025 Change the type of a local from int to size_t.
8027 * strftime.c (my_strftime_localtime_r): Include this function
8028 definition in the `#if ! HAVE_TM_GMTOFF' block.
8030 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8031 Include xalloc.h instead.
8033 2001-12-02 Jim Meyering <meyering@lucent.com>
8035 * tempname.c: Don't declare getenv, thus reverting the change of
8036 2001-11-18. It's no longer necessary, now that stdlib.h is always
8039 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8040 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
8042 2001-11-30 Akim Demaille <akim@epita.fr>
8044 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8045 before being defined.
8047 2001-11-27 Paul Eggert <eggert@twinsun.com>
8049 * quotearg.h (quotearg_n, quotearg_n_style):
8050 First arg is int, not unsigned.
8051 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8052 (SIZE_MAX, UINT_MAX): New macros.
8053 (quotearg_n_options): Abort if N is negative.
8054 Avoid overflow check on hosts where size_t is 64 bits and int
8055 is 32 bits, as overflow is impossible there.
8056 Fix off-by-one typo that caused unnecessary reallocation.
8058 2001-11-27 Jim Meyering <meyering@lucent.com>
8060 * tempname.c: Merge with version from libc.
8061 * regex.c: Likewise.
8063 * tempname.c: Include stdlib.h unconditionally. On some old systems
8064 for which STDC_HEADERS is 0, it was not included, resulting in a
8065 warning about an integer-to-pointer conversion problem with getenv.
8066 Reported by Volker Borchert.
8068 2001-11-26 Jim Meyering <meyering@lucent.com>
8070 * gtod.h: Remove file.
8071 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8072 * gettimeofday.c: Don't include gtod.h.
8073 (GTOD_init): Remove function.
8074 (rpl_gettimeofday): Do its job here instead, rather than aborting.
8075 Suggestion from Volker Borchert.
8077 2001-11-23 Jim Meyering <meyering@lucent.com>
8079 * hash.h (struct hash_table): Don't define here. Merely declare it.
8080 * hash.c (struct hash_table): Define it here instead.
8082 2001-11-22 Jim Meyering <meyering@lucent.com>
8084 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8086 2001-11-18 Paul Eggert <eggert@twinsun.com>
8088 * tempname.c (TMP_MAX): Remove; no longer needed.
8089 (TEMPORARIES): New macro.
8090 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
8091 removes an artificial limitation (e.g. HP-UX 10.20, where
8094 2001-11-18 Jim Meyering <meyering@lucent.com>
8096 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8099 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8100 files will be created before anything else.
8102 2001-11-17 Jim Meyering <meyering@lucent.com>
8104 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8105 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8106 rather than group writable. Patch by Juan F. Codagnone.
8108 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8109 Instead, include "xalloc.h".
8111 * mountlist.c: Include unlocked-io.h after all system headers.
8112 Remove explicit declarations of xmalloc, xrealloc,
8113 and xstrdup. Instead, include "xalloc.h".
8115 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8116 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8117 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8119 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8120 Reported by Padraig Brady.
8122 * mkstemp.c: #undef mkstemp.
8124 (rpl_mkstemp): Rename from mkstemp.
8127 2001-11-16 Jim Meyering <meyering@lucent.com>
8129 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8130 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8131 determine the amount of total physical memory, use pstat_getstatic.
8132 HPUX-11 doesn't define _SC_PHYS_PAGES.
8133 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8134 If sysconf couldn't be used to determine the amount of available
8135 physical memory, use both pstat_getstatic and pstat_getdynamic.
8136 Based on a patch from Bob Proulx.
8138 2001-11-05 Jim Meyering <meyering@lucent.com>
8140 * xstat.in (slash_aware_lstat): Correct a misleading comment.
8142 2001-11-03 Jim Meyering <meyering@lucent.com>
8144 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8145 in argmatch_to_argument call.
8147 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8150 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8151 e.g., a fault due to an attempt to free a NULL pointer.
8153 2001-11-01 Jim Meyering <meyering@lucent.com>
8155 * dirfd.c, dirfd.h: New files.
8156 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8158 * hash.c (hash_print) [TESTING]: Clean up.
8160 2001-10-22 Paul Eggert <eggert@twinsun.com>
8162 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8163 to avoid a warning if -Wall.
8165 2001-10-21 Paul Eggert <eggert@twinsun.com>
8167 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8169 2001-10-21 Jim Meyering <meyering@lucent.com>
8171 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
8172 this code would end up calling gettext even in packages built
8174 * getopt.c (_): Likewise.
8175 * regex.c (_): Likewise.
8177 2001-10-20 Paul Eggert <eggert@twinsun.com>
8179 * error.c (strerror_r): Do not declare unless !_LIBC.
8180 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8181 Use strerror_r that is only a macro, even if it is not a function.
8182 (strerror): Check for HAVE_DECL_STRERROR before declaring.
8183 (private_strerror): Use prototypes, not old-style function definition.
8184 (print_errno_message): New function.
8185 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8187 (error_tail, error, error_at_line): Use it.
8189 2001-10-11 Jim Meyering <meyering@lucent.com>
8191 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8192 and quote_n (1, ... to avoid clobbering a buffer.
8194 2001-10-05 Jim Meyering <meyering@lucent.com>
8196 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8197 * hash-pjw.c: New file (factored out of fileutils' remove.c).
8198 * hash-pjw.h: New file.
8200 2001-09-30 Jim Meyering <meyering@lucent.com>
8202 * mountlist.c [MOUNTED_GETFSSTAT]:
8203 Include <sys/ucred.h>, for Apple Darwin.
8204 Include sys/mount.h and sys/fs_types.h only if available.
8206 (read_filesystem_list): Use FS_TYPE.
8208 2001-09-29 Paul Eggert <eggert@twinsun.com>
8210 * exclude.c (excluded_filename): 0 -> false, since it's
8213 2001-09-28 Paul Eggert <eggert@twinsun.com>
8215 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8216 #defines strtoimax. Also treat the other strto* functions
8219 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8220 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8221 (strtoimax, strtoumax): Do not declare if already defined as a macro.
8223 2001-09-26 Jim Meyering <meyering@lucent.com>
8225 Most macros in unlocked-io.h had the wrong number of arguments.
8226 * gen-uio: New script.
8227 (USE_UNLOCKED_IO): Define to 1 if not already defined.
8228 * unlocked-io.hin: Remove file.
8229 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8230 rather than trying to embed it here.
8231 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
8232 Reported by Padraig Brady.
8234 2001-09-25 Volker Borchert <bt@teknon.de>
8236 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8238 2001-09-23 Jim Meyering <meyering@lucent.com>
8240 * mountlist.c: Remove useless parentheses in #if directives.
8241 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8242 the deprecated MOUNTED symbol is no longer defined in mntent.h.
8244 2001-09-22 Jim Meyering <meyering@lucent.com>
8246 * localcharset.c: Update from latest gettext.
8247 * config.charset: Likewise.
8249 2001-09-20 Jim Meyering <meyering@lucent.com>
8251 * xstrtol.c (strtoimax): Guard declaration with
8252 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8253 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8254 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8255 (strtoumax): Likewise, for completeness (it wasn't necessary).
8257 2001-09-06 Paul Eggert <eggert@twinsun.com>
8259 * strtoimax.c (HAVE_LONG_LONG):
8260 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8261 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8262 to work around bug in IBM C compiler.
8264 2001-09-16 Jim Meyering <meyering@lucent.com>
8266 * mkdir.c: New file.
8268 2001-09-04 Paul Eggert <eggert@twinsun.com>
8270 * xgetcwd.c: Revert some of the previous change; intead,
8271 fix the HAVE_GETCWD_NULL code to behave more like the
8272 !HAVE_GETCWD_NULL code used to.
8275 (xgetcwd): Do not return NULL when memory is exhausted; instead,
8278 2001-09-04 Paul Eggert <eggert@twinsun.com>
8280 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
8281 Use ssize_t, not int, to store result of readlink.
8282 Check for ssize_t overflow as well as size_t overflow,
8283 as POSIX says the result of readlink is implementation-defined
8284 when ssize_t overflows.
8285 Remove unnecessary cast to char*.
8286 Use free+malloc instead of realloc, as the storage doesn't need
8287 to be preserved and it's clearer and can be more efficient that way.
8288 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8289 * xreadlink.h (xreadlink): Update prototype.
8291 2001-09-03 Paul Eggert <eggert@twinsun.com>
8293 * exclude.c (fnmatch_no_wildcards): Fix confusion between
8294 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
8295 spotted by Jim Meyering.
8297 2001-09-03 Jim Meyering <meyering@lucent.com>
8299 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8301 2001-09-03 Paul Eggert <eggert@twinsun.com>
8303 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8304 like the HAVE_GETCWD_NULL code.
8305 Include pathmax.h if not HAVE_GETCWD.
8306 Do not include xalloc.h.
8307 (INITIAL_BUFFER_SIZE): New symbol.
8308 Do not use xmalloc / xrealloc, since the caller is responsible for
8309 handling errors. Preserve errno around `free' during failure.
8310 Do not overrun buffer when using getwd.
8312 2001-09-03 Paul Eggert <eggert@twinsun.com>
8314 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8315 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8317 2001-09-02 Jim Meyering <meyering@lucent.com>
8319 * error.c: Update from GNU libc.
8321 2001-09-01 Jim Meyering <meyering@lucent.com>
8323 * xreadlink.c: New file.
8324 * xreadlink.h: New file.
8325 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8327 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8328 doesn't conflict with sparc Solaris 7's definition in
8329 /usr/include/sys/int_types.h.
8331 * exclude.c: Use `""', not `<>' to #include non-system header files.
8332 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8333 and strncasecmp as r-values. Unixware didn't have declarations.
8335 2001-08-31 Jim Meyering <meyering@lucent.com>
8337 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8338 Use an initial, malloc'd, buffer of length 128 rather than
8339 a statically allocated one of length 1024.
8341 2001-08-30 Paul Eggert <eggert@twinsun.com>
8343 * xgetcwd.c: Don't include pathmax.h.
8344 Include stdlib.h and unistd.h if available.
8346 (xmalloc, xstrdup, free): Remove decls.
8347 (xgetcwd): Don't assume sizes fit in unsigned.
8348 Check for overflow when computing sizes.
8349 Simplify reallocation code.
8351 2001-08-28 Paul Eggert <eggert@twinsun.com>
8353 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8355 * strtoimax.c: Renamed from strtoxmax.c, removing the
8358 Also, make the following further changes to make this file's
8359 configuration more similar to that of strtol.c:
8360 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
8361 (strtoumax, uintmax_t, strtoull, strtol): Remove.
8362 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8363 (strtoimax): Renamed from strtoumax. All uses of unsigned values
8364 changed to signed values.
8366 And make the following changes as well:
8367 Fix copyright notice, as 1999 was missing.
8368 (verify): New macro.
8369 (strtoimax): Check sizes at compile-time, not run-time.
8370 Prefer strtol to strtoll if both work.
8371 (main): Remove; it was not that useful and was a pain to maintain.
8373 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8375 2001-08-30 Paul Eggert <eggert@twinsun.com>
8377 * savedir.c (savedir): Remove size parameter, as POSIX says that
8378 a directory's st_size can have an arbitrary value, so the old
8379 usage could waste an arbitrary amount of memory. All uses
8381 * savedir.h: Update prototype.
8383 2001-08-30 Paul Eggert <eggert@twinsun.com>
8385 * xstrtol.c (strtoimax): New decl.
8387 2001-08-28 Paul Eggert <eggert@twinsun.com>
8389 * xstrtol.h: Add copyright notice.
8390 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8391 LONGINT_INVALID_SUFFIX_CHAR.
8393 2001-08-30 Paul Eggert <eggert@twinsun.com>
8395 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8398 2001-08-30 Paul Eggert <eggert@twinsun.com>
8400 * hash.c: Remove '2001' from copyright notice.
8402 2001-08-30 Paul Eggert <eggert@twinsun.com>
8404 * full-write.h: New file.
8405 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8406 * full-write.c: Correct credits, as cccp.c no longer
8407 exists and anyway it was so heavily changed from the old cccp
8408 code as to be unrecognizable. Include full-write.h.
8409 (full_write) Return size_t, with short writes meaning failure.
8410 All callers changed. This fixes a bug with large buffers
8412 * utime.c: Include full-write.h.
8414 2001-08-30 Paul Eggert <eggert@twinsun.com>
8416 Merge 'exclude' changes from tar 1.13.22.
8417 This fixes one or two unlikely storage allocation overflow bugs,
8418 but doesn't change user-visible behavior otherwise.
8420 2001-08-30 Paul Eggert <eggert@twinsun.com>
8422 * exclude.c (bool): Declare, perhaps by including stdbool.h.
8423 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8424 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8425 Include if available.
8426 (<xalloc.h>): Include
8427 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8428 (verify): New macro. Use it to verify that EXCLUDE macros do not
8429 collide with FNM macros.
8430 (struct patopts): New struct.
8431 (struct exclude): Use it, as exclude patterns now come with options.
8432 (new_exclude): Support above changes.
8433 (new_exclude, add_exclude_file):
8434 Initial size must now be a power of two to simplify overflow checking.
8435 (free_exclude, fnmatch_no_wildcards): New function.
8436 (excluded_filename): No longer requires options arg, as the options
8437 are determined by add_exclude. Now returns bool, not int.
8438 (excluded_filename, add_exclude):
8439 Add support for the fancy new exclusion options.
8440 (add_exclude, add_exclude_file): Now takes int options arg.
8441 Check for arithmetic overflow when computing sizes.
8442 (add_exclude_file): xrealloc might modify errno, so don't
8443 realloc until after errno might be used.
8445 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8447 (free_exclude): New decl.
8448 (add_exclude, add_exclude_file): Now takes int options arg.
8449 (excluded_filename): No longer requires options arg, as the options
8450 are determined by add_exclude. Now returns bool, not int.
8452 2001-08-30 Paul Eggert <eggert@twinsun.com>
8454 * alloca.c (alloca): Arg is of type size_t, not unsigned.
8456 2001-08-27 Jim Meyering <meyering@lucent.com>
8458 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
8460 * version-etc.c (N_): Remove definition.
8461 Revert most of last change.
8462 Instead, simply don't mark the `Copyright...' string for translation.
8463 Based on advice from Paul Eggert.
8465 * strtoxmax.c: Tweak comment.
8467 2001-08-26 Jim Meyering <meyering@lucent.com>
8469 * version-etc.c (version_etc_copyright_fmt): Replace literal year
8470 of copyright with `%s' so translators don't get an untranslated
8472 (COPYRIGHT_YEAR): Define.
8473 (version_etc): Use fprintf rather than fputs.
8474 Suggestion from Ulrich Drepper.
8476 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
8478 * strtoll.c: New file, from GNU libc.
8479 * xstrtoimax.c: New file.
8481 * xstrtol.h: Add xstrtoimax.
8482 * strtoumax.c: New file. Simply include "strtoumax.c".
8483 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
8485 * strtoumax.c: Factor to work both for unsigned and signed types, ...
8486 * strtoxmax.c: ... then renamed to this.
8488 2001-08-13 Paul Eggert <eggert@twinsun.com>
8490 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
8491 Port to Solaris 8, where 'sed' requires a space after the 'r'
8492 command, and where sh dislikes "$/". Clean up the spacing a bit.
8493 Redirect output to $tmp just once.
8495 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
8497 * addext.c (<errno.h>): Include.
8498 (errno): Declare if not defined.
8499 (addext): Work correctly when pathconf returns -1 and leaves
8500 errno alone because there is no limit. Also, work even if
8501 pathconf returns a value greater than SIZE_MAX.
8503 2001-08-12 Jim Meyering <meyering@lucent.com>
8505 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
8506 Simply `return getcwd (NULL, 0);'.
8507 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
8508 Use 1300 as initial value for length, not PATH_MAX.
8510 * pathmax.h: Clean up cpp syntax.
8512 2001-08-12 Jim Meyering <meyering@lucent.com>
8514 * gettimeofday.c: New file.
8516 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
8518 2001-08-04 Jim Meyering <meyering@lucent.com>
8520 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
8521 to get in sync with glibc.
8523 2001-08-03 Paul Eggert <eggert@twinsun.com>
8525 The following changes are from gettext 0.10.39 as maintained by
8528 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
8529 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
8530 with inverted sense. All uses changed.
8532 * mbswidth.c: Don't include <limits.h>.
8533 Include <stdlib.h> and <string.h> unconditionally.
8534 (iswcntrl, mbsinit, ISCNTRL): New macros.
8535 (mbsnwidth): Use K&R style function declarations.
8536 Don't bother checking for MB_LEN_MAX == 1, since the compiler
8537 can optimize it when MB_CUR_MAX == 1.
8538 The width of control characters is zero, not 1.
8540 2001-07-15 Jim Meyering <meyering@lucent.com>
8542 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
8543 (BUILT_SOURCES): Add unlocked-io.h.
8544 (io_functions): Define.
8545 (unlocked-io.h): New rule.
8546 (DISTCLEANFILES): Add unlocked-io.h.
8547 (all-local): Depend on unlocked-io.h, to ensure it is created.
8549 * unlocked-io.hin: New file
8551 * regex.c: Update from glibc.
8553 2001-07-05 Jim Meyering <meyering@lucent.com>
8555 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
8557 (libfetish_a_SOURCES): Put all .h files here instead.
8558 Remove a thus-exposed (better checks in automake) duplicate and
8559 two unnecessary .h files.
8561 2001-06-11 Jim Meyering <meyering@lucent.com>
8563 * regex.c: Update from GNU libc.
8565 2001-05-27 Jim Meyering <meyering@lucent.com>
8567 * readutmp.h (UT_TYPE): Define.
8569 2001-05-24 Jim Meyering <meyering@lucent.com>
8571 * argmatch.c: Include "quote.h".
8572 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
8573 quote function. Reported by Göran Uddeborg.
8575 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
8577 * dirname.c (dir_name): Compute append_dot using path, not newpath
8578 which is not yet declared.
8580 2001-05-11 Paul Eggert <eggert@twinsun.com>
8582 * Makefile.am (libfetish_a_SOURCES):
8583 Add strftime.c, since we now compile it on all hosts.
8585 * strftime.c (my_strftime):
8586 Define to nstrftime if emacs, but only if my_strftime is not defined.
8587 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
8588 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
8589 Add one more extra argument: a nanoseconds value.
8592 (my_strftime function): Add %N format.
8593 (emacs_strftimeu): Renamed from emacs_strftime,
8594 with extra ut argument.
8596 2001-05-11 Paul Eggert <eggert@twinsun.com>
8598 dirname code cleanup. base_name now behaves more compatibly
8599 with POSIX basename when given file names that have trailing
8600 slashes, and similarly for dir_name. Add new primitives
8601 base_len and dir_len. Put the directory-name-related decls
8604 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
8605 * backupfile.c (base_name): Likewise.
8606 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
8607 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
8608 * makepath.c (strip_trailing_slashes): Likewise.
8609 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
8611 * rename.c (strip_trailing_slashes): Likewise.
8612 * same.c (base_name): Likewise.
8613 * stripslash.c (ISSLASH): Likewise.
8615 * addext.c: Include <dirname.h> after size_t is defined.
8616 * backupfile.c: Likewise.
8618 * addext.c (addext): Use base_len to trim redundant
8619 trailing slashes instead of doing it ourselves.
8620 But do not trim the last slash if it is not redundant.
8622 * backupfile.c (find_backup_file_name,
8623 max_backup_version): Use base_len instead of rolling it ourselves.
8624 Handle the case of "" and (on DOS) "C:" correctly.
8626 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
8627 Include <string.h>, <dirname.h>.
8628 (base_name): Allow file names ending in slashes, other than names
8629 that are all slashes. In this case, return the basename followed
8630 by the slashes. This is more general, and can be used in places
8631 where the original base_name purposely had an assertion failure.
8632 (base_len): New function.
8634 * dirname.c: Include <string.h> instead of <stdlib.h>.
8635 Do not include <assert.h>; no longer needed.
8637 (memrchr): Remove decl.
8638 (dir_name_r): Remove.
8639 (dir_len): Renamed from dirlen. All callers changed.
8640 Rewrite in terms of base_name, for simplicity and consistency.
8641 (dir_name): Never return NULL. All callers changed.
8642 Do not include <stdlib.h> in test program; no longer needed.
8643 return 0; is fine for test program.
8645 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
8647 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
8649 * path-concat.c (path_concat): Use base_len to compute
8650 base length, not strlen; this means we cannot rely on memcpy
8653 * same.c (STREQ): Remove.
8654 (same_name): Handle the case where the basename ends in trailing '/'.
8656 * stripslash.c (strip_trailing_slashes): Return nonzero if
8657 a slash was stripped. Do not strip the last slash after a
8660 2001-04-08 Jim Meyering <meyering@lucent.com>
8662 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
8663 recomputed; that's necessary when the offset spans a DST transition.
8664 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
8666 2001-04-02 Jim Meyering <meyering@lucent.com>
8668 * regex.h, regex.c: Update from GNU libc.
8670 2001-03-19 Paul Eggert <eggert@twinsun.com>
8672 * version-etc.c (version_etc_copyright): Update to 2001.
8674 2001-03-16 Paul Eggert <eggert@twinsun.com>
8676 * tempname.c (uint64_t): Define to uintmax_t if
8677 not defined, and if UINT64_MAX is not defined.
8678 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
8679 Reported by John David Anglin.
8681 2001-03-10 Bruno Haible <haible@clisp.cons.org>
8683 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
8684 alias if codeset is empty.
8685 * config.charset (BeOS): Use wildcard syntax.
8687 2001-03-13 Jim Meyering <meyering@lucent.com>
8689 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
8690 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
8693 2001-03-06 Bruno Haible <haible@clisp.cons.org>
8695 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
8697 * unicodeio.c (print_unicode_char): Simplify accordingly.
8699 2001-03-06 Bruno Haible <haible@clisp.cons.org>
8701 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
8702 support for DOS/DJGPP.
8704 2001-02-28 Paul Eggert <eggert@twinsun.com>
8706 * Makefile.am (libfetish_a_SOURCES):
8707 Add dup-safer.c, fopen-safer.c.
8708 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
8710 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
8712 2001-02-25 Paul Eggert <eggert@twinsun.com>
8714 The mkstemp replacement is taken from glibc 2.2.2, with some
8715 portability fixes for use outside glibc, as follows:
8717 * tempname.c (struct_stat64): New macro.
8718 (direxists, __gen_tempname): Use it.
8719 This avoids a portability problem with Solaris 8.
8721 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
8722 (<stddef.h>, <stdint.h>, <string.h>):
8723 Include only if STDC_HEADERS || _LIBC.
8724 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
8725 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
8726 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
8727 (__set_errno): Define this macro if <errno.h> doesn't.
8728 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
8729 Define these macros if <stdio.h> doesn't.
8730 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
8731 Define these macros if <sys/stat.h>
8732 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
8733 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
8734 __xstat64): Define if not _LIBC.
8735 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
8736 (__gen_tempname): Invoke gettimeofday only if
8737 HAVE_GETTIMEOFDAY || _LIBC;
8738 otherwise, fall back on plain "time".
8739 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
8741 * mkstemp.c (__GT_FILE): Define to zero if not defined.
8743 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
8745 2001-02-17 Jim Meyering <meyering@lucent.com>
8747 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
8748 around included file name.
8750 * strnlen.c (__strnlen): Merge in a change from GNU libc.
8752 * strftime.c: Update from GNU libc (the only changes were to comments).
8754 2001-02-13 Bruno Haible <haible@clisp.cons.org>
8756 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
8758 2001-02-17 Paul Eggert <eggert@twinsun.com>
8760 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
8761 Remove workaround macros for hosts that have mbrtowc but not
8762 mbstate_t, as we now insist on proper declarations for both
8763 before using mbrtowc.
8765 2001-02-17 Jim Meyering <meyering@lucent.com>
8767 * regex.c: Update from libc.
8769 2001-02-16 Paul Eggert <eggert@twinsun.com>
8771 * alloca.c (malloc): Undef before defining, since stdlib.h
8772 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
8773 Reported by Mark Hounschell via Paul Eggert.
8775 2001-01-30 Bruno Haible <haible@clisp.cons.org>
8777 * config.charset: Update for FreeBSD 4.2.
8779 2001-01-26 Jim Meyering <meyering@lucent.com>
8781 * quotearg.c: Include stddef.h.
8782 * quote.c: Include stddef.h.
8783 Reported by Axel Kittenberger.
8785 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
8786 line in double quotes so that it evokes a better diagnostic.
8787 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
8788 Reported by Axel Kittenberger.
8790 2001-01-15 Bruno Haible <haible@clisp.cons.org>
8792 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
8793 to avoid a warning. Add back 'const' to inptr.
8795 2001-01-16 Jim Meyering <meyering@lucent.com>
8797 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
8800 2001-01-14 Jim Meyering <meyering@lucent.com>
8802 * rename.c: New file. From Volker Borchert.
8803 Include stdlib.h, string.h or strings.h, and xalloc.h.
8804 Use strip_trailing_slashes rather than open-coding it.
8806 2001-01-03 Paul Eggert <eggert@twinsun.com>
8808 * strftime.c: Sync with glibc time/strftime.c 1.81.
8810 2001-01-03 Jim Meyering <meyering@lucent.com>
8812 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
8813 local `inptr' to avoid warning with some system declarations of iconv.
8815 2000-12-29 Paul Eggert <eggert@twinsun.com>
8817 * modechange.c: Do not assume that mode_t uses the
8818 traditional octal encoding. E.g. "chmod 1 FOO" should set
8819 the other-execute bit of FOO even if S_IXOTH != 1.
8821 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
8822 WOTH, XOTH, ALLM): New macros.
8823 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
8824 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
8826 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
8827 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
8829 No need to use uintmax_t; unsigned long is long enough.
8830 Don't bother to get suffix since we don't use it.
8832 2000-12-24 Jim Meyering <meyering@lucent.com>
8834 * hash.c (is_prime): Return explicit boolean values.
8835 (hash_get_first): Return NULL to appease Irix5.6's 89.
8836 Reported by Nelson Beebe.
8838 2000-10-31 Bruno Haible <haible@clisp.cons.org>
8840 * localcharset.c (locale_charset): Add support for Win32.
8842 2000-12-18 Paul Eggert <eggert@twinsun.com>
8844 * physmem.h, physmem.c: New files.
8846 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
8847 (noinst_HEADERS): Add physmem.h.
8849 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
8850 't' for compatibility with Solaris 8 sort.
8852 2000-12-18 Bruno Haible <haible@clisp.cons.org>
8854 * config.charset: Add support for BeOS.
8856 2000-12-16 Jim Meyering <meyering@lucent.com>
8858 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
8859 SHELLS_FILE to a file name that's useful on djgpp systems.
8861 (ADDITIONAL_DEFAULT_SHELLS): Define.
8862 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
8863 Based mostly on a patch from Prashant TR.
8865 2000-12-16 Jim Meyering <meyering@lucent.com>
8867 This bug had a serious impact on chown: `chown N:M FILE' (for integer
8868 N and M) would have treated it like `chown N:N FILE'.
8870 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
8872 2000-10-31 Bruno Haible <haible@clisp.cons.org>
8874 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
8875 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
8876 to the list of canonical encodings. Rename EUC-CN to GB2312.
8878 2000-12-08 Andreas Schwab <schwab@suse.de>
8880 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
8881 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
8883 2000-12-07 Jim Meyering <meyering@lucent.com>
8885 * stripslash.c (ISSLASH): Define.
8886 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
8889 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
8890 (dir_name_r): Declare this function as static.
8891 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
8892 manifest itself on a name containing a mix of slashes and
8894 Make this function work with names starting with a DOS-style
8895 drive letter and colon prefix.
8896 (dir_name): Append `.' if necessary.
8897 Based mostly on patches from Prashant TR and Eli Zaretskii.
8899 * dirname.h (dir_name_r): Remove prototype.
8901 2000-12-05 Jim Meyering <meyering@lucent.com>
8903 * dirname.c (dir_name_r): Add `const' in a few local declarations.
8905 2000-12-04 Jim Meyering <meyering@lucent.com>
8907 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
8908 Also include memory.h, stdlib.h, unistd.h if appropriate.
8909 Reported by Andreas Jaeger (conflicting declaration of malloc).
8911 2000-12-02 Jim Meyering <meyering@lucent.com>
8913 * closeout.h: Make idempotent, to avoid some obscure warnings.
8915 2000-12-01 Paul Eggert <eggert@twinsun.com>
8917 * memrchr.c: Include <config.h> before any system include file.
8919 2000-11-29 Paul Eggert <eggert@twinsun.com>
8921 * dirname.c (dir_name_r): Fix typo: int -> size_t.
8923 2000-11-26 Jim Meyering <meyering@lucent.com>
8925 * memcoll.c: Include sys/types.h. From Werner Almesberger.
8927 2000-11-22 Paul Eggert <eggert@twinsun.com>
8929 * strftime.c (my_strftime): Do not invoke mbrlen with a
8930 size of (size_t) -1; it's not portable.
8932 2000-11-17 Akim Demaille <akim@epita.fr>
8934 * obstack.h: Formatting changes.
8935 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
8936 prevent type checking.
8937 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
8938 cast the value to (void *): assigning a `foo *' to a `void *'
8940 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
8942 2000-11-17 Jim Meyering <meyering@lucent.com>
8944 * strstr.c: Update from GNU libc.
8946 2000-11-16 Jim Meyering <meyering@lucent.com>
8948 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
8950 2000-11-11 Jim Meyering <meyering@lucent.com>
8952 * error.c: Add a couple #includes, merging from GNU libc version.
8954 2000-11-10 Jim Meyering <meyering@lucent.com>
8956 * obstack.h: Update from GNU libc.
8957 * obstack.c: Likewise.
8959 2000-11-06 Paul Eggert <eggert@twinsun.com>
8961 * getusershell.c (setusershell): Use rewind rather than
8962 fseek/fseeko, to avoid configuration hassles with fseeko.
8963 Don't bother opening SHELLS_FILE if shellstream is NULL;
8966 2000-11-05 Jim Meyering <meyering@lucent.com>
8968 * makepath.h (make_dir): Declare.
8969 * makepath.c (make_dir): Remove `static' attribute.
8972 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
8974 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
8975 last one in a bucket, advance to the next bucket.
8977 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
8979 * fnmatch.c: Do not comment out all the code if we are using
8980 the GNU C library, because in some cases we are replacing buggy
8981 code in the GNU C library itself.
8983 2000-10-30 Paul Eggert <eggert@twinsun.com>
8985 * error.h, getline.h, modechange.h:
8986 Remove "2000" from Copyright line, as the file hasn't been
8987 changed this year other than in the copyright notice.
8989 * xalloc.h: Add "2000" to Copyright line, as this file
8990 was changed this year.
8992 2000-10-30 Paul Eggert <eggert@twinsun.com>
8994 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
8995 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
8996 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
8998 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
9000 * regex.h (__restrict_arr): Move definition out of #ifndef block.
9001 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9002 doesn't define __restrict_arr.
9004 2000-10-29 Jim Meyering <meyering@lucent.com>
9006 * xstat.in: Fix grammar in comment.
9008 2000-10-28 Jim Meyering <meyering@lucent.com>
9010 * memchr.c: Update from libc.
9011 Adjust for portability:
9012 [HAVE_STDLIB_H]: Include stdlib.h.
9013 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9014 Undef __memchr, too.
9015 [!weak_alias]: Define __memchr to memchr.
9017 * regex.c: Update from libc.
9018 * regex.h: Likewise.
9019 * getopt1.c: Likewise.
9020 * memcmp.c: Likewise.
9022 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9023 Avoid using fseek, when possible -- it's broken by design.
9024 Patch by Ulrich Drepper.
9026 2000-10-26 Jim Meyering <meyering@lucent.com>
9028 * strftime.c: Update from libc.
9030 2000-10-25 Jim Meyering <meyering@lucent.com>
9032 * obstack.c: Update from libc.
9034 2000-10-23 Jim Meyering <meyering@lucent.com>
9036 * hard-locale.c (hard_locale): Revert last change -- it was simply
9037 wrong. That set_locale call must not have any side effects.
9040 2000-10-22 Jim Meyering <meyering@lucent.com>
9042 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9043 [CYCLIC]: Remove now-unused definition.
9045 * save-cwd.c (O_DIRECTORY): Define, if needed.
9046 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9047 Suggestion from Ulrich Drepper.
9049 2000-10-21 Jim Meyering <meyering@lucent.com>
9051 * dirname.c (dir_name_r): New function, factored out of dir_name.
9052 (dir_name): Use dir_name_r.
9053 * dirname.h (dir_name_r): Declare it.
9055 2000-10-21 Jim Meyering <meyering@lucent.com>
9057 * dirname.c (memrchr): Declare if necessary.
9058 (dir_name): Remove the restriction that there be no
9059 trailing slashes. Now, this code skips past them, effectively
9061 [TEST_DIRNAME] (main): New unit tests.
9063 * memrchr.c: New file from GNU libc.
9064 Undef __memrchr, too.
9065 [!weak_alias]: Define __memrchr to memrchr.
9066 Guard weak_alias use with `#ifdef weak_alias'.
9068 2000-10-17 Jim Meyering <meyering@lucent.com>
9070 * quote.h (PARAMS): Define and use.
9071 Reported by Akim Demaille.
9073 * getopt.c: Update from libc.
9075 2000-10-16 Jim Meyering <meyering@lucent.com>
9077 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9080 2000-09-25 Jim Meyering <meyering@lucent.com>
9082 * md5.h (rol): Define (from GnuPG).
9084 * sha.c: Give credit (GnuPG) where due.
9085 (M): Use rol rather than open-coding it.
9086 Add a FIXME comment.
9088 2000-09-21 Jim Meyering <meyering@lucent.com>
9090 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9091 Reported by Michael Stone.
9093 2000-09-20 Jim Meyering <meyering@lucent.com>
9095 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9096 (noinst_HEADERS): Add sha.h.
9097 Based on code from Scott G. Miller and from GnuPG.
9099 2000-09-15 Jim Meyering <meyering@lucent.com>
9101 * regex.c: Update from libc.
9103 2000-09-10 Jim Meyering <meyering@lucent.com>
9105 * getopt.c (_getopt_internal): Update from glibc.
9107 2000-09-09 Jim Meyering <meyering@lucent.com>
9109 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9110 think it should be used as a general replacement for isascii.
9111 * fnmatch.c: Likewise.
9112 * mbswidth.c: Likewise
9113 * regex.c: Likewise.
9116 * userspec.c: Include sys/param.h and limits.h.
9118 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9119 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9120 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9121 UID, GID. Check range.
9123 2000-09-06 Jim Meyering <meyering@lucent.com>
9125 * getopt.c (_getopt_internal): Update from glibc.
9127 2000-08-30 Jim Meyering <meyering@lucent.com>
9129 * strftime.c: Merge in changes from GNU libc.
9131 2000-08-26 Jim Meyering <meyering@lucent.com>
9133 * closeout.c: Include "__fpending.h".
9134 (close_stdout_status): Return right away if there's nothing to flush.
9136 * Makefile.am (noinst_HEADERS): Add __fpending.h.
9137 * __fpending.c: New file.
9138 * __fpending.h: New file.
9140 2000-08-07 Paul Eggert <eggert@twinsun.com>
9142 Standardize on "memory exhausted" instead of "Memory exhausted"
9143 or "virtual memory exhausted".
9144 * obstack.c (print_and_abort): Use "memory exhausted", not
9145 "virtual memory exhausted".
9146 * same.c (same_name): Invoke xalloc_die instead of printing
9148 * userspec.c (parse_user_spec): Likewise.
9149 * bumpalloc.h: comment fix
9150 * same.c, userspec.c: Include xalloc.h.
9152 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9153 not char *const and pointing to a constant array.
9154 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9155 (xrealloc): Comment fix.
9157 * userspec.c (parse_user_spec):
9158 Don't translate a message until just before returning,
9159 to avoid unnecessary translation.
9161 2000-08-07 Jim Meyering <meyering@lucent.com>
9163 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9164 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9165 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9166 getgroups.c, gethostname.c, getopt.h, group-member.c,
9167 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9168 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9169 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9170 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9171 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9172 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9173 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9174 yesno.c: Back out Copyright date changes for each file with no change
9175 this year. This eases coordination with other programs using the same
9176 source code modules. From Paul Eggert.
9178 2000-08-03 Greg McGary <greg@mcgary.org>
9180 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9181 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9182 (EXTEND_BUFFER): Use them.
9184 2000-08-01 Jim Meyering <meyering@lucent.com>
9186 * dirname.c (ISSLASH): Define.
9187 (BACKSLASH_IS_PATH_SEPARATOR): Define.
9188 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9189 both `\' and `/' may be use as path separators.
9190 Based on a patch from Prashant TR.
9192 2000-07-31 Paul Eggert <eggert@twinsun.com>
9194 * quotearg.c (quotearg_n_options): Don't make the initial
9195 slot vector a constant, since it might get modified.
9197 2000-07-31 Jim Meyering <meyering@lucent.com>
9199 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9200 * obstack.c (print_and_abort): Likewise.
9202 2000-07-30 Paul Eggert <eggert@twinsun.com>
9204 * quotearg.c (quotearg_n_options): Preallocate a slot 0
9205 buffer, so that the caller can always quote one small
9206 component of a "memory exhausted" message in slot 0.
9207 From a suggestion by Jim Meyering.
9209 2000-07-30 Jim Meyering <meyering@lucent.com>
9211 * makepath.c (make_path): Quote the other instance, too.
9213 * quotearg.c (N_STATIC_SLOTVECS): Define.
9214 (STATIC_BUF_SIZE): Define.
9215 (quotearg_n_options): Use only statically allocated storage when
9216 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9217 than STATIC_BUF_SIZE.
9219 2000-07-29 Jim Meyering <meyering@lucent.com>
9221 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9222 * dirname.c (dir_name): Likewise.
9224 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9226 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9227 (dir_name): Assert that there are no trailing slashes.
9229 2000-07-18 Bruno Haible <haible@clisp.cons.org>
9231 * mbswidth.h (mbswidth): Add a flags argument.
9232 (mbswidth): New declaration.
9233 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9234 * mbswidth.c (mbswidth): Add a flags argument.
9235 (mbsnwidth): New function.
9237 2000-07-24 Jim Meyering <meyering@lucent.com>
9239 * mbswidth.c: Remove useless #else. From Bruno Haible.
9241 2000-07-23 Paul Eggert <eggert@twinsun.com>
9243 * mbswidth.c (_XOPEN_SOURCE):
9244 Don't define; this causes problems on Solaris 7.
9245 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9247 2000-07-23 Paul Eggert <eggert@twinsun.com>
9250 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9251 so that mbstate_t is always defined.
9253 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9254 be 1 in at least one GCC installation, and this configuration
9255 error is likely to be common. Ignoring MB_LEN_MAX hurts
9256 performance on hosts that have mbrtowc but have only unibyte
9257 locales, but I assume these hosts are rare.
9259 2000-07-23 Paul Eggert <eggert@twinsun.com>
9261 * quotearg.c: Streamline by invoking multibyte code only if needed.
9262 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9263 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9264 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9265 invoke multibyte primitives.
9267 2000-07-23 Jim Meyering <meyering@lucent.com>
9269 * basename.c (base_name): Add an assertion.
9271 2000-07-15 Bruno Haible <clisp.cons.org>
9273 * quotearg.c: When the system forces us to redefine mbstate_t,
9274 shadow its mbsinit function.
9276 2000-07-16 Bruno Haible <haible@clisp.cons.org>
9278 * mbswidth.h: New file.
9279 * mbswidth.c: New file.
9280 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9281 (noinst_HEADERS): Add mbswidth.h.
9283 2000-07-17 Bruno Haible <haible@clisp.cons.org>
9285 * config.charset: Add support for FreeBSD. Improve support for HP-UX
9288 2000-07-15 Jim Meyering <meyering@lucent.com>
9290 * makepath.c: Include quote.h.
9291 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9292 corresponding argument in a `quote (...)' call.
9293 Give better diagnostics.
9295 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9296 (noinst_HEADERS): Add quote.h.
9298 * quote.c (quote, quote_n): New file. Two functions taken verbatim
9299 from tar's src/misc.c.
9300 * quote.h: New file. Prototypes for same.
9302 2000-07-10 Paul Eggert <eggert@twinsun.com>
9304 From a suggestion by Bruno Haible.
9305 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9306 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9307 to decide whether to define the BeOS workaround macro;
9308 this adjusts to the change to AC_MBSTATE_T.
9310 2000-07-13 Paul Eggert <eggert@twinsun.com>
9312 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9314 * quotearg.c (quoting_style_args, quoting_style_vals,
9315 quotearg_buffer_restyled): Add support for
9316 clocale_quoting_style. Undo previous change to
9317 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9318 and "{RIGHT QUOTATION MARK}" msgids.
9320 2000-07-05 Paul Eggert <eggert@twinsun.com>
9322 The old behavior of quoting `like this' doesn't look good with
9323 newer, ISO-style fonts. See:
9324 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9326 Instead, quote "like this" by default. Let the translator
9327 tailor the locale-specific quoting behavior by providing
9328 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9330 * quotearg.c (N_): New macro.
9331 (gettext_default): New function.
9332 (quotearg_buffer_restyled): Use
9333 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9334 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9336 2000-07-09 Jim Meyering <meyering@lucent.com>
9338 * Most files: Update copyright dates to include 2000.
9340 2000-07-08 Jim Meyering <meyering@lucent.com>
9342 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9344 (xgethostname): Remove now-unnecessary #ifdef.
9345 Move declaration of `err' into loop where it's used.
9347 2000-07-05 Bruno Haible <haible@clisp.cons.org>
9349 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9350 by allocating a larger buffer. Test the gethostname return value for
9351 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
9352 returns an error and ENAMETOOLONG isn't defined.
9354 2000-07-05 Paul Eggert <eggert@twinsun.com>
9355 and Bruno Haible <haible@clisp.cons.org>
9357 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9359 2000-07-05 Bruno Haible <haible@clisp.cons.org>
9361 * quotearg.c (struct quoting_options): Simplify quote_these_too
9364 2000-07-03 Jim Meyering <meyering@lucent.com>
9366 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9367 Reported by Bruno Haible.
9369 2000-07-04 Jim Meyering <meyering@lucent.com>
9371 * quotearg.c: Make inclusion of <wchar.h> independent of whether
9372 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
9375 2000-07-03 Paul Eggert <eggert@twinsun.com>
9376 and Bruno Haible <haible@clisp.cons.org>
9378 * quotearg.c (mbrtowc):
9379 Assign to *pwc, and return 1 only if result is nonzero.
9380 (iswprint): Use ISPRINT when substituting our own mbrtowc.
9382 2000-07-03 Jim Meyering <meyering@lucent.com>
9384 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9385 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9388 2000-07-02 Jim Meyering <meyering@lucent.com>
9390 * quotearg.c (mbstate_t): Don't define here.
9392 2000-07-02 Jim Meyering <meyering@lucent.com>
9394 * nanosleep.c (SIGCONT): Define if not already defined.
9396 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9398 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9399 per change in ../m4/ls-mntd-fs.m4.
9400 (read_filesystem_list): Ignore symbolic links.
9402 2000-06-29 Jim Meyering <meyering@lucent.com>
9404 * same.c: Include <string.h> or <strings.h>, as appropriate,
9405 for declaration of strcmp.
9407 * long-options.c: Include <stdlib.h>, for declaration of exit.
9409 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9410 Avoid warning by casting result to `char *' to remove `const'.
9412 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9414 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9416 2000-06-26 Paul Eggert <eggert@twinsun.com>
9418 savedir now sets errno on failure and invokes xmalloc to get memory.
9419 Fix a couple of other minor bugs while we're at it.
9421 * savedir.c (<unistd.h>): Do not include; there's no need.
9422 (NAMLEN): Remove macro.
9423 (malloc, realloc): Remove decls.
9425 ("xalloc.h"): Include.
9426 (NAME_SIZE_DEFAULT): New macro.
9427 (savedir): Use xmalloc / xrealloc to allocate memory.
9428 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9429 Skip "" directory entries.
9430 Use strlen to calculate directory entry length, since the old method
9431 is rarely used these days and isn't worth supporting.
9432 Don't use a pointer after freeing it.
9433 Check for integer overflow when calculating allocation size.
9434 Use memcpy to copy entries, instead of stpcpy.
9435 Set errno properly when returning NULL.
9436 Check for readdir error.
9438 2000-06-26 Jim Meyering <meyering@lucent.com>
9440 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9442 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9444 * getusershell.c (xmalloc, xrealloc): Remove functions.
9446 Don't include <stdlib.h>. Don't declare malloc, realloc.
9448 2000-06-23 Bruno Haible <haible@clisp.cons.org>
9450 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9452 2000-06-24 Jim Meyering <meyering@lucent.com>
9454 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9456 2000-06-21 Jim Meyering <meyering@lucent.com>
9458 * getpass.c: New file, from Bruno Haible. Required for BeOS.
9460 2000-06-19 Paul Eggert <eggert@twinsun.com>
9462 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
9463 (mbrtowc, mbstate_t): Define substitutes if
9464 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
9465 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
9466 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9468 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9470 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
9471 than 1024, return a memory chunk of least possible size, instead
9472 of size PATH_MAX + 2. In the loop, increment the size proportionally.
9473 Use free/xmalloc instead of xrealloc to avoid copying for very long
9476 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9478 * canon-host.c (canon_host): Use malloc and memcpy to copy an
9479 address, not strdup. Include <stdlib.h> and don't declare free().
9481 2000-06-17 Bruno Haible <haible@clisp.cons.org>
9483 * path-concat.c (path_concat): Don't access dir[-1] if dir is
9486 2000-06-21 Jim Meyering <meyering@lucent.com>
9488 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
9489 (noinst_HEADERS): Add getstr.h.
9491 * getline.c (getstr): Move into a separate file.
9492 * getstr.c (getstr): New file, extracted from getline.c, with
9493 the following changes: new parameter, delim2; both delim[12]
9494 parameters have type `int', not `char'. The latter would lose
9495 with 8-bit delimiters.
9496 * getstr.h: New file.
9498 2000-06-19 Jim Meyering <meyering@lucent.com>
9500 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
9502 2000-06-18 Jim Meyering <meyering@lucent.com>
9504 * mkdir.c: Remove file, due mainly to copyright incompatibility.
9505 Besides, these days every porting target provides a mkdir function.
9507 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
9508 (this snippet comes from src/system.h).
9510 2000-06-15 Paul Eggert <eggert@twinsun.com>
9512 * human.c (adjust_value): New function.
9513 (human_readable_inexact): Apply rounding style even when
9514 printing approximate values.
9516 2000-06-14 Paul Eggert <eggert@twinsun.com>
9518 * human.c (human_readable_inexact): Allow an input block
9519 size that is not a multiple of the output block size, and vice versa.
9520 Reported by Piergiorgio Sartor.
9522 2000-06-14 Paul Eggert <eggert@twinsun.com>
9524 * getdate.y (get_date): Apply relative times after time
9525 zone indicator, not before. Reported by Todd A. Jacobs.
9527 2000-06-13 Jim Meyering <meyering@lucent.com>
9529 * Makefile.am (all-local): Depend on lstat.c and stat.c.
9531 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
9533 2000-06-12 Paul Eggert <eggert@twinsun.com>
9535 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
9537 2000-06-04 Paul Eggert <eggert@twinsun.com>
9539 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
9541 2000-06-04 Jim Meyering <meyering@lucent.com>
9543 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
9544 SunOS 4.1.4 for which gid_t is an unsigned type.
9546 2000-06-03 Jim Meyering <meyering@lucent.com>
9548 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
9550 2000-05-26 Bruno Haible <haible@clisp.cons.org>
9552 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
9553 newer, don't install charset.alias.
9554 * config.charset: Change the Linux/glibc rules so they become empty
9555 on glibc-2.1 or newer.
9557 2000-06-02 Jim Meyering <meyering@lucent.com>
9559 * mountlist.c: Back out last change. Instead, do this...
9560 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
9561 member using the same `ignore'-testing code.
9562 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
9566 2000-05-29 Jim Meyering <meyering@lucent.com>
9568 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
9569 with the `ignore' attribute. Based on a patch from Mark D. Roth.
9571 2000-05-22 Jim Meyering <meyering@lucent.com>
9573 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
9575 2000-05-18 Jim Meyering <meyering@lucent.com>
9577 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
9578 back, too, since it may have been modified by allocate_entry.
9579 (hash_delete): Rewrite to use neither the assignment operator
9580 nor the comma operator in an if-expression.
9582 2000-05-15 Paul Eggert <eggert@twinsun.com>
9585 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
9586 Remove; no longer needed.
9587 "quotearg.h": Add include.
9588 (file_name): Do not bother to explicitly initialize to NULL; it's less
9589 efficient on some hosts.
9590 (close_stdout_status): Remove test as to whether stdout was already
9591 closed; it breaks for the case "echo x | sort >&-".
9592 Quote file name colons.
9593 Do not assume that _("write error") lacks format strings.
9595 2000-05-15 Jim Meyering <meyering@lucent.com>
9597 * version-etc.c (version_etc_copyright): Update the copyright string
9598 used in all --version output.
9600 2000-05-14 Jim Meyering <meyering@lucent.com>
9602 * closeout.c (close_stdout_set_file_name): New function.
9603 (close_stdout_status): Use new file-scoped global.
9604 Return right away if fstat says the stdout file descriptor is invalid.
9605 * closeout.h (close_stdout_set_file_name): Declare.
9607 2000-05-10 Jim Meyering <meyering@lucent.com>
9609 * closeout.c [default_exit_status]: New file-scoped variable.
9610 (close_stdout_set_status): New function.
9611 * closeout.h (close_stdout_set_status): Declare.
9613 2000-05-08 Jim Meyering <meyering@lucent.com>
9615 * long-options.c: Don't include closeout.h.
9616 (parse_long_options): Don't call close_stdout for --version.
9618 2000-05-06 Jim Meyering <meyering@lucent.com>
9620 * strnlen.c: Undefine __strnlen and strnlen.
9621 [!weak_alias]: Define __strnlen to strnlen.
9623 * atexit.c: New file, from libiberty.
9625 2000-05-06 Jim Meyering <meyering@lucent.com>
9627 * closeout.c (close_stdout_status): Also check for errors on the
9630 2000-05-05 Bruno Haible <haible@clisp.cons.org>
9632 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
9633 instead of xmalloc, xrealloc, path_concat.
9634 (locale_charset): Treat empty environment variables as absent.
9635 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
9637 2000-05-04 Jim Meyering <meyering@lucent.com>
9639 * getopt.c: Update from glibc.
9640 * obstack.c: Likewise.
9641 * obstack.h: Likewise.
9642 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
9644 * regex.h: Likewise.
9645 * strndup.c: Likewise.
9646 * strnlen.c: New file, from glibc.
9648 2000-05-01 Jim Meyering <meyering@lucent.com>
9650 * full-write.c (full_write): Remove `FIXME' part of comment.
9652 2000-04-29 Jim Meyering <meyering@lucent.com>
9654 * path-concat.c: Declare strdup only if it's not defined.
9655 * canon-host.c: Likewise.
9657 2000-04-28 Jim Meyering <meyering@lucent.com>
9659 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
9660 redefinition warning on some systems (HPUX). Otherwise, regex.h is
9661 included first, then limits.h is included by locale.h by libintl.h.
9662 From John David Anglin.
9664 2000-04-25 Jim Meyering <meyering@lucent.com>
9666 * makepath.c (S_IRWXUGO): Define.
9667 (make_path): Always perform explicit chmod if MODE specifies any
9668 of the `special' permission bits. Prompted by a bug report against
9669 install from Mate Wierdl and Joost van Baal.
9671 2000-04-18 Jim Meyering <meyering@lucent.com>
9675 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
9676 getpagesize. For BeOS. Based on a patch from Bruno Haible.
9678 2000-04-17 Jim Meyering <meyering@lucent.com>
9680 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
9681 the definition of it to rpl_strftime also defined-away the system's
9684 2000-04-15 Jim Meyering <meyering@lucent.com>
9686 Use `C' to denote so-called `contiguous' files, the same way
9688 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
9689 (ftypelet): Use S_ISCTG.
9690 From Michael Deutschmann.
9692 2000-04-14 Jim Meyering <meyering@lucent.com>
9694 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
9696 2000-04-08 Jim Meyering <meyering@lucent.com>
9698 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
9699 names don't conflict. Reported by Eli Zaretskii.
9701 2000-03-28 Bruno Haible <haible@clisp.cons.org>
9703 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
9704 bug. Deal with the different error behavior of Irix iconv.
9706 2000-04-07 Jim Meyering <meyering@lucent.com>
9708 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
9709 to work around system header problems on AIX 3.2.5. From Bruno Haible.
9711 2000-04-05 Jim Meyering <meyering@lucent.com>
9713 Portability tweaks required for ultrix4.3.
9714 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
9715 * readutmp.c: Include sys/types.h before sys/stat.h.
9716 * canon-host.c: Declare strdup.
9717 * path-concat.c: Likewise.
9718 From John David Anglin.
9720 2000-04-04 Jim Meyering <meyering@lucent.com>
9722 Be more DOS 8.3-friendly.
9723 * ref-add.sin: Renamed from ref-add.sed.in.
9724 * ref-del.sin: Renamed from ref-del.sed.in.
9725 * Makefile.am: Reflect renaming.
9726 Reported by Eli Zaretskii.
9728 Use a temporary file name that won't clash with `charset.alias'
9729 in the DOS 8.3 name space.
9730 * Makefile.am (charset_tmp): Define.
9731 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
9732 (uninstall-local): Likewise.
9733 Reported by Eli Zaretskii.
9735 2000-03-29 Paul Eggert <eggert@twinsun.com>
9737 * time/strftime.c (my_strftime): Make sure we call the system
9738 strftime, not ourselves, when invoking the underlying strftime.
9740 2000-03-24 Jim Meyering <meyering@lucent.com>
9742 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
9743 (charset_alias): Define.
9744 (install-exec-local): Factor out common code.
9745 (uninstall-local): Split lines longer than 80.
9746 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
9748 (.sed.in.sed): New rule. Don't redirect directly to $@.
9749 (CLEANFILES): Add ref-add.sed and ref-del.sed.
9751 2000-03-19 Bruno Haible <haible@clisp.cons.org>
9753 * config.charset: Output a line containing "Packages using this file".
9754 * ref-add.sed.in, ref-del.sed.in: New files.
9755 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
9756 ref-del.sed): New rules.
9758 2000-03-17 Jim Meyering <meyering@lucent.com>
9760 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
9761 Otherwise, include <strings.h>
9763 2000-03-17 Bruno Haible <haible@clisp.cons.org>
9765 * unicodeio.c (utf8_wctomb): New function.
9766 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
9767 format instead of in UCS-4 with platform dependent endianness.
9769 2000-03-07 Paul Eggert <eggert@twinsun.com>
9771 * savedir.c (savedir): Work even if directory size is
9772 negative; this can happen with some screwy NFS configurations.
9774 2000-03-06 Jim Meyering <meyering@lucent.com>
9776 * localcharset.c (get_charset_aliases): Don't try to free file_name
9777 if it's NULL (because we ran out of memory). From Bruno Haible.
9779 2000-03-05 Jim Meyering <meyering@lucent.com>
9781 * localcharset.c ("path-concat.h"): Include.
9782 (get_charset_aliases): Use path_concat instead of ANSI string
9785 * unicodeio.h (PARAMS): Define.
9786 Use it to guard prototype.
9788 2000-03-04 Jim Meyering <meyering@lucent.com>
9790 * Makefile.am (install-exec-local): Create $(libdir) before installing
9792 (uninstall-local): Uncomment this rule so `make distcheck' works
9795 * unicodeio.c (<errno.h>): Include it.
9796 (errno): Declare if not defined.
9798 * localcharset.c: Add Bruno's comment justifying use of volatile.
9800 * config.charset: New version, incorporating remarks from a linux
9801 i18n mailing list. From Bruno Haible.
9803 2000-03-02 Jim Meyering <meyering@lucent.com>
9805 * Makefile.am (EXTRA_DIST): Add config.charset.
9807 2000-03-01 Jim Meyering <meyering@lucent.com>
9809 * localcharset.c: Guard some #includes with `#if HAVE_...'.
9810 * unicodeio.c: Likewise.
9812 2000-02-02 Bruno Haible <haible@clisp.cons.org>
9814 * config.charset: New file.
9815 * localcharset.c: New file.
9816 * unicodeio.h, unicodeio.c: New files.
9817 * Makefile.am (DEFS): Add -DLIBDIR=...
9818 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
9819 (noinst_HEADERS): Add unicodeio.h.
9820 (all-local, install-exec-local, charset.alias): New targets.
9822 2000-02-28 Paul Eggert <eggert@twinsun.com>
9824 * quotearg.c (ALERT_CHAR): New macro.
9825 (quotearg_buffer_restyled): Use it.
9827 2000-02-27 Jim Meyering <meyering@lucent.com>
9829 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
9830 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
9832 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
9833 not `#if STDC_HEADERS'.
9834 Declare malloc if needed.
9836 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
9837 now that autoconf always defines the HAVE_DECL_ symbols.
9838 * human.c: Likewise.
9840 * strtoumax.c: Likewise.
9842 * backupfile.c: Arrange for cpp to fail if the configure-time
9843 declaration check was not run.
9845 * human.c: Likewise.
9847 * strtoumax.c: Likewise.
9849 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
9850 then first look up the entire `.'-containing string as a login name.
9852 2000-02-18 Paul Eggert <eggert@twinsun.com>
9854 * getdate.y: Handle two-digit years with leading zeros correctly.
9855 (textint): New typedef.
9856 (parser_control): Member year changed from int to textint.
9858 (YYSTYPE): Removed; replaced by %union with int and textint members.
9859 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
9860 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
9861 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
9862 (tSNUMBER, tUNUMBER): Now of type <textintval>.
9863 (date, number, to_year): Use width of number in digits, not its value,
9864 to determine whether it's a 2-digit year, or a 2-digit time.
9865 (yylex): Store number of digits of numeric tokens.
9866 Reported by John Kendall.
9868 (parser_control): Changed from struct parser_control to typedef (for
9869 consistency). All uses changed.
9871 (tID): Removed; not used.
9872 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
9874 2000-02-14 Paul Eggert <eggert@twinsun.com>
9876 * getpagesize.h (getpagesize): Port to VMS for Alpha;
9877 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
9879 2000-02-12 Jim Meyering <meyering@lucent.com>
9881 * userspec.c (ISDIGIT): Define it.
9882 (isdigit): Remove definition.
9883 (is_number): Use ISDIGIT, not isdigit.
9884 <libintl.h>: Include.
9886 (parse_user_spec): Mark translatable strings.
9888 2000-02-10 Jim Meyering <meyering@lucent.com>
9890 With these changes, nanosleep.[ch] are finally enough like the other
9891 lib/* replacement files to compile on a few more losing systems.
9893 * nanosleep.h: Don't include config.h.
9894 Remove prototype from declaration of nanosleep.
9895 (PARAMS): Remove now-unneeded definition.
9896 * nanosleep.c: #undef nanosleep.
9897 (rpl_nanosleep): Rename from nanosleep.
9899 2000-02-03 Jim Meyering <meyering@lucent.com>
9901 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
9902 rather than with `#if HAVE_UTMPNAME'.
9904 2000-02-01 Jim Meyering <meyering@lucent.com>
9906 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
9908 2000-01-31 Jim Meyering <meyering@lucent.com>
9910 * nanosleep.h (nanosleep): Guard declaration with
9911 `#if ! HAVE_DECL_NANOSLEEP'.
9912 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
9913 the declaration in that vendor's sys/timers.h.
9914 Reported by Christian Krackowizer.
9916 * quotearg.c (ISASCII): Add #undef and move definition to follow
9917 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
9918 (ISPRINT): Likewise.
9919 Reported by Tom Tromey.
9921 2000-01-30 Jim Meyering <meyering@lucent.com>
9923 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
9924 uses of ->ut_name. The latter doesn't work with new Linux header files
9925 where only utmpx.ut_user is declared.
9927 * readutmp.h (UT_USER): Define.
9929 2000-01-23 Jim Meyering <meyering@lucent.com>
9931 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
9934 2000-01-22 Jim Meyering <meyering@lucent.com>
9936 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
9937 [! HAVE_DECL_STRTOULL]: Declare strtoull.
9938 Required for some AIX systems. Reported by Christian Krackowizer.
9939 [TESTING] (main): New function.
9941 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
9942 * dirname.c (dir_name): Support for DOS-style file names with drive
9945 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
9947 * strverscmp.c (ISDIGIT): Define.
9948 (strverscmp): Use ISDIGIT, not isdigit.
9950 2000-01-17 Paul Eggert <eggert@twinsun.com>
9952 * nanosleep.c (nanosleep):
9953 Don't use SA_INTERRUPT to decide whether to call sigaction, as
9954 POSIX.1 doesn't require SA_INTERRUPT and some systems
9955 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
9956 it's been part of POSIX.1 since day 1 (in 1988).
9958 2000-01-17 Jim Meyering <meyering@lucent.com>
9960 * interlock: Remove unused file. Reported by François Pinard.
9962 2000-01-16 Paul Eggert <eggert@twinsun.com>
9964 * quotearg.c (quotearg_buffer_restyled): Do not quote
9965 alert, backslash, formfeed, and vertical tab unnecessarily in
9966 shell quoting style.
9969 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
9970 Free Software Foundation, Inc.
9971 Copying and distribution of this file, with or without modification,
9972 are permitted provided the copyright notice and this notice are preserved.