1 2005-08-16 Bruno Haible <bruno@clisp.org>
5 2005-08-16 Bruno Haible <bruno@clisp.org>
9 2005-08-16 Bruno Haible <bruno@clisp.org>
14 2005-08-16 Bruno Haible <bruno@clisp.org>
16 * tls.h: New file, from GNU gettext.
17 * tls.c: New file, from GNU gettext.
19 2005-08-15 Bruno Haible <bruno@clisp.org>
21 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
24 2005-08-14 Jim Meyering <jim@meyering.net>
28 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
29 Use the hash-table-based cycle-detection code not just when
30 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
31 Reported by James Youngman in
32 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
33 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
34 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
35 This lets us compile with -DFTS_DEBUG, once again.
36 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
37 * fts.c (fd_safer): Remove decl.
38 Include fcntl--.h rather than unistd-safer.h
39 (fts_safe_changedir): Don't call fd_safer; no longer needed
40 now that we include fcntl--.h.
42 2005-08-11 Simon Josefsson <jas@extundo.com>
44 * readline.h, readline.c: New file.
46 2005-08-11 Bruno Haible <bruno@clisp.org>
48 * strnlen.h (strnlen): Change parameter name to match comment.
50 2005-08-10 Simon Josefsson <jas@extundo.com>
52 * strndup.c: Use strnlen.h.
54 * strnlen.h: New file.
56 2005-08-02 Simon Josefsson <jas@extundo.com>
58 * getline.h, getline.c: Rewrite.
60 * getdelim.h, getdelim.c: New files, ported from glibc.
62 2005-07-31 Bruno Haible <bruno@clisp.org>
64 * lock.h (gl_lock_initializer): New macro.
65 (gl_lock_define_initialized): Use it.
66 (gl_rwlock_initializer): New macro.
67 (gl_rwlock_define_initialized): Use it.
68 (gl_recursive_lock_initializer): New macro.
69 (gl_recursive_lock_define_initialized): Use it.
71 2005-07-26 Bruno Haible <bruno@clisp.org>
73 * lock.h: Update from GNU gettext.
74 * lock.c: Update from GNU gettext.
76 2005-07-18 Bruno Haible <bruno@clisp.org>
78 * lock.h (gl_once_t): New type.
79 (gl_once_define, gl_once): New macros.
80 * lock.c (fresh_once): New variable.
81 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
84 2005-07-18 Simon Josefsson <jas@extundo.com>
86 * check-version.c (check_version): Accept identical versions too.
88 2005-07-18 Bruno Haible <bruno@clisp.org>
90 * lock.h: New file, from GNU gettext.
91 * lock.c: New file, from GNU gettext.
93 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
95 * quotearg.c: Add translator comment suggested by Bruno Haible,
98 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
100 * version-etc-fsf.c (version_etc_copyright): Parameterize the
101 copyright symbol and the year.
102 * version-etc.c (COPYRIGHT_YEAR): New constant.
103 (version_etc_va): Use parameterized copyright notice.
104 Reword to conform to the current GNU coding standards.
106 2005-07-11 Simon Josefsson <jas@extundo.com>
108 * size_max.h: New file.
110 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
112 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
115 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
116 and Paul Eggert <eggert@cs.ucla.edu>
118 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
119 in wint_t, not wchar_t. Remove now-unnecessary cast.
121 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
123 * regex.c, regex.h: Sync from libc.
124 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
125 New files, synced from libc, except that regex_internal.h
126 currently has a small porting fix.
128 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
130 Remove the dependency of the strftime module on the tzset module.
131 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
132 Copy the input structure, to work around some of the bug with
133 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
134 Solaris releases, you should also use the tzset module, but we won't
135 require it as a dependency any more since we don't want LGPLed code
136 to depend on GPLed code.
138 2005-07-02 Jim Meyering <jim@meyering.net>
140 * backupfile.c (backup_args): Change a `0' to NULL.
142 2005-07-01 Jim Meyering <jim@meyering.net>
144 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
145 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
146 * save-cwd.c, tempname.c:
147 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
148 and don't include <sys/file.h>).
150 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
152 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
153 declares only 'struct timespec;' (!).
155 2005-06-29 Jim Meyering <jim@meyering.net>
157 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
158 type name. Use the variable name instead.
159 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
161 2005-06-28 Simon Josefsson <jas@extundo.com>
163 * check-version.h, check-version.c: New files.
165 2005-06-28 Simon Josefsson <jas@extundo.com>
167 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
168 collision with global variable. Better indentation. Don't
169 increment buffer pointer beyond buffer end. Based on comments
170 from Paul Eggert <eggert@cs.ucla.edu>.
174 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
176 * canon-host.c (canon-host): Append trailing "," to 0 in
177 initializer of struct addrinfo, as an indication that we don't
178 care how many members the structure has.
180 2005-06-24 Derek Price <derek@ximbiot.com>
181 and Bruno Haible <bruno@clisp.org>
183 Remove stat module & update lstat.
184 * stat.c: Remove this file...
185 (slash_aware_lstat): ...moving this content and its support...
186 * lstat.c (rpl_lstat): ...into here.
189 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
191 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
192 (ranged_convert): Don't save conversion in a temporary struct.
193 This causes a warning with GCC 4.0.0, and anyway in the typical
194 case it's not worth the extra 100 bytes or so of code.
195 (ranged_convert, __mktime_internal): When calling a function via a
196 pointer P, use P () rather than (*P) (), as we now assume C89 or
199 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
201 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
202 "who -r" failed to give output. Problem reported by Tim Waugh.
204 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
205 (xcalloc): Use it to avoid needless tests.
206 Problem reported by Jim Meyering.
208 2005-06-16 Jim Meyering <jim@meyering.net>
210 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
211 when either N or S is zero.
213 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
215 * argp.h (__option_is_short): Check upper limit of
216 __key. Isprint() requires its argument to have the value
217 of an unsigned char or EOF.
219 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
221 * fnmatch.c (fnmatch): If there is an encoding error in a
222 multibyte string or pattern, fall back on unibyte matching.
223 Problem reported by James Youngman.
225 2005-06-08 Bruno Haible <bruno@clisp.org>
227 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
230 2005-06-08 Bruno Haible <bruno@clisp.org>
232 * csharpcomp.h: New file, from GNU gettext.
233 * csharpcomp.c: New file, from GNU gettext.
234 * csharpcomp.sh.in: New file, from GNU gettext.
236 2005-06-07 Derek Price <derek@ximbiot.com>
239 * glob_.h: Indent nested #ifdef.
241 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
244 Use "file name" when talking about file names, instead of "filename"
245 or "path", as per the GNU coding standards.
246 * mkdir-p.c: Renamed from makepath.c.
247 (make_dir_parents): Renamed from make_path. All callers changed.
248 * mkdir-p.h: Likewise. All includers changed.
249 * filenamecat.c: Renamed from path-concat.c.
250 (file_name_concat): Renamed from path_concat. All callers changed.
251 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
252 * filenamecat.h: Likewise. All includers changed.
253 * acl.c: Don't use "path" or "filename" to mean "file name"
254 in comments or local variable names.
255 * basename.c: Likewise.
256 * canonicalize.c, canonicalize.h: Likewise.
257 * dirname.c, dirname.h: Likewise.
258 * euidaccess.c: Likewise.
259 * exclude.c: Likewise
260 * fnmatch_.h, fnmatch_loop.c: Likewise.
261 * fsusage.c, fsuage.h: Likewise.
262 * fts.c, fts_.h: Likewise.
263 * getcwd.c: Likewise.
264 * getloadavg.c: Likewise.
265 * mkstemp.c: Likewise.
266 * mountlist.c, mountlist.h: Likewise.
267 * openat.c, openat.h: Likewise.
268 * readlink-stub.c: Likewise.
269 * readutmp.c, readutmp.h: Likewise.
270 * rename.c: Likewise.
273 * savedir.c: Likewise.
274 * stripslash.c: Likewise.
275 * tempname.c: Likewise.
276 * xreadlink.c: Likewise.
277 * exclude.c (excluded_file_name): Renamed from excluded_filename.
279 * exclude.h: Likewise.
281 * euidaccess.c (getuid, getgid, getuid, getegid)
282 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
283 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
284 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
285 * pathmax.h: Include <limits.h> unconditionally, since other
286 files have been getting away with it for years (MORE/BSD 4.3
288 * userspec.c (getpwnam, getgrnam, getgrgid)
289 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
291 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
292 Define to 256, not 255, as per modern POSIX.
294 2005-06-01 Bruno Haible <bruno@clisp.org>
296 * csharpexec.h: New file, from GNU gettext.
297 * csharpexec.c: New file, from GNU gettext.
298 * csharpexec.sh.in: New file, from GNU gettext.
300 2005-05-31 Derek Price <derek@ximbiot.com>
301 Paul Eggert <eggert@cs.ucla.edu>
304 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
306 2005-05-29 Derek Price <derek@ximbiot.com>
307 Paul Eggert <eggert@cs.ucla.edu>
309 * glob_.h, glob.c: New files.
311 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
313 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
315 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
316 the configuration hassle isn't worth it.
317 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
318 (LONGEST_MODIFIER, PRIuMAX): Remove.
320 2005-05-27 Bruno Haible <bruno@clisp.org>
322 * getlogin_r.h: Remove second include of <stddef.h>.
324 2005-05-25 Bruno Haible <bruno@clisp.org>
325 Derek Price <derek@ximbiot.com>
327 * getlogin_r.h: Simplify API documentation.
329 2005-05-25 Derek Price <derek@ximbiot.com>
330 Paul Eggert <eggert@cs.ucla.edu>
332 * getlogin_r.c, getlogin_r.h: New files.
334 2005-05-22 Bruno Haible <bruno@clisp.org>
336 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
337 Also include <sys/param.h> if it defines MIN, MAX.
338 Based on a patch by Derek Price <derek@ximbiot.com>.
340 2005-05-22 Bruno Haible <bruno@clisp.org>
342 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
343 (INT64_MIN): Fix definition.
344 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
346 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
347 NEED_SIGNED_INT_TYPES.
349 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
350 HAVE_SYSTEM_INTTYPES.
352 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
354 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
355 so that unistd-safer.h (GPL'ed code) need not be included.
357 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
360 * fts.c: Don't include "cycle-check.h" or "hash.h".
361 (setup_dir, free_dir): New functions.
362 (enter_dir, leave_dir): Define trivial
363 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
364 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
365 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
366 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
368 (fts_open): Use setup_dir.
369 (fts_close): Use free_dir.
370 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
371 This adds a label and some gotos, but the alternatives were messier.
372 Check for memory allocation failure when entering a dir.
373 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
374 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
375 (FTS): New member fts_cycle, that is a union that contains the
376 old active_dir_ht and cycle_state. All uses changed to mention
377 fts_cycle.ht and fts_cycle.state.
378 * fts-cycle.c: New file, containing GPL'ed code migrated out of
379 fts.c, with the following changes:
380 (setup_dir, free_dir): New functions.
381 (enter_dir): Now returns bool. Return true if successful, false
382 if memory exhausted. All callers changed.
383 Do not bother partly cleaning up on
384 memory allocation failure; that is free_dir's job.
385 However, free ad if hash_insert fails, to avoid memory leak.
386 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
387 fts->fts_options to see which union member to use.
389 2005-05-20 Jim Meyering <jim@meyering.net>
391 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
392 Now a macro, to pacify GCC.
394 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
396 * chown.c (rpl_chown): Return -1 on failure.
398 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
400 * canonicalize.c: Include canonicalize.h first, to test interface.
401 Include <stddef.h> unconditionally, since we assume C89 now.
402 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
403 * fts.c: Include fts_.h first, to check interface.
404 Do not include intprops.h; no longer needed.
405 Include cycle-check.h and hash.h, since fts_.h no longer does.
406 Remove unnecessary casts of closedir to void.
407 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
408 decide whether to decrement nlinks.
409 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
410 (FTS): Use struct hash_table * instead of Hash_table, so that
411 we no longer need to include hash.h here.
413 2005-05-17 Jim Meyering <jim@meyering.net>
415 * fts.c, fts_.h: New files, from coreutils.
417 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
420 * unlinkdir.c, unlinkdir.h: New files.
421 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
422 regex.h, unlocked-io.h, xtime.h:
423 White space changes only.
424 * makepath.c (make_path): Port to hosts where leading "//" is special.
425 * yesno.c: Include getline.h, not ctype.h.
426 (yesno): Don't remove leading white space; POSIX doesn't allow it.
427 Use getline to remove arbitrary restriction on response length.
429 2005-05-13 Bruno Haible <bruno@clisp.org>
431 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
432 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
433 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
434 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
435 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
436 Add support for 64-bit integers in the MSVC compiler.
438 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
440 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
441 Change the initial comment to refer to GPL, not LGPL.
442 gnulib-tool will change it to LGPL as needed.
444 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
445 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
446 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
447 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
448 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
449 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
450 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
451 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
452 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
453 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
454 concatpath.c, config.charset, copy-file.c, copy-file.h,
455 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
456 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
457 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
458 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
459 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
460 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
461 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
462 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
463 full-read.c, full-read.h, full-write.c, full-write.h,
464 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
465 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
466 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
467 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
468 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
469 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
470 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
471 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
472 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
473 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
474 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
475 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
476 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
477 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
478 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
479 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
480 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
481 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
482 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
483 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
484 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
485 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
486 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
487 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
488 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
489 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
490 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
491 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
492 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
493 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
494 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
495 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
496 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
497 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
498 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
499 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
500 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
501 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
502 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
503 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
504 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
505 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
506 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
507 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
508 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
509 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
510 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
511 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
512 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
513 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
514 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
515 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
516 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
517 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
518 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
519 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
520 Update FSF postal mail address.
522 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
524 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
525 specified in ai_socktype. Fix invalid ai_protocol
526 check. ai_protocol is usually set to 0 or depending on
527 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
528 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
529 ai_socktype / ai_protocol in the returned addrinfo structure.
531 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
532 Bruno Haible <bruno@clisp.org>
534 * inet_ntop.h: New file.
535 * inet_ntop.c: New file, from glibc with modifications.
537 2005-05-08 Jim Meyering <jim@meyering.net>
539 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
541 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
543 Merge from coreutils. Among other things,
544 add bulletproofing for cases where stdin, stdout, or stderr are closed.
545 * fd-safer.c: New file.
546 * fcntl-safer.h, open-safer.c: Remove.
547 * chdir-long.c: Fix comment "fetish" -> "coreutils".
548 * dup-safer.c: Include unistd-safer.h first.
549 Don't include errno.h.
550 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
551 * file-type.h: Don't assume invoker included sys/stat.h first.
552 * file-type.c: Rely on file-type.h change.
553 * getloadavg.c: Include unistd-safer.h.
554 (getloadavg): Use safer open.
555 * getusershell.c: Include "stdio-safer.h".
556 (getusershell): Use safer fopen.
557 * long-options.c (long_options): Use NULL rather than 0.
558 * modechange.h (mode_free): Remove; all callers changed to invoke
560 * modechange.c: Likewise.
561 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
562 (MODE_DONE): New constant.
563 (struct mode_change): Remove 'next' member.
564 (make_node_op_equals): New function; like the old one of the
565 same name, except it allocates an array.
566 (mode_compile, mode_create_from_ref): Use it.
567 (mode_compile): Allocate result as an array, not a linked list.
568 Parse octal string ourself, so that we catch mistakes like "+0".
569 (mode_adjust): Arg is an array, not a linked list.
570 * modechange.c: Include stat-macros.h, xalloc.h.
571 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
572 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
573 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
574 Remove. This is now stat-macros.h's job.
575 (talloc): Remove. All callers replaced by xalloc, so that
576 our invokers don't have to worry about reporting memory failures.
577 (make_node_op_equals): Remove.
578 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
580 (struct mode_change): Moved here from modechange.h.
581 (mode_append_entry): Remove.
582 (mode_compile): Remove MASKED_OPS arg, since it encouraged
583 apps to have incorrect behavior. Use simpler algorithm for head
584 and tail. Don't futz with umask; that's now the job of mode_adjust.
585 Detect more invalid usages rather than having somewhat-random behavior.
586 Don't insert an "a=" action, as that leads to incorrect behavior.
587 (mode_compile, mode_create_from_ref): Return NULL on error instead
588 of an enum, since now there's only one way to have an error. All
590 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
591 at the correct time. Simplify calculation of "+u" and its ilk.
592 Don't mishandle "+X".
593 (mode_free): Remove "register" and localize decls.
594 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
595 (struct mode_change): Move to modechange.c; callers don't
596 need to see this stuff.
597 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
598 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
599 (mode_change, mode_adjust): Reflect the new signatures noted above.
600 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
601 that might redefine system include files.
602 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
603 (my_usleep): Use NULL rather than (void *) 0.
604 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
605 Use siginterrupt to specify that system calls should be interrupted.
606 (rpl_nanosleep): Move initialization of suspended closer to call of
608 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
609 * readutmp.c: Likewise. Include signal.h, stdbool.h.
610 (desirable_utmp_entry): New function.
611 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
612 using x2nrealloc, to simplify logic.
613 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
614 size calculation. Do not assume utmp file is a regular file.
615 * readutmp.h (UT_PID): Moved here from ../src/who.c.
616 (READ_UTMP_CHECK_PIDS): New constant.
617 * save-cwd.c: Include unistd-safer.h.
618 (save_cwd): Use fd_safer.
619 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
620 [!_LIBC] Include "stat-macros.h" instead.
621 * unistd-safer.h (fd_safer): New decl.
623 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
625 * byteswap_.h: New file.
627 2005-04-25 Albert Chin <china@thewrittenword.com>
629 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
632 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
634 * getdate.y (zone): Allow relunit_snumber after tZONE, so
635 that "UTC +1 second" continues to work. Problem reported
637 (relunit_snumber): New rule.
640 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
642 * getdate.y (universal_time_zone_table): New constant.
643 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
644 universal_time_zone_table.
645 (lookup_zone): Prefer universal_time_zone_table to
646 local_time_zone_table, so that "GMT" time stamps are allowed in
647 London during the summer. Problem reported by Ian Abbott.
649 2005-04-12 Jim Meyering <jim@meyering.net>
651 * human.c (humblock): Set *options even when returning due to
652 xstrtoumax conversion failure. Thanks to a used-uninitialized
655 2005-04-09 Jim Meyering <jim@meyering.net>
657 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
658 -Wuninitialized: initialize tm0.tm_year.
660 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
662 * getdate.y (parser_control): rels_seen is now a boolean, not a
663 count, since there's no maximum. All uses changed.
664 Add member dsts_seen.
665 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
667 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
668 Use pc_rels_seen to decide whther a date is absolute.
670 * getdate.y (number): Don't overwrite year.
671 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
674 2005-04-02 Simon Josefsson <jas@extundo.com>
676 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
677 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
679 2005-03-27 Jim Meyering <jim@meyering.net>
681 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
683 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
685 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
686 "one's complement" -> "ones' complement" in comment, as per Knuth.
687 "value of type" -> "type or expression" in comment.
688 * mktime.c, strftime.c: Propagate intprops.h comment nits.
690 2005-03-26 Jim Meyering <jim@meyering.net>
693 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
694 Correct typos: s/or/of/.
696 2005-03-23 Jim Meyering <jim@meyering.net>
698 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
700 2005-03-21 Jim Meyering <jim@meyering.net>
702 Changes imported from coreutils.
704 * cycle-check.c: Don't include xalloc.h.
706 * path-concat.c: Don't include assert.h.
707 (path_concat): Remove assertion that would have triggered
708 for ABASE starting with more than one slash.
709 Reported by Andreas Schwab.
711 * path-concat.c (path_concat): Set *BASE_IN_RESULT
712 properly when ABASE is an absolute file name.
713 Correct the description of this function.
715 Add an assertion and a test driver.
716 This fixes a bug introduced on 2004-07-02.
717 Andreas Schwab reported the resulting failure of cp --parents:
718 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
720 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
722 * strftime.c (my_strftime): If the underlying strftime returns 0
723 (which shouldn't happen), generate nothing instead of returning 0
724 immediately, so that nstrftime (NULL, ...) doesn't return 0.
726 2005-03-16 Bruno Haible <bruno@clisp.org>
728 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
730 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
732 * strftime.c (my_strftime): Prepend space to format so that we can
733 reliably distinguish strftime failure from empty output on POSIX
736 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
738 * iconvme.c (SIZE_MAX): New macro, if not already defined.
739 (iconv_string): Don't guess a size-zero buffer, as that might cause
740 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
741 result would be 'too large', where 'too large' is (heuristically)
742 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
743 overflow concerns. This will prevent some unwanted malloc failures
744 when the inputs are very large.
746 2005-03-15 Bruno Haible <bruno@clisp.org>
748 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
751 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
754 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
756 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
758 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
759 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
761 * strtol.c: Likewise.
763 2005-03-14 Simon Josefsson <jas@extundo.com>
765 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
768 2005-03-14 Jim Meyering <jim@meyering.net>
770 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
771 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
772 to be nonzero so that we (and caller) can detect the difference
773 between a valid zero-length expansion and an error return, even
774 when the underlying strftime fails before writing anything into
777 2005-03-10 Jim Meyering <jim@meyering.net>
779 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
780 so that this module works on systems without fchdir.
782 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
784 Factor int-properties macros into a single file, except for
786 * intprops.h: New file.
787 * getloadavg.c: Include it instead of limits.h.
788 (INT_STRLEN_BOUND): Remove.
789 * human.c: Include intprops.h.
790 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
791 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
792 * inttostr.h: Include intprops.h instead of limits.h.
793 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
794 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
795 for consistency with intprops.h.
796 (time_t_is_integer, twos_complement_arithmetic): Use them.
797 * sig2str.h: Include <signal.h>, intprops.h.
798 (INT_STRLEN_BOUND): Remove.
799 * strftime.c (TYPE_SIGNED): Remove.
800 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
801 * strtol.c: Adjust comments to match intprops.h.
802 * userspec.c: Include intprops.h.
803 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
804 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
805 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
806 instead of rolling our own expressions.
807 * xstrtol.c: Include xstrtol.h first, to test interface.
809 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
811 (my_strftime): Do not mishandle years close to INT_MAX, by doing
812 the right thing even if adding 1900 would overflow. Similarly
813 for tm_mon + 1 and tm_yday + 1.
814 Make %Y always equivalent to %C%y, and similarly for %G and %g.
815 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
816 (DO_SIGNED_NUMBER): New macro.
817 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
819 2005-03-07 Bruno Haible <bruno@clisp.org>
821 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
823 2005-03-03 Derek R. Price <derek@ximbiot.com>
824 Bruno Haible <bruno@clisp.org>
826 * pagealign_alloc.h: New file.
827 * pagealign_alloc.c: New file.
829 2005-01-28 Bruno Haible <bruno@clisp.org>
831 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
834 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
836 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
837 The workaround isn't strictly needed for POSIX conformance, and
838 it's too much of a pain to configure and maintain. We'll ask
839 people to fix their kernels instead.
840 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
841 (NANOSLEEP_BUG_WORKAROUND): Remove.
842 (xnanosleep): Remove the workaround.
844 2005-02-12 Bruno Haible <bruno@clisp.org>
846 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
848 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
850 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
851 * timespec.h (gettime): Return void, since it always
852 succeeds now. All uses changed.
853 * gettime.c (gettime) Likewise.
854 [HAVE_NANOTIME]: Prefer nanotime.
855 Assume gettimeofday succeeds, as POSIX requires.
856 Assime time () succeeds, since other code already does.
857 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
858 (timespec_subtract): Remove.
859 (NANOSLEEP_BUG_WORKAROUND): New constant.
860 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
861 things considerably. Use it only on GNU/Linux hosts, since the
862 workaround shouldn't be needed elsewhere.
864 2005-02-24 Bruno Haible <bruno@clisp.org>
866 * gettext.h: Update from GNU gettext 0.14.2.
868 2005-02-24 Bruno Haible <bruno@clisp.org>
870 * localcharset.c: Update from GNU gettext 0.14.2.
871 * config.charset: Update from GNU gettext 0.14.2.
873 2005-02-22 Simon Josefsson <jas@extundo.com>
875 * iconvme.h, iconvme.c: New files, from libc.
877 2005-02-20 Neil Conway <neilc@samurai.com>
879 * xgethostname.c (xgethostname): Check for ENOMEM, which is
880 returned by OSX/Darwin if the specified buffer is not large
881 enough for the hostname.
883 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
885 * memrchr.h: New file.
886 * chdir-long.c: Include it.
887 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
888 Don't bother including stddef.h.
890 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
892 * argp-help.c (__argp_help): Create a fake struct argp_state and
893 pass it to _help, otherwise the latter coredumps trying to
894 dereference state.root_argp.
896 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
898 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
900 Include <sys/types.h>, for dev_t.
901 (ME_DUMMY, ME_REMOTE): Move from here....
902 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
903 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
905 Include mountlist.h first, to test the interface.
907 2005-01-29 Bruno Haible <bruno@clisp.org>
909 * progname.c (program_name): Initialize.
910 Needed when linking statically on MacOS X.
912 2005-01-28 Bruno Haible <bruno@clisp.org>
914 * javacomp.sh.in: New file, from GNU gettext.
915 * javacomp.h: New file, from GNU gettext.
916 * javacomp.c: New file, from GNU gettext.
918 2005-01-26 Bruno Haible <bruno@clisp.org>
920 * javaexec.sh.in: New file, from GNU gettext.
921 * javaexec.h: New file, from GNU gettext.
922 * javaexec.c: New file, from GNU gettext.
924 2005-01-26 Simon Josefsson <jas@extundo.com>
926 * gai_strerror.c: Use GPL in header.
928 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
930 * argp-help.c (hol_entry_help): Avoid using non-constant
931 initializers for struct pentry_state.
932 (__argp_error): Check return value of __asprintf
933 (__argp_failure): Translate error message
935 * argp-parse.c: Removed braces around the expansion of N_()
937 2005-01-21 Jim Meyering <jim@meyering.net>
939 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
940 same value as for Solaris 9.
942 * chdir-long.c (chdir_long): Rewrite to remove limitation on
943 component length. This included changing the parameter to be
944 of type `char *' rather than `char const *'.
945 * chdir-long.h (chdir_long): Update prototype.
947 * openat.c (fdopendir, fstatat): New functions.
948 * openat.h: Include headers required for use of DIR and struct stat.
949 [AT_SYMLINK_NOFOLLOW]: Define.
950 (fdopendir, fstatat): Add prototypes.
952 2005-01-21 Bruno Haible <bruno@clisp.org>
954 * classpath.h: New file, from GNU gettext.
955 * classpath.c: New file, from GNU gettext.
957 2005-01-20 Simon Josefsson <jas@extundo.com>
959 * version-etc-fsf.c: New file, with version_etc_copyright.
960 * version-etc.c: Remove version_etc_copyright.
961 * version-etc.h (version_etc_copyright): Use [] instead of * in
962 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
964 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
966 * save-cwd.c (save_cwd): Remove code to support the case
967 where fchdir is missing or flaky.
969 2005-01-20 Simon Josefsson <jas@extundo.com>
971 * base64.h (isbase64): Add.
973 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
974 using a unsigned prototype, don't inline.
975 (base64_decode): Use it.
977 2005-01-19 Bruno Haible <bruno@clisp.org>
979 * sh-quote.h: New file, from GNU gettext.
980 * sh-quote.c: New file, from GNU gettext.
982 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
984 Merge changes from coreutils, as described below in several
985 changelogs dated today.
987 * save-cwd.c: Include "save-cwd.h" before other include files.
988 (O_DIRECTORY): Remove; not needed here, since "." must be
989 a directory. All uses removed.
990 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
991 universal on Suns, and we also need to test for IRIX.
992 Revamp code to use 'if' rather than '#if'.
993 Avoid unnecessary comparison of cwd->desc to 0.
995 * utimens.c (futimens): Robustify the previous patch, by checking
996 for known valid error numbers rather than observed invalid ones.
998 2005-01-18 Jim Meyering <jim@meyering.net>
1000 * version-etc.c (version_etc_copyright): Update copyright date.
1002 * utimens.c (futimens): Account for the fact that futimes
1003 can also fail with errno == ENOSYS or errno == ENOENT.
1004 Patch from Dmitry V. Levin.
1006 Change the name of the robust chdir function from chdir to chdir_long.
1007 * save-cwd.c: Include chdir-long.h rather than chdir.h.
1008 (restore_cwd): Use chdir_long, not chdir.
1009 * chdir-long.c: Renamed from chdir.c.
1010 * chdir-long.h: Renamed from chdir.h.
1011 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
1014 2005-01-18 Bob Proulx <bob@proulx.com>
1016 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
1017 offsetof() macro construct to avoid compile failure with native HP-UX
1018 11.0 ANSI C compiler.
1020 2005-01-06 Bruno Haible <bruno@clisp.org>
1022 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
1023 because stpncpy.m4 takes care of it.
1025 2004-01-24 Bruno Haible <bruno@clisp.org>
1027 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
1029 2003-10-09 Bruno Haible <bruno@clisp.org>
1031 * progreloc.c: Include xalloc.h instead of xmalloc.h.
1033 2005-01-06 Bruno Haible <bruno@clisp.org>
1035 * fwriteerror.h (fwriteerror): Change specification to include fclose.
1036 * fwriteerror.c: Include <stdbool.h>.
1037 (fwriteerror): At the end, close the file stream. Record whether
1038 stdout was already closed.
1040 2004-05-27 Bruno Haible <bruno@clisp.org>
1042 * execute.c (environ): Declare if needed.
1043 * pipe.c (environ): Likewise.
1044 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
1046 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
1048 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
1049 definitions to be after all include files, to avoid collisions.
1050 Problem reported by Bob Proulx.
1052 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
1054 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
1055 not needed. This removes a dependency on the gettext module.
1056 [defined _LIBC]: Do not include <libintl.h>; not needed.
1058 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
1060 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
1063 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
1065 * argp-parse.c: Include <stddef.h>.
1066 (alignof, alignto): New macros.
1067 (parser_init): Don't assume that void * is aligned sufficiently
1070 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
1071 need to extend the stack.
1072 (YYINITDEPTH): New macro, so that the initial stack isn't overly
1075 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1077 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
1079 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1081 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
1082 Remove now-obsolete comment about AIX.
1083 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
1084 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
1085 (YYMAXDEPTH): New macro.
1087 2004-12-18 Bruno Haible <bruno@clisp.org>
1089 * fatal-signal.c (fatal_signals): Make non-const.
1090 (init_fatal_signals): New function.
1091 (uninstall_handlers, install_handlers): Ignore signals that were set to
1093 (at_fatal_signal): Call init_fatal_signals.
1094 (init_fatal_signal_set): Likewise. Ignore signals that were set to
1096 Reported by Paul Eggert.
1098 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
1100 * getdate.y (textint): New member "negative".
1101 (time_zone_hhmm): New function.
1102 Expect 14 shift-reduce conflicts, not 13.
1103 (o_colon_minutes): New rule.
1104 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
1105 (yylex): Set the "negative" member of signed numbers.
1107 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
1109 Changes imported from coreutils.
1110 * hard-locale.c: Assume <locale.h> exists.
1112 (GLIBC_VERSION): New macro.
1113 (hard_locale): Assume setlocale exists.
1114 Rewrite to avoid #ifdef.
1115 Use strdup rather than malloc + strcpy.
1116 * human.c: Assume <locale.h> exists.
1117 (human_readable): Assume localeconv exists.
1119 2004-12-01 Jakub Jelinek <jakub@redhat.com>
1121 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
1122 convert T2, not T. (Imported from libc.)
1124 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
1126 * getcwd.c (is_ENAMETOOLONG): New macro.
1127 (__getcwd.c): Don't restore errno; glibc doesn't.
1128 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
1129 first, falling back to our code only if its results look suspicious.
1130 Ensure that the resulting buffer is only as large as necessary.
1132 * readutmp.c: Include readutmp.h first.
1133 Include <errno.h>, since readutmp.h no longer does that.
1134 * readutmp.h: Don't include <errno.h>,
1135 <sys/param.h>, <time.h>; not needed to establish interface.
1136 (errno): Remove decl.
1137 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
1138 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
1139 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
1141 2004-11-28 Simon Josefsson <jas@extundo.com>
1143 * base64.h, base64.c: New file.
1145 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
1147 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
1149 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
1151 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
1152 HP's ANSI C compiler.
1153 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
1154 Declaring int functions causes warnings on some modern systems and
1155 shouldn't be needed to compile on ancient ones.
1156 * same.c (MIN) [defined MIN]: Don't define, since it's already
1159 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
1160 with the following changes.
1161 (__set_errno): Parenthesize properly.
1162 Include <stdbool.h>.
1163 (MIN, MAX, MATCHING_INO): New macros.
1164 (__getcwd): Define with prototype, not K&R form.
1165 Use heuristics to allocate default buffer on stack if possible.
1166 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
1167 behavior, and to avoid the PATH_MAX limit when computing
1169 Use MATCHING_INO to compare inode number to file.
1170 Check for arithmetic overflow in size calculations.
1171 Fix bug in reallocation of dot array that caused getcwd to fail
1172 on directories nested deeper than 75.
1173 Be more careful about saving errno on error.
1174 Do not use realloc; use only free+malloc, as this is a bit
1175 more flexible and avoids a needless copy operation.
1176 Do not inspect st_dev and st_ino for symbolic links; POSIX
1177 doesn't specify the latter.
1178 Check for closedir errors.
1179 Avoid needless casts.
1180 Use "#ifdef weak_alias" around weak_alias, to be like other
1182 The following changes to getcwd.c have effect only when used in
1183 gnulib; they have no effect inside glibc proper.
1184 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
1185 as alloca isn't used.
1186 (alloca, __alloca): Likewise.
1187 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
1188 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1189 unconditionally, as gnulib assumes C89 or better.
1190 Do not include <sys/param.h>.
1191 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
1192 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
1194 (NULL) [!defined NULL]: Remove; we assume C89 or better.
1195 Include <dirent.h> in a way that is compatible with modern Autoconf.
1196 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
1197 New macros, if not already defined.
1198 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
1199 Use "_LIBC", not "defined _LIBC", for consistency.
1200 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
1202 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
1203 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
1204 * xgetcwd.c: David MacKenzie's old code was removed, so give
1205 credit only to Jim Meyering and adjust the copyright dates.
1206 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
1207 <stdlib.h>, <unistd.h>, "pathmax.h".
1208 Instead, include "xgetcwd.h" (first) and "getcwd.h".
1209 (INITIAL_BUFFER_SIZE): Remove.
1210 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
1212 2004-11-23 Jim Meyering <jim@meyering.net>
1214 * getopt_.h: Remove trailing blanks.
1216 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1218 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
1219 (futimens): New function, which uses futimes if available.
1220 (futimens, utimens): Support timespec==NULL, with same semantics
1221 as utime and utimens.
1222 * utimens.h (futimens): New decl.
1224 2004-11-23 Jim Meyering <jim@meyering.net>
1226 * __fpending.c: Add comment.
1228 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1230 * getopt_.h: Re-addition of __getopt_argv_const caused
1231 redefinition warnings. To avoid them, include the defines
1232 in `#if !defined __need_getopt ... #endif'. The only place
1233 where __getopt_argv_const is used is in definitions
1234 of getopt_long and getopt_long_only below, which are as well
1235 protected by `#ifndef __need_getopt'.
1236 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
1237 __need_getopt after including <stdio.h> and <unistd.h> These
1238 headers might have defined it.
1240 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
1242 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
1244 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
1245 optopt): Use them instead of invoking ## directly; otherwise, the
1246 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
1248 2004-11-19 Bruno Haible <bruno@clisp.org>
1250 * strtok_r.c: Move comments from here...
1251 * strtok_r.h: ... to here.
1253 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
1255 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
1256 might fail. Problem reported by Yoann Vandoorselaere.
1257 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
1258 that mishandle size_t overflow.
1260 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1262 * canon-host.c: Include "strdup.h".
1263 (canon_host): Use getaddrinfo if available, so that IPv6 works.
1264 Use strdup instead of malloc/strcpy to duplicate strings.
1266 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
1267 (human_space_before_unit): New constant.
1268 * human.c (human_readable): Support it.
1270 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
1271 (xgetcwd): Set errno correctly when failing.
1272 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
1273 the failure is actually due to a PATH_MAX problem.
1275 Further getopt changes to make it more likely that glibc will
1276 buy the changes back.
1277 * getopt.c (POSIXLY_CORRECT): New constant.
1278 (getopt): Use it, so to preserve glibc semantic
1279 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
1280 when compiling for libc.
1281 * getopt_.h (__getopt_argv_const): Bring it back.
1282 (getopt_long, getopt_long_only): Use it.
1284 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
1285 New arg POSIXLY_CORRECT. All callers changed.
1286 (getopt): Argv is now char * const *, as per standard.
1287 (_getopt_internal_r, _getopt_internal): Argv is now char **,
1288 not char *__getopt_argv_const *.
1289 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1290 _getopt_long_only_r): Likewise.
1291 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
1292 * getopt_int.h (_getopt_internal, _getopt_internal_r,
1293 _getopt_long_r, _getopt_long_only_r): Likewise.
1294 * getopt_.h (__getopt_argv_const): Remove.
1295 (getopt): Argv is now char * const *, as per standard.
1297 * getdate.y (tORDINAL): New token.
1298 (day, relunit): Allow it for relative times.
1299 (relative_time_table): Use tORDINAL for ordinals.
1301 2004-11-15 Jim Meyering <jim@meyering.net>
1303 * closeout.c: Include "__fpending.h" once again.
1304 Include <stdbool.h>.
1305 (close_stdout): Don't fail just because stdout was closed initially,
1306 since some programs don't write to stdout in the normal course of
1307 operation (other than --version and --help), and we don't want this
1308 function to make e.g. `touch file >&-' fail.
1309 But do fail if it was closed and someone has tried to write to it.
1310 E.g., `printf foo >&-' must fail.
1312 2004-11-11 Simon Josefsson <jas@extundo.com>
1314 * strtok_r.h, strtok_r.c: New file.
1316 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
1318 * getopt_.h (__getopt_argv_const): New macro, to be used so that
1319 we can stop lying to compilers about the constness of argv when we
1320 are compiled outside glibc.
1321 (getopt, getopt_long, getopt_long_only): Use it.
1322 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
1324 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1325 _getopt_long_only_r): Likewise.
1326 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
1327 _getopt_long_only_r): Likewise.
1329 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
1330 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
1331 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
1332 the other external symbols.
1333 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
1334 declaration, since the above renaming now works around collisions.
1336 2004-11-11 Jim Meyering <jim@meyering.net>
1338 * linebreak.c: Remove trailing blanks.
1339 * alloca_.h: Likewise.
1340 * acosl.c: Likewise.
1341 * euidaccess.c: Likewise.
1342 * allocsa.h: Likewise.
1344 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
1346 * mktime.c (SHR): New macro, which is a portable
1347 substitute for >> that should work even on Crays.
1348 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
1349 Problem reported by Mark D. Baushke in
1350 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
1351 * getdate.y (SHR): Likewise.
1353 * strftime.c (SHR): Likewise.
1355 * quotearg.c (struct quoting_options): Use unsigned int for
1356 quote_these_too, so that right shifts are well defined. All uses
1359 2004-11-10 Simon Josefsson <jas@extundo.com>
1361 * getaddrinfo.h, getaddrinfo.c: New files.
1363 2004-11-10 Jim Meyering <jim@meyering.net>
1365 Ensure that no close failure goes unreported.
1366 * closeout.c (close_stdout): Always close stdout. I.e., don't
1367 return early when it seems there's nothing to flush.
1368 Don't include __fpending.h.
1370 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
1372 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
1374 2004-11-05 Bruno Haible <bruno@clisp.org>
1376 * readlink.c: Include stddef.h, needed for size_t on Woe32.
1377 Reported by Mark D. Baushke <mdb@cvshome.org>.
1379 2004-11-04 Bruno Haible <bruno@clisp.org>
1381 2004-09-11 Bruno Haible <bruno@clisp.org>
1382 * allocsa.valgrind: New file.
1383 2004-02-06 Bruno Haible <bruno@clisp.org>
1384 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
1385 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
1386 Reported by Christopher Seip <chris.seip@hp.com>.
1388 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1390 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
1391 with errno == ERANGE if the buffer is too small.
1392 Problem reported by Mark D. Baushke.
1394 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
1396 * xreadlink.c (MAXSIZE): New macro.
1397 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
1398 size does not exceed MAXSIZE. Avoid cast.
1399 As suggested by Mark D. Baushke in
1400 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
1401 if readlink fails with buffer size just under MAXSIZE, try again
1404 2004-11-02 Derek R. Price <derek@ximbiot.com>
1405 and Paul Eggert <eggert@cs.ucla.edu>
1407 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
1408 (get_date): Overparenthesize to avoid GCC warning.
1410 2004-11-02 Bruno Haible <bruno@clisp.org>
1412 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
1413 function returns void.
1415 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
1417 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1418 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
1421 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1423 * getdate.y: Add support for TZ="foo" within a date string.
1424 Fix some bugs near time_t boundaries. Reject dates with
1425 out-of-range components, e.g., "Sept 31".
1426 Include <stdlib.h>, "setenv.h", "xalloc.h".
1427 (ISDIGIT_LOCALE): Remove; unused.
1428 Note that the TZ and time functions used here are not reentrant.
1429 (mktime_ok, get_tz): New functions.
1430 (TZBUFSIZE): New constant.
1431 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
1432 This requires that we sometimes generate our own TZ="XXX..." setting.
1434 2004-10-27 Derek R. Price <derek@ximbiot.com>
1436 * mktime.c (not_equal_tm): Remove redundant check.
1438 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
1440 * getdate.y: Use Bison 1.875 features, and some minor
1441 code cleanups. This change does not affect semantics.
1442 Don't include <stdlib.h>; no longer needed.
1443 Don't include unlocked-io.h; only the "#if TEST" code uses
1444 stdio, and performance isn't crucial there.
1445 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
1446 Bison 1.875 features as described below.
1447 All uses of "PC." replaced by "pc->".
1448 (YYSTYPE): Add a forward declaration.
1449 (yylex, yyerror): Use full prototypes in forward decls.
1450 Use "%pure-parser" rather than obsolescent "%pure_parser".
1451 Use %parse-param and %lex-param instead of obsolescent
1452 YYPARSE_PARAM and YYLEX_PARAM.
1453 (meridian_table, month_and_day_table, time_units_table,
1454 relative_time_table, time_zone_table, military_table,
1455 lookup_zone, lookup_word, get_date):
1456 Use NULL instead of 0 where appropriate.
1457 (to_hour): Avoid abort (), to avoid a dependency on
1459 (yyerror, yylex): Now accepts parser_control * arg.
1460 (main) [TEST]: Use '\0' rather than 0 for char.
1462 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
1464 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
1465 It's now the caller's responsibility to handle the case where
1466 !HAVE_GETPAGESIZE && !defined getpagesize.
1468 * mktime.c (leapyear): Arg is long int, not int.
1470 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
1472 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
1474 2004-10-12 Simon Josefsson <jas@extundo.com>
1476 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1477 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
1480 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
1482 * vsnprintf.h: New file.
1483 * vsnprintf.c: New file.
1485 2004-10-07 Bruno Haible <bruno@clisp.org>
1487 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
1488 into the provided buffer.
1490 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
1492 * diacrit.c, diacrit.h: Add GPL notice.
1494 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
1495 * atanl.c (atanl): Keep the code as similar to glibc as possible.
1496 * logl.c (logl): Keep the code as similar to glibc as possible.
1497 This avoids a potential constant-folding bug.
1499 2004-10-05 Bruno Haible <bruno@clisp.org>
1501 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
1503 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1505 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
1506 * xmalloc.c (xmemdup): Likewise.
1507 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
1508 XFREE): Remove these long-obsolescent macros.
1509 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
1510 * xstrdup.c: Remove.
1512 * regex.c (re_comp): Cast gettext return value to char *,
1513 Problem reported by Martin Neitzel via Mark D. Baushke.
1515 2004-10-04 Simon Josefsson <jas@extundo.com>
1517 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
1518 '#ifdef USE_UNLOCKED_IO'.
1520 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1522 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
1523 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
1524 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
1525 regex.c, sha1.c, version-etc.c, yesno.c:
1526 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
1527 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
1528 the includer's responsibility.
1530 Sync from coreutils.
1532 * modechange.c (mode_compile): Don't decrement a pointer that
1533 points to the start of a string, as the C Standard says the
1534 resulting behavior is undefined.
1536 * backupfile.h (enum backuptype): Rename none -> no_backups,
1537 simple -> simple_backups, numbered_existing ->
1538 numbered_existing_backups, numbered -> numbered_backups
1539 to avoid shadowing problems. All uses changed.
1540 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
1541 * backupfile.c (check_extension, numbered_backup):
1542 Rename locals to avoid shadowing 'basename'.
1543 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
1546 * .cppi-disable: Add getopt_.h, getopt_int.h.
1547 * .cvsignore: Add getopt.h.
1549 2004-10-04 Simon Josefsson <jas@extundo.com>
1551 * memmem.h: New file.
1552 * memmem.c: New file, taken from glibc.
1554 2004-10-02 Jim Meyering <jim@meyering.net>
1556 * dirfd.h, getpagesize.h: Add copyright notice.
1558 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
1560 * snprintf.c: Remove comments as to why each header is needed.
1562 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
1564 * strsep.h: New file.
1565 * strsep.c: New file.
1567 2004-10-01 Simon Josefsson <jas@extundo.com>
1569 * snprintf.c (snprintf): Handle size==0.
1571 2004-10-01 Simon Josefsson <jas@extundo.com>
1572 Bruno Haible <bruno@clisp.org>
1574 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
1575 (snprintf): Declare 'args'.
1577 2004-09-30 Simon Josefsson <jas@extundo.com>
1579 * snprintf.h, snprintf.c: New files.
1581 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1583 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
1584 (hol_entry_help): Never translate an empty string.
1585 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
1586 * argp.h (OPTION_NO_TRANS): New option.
1588 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
1590 * xvasprintf.c: Include xalloc.h.
1591 (xvasprintf): Use xalloc_die, not xmalloc_die.
1593 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
1595 * dummy.c: Change copyright notice to FSF, and license to GPL.
1597 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
1599 * argp-pvh.c (argp_program_version_hook): Provide initial value.
1600 Problem reported by Bruno Haible in:
1601 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
1603 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
1605 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
1606 in case some system header has #define'd it. Problem reported by
1607 Soeren D. Schulze in
1608 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
1610 2004-09-08 Bruno Haible <bruno@clisp.org>
1612 * stdint_.h.in: New file, taken from GNU clisp.
1614 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
1616 * xvasprintf.h: New file.
1617 * xvasprintf.c: New file.
1618 * xasprintf.c: New file.
1620 2004-09-08 Bruno Haible <bruno@clisp.org>
1622 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
1624 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
1626 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
1628 Import from coreutils.
1629 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
1630 strings on unbounded length. alloca's performance benefits aren't
1631 that important here.
1633 (parse_with_separator): New function, with most of the internals
1634 of the old parse_user_spec. Allow user to omit both user and group,
1635 for compatibility with FreeBSD.
1636 Clone only the user name, not the entire spec.
1637 Do not set *uid, *gid unless entirely successful.
1638 Avoid memory leak in some failing cases.
1639 Fix regression for USER.GROUP reported by Dmitry V. Levin in
1640 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1641 (parse_user_spec): Rewrite to use parse_with_separator.
1643 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
1645 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
1646 its complicated substitute.
1647 * argp-help.c: Include <errno.h>, for program_invocation_short_name
1648 and program_invocation_name.
1649 (__argp_basename) [!_LIBC]: Remove; the only use was
1650 replaced by its body.
1651 (__argp_short_program_name): Change condition from
1652 !defined __argp_short_program_name to
1653 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
1654 to match argp-namefrob.h.
1655 (__argp_failure): Don't assume strerror_r returns char *.
1656 * argp-parse.c (N_): Define unconditionally.
1657 (argp_default_options): Fill out initializers with 0 to avoid
1660 2004-08-12 Simon Josefsson <jas@extundo.com>
1662 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
1663 * getopt_.h: Renamed from getopt.h.
1665 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1667 Merge from coreutils.
1669 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
1670 wmemchr or wmemcpy. Problem reported by Robert Dahlem
1671 for Reliant Unix 5.43.
1673 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
1674 (union fooround): Use uintmax_t, not long int.
1675 The rest is a merge from libc:
1676 [defined _LIBC]: Include <shlib-compat.h>.
1677 (_obstack) [defined _LIBC]: Remove after 2.3.4.
1679 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
1681 * strverscmp.c: Convert to UTF-8.
1683 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
1685 * obstack.h (obstack_empty_p):
1686 Don't assume that chunk->contents is suitably aligned.
1687 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
1688 Likewise. Problem reported by Benno in
1689 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
1691 * chown.c (rpl_chown): Work even if the file is writeable but not
1692 readable. This could be improved further but it'd take some work.
1694 2004-08-08 Simon Josefsson <jas@extundo.com>
1696 * xgethostname.c: Don't include error.h (not used).
1699 * getpass.c: Include getpass.h first.
1701 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
1703 * xalloc-die.c: New files.
1704 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
1706 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
1707 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
1708 (_, N_, xalloc_die): Move to xalloc-die.c.
1709 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
1710 so that we needn't mess with xalloc_msg_memory_exhausted.
1712 * sha1.h: Renamed from sha.h.
1713 (SHA1_H): Renamed from _SHA_H.
1714 (sha1_ctx): Renamed from sha_ctx.
1715 (sha1_init_ctx): Renamed from sha_init_ctx.
1716 (sha1_process_block): Renamed from sha_process_block.
1717 (sha1_process_bytes): Renamed from sha_process_bytes.
1718 (sha1_finish_ctx): Renamed from sha_finish_ctx.
1719 (sha1_read_ctx): Renamed from sha_read_ctx.
1720 (sha1_stream): Renamed from sha_stream.
1721 (sha1_buffer): Renamed from sha_buffer.
1722 * sha1.c: Likewise; renamed from sha.c.
1723 Do not include <sys/types.h>.
1724 Include <stddef.h> rather than <stdlib.h>.
1726 2004-08-08 Bruno Haible <bruno@clisp.org>
1728 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
1729 FILESYSTEM_PREFIX_LEN.
1730 * progreloc.c: Likewise.
1731 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
1733 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
1736 * argp-help.c (make_hol, hol_append): Don't assume that
1737 SIZE_MAX is a valid preprocessor constant.
1738 (__argp_basename): Change from "#ifndef _LIBC"
1739 to "#ifndef __argp_short_program_name", so that
1740 we don't compile these functions for tar.
1742 More merges from coreutils.
1743 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
1744 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
1746 * addext.c: Remove; no longer needed.
1747 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
1748 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
1749 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
1750 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
1751 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
1752 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
1753 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
1754 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
1755 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
1756 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
1757 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
1758 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
1759 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
1760 Import changes from coreutils.
1762 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
1764 Merge from coreutils.
1766 * .gdb-history: Remove; this doesn't belong here.
1768 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
1769 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
1770 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
1772 * dirname.h: Include <stdbool.h>.
1773 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
1774 for consistency with POSIX terminology. All uses changed.
1775 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
1776 (strip_trailing_slashes): Use bool for booleans.
1777 * stripslash.c (strip_trailing_slashes): Likewise.
1779 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1780 sometimes returns a positive errno value even when it succeeds.
1781 (print_errno_message) [!LIBC]: Fall back on strerror if
1784 * path-concat.c (mempcpy): Don't define if a system header defines it.
1785 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
1786 (longest_relative_suffix): New function.
1787 (path_concat): Use it. Assume first argument is not NULL.
1788 Port to DOS. Omit redundant separators.
1789 Report an error instead of returning NULL.
1790 Use mempcpy instead of memcpy.
1791 (xpath_concat): Remove: not declared or used.
1793 * same.h: Include <stdbool.h>
1794 (same_name): Return bool, not int.
1795 * same.c (same_name): Likewise.
1796 (errno): Don't declare; we assume C89 or better now.
1798 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
1799 if not already defined.
1801 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
1802 * dup-safer.c (errno): Likewise.
1804 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
1806 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
1809 2004-08-03 Simon Josefsson <jas@extundo.com>
1811 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
1812 * progname.h: Don't include stdbool.h.
1814 2004-08-02 Simon Josefsson <jas@extundo.com>
1816 * getsubopt.h: New file, with comments from Bruno Haible.
1817 * getsubopt.c: New file, from glibc, but slightly modified based on
1818 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
1820 2004-08-01 Simon Josefsson <jas@extundo.com>
1822 * xgetdomainname.c: Include stdlib.h, for free().
1824 2004-07-16 Simon Josefsson <jas@extundo.com>
1826 * dummy.c: New file.
1828 2004-07-16 Bruno Haible <bruno@clisp.org>
1830 * backupfile.h: Add extern "C" for C++.
1831 * closeout.h: Likewise.
1832 * copy-file.h: Likewise.
1833 * findprog.h: Likewise.
1834 * full-write.h: Likewise.
1835 * pathname.h: Likewise.
1836 * progname.h: Likewise.
1837 * stpcpy.h: Likewise.
1838 * stpncpy.h: Likewise.
1839 * strcase.h: Likewise.
1840 * strstr.h: Likewise.
1841 * xalloc.h: Likewise.
1843 * mbswidth.h: Add extern "C" for C++.
1844 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
1846 2004-07-09 Simon Josefsson <jas@extundo.com>
1848 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
1849 failed without this.)
1851 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
1853 * fchown-stub.c: New file.
1855 2004-06-24 Jim Meyering <jim@meyering.net>
1857 * obstack.h (obstack_base): Cast to (void *), per documentation.
1859 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
1861 * argz.c, argz_.h: New files, which are autoupdated from libtool.
1863 2004-06-01 Jim Meyering <jim@meyering.net>
1865 * calloc.c: New file.
1867 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
1869 * getdate.y (yylex): Allow space between sign and number.
1870 Problem reported by Dan Jacobson.
1872 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
1873 and Jim Meyering <jim@meyering.net>
1875 Merge from coreutils CVS.
1877 * stat-macros.h: New file, with contents from file-type.h
1878 and coreutils' system.h.
1879 * file-type.c: Include "stat-macros.h".
1880 * file-type.h (file_type): Move all macro definitions to new file,
1883 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
1884 Wrap old code with this conditional.
1885 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
1886 function that does not dereference symlinks.
1887 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
1889 * xreadlink.c: Include xreadlink.h first, to catch .h file
1890 dependency problems.
1891 (xreadlink): Accept new arg SIZE, for efficiency.
1892 All decls and uses changed.
1893 * xreadlink.h: Include <stddef.h>, for size_t.
1895 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
1896 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
1898 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
1900 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
1902 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
1903 macros to be defined.
1904 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
1905 the allocator returns NULL because the requested size is zero.
1907 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
1909 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
1910 var. Add comment explaining why libc still defines it. This
1911 merges the following patch from glibc:
1912 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
1914 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
1916 * obstack.c (_obstack): Remove unused variable. It hasn't been
1917 present in glibc since revision 1.1 of this file.
1918 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
1919 obstack_alignment_mask, obstack_alloc, obstack_base,
1920 obstack_blank, obstack_blank_fast, obstack_chunk_size,
1921 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
1922 obstack_grow0, obstack_init, obstack_int_grow,
1923 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
1924 obstack_next_free, obstack_object_size, obstack_ptr_grow,
1925 obstack_ptr_grow_fast, obstack_room): Remove declarations of
1926 nonexistent functions.
1928 2004-05-17 Derek R. Price <derek@ximbiot.com>
1929 Paul Eggert <eggert@cs.ucla.edu>
1931 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
1933 2004-05-14 Bruno Haible <bruno@clisp.org>
1935 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
1936 that consists of a '.' followed by an empty digit string.
1937 Patch by Tor Lillqvist <tml@iki.fi>.
1939 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
1941 Port obstack to the AS/400, where pointers are 16 bytes wide and
1942 you cannot cast an integer to a valid pointer. This patch is
1943 currently waiting to be integrated into glibc; see
1944 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
1946 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
1947 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
1948 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
1949 (struct obstack): temp member is now a union of a pointer and
1950 an integer, instead of an integer. All integer uses changed.
1951 This does not affect the physical layout of struct obstack,
1952 except on hosts (like the AS/400) where the size or alignment of
1953 void * is greater than that of ptrdiff_t.
1954 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
1955 __STDC__)]: Store temporary in pointer member of union, not
1957 * obstack.c: Include <stddef.h>, for offsetof.
1958 (struct fooalign): Remove; it doesn't need a name.
1959 (union fooround): Change double to long double, and add void *.
1960 (DEFAULT_ALIGNMENT): Use offsetof to compute.
1961 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
1962 not a macro. Hence the values are always int; so remove all
1963 casts-to-int in uses.
1965 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
1966 Derek Price <derek@ximbiot.com>
1968 * alloca.c: Include <alloca.h>, to get our interface.
1969 * alloca_.h: Use __alloca on AIX, so that we don't have to
1970 include <alloca.h> first. Use C89 prototype for alloca; this
1971 requires including <stddef.h> for size_t. Use extern "C" if C++.
1972 Use #elif for simplicity, since we can assume C89 now.
1973 Don't try to source the system alloca.h since it will not be found
1974 and to prevent recursively including its replacement.
1975 * fnmatch.c: Include <alloca.h> instead of opencoding.
1976 * regex.c: Likewise.
1978 2004-05-16 Derek Price <derek@ximbiot.com>
1979 Paul Eggert <eggert@cs.ucla.edu>
1981 getline cleanup. This changes the getndelim2 API: both order of
1982 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
1985 * getline.c: Don't include stddef.h or stdio.h, since our
1986 interface does that.
1987 (getline): Always use getdelim, so that we don't have two
1988 copies of this code.
1989 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
1991 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
1992 (GETNDELIM2_MAXIMUM): New macro.
1993 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
1994 instead of the old practice of delim2==0. All callers changed.
1995 Return -1 on overflow, instead of returning junk.
1996 Do not set *linesize unless allocation succeeds.
1997 * getndelim2.h: Do not include stddef.h; no longer needed, now
1998 that we include sys/types.h.
1999 * getnline.h: Likewise.
2000 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
2001 (getndelim2): Reorder arguments.
2002 * getnline.c (getnline, getndelim):
2003 Don't discard the NMAX argument.
2004 (getnline): Invoke getndelim, to avoid code duplication.
2005 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
2006 of (size_t) -1 by callers of the getnline family.
2008 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
2010 * nanosleep.c (suspended): Change its type from int to
2011 sig_atomic_t volatile.
2012 (first_call): Make it private to rpl_nanosleep, and have it
2013 be zero initially as that's a bit faster.
2014 (my_usleep): Round up fractional times instead of truncating them,
2015 as this is the usual meaning for 'sleep'.
2017 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
2019 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
2020 (ENOSYS): Define if not defined.
2021 (settime): Fall back on stime if it exists and settimeofday fails.
2022 But don't bother with fallbacks if a method fails with errno == EPERM.
2024 2004-05-11 Jim Meyering <jim@meyering.net>
2026 Prior to this change, the save_cwd caller required read access to the
2027 current directory on most systems (ones with the fchdir function).
2029 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
2030 fails, try write-only, and finally, resort to using xgetcwd.
2032 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
2034 * obstack.c, obstack.h: Import changes from libc.
2036 2004-04-28 Bruno Haible <bruno@clisp.org>
2038 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
2039 implicitly appends .exe to executables.
2040 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
2041 accepts Windows pathnames.
2042 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
2043 Cygwin like Windows, since it now accepts Windows pathnames.
2044 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
2045 Cygwin like Windows, since it now accepts Windows pathnames.
2046 Reported by Derek Robert Price <derek@ximbiot.com>.
2048 2004-04-20 Jim Meyering <jim@meyering.net>
2050 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
2052 2004-04-20 Jim Meyering <jim@meyering.net>
2053 Bruno Haible <bruno@clisp.org>
2055 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
2056 memory when realloc fails.
2058 2004-04-18 Jim Meyering <jim@meyering.net>
2060 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
2061 don't leak memory and do call END_UTMP_ENT.
2063 2004-04-11 Paul Eggert <eggert@twinsun.com>
2065 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
2066 (CHAR_BIT): Remove, since we assume C89.
2067 Include <stdint.h> if available, as per current Autoconf CVS advice.
2069 2004-03-30 Paul Eggert <eggert@twinsun.com>
2071 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
2072 not bool, to be more consistent with Unix conventions.
2073 Suggested by Bruno Haible.
2075 Merge from coreutils.
2077 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
2080 * getdate.h: Include stdbool.h, and timespec.h instead of
2081 the usual <time.h> dance.
2082 (get_date): Change signature to support fractional time stamps.
2083 All callers changed.
2084 * getdate.y: Include "getdate.h" first, as we can now
2085 assume C89 and don't need to worry about 'const'.
2086 Similarly, include "unlocked-io.h" near start, not in middle.
2088 (textint.value): Use long int rather than int.
2089 (textint.digits): Use size_t rather than int.
2090 (BILLION, LOG10_BILLION): New constants.
2091 (parser_control): New member rel_ns. Members day_ordinal,
2092 time_zone, month, day, hour, minutes, rel_year, rel_month,
2093 rel_day, rel_hour, rel_minutes, rel_seconds
2094 are now long int, not int. Member seconds is now struct timespec,
2095 not int. New member timespec_seen. Members dates_seen, days_seen,
2096 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
2098 (%union.intval): Now long int, not int.
2099 New member timespec.
2100 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
2101 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
2102 (spec): Now is a timespec or an item list.
2103 (timespec, items): New nonterminals.
2104 (time, rel, relunit, number, get_date):
2105 Add support for fractional seconds.
2106 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
2107 (gmtime, localtime, mktime): Remove decls; not needed with C89.
2108 (to_hour): First arg is now long int, not int.
2109 (to_year): Returns long int, not int.
2110 Don't treat year -70 like 70.
2111 (tm_diff): Returns long int, not int.
2112 (lookup_word): Use bool instead of int when appropriate.
2113 (yylex): Use size_t for count, not int.
2114 Detect overflow when parsing large integer constants.
2115 Add support for fractions.
2116 (get_date): Make pointers 'const' if possible.
2117 Use more-portable code to detect integer overflow.
2118 (main) [TEST]: Adjust to above changes. Test for localtime failure.
2119 Don't use ctime; it's not reliable if the year has >4 digits.
2121 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
2122 This is for compatibility with BSD.
2124 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
2125 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
2126 From coreutils' system.h.
2128 * userspec.c: Don't include "posixver.h".
2129 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
2130 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
2131 compatible extension. Simplify code by removing a boolean int
2132 that was always nonzero if a string was nonnull.
2134 2004-03-30 Jim Meyering <jim@meyering.net>
2136 Merge from coreutils.
2138 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
2140 * readtokens.c (readtoken): Don't leak 64 bytes when reading
2141 an empty input stream.
2143 * readtokens.c: Include <stdbool.h>.
2144 (readtoken): Use `size_t' rather than int/long.
2145 All callers adjusted.
2146 Use `bool' rather than `int' where appropriate.
2147 Use memset rather than an explicit loop.
2148 Use x2nrealloc rather than xrealloc.
2149 Allow the use of `\0' as a delimiter.
2150 (readtokens): Likewise.
2151 * readtokens.h (readtoken, readtokens): Update prototypes.
2153 2004-03-30 Bruno Haible <bruno@clisp.org>
2155 * getloadavg.c (getloadavg): Don't assume setlocale returns
2158 2004-03-29 Paul Eggert <eggert@twinsun.com>
2160 Merge changes to getloadavg.c from coreutils and Emacs.
2162 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
2163 Define to an expression, not to the empty string.
2164 Include cloexec.h and xalloc.h.
2165 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
2166 Use set_cloexec_flag rather than rolling our own.
2167 * cloexec.c, cloexec.h: New files.
2169 2004-03-18 Paul Eggert <eggert@twinsun.com>
2171 * getopt.h: Sync with libc CVS.
2173 2004-03-18 Paul Eggert <eggert@twinsun.com>
2174 Bruno Haible <bruno@clisp.org>
2176 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
2177 not on all platforms that have <wchar.h>.
2178 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
2180 2004-03-09 Paul Eggert <eggert@twinsun.com>
2182 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
2184 * getopt_int.h: New file, also synced from libc.
2186 2004-03-07 Paul Eggert <eggert@twinsun.com>
2188 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
2189 '#if' expressions. Unlike the code it replaces, it does not
2190 depend on (defined _SC_PAGESIZE). However, it does depend on
2191 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
2192 first reported by Jason Andrade in
2193 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
2195 2004-01-18 Simon Josefsson <jas@extundo.com>
2197 * strdup.h: New file.
2198 * strdup.c: Include it.
2199 * path-concat.c: Include strdup.h. Drop strdup declaration.
2200 * userspec.c: Include strdup.h. Drop strdup declaration.
2202 2004-02-06 Karl Berry <karl@gnu.org>
2204 * config.charset: update from gettext 0.14.1.
2206 2004-02-05 Paul Eggert <eggert@twinsun.com>
2208 Add comments and code, prompted by suggestions from Bruno Haible
2210 * quotearg.h (quotearg_alloc): New decl. Improve the comments
2211 describing the enum quoting_style values.
2212 * quotearg.c (quotearg_alloc): New function.
2213 (quotearg_buffer_restyled): Treat lone { and } as special.
2214 Treat = as special. Work around bug with older shells
2215 that "see" a '\' that is really the 2nd byte of a multibyte char.
2216 Quote empty string with shell_quoting_style.
2218 2004-02-03 Bruno Haible <bruno@clisp.org>
2220 * pipe.h: New file, from GNU gettext.
2221 * pipe.c: New file, from GNU gettext.
2223 2004-01-27 Bruno Haible <bruno@clisp.org>
2225 * execute.h: New file, from GNU gettext.
2226 * execute.c: New file, from GNU gettext.
2227 * w32spawn.h: New file, from GNU gettext.
2229 2004-01-23 Paul Eggert <eggert@twinsun.com>
2231 Exit-status fix from coreutils.
2233 Use exit_failure consistently in place of EXIT_FAILURE,
2234 so that program exit statuses are consistent on failure.
2236 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
2237 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
2238 * argmatch.h: Comment fix to match the above.
2239 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
2240 Now a macro referring to exit_failure, instead of a separate
2241 variable. Include "exitfail.h" to get it.
2242 * xstrtol.h: Include "exitfail.h".
2243 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
2245 * long-options.c (parse_long_options): Use prototype
2246 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
2249 2004-01-21 Jim Meyering <jim@meyering.net>
2251 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
2252 so as not to conflict with a different-sized __mktime_internal
2253 function in GNU libc.
2254 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
2255 Problem building statically-linked `ls' reported by Michael Brunnbauer.
2257 2004-01-18 Paul Eggert <eggert@twinsun.com>
2259 Merge from diffutils.
2261 * file-type.c (file_type): Add typed memory objects.
2262 * file-type.h (S_TYPEISTMO): New macro.
2264 * c-stack.h (c_stack_action): Remove argv argument.
2265 * c-stack.c (c_stack_action): Likewise. All uses changed.
2266 (die): Don't calculate message unless segv_action returns.
2267 (get_stack_location, min_address_from_argv, max_address_from_argv,
2268 volatile stack_base, volatile_stack_size): Remove.
2269 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
2270 that every segmentation violation is a stack overflow. (Ouch!)
2271 See Debian bug 136249 (still outstanding) for more info about why
2272 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
2274 2003-11-30 Bruno Haible <bruno@clisp.org>
2276 Safer stack allocation.
2277 * setenv.c: Include allocsa.h.
2278 (alloca): Remove fallback definition.
2279 (freea): Remove macro.
2280 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
2283 2003-10-17 Bruno Haible <bruno@clisp.org>
2285 * binary-io.h: Avoid warnings on Cygwin.
2287 2003-12-28 Bruno Haible <bruno@clisp.org>
2289 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
2290 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
2292 2003-11-28 Bruno Haible <bruno@clisp.org>
2294 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
2296 2003-11-27 Bruno Haible <bruno@clisp.org>
2298 * wait-process.c: On Windows, include windows.h. Needed on mingw.
2300 2003-11-17 Bruno Haible <bruno@clisp.org>
2302 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
2304 2003-11-24 Bruno Haible <bruno@clisp.org>
2306 * xallocsa.h: New file, from GNU gettext.
2307 * xallocsa.c: New file, from GNU gettext.
2309 2003-11-24 Bruno Haible <bruno@clisp.org>
2311 * allocsa.h: New file, from GNU gettext.
2312 * allocsa.c: New file, from GNU gettext.
2314 2003-11-24 Bruno Haible <bruno@clisp.org>
2316 * eealloc.h: New file.
2318 2004-01-15 Jim Meyering <jim@meyering.net>
2320 Merge from coreutils.
2322 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
2323 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
2324 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
2326 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
2327 optional configure-time default.
2329 * version-etc.c (version_etc_copyright): Update copyright date.
2331 * xreadlink.c (xreadlink): Correct outdated comment.
2333 2004-01-15 Paul Eggert <eggert@twinsun.com>
2335 Merge from coreutils.
2337 * posixver.c: Include posixver.h.
2339 * same.c: Include <stdbool.h>, <limits.h>.
2340 (_POSIX_NAME_MAX): Define if not defined.
2342 (same_name): If file names are silently truncated, report
2343 that the file names are the same if they are the same after
2344 the silent truncation.
2346 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
2347 conversion function.
2348 * xstrtod.c (xstrtod): Likewise. All callers changed to
2349 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
2352 2004-01-14 Paul Eggert <eggert@twinsun.com>
2354 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
2355 with like-named macro in fnmatch.c.
2356 (EXT): Use an internal constant instead.
2358 Merge fnmatch patches from glibc.
2359 * fnmatch.c (mbsinit): Remove define.
2360 Add libc_hidden_ver (__fnmatch, fnmatch).
2361 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
2362 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
2364 2003-12-14 Karl Berry <karl@gnu.org>
2366 * config.charset: update from gettext-runtime.
2368 2003-12-03 Paul Eggert <eggert@twinsun.com>
2370 * getgroups.c (getgroups): xmalloc takes one argument, not two.
2371 Bug reported by Alfred M. Szmidt.
2373 2003-11-29 Karl Berry <karl@gnu.org>
2375 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
2377 2003-11-23 Paul Eggert <eggert@twinsun.com>
2378 Bruno Haible <bruno@clisp.org>
2380 * printf-parse.h: Don't include sys/types.h.
2381 (ARG_NONE): New macro.
2382 (char_directive): Change type of *arg_index fields to size_t.
2383 * printf-parse.c: Don't include sys/types.h.
2384 (SSIZE_MAX): Remove macro.
2385 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
2386 Remove unnecessary overflow check.
2387 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
2390 2003-11-24 Paul Eggert <eggert@twinsun.com>
2392 * alloca.c: Remove dependency on xalloc module.
2393 (xalloc_die): Remove.
2394 (memory_full) [!defined emacs]: New macro.
2395 [!defined emacs]: Don't include xalloc.h.
2396 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
2397 address arithmetic overflows. Change datatypes a bit to avoid
2400 2003-11-22 Jim Meyering <jim@meyering.net>
2402 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
2404 2003-11-17 Bruno Haible <bruno@clisp.org>
2406 * vasnprintf.c (alloca): Remove fallback definition.
2407 (freea): Remove definition.
2408 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
2409 Reported by Paul Eggert.
2411 2003-11-17 Jim Meyering <jim@meyering.net>
2413 On systems without utime and without a utimes function capable of
2414 dealing with a NULL struct utimbuf* argument, this utime replacement
2415 could -- in unusual circumstances -- leak a file descriptor.
2416 * utime.c: Include <unistd.h> and <errno.h>.
2417 (utime_null): Be sure to close `fd' and to preserve errno.
2418 Reported by Geoff Collyer via Arnold Robbins.
2420 2003-11-16 Paul Eggert <eggert@twinsun.com>
2421 Bruno Haible <bruno@clisp.org>
2423 Protect against address arithmetic overflow.
2424 * printf-args.h: Include stddef.h.
2425 (arguments): Change type of field 'count' to size_t.
2426 * printf-args.c (printf_fetchargs): Use size_t instead of
2427 'unsigned int' where appropriate.
2428 * printf-parse.h: Include sys/types.h.
2429 (char_directive): Change type of *arg_index fields to ssize_t.
2430 (char_directives): Change type of fields 'count', max_*_length to
2432 * printf-parse.c: Include sys/types.h and xsize.h.
2433 (SSIZE_MAX): Define fallback value.
2434 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
2435 instead of 'int' where appropriate. Check a_allocated, d_allocated
2436 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
2437 * vasnprintf.c: Include xsize.h.
2438 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
2439 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
2440 overflow. Avoid wraparound when converting a width or precision from
2443 2003-11-16 Bruno Haible <bruno@clisp.org>
2445 Update from GNU gettext.
2446 * printf-parse.c: Generalize to it can be compiled for wide strings.
2447 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
2448 * vasnprintf.c: Generalize to it can be compiled for wide strings.
2449 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
2450 SNPRINTF): New macros.
2451 Don't include <alloca.h> if the file is used inside libintl.
2452 (local_wcslen): New function, for Solaris 2.5.1.
2453 (VASNPRINTF): Use it instead of wcslen.
2455 2003-11-16 Bruno Haible <bruno@clisp.org>
2457 * xsize.h (xmax): New function.
2458 (xsum, xsum3, xsum4): Declare as "pure" functions.
2460 2003-11-12 Paul Eggert <eggert@twinsun.com>
2462 * xalloc.h: Do not include <limits.h> or <stdint.h>.
2463 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
2464 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
2465 heuristic is just as accurate as far as we know, and it removes a
2466 dependency on size_max.m4 and ptrdiff_max.m4.
2468 2003-11-12 Paul Eggert <eggert@twinsun.com>
2470 * xstrtol.c (__xstrtol): Remove "break" immediately after
2471 "return", to pacify some unknown compiler. Problem reported
2474 2003-11-11 Bruno Haible <bruno@clisp.org>
2476 * xsize.h (SIZE_MAX): Remove fallback definition.
2477 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
2480 2003-11-10 Paul Eggert <eggert@twinsun.com>
2482 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
2483 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
2484 rejected some allocations of exactly SIZE_MAX - 2 bytes.
2486 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
2487 not (size_t) -1, since it's defined here.
2489 2003-11-06 Paul Eggert <eggert@twinsun.com>
2491 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
2492 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
2493 Reject sizes of exactly SIZE_MAX bytes.
2494 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
2495 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
2497 2003-11-05 Bruno Haible <bruno@clisp.org>
2499 * xsize.h: Include limits.h, to avoid a possible collision with
2500 SIZE_MAX defined in <limits.h> on Solaris.
2502 2003-11-04 Bruno Haible <bruno@clisp.org>
2504 * xsize.h: New file.
2505 * linebreak.c: Include xsize.h.
2506 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
2507 argument for overflow.
2508 Suggested by Paul Eggert.
2510 2003-10-31 Bruno Haible <bruno@clisp.org>
2512 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
2513 to avoid (extremely rare) race condition.
2514 Suggested by Paul Eggert.
2516 2003-11-03 Jim Meyering <jim@meyering.net>
2518 * userspec.c: Include "userspec.h".
2519 * userspec.h: New file.
2521 2003-10-31 Paul Eggert <eggert@twinsun.com>
2523 * mountlist.h (struct mount_entry.me_type_malloced): New member.
2524 * mountlist.c (SIZE_MAX): Define if not defined already.
2525 (read_filesystem_list): Set and use me_type_malloced.
2526 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
2527 whatever the type happens to be), for brevity and consistency.
2528 Check for size calculation overflow on Alphas running OSF/1.
2530 2003-10-31 Jim Meyering <jim@meyering.net>
2532 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
2534 * linebuffer.c: Include <string.h> for declaration of memset.
2536 2003-10-30 Paul Eggert <eggert@twinsun.com>
2537 Bruno Haible <bruno@clisp.org>
2539 * vasprintf.c: Include <limits.h>, <stdlib.h>.
2540 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
2542 2003-10-29 Paul Eggert <eggert@twinsun.com>
2544 * xalloc.h (xalloc_oversized): Now a macro, not a function,
2545 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
2547 * quotearg.c (quotearg_n_options): Use it.
2548 * group-member.c: Include <stdbool.h>.
2549 (free_group_info): Arg is now const *; don't free arg.
2550 (get_group_info): Now returns bool and accepts struct group_info *,
2551 rather than returning a malloc'ed struct group_info *.
2552 All uses changed. Check for overflow in internal size calculation.
2554 * getusershell.c (readname): Simplify the code by using x2nrealloc
2555 rather than xmalloc/xrealloc.
2556 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
2557 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
2558 conformance bug: the old code used a pointer after freeing the
2559 storage that it addressed.
2560 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
2561 rather than doing it by hand.
2562 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
2563 the buffer preserved. Use free and xmalloc instead.
2564 * quotearg.c (quotearg_n_options): Likewise.
2565 Use a simpler test for size overflow. Don't use xalloc_oversized
2566 because unsigned int might be wider than size_t (!); this suggests
2567 that we should switch from unsigned int to size_t for slot numbers.
2569 2003-10-27 Bruno Haible <bruno@clisp.org>
2571 * stdbool_.h: Better support for BeOS.
2573 2003-10-27 Paul Eggert <eggert@twinsun.com>
2575 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
2576 to allocate the returned structure. Do not allocate a subarray,
2577 as x2nrealloc will do that.
2578 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
2579 instead of xnrealloc.
2580 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
2582 2003-10-26 Paul Eggert <eggert@twinsun.com>
2584 * xalloc.h (xalloc_oversized): New static inline function, for
2585 callers that want to do their own size-overflow checking. Include
2586 <stdbool.h>, since xalloc_oversized returns bool.
2587 * xalloc.c (array_size_overflow): Remove. All callers changed
2588 to use xalloc_oversized.
2590 Add two functions x2realloc, x2nrealloc, for programs that grow
2591 arrays dynamically by doubling their sizes.
2592 * xalloc.h (x2realloc, x2nrealloc): New decls.
2593 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
2596 Port to C99 semantics for 'inline' of external functions.
2597 Bug reported by Bruno Haible.
2598 * xmalloc.c (xnmalloc_inline): New static inline function,
2599 with the old contents of xnmalloc.
2600 (xnmalloc, xmalloc): Use it.
2601 (xnrealloc_inline): New static inline function,
2602 with the old contents of xnrealloc.
2603 (xnrealloc, xrealloc): Use it.
2605 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
2607 2003-10-25 Paul Eggert <eggert@twinsun.com>
2609 Fix several address-calculation bugs in the hash modules,
2610 plus some minor code cleanup.
2612 * hash.h: Include <stdbool.h>, for bool.
2613 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
2614 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
2615 hash_get_n_entries, hash_get_max_bucket_length,
2616 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
2617 hash_rehash): Use size_t rather than unsigned.
2618 * hash.c (struct hash_table, hash_get_n_buckets,
2619 hash_get_n_buckets_used, hash_get_n_entries,
2620 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
2621 hash_get_entries, hash_do_for_each, hash_string, is_prime,
2622 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
2624 (SIZE_MAX): Define if not defined.
2625 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
2626 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
2628 Use const * when possible.
2629 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
2630 (check_tuning): Fix bug: if tuning parameters were very close to
2631 0 or 1, rounding errors could have caused subscript violations.
2632 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
2633 (hash_initialize): Add 'fail:' label
2634 to free table and return NULL, and use it to simplify code.
2635 Use calloc rather than clearing the storage ourself.
2636 (hash_initialize, hash_rehash): Check for arithmetic overflow in
2637 buffer size calculations.
2638 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
2639 Include <stddef.h>, for size_t.
2640 * hash-pjw.c (hash_pjw): Likewise.
2641 Switch to method described by Bruno Haible.
2642 Include <limits.h>, for CHAR_BIT.
2643 (SIZE_BITS): New macro.
2645 2003-10-21 Paul Eggert <eggert@twinsun.com>
2647 * getndelim2.c (getndelim2): When size calculation overflows,
2648 ceiling the allocation at NMAX bytes rather than silently
2649 discarding input bytes before NMAX is reached. This makes
2650 a difference only if NMAX exceeds SIZE_MAX / 2.
2652 * obstack.c: Merge from glibc.
2653 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
2654 Add libc_hidden_def (_obstack_newchunk).
2655 (_obstack_free) [! defined _LIBC]: Remove.
2656 [defined _LIBC]: Make a strong alias from obstack_free, rather than
2657 a clone of the function body.
2658 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
2659 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
2661 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
2662 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
2665 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
2666 (obstack_ptr_grow_fast, obstack_int_grow_fast):
2667 Don't use lvalue casts, as GCC plans to remove support for them
2668 in GCC 3.5. Reported by Joseph S. Myers. This bug
2669 was also present in the non-GCC version, indicating that this
2670 code had always been buggy and had never been widely used.
2671 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
2672 Use the fast variant of each macro, rather than copying the
2673 definiens of the fast variant; that way, we'll be more likely to
2674 catch future bugs in the fast variants.
2676 2003-10-20 Bruno Haible <bruno@clisp.org>
2678 * wait-process.h: New file, from GNU gettext.
2679 * wait-process.c: New file, from GNU gettext.
2681 2003-10-19 Jim Meyering <jim@meyering.net>
2683 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
2685 2003-10-16 Paul Eggert <eggert@twinsun.com>
2687 * getgroups.c: Include <errno.h>, <stdlib.h>.
2688 (getgroups): First arg is int, not size_t.
2689 Don't let 'free' mangle errno.
2691 2003-10-16 Jim Meyering <jim@meyering.net>
2693 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
2695 2003-10-15 Paul Eggert <eggert@twinsun.com>
2697 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
2699 (new_exclude, add_exclude_file): Initial size no longer needs to
2701 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
2702 our own address arithmetic overflow checking.
2704 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
2705 (fnmatch): Do not alloca more than 2000 wide characters;
2706 instead, use malloc for large buffers.
2707 Check for address arithmetic overflow, and return -1
2708 with errno set to ENOMEM in that case.
2709 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
2710 (NEW_PATTERN): Do not alloca more than 8000 bytes;
2711 instead, return -1. Check for address arithmetic overflow.
2713 2003-10-14 Paul Eggert <eggert@twinsun.com>
2715 Handle invalid suffixes and overflow independently, so that
2716 callers can treat them independently as needed. Fix some bugs in
2717 suffix handling, e.g., "100k@" was not diagnosed as an invalid
2718 suffix for a human-readable blocksize. The major caller-visible
2719 change is the addition of a new
2720 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
2721 that both overflow and suffix chars were found.
2723 * human.c (humblock): Don't check separately for invalid suffix
2724 char; that is xstrtoumax's job (now that its bug is fixed).
2725 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
2726 INTMAX_MAX]: New macros.
2727 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
2728 TYPE_MAXIMUM): New macros.
2729 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
2730 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
2731 if overflow occurs, as it's what __strtol does and it's more useful
2733 (__xstrtol): If __strtol reports some error other than ERANGE,
2734 reflect it to the caller as LONGINT_INVALID. If it reports
2735 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
2736 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
2737 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
2739 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
2740 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
2741 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
2742 [defined UINTMAX_MAX]: New macros.
2744 2003-10-14 Bruno Haible <bruno@clisp.org>
2746 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
2747 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
2748 Also use volatile where needed.
2750 2003-10-12 Paul Eggert <eggert@twinsun.com>
2752 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
2753 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
2754 and define in terms of the other primitives.
2755 * xmalloc.c: Include stdbool.h; do not include exit.h.
2756 (SIZE_MAX): Define if not already defined.
2757 (array_size_overflow): New function.
2758 (xalloc_die): Abort instead of exiting if 'error' returns.
2759 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
2760 (xmalloc, xrealloc): Use them.
2761 (xcalloc): Check for address arithmetic overflow.
2762 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
2763 a bit faster than strcpy.
2765 2003-10-08 Paul Eggert <eggert@twinsun.com>
2767 Merge getpass from libc, plus a few fixes.
2769 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
2770 Include <stdbool.h>.
2771 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
2772 __fsetlocking to empty.
2773 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
2774 do include <bits/libc-lock.h>.
2775 Do not include <fcntl.h>; not needed.
2776 [_LIBC]: Include <wchar.h>.
2777 (NOTCANCEL_MODE): New macro.
2778 (flockfile, funlockfile) [_LIBC]: New macros.
2779 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
2780 [!_LIBC]: New macros.
2781 (call_fclose): New function.
2782 (getpass): Use it. Save tty stream separately; this simplifies the
2783 code and makes it more reliable if stdin happens to equal stdout.
2784 Invoke __fsetlocking on tty.
2785 Handle thread cancellation if needed.
2786 Namespace cleanup (use __tcgetattr, __getline).
2787 Use bool for Booleans.
2788 [USE_IN_LIBIO]: Handle wide streams.
2789 [!_LIBC]: Unconditionally do the fseek, since we don't know what
2790 stream might go where.
2792 * unlocked-io.h: Include <stdio.h>, so that the caller
2793 doesn't have to include <stdio.h> before us.
2794 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2795 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2796 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2797 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2798 if not declared, so that we can use getpass.c code from libc without
2800 (flockfile, ftrylockfile, funlockfile): New macros.
2802 2003-10-06 Bruno Haible <bruno@clisp.org>
2804 * version-etc-2.h: Remove file.
2805 * version-etc-2.c: Remove file.
2807 2003-09-25 Jim Meyering <jim@meyering.net>
2808 Bruno Haible <bruno@clisp.org>
2810 This lets translators provide better translations for the
2811 "Written by ..." part of --version output.
2812 * version-etc.h: Include stdarg.h.
2813 (version_etc_copyright): Declare as readonly.
2814 (version_etc): Make this function variadic with a NULL-terminated list
2815 of author name strings.
2816 (version_etc_va): New declaration.
2817 * version-etc.c: Include stdarg.h, stdlib.h.
2818 (version_etc_copyright): Declare as readonly.
2819 (version_etc_va): New function. Provide a different translatable string
2820 for each possible number of authors < 10. Abbreviate when there are 10
2822 (version_etc): Make this function variadic. Call version_etc_va.
2823 Suggestion from Gary V. Vaughan.
2825 * long-options.h (parse_long_options): Change prototype: the authors
2826 string is moved to the end and becomes variadic.
2827 * long-options.c: Include stdarg.h.
2828 (parse_long_options): Make this function variadic, too.
2829 Call version_etc_va, not version_etc.
2831 2003-10-06 Bruno Haible <bruno@clisp.org>
2833 * fatal-signal.h: New file, from GNU gettext.
2834 * fatal-signal.c: New file, from GNU gettext.
2836 2003-10-04 Karl Berry <karl@gnu.org>
2838 * argp*: update from libc.
2840 2003-10-01 Larry Jones <lawrence.jones@eds.com>
2842 * getpass.c (getpass): Use a no-op fseek when switching from input to
2843 output mode on the same stream.
2845 2003-09-29 Paul Eggert <eggert@twinsun.com>
2847 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
2848 Fix arg typo in previous patch.
2850 2003-09-28 Jim Meyering <jim@meyering.net>
2852 * error.c: Correct cpp indentation.
2854 2003-09-27 Paul Eggert <eggert@twinsun.com>
2856 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
2857 Omit the special code that used __typeof__, since we worry that
2858 it could be more trouble than it's worth. See:
2859 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
2860 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
2864 2003-09-26 Jim Meyering <jim@meyering.net>
2866 * error.c (error_tail): Move some declarations
2867 into inner scope where the local variables are used.
2869 2003-09-26 Bruno Haible <bruno@clisp.org>
2871 * stpncpy.h (gnu_stpncpy): New declaration.
2872 (stpncpy): Define as alias for gnu_stpncpy.
2873 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
2875 2003-09-26 Paul Eggert <eggert@twinsun.com>
2877 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
2878 (error_tail): Do not loop, reallocating temporary buffer, since
2879 the output cannot contain more wide characters than the input
2880 contains bytes, the size must be big enough already. This avoids
2881 one potential size overflow calculation. Check for size overflow
2882 when calculating temporary buffer size. Free temporary buffer
2883 when done, if it was allocated with malloc; this plugs a memory
2884 leak. Remove casts from void * to pointers, that are no longer
2885 needed now that we're assuming C89 or better.
2887 Merge error changes from glibc.
2889 * error.c, error.h: Update copyright notice header to match glibc.
2890 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
2891 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
2892 Disable cancellation while printing error.
2893 * error.h: Prepend __ to parameter names.
2895 2003-09-25 Karl Berry <karl@gnu.org>
2897 * argp-fmtstream.c, argp-help.c: update from libc.
2899 2003-09-25 Bruno Haible <bruno@clisp.org>
2901 * version-etc-2.h: New file, from version-etc.h with modifications.
2902 * version-etc-2.c: New file, from version-etc.c with modifications.
2904 2003-09-25 Simon Josefsson <jas@extundo.com>
2906 * xgetdomainname.h: New file.
2907 * xgetdomainname.c: New file.
2909 2003-09-25 Simon Josefsson <jas@extundo.com>
2910 Bruno Haible <bruno@clisp.org>
2912 * getdomainname.h: New file.
2913 * getdomainname.c: New file.
2915 2003-09-24 Paul Eggert <eggert@twinsun.com>
2917 * linebuffer.c (freebuffer): Don't free the argument, just
2918 the buffer associated with the argument. Bug reported by
2921 2003-09-19 Karl Berry <karl@gnu.org>
2923 * argp.h: update from libc.
2925 2003-09-16 Paul Eggert <eggert@twinsun.com>
2927 * linebuffer.c (readlinebuffer): Return NULL immediately upon
2928 input error, instead of returning NULL the next time we are called
2929 (and therefore losing track of errno).
2931 2003-09-15 Paul Eggert <eggert@twinsun.com>
2933 * getndelim2.c (getndelim2): Don't trash errno when a read
2934 fails, so that the caller gets the proper errno.
2936 * readutmp.c (read_utmp): Likewise.
2937 Check for fstat error. Close stream and free storage
2940 2003-09-14 Bruno Haible <bruno@clisp.org>
2942 * fwriteerror.h: New file.
2943 * fwriteerror.c: New file.
2945 2003-09-14 Jim Meyering <jim@meyering.net>
2947 * getloadavg.c: Correct cpp indentation.
2948 * strdup.c: Likewise.
2949 * vasnprintf.c: Likewise.
2951 2003-09-12 Paul Eggert <eggert@twinsun.com>
2953 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
2954 * obstack.c [!defined _LIBC]: Likewise.
2955 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
2956 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
2957 * exitfail.c: Don't include stdlib.h; no longer needed.
2959 More changes to assume C89 or better.
2961 * error.c (error_tail): Assume vprintf.
2963 * argmatch.c (getenv): Remove decl.
2964 * progreloc.c (get_full_program_name): Define via prototype.
2965 * setenv.c (clearenv): Likewise.
2966 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
2968 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
2969 (malloc, memcpy): Remove decls.
2970 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
2971 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
2972 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2973 (memcpy): Remove macro.
2974 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
2975 (__P): Remove. All uses removed.
2976 (PTR): Remove. All uses changed to void *.
2977 (CHAR_BIT, NULL): Remove.
2978 (spaces, zeros, memset_space, memset_zero)
2979 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
2981 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
2982 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
2983 Define with prototype.
2984 Remove now-unnecessary prototype decl.
2985 (extra_args_spec): Assume ANSI C. All uses changed.
2986 (extra_args_spec_iso): Remove.
2987 (my_strftime, emacs_strftimeu): Define via prototype.
2988 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
2990 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
2991 * strtoimax.c: Include <stdlib.h> unconditionally.
2992 (strtoul, strtol): Remove decls.
2993 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
2995 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2996 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
2997 (LOCALE_PARAM_PROTO): New macro.
2998 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
2999 (INTERNAL (strtol), strtol): Define with a prototype.
3000 (PARAMS): Remove. All uses removed.
3001 * tempname.c: Include <string.h> unconditionally.
3002 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
3003 * xgethostname.c (main): Define with a prototype.
3004 * xmalloc.c: Include "xalloc.h" first, to check interface.
3005 Include <stdlib.h> unconditionally.
3006 (calloc, malloc, realloc, free): Remove decls.
3007 * xstrtod.c: Include "xstrtod.h" first, to check interface.
3008 Include <stdlib.h> unconditionally. Sort include file names.
3010 (xstrtod): Define with a prototype.
3011 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
3012 (strtol, strtoul): Remove decls.
3014 2003-09-11 Paul Eggert <eggert@twinsun.com>
3016 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
3017 Include <stdlib.h>, <string.h> unconditionally.
3018 Remove now-unnecessary cast to char *.
3019 * strnlen.c: Include <string.h> unconditionally.
3020 * yesno.c (yesno): Define with a prototype.
3022 2003-09-10 Bruno Haible <bruno@clisp.org>
3024 * strcspn.c: Include <string.h> unconditionally.
3025 * strpbrk.c: Include <string.h> unconditionally.
3026 * strstr.c: Include <string.h> unconditionally.
3027 * unicodeio.c: Include <string.h> unconditionally.
3028 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
3029 * unsetenv.c: Likewise.
3030 * xreadlink.c: Include <stdlib.h> unconditionally.
3031 * yesno.c: Include <stdlib.h> unconditionally.
3032 (rpmatch): Add prototype.
3034 2003-09-10 Jim Meyering <jim@meyering.net>
3036 * error.c: Correct indentation of cpp directives.
3038 2003-09-09 Paul Eggert <eggert@twinsun.com>
3042 * acosl.c (main): Use a prototype.
3043 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
3046 * getloadavg.c (getloadavg, main): Define via prototypes.
3048 * getopt.h (struct option.name): Assume C89, and use 'const'.
3049 (getopt, etopt_long, getopt_long_only, _getopt_internal)
3050 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
3052 * getopt.c (const): Remove macro.
3053 Include <string.h> unconditionally.
3054 (my_index): Remove; all uses changed to strchr.
3055 (strlen): Remove decl.
3056 (exchange): Remove forward decl; no longer needed.
3057 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
3058 Define with prototype.
3059 * getopt1.c (const): Remove macro.
3060 (getopt_long, getopt_long_only, main): Define with prototype.
3062 * getugroups.c: Include <string.h> unconditionally.
3064 * getusershell.c: Include <stdlib.h> unconditionally.
3065 (getusershell, setusershell, endusershell, readname, main):
3066 Define with prototypes.
3068 * group-member.c: Include group-member.h first.
3069 Include <stdlib.h> unconditionally.
3071 * hard-locale.c: Include hard-locale.h first.
3072 Include <stdlib.h>, <string.h> unconditionally.
3074 * hash.c (free, malloc): Remove decls.
3075 Include <stdlib.h> unconditionally.
3077 * human.c: Include <stdlib.h>, <string.h> unconditionally.
3078 (getenv): Do not declare.
3080 * idcache.c: Include <string.h> unconditionally.
3082 * long-options.c: Include long-options.h first, to test interface.
3083 Include <stdlib.h> unconditionally.
3085 * makepath.c: Include makepath.h first, to test interface.
3086 Include <stdlib.h> and <string.h> unconditionally.
3088 * linebuffer.c: Include <stdlib.h>.
3089 (free): Remove decl.
3091 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
3092 rpl_malloc returns void *, not char *.
3093 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
3095 * md5.h: Include <limits.h> unconditionally.
3096 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
3097 (__P): Remove; all uses removed.
3098 * md5.c: Include "md5.h" first.
3099 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
3100 md5_buffer, md5_process_bytes, md5_process_block):
3101 Define with prototypes.
3102 * sha.h (__P): Remove all uses. (It wasn't defined??)
3103 * sha.c: Include "sha.h" first.
3104 Include <stdlib.h>, <string.h> unconditionally.
3106 * memchr.c (__ptr_t): Remove; all uses changed to void *.
3107 * memcmp.c (__ptr_t): Likewise.
3108 * memrchr.c (__ptr_t): Likewise.
3109 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
3110 Include <string.h> unconditionally.
3111 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
3112 * memchr.c: Include <stdlib.h> unconditionally.
3113 * memchr.c (LONG_MAX): Remove.
3114 * memrchr.c (LONG_MAX): Likewise.
3115 * memchr.c (__memchr): Define via a prototype.
3116 * memrchr.c (__memrchr): Likewise.
3117 * memcmp.c (__P): Remove, and remove all uses.
3118 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
3119 Remove forward decls; no longer needed.
3120 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
3121 Use types required by C89 in prototype.
3123 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
3124 * savedir.c: Likewise.
3125 * mkdir.c (free): Remove decl.
3126 * rmdir.c (rmdir): Define with a prototype.
3127 * savedir.c: Include savedir.h first, to test interface.
3129 * mktime.c (STDC_HEADERS): Remove.
3130 Include <stdlib.h>, <string.h> unconditionally.
3132 * modechange.c: Include <stdlib.h> unconditionally.
3133 (malloc): Remove decl.
3135 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
3136 (free): Remove decl.
3138 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
3139 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
3140 (This type really should be intptr_t, but that's a C99ism.)
3141 (_obstack_memcpy): Remove: all uses changed to memcpy.
3142 Include <string.h> unconditionally.
3143 (struct obstack): Assume __STDC__ for types of members
3144 chunkfun, freefun, extra_arg.
3145 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
3146 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
3147 obstack_begin, obstack_specify_allocation,
3148 obstack_specify_allocation_with_arg, obstack_chunkfun,
3149 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
3150 Remove unprototyped decls and the macros that use them.
3151 * obstack.c (POINTER): Remove. All uses changed to void *.
3152 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
3153 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
3154 (defined __STDC__ && __STDC__)]:
3155 Remove nonprototyped code.
3156 Include <stdlib.h> unconditionally.
3157 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
3158 _obstack_allocated_p, _obstack_free, obstack_free,
3159 _obstack_memory_used, print_and_abort):
3160 Define using prototypes.
3161 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
3162 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
3163 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
3164 obstack_next_free, obstack_object_size, obstack_room) [0]:
3165 Remove unused, unprototyped code.
3167 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
3169 * physmem.c (physmem_total, physmem_available, main): Define
3172 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
3173 (main): Define with a prototype.
3175 * posixver.c (getenv): Remove decl.
3177 * putenv.c (malloc): Returns void *, not char *.
3178 Include <string.h> unconditionally.
3179 (strchr, memcpy, NULL): Do not define.
3181 * readtokens.c: Include readtokens.h first, to test interface.
3182 Include <stdlib.h>, <string.h> unconditionally.
3183 (init_tokenbuffer): Define with a prototype.
3185 * regex.c (PARAMS): Remove. All uses removed.
3186 All uses of _RE_ARGS removed, too.
3187 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3189 (bzero): Assume memset exists.
3190 (memcmp, memcpy, NULL): Remove.
3191 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
3192 char, or assignments to local vars of type signed char.
3193 (init_syntax_once, PREFIX(extract_number_and_incr),
3194 PREFIX(print_partial_compiled_pattern),
3195 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
3196 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
3197 PREFIX(regex_grow_registers), PREFIX(regex_compile),
3198 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
3199 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
3200 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
3201 wcs_compile_range, byte_compile_range, truncate_wchar,
3202 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
3203 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
3204 count_mbs_length, wcs_re_match_2_internal,
3205 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
3206 PREFIX(alt_match_null_string_p),
3207 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
3208 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
3209 regfree, PREFIX(extract_number)): Define with prototype. Remove
3210 now-unnecessary declaration, if any.
3211 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
3213 Remove now-unnecessary casts among pointer types.
3214 * regex.h (_RE_ARGS): Remove. All uses removed.
3216 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
3217 (free): Remove decl.
3219 * rpmatch.c: Include <stdlib.h> unconditionally.
3221 * same.c: Include <stdlib.h>, <string.h> unconditionally.
3222 (free): Remove decl.
3224 * save-cwd.c: Include <stdlib.h> unconditionally.
3225 * xgetcwd.c: Likewise.
3227 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
3228 (free): Remove decl.
3230 * strchrnul.c (strchrnul): Define with a prototype.
3231 Fix bug: c_in was not converted to char before searching.
3233 The following changes are not K&R related:
3235 * group-member.h: Include <sys/types.h>, so that this file is
3237 * makepath.h: Likewise.
3239 * getusershell.c (readname, default_index, line_size, readname):
3240 Use size_t, not int, for sizes.
3241 (readname): If the size overflows, report an error instead of
3244 2003-09-09 Derek Robert Price <derek@ximbiot.com>
3246 * getndelim2.c: Assume stdlib.h per the C89 spec.
3248 2003-09-08 Paul Eggert <eggert@twinsun.com>
3250 Assume C89 or better; remove K&R cruft.
3251 A few of these changes were first proposed by Derek Robert Price
3252 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
3254 * addext.c: Include <string.h> unconditionally.
3255 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
3256 Don't declare getenv or malloc.
3258 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
3259 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
3261 (find_stack_direction, alloca): Use prototypes.
3263 * atexit.c (atexit): Define using a prototype.
3265 * basename.c, dirname.c, stripslash.c:
3266 Include <string.h> unconditionally.
3268 * bcopy.c: Include <stddef.h>.
3269 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
3271 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
3273 * error.h (error, error_at_line, error_print_progname)
3274 [! (defined (__STDC__) && __STDC__)]: Remove decls.
3275 * error.c: Include error.h first, to check interface.
3276 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3277 (VA_START): Remove; all uses changeed to va_start.
3278 (exit, strerror): Remove decls.
3279 (error_print_progname): Prototype uncondionally.
3280 Don't include <errno.h>; no longer needed.
3281 (private_strerror): Remove.
3282 (error_tail): Always define.
3283 (error, error_at_line): Assume C89 or better; always use prototypes.
3284 * fatal.c: Include "fatal.h" first, to test interface.
3285 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3286 (VA_START): Remove; all uses changed to va_start.
3287 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
3289 (exit): Remove decl.
3290 (fatal): Prototype unconditionally. Assume va_start works.
3291 Abort at end, to pacify gcc.
3293 * euidaccess.c (main): Define with a prototype.
3295 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
3297 * exitfail.c: Include <stdlib.h> unconditionally.
3299 * fnmatch_.h (__P): Remove. All uses changed to assume
3301 * fnmatch.c: Include fnmatch.h first, to test interface.
3302 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
3303 (getenv): Remove decl.
3304 (fnmatch): Define using a prototype.
3305 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
3306 (FCT): Define using a prototype.
3308 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
3310 * gethostname.c: Include <stddef.h>.
3311 (gethostname): Define with prototype. Length is size_t, not int.
3313 2003-09-08 Paul Eggert <eggert@twinsun.com>
3315 * getversion.c: Remove; was migrated to backupfile.c in 1997.
3316 getversion.c should have been removed then, but was accidentally
3319 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
3320 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
3322 2003-09-07 Paul Eggert <eggert@twinsun.com>
3324 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
3325 copy_tm_result. Bug reported by Simon Josefsson in
3326 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
3328 2003-09-06 Paul Eggert <eggert@twinsun.com>
3330 * time_r.c, time_r.h: New files.
3332 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
3334 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
3335 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
3337 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
3339 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
3340 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
3343 * timegm.c: Switch to glibc implementation, with the following changes:
3344 [defined HAVE_CONFIG_H]: Include <config.h>.
3345 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
3346 (__mktime_internal) [!defined _LIBC]: New decl.
3347 (__gmtime_r) [!defined _LIBC]: New macro and function.
3348 (timegm): Use a prototype, since gnulib assumes C89.
3349 Do not bother declaring tmp to be const, as it's not really usefu.
3350 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
3351 (timegm): Declare only if HAVE_DECL_TIMEGM.
3353 2003-09-03 Paul Eggert <eggert@twinsun.com>
3355 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
3356 Bug reported by Lute Kamstra in
3357 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
3359 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
3360 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
3361 course with correspondingly smaller numbers for tomorrow and
3362 yesterday. From Tadayoshi Funaba. Originally installed into
3363 sh-utils on 1999-08-07, but the patch got lost (I guess during the
3366 2003-08-31 Simon Josefsson <jas@extundo.com>
3368 * timegm.h: New file.
3369 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
3371 2003-08-31 Karl Berry <karl@gnu.org>
3373 * argp.h: update from libc.
3375 2003-08-28 Bruno Haible <bruno@clisp.org>
3377 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
3378 warning on QNX, which defines O_BINARY to 000000.
3380 2003-08-24 Bruno Haible <bruno@clisp.org>
3382 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
3383 MSVC7 <stdio.h> is included later.
3385 2003-08-20 Bruno Haible <bruno@clisp.org>
3387 * progname.h: New file, from GNU gettext.
3388 * progname.c: New file, from GNU gettext.
3389 * progreloc.c: New file, from GNU gettext.
3391 2003-08-19 Bruno Haible <bruno@clisp.org>
3393 * xstrdup.c: Assume <string.h> exists.
3395 2003-08-18 Jim Meyering <jim@meyering.net>
3397 * setenv.h: Indent nested cpp directive.
3398 * vasnprintf.c: Remove trailing blanks.
3400 2003-08-17 Simon Josefsson <jas@extundo.com>
3401 Bruno Haible <bruno@clisp.org>
3403 * xstrndup.h: New file.
3404 * xstrndup.c: New file.
3406 2003-08-17 Bruno Haible <bruno@clisp.org>
3408 * strndup.h: New file.
3410 2003-08-16 Paul Eggert <eggert@twinsun.com>
3412 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
3413 space, undoing this 2003-08-12 change:
3414 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
3416 2003-08-16 Jim Meyering <jim@meyering.net>
3418 Merge from coreutils.
3419 * xstrtoimax.c: #else #if -> #elif.
3420 * xstrtoumax.c: Likewise.
3422 2003-08-15 Paul Eggert <eggert@twinsun.com>
3424 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
3425 rather than tab, after '#' in shell-script copyright notices.
3426 Suggested by Bruno Haible.
3428 2003-08-15 Jim Meyering <jim@meyering.net>
3429 and Paul Eggert <eggert@twinsun.com>
3431 Merge from coreutils.
3432 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
3433 member but strut utmpx does not. Needed for AIX 4.3.3.
3434 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
3436 2003-08-15 Jim Meyering <jim@meyering.net>
3438 Merge from coreutils.
3439 * xgethostname.c: Include <stdlib.h>.
3440 (xghostname): Don't exit for anything other than memory-related
3441 failure; just return NULL.
3442 * userspec.c: Include "posixver.h".
3443 (parse_user_spec): Accept `.' as a separator only
3444 in pre-POSIX-200112 mode.
3445 * strtoimax.c: Use #elif rather than #else #if.
3446 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
3447 Remove function, now that we can rely on a working tzset function.
3448 [!_LIBC]: Ensure that the required autoconf test has been run.
3449 [!defined _NL_CURRENT && HAVE_STRFTIME]:
3450 Use underlying_strftime for %r.
3451 * sha.c: Merge in some clean-up and optimization changes from glibc.
3452 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
3453 Ensure that it is a multiple of 64.
3454 Rearrange loop exit tests so as to avoid performing an
3455 additional fread after encountering an error or EOF.
3456 * realloc.c: Update copyright date.
3458 2003-08-14 Jim Meyering <jim@meyering.net>
3460 Merge from coreutils.
3461 * obstack.h: Whitespace changes.
3462 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
3463 and xcalloc return values.
3464 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
3465 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
3466 hang on OSF/1 5.1 for DIR on both local and remote file systems.
3467 Reported by (and fix confirmed by) Nelson H. F. Beebe.
3468 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3470 Use mntctl's return value to drive the entry-processing loop, since
3471 we can't rely on the value of the vmt_length member in the last
3472 entry. On some systems doing so could result in exhausting
3473 virtual memory. Based in part on a patch from Mike Jetzer.
3475 2003-08-14 Jim Meyering <jim@meyering.net>
3476 and Paul Eggert <eggert@twinsun.com>
3478 Merges from coreutils, plus other fixes.
3479 * physmem.c: Merge in portability changes from gcc/libiberty
3480 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
3481 for credits and details. Thanks to Kaveh Ghazi for helping
3482 to keep these files in sync.
3483 (ARRAY_SIZE): Define it.
3484 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
3485 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
3486 (memcasecmp): Don't assume size_t fits in unsigned int.
3487 Remove casts and duplicate code.
3488 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
3489 (memcpy): Remove definition.
3490 Merge in some clean-up and optimization changes from glibc.
3491 [BLOCKSIZE]: Move definition to top of file.
3492 Ensure that it is a multiple of 64.
3493 Rearrange loop exit tests so as to avoid performing an
3494 additional fread after encountering an error or EOF.
3495 * md5.h (md5_uintptr): Define.
3496 * makepath.c (CLEANUP_CWD): Report an error if we failed to
3497 return to the initial working directory. Preserve errno
3499 * idcache.c: Include "xalloc.h".
3500 (xmalloc, xrealloc): Remove decls.
3501 (getuser): Remove casts no longer required in C89.
3502 * human.c: Include stdio.h, for sprintf.
3503 * group-member.c: Include "xalloc.h".
3504 (xmalloc, xrealloc): Remove decls.
3505 (get_group_info): Remove casts no longer required in C89.
3506 * getusershell.c (readname): Remove casts no longer required in C89.
3507 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
3508 * getline.c: Whitespace fix, from coreutils.
3510 2003-08-13 Paul Eggert <eggert@twinsun.com>
3512 * exclude.c: Include <ctype.h>
3513 (IN_CTYPE_DOMAIN): New macro.
3515 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
3518 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3519 Undo previous (whitespace-only) change.
3521 2003-08-12 Paul Eggert <eggert@twinsun.com>
3523 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3524 Normalize leading white space and remove trailing white space.
3525 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
3526 notice, as per ../config/srclist-update.
3528 Merge from coreutils.
3529 * euidaccess.h: New file.
3530 * euidaccess.c: Include it.
3531 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
3532 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
3533 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
3535 2003-08-11 Bruno Haible <bruno@clisp.org>
3537 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
3538 (vasnprintf): Use it instead of wcslen.
3540 2003-08-11 Bruno Haible <bruno@clisp.org>
3542 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
3543 value to ensure that _Bool promotes to int. Use #define for _Bool when
3544 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
3546 2003-08-10 Karl Berry <karl@gnu.org>
3548 * regex.h: update from libc (whitespace fix).
3550 2003-08-09 Paul Eggert <eggert@twinsun.com>
3552 Merge some files from coreutils. These changes were
3553 originally made by Jim Meyering.
3554 * acl.c: Include <sys/types.h> before <sys/stat.h>;
3555 many older Unixes require this.
3556 * alloca.c (alloca): Remove cast to argument of free;
3557 no longer needed in C89.
3558 * alloca_.h, regex.h: Fix white space to match
3559 what GNU indent does.
3561 2003-08-05 Paul Eggert <eggert@twinsun.com>
3563 * bumpalloc.h: Remove.
3565 2003-08-04 Paul Eggert <eggert@twinsun.com>
3567 * getloadavg.c: Change copyright notice and spacing to conform to
3570 Merge from coreutils.
3571 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
3573 * getdate.y (date): Also accept dates like May-23-2003; suggestion
3574 from Karl Berry, implemented by Jim Meyering.
3575 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
3576 from Dmitry V. Levin.
3577 Remove anachronistic cast of xrealloc.
3578 * fnmatch_.h (__const): Remove. Use 'const'.
3579 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
3580 type. Otherwise, it wouldn't compile with at least /bin/cc on
3581 ymp-cray-unicos9.0.2.X.
3582 Combine two mostly-identical uses of alloca into one.
3583 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
3585 2003-08-04 Dave Love <d.love@dl.ac.uk>
3589 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
3590 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
3591 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
3592 obsolete NLIST_NAME_UNION.
3593 [__GNU__]: Undef BSD and FSCALE.
3594 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
3596 2003-08-03 Paul Eggert <eggert@twinsun.com>
3598 * stdbool_.h (_Bool): Make it signed char, instead of
3599 an enum type, so that it's guaranteed to promote to int. See:
3600 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
3602 2003-07-31 Paul Eggert <eggert@twinsun.com>
3604 * strerror.c: Include config.h, limits.h. Declare sprintf.
3605 (strerror): Don't assume that a printable int fits in 14 bytes.
3607 2003-07-24 Derek Robert Price <derek@ximbiot.com>
3608 Bruno Haible <bruno@clisp.org>
3610 * getline.h (getline, getdelim): Change return type to ssize_t.
3611 * getline.c (getline, getdelim): Likewise.
3612 Remove _GNU_SOURCE define; now it's defined in config.h through
3615 2003-07-22 Paul Eggert <eggert@twinsun.com>
3617 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
3618 over-parenthesization in macros.
3620 Sync with coreutils.
3622 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
3625 Use `exit_failure' for xalloc and xmemcoll instead of their own
3626 private exit-failure variables.
3627 * xalloc.h (xalloc_exit_failure): Remove.
3628 * xmalloc.c: Likewise. Include exitfail.h.
3629 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
3630 * xmemcoll.h (xmemcoll_exit_failure): Remove.
3631 * xmemcoll.c: Likewise. Include exitfail.h.
3632 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
3634 2003-07-18 Paul Eggert <eggert@twinsun.com>
3636 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
3637 * closeout.c: Likewise. Include "closeout.h" right after config.h,
3638 to test that it can stand by itself. Include "exitfail.h".
3639 Clients should set exit_failure instead.
3640 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
3642 2003-07-18 Andreas Schwab <schwab@suse.de>
3644 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
3646 2003-07-18 Bruno Haible <bruno@clisp.org>
3648 * getndelim2.h: New file.
3649 * getndelim2.c: Make into a module of its own. Include config.h,
3651 (getndelim2): Make non-static. Change return type to ssize_t.
3652 * getline.h: Change argument names.
3653 * getline.c: Include getndelim2.h instead of getndelim2.c.
3654 * getnline.c: Include getndelim2.h.
3656 2003-07-17 Bruno Haible <bruno@clisp.org>
3658 * Makefile.am: Remove file.
3659 * Makefile.in: Remove file.
3661 2003-07-17 Bruno Haible <bruno@clisp.org>
3663 * getnline.h: New file.
3664 * getnline.c: New file.
3665 * getndelim2.c: New file, extracted from getline.c.
3666 (getndelim2): Renamed from getdelim2, with added nmax argument.
3667 * getline.c: Include getndelim2.c.
3668 (getdelim2): Moved out to getndelim2.c.
3669 (getline, getdelim): Update.
3671 2003-07-15 <karl@gnu.org>
3673 * vasnprintf.c: update from gettext.
3675 2003-07-15 Jim Meyering <jim@meyering.net>
3677 * makepath.c (make_path): Enclose diagnostic in _(...).
3679 2003-07-14 Paul Eggert <eggert@twinsun.com>
3681 * asnprintf.c, asprintf.c, config.charset, gettext.h,
3682 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
3683 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
3684 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
3685 vasprintf.c, vasprintf.h: Regenerate. These files are now being
3686 updated automatically by ../config/srclist-update. This changes
3687 their license from LPGL to GPL.
3689 2003-07-14 Jim Meyering <jim@meyering.net>
3691 Don't emit diagnostics. Let callers do that.
3692 * save-cwd.c: Don't include "error.h".
3693 (save_cwd): Don't call error. Ensure that errno is valid
3694 when returning nonzero.
3696 * save-cwd.h (restore_cwd): Update prototype.
3697 * save-cwd.c (restore_cwd): Remove two parameters.
3698 Simplify. Don't call error upon failure. Let callers do that.
3699 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
3700 when auditing is enabled. But don't bother updating the #if.
3702 2003-07-14 Simon Josefsson <jas@extundo.com>
3704 * mempcpy.h: New file.
3705 * mempcpy.c: New file.
3707 2003-07-14 Paul Eggert <eggert@twinsun.com>
3709 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
3710 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
3711 unicodeio.c, unicodeio.h, unlocked-io.h:
3712 Switch from LGPL to GPL.
3714 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
3716 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
3717 it breaks C++ compilation.
3718 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
3720 2003-07-10 Jim Meyering <jim@meyering.net>
3722 * vasnprintf.c: Remove trailing blanks.
3723 Make cpp indentation consistent.
3725 2003-07-09 Paul Eggert <eggert@twinsun.com>
3727 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
3728 posixver.c, strftime.c, strnlen.c, strverscmp.c:
3729 Switch from LGPL to GPL.
3731 2003-07-07 Paul Eggert <eggert@twinsun.com>
3733 * mktime.c: Fix some boundary cases and remove need for floating point.
3735 Issue a compile-time diagnostic if time_t is floating point, or if
3736 two's complement arithmetic is not in effect, or if arithmetic
3737 right shift does not propagate the sign. These assumptions were
3738 all in the original code but they weren't checked.
3740 (TIME_T_MIDPOINT, verify): New macros.
3741 (__isleap): Remove; it has integer overflow problems.
3742 (leapyear): New function, without those problems.
3743 (ydhms_tm_diff): Remove; splitting into two parts.
3744 (ydhms_diff): New function, containing the arithmetic part of
3745 the old ydhms_tm_diff function. Issue a compile-time
3746 diagnostic if we are not using C99 integer division.
3747 Avoid casts when possible.
3748 (guess_time_tm): New function, containing the checking part of
3749 the old ydhms_tm_diff function. Return the new value, rather than
3750 the difference between it and the old. Accept a new argument T
3751 so that *T specifies the old value. Check for overflow in the result.
3753 (__mktime_internal): Use a time_t offset, not a long int offset.
3754 This undoes the 2003-06-04 change, which is no longer needed now
3755 that we have better overflow checking.
3756 (localtime_offset): Likewise.
3758 (__mktime_internal): Avoid harmful overflow on hosts where time_t
3759 and long are 64-bit but int is only 32-bit.
3760 (ydhms_diff): Use long int to store year1 and yday1.
3761 Issue a compile-time diagnostic if long int is not wide enough.
3763 (__mktime_internal): Use long int to store adjusted year and yday.
3764 Use plain C rather than preprocessor commands, if that doesn't
3766 Check for overflow (and try to repair) after each probe
3767 rather than checking only at the very end. This avoids some bugs
3768 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
3769 does not equal GMT offset at maximum time).
3770 Use integer to check for overflow rather than floating point; this
3771 is more portable to non-IEEE hosts, and is a tad faster.
3772 When we detect that we are oscillating between two values,
3773 don't check whether tm_isdst has the requested value, since
3774 we already know the answer. When tm_isdst has the wrong value,
3775 use a different heuristic to find the right one, based on the
3776 extreme values actually observed in practice in tz2003a,
3777 rather than the (overly optimistic) "previous 3 calendar quarters".
3779 (not_equal_tm, print_tm, check_result): Use "const T" rather than
3780 "T const" to accommodate glibc style.
3781 (check_result): Use less-confusing report format. "long" -> "long int.
3783 Don't loop if the iteration overflows time_t.
3784 Allow a negative step in the iteration.
3786 2003-07-01 Paul Eggert <eggert@twinsun.com>
3788 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3789 having it depend on HAVE_SYS_TYPES_H.
3791 2003-06-25 Bruno Haible <bruno@clisp.org>
3793 * readlink.c: New file.
3795 2003-06-20 Bruno Haible <bruno@clisp.org>
3797 Assume C89, so PARAMS isn't needed.
3798 * unicodeio.h (PARAMS): Remove.
3799 * unicodeio.c: Don't use PARAMS.
3801 2003-06-18 Jim Meyering <jim@meyering.net>
3803 Merge changes from coreutils.
3804 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
3805 Remove explicit declarations of xmalloc and realloc.
3807 (read_utmp): Remove anachronistic cast of xmalloc.
3809 2003-06-17 Paul Eggert <eggert@twinsun.com>
3811 Assume C89, so PARAMS isn't needed.
3812 * backupfile.h (PARAMS): Remove. All uses removed.
3813 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
3814 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
3815 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
3816 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
3817 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
3818 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
3819 xstrtol.h: Likewise.
3820 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
3821 same.h, strverscmp.h: Do not include config.h; no longer needed.
3822 Anyway, config.h should always be included before any other file.
3824 2003-06-11 Simon Josefsson <jas@extundo.com>
3826 * sysexit_.h: New file.
3828 2003-05-20 Derek Price <derek@ximbiot.com>
3830 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
3832 2003-06-10 Simon Josefsson <jas@extundo.com>
3834 * strchrnul.h: New file.
3835 * strchrnul.c: New file.
3837 2003-06-10 Simon Josefsson <jas@extundo.com>
3839 * argp.h: New file, from glibc.
3840 * argp-ba.c: New file, from glibc.
3841 * argp-eexst.c: New file, from glibc.
3842 * argp-fmtstream.c: New file, from glibc.
3843 * argp-fmtstream.h: New file, from glibc.
3844 * argp-fs-xinl.c: New file, from glibc.
3845 * argp-help.c: New file, from glibc.
3846 * argp-namefrob.h: New file, from glibc.
3847 * argp-parse.c: New file, from glibc.
3848 * argp-pv.c: New file, from glibc.
3849 * argp-pvh.c: New file, from glibc.
3850 * argp-xinl.c: New file, from glibc.
3852 2003-06-07 Jim Meyering <jim@meyering.net>
3854 * readtokens.h: Put `Free Software Foundation, Inc.'
3855 in place of my name in the copyright comment.
3856 Remove definition and uses of __P.
3859 * stat.c: Don't declare xmalloc explicitly.
3860 Instead, include "xalloc.h".
3861 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
3862 xrealloc, and xcalloc return values.
3863 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
3865 * xgetcwd.h: Remove definition/uses of PARAMS.
3867 2003-06-06 Jim Meyering <jim@meyering.net>
3869 * stdbool_.h: Renamed from stdbool.h.in.
3871 2003-06-06 Jim Meyering <jim@meyering.net>
3873 Merge from coreutils.
3874 * same.c: (same_name): Declare *_basename locals to be `const'.
3875 Consolidate declarations and initializations of *_base* locals.
3877 Merge from coreutils.
3878 This avoids a core dump on systems without GNU putenv,
3879 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
3880 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
3881 (unsetenv): New static function, from GNU libc.
3882 (rpl_putenv): Use it.
3884 * modechange.c: Remove trailing blanks.
3886 Merge from coreutils.
3887 * fsusage.c: Remove declaration of statfs.
3888 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
3890 * posixtm.c: Include <stdbool.h> unconditionally.
3892 2003-06-05 Paul Eggert <eggert@twinsun.com>
3894 * mktime.c (__mktime_internal): When resolving a tm_isdst
3895 mismatch, look in future quarters as well as past. This fixes a
3896 bug when processing fall-backwards gaps immediately after a long
3897 period of daylight-saving time.
3899 * mktime.c: Assume freestanding C89 or better.
3900 (HAVE_LIMITS_H): Remove. Assume it's 1.
3901 (__P): Remove; not used.
3902 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
3903 (mktime, not_equal_tm, print_tm, check_result,
3904 main): Use prototypes. Use const * where appropriate.
3905 (main): Fix typo in testing code that uncovered by above changes.
3906 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
3908 2003-06-04 Paul Eggert <eggert@twinsun.com>
3910 * mktime.c: Fix Debian bug 177940
3911 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
3912 (localtime_offset): Now long int, not time_t, because we want it
3913 to be guaranteed to be signed. All uses changed.
3914 (__mktime_internal): If overflow would occur when adding offset,
3917 Merge 'human' changes from coreutils. Rewrite to support
3918 locale-specific notations like thousands separators.
3919 * human.c: Simplify authorship notice.
3920 Include human.h immediately after config.h.
3921 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
3922 <limits.h>: Do not include, since human.h does.
3923 (SIZE_MAX, UINTMAX_MAX): New macros.
3924 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
3925 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
3926 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
3927 (power_letter): Renamed from suffixes.
3928 (generate_suffix_backwards): Remove.
3929 (adjust_value): Now takes int style (because of human.h changes)
3930 and long double value (for greater precision on some platforms).
3931 (group_number): New function.
3932 (human_readable): Use it. Use integer options, not enum.
3933 Put the options before the sizes in the arg list.
3934 Support all the new options.
3935 The old human_readable function has been removed;
3936 use inttostr.h instead.
3937 (human_readable, default_block_size, humblock):
3938 Use uintmax_t, not int, for block sizes.
3939 (human_readable_inexact, block_size_types): Remove.
3940 (block_size_opts): New constant.
3941 (human_options): Renamed from human_block_size, with new signature
3942 that allows block sizes up to UINTMAX_MAX. All callers changed.
3943 * human.h: Add copyright and authorship notice.
3944 Include <limits.h> and <stdbool.h> unconditionally.
3945 (PARAMS): Remove. All uses removed.
3946 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
3947 (enum human_inexact_style): Remove tag; now a nameless enum.
3948 (human_floor, human_ceiling, human_round_to_even): Now have
3949 values 2, 0, 1 rather than -1, 1, 0.
3950 (human_group_digits, human_suppress_point_zero, human_autoscale,
3951 human_base_1024, human_SI, human_B): New constants.
3952 (human_readable_inexact, human_block_size): Remove.
3953 (human_readable): Size args are now uintmax_t, not int.
3954 (human_options): New decl.
3956 * exclude.c: (new_exclude, add_exclude): Remove casts that are
3957 unnecessary now that we assume C89 or better. This change
3958 imported from coreutils.
3960 * mktime.c (__mktime_internal): Do not reject negative timestamps
3961 arbitrarily. This is the same patch as 2003-05-28, but it got lost
3962 in the 2003-05-30 sync from glibc.
3964 .h files should stand alone, but we shouldn't include <sys/types.h>
3965 if we can get away with just <stddef.h>.
3967 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
3968 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
3969 rather than <sys/types.h>, as we merely need size_t.
3970 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
3972 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
3973 Include <stdio.h>, to get FILE.
3974 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
3975 memcasecmp.h has included <stddef.h> and all we need is size_t.
3976 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
3977 our interface, instead of including <sys/types.h>
3979 2003-06-02 Paul Eggert <eggert@twinsun.com>
3982 Fix some minor time-related bugs with POSIX time arguments.
3983 Some valid time stamps were being rejected (notably -1, and
3984 time stamps before 1900 on 64-bit hosts). And some invalid
3985 time stamps were being accepted, e.g. September 31.
3987 * posixtm.h (posixtime): Return bool instead of time_t, so
3988 that we can return (time_t) -1 successfully.
3989 * posixtm.c: Likewise.
3990 [HAVE_STDBOOL_H]: Include <stdbool.h>.
3991 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
3992 (t): Remove static var.
3993 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
3994 of static var. All uses changed.
3995 (year): Do not reject years before 1900; they can occur with
3997 (posix_time_parse): Do not check for out-of-range components;
3998 that is now the caller's responsibility, since our checks were
3999 only approximations.
4000 (posixtime): Use mktime to check for out-of-range components,
4001 since it knows them exactly.
4002 If mktime returns (time_t) -1, check whether an error actually occurred
4003 by invoking localtime on -1.
4004 (main) [TEST_POSIXTIME]: Check for input data errors, and report
4005 posixtime failures better.
4006 Improve the test data (in comments only).
4008 2003-05-30 <karl@gnu.org>
4010 * mktime.c: update from libc.
4012 2003-05-30 Bruno Haible <bruno@clisp.org>
4014 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
4015 * localcharset.h: Likewise.
4016 * localcharset.c: Likewise.
4018 2003-05-28 Paul Eggert <eggert@twinsun.com>
4020 Assume the headers required for C89 freestanding compilers.
4021 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
4022 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
4023 without checking for HAVE_LIMITS_H.
4024 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
4025 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
4027 * fatal.c: Include <stdarg.h> without checking for __STDC__.
4028 * exclude.c: Include <stdbool.h> unconditionally.
4029 * tempname.c: Include <stddef.h> unconditionally.
4030 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
4031 * modechange.c, rpmatch.c (NULL): Don't define, since
4032 <stddef.h> does that.
4033 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
4034 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
4035 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
4036 * xstrtol.c: Likewise.
4037 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
4038 * savedir.c: Include <stddef.h> instead of defining NULL.
4040 * addext.c (addext): Use assignment rather than cast, to avoid
4041 warnings on some platforms.
4043 * mktime.c (__mktime_internal): Do not reject negative timestamps
4046 2003-05-10 Bruno Haible <bruno@clisp.org>
4048 * linebreak.c (iconv_string_length): Don't return -1 just because the
4049 string is longer than 4 KB.
4051 2003-05-12 Jim Meyering <jim@meyering.net>
4053 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
4054 the space-padded-by-default conversion specifiers, %e, %k, %l.
4056 2003-05-03 Bruno Haible <bruno@clisp.org>
4058 Upgrade to Unicode-4.0.
4059 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
4060 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
4061 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
4062 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
4063 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
4064 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
4065 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
4066 Change width of U+E0100..U+E01EF from 1 to 0.
4068 2003-04-25 Bruno Haible <bruno@clisp.org>
4070 * copy-file.c: Include <stddef.h>, for size_t.
4072 2003-04-25 Jim Meyering <jim@meyering.net>
4074 * copy-file.c (copy_file_preserving): Declare buf_size to be
4075 of type size_t, not int.
4077 2003-04-11 Jim Meyering <jim@meyering.net>
4079 Merge changes from Coreutils.
4081 2003-03-22 Jim Meyering <jim@meyering.net>
4083 * strftime.c (widen): Cast alloca return value to proper type.
4085 2003-01-19 Ulrich Drepper <drepper@redhat.com>
4088 * strftime.c (my_strftime): Handle very large width
4089 specifications for numeric values correctly. Improve checks for
4092 2003-01-19 Jim Meyering <jim@meyering.net>
4094 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
4095 (nl_get_alt_digit) [! defined my_strftime]: Define.
4096 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
4097 _nl_get_alt_digit and _nl_get_walt_digit.
4099 * strftime.c (my_strftime): Merge in locale-related changes from libc.
4100 These changes have no effect outside of _LIBC.
4102 2003-04-10 Bruno Haible <bruno@clisp.org>
4104 * findprog.h: New file, from GNU gettext.
4105 * findprog.c: New file, from GNU gettext.
4107 2003-04-05 Jim Meyering <jim@meyering.net>
4109 Merge changes from Coreutils.
4111 * exclude.h (PARAMS): Remove definition and uses.
4112 * exclude.c: Remove uses of `PARAMS'.
4114 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
4115 Add test-cases for DOS filenames. Declare program_name.
4116 (main): Set up program_name. Patch by Rich Dawe.
4118 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4120 Use mntctl's return value to drive the entry-processing loop, since
4121 we can't rely on the value of the vmt_length member in the last
4122 entry. On some systems doing so could result in exhausting
4123 virtual memory. Based in part on a patch from Mike Jetzer.
4125 2003-04-04 Bruno Haible <bruno@clisp.org>
4127 * linebreak.h: New file, from GNU gettext.
4128 * linebreak.c: New file, from GNU gettext with slight modifications.
4129 * lbrkprop.h: New file, from GNU gettext.
4131 2003-04-03 Bruno Haible <bruno@clisp.org>
4133 * utf8-ucs4.h: New file, from GNU gettext.
4134 * utf16-ucs4.h: New file, from GNU gettext.
4135 * ucs4-utf8.h: New file, from GNU gettext.
4136 * ucs4-utf16.h: New file, from GNU gettext.
4138 2003-04-02 Bruno Haible <bruno@clisp.org>
4140 * binary-io.h: New file, from GNU gettext.
4142 2003-04-01 Bruno Haible <bruno@clisp.org>
4144 * pathname.h: New file, from GNU gettext.
4145 * concatpath.c: New file, from GNU gettext.
4147 2003-03-30 Bruno Haible <bruno@clisp.org>
4149 * copy-file.c (copy_file_preserving): Don't set owner if the function
4150 chown() doesn't exist.
4152 2003-03-28 Bruno Haible <bruno@clisp.org>
4154 * copy-file.h: New file, from GNU gettext.
4155 * copy-file.c: New file, from GNU gettext.
4157 2003-03-18 Jim Meyering <jim@meyering.net>
4159 * quote.c (quote_n): Fix typo in comment.
4161 2003-03-14 Jim Meyering <jim@meyering.net>
4163 Merge changes from Coreutils.
4164 * obstack.h (obstack_object_size): Declare temporary, __o,
4165 to be const, in order to avoid warnings.
4166 (obstack_room): Likewise.
4167 (obstack_empty_p): Likewise.
4169 2003-03-13 Paul Eggert <eggert@twinsun.com>
4171 Merge changes from Bison.
4172 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
4173 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
4174 when compiling Bison 1.875's `bitset bset = obstack_alloc
4175 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
4176 * hash.c: Include <stdbool.h> unconditionally.
4178 2003-03-09 Paul Eggert <eggert@twinsun.com>
4180 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
4181 Reported by Bruce Becker; see:
4182 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
4184 2003-03-03 Paul Eggert <eggert@twinsun.com>
4185 Bruno Haible <bruno@clisp.org>
4187 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
4188 Reported by John Hughes, see
4189 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
4191 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
4193 * poll_.h: New file.
4196 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
4198 * mathl.h: New file.
4199 * acosl.c: New file.
4200 * asinl.c: New file.
4201 * atanl.c: New file.
4202 * ceill.c: New file.
4205 * floorl.c: New file.
4206 * frexpl.c: New file.
4207 * ldexpl.c: New file.
4209 * sincosl.c: New file.
4211 * sqrtl.c: New file.
4213 * trigl.c: New file.
4214 * trigl.h: New file.
4216 2003-02-17 Bruno Haible <bruno@clisp.org>
4218 * mkdtemp.h: New file, from GNU gettext.
4219 * mkdtemp.c: New file, from GNU gettext.
4221 2003-01-31 Bruno Haible <bruno@clisp.org>
4223 * rename.c: #undef rename before defining rpl_rename.
4224 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
4226 2003-01-30 Bruno Haible <bruno@clisp.org>
4228 * printf-args.h: New file, from GNU gettext.
4229 * printf-args.c: New file, from GNU gettext.
4230 * printf-parse.h: New file, from GNU gettext.
4231 * printf-parse.c: New file, from GNU gettext.
4232 * vasnprintf.h: New file, from GNU gettext.
4233 * vasnprintf.c: New file, from GNU gettext.
4234 * asnprintf.c: New file, from GNU gettext.
4235 * vasprintf.h: New file, from GNU gettext with modifications.
4236 * vasprintf.c: New file, from GNU gettext.
4237 * asprintf.c: New file, from GNU gettext.
4239 2003-01-29 Bruno Haible <bruno@clisp.org>
4241 * stpncpy.h: New file, from GNU gettext with modifications.
4242 * stpncpy.c: New file, from GNU gettext with modifications.
4244 2003-01-28 Bruno Haible <bruno@clisp.org>
4246 * c-ctype.h: New file, from GNU gettext, with changes suggested by
4248 * c-ctype.c: New file, from GNU gettext, with changes suggested by
4251 2003-01-27 Bruno Haible <bruno@clisp.org>
4253 * xsetenv.h: New file, from GNU gettext.
4254 * xsetenv.c: New file, from GNU gettext.
4256 2003-01-23 Bruno Haible <bruno@clisp.org>
4258 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
4260 2003-01-22 Bruno Haible <bruno@clisp.org>
4262 * exit.h: New file, from GNU gettext.
4264 2003-01-11 Bruno Haible <bruno@clisp.org>
4266 * stpcpy.h (stpcpy): Use ANSI C function declarations.
4267 * strcase.h (strcasecmp, strncasecmp): Likewise.
4269 2003-01-14 Jim Meyering <jim@meyering.net>
4271 * same.c (same_name): Tweak a comment.
4273 2003-01-11 Bruno Haible <bruno@clisp.org>
4275 * same.c (same_name): Reorder tests so as to avoid calling stat()
4276 when a string comparison is sufficient.
4278 2003-01-11 Bruno Haible <bruno@clisp.org>
4280 * readtokens.c (readtoken): Cast character to 'unsigned char', not
4283 2003-01-11 Bruno Haible <bruno@clisp.org>
4285 * hash-pjw.c: Add comment about low quality of this function.
4287 2003-01-12 Paul Eggert <eggert@twinsun.com>
4289 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
4290 to avoid collisions with libcurses and libreadline.
4292 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
4293 * getstr.h, getstr.c: Remove.
4294 * getline.c: Include "getline.h", to check interface.
4295 Move body of old getstr.c here: this defines MIN_CHUNK and
4296 declares getdelim2, which is renamed from getstr.
4297 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
4299 * linebuffer.c (readlinebuffer): Renamed from readline.
4301 * linebuffer.h: Likewise.
4302 (readline): Remove backward-compatibility macro.
4304 2003-01-12 Jim Meyering <jim@meyering.net>
4306 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
4308 2003-01-10 Bruno Haible <bruno@clisp.org>
4310 * alloca_.h: New file.
4311 * getdate.y: Unconditionally include alloca.h.
4312 * makepath.c: Likewise.
4313 * setenv.c: Likewise.
4314 * userspec.c: Likewise.
4316 2003-01-09 Bruno Haible <bruno@clisp.org>
4318 * stdbool.h.in: New file.
4320 2003-01-08 Bruno Haible <bruno@clisp.org>
4322 * safe-read.c: Include specification header first, to ensure its
4324 * full-write.c: Likewise.
4326 2003-01-08 Jim Meyering <jim@meyering.net>
4328 * full-write.c: Undefine and define-away `const' after inclusion
4329 of errno.h, not before. Suggestion from Bruno Haible.
4331 2003-01-07 Jim Meyering <jim@meyering.net>
4333 * full-write.c: Rework so that it may serve to define full_read, too.
4334 * full-read.c: Simply #define FULL_READ and include full-write.c.
4336 2003-01-06 Jim Meyering <jim@meyering.net>
4338 * version-etc.c: Update year in translatable copyright string.
4340 2002-12-25 Bruno Haible <bruno@clisp.org>
4342 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
4343 * xstrtol.h: Likewise.
4344 * xstrtoimax.c: Likewise.
4345 * xstrtoumax.c: Likewise.
4346 * human.h: Likewise.
4348 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
4349 on systems that have <inttypes.h> but not <stdint.h>.
4351 2002-12-31 Paul Eggert <eggert@twinsun.com>
4353 * memcoll.c (memcoll): Fall back on a simple algorithm using
4354 memcmp if strcoll doesn't work.
4356 2002-12-23 Bruno Haible <bruno@clisp.org>
4358 * localcharset.h: New file.
4359 * localcharset.c: Include it.
4360 * unicodeio.c: Likewise.
4362 2002-12-22 Bruno Haible <bruno@clisp.org>
4364 * utime.c (utime_null): No need to call ftruncate if the file was
4367 2002-12-23 Bruno Haible <bruno@clisp.org>
4369 * memcoll.c (STRCOLL): New macro.
4372 2002-12-22 Bruno Haible <bruno@clisp.org>
4374 * getstr.h (getstr): Define, to avoid clash with libcurses.
4375 * linebuffer.h (readline): Define, to avoid clash with libreadline.
4377 2002-12-22 Bruno Haible <bruno@clisp.org>
4379 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
4381 2002-12-23 Bruno Haible <bruno@clisp.org>
4383 * getline.h: Include <stddef.h>, for size_t.
4385 * unicodeio.h: Include <stddef.h>, for size_t.
4386 * unicodeio.c: Don't include <stddef.h>.
4388 2002-12-17 Bruno Haible <bruno@clisp.org>
4390 * canon-host.c (strdup): Remove unused declaration.
4392 * fsusage.c: Include full_read.h.
4393 (get_fs_usage): Use full_read instead of safe_read.
4395 * utime.c (utime_null): Use SAFE_READ_ERROR.
4397 2002-12-11 Bruno Haible <bruno@clisp.org>
4399 * setenv.h: Rewritten to cope with systems that have setenv() but not
4401 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
4404 2002-12-11 Bruno Haible <bruno@clisp.org>
4406 * setenv.c (alloca): Fall back to malloc.
4408 (setenv): Use freea() to free memory allocated with alloca().
4410 2002-11-13 Bruno Haible <bruno@clisp.org>
4412 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
4413 function declarations.
4414 * unsetenv.c (unsetenv): Likewise.
4416 2002-03-04 Bruno Haible <bruno@clisp.org>
4418 Portability to AIX 4.3.3.
4419 * unsetenv.c: New file, extracted from setenv.c.
4420 * setenv.c: Move the unsetenv() function to unsetenv.c.
4422 2001-12-20 Bruno Haible <bruno@clisp.org>
4424 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
4425 use malloc instead. For SunOS 4.
4427 2001-12-11 Bruno Haible <bruno@clisp.org>
4429 * setenv.c: Declare alloca.
4430 (compar_fn_t): New typedef.
4431 (KNOWN_VALUE, STORE_VALUE): Use it.
4433 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
4436 2002-12-10 Paul Eggert <eggert@twinsun.com>
4438 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
4439 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
4440 Choose values that are less likely to collide with system fnmatch
4442 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
4443 defined (e.g., a pure POSIX system).
4444 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
4445 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
4447 2002-12-06 Jim Meyering <jim@meyering.net>
4449 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
4451 Merge in changes from libc's misc/error.c, in preparation
4452 for the merge of gnulib's changes back into libc.
4454 * error.c (_): Define only if not already defined.
4455 Move definition to follow all #include directives.
4456 Include unlocked-io.h only if !_LIBC.
4457 [_LIBC]: Include <libio/libioP.h>.
4458 [USE_IN_LIBIO]: Include <libio/iolibio.h>
4459 (fflush): Tweak definition to use INTUSE.
4462 2002-12-05 Paul Eggert <eggert@twinsun.com>
4464 * alloca.c [defined emacs]: Include "lisp.h".
4465 (xalloc_die) [defined emacs]: New macro.
4466 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
4467 [! defined emacs]: Include <xalloc.h>.
4468 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
4469 (pointer): Typedef to POINTER_TYPE *.
4470 (malloc): Remove decl; we now always use xmalloc.
4471 (alloca): Use old-style definition, since Emacs needs this.
4472 Check for arithmetic overflow when computing combined size.
4474 2002-12-04 Paul Eggert <eggert@twinsun.com>
4476 Do not generate unlocked-io.h automatically, since it's easier to
4477 maintain it by hand.
4479 * unlocked-io.h: New file, from GNU diffutils,
4480 but with proper copyright notice and attribution.
4482 * Makefile.am: Add copyright notice.
4483 (libfetish_a_SOURCES): Add unlocked-io.h.
4484 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
4485 (DISTCLEANFILES, io_functions): Remove macros.
4486 (EXTRA_DIST): Remove gen_uio.
4487 (unlocked-io.h): Remove rule.
4489 2002-12-04 Jim Meyering <jim@meyering.net>
4491 Reflect the fact that stat.c and lstat.c are no longer generated.
4492 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
4493 (DISTCLEANFILES): Likewise.
4494 (EXTRA_DIST): Likewise.
4495 (all_local): Don't depend on stat.c or lstat.c.
4496 (stat.c, lstat.c): Remove rules.
4497 (EXTRA_DIST): Remove xstat.in.
4499 * xstat.in: Remove file. Contents moved into stat.c.
4500 * stat.c: New file. Contents mostly from xstat.in.
4501 * stat.c: Rework so that it may serve to define rpl_lstat, too.
4502 * lstat.c: New file. Simply #define LSTAT and include stat.c.
4504 * safe-read.c: Rework so that it may serve to define safe_write, too.
4505 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
4507 2002-12-03 Jim Meyering <jim@meyering.net>
4509 * safe-read.c, safe-write.c: Change variable names and comments, but
4510 not semantics, to minimize the differences between these two files.
4511 (safe_read): Change comment to mention SAFE_READ_ERROR.
4513 * safe-read.c (IS_EINTR): Define.
4514 (safe_read): Use IS_EINTR in place of in-function cpp directives.
4516 2002-12-02 Bruno Haible <bruno@clisp.org>
4518 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
4519 Define, taken from safe-read.c.
4520 (INT_MAX): Provide fallback.
4521 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
4522 * safe-write.h (SAFE_WRITE_ERROR): Define.
4524 * safe-read.c (EINTR): Remove definition.
4525 (safe_read): Don't use EINTR if it is absent.
4527 2002-12-02 Jim Meyering <jim@meyering.net>
4529 * safe-read.c (EINTR): Define.
4530 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4531 (INT_MAX): Provide fallback.
4532 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
4534 * safe-read.h (SAFE_READ_ERROR): Define.
4536 2002-12-01 Jim Meyering <jim@meyering.net>
4538 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
4539 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
4541 2002-11-27 Paul Eggert <eggert@twinsun.com>
4543 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4544 hash_rehash): Replace `if (limit <= value) abort ();' with
4545 `if (! (value < limit)) abort ();', for readability.
4547 2002-11-26 <karl@gnu.org>
4549 * strdup.c: copy from libc again, with jim's ok.
4550 * .cppi-disable: re-add strdup.c
4552 2002-11-25 <karl@gnu.org>
4554 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
4555 instead of "strtol.c".
4557 2002-11-25 Jim Meyering <jim@meyering.net>
4559 * mktime.c: Sync from libc, now that it has the latest fix.
4561 2002-11-24 <karl@gnu.org>
4563 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
4564 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
4566 2002-11-24 Jim Meyering <jim@meyering.net>
4568 Update from coreutils:
4570 * mktime.c: Merge in changes from libc.
4572 Avoid a link-time failure on some Linux systems.
4573 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
4574 (__mon_yday): Declare with the STATIC attribute.
4575 (__mktime_internal): Likewise.
4576 Based on a report from Greg Schafer.
4578 2002-11-23 Jim Meyering <jim@meyering.net>
4580 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
4581 Use `unsigned', not `int', as type of index.
4583 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
4585 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
4587 2002-11-22 Paul Eggert <eggert@twinsun.com>
4589 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
4590 hint that one should use `if (! x) abort ();' rather than `assert
4591 (x);', and anyway it's one less thing to worry about configuring.
4592 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4593 hash_rehash, hash_insert): Use abort rather than assert.
4595 2002-11-22 Paul Eggert <eggert@twinsun.com>
4597 * quotearg.h: Allow multiple inclusion by surrounding with
4598 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
4599 so that we can be included first.
4600 (PARAMS): Remove; we now assume C89 or later. All uses removed.
4601 * quotearg.c: Include quotearg.h immediately after config.h.
4602 No need to include stddef.h or sys/types.h any more.
4603 Surround local include files with "", not "<>".
4604 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
4605 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
4606 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
4607 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
4608 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
4609 (ISPRINT): Remove; no longer needed now that we assume C89.
4611 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
4614 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
4615 quotearg_char): Use SIZE_MAX rather than
4616 (size_t) -1 when we are talking about "infinity".
4618 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
4620 2002-11-22 Bruno Haible <bruno@clisp.org>
4622 * safe-read.h: Assume C89. Add comments.
4623 (safe_read): Change return type to size_t.
4624 * safe-read.c (safe_read): Change return type to size_t. Handle byte
4625 counts > SSIZE_MAX correctly.
4626 * safe-write.h: New file.
4627 * safe-write.c: New file.
4628 * full-read.h: New file.
4629 * full-read.c: New file.
4630 * full-write.h: Assume C89. Add comments.
4631 * full-write.c: Include safe-write.h.
4632 (full_write): Rewritten to use safe_write.
4633 Suggested by Jim Meyering and Paul Eggert.
4635 2002-11-21 Bruno Haible <bruno@clisp.org>
4637 Remove case insensitive option matching.
4638 * argmatch.h (argcasematch): Remove declaration.
4639 (ARGCASEMATCH): Remove macro.
4640 (__xargmatch_internal): Remove case_sensitive argument.
4641 (XARGMATCH): Update.
4642 (XARGCASEMATCH): Remove macro.
4643 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
4644 case_sensitive argument.
4645 (argcasematch): Remove function.
4646 (__xargmatch_internal): Remove case_sensitive argument.
4647 (main): Use XARGMATCH instead of XARGCASEMATCH.
4649 * xmalloc.c: Change compile-time error message. Add comment about
4650 required autoconf version.
4652 2002-11-21 Jim Meyering <jim@meyering.net>
4654 * strdup.c (strdup): Tweak comment and initial #if/#include.
4656 Merge in changes from the coreutils.
4658 2002-09-25 Paul Eggert <eggert@twinsun.com>
4659 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
4660 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
4661 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
4662 int. Work more efficiently if X is the same width as uintmax_t.
4663 Do not compare X to -1, to avoid bogus compiler warning.
4664 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
4665 Don't assume that f_frsize and f_bsize are the same type.
4667 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
4670 * makepath.c (make_path): Restore umask *before* creating the final
4672 (make_path): Minor reformatting.
4674 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
4675 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
4677 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
4678 ones. At least on GNU/Linux systems, `auto' means something else.
4681 2002-11-20 Paul Eggert <eggert@twinsun.com>
4683 Merge argmatch cleanups from Bison. Assume C89.
4685 * argmatch.c: Include config.h here, not in argmatch.h.
4686 Include stdlib.h, for EXIT_FAILURE.
4687 Always include <string.h>, since we assume C89.
4688 (EXIT_FAILURE): Remove pre-C89 bug workaround.
4689 * argmatch.h: Do not include <config.h> or <sys/types.h>.
4690 Include <stddef.h> instead, since it's all we need for size_t.
4691 (PARAMS): Remove. All uses removed.
4692 (ARRAY_CARDINALITY): Do not bother to #undef.
4693 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
4694 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4695 Remove unnecessary parentheses.
4696 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4697 Insert necessary parentheses.
4698 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
4699 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
4701 2002-11-19 Bruno Haible <bruno@clisp.org>
4703 * mbswidth.c: Include mbswidth.h right at the beginning.
4704 * mbswidth.h: Include <stddef.h>, for size_t.
4706 * mbswidth.h (PARAMS): Remove macro.
4707 (mbswidth, mbsnwidth): Use ANSI C function declarations.
4708 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
4710 * gcd.h (PARAMS): Remove macro.
4711 (gcd): Use ANSI C function declarations.
4712 * gcd.c (gcd): Likewise.
4714 2002-11-15 Bruno Haible <bruno@clisp.org>
4716 * strcspn.c: Include <stddef.h>.
4717 (strcspn): Use ANSI C function declaration. Change return type to
4719 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
4720 (strpbrk): Use NULL.
4721 * strpbrk.h (PARAMS): Remove macro.
4722 (strpbrk): Use ANSI C function declaration.
4723 * strstr.c: Don't include <sys/types.h>.
4724 * strstr.h (PARAMS): Remove macro.
4725 (strstr): Use ANSI C function declarations.
4727 2002-11-06 Bruno Haible <bruno@clisp.org>
4729 * gcd.h (gcd): Change argument type to 'unsigned long'.
4730 * gcd.c (gcd): Likewise.
4732 2002-11-05 Bruno Haible <bruno@clisp.org>
4734 * gcd.h: New file, from gettext-0.11.5.
4735 * gcd.c: New file, from gettext-0.11.5.
4737 2002-11-05 Bruno Haible <bruno@clisp.org>
4739 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4740 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4741 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4742 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4744 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4745 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4747 * closeout.c: Include gettext.h instead of <libintl.h>.
4748 * human.c: Include gettext.h instead of <libintl.h>.
4749 * quotearg.c: Include gettext.h instead of <libintl.h>.
4750 * rpmatch.c: Include gettext.h instead of <libintl.h>.
4751 * unicodeio.c: Include gettext.h instead of <libintl.h>.
4752 * userspec.c: Include gettext.h instead of <libintl.h>.
4753 * version-etc.c: Include gettext.h instead of <libintl.h>.
4754 * xmalloc.c: Include gettext.h instead of <libintl.h>.
4755 (textdomain): Remove definition.
4756 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
4758 * long-options.c: Remove include of <libintl.h> and definition of _.
4759 * same.c: Remove include of <libintl.h> and definition of _.
4761 2002-11-04 Bruno Haible <bruno@clisp.org>
4763 * stpcpy.h: New file, from GNU gettext-0.11.5.
4764 * strcase.h: New file, from GNU gettext-0.11.5.
4765 * strpbrk.h: New file, from GNU gettext-0.11.5.
4766 * strstr.h: New file, from GNU gettext-0.11.5.
4767 * xgetcwd.h: New file, from GNU gettext-0.11.5.
4769 2002-05-09 Bruno Haible <bruno@clisp.org>
4771 * config.charset: Update for newest glibc. Add canonical names
4772 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
4774 2002-05-09 Bruno Haible <bruno@clisp.org>
4776 * localcharset.c (get_charset_aliases): Add more Windows specific
4779 2002-05-08 Owen Taylor <otaylor@redhat.com>
4781 * config.charset: A few additions for Solaris.
4783 2001-12-05 Bruno Haible <bruno@clisp.org>
4785 * localcharset.c (locale_charset): Don't return an empty string.
4787 2001-10-23 Bruno Haible <haible@clisp.cons.org>
4789 * config.charset: msdos in uk_UA uses CP1125.
4791 2001-08-05 Bruno Haible <haible@clisp.cons.org>
4793 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
4794 * localcharset.c (locale_charset): Declare as extern "C".
4796 2002-02-15 Bruno Haible <bruno@clisp.org>
4798 * config.charset [msdosdjgpp]: For Russian, use CP866.
4800 2002-02-11 Bruno Haible <bruno@clisp.org>
4802 * config.charset: Add support for NetBSD.
4804 2002-09-25 <karl@gnu.org>
4806 * strdup.c: copy from libc/string (via ../config/srclist*).
4807 * getopt*: copy from libc/posix.
4808 * gettext.h: copy from gettext.
4809 * .cppi-disable: add strdup.c, gettext.h.
4811 2002-07-01 Jim Meyering <meyering@lucent.com>
4813 * c-stack.c: Include sys/time.h.
4814 From Volker Borchert.
4816 2002-06-11 Paul Eggert <eggert@twinsun.com>
4818 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
4819 New macro. Use it uniformly instead of
4820 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
4821 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
4822 reported by Vin Shelton.
4824 2002-06-22 Jim Meyering <meyering@lucent.com>
4826 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
4827 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
4829 2002-06-22 Paul Eggert <eggert@twinsun.com>
4831 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
4832 Do not assume SA_SIGINFO behavior.
4833 Bug reported by Jim Meyering on NetBSD 1.5.2.
4835 2002-06-22 Jim Meyering <meyering@lucent.com>
4837 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
4839 * exitfail.c, exitfail.h: Likewise.
4840 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
4842 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
4844 (EXTRA_DIST): Add fnmatch_loop.c.
4845 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
4847 * fnmatch_loop.c: New file, from diffutils-2.8.2.
4848 * fnmatch.c: Update from diffutils-2.8.2.
4849 * fnmatch_.h: New file. From diffutils-2.8.2.
4850 * fnmatch.h: Remove file.
4852 2002-06-18 Paul Eggert <eggert@twinsun.com>
4854 * file-type.h: Report an error if neither S_ISREG nor
4855 S_IFREG is defined, instead of using a test specific to glibc
4856 2.2. This should be safe, since POSIX requires S_ISREG and
4857 Unix Version 7 had S_IFREG. We don't need to check for
4858 <sys/types.h> since we don't use any symbols that it defines.
4860 2002-06-15 Jim Meyering <meyering@lucent.com>
4862 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
4863 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
4864 have been included before this file.
4866 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
4868 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
4869 so that each temporary file name is unique and valid in the first
4870 8 characters, for operation under DOS.
4872 2002-06-15 Jim Meyering <meyering@lucent.com>
4874 Work even with DJGPP 2.03, which lacks support for symlinks.
4876 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
4878 * lchown.c (S_ISLNK): Likewise.
4880 2002-06-14 Jim Meyering <meyering@lucent.com>
4882 * file-type.h: Use the version from diffutils-2.8.2.
4883 * file-type.c: Likewise.
4885 2002-05-27 Jim Meyering <meyering@lucent.com>
4887 Fix a problem seen only on nonconforming systems whereby ls.c's
4888 use of localtime, and then of gettimeofday would cause trouble:
4889 the localtime call used to initialize rpl_gettimeofday's save
4890 mechanism would clobber ls's current local time information so
4891 that in any long listing the first file would always be listed
4892 with date 1970-01-01. Analysis by Volker Borchert.
4894 * gettimeofday.c (localtime): Undefine.
4895 (rpl_localtime): New function.
4897 2002-05-22 Jim Meyering <meyering@lucent.com>
4899 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
4900 * file-type.h: New file.
4901 * file-type.c (file_type): New file/function. Extracted from diffutils.
4903 2002-04-29 Paul Eggert <eggert@twinsun.com>
4905 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
4907 2002-04-28 Paul Eggert <eggert@twinsun.com>
4909 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
4910 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
4911 of 127, since 64 is the largest conceivable number for ancient
4913 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
4915 2002-04-28 Jim Meyering <meyering@lucent.com>
4917 * sig2str.c (WTERMSIG): Remove definition (unused).
4919 2002-04-28 Paul Eggert <eggert@twinsun.com>
4921 * sig2str.h, sig2str.c: New files.
4922 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
4924 2002-04-24 Jim Meyering <meyering@lucent.com>
4926 * gettext.h: New file, from Gettext.
4927 * Makefile.am (INCLUDES): Remove -I../intl.
4928 (libfetish_a_SOURCES): Add gettext.h.
4930 2002-04-16 Jim Meyering <meyering@lucent.com>
4932 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
4933 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
4934 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
4936 2002-04-12 Jim Meyering <meyering@lucent.com>
4938 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
4940 2002-03-10 Jim Meyering <meyering@lucent.com>
4942 * makepath.c (make_path): Remove a comma from a diagnostic.
4943 Suggestion from Santiago Vila.
4945 2002-03-08 Jim Meyering <meyering@lucent.com>
4947 * rename.c: Mention that this wrapper is needed also on
4948 mips-dec-ultrix4.4 systems.
4950 2002-03-02 Jim Meyering <meyering@lucent.com>
4952 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
4953 not HAVE_CLOCK_SETTIME.
4955 2002-02-27 Paul Eggert <eggert@twinsun.com>
4957 * nanosleep.h: Rename to....
4958 * timespec.h: New name for nanosleep.h. All uses changed.
4960 * gettime.c: New file.
4961 * settime.c: New file.
4964 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
4965 timespec.h. Remove nanosleep.h.
4967 2002-02-25 Paul Eggert <eggert@twinsun.com>
4969 * acl.c, acl.h: New files.
4970 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
4972 2002-02-24 Jim Meyering <meyering@lucent.com>
4974 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
4975 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
4976 cause trouble. Reported by Nelson Beebe.
4978 2002-02-23 Paul Eggert <eggert@twinsun.com>
4980 * path-concat.c (xpath_concat): Reorder code to pacify
4981 compilers that don't know that xalloc_die never returns.
4983 2002-02-20 Jim Meyering <meyering@lucent.com>
4985 * getdate.c: Regenerate using bison-1.33.
4987 2002-02-15 Paul Eggert <eggert@twinsun.com>
4989 * posixver.c, posixver.h: New files.
4990 * Makefile.am (libfetish_a_SOURCES): Add them.
4992 2002-02-02 Paul Eggert <eggert@twinsun.com>
4993 Bruno Haible <bruno@clisp.org>
4995 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
4996 (fwrite_success_callback): New declaration.
4997 * unicodeio.c (unicode_to_mb): New function, extracted from
4998 print_unicode_char. Call failure callback instead of error.
4999 (fwrite_success_callback): New function.
5000 (exit_failure_callback): New function.
5001 (fallback_failure_callback): New function.
5002 (print_unicode_char): Call unicode_to_mb.
5004 2002-01-26 Jim Meyering <meyering@lucent.com>
5006 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
5008 2002-01-22 Jim Meyering <meyering@lucent.com>
5010 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
5011 Otherwise, some versions of automake would omit the rule that makes
5012 Makefile from Makefile.in.
5014 2001-01-21 Paul Eggert <eggert@twinsun.com>
5016 * xmemcoll.h, xmemcoll.c: New files.
5017 * Makefile.am (libfetish_a_SOURCES): Add them.
5018 * memcoll.c: Include errno.h, and declare errno if not defined.
5019 (memcoll): Set errno to zero if there is no error.
5021 * quotearg.c (quotearg_buffer_restyled):
5022 Fix bug with quoting buffers containing NUL when backslashing escapes.
5023 This bug was exposed by the other changes in this patch.
5024 (quotearg_n_options): New arg ARGSIZE.
5025 All callers changed.
5026 (quoting_options_from_style): New function.
5027 (quotearg_n_style): Use it.
5028 (quotearg_n_style_mem): New function.
5030 * quotearg.h (quotearg_n_style_mem): New function.
5032 2002-01-16 Jim Meyering <meyering@lucent.com>
5034 * getdate.y: Add three semicolons, each just before a closing brace.
5035 Bison (as of version 1.31) no longer papers over that mistake.
5037 2002-02-14 Paul Eggert <eggert@twinsun.com>
5039 * backupfile.c (ISDIGIT): Comment fix.
5040 * getdate.y (ISDIGIT): Likewise.
5041 * posixtm.c (ISDIGIT, year): Likewise.
5042 * strverscmp.c (ISDIGIT): Likewise.
5043 * userspec.c (ISDIGIT): Likewise.
5045 2002-01-05 Jim Meyering <meyering@lucent.com>
5047 * version-etc.c (version_etc_copyright): Update copyright year.
5049 2001-01-19 Paul Eggert <eggert@twinsun.com>
5051 * closeout.c (close_stdout_status): If ferror (stdout), do
5052 not silently exit merely because the output buffer happens to
5053 have nothing pending.
5055 2001-12-18 Paul Eggert <eggert@twinsun.com>
5057 See the big note in ../ChangeLog.
5058 * human.c (suffixes): Prefer K to k for 1024.
5059 (generate_suffix_backwards): New function.
5060 (human_readable_inexact): Use it.
5061 * xstrtol.c (__xstrtol): If there is no number but there
5062 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
5063 Accept 'K' as well as 'k'.
5065 2001-12-15 Jim Meyering <meyering@lucent.com>
5067 * regex.h (__restrict_arr): Update from libc.
5069 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
5070 as `remote' if the name starts with `//'. Suggested by Michael Stone.
5073 2001-12-10 Jim Meyering <meyering@lucent.com>
5075 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
5076 Instead, include "xalloc.h".
5077 (initbuffer): Don't cast xmalloc return value to char*.
5078 (readline): Reword comment.
5079 Don't cast xrealloc return value to char*
5082 2001-12-09 Jim Meyering <meyering@lucent.com>
5084 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
5085 `signed and unsigned type in conditional expression'.
5086 * posixtm.c (posix_time_parse): Likewise.
5088 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
5090 * readtokens.c (readtoken): Declare an index to be of type unsigned
5091 to avoid a pedantic warning.
5093 * getstr.c: Don't include assert.h.
5094 (getstr): Remove warning-evoking assertions.
5095 Return -1 if offset parameter is out of bounds.
5096 Change the type of a local from int to size_t.
5098 * strftime.c (my_strftime_localtime_r): Include this function
5099 definition in the `#if ! HAVE_TM_GMTOFF' block.
5101 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
5102 Include xalloc.h instead.
5104 2001-12-02 Jim Meyering <meyering@lucent.com>
5106 * tempname.c: Don't declare getenv, thus reverting the change of
5107 2001-11-18. It's no longer necessary, now that stdlib.h is always
5110 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
5111 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
5113 2001-11-30 Akim Demaille <akim@epita.fr>
5115 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
5116 before being defined.
5118 2001-11-27 Paul Eggert <eggert@twinsun.com>
5120 * quotearg.h (quotearg_n, quotearg_n_style):
5121 First arg is int, not unsigned.
5122 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
5123 (SIZE_MAX, UINT_MAX): New macros.
5124 (quotearg_n_options): Abort if N is negative.
5125 Avoid overflow check on hosts where size_t is 64 bits and int
5126 is 32 bits, as overflow is impossible there.
5127 Fix off-by-one typo that caused unnecessary reallocation.
5129 2001-11-27 Jim Meyering <meyering@lucent.com>
5131 * tempname.c: Merge with version from libc.
5132 * regex.c: Likewise.
5134 * tempname.c: Include stdlib.h unconditionally. On some old systems
5135 for which STDC_HEADERS is 0, it was not included, resulting in a
5136 warning about an integer-to-pointer conversion problem with getenv.
5137 Reported by Volker Borchert.
5139 2001-11-26 Jim Meyering <meyering@lucent.com>
5141 * gtod.h: Remove file.
5142 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
5143 * gettimeofday.c: Don't include gtod.h.
5144 (GTOD_init): Remove function.
5145 (rpl_gettimeofday): Do its job here instead, rather than aborting.
5146 Suggestion from Volker Borchert.
5148 2001-11-23 Jim Meyering <meyering@lucent.com>
5150 * hash.h (struct hash_table): Don't define here. Merely declare it.
5151 * hash.c (struct hash_table): Define it here instead.
5153 2001-11-22 Jim Meyering <meyering@lucent.com>
5155 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
5157 2001-11-18 Paul Eggert <eggert@twinsun.com>
5159 * tempname.c (TMP_MAX): Remove; no longer needed.
5160 (TEMPORARIES): New macro.
5161 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
5162 removes an artificial limitation (e.g. HP-UX 10.20, where
5165 2001-11-18 Jim Meyering <meyering@lucent.com>
5167 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
5170 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
5171 files will be created before anything else.
5173 2001-11-17 Jim Meyering <meyering@lucent.com>
5175 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
5176 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
5177 rather than group writable. Patch by Juan F. Codagnone.
5179 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
5180 Instead, include "xalloc.h".
5182 * mountlist.c: Include unlocked-io.h after all system headers.
5183 Remove explicit declarations of xmalloc, xrealloc,
5184 and xstrdup. Instead, include "xalloc.h".
5186 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
5187 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
5188 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
5190 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
5191 Reported by Padraig Brady.
5193 * mkstemp.c: #undef mkstemp.
5195 (rpl_mkstemp): Rename from mkstemp.
5198 2001-11-16 Jim Meyering <meyering@lucent.com>
5200 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
5201 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
5202 determine the amount of total physical memory, use pstat_getstatic.
5203 HPUX-11 doesn't define _SC_PHYS_PAGES.
5204 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
5205 If sysconf couldn't be used to determine the amount of available
5206 physical memory, use both pstat_getstatic and pstat_getdynamic.
5207 Based on a patch from Bob Proulx.
5209 2001-11-05 Jim Meyering <meyering@lucent.com>
5211 * xstat.in (slash_aware_lstat): Correct a misleading comment.
5213 2001-11-03 Jim Meyering <meyering@lucent.com>
5215 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
5216 in argmatch_to_argument call.
5218 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
5221 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
5222 e.g., a fault due to an attempt to free a NULL pointer.
5224 2001-11-01 Jim Meyering <meyering@lucent.com>
5226 * dirfd.c, dirfd.h: New files.
5227 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
5229 * hash.c (hash_print) [TESTING]: Clean up.
5231 2001-10-22 Paul Eggert <eggert@twinsun.com>
5233 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
5234 to avoid a warning if -Wall.
5236 2001-10-21 Paul Eggert <eggert@twinsun.com>
5238 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
5240 2001-10-21 Jim Meyering <meyering@lucent.com>
5242 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
5243 this code would end up calling gettext even in packages built
5245 * getopt.c (_): Likewise.
5246 * regex.c (_): Likewise.
5248 2001-10-20 Paul Eggert <eggert@twinsun.com>
5250 * error.c (strerror_r): Do not declare unless !_LIBC.
5251 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
5252 Use strerror_r that is only a macro, even if it is not a function.
5253 (strerror): Check for HAVE_DECL_STRERROR before declaring.
5254 (private_strerror): Use prototypes, not old-style function definition.
5255 (print_errno_message): New function.
5256 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
5258 (error_tail, error, error_at_line): Use it.
5260 2001-10-11 Jim Meyering <meyering@lucent.com>
5262 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
5263 and quote_n (1, ... to avoid clobbering a buffer.
5265 2001-10-05 Jim Meyering <meyering@lucent.com>
5267 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
5268 * hash-pjw.c: New file (factored out of fileutils' remove.c).
5269 * hash-pjw.h: New file.
5271 2001-09-30 Jim Meyering <meyering@lucent.com>
5273 * mountlist.c [MOUNTED_GETFSSTAT]:
5274 Include <sys/ucred.h>, for Apple Darwin.
5275 Include sys/mount.h and sys/fs_types.h only if available.
5277 (read_filesystem_list): Use FS_TYPE.
5279 2001-09-29 Paul Eggert <eggert@twinsun.com>
5281 * exclude.c (excluded_filename): 0 -> false, since it's
5284 2001-09-28 Paul Eggert <eggert@twinsun.com>
5286 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
5287 #defines strtoimax. Also treat the other strto* functions
5290 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
5291 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
5292 (strtoimax, strtoumax): Do not declare if already defined as a macro.
5294 2001-09-26 Jim Meyering <meyering@lucent.com>
5296 Most macros in unlocked-io.h had the wrong number of arguments.
5297 * gen-uio: New script.
5298 (USE_UNLOCKED_IO): Define to 1 if not already defined.
5299 * unlocked-io.hin: Remove file.
5300 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
5301 rather than trying to embed it here.
5302 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
5303 Reported by Padraig Brady.
5305 2001-09-25 Volker Borchert <bt@teknon.de>
5307 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
5309 2001-09-23 Jim Meyering <meyering@lucent.com>
5311 * mountlist.c: Remove useless parentheses in #if directives.
5312 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
5313 the deprecated MOUNTED symbol is no longer defined in mntent.h.
5315 2001-09-22 Jim Meyering <meyering@lucent.com>
5317 * localcharset.c: Update from latest gettext.
5318 * config.charset: Likewise.
5320 2001-09-20 Jim Meyering <meyering@lucent.com>
5322 * xstrtol.c (strtoimax): Guard declaration with
5323 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
5324 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
5325 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
5326 (strtoumax): Likewise, for completeness (it wasn't necessary).
5328 2001-09-06 Paul Eggert <eggert@twinsun.com>
5330 * strtoimax.c (HAVE_LONG_LONG):
5331 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
5332 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
5333 to work around bug in IBM C compiler.
5335 2001-09-16 Jim Meyering <meyering@lucent.com>
5337 * mkdir.c: New file.
5339 2001-09-04 Paul Eggert <eggert@twinsun.com>
5341 * xgetcwd.c: Revert some of the previous change; intead,
5342 fix the HAVE_GETCWD_NULL code to behave more like the
5343 !HAVE_GETCWD_NULL code used to.
5346 (xgetcwd): Do not return NULL when memory is exhausted; instead,
5349 2001-09-04 Paul Eggert <eggert@twinsun.com>
5351 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
5352 Use ssize_t, not int, to store result of readlink.
5353 Check for ssize_t overflow as well as size_t overflow,
5354 as POSIX says the result of readlink is implementation-defined
5355 when ssize_t overflows.
5356 Remove unnecessary cast to char*.
5357 Use free+malloc instead of realloc, as the storage doesn't need
5358 to be preserved and it's clearer and can be more efficient that way.
5359 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
5360 * xreadlink.h (xreadlink): Update prototype.
5362 2001-09-03 Paul Eggert <eggert@twinsun.com>
5364 * exclude.c (fnmatch_no_wildcards): Fix confusion between
5365 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
5366 spotted by Jim Meyering.
5368 2001-09-03 Jim Meyering <meyering@lucent.com>
5370 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
5372 2001-09-03 Paul Eggert <eggert@twinsun.com>
5374 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
5375 like the HAVE_GETCWD_NULL code.
5376 Include pathmax.h if not HAVE_GETCWD.
5377 Do not include xalloc.h.
5378 (INITIAL_BUFFER_SIZE): New symbol.
5379 Do not use xmalloc / xrealloc, since the caller is responsible for
5380 handling errors. Preserve errno around `free' during failure.
5381 Do not overrun buffer when using getwd.
5383 2001-09-03 Paul Eggert <eggert@twinsun.com>
5385 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
5386 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
5388 2001-09-02 Jim Meyering <meyering@lucent.com>
5390 * error.c: Update from GNU libc.
5392 2001-09-01 Jim Meyering <meyering@lucent.com>
5394 * xreadlink.c: New file.
5395 * xreadlink.h: New file.
5396 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
5398 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
5399 doesn't conflict with sparc Solaris 7's definition in
5400 /usr/include/sys/int_types.h.
5402 * exclude.c: Use `""', not `<>' to #include non-system header files.
5403 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
5404 and strncasecmp as r-values. Unixware didn't have declarations.
5406 2001-08-31 Jim Meyering <meyering@lucent.com>
5408 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
5409 Use an initial, malloc'd, buffer of length 128 rather than
5410 a statically allocated one of length 1024.
5412 2001-08-30 Paul Eggert <eggert@twinsun.com>
5414 * xgetcwd.c: Don't include pathmax.h.
5415 Include stdlib.h and unistd.h if available.
5417 (xmalloc, xstrdup, free): Remove decls.
5418 (xgetcwd): Don't assume sizes fit in unsigned.
5419 Check for overflow when computing sizes.
5420 Simplify reallocation code.
5422 2001-08-28 Paul Eggert <eggert@twinsun.com>
5424 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
5426 * strtoimax.c: Renamed from strtoxmax.c, removing the
5429 Also, make the following further changes to make this file's
5430 configuration more similar to that of strtol.c:
5431 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
5432 (strtoumax, uintmax_t, strtoull, strtol): Remove.
5433 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
5434 (strtoimax): Renamed from strtoumax. All uses of unsigned values
5435 changed to signed values.
5437 And make the following changes as well:
5438 Fix copyright notice, as 1999 was missing.
5439 (verify): New macro.
5440 (strtoimax): Check sizes at compile-time, not run-time.
5441 Prefer strtol to strtoll if both work.
5442 (main): Remove; it was not that useful and was a pain to maintain.
5444 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
5446 2001-08-30 Paul Eggert <eggert@twinsun.com>
5448 * savedir.c (savedir): Remove size parameter, as POSIX says that
5449 a directory's st_size can have an arbitrary value, so the old
5450 usage could waste an arbitrary amount of memory. All uses
5452 * savedir.h: Update prototype.
5454 2001-08-30 Paul Eggert <eggert@twinsun.com>
5456 * xstrtol.c (strtoimax): New decl.
5458 2001-08-28 Paul Eggert <eggert@twinsun.com>
5460 * xstrtol.h: Add copyright notice.
5461 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
5462 LONGINT_INVALID_SUFFIX_CHAR.
5464 2001-08-30 Paul Eggert <eggert@twinsun.com>
5466 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5469 2001-08-30 Paul Eggert <eggert@twinsun.com>
5471 * hash.c: Remove '2001' from copyright notice.
5473 2001-08-30 Paul Eggert <eggert@twinsun.com>
5475 * full-write.h: New file.
5476 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
5477 * full-write.c: Correct credits, as cccp.c no longer
5478 exists and anyway it was so heavily changed from the old cccp
5479 code as to be unrecognizable. Include full-write.h.
5480 (full_write) Return size_t, with short writes meaning failure.
5481 All callers changed. This fixes a bug with large buffers
5483 * utime.c: Include full-write.h.
5485 2001-08-30 Paul Eggert <eggert@twinsun.com>
5487 Merge 'exclude' changes from tar 1.13.22.
5488 This fixes one or two unlikely storage allocation overflow bugs,
5489 but doesn't change user-visible behavior otherwise.
5491 2001-08-30 Paul Eggert <eggert@twinsun.com>
5493 * exclude.c (bool): Declare, perhaps by including stdbool.h.
5494 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
5495 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
5496 Include if available.
5497 (<xalloc.h>): Include
5498 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
5499 (verify): New macro. Use it to verify that EXCLUDE macros do not
5500 collide with FNM macros.
5501 (struct patopts): New struct.
5502 (struct exclude): Use it, as exclude patterns now come with options.
5503 (new_exclude): Support above changes.
5504 (new_exclude, add_exclude_file):
5505 Initial size must now be a power of two to simplify overflow checking.
5506 (free_exclude, fnmatch_no_wildcards): New function.
5507 (excluded_filename): No longer requires options arg, as the options
5508 are determined by add_exclude. Now returns bool, not int.
5509 (excluded_filename, add_exclude):
5510 Add support for the fancy new exclusion options.
5511 (add_exclude, add_exclude_file): Now takes int options arg.
5512 Check for arithmetic overflow when computing sizes.
5513 (add_exclude_file): xrealloc might modify errno, so don't
5514 realloc until after errno might be used.
5516 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
5518 (free_exclude): New decl.
5519 (add_exclude, add_exclude_file): Now takes int options arg.
5520 (excluded_filename): No longer requires options arg, as the options
5521 are determined by add_exclude. Now returns bool, not int.
5523 2001-08-30 Paul Eggert <eggert@twinsun.com>
5525 * alloca.c (alloca): Arg is of type size_t, not unsigned.
5527 2001-08-27 Jim Meyering <meyering@lucent.com>
5529 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
5531 * version-etc.c (N_): Remove definition.
5532 Revert most of last change.
5533 Instead, simply don't mark the `Copyright...' string for translation.
5534 Based on advice from Paul Eggert.
5536 * strtoxmax.c: Tweak comment.
5538 2001-08-26 Jim Meyering <meyering@lucent.com>
5540 * version-etc.c (version_etc_copyright_fmt): Replace literal year
5541 of copyright with `%s' so translators don't get an untranslated
5543 (COPYRIGHT_YEAR): Define.
5544 (version_etc): Use fprintf rather than fputs.
5545 Suggestion from Ulrich Drepper.
5547 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5549 * strtoll.c: New file, from GNU libc.
5550 * xstrtoimax.c: New file.
5552 * xstrtol.h: Add xstrtoimax.
5553 * strtoumax.c: New file. Simply include "strtoumax.c".
5554 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
5556 * strtoumax.c: Factor to work both for unsigned and signed types, ...
5557 * strtoxmax.c: ... then renamed to this.
5559 2001-08-13 Paul Eggert <eggert@twinsun.com>
5561 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
5562 Port to Solaris 8, where 'sed' requires a space after the 'r'
5563 command, and where sh dislikes "$/". Clean up the spacing a bit.
5564 Redirect output to $tmp just once.
5566 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
5568 * addext.c (<errno.h>): Include.
5569 (errno): Declare if not defined.
5570 (addext): Work correctly when pathconf returns -1 and leaves
5571 errno alone because there is no limit. Also, work even if
5572 pathconf returns a value greater than SIZE_MAX.
5574 2001-08-12 Jim Meyering <meyering@lucent.com>
5576 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
5577 Simply `return getcwd (NULL, 0);'.
5578 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
5579 Use 1300 as initial value for length, not PATH_MAX.
5581 * pathmax.h: Clean up cpp syntax.
5583 2001-08-12 Jim Meyering <meyering@lucent.com>
5585 * gettimeofday.c: New file.
5587 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
5589 2001-08-04 Jim Meyering <meyering@lucent.com>
5591 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
5592 to get in sync with glibc.
5594 2001-08-03 Paul Eggert <eggert@twinsun.com>
5596 The following changes are from gettext 0.10.39 as maintained by
5599 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
5600 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
5601 with inverted sense. All uses changed.
5603 * mbswidth.c: Don't include <limits.h>.
5604 Include <stdlib.h> and <string.h> unconditionally.
5605 (iswcntrl, mbsinit, ISCNTRL): New macros.
5606 (mbsnwidth): Use K&R style function declarations.
5607 Don't bother checking for MB_LEN_MAX == 1, since the compiler
5608 can optimize it when MB_CUR_MAX == 1.
5609 The width of control characters is zero, not 1.
5611 2001-07-15 Jim Meyering <meyering@lucent.com>
5613 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
5614 (BUILT_SOURCES): Add unlocked-io.h.
5615 (io_functions): Define.
5616 (unlocked-io.h): New rule.
5617 (DISTCLEANFILES): Add unlocked-io.h.
5618 (all-local): Depend on unlocked-io.h, to ensure it is created.
5620 * unlocked-io.hin: New file
5622 * regex.c: Update from glibc.
5624 2001-07-05 Jim Meyering <meyering@lucent.com>
5626 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
5628 (libfetish_a_SOURCES): Put all .h files here instead.
5629 Remove a thus-exposed (better checks in automake) duplicate and
5630 two unnecessary .h files.
5632 2001-06-11 Jim Meyering <meyering@lucent.com>
5634 * regex.c: Update from GNU libc.
5636 2001-05-27 Jim Meyering <meyering@lucent.com>
5638 * readutmp.h (UT_TYPE): Define.
5640 2001-05-24 Jim Meyering <meyering@lucent.com>
5642 * argmatch.c: Include "quote.h".
5643 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
5644 quote function. Reported by Göran Uddeborg.
5646 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
5648 * dirname.c (dir_name): Compute append_dot using path, not newpath
5649 which is not yet declared.
5651 2001-05-11 Paul Eggert <eggert@twinsun.com>
5653 * Makefile.am (libfetish_a_SOURCES):
5654 Add strftime.c, since we now compile it on all hosts.
5656 * strftime.c (my_strftime):
5657 Define to nstrftime if emacs, but only if my_strftime is not defined.
5658 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
5659 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
5660 Add one more extra argument: a nanoseconds value.
5663 (my_strftime function): Add %N format.
5664 (emacs_strftimeu): Renamed from emacs_strftime,
5665 with extra ut argument.
5667 2001-05-11 Paul Eggert <eggert@twinsun.com>
5669 dirname code cleanup. base_name now behaves more compatibly
5670 with POSIX basename when given file names that have trailing
5671 slashes, and similarly for dir_name. Add new primitives
5672 base_len and dir_len. Put the directory-name-related decls
5675 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
5676 * backupfile.c (base_name): Likewise.
5677 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
5678 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
5679 * makepath.c (strip_trailing_slashes): Likewise.
5680 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
5682 * rename.c (strip_trailing_slashes): Likewise.
5683 * same.c (base_name): Likewise.
5684 * stripslash.c (ISSLASH): Likewise.
5686 * addext.c: Include <dirname.h> after size_t is defined.
5687 * backupfile.c: Likewise.
5689 * addext.c (addext): Use base_len to trim redundant
5690 trailing slashes instead of doing it ourselves.
5691 But do not trim the last slash if it is not redundant.
5693 * backupfile.c (find_backup_file_name,
5694 max_backup_version): Use base_len instead of rolling it ourselves.
5695 Handle the case of "" and (on DOS) "C:" correctly.
5697 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
5698 Include <string.h>, <dirname.h>.
5699 (base_name): Allow file names ending in slashes, other than names
5700 that are all slashes. In this case, return the basename followed
5701 by the slashes. This is more general, and can be used in places
5702 where the original base_name purposely had an assertion failure.
5703 (base_len): New function.
5705 * dirname.c: Include <string.h> instead of <stdlib.h>.
5706 Do not include <assert.h>; no longer needed.
5708 (memrchr): Remove decl.
5709 (dir_name_r): Remove.
5710 (dir_len): Renamed from dirlen. All callers changed.
5711 Rewrite in terms of base_name, for simplicity and consistency.
5712 (dir_name): Never return NULL. All callers changed.
5713 Do not include <stdlib.h> in test program; no longer needed.
5714 return 0; is fine for test program.
5716 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
5718 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
5720 * path-concat.c (path_concat): Use base_len to compute
5721 base length, not strlen; this means we cannot rely on memcpy
5724 * same.c (STREQ): Remove.
5725 (same_name): Handle the case where the basename ends in trailing '/'.
5727 * stripslash.c (strip_trailing_slashes): Return nonzero if
5728 a slash was stripped. Do not strip the last slash after a
5731 2001-04-08 Jim Meyering <meyering@lucent.com>
5733 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
5734 recomputed; that's necessary when the offset spans a DST transition.
5735 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
5737 2001-04-02 Jim Meyering <meyering@lucent.com>
5739 * regex.h, regex.c: Update from GNU libc.
5741 2001-03-19 Paul Eggert <eggert@twinsun.com>
5743 * version-etc.c (version_etc_copyright): Update to 2001.
5745 2001-03-16 Paul Eggert <eggert@twinsun.com>
5747 * tempname.c (uint64_t): Define to uintmax_t if
5748 not defined, and if UINT64_MAX is not defined.
5749 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5750 Reported by John David Anglin.
5752 2001-03-10 Bruno Haible <haible@clisp.cons.org>
5754 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5755 alias if codeset is empty.
5756 * config.charset (BeOS): Use wildcard syntax.
5758 2001-03-13 Jim Meyering <meyering@lucent.com>
5760 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5761 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5764 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5766 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5768 * unicodeio.c (print_unicode_char): Simplify accordingly.
5770 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5772 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5773 support for DOS/DJGPP.
5775 2001-02-28 Paul Eggert <eggert@twinsun.com>
5777 * Makefile.am (libfetish_a_SOURCES):
5778 Add dup-safer.c, fopen-safer.c.
5779 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5781 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5783 2001-02-25 Paul Eggert <eggert@twinsun.com>
5785 The mkstemp replacement is taken from glibc 2.2.2, with some
5786 portability fixes for use outside glibc, as follows:
5788 * tempname.c (struct_stat64): New macro.
5789 (direxists, __gen_tempname): Use it.
5790 This avoids a portability problem with Solaris 8.
5792 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5793 (<stddef.h>, <stdint.h>, <string.h>):
5794 Include only if STDC_HEADERS || _LIBC.
5795 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5796 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5797 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5798 (__set_errno): Define this macro if <errno.h> doesn't.
5799 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
5800 Define these macros if <stdio.h> doesn't.
5801 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
5802 Define these macros if <sys/stat.h>
5803 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
5804 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
5805 __xstat64): Define if not _LIBC.
5806 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
5807 (__gen_tempname): Invoke gettimeofday only if
5808 HAVE_GETTIMEOFDAY || _LIBC;
5809 otherwise, fall back on plain "time".
5810 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
5812 * mkstemp.c (__GT_FILE): Define to zero if not defined.
5814 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
5816 2001-02-17 Jim Meyering <meyering@lucent.com>
5818 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
5819 around included file name.
5821 * strnlen.c (__strnlen): Merge in a change from GNU libc.
5823 * strftime.c: Update from GNU libc (the only changes were to comments).
5825 2001-02-13 Bruno Haible <haible@clisp.cons.org>
5827 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
5829 2001-02-17 Paul Eggert <eggert@twinsun.com>
5831 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
5832 Remove workaround macros for hosts that have mbrtowc but not
5833 mbstate_t, as we now insist on proper declarations for both
5834 before using mbrtowc.
5836 2001-02-17 Jim Meyering <meyering@lucent.com>
5838 * regex.c: Update from libc.
5840 2001-02-16 Paul Eggert <eggert@twinsun.com>
5842 * alloca.c (malloc): Undef before defining, since stdlib.h
5843 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
5844 Reported by Mark Hounschell via Paul Eggert.
5846 2001-01-30 Bruno Haible <haible@clisp.cons.org>
5848 * config.charset: Update for FreeBSD 4.2.
5850 2001-01-26 Jim Meyering <meyering@lucent.com>
5852 * quotearg.c: Include stddef.h.
5853 * quote.c: Include stddef.h.
5854 Reported by Axel Kittenberger.
5856 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
5857 line in double quotes so that it evokes a better diagnostic.
5858 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
5859 Reported by Axel Kittenberger.
5861 2001-01-15 Bruno Haible <haible@clisp.cons.org>
5863 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
5864 to avoid a warning. Add back 'const' to inptr.
5866 2001-01-16 Jim Meyering <meyering@lucent.com>
5868 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
5871 2001-01-14 Jim Meyering <meyering@lucent.com>
5873 * rename.c: New file. From Volker Borchert.
5874 Include stdlib.h, string.h or strings.h, and xalloc.h.
5875 Use strip_trailing_slashes rather than open-coding it.
5877 2001-01-03 Paul Eggert <eggert@twinsun.com>
5879 * strftime.c: Sync with glibc time/strftime.c 1.81.
5881 2001-01-03 Jim Meyering <meyering@lucent.com>
5883 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
5884 local `inptr' to avoid warning with some system declarations of iconv.
5886 2000-12-29 Paul Eggert <eggert@twinsun.com>
5888 * modechange.c: Do not assume that mode_t uses the
5889 traditional octal encoding. E.g. "chmod 1 FOO" should set
5890 the other-execute bit of FOO even if S_IXOTH != 1.
5892 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
5893 WOTH, XOTH, ALLM): New macros.
5894 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
5895 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
5897 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
5898 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
5900 No need to use uintmax_t; unsigned long is long enough.
5901 Don't bother to get suffix since we don't use it.
5903 2000-12-24 Jim Meyering <meyering@lucent.com>
5905 * hash.c (is_prime): Return explicit boolean values.
5906 (hash_get_first): Return NULL to appease Irix5.6's 89.
5907 Reported by Nelson Beebe.
5909 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5911 * localcharset.c (locale_charset): Add support for Win32.
5913 2000-12-18 Paul Eggert <eggert@twinsun.com>
5915 * physmem.h, physmem.c: New files.
5917 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
5918 (noinst_HEADERS): Add physmem.h.
5920 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
5921 't' for compatibility with Solaris 8 sort.
5923 2000-12-18 Bruno Haible <haible@clisp.cons.org>
5925 * config.charset: Add support for BeOS.
5927 2000-12-16 Jim Meyering <meyering@lucent.com>
5929 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
5930 SHELLS_FILE to a file name that's useful on djgpp systems.
5932 (ADDITIONAL_DEFAULT_SHELLS): Define.
5933 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
5934 Based mostly on a patch from Prashant TR.
5936 2000-12-16 Jim Meyering <meyering@lucent.com>
5938 This bug had a serious impact on chown: `chown N:M FILE' (for integer
5939 N and M) would have treated it like `chown N:N FILE'.
5941 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
5943 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5945 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
5946 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
5947 to the list of canonical encodings. Rename EUC-CN to GB2312.
5949 2000-12-08 Andreas Schwab <schwab@suse.de>
5951 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
5952 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
5954 2000-12-07 Jim Meyering <meyering@lucent.com>
5956 * stripslash.c (ISSLASH): Define.
5957 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
5960 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
5961 (dir_name_r): Declare this function as static.
5962 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
5963 manifest itself on a name containing a mix of slashes and
5965 Make this function work with names starting with a DOS-style
5966 drive letter and colon prefix.
5967 (dir_name): Append `.' if necessary.
5968 Based mostly on patches from Prashant TR and Eli Zaretskii.
5970 * dirname.h (dir_name_r): Remove prototype.
5972 2000-12-05 Jim Meyering <meyering@lucent.com>
5974 * dirname.c (dir_name_r): Add `const' in a few local declarations.
5976 2000-12-04 Jim Meyering <meyering@lucent.com>
5978 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
5979 Also include memory.h, stdlib.h, unistd.h if appropriate.
5980 Reported by Andreas Jaeger (conflicting declaration of malloc).
5982 2000-12-02 Jim Meyering <meyering@lucent.com>
5984 * closeout.h: Make idempotent, to avoid some obscure warnings.
5986 2000-12-01 Paul Eggert <eggert@twinsun.com>
5988 * memrchr.c: Include <config.h> before any system include file.
5990 2000-11-29 Paul Eggert <eggert@twinsun.com>
5992 * dirname.c (dir_name_r): Fix typo: int -> size_t.
5994 2000-11-26 Jim Meyering <meyering@lucent.com>
5996 * memcoll.c: Include sys/types.h. From Werner Almesberger.
5998 2000-11-22 Paul Eggert <eggert@twinsun.com>
6000 * strftime.c (my_strftime): Do not invoke mbrlen with a
6001 size of (size_t) -1; it's not portable.
6003 2000-11-17 Akim Demaille <akim@epita.fr>
6005 * obstack.h: Formatting changes.
6006 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
6007 prevent type checking.
6008 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
6009 cast the value to (void *): assigning a `foo *' to a `void *'
6011 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
6013 2000-11-17 Jim Meyering <meyering@lucent.com>
6015 * strstr.c: Update from GNU libc.
6017 2000-11-16 Jim Meyering <meyering@lucent.com>
6019 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
6021 2000-11-11 Jim Meyering <meyering@lucent.com>
6023 * error.c: Add a couple #includes, merging from GNU libc version.
6025 2000-11-10 Jim Meyering <meyering@lucent.com>
6027 * obstack.h: Update from GNU libc.
6028 * obstack.c: Likewise.
6030 2000-11-06 Paul Eggert <eggert@twinsun.com>
6032 * getusershell.c (setusershell): Use rewind rather than
6033 fseek/fseeko, to avoid configuration hassles with fseeko.
6034 Don't bother opening SHELLS_FILE if shellstream is NULL;
6037 2000-11-05 Jim Meyering <meyering@lucent.com>
6039 * makepath.h (make_dir): Declare.
6040 * makepath.c (make_dir): Remove `static' attribute.
6043 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
6045 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
6046 last one in a bucket, advance to the next bucket.
6048 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
6050 * fnmatch.c: Do not comment out all the code if we are using
6051 the GNU C library, because in some cases we are replacing buggy
6052 code in the GNU C library itself.
6054 2000-10-30 Paul Eggert <eggert@twinsun.com>
6056 * error.h, getline.h, modechange.h:
6057 Remove "2000" from Copyright line, as the file hasn't been
6058 changed this year other than in the copyright notice.
6060 * xalloc.h: Add "2000" to Copyright line, as this file
6061 was changed this year.
6063 2000-10-30 Paul Eggert <eggert@twinsun.com>
6065 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
6066 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
6067 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
6069 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
6071 * regex.h (__restrict_arr): Move definition out of #ifndef block.
6072 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
6073 doesn't define __restrict_arr.
6075 2000-10-29 Jim Meyering <meyering@lucent.com>
6077 * xstat.in: Fix grammar in comment.
6079 2000-10-28 Jim Meyering <meyering@lucent.com>
6081 * memchr.c: Update from libc.
6082 Adjust for portability:
6083 [HAVE_STDLIB_H]: Include stdlib.h.
6084 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
6085 Undef __memchr, too.
6086 [!weak_alias]: Define __memchr to memchr.
6088 * regex.c: Update from libc.
6089 * regex.h: Likewise.
6090 * getopt1.c: Likewise.
6091 * memcmp.c: Likewise.
6093 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
6094 Avoid using fseek, when possible -- it's broken by design.
6095 Patch by Ulrich Drepper.
6097 2000-10-26 Jim Meyering <meyering@lucent.com>
6099 * strftime.c: Update from libc.
6101 2000-10-25 Jim Meyering <meyering@lucent.com>
6103 * obstack.c: Update from libc.
6105 2000-10-23 Jim Meyering <meyering@lucent.com>
6107 * hard-locale.c (hard_locale): Revert last change -- it was simply
6108 wrong. That set_locale call must not have any side effects.
6111 2000-10-22 Jim Meyering <meyering@lucent.com>
6113 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
6114 [CYCLIC]: Remove now-unused definition.
6116 * save-cwd.c (O_DIRECTORY): Define, if needed.
6117 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
6118 Suggestion from Ulrich Drepper.
6120 2000-10-21 Jim Meyering <meyering@lucent.com>
6122 * dirname.c (dir_name_r): New function, factored out of dir_name.
6123 (dir_name): Use dir_name_r.
6124 * dirname.h (dir_name_r): Declare it.
6126 2000-10-21 Jim Meyering <meyering@lucent.com>
6128 * dirname.c (memrchr): Declare if necessary.
6129 (dir_name): Remove the restriction that there be no
6130 trailing slashes. Now, this code skips past them, effectively
6132 [TEST_DIRNAME] (main): New unit tests.
6134 * memrchr.c: New file from GNU libc.
6135 Undef __memrchr, too.
6136 [!weak_alias]: Define __memrchr to memrchr.
6137 Guard weak_alias use with `#ifdef weak_alias'.
6139 2000-10-17 Jim Meyering <meyering@lucent.com>
6141 * quote.h (PARAMS): Define and use.
6142 Reported by Akim Demaille.
6144 * getopt.c: Update from libc.
6146 2000-10-16 Jim Meyering <meyering@lucent.com>
6148 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
6151 2000-09-25 Jim Meyering <meyering@lucent.com>
6153 * md5.h (rol): Define (from GnuPG).
6155 * sha.c: Give credit (GnuPG) where due.
6156 (M): Use rol rather than open-coding it.
6157 Add a FIXME comment.
6159 2000-09-21 Jim Meyering <meyering@lucent.com>
6161 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
6162 Reported by Michael Stone.
6164 2000-09-20 Jim Meyering <meyering@lucent.com>
6166 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
6167 (noinst_HEADERS): Add sha.h.
6168 Based on code from Scott G. Miller and from GnuPG.
6170 2000-09-15 Jim Meyering <meyering@lucent.com>
6172 * regex.c: Update from libc.
6174 2000-09-10 Jim Meyering <meyering@lucent.com>
6176 * getopt.c (_getopt_internal): Update from glibc.
6178 2000-09-09 Jim Meyering <meyering@lucent.com>
6180 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
6181 think it should be used as a general replacement for isascii.
6182 * fnmatch.c: Likewise.
6183 * mbswidth.c: Likewise
6184 * regex.c: Likewise.
6187 * userspec.c: Include sys/param.h and limits.h.
6189 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6190 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
6191 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
6192 UID, GID. Check range.
6194 2000-09-06 Jim Meyering <meyering@lucent.com>
6196 * getopt.c (_getopt_internal): Update from glibc.
6198 2000-08-30 Jim Meyering <meyering@lucent.com>
6200 * strftime.c: Merge in changes from GNU libc.
6202 2000-08-26 Jim Meyering <meyering@lucent.com>
6204 * closeout.c: Include "__fpending.h".
6205 (close_stdout_status): Return right away if there's nothing to flush.
6207 * Makefile.am (noinst_HEADERS): Add __fpending.h.
6208 * __fpending.c: New file.
6209 * __fpending.h: New file.
6211 2000-08-07 Paul Eggert <eggert@twinsun.com>
6213 Standardize on "memory exhausted" instead of "Memory exhausted"
6214 or "virtual memory exhausted".
6215 * obstack.c (print_and_abort): Use "memory exhausted", not
6216 "virtual memory exhausted".
6217 * same.c (same_name): Invoke xalloc_die instead of printing
6219 * userspec.c (parse_user_spec): Likewise.
6220 * bumpalloc.h: comment fix
6221 * same.c, userspec.c: Include xalloc.h.
6223 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
6224 not char *const and pointing to a constant array.
6225 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
6226 (xrealloc): Comment fix.
6228 * userspec.c (parse_user_spec):
6229 Don't translate a message until just before returning,
6230 to avoid unnecessary translation.
6232 2000-08-07 Jim Meyering <meyering@lucent.com>
6234 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
6235 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
6236 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
6237 getgroups.c, gethostname.c, getopt.h, group-member.c,
6238 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
6239 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
6240 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
6241 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
6242 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
6243 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
6244 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
6245 yesno.c: Back out Copyright date changes for each file with no change
6246 this year. This eases coordination with other programs using the same
6247 source code modules. From Paul Eggert.
6249 2000-08-03 Greg McGary <greg@mcgary.org>
6251 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
6252 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
6253 (EXTEND_BUFFER): Use them.
6255 2000-08-01 Jim Meyering <meyering@lucent.com>
6257 * dirname.c (ISSLASH): Define.
6258 (BACKSLASH_IS_PATH_SEPARATOR): Define.
6259 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
6260 both `\' and `/' may be use as path separators.
6261 Based on a patch from Prashant TR.
6263 2000-07-31 Paul Eggert <eggert@twinsun.com>
6265 * quotearg.c (quotearg_n_options): Don't make the initial
6266 slot vector a constant, since it might get modified.
6268 2000-07-31 Jim Meyering <meyering@lucent.com>
6270 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
6271 * obstack.c (print_and_abort): Likewise.
6273 2000-07-30 Paul Eggert <eggert@twinsun.com>
6275 * quotearg.c (quotearg_n_options): Preallocate a slot 0
6276 buffer, so that the caller can always quote one small
6277 component of a "memory exhausted" message in slot 0.
6278 From a suggestion by Jim Meyering.
6280 2000-07-30 Jim Meyering <meyering@lucent.com>
6282 * makepath.c (make_path): Quote the other instance, too.
6284 * quotearg.c (N_STATIC_SLOTVECS): Define.
6285 (STATIC_BUF_SIZE): Define.
6286 (quotearg_n_options): Use only statically allocated storage when
6287 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
6288 than STATIC_BUF_SIZE.
6290 2000-07-29 Jim Meyering <meyering@lucent.com>
6292 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
6293 * dirname.c (dir_name): Likewise.
6295 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
6297 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
6298 (dir_name): Assert that there are no trailing slashes.
6300 2000-07-18 Bruno Haible <haible@clisp.cons.org>
6302 * mbswidth.h (mbswidth): Add a flags argument.
6303 (mbswidth): New declaration.
6304 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
6305 * mbswidth.c (mbswidth): Add a flags argument.
6306 (mbsnwidth): New function.
6308 2000-07-24 Jim Meyering <meyering@lucent.com>
6310 * mbswidth.c: Remove useless #else. From Bruno Haible.
6312 2000-07-23 Paul Eggert <eggert@twinsun.com>
6314 * mbswidth.c (_XOPEN_SOURCE):
6315 Don't define; this causes problems on Solaris 7.
6316 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
6318 2000-07-23 Paul Eggert <eggert@twinsun.com>
6321 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
6322 so that mbstate_t is always defined.
6324 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
6325 be 1 in at least one GCC installation, and this configuration
6326 error is likely to be common. Ignoring MB_LEN_MAX hurts
6327 performance on hosts that have mbrtowc but have only unibyte
6328 locales, but I assume these hosts are rare.
6330 2000-07-23 Paul Eggert <eggert@twinsun.com>
6332 * quotearg.c: Streamline by invoking multibyte code only if needed.
6333 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
6334 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
6335 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
6336 invoke multibyte primitives.
6338 2000-07-23 Jim Meyering <meyering@lucent.com>
6340 * basename.c (base_name): Add an assertion.
6342 2000-07-15 Bruno Haible <clisp.cons.org>
6344 * quotearg.c: When the system forces us to redefine mbstate_t,
6345 shadow its mbsinit function.
6347 2000-07-16 Bruno Haible <haible@clisp.cons.org>
6349 * mbswidth.h: New file.
6350 * mbswidth.c: New file.
6351 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
6352 (noinst_HEADERS): Add mbswidth.h.
6354 2000-07-17 Bruno Haible <haible@clisp.cons.org>
6356 * config.charset: Add support for FreeBSD. Improve support for HP-UX
6359 2000-07-15 Jim Meyering <meyering@lucent.com>
6361 * makepath.c: Include quote.h.
6362 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
6363 corresponding argument in a `quote (...)' call.
6364 Give better diagnostics.
6366 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
6367 (noinst_HEADERS): Add quote.h.
6369 * quote.c (quote, quote_n): New file. Two functions taken verbatim
6370 from tar's src/misc.c.
6371 * quote.h: New file. Prototypes for same.
6373 2000-07-10 Paul Eggert <eggert@twinsun.com>
6375 From a suggestion by Bruno Haible.
6376 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
6377 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
6378 to decide whether to define the BeOS workaround macro;
6379 this adjusts to the change to AC_MBSTATE_T.
6381 2000-07-13 Paul Eggert <eggert@twinsun.com>
6383 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
6385 * quotearg.c (quoting_style_args, quoting_style_vals,
6386 quotearg_buffer_restyled): Add support for
6387 clocale_quoting_style. Undo previous change to
6388 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
6389 and "{RIGHT QUOTATION MARK}" msgids.
6391 2000-07-05 Paul Eggert <eggert@twinsun.com>
6393 The old behavior of quoting `like this' doesn't look good with
6394 newer, ISO-style fonts. See:
6395 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
6397 Instead, quote "like this" by default. Let the translator
6398 tailor the locale-specific quoting behavior by providing
6399 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
6401 * quotearg.c (N_): New macro.
6402 (gettext_default): New function.
6403 (quotearg_buffer_restyled): Use
6404 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
6405 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
6407 2000-07-09 Jim Meyering <meyering@lucent.com>
6409 * Most files: Update copyright dates to include 2000.
6411 2000-07-08 Jim Meyering <meyering@lucent.com>
6413 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
6415 (xgethostname): Remove now-unnecessary #ifdef.
6416 Move declaration of `err' into loop where it's used.
6418 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6420 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
6421 by allocating a larger buffer. Test the gethostname return value for
6422 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
6423 returns an error and ENAMETOOLONG isn't defined.
6425 2000-07-05 Paul Eggert <eggert@twinsun.com>
6426 and Bruno Haible <haible@clisp.cons.org>
6428 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
6430 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6432 * quotearg.c (struct quoting_options): Simplify quote_these_too
6435 2000-07-03 Jim Meyering <meyering@lucent.com>
6437 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
6438 Reported by Bruno Haible.
6440 2000-07-04 Jim Meyering <meyering@lucent.com>
6442 * quotearg.c: Make inclusion of <wchar.h> independent of whether
6443 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
6446 2000-07-03 Paul Eggert <eggert@twinsun.com>
6447 and Bruno Haible <haible@clisp.cons.org>
6449 * quotearg.c (mbrtowc):
6450 Assign to *pwc, and return 1 only if result is nonzero.
6451 (iswprint): Use ISPRINT when substituting our own mbrtowc.
6453 2000-07-03 Jim Meyering <meyering@lucent.com>
6455 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
6456 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
6459 2000-07-02 Jim Meyering <meyering@lucent.com>
6461 * quotearg.c (mbstate_t): Don't define here.
6463 2000-07-02 Jim Meyering <meyering@lucent.com>
6465 * nanosleep.c (SIGCONT): Define if not already defined.
6467 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6469 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
6470 per change in ../m4/ls-mntd-fs.m4.
6471 (read_filesystem_list): Ignore symbolic links.
6473 2000-06-29 Jim Meyering <meyering@lucent.com>
6475 * same.c: Include <string.h> or <strings.h>, as appropriate,
6476 for declaration of strcmp.
6478 * long-options.c: Include <stdlib.h>, for declaration of exit.
6480 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
6481 Avoid warning by casting result to `char *' to remove `const'.
6483 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6485 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
6487 2000-06-26 Paul Eggert <eggert@twinsun.com>
6489 savedir now sets errno on failure and invokes xmalloc to get memory.
6490 Fix a couple of other minor bugs while we're at it.
6492 * savedir.c (<unistd.h>): Do not include; there's no need.
6493 (NAMLEN): Remove macro.
6494 (malloc, realloc): Remove decls.
6496 ("xalloc.h"): Include.
6497 (NAME_SIZE_DEFAULT): New macro.
6498 (savedir): Use xmalloc / xrealloc to allocate memory.
6499 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
6500 Skip "" directory entries.
6501 Use strlen to calculate directory entry length, since the old method
6502 is rarely used these days and isn't worth supporting.
6503 Don't use a pointer after freeing it.
6504 Check for integer overflow when calculating allocation size.
6505 Use memcpy to copy entries, instead of stpcpy.
6506 Set errno properly when returning NULL.
6507 Check for readdir error.
6509 2000-06-26 Jim Meyering <meyering@lucent.com>
6511 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
6513 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6515 * getusershell.c (xmalloc, xrealloc): Remove functions.
6517 Don't include <stdlib.h>. Don't declare malloc, realloc.
6519 2000-06-23 Bruno Haible <haible@clisp.cons.org>
6521 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
6523 2000-06-24 Jim Meyering <meyering@lucent.com>
6525 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
6527 2000-06-21 Jim Meyering <meyering@lucent.com>
6529 * getpass.c: New file, from Bruno Haible. Required for BeOS.
6531 2000-06-19 Paul Eggert <eggert@twinsun.com>
6533 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
6534 (mbrtowc, mbstate_t): Define substitutes if
6535 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
6536 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
6537 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
6539 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6541 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
6542 than 1024, return a memory chunk of least possible size, instead
6543 of size PATH_MAX + 2. In the loop, increment the size proportionally.
6544 Use free/xmalloc instead of xrealloc to avoid copying for very long
6547 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6549 * canon-host.c (canon_host): Use malloc and memcpy to copy an
6550 address, not strdup. Include <stdlib.h> and don't declare free().
6552 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6554 * path-concat.c (path_concat): Don't access dir[-1] if dir is
6557 2000-06-21 Jim Meyering <meyering@lucent.com>
6559 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
6560 (noinst_HEADERS): Add getstr.h.
6562 * getline.c (getstr): Move into a separate file.
6563 * getstr.c (getstr): New file, extracted from getline.c, with
6564 the following changes: new parameter, delim2; both delim[12]
6565 parameters have type `int', not `char'. The latter would lose
6566 with 8-bit delimiters.
6567 * getstr.h: New file.
6569 2000-06-19 Jim Meyering <meyering@lucent.com>
6571 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
6573 2000-06-18 Jim Meyering <meyering@lucent.com>
6575 * mkdir.c: Remove file, due mainly to copyright incompatibility.
6576 Besides, these days every porting target provides a mkdir function.
6578 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
6579 (this snippet comes from src/system.h).
6581 2000-06-15 Paul Eggert <eggert@twinsun.com>
6583 * human.c (adjust_value): New function.
6584 (human_readable_inexact): Apply rounding style even when
6585 printing approximate values.
6587 2000-06-14 Paul Eggert <eggert@twinsun.com>
6589 * human.c (human_readable_inexact): Allow an input block
6590 size that is not a multiple of the output block size, and vice versa.
6591 Reported by Piergiorgio Sartor.
6593 2000-06-14 Paul Eggert <eggert@twinsun.com>
6595 * getdate.y (get_date): Apply relative times after time
6596 zone indicator, not before. Reported by Todd A. Jacobs.
6598 2000-06-13 Jim Meyering <meyering@lucent.com>
6600 * Makefile.am (all-local): Depend on lstat.c and stat.c.
6602 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
6604 2000-06-12 Paul Eggert <eggert@twinsun.com>
6606 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
6608 2000-06-04 Paul Eggert <eggert@twinsun.com>
6610 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
6612 2000-06-04 Jim Meyering <meyering@lucent.com>
6614 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
6615 SunOS 4.1.4 for which gid_t is an unsigned type.
6617 2000-06-03 Jim Meyering <meyering@lucent.com>
6619 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
6621 2000-05-26 Bruno Haible <haible@clisp.cons.org>
6623 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
6624 newer, don't install charset.alias.
6625 * config.charset: Change the Linux/glibc rules so they become empty
6626 on glibc-2.1 or newer.
6628 2000-06-02 Jim Meyering <meyering@lucent.com>
6630 * mountlist.c: Back out last change. Instead, do this...
6631 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
6632 member using the same `ignore'-testing code.
6633 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
6637 2000-05-29 Jim Meyering <meyering@lucent.com>
6639 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
6640 with the `ignore' attribute. Based on a patch from Mark D. Roth.
6642 2000-05-22 Jim Meyering <meyering@lucent.com>
6644 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
6646 2000-05-18 Jim Meyering <meyering@lucent.com>
6648 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
6649 back, too, since it may have been modified by allocate_entry.
6650 (hash_delete): Rewrite to use neither the assignment operator
6651 nor the comma operator in an if-expression.
6653 2000-05-15 Paul Eggert <eggert@twinsun.com>
6656 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
6657 Remove; no longer needed.
6658 "quotearg.h": Add include.
6659 (file_name): Do not bother to explicitly initialize to NULL; it's less
6660 efficient on some hosts.
6661 (close_stdout_status): Remove test as to whether stdout was already
6662 closed; it breaks for the case "echo x | sort >&-".
6663 Quote file name colons.
6664 Do not assume that _("write error") lacks format strings.
6666 2000-05-15 Jim Meyering <meyering@lucent.com>
6668 * version-etc.c (version_etc_copyright): Update the copyright string
6669 used in all --version output.
6671 2000-05-14 Jim Meyering <meyering@lucent.com>
6673 * closeout.c (close_stdout_set_file_name): New function.
6674 (close_stdout_status): Use new file-scoped global.
6675 Return right away if fstat says the stdout file descriptor is invalid.
6676 * closeout.h (close_stdout_set_file_name): Declare.
6678 2000-05-10 Jim Meyering <meyering@lucent.com>
6680 * closeout.c [default_exit_status]: New file-scoped variable.
6681 (close_stdout_set_status): New function.
6682 * closeout.h (close_stdout_set_status): Declare.
6684 2000-05-08 Jim Meyering <meyering@lucent.com>
6686 * long-options.c: Don't include closeout.h.
6687 (parse_long_options): Don't call close_stdout for --version.
6689 2000-05-06 Jim Meyering <meyering@lucent.com>
6691 * strnlen.c: Undefine __strnlen and strnlen.
6692 [!weak_alias]: Define __strnlen to strnlen.
6694 * atexit.c: New file, from libiberty.
6696 2000-05-06 Jim Meyering <meyering@lucent.com>
6698 * closeout.c (close_stdout_status): Also check for errors on the
6701 2000-05-05 Bruno Haible <haible@clisp.cons.org>
6703 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
6704 instead of xmalloc, xrealloc, path_concat.
6705 (locale_charset): Treat empty environment variables as absent.
6706 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
6708 2000-05-04 Jim Meyering <meyering@lucent.com>
6710 * getopt.c: Update from glibc.
6711 * obstack.c: Likewise.
6712 * obstack.h: Likewise.
6713 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
6715 * regex.h: Likewise.
6716 * strndup.c: Likewise.
6717 * strnlen.c: New file, from glibc.
6719 2000-05-01 Jim Meyering <meyering@lucent.com>
6721 * full-write.c (full_write): Remove `FIXME' part of comment.
6723 2000-04-29 Jim Meyering <meyering@lucent.com>
6725 * path-concat.c: Declare strdup only if it's not defined.
6726 * canon-host.c: Likewise.
6728 2000-04-28 Jim Meyering <meyering@lucent.com>
6730 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
6731 redefinition warning on some systems (HPUX). Otherwise, regex.h is
6732 included first, then limits.h is included by locale.h by libintl.h.
6733 From John David Anglin.
6735 2000-04-25 Jim Meyering <meyering@lucent.com>
6737 * makepath.c (S_IRWXUGO): Define.
6738 (make_path): Always perform explicit chmod if MODE specifies any
6739 of the `special' permission bits. Prompted by a bug report against
6740 install from Mate Wierdl and Joost van Baal.
6742 2000-04-18 Jim Meyering <meyering@lucent.com>
6746 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
6747 getpagesize. For BeOS. Based on a patch from Bruno Haible.
6749 2000-04-17 Jim Meyering <meyering@lucent.com>
6751 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6752 the definition of it to rpl_strftime also defined-away the system's
6755 2000-04-15 Jim Meyering <meyering@lucent.com>
6757 Use `C' to denote so-called `contiguous' files, the same way
6759 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6760 (ftypelet): Use S_ISCTG.
6761 From Michael Deutschmann.
6763 2000-04-14 Jim Meyering <meyering@lucent.com>
6765 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6767 2000-04-08 Jim Meyering <meyering@lucent.com>
6769 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6770 names don't conflict. Reported by Eli Zaretskii.
6772 2000-03-28 Bruno Haible <haible@clisp.cons.org>
6774 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6775 bug. Deal with the different error behavior of Irix iconv.
6777 2000-04-07 Jim Meyering <meyering@lucent.com>
6779 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6780 to work around system header problems on AIX 3.2.5. From Bruno Haible.
6782 2000-04-05 Jim Meyering <meyering@lucent.com>
6784 Portability tweaks required for ultrix4.3.
6785 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6786 * readutmp.c: Include sys/types.h before sys/stat.h.
6787 * canon-host.c: Declare strdup.
6788 * path-concat.c: Likewise.
6789 From John David Anglin.
6791 2000-04-04 Jim Meyering <meyering@lucent.com>
6793 Be more DOS 8.3-friendly.
6794 * ref-add.sin: Renamed from ref-add.sed.in.
6795 * ref-del.sin: Renamed from ref-del.sed.in.
6796 * Makefile.am: Reflect renaming.
6797 Reported by Eli Zaretskii.
6799 Use a temporary file name that won't clash with `charset.alias'
6800 in the DOS 8.3 name space.
6801 * Makefile.am (charset_tmp): Define.
6802 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
6803 (uninstall-local): Likewise.
6804 Reported by Eli Zaretskii.
6806 2000-03-29 Paul Eggert <eggert@twinsun.com>
6808 * time/strftime.c (my_strftime): Make sure we call the system
6809 strftime, not ourselves, when invoking the underlying strftime.
6811 2000-03-24 Jim Meyering <meyering@lucent.com>
6813 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
6814 (charset_alias): Define.
6815 (install-exec-local): Factor out common code.
6816 (uninstall-local): Split lines longer than 80.
6817 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
6819 (.sed.in.sed): New rule. Don't redirect directly to $@.
6820 (CLEANFILES): Add ref-add.sed and ref-del.sed.
6822 2000-03-19 Bruno Haible <haible@clisp.cons.org>
6824 * config.charset: Output a line containing "Packages using this file".
6825 * ref-add.sed.in, ref-del.sed.in: New files.
6826 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
6827 ref-del.sed): New rules.
6829 2000-03-17 Jim Meyering <meyering@lucent.com>
6831 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
6832 Otherwise, include <strings.h>
6834 2000-03-17 Bruno Haible <haible@clisp.cons.org>
6836 * unicodeio.c (utf8_wctomb): New function.
6837 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
6838 format instead of in UCS-4 with platform dependent endianness.
6840 2000-03-07 Paul Eggert <eggert@twinsun.com>
6842 * savedir.c (savedir): Work even if directory size is
6843 negative; this can happen with some screwy NFS configurations.
6845 2000-03-06 Jim Meyering <meyering@lucent.com>
6847 * localcharset.c (get_charset_aliases): Don't try to free file_name
6848 if it's NULL (because we ran out of memory). From Bruno Haible.
6850 2000-03-05 Jim Meyering <meyering@lucent.com>
6852 * localcharset.c ("path-concat.h"): Include.
6853 (get_charset_aliases): Use path_concat instead of ANSI string
6856 * unicodeio.h (PARAMS): Define.
6857 Use it to guard prototype.
6859 2000-03-04 Jim Meyering <meyering@lucent.com>
6861 * Makefile.am (install-exec-local): Create $(libdir) before installing
6863 (uninstall-local): Uncomment this rule so `make distcheck' works
6866 * unicodeio.c (<errno.h>): Include it.
6867 (errno): Declare if not defined.
6869 * localcharset.c: Add Bruno's comment justifying use of volatile.
6871 * config.charset: New version, incorporating remarks from a linux
6872 i18n mailing list. From Bruno Haible.
6874 2000-03-02 Jim Meyering <meyering@lucent.com>
6876 * Makefile.am (EXTRA_DIST): Add config.charset.
6878 2000-03-01 Jim Meyering <meyering@lucent.com>
6880 * localcharset.c: Guard some #includes with `#if HAVE_...'.
6881 * unicodeio.c: Likewise.
6883 2000-02-02 Bruno Haible <haible@clisp.cons.org>
6885 * config.charset: New file.
6886 * localcharset.c: New file.
6887 * unicodeio.h, unicodeio.c: New files.
6888 * Makefile.am (DEFS): Add -DLIBDIR=...
6889 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
6890 (noinst_HEADERS): Add unicodeio.h.
6891 (all-local, install-exec-local, charset.alias): New targets.
6893 2000-02-28 Paul Eggert <eggert@twinsun.com>
6895 * quotearg.c (ALERT_CHAR): New macro.
6896 (quotearg_buffer_restyled): Use it.
6898 2000-02-27 Jim Meyering <meyering@lucent.com>
6900 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
6901 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
6903 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
6904 not `#if STDC_HEADERS'.
6905 Declare malloc if needed.
6907 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
6908 now that autoconf always defines the HAVE_DECL_ symbols.
6909 * human.c: Likewise.
6911 * strtoumax.c: Likewise.
6913 * backupfile.c: Arrange for cpp to fail if the configure-time
6914 declaration check was not run.
6916 * human.c: Likewise.
6918 * strtoumax.c: Likewise.
6920 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
6921 then first look up the entire `.'-containing string as a login name.
6923 2000-02-18 Paul Eggert <eggert@twinsun.com>
6925 * getdate.y: Handle two-digit years with leading zeros correctly.
6926 (textint): New typedef.
6927 (parser_control): Member year changed from int to textint.
6929 (YYSTYPE): Removed; replaced by %union with int and textint members.
6930 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
6931 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
6932 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
6933 (tSNUMBER, tUNUMBER): Now of type <textintval>.
6934 (date, number, to_year): Use width of number in digits, not its value,
6935 to determine whether it's a 2-digit year, or a 2-digit time.
6936 (yylex): Store number of digits of numeric tokens.
6937 Reported by John Kendall.
6939 (parser_control): Changed from struct parser_control to typedef (for
6940 consistency). All uses changed.
6942 (tID): Removed; not used.
6943 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
6945 2000-02-14 Paul Eggert <eggert@twinsun.com>
6947 * getpagesize.h (getpagesize): Port to VMS for Alpha;
6948 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
6950 2000-02-12 Jim Meyering <meyering@lucent.com>
6952 * userspec.c (ISDIGIT): Define it.
6953 (isdigit): Remove definition.
6954 (is_number): Use ISDIGIT, not isdigit.
6955 <libintl.h>: Include.
6957 (parse_user_spec): Mark translatable strings.
6959 2000-02-10 Jim Meyering <meyering@lucent.com>
6961 With these changes, nanosleep.[ch] are finally enough like the other
6962 lib/* replacement files to compile on a few more losing systems.
6964 * nanosleep.h: Don't include config.h.
6965 Remove prototype from declaration of nanosleep.
6966 (PARAMS): Remove now-unneeded definition.
6967 * nanosleep.c: #undef nanosleep.
6968 (rpl_nanosleep): Rename from nanosleep.
6970 2000-02-03 Jim Meyering <meyering@lucent.com>
6972 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
6973 rather than with `#if HAVE_UTMPNAME'.
6975 2000-02-01 Jim Meyering <meyering@lucent.com>
6977 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
6979 2000-01-31 Jim Meyering <meyering@lucent.com>
6981 * nanosleep.h (nanosleep): Guard declaration with
6982 `#if ! HAVE_DECL_NANOSLEEP'.
6983 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
6984 the declaration in that vendor's sys/timers.h.
6985 Reported by Christian Krackowizer.
6987 * quotearg.c (ISASCII): Add #undef and move definition to follow
6988 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
6989 (ISPRINT): Likewise.
6990 Reported by Tom Tromey.
6992 2000-01-30 Jim Meyering <meyering@lucent.com>
6994 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
6995 uses of ->ut_name. The latter doesn't work with new Linux header files
6996 where only utmpx.ut_user is declared.
6998 * readutmp.h (UT_USER): Define.
7000 2000-01-23 Jim Meyering <meyering@lucent.com>
7002 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
7005 2000-01-22 Jim Meyering <meyering@lucent.com>
7007 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
7008 [! HAVE_DECL_STRTOULL]: Declare strtoull.
7009 Required for some AIX systems. Reported by Christian Krackowizer.
7010 [TESTING] (main): New function.
7012 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
7013 * dirname.c (dir_name): Support for DOS-style file names with drive
7016 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
7018 * strverscmp.c (ISDIGIT): Define.
7019 (strverscmp): Use ISDIGIT, not isdigit.
7021 2000-01-17 Paul Eggert <eggert@twinsun.com>
7023 * nanosleep.c (nanosleep):
7024 Don't use SA_INTERRUPT to decide whether to call sigaction, as
7025 POSIX.1 doesn't require SA_INTERRUPT and some systems
7026 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
7027 it's been part of POSIX.1 since day 1 (in 1988).
7029 2000-01-17 Jim Meyering <meyering@lucent.com>
7031 * interlock: Remove unused file. Reported by François Pinard.
7033 2000-01-16 Paul Eggert <eggert@twinsun.com>
7035 * quotearg.c (quotearg_buffer_restyled): Do not quote
7036 alert, backslash, formfeed, and vertical tab unnecessarily in
7037 shell quoting style.
7040 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
7041 Free Software Foundation, Inc.
7042 Copying and distribution of this file, with or without modification,
7043 are permitted provided the copyright notice and this notice are preserved.