1 2005-08-16 Bruno Haible <bruno@clisp.org>
3 * tls.h: New file, from GNU gettext.
4 * tls.c: New file, from GNU gettext.
6 2005-08-15 Bruno Haible <bruno@clisp.org>
8 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
11 2005-08-14 Jim Meyering <jim@meyering.net>
15 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
16 Use the hash-table-based cycle-detection code not just when
17 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
18 Reported by James Youngman in
19 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
20 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
21 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
22 This lets us compile with -DFTS_DEBUG, once again.
23 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
24 * fts.c (fd_safer): Remove decl.
25 Include fcntl--.h rather than unistd-safer.h
26 (fts_safe_changedir): Don't call fd_safer; no longer needed
27 now that we include fcntl--.h.
29 2005-08-11 Simon Josefsson <jas@extundo.com>
31 * readline.h, readline.c: New file.
33 2005-08-11 Bruno Haible <bruno@clisp.org>
35 * strnlen.h (strnlen): Change parameter name to match comment.
37 2005-08-10 Simon Josefsson <jas@extundo.com>
39 * strndup.c: Use strnlen.h.
41 * strnlen.h: New file.
43 2005-08-02 Simon Josefsson <jas@extundo.com>
45 * getline.h, getline.c: Rewrite.
47 * getdelim.h, getdelim.c: New files, ported from glibc.
49 2005-07-31 Bruno Haible <bruno@clisp.org>
51 * lock.h (gl_lock_initializer): New macro.
52 (gl_lock_define_initialized): Use it.
53 (gl_rwlock_initializer): New macro.
54 (gl_rwlock_define_initialized): Use it.
55 (gl_recursive_lock_initializer): New macro.
56 (gl_recursive_lock_define_initialized): Use it.
58 2005-07-26 Bruno Haible <bruno@clisp.org>
60 * lock.h: Update from GNU gettext.
61 * lock.c: Update from GNU gettext.
63 2005-07-18 Bruno Haible <bruno@clisp.org>
65 * lock.h (gl_once_t): New type.
66 (gl_once_define, gl_once): New macros.
67 * lock.c (fresh_once): New variable.
68 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
71 2005-07-18 Simon Josefsson <jas@extundo.com>
73 * check-version.c (check_version): Accept identical versions too.
75 2005-07-18 Bruno Haible <bruno@clisp.org>
77 * lock.h: New file, from GNU gettext.
78 * lock.c: New file, from GNU gettext.
80 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
82 * quotearg.c: Add translator comment suggested by Bruno Haible,
85 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
87 * version-etc-fsf.c (version_etc_copyright): Parameterize the
88 copyright symbol and the year.
89 * version-etc.c (COPYRIGHT_YEAR): New constant.
90 (version_etc_va): Use parameterized copyright notice.
91 Reword to conform to the current GNU coding standards.
93 2005-07-11 Simon Josefsson <jas@extundo.com>
95 * size_max.h: New file.
97 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
99 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
102 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
103 and Paul Eggert <eggert@cs.ucla.edu>
105 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
106 in wint_t, not wchar_t. Remove now-unnecessary cast.
108 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
110 * regex.c, regex.h: Sync from libc.
111 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
112 New files, synced from libc, except that regex_internal.h
113 currently has a small porting fix.
115 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
117 Remove the dependency of the strftime module on the tzset module.
118 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
119 Copy the input structure, to work around some of the bug with
120 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
121 Solaris releases, you should also use the tzset module, but we won't
122 require it as a dependency any more since we don't want LGPLed code
123 to depend on GPLed code.
125 2005-07-02 Jim Meyering <jim@meyering.net>
127 * backupfile.c (backup_args): Change a `0' to NULL.
129 2005-07-01 Jim Meyering <jim@meyering.net>
131 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
132 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
133 * save-cwd.c, tempname.c:
134 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
135 and don't include <sys/file.h>).
137 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
139 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
140 declares only 'struct timespec;' (!).
142 2005-06-29 Jim Meyering <jim@meyering.net>
144 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
145 type name. Use the variable name instead.
146 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
148 2005-06-28 Simon Josefsson <jas@extundo.com>
150 * check-version.h, check-version.c: New files.
152 2005-06-28 Simon Josefsson <jas@extundo.com>
154 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
155 collision with global variable. Better indentation. Don't
156 increment buffer pointer beyond buffer end. Based on comments
157 from Paul Eggert <eggert@cs.ucla.edu>.
161 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
163 * canon-host.c (canon-host): Append trailing "," to 0 in
164 initializer of struct addrinfo, as an indication that we don't
165 care how many members the structure has.
167 2005-06-24 Derek Price <derek@ximbiot.com>
168 and Bruno Haible <bruno@clisp.org>
170 Remove stat module & update lstat.
171 * stat.c: Remove this file...
172 (slash_aware_lstat): ...moving this content and its support...
173 * lstat.c (rpl_lstat): ...into here.
176 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
178 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
179 (ranged_convert): Don't save conversion in a temporary struct.
180 This causes a warning with GCC 4.0.0, and anyway in the typical
181 case it's not worth the extra 100 bytes or so of code.
182 (ranged_convert, __mktime_internal): When calling a function via a
183 pointer P, use P () rather than (*P) (), as we now assume C89 or
186 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
188 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
189 "who -r" failed to give output. Problem reported by Tim Waugh.
191 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
192 (xcalloc): Use it to avoid needless tests.
193 Problem reported by Jim Meyering.
195 2005-06-16 Jim Meyering <jim@meyering.net>
197 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
198 when either N or S is zero.
200 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
202 * argp.h (__option_is_short): Check upper limit of
203 __key. Isprint() requires its argument to have the value
204 of an unsigned char or EOF.
206 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
208 * fnmatch.c (fnmatch): If there is an encoding error in a
209 multibyte string or pattern, fall back on unibyte matching.
210 Problem reported by James Youngman.
212 2005-06-08 Bruno Haible <bruno@clisp.org>
214 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
217 2005-06-08 Bruno Haible <bruno@clisp.org>
219 * csharpcomp.h: New file, from GNU gettext.
220 * csharpcomp.c: New file, from GNU gettext.
221 * csharpcomp.sh.in: New file, from GNU gettext.
223 2005-06-07 Derek Price <derek@ximbiot.com>
226 * glob_.h: Indent nested #ifdef.
228 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
231 Use "file name" when talking about file names, instead of "filename"
232 or "path", as per the GNU coding standards.
233 * mkdir-p.c: Renamed from makepath.c.
234 (make_dir_parents): Renamed from make_path. All callers changed.
235 * mkdir-p.h: Likewise. All includers changed.
236 * filenamecat.c: Renamed from path-concat.c.
237 (file_name_concat): Renamed from path_concat. All callers changed.
238 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
239 * filenamecat.h: Likewise. All includers changed.
240 * acl.c: Don't use "path" or "filename" to mean "file name"
241 in comments or local variable names.
242 * basename.c: Likewise.
243 * canonicalize.c, canonicalize.h: Likewise.
244 * dirname.c, dirname.h: Likewise.
245 * euidaccess.c: Likewise.
246 * exclude.c: Likewise
247 * fnmatch_.h, fnmatch_loop.c: Likewise.
248 * fsusage.c, fsuage.h: Likewise.
249 * fts.c, fts_.h: Likewise.
250 * getcwd.c: Likewise.
251 * getloadavg.c: Likewise.
252 * mkstemp.c: Likewise.
253 * mountlist.c, mountlist.h: Likewise.
254 * openat.c, openat.h: Likewise.
255 * readlink-stub.c: Likewise.
256 * readutmp.c, readutmp.h: Likewise.
257 * rename.c: Likewise.
260 * savedir.c: Likewise.
261 * stripslash.c: Likewise.
262 * tempname.c: Likewise.
263 * xreadlink.c: Likewise.
264 * exclude.c (excluded_file_name): Renamed from excluded_filename.
266 * exclude.h: Likewise.
268 * euidaccess.c (getuid, getgid, getuid, getegid)
269 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
270 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
271 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
272 * pathmax.h: Include <limits.h> unconditionally, since other
273 files have been getting away with it for years (MORE/BSD 4.3
275 * userspec.c (getpwnam, getgrnam, getgrgid)
276 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
278 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
279 Define to 256, not 255, as per modern POSIX.
281 2005-06-01 Bruno Haible <bruno@clisp.org>
283 * csharpexec.h: New file, from GNU gettext.
284 * csharpexec.c: New file, from GNU gettext.
285 * csharpexec.sh.in: New file, from GNU gettext.
287 2005-05-31 Derek Price <derek@ximbiot.com>
288 Paul Eggert <eggert@cs.ucla.edu>
291 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
293 2005-05-29 Derek Price <derek@ximbiot.com>
294 Paul Eggert <eggert@cs.ucla.edu>
296 * glob_.h, glob.c: New files.
298 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
300 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
302 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
303 the configuration hassle isn't worth it.
304 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
305 (LONGEST_MODIFIER, PRIuMAX): Remove.
307 2005-05-27 Bruno Haible <bruno@clisp.org>
309 * getlogin_r.h: Remove second include of <stddef.h>.
311 2005-05-25 Bruno Haible <bruno@clisp.org>
312 Derek Price <derek@ximbiot.com>
314 * getlogin_r.h: Simplify API documentation.
316 2005-05-25 Derek Price <derek@ximbiot.com>
317 Paul Eggert <eggert@cs.ucla.edu>
319 * getlogin_r.c, getlogin_r.h: New files.
321 2005-05-22 Bruno Haible <bruno@clisp.org>
323 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
324 Also include <sys/param.h> if it defines MIN, MAX.
325 Based on a patch by Derek Price <derek@ximbiot.com>.
327 2005-05-22 Bruno Haible <bruno@clisp.org>
329 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
330 (INT64_MIN): Fix definition.
331 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
333 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
334 NEED_SIGNED_INT_TYPES.
336 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
337 HAVE_SYSTEM_INTTYPES.
339 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
341 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
342 so that unistd-safer.h (GPL'ed code) need not be included.
344 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
347 * fts.c: Don't include "cycle-check.h" or "hash.h".
348 (setup_dir, free_dir): New functions.
349 (enter_dir, leave_dir): Define trivial
350 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
351 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
352 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
353 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
355 (fts_open): Use setup_dir.
356 (fts_close): Use free_dir.
357 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
358 This adds a label and some gotos, but the alternatives were messier.
359 Check for memory allocation failure when entering a dir.
360 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
361 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
362 (FTS): New member fts_cycle, that is a union that contains the
363 old active_dir_ht and cycle_state. All uses changed to mention
364 fts_cycle.ht and fts_cycle.state.
365 * fts-cycle.c: New file, containing GPL'ed code migrated out of
366 fts.c, with the following changes:
367 (setup_dir, free_dir): New functions.
368 (enter_dir): Now returns bool. Return true if successful, false
369 if memory exhausted. All callers changed.
370 Do not bother partly cleaning up on
371 memory allocation failure; that is free_dir's job.
372 However, free ad if hash_insert fails, to avoid memory leak.
373 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
374 fts->fts_options to see which union member to use.
376 2005-05-20 Jim Meyering <jim@meyering.net>
378 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
379 Now a macro, to pacify GCC.
381 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
383 * chown.c (rpl_chown): Return -1 on failure.
385 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
387 * canonicalize.c: Include canonicalize.h first, to test interface.
388 Include <stddef.h> unconditionally, since we assume C89 now.
389 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
390 * fts.c: Include fts_.h first, to check interface.
391 Do not include intprops.h; no longer needed.
392 Include cycle-check.h and hash.h, since fts_.h no longer does.
393 Remove unnecessary casts of closedir to void.
394 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
395 decide whether to decrement nlinks.
396 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
397 (FTS): Use struct hash_table * instead of Hash_table, so that
398 we no longer need to include hash.h here.
400 2005-05-17 Jim Meyering <jim@meyering.net>
402 * fts.c, fts_.h: New files, from coreutils.
404 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
407 * unlinkdir.c, unlinkdir.h: New files.
408 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
409 regex.h, unlocked-io.h, xtime.h:
410 White space changes only.
411 * makepath.c (make_path): Port to hosts where leading "//" is special.
412 * yesno.c: Include getline.h, not ctype.h.
413 (yesno): Don't remove leading white space; POSIX doesn't allow it.
414 Use getline to remove arbitrary restriction on response length.
416 2005-05-13 Bruno Haible <bruno@clisp.org>
418 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
419 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
420 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
421 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
422 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
423 Add support for 64-bit integers in the MSVC compiler.
425 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
427 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
428 Change the initial comment to refer to GPL, not LGPL.
429 gnulib-tool will change it to LGPL as needed.
431 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
432 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
433 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
434 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
435 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
436 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
437 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
438 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
439 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
440 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
441 concatpath.c, config.charset, copy-file.c, copy-file.h,
442 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
443 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
444 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
445 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
446 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
447 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
448 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
449 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
450 full-read.c, full-read.h, full-write.c, full-write.h,
451 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
452 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
453 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
454 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
455 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
456 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
457 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
458 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
459 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
460 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
461 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
462 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
463 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
464 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
465 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
466 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
467 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
468 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
469 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
470 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
471 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
472 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
473 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
474 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
475 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
476 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
477 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
478 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
479 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
480 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
481 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
482 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
483 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
484 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
485 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
486 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
487 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
488 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
489 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
490 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
491 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
492 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
493 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
494 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
495 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
496 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
497 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
498 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
499 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
500 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
501 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
502 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
503 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
504 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
505 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
506 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
507 Update FSF postal mail address.
509 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
511 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
512 specified in ai_socktype. Fix invalid ai_protocol
513 check. ai_protocol is usually set to 0 or depending on
514 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
515 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
516 ai_socktype / ai_protocol in the returned addrinfo structure.
518 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
519 Bruno Haible <bruno@clisp.org>
521 * inet_ntop.h: New file.
522 * inet_ntop.c: New file, from glibc with modifications.
524 2005-05-08 Jim Meyering <jim@meyering.net>
526 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
528 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
530 Merge from coreutils. Among other things,
531 add bulletproofing for cases where stdin, stdout, or stderr are closed.
532 * fd-safer.c: New file.
533 * fcntl-safer.h, open-safer.c: Remove.
534 * chdir-long.c: Fix comment "fetish" -> "coreutils".
535 * dup-safer.c: Include unistd-safer.h first.
536 Don't include errno.h.
537 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
538 * file-type.h: Don't assume invoker included sys/stat.h first.
539 * file-type.c: Rely on file-type.h change.
540 * getloadavg.c: Include unistd-safer.h.
541 (getloadavg): Use safer open.
542 * getusershell.c: Include "stdio-safer.h".
543 (getusershell): Use safer fopen.
544 * long-options.c (long_options): Use NULL rather than 0.
545 * modechange.h (mode_free): Remove; all callers changed to invoke
547 * modechange.c: Likewise.
548 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
549 (MODE_DONE): New constant.
550 (struct mode_change): Remove 'next' member.
551 (make_node_op_equals): New function; like the old one of the
552 same name, except it allocates an array.
553 (mode_compile, mode_create_from_ref): Use it.
554 (mode_compile): Allocate result as an array, not a linked list.
555 Parse octal string ourself, so that we catch mistakes like "+0".
556 (mode_adjust): Arg is an array, not a linked list.
557 * modechange.c: Include stat-macros.h, xalloc.h.
558 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
559 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
560 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
561 Remove. This is now stat-macros.h's job.
562 (talloc): Remove. All callers replaced by xalloc, so that
563 our invokers don't have to worry about reporting memory failures.
564 (make_node_op_equals): Remove.
565 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
567 (struct mode_change): Moved here from modechange.h.
568 (mode_append_entry): Remove.
569 (mode_compile): Remove MASKED_OPS arg, since it encouraged
570 apps to have incorrect behavior. Use simpler algorithm for head
571 and tail. Don't futz with umask; that's now the job of mode_adjust.
572 Detect more invalid usages rather than having somewhat-random behavior.
573 Don't insert an "a=" action, as that leads to incorrect behavior.
574 (mode_compile, mode_create_from_ref): Return NULL on error instead
575 of an enum, since now there's only one way to have an error. All
577 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
578 at the correct time. Simplify calculation of "+u" and its ilk.
579 Don't mishandle "+X".
580 (mode_free): Remove "register" and localize decls.
581 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
582 (struct mode_change): Move to modechange.c; callers don't
583 need to see this stuff.
584 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
585 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
586 (mode_change, mode_adjust): Reflect the new signatures noted above.
587 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
588 that might redefine system include files.
589 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
590 (my_usleep): Use NULL rather than (void *) 0.
591 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
592 Use siginterrupt to specify that system calls should be interrupted.
593 (rpl_nanosleep): Move initialization of suspended closer to call of
595 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
596 * readutmp.c: Likewise. Include signal.h, stdbool.h.
597 (desirable_utmp_entry): New function.
598 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
599 using x2nrealloc, to simplify logic.
600 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
601 size calculation. Do not assume utmp file is a regular file.
602 * readutmp.h (UT_PID): Moved here from ../src/who.c.
603 (READ_UTMP_CHECK_PIDS): New constant.
604 * save-cwd.c: Include unistd-safer.h.
605 (save_cwd): Use fd_safer.
606 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
607 [!_LIBC] Include "stat-macros.h" instead.
608 * unistd-safer.h (fd_safer): New decl.
610 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
612 * byteswap_.h: New file.
614 2005-04-25 Albert Chin <china@thewrittenword.com>
616 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
619 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
621 * getdate.y (zone): Allow relunit_snumber after tZONE, so
622 that "UTC +1 second" continues to work. Problem reported
624 (relunit_snumber): New rule.
627 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
629 * getdate.y (universal_time_zone_table): New constant.
630 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
631 universal_time_zone_table.
632 (lookup_zone): Prefer universal_time_zone_table to
633 local_time_zone_table, so that "GMT" time stamps are allowed in
634 London during the summer. Problem reported by Ian Abbott.
636 2005-04-12 Jim Meyering <jim@meyering.net>
638 * human.c (humblock): Set *options even when returning due to
639 xstrtoumax conversion failure. Thanks to a used-uninitialized
642 2005-04-09 Jim Meyering <jim@meyering.net>
644 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
645 -Wuninitialized: initialize tm0.tm_year.
647 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
649 * getdate.y (parser_control): rels_seen is now a boolean, not a
650 count, since there's no maximum. All uses changed.
651 Add member dsts_seen.
652 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
654 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
655 Use pc_rels_seen to decide whther a date is absolute.
657 * getdate.y (number): Don't overwrite year.
658 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
661 2005-04-02 Simon Josefsson <jas@extundo.com>
663 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
664 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
666 2005-03-27 Jim Meyering <jim@meyering.net>
668 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
670 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
672 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
673 "one's complement" -> "ones' complement" in comment, as per Knuth.
674 "value of type" -> "type or expression" in comment.
675 * mktime.c, strftime.c: Propagate intprops.h comment nits.
677 2005-03-26 Jim Meyering <jim@meyering.net>
680 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
681 Correct typos: s/or/of/.
683 2005-03-23 Jim Meyering <jim@meyering.net>
685 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
687 2005-03-21 Jim Meyering <jim@meyering.net>
689 Changes imported from coreutils.
691 * cycle-check.c: Don't include xalloc.h.
693 * path-concat.c: Don't include assert.h.
694 (path_concat): Remove assertion that would have triggered
695 for ABASE starting with more than one slash.
696 Reported by Andreas Schwab.
698 * path-concat.c (path_concat): Set *BASE_IN_RESULT
699 properly when ABASE is an absolute file name.
700 Correct the description of this function.
702 Add an assertion and a test driver.
703 This fixes a bug introduced on 2004-07-02.
704 Andreas Schwab reported the resulting failure of cp --parents:
705 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
707 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
709 * strftime.c (my_strftime): If the underlying strftime returns 0
710 (which shouldn't happen), generate nothing instead of returning 0
711 immediately, so that nstrftime (NULL, ...) doesn't return 0.
713 2005-03-16 Bruno Haible <bruno@clisp.org>
715 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
717 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
719 * strftime.c (my_strftime): Prepend space to format so that we can
720 reliably distinguish strftime failure from empty output on POSIX
723 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
725 * iconvme.c (SIZE_MAX): New macro, if not already defined.
726 (iconv_string): Don't guess a size-zero buffer, as that might cause
727 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
728 result would be 'too large', where 'too large' is (heuristically)
729 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
730 overflow concerns. This will prevent some unwanted malloc failures
731 when the inputs are very large.
733 2005-03-15 Bruno Haible <bruno@clisp.org>
735 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
738 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
741 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
743 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
745 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
746 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
748 * strtol.c: Likewise.
750 2005-03-14 Simon Josefsson <jas@extundo.com>
752 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
755 2005-03-14 Jim Meyering <jim@meyering.net>
757 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
758 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
759 to be nonzero so that we (and caller) can detect the difference
760 between a valid zero-length expansion and an error return, even
761 when the underlying strftime fails before writing anything into
764 2005-03-10 Jim Meyering <jim@meyering.net>
766 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
767 so that this module works on systems without fchdir.
769 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
771 Factor int-properties macros into a single file, except for
773 * intprops.h: New file.
774 * getloadavg.c: Include it instead of limits.h.
775 (INT_STRLEN_BOUND): Remove.
776 * human.c: Include intprops.h.
777 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
778 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
779 * inttostr.h: Include intprops.h instead of limits.h.
780 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
781 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
782 for consistency with intprops.h.
783 (time_t_is_integer, twos_complement_arithmetic): Use them.
784 * sig2str.h: Include <signal.h>, intprops.h.
785 (INT_STRLEN_BOUND): Remove.
786 * strftime.c (TYPE_SIGNED): Remove.
787 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
788 * strtol.c: Adjust comments to match intprops.h.
789 * userspec.c: Include intprops.h.
790 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
791 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
792 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
793 instead of rolling our own expressions.
794 * xstrtol.c: Include xstrtol.h first, to test interface.
796 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
798 (my_strftime): Do not mishandle years close to INT_MAX, by doing
799 the right thing even if adding 1900 would overflow. Similarly
800 for tm_mon + 1 and tm_yday + 1.
801 Make %Y always equivalent to %C%y, and similarly for %G and %g.
802 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
803 (DO_SIGNED_NUMBER): New macro.
804 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
806 2005-03-07 Bruno Haible <bruno@clisp.org>
808 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
810 2005-03-03 Derek R. Price <derek@ximbiot.com>
811 Bruno Haible <bruno@clisp.org>
813 * pagealign_alloc.h: New file.
814 * pagealign_alloc.c: New file.
816 2005-01-28 Bruno Haible <bruno@clisp.org>
818 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
821 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
823 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
824 The workaround isn't strictly needed for POSIX conformance, and
825 it's too much of a pain to configure and maintain. We'll ask
826 people to fix their kernels instead.
827 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
828 (NANOSLEEP_BUG_WORKAROUND): Remove.
829 (xnanosleep): Remove the workaround.
831 2005-02-12 Bruno Haible <bruno@clisp.org>
833 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
835 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
837 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
838 * timespec.h (gettime): Return void, since it always
839 succeeds now. All uses changed.
840 * gettime.c (gettime) Likewise.
841 [HAVE_NANOTIME]: Prefer nanotime.
842 Assume gettimeofday succeeds, as POSIX requires.
843 Assime time () succeeds, since other code already does.
844 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
845 (timespec_subtract): Remove.
846 (NANOSLEEP_BUG_WORKAROUND): New constant.
847 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
848 things considerably. Use it only on GNU/Linux hosts, since the
849 workaround shouldn't be needed elsewhere.
851 2005-02-24 Bruno Haible <bruno@clisp.org>
853 * gettext.h: Update from GNU gettext 0.14.2.
855 2005-02-24 Bruno Haible <bruno@clisp.org>
857 * localcharset.c: Update from GNU gettext 0.14.2.
858 * config.charset: Update from GNU gettext 0.14.2.
860 2005-02-22 Simon Josefsson <jas@extundo.com>
862 * iconvme.h, iconvme.c: New files, from libc.
864 2005-02-20 Neil Conway <neilc@samurai.com>
866 * xgethostname.c (xgethostname): Check for ENOMEM, which is
867 returned by OSX/Darwin if the specified buffer is not large
868 enough for the hostname.
870 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
872 * memrchr.h: New file.
873 * chdir-long.c: Include it.
874 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
875 Don't bother including stddef.h.
877 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
879 * argp-help.c (__argp_help): Create a fake struct argp_state and
880 pass it to _help, otherwise the latter coredumps trying to
881 dereference state.root_argp.
883 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
885 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
887 Include <sys/types.h>, for dev_t.
888 (ME_DUMMY, ME_REMOTE): Move from here....
889 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
890 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
892 Include mountlist.h first, to test the interface.
894 2005-01-29 Bruno Haible <bruno@clisp.org>
896 * progname.c (program_name): Initialize.
897 Needed when linking statically on MacOS X.
899 2005-01-28 Bruno Haible <bruno@clisp.org>
901 * javacomp.sh.in: New file, from GNU gettext.
902 * javacomp.h: New file, from GNU gettext.
903 * javacomp.c: New file, from GNU gettext.
905 2005-01-26 Bruno Haible <bruno@clisp.org>
907 * javaexec.sh.in: New file, from GNU gettext.
908 * javaexec.h: New file, from GNU gettext.
909 * javaexec.c: New file, from GNU gettext.
911 2005-01-26 Simon Josefsson <jas@extundo.com>
913 * gai_strerror.c: Use GPL in header.
915 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
917 * argp-help.c (hol_entry_help): Avoid using non-constant
918 initializers for struct pentry_state.
919 (__argp_error): Check return value of __asprintf
920 (__argp_failure): Translate error message
922 * argp-parse.c: Removed braces around the expansion of N_()
924 2005-01-21 Jim Meyering <jim@meyering.net>
926 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
927 same value as for Solaris 9.
929 * chdir-long.c (chdir_long): Rewrite to remove limitation on
930 component length. This included changing the parameter to be
931 of type `char *' rather than `char const *'.
932 * chdir-long.h (chdir_long): Update prototype.
934 * openat.c (fdopendir, fstatat): New functions.
935 * openat.h: Include headers required for use of DIR and struct stat.
936 [AT_SYMLINK_NOFOLLOW]: Define.
937 (fdopendir, fstatat): Add prototypes.
939 2005-01-21 Bruno Haible <bruno@clisp.org>
941 * classpath.h: New file, from GNU gettext.
942 * classpath.c: New file, from GNU gettext.
944 2005-01-20 Simon Josefsson <jas@extundo.com>
946 * version-etc-fsf.c: New file, with version_etc_copyright.
947 * version-etc.c: Remove version_etc_copyright.
948 * version-etc.h (version_etc_copyright): Use [] instead of * in
949 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
951 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
953 * save-cwd.c (save_cwd): Remove code to support the case
954 where fchdir is missing or flaky.
956 2005-01-20 Simon Josefsson <jas@extundo.com>
958 * base64.h (isbase64): Add.
960 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
961 using a unsigned prototype, don't inline.
962 (base64_decode): Use it.
964 2005-01-19 Bruno Haible <bruno@clisp.org>
966 * sh-quote.h: New file, from GNU gettext.
967 * sh-quote.c: New file, from GNU gettext.
969 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
971 Merge changes from coreutils, as described below in several
972 changelogs dated today.
974 * save-cwd.c: Include "save-cwd.h" before other include files.
975 (O_DIRECTORY): Remove; not needed here, since "." must be
976 a directory. All uses removed.
977 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
978 universal on Suns, and we also need to test for IRIX.
979 Revamp code to use 'if' rather than '#if'.
980 Avoid unnecessary comparison of cwd->desc to 0.
982 * utimens.c (futimens): Robustify the previous patch, by checking
983 for known valid error numbers rather than observed invalid ones.
985 2005-01-18 Jim Meyering <jim@meyering.net>
987 * version-etc.c (version_etc_copyright): Update copyright date.
989 * utimens.c (futimens): Account for the fact that futimes
990 can also fail with errno == ENOSYS or errno == ENOENT.
991 Patch from Dmitry V. Levin.
993 Change the name of the robust chdir function from chdir to chdir_long.
994 * save-cwd.c: Include chdir-long.h rather than chdir.h.
995 (restore_cwd): Use chdir_long, not chdir.
996 * chdir-long.c: Renamed from chdir.c.
997 * chdir-long.h: Renamed from chdir.h.
998 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
1001 2005-01-18 Bob Proulx <bob@proulx.com>
1003 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
1004 offsetof() macro construct to avoid compile failure with native HP-UX
1005 11.0 ANSI C compiler.
1007 2005-01-06 Bruno Haible <bruno@clisp.org>
1009 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
1010 because stpncpy.m4 takes care of it.
1012 2004-01-24 Bruno Haible <bruno@clisp.org>
1014 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
1016 2003-10-09 Bruno Haible <bruno@clisp.org>
1018 * progreloc.c: Include xalloc.h instead of xmalloc.h.
1020 2005-01-06 Bruno Haible <bruno@clisp.org>
1022 * fwriteerror.h (fwriteerror): Change specification to include fclose.
1023 * fwriteerror.c: Include <stdbool.h>.
1024 (fwriteerror): At the end, close the file stream. Record whether
1025 stdout was already closed.
1027 2004-05-27 Bruno Haible <bruno@clisp.org>
1029 * execute.c (environ): Declare if needed.
1030 * pipe.c (environ): Likewise.
1031 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
1033 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
1035 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
1036 definitions to be after all include files, to avoid collisions.
1037 Problem reported by Bob Proulx.
1039 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
1041 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
1042 not needed. This removes a dependency on the gettext module.
1043 [defined _LIBC]: Do not include <libintl.h>; not needed.
1045 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
1047 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
1050 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
1052 * argp-parse.c: Include <stddef.h>.
1053 (alignof, alignto): New macros.
1054 (parser_init): Don't assume that void * is aligned sufficiently
1057 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
1058 need to extend the stack.
1059 (YYINITDEPTH): New macro, so that the initial stack isn't overly
1062 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1064 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
1066 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1068 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
1069 Remove now-obsolete comment about AIX.
1070 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
1071 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
1072 (YYMAXDEPTH): New macro.
1074 2004-12-18 Bruno Haible <bruno@clisp.org>
1076 * fatal-signal.c (fatal_signals): Make non-const.
1077 (init_fatal_signals): New function.
1078 (uninstall_handlers, install_handlers): Ignore signals that were set to
1080 (at_fatal_signal): Call init_fatal_signals.
1081 (init_fatal_signal_set): Likewise. Ignore signals that were set to
1083 Reported by Paul Eggert.
1085 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
1087 * getdate.y (textint): New member "negative".
1088 (time_zone_hhmm): New function.
1089 Expect 14 shift-reduce conflicts, not 13.
1090 (o_colon_minutes): New rule.
1091 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
1092 (yylex): Set the "negative" member of signed numbers.
1094 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
1096 Changes imported from coreutils.
1097 * hard-locale.c: Assume <locale.h> exists.
1099 (GLIBC_VERSION): New macro.
1100 (hard_locale): Assume setlocale exists.
1101 Rewrite to avoid #ifdef.
1102 Use strdup rather than malloc + strcpy.
1103 * human.c: Assume <locale.h> exists.
1104 (human_readable): Assume localeconv exists.
1106 2004-12-01 Jakub Jelinek <jakub@redhat.com>
1108 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
1109 convert T2, not T. (Imported from libc.)
1111 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
1113 * getcwd.c (is_ENAMETOOLONG): New macro.
1114 (__getcwd.c): Don't restore errno; glibc doesn't.
1115 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
1116 first, falling back to our code only if its results look suspicious.
1117 Ensure that the resulting buffer is only as large as necessary.
1119 * readutmp.c: Include readutmp.h first.
1120 Include <errno.h>, since readutmp.h no longer does that.
1121 * readutmp.h: Don't include <errno.h>,
1122 <sys/param.h>, <time.h>; not needed to establish interface.
1123 (errno): Remove decl.
1124 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
1125 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
1126 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
1128 2004-11-28 Simon Josefsson <jas@extundo.com>
1130 * base64.h, base64.c: New file.
1132 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
1134 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
1136 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
1138 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
1139 HP's ANSI C compiler.
1140 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
1141 Declaring int functions causes warnings on some modern systems and
1142 shouldn't be needed to compile on ancient ones.
1143 * same.c (MIN) [defined MIN]: Don't define, since it's already
1146 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
1147 with the following changes.
1148 (__set_errno): Parenthesize properly.
1149 Include <stdbool.h>.
1150 (MIN, MAX, MATCHING_INO): New macros.
1151 (__getcwd): Define with prototype, not K&R form.
1152 Use heuristics to allocate default buffer on stack if possible.
1153 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
1154 behavior, and to avoid the PATH_MAX limit when computing
1156 Use MATCHING_INO to compare inode number to file.
1157 Check for arithmetic overflow in size calculations.
1158 Fix bug in reallocation of dot array that caused getcwd to fail
1159 on directories nested deeper than 75.
1160 Be more careful about saving errno on error.
1161 Do not use realloc; use only free+malloc, as this is a bit
1162 more flexible and avoids a needless copy operation.
1163 Do not inspect st_dev and st_ino for symbolic links; POSIX
1164 doesn't specify the latter.
1165 Check for closedir errors.
1166 Avoid needless casts.
1167 Use "#ifdef weak_alias" around weak_alias, to be like other
1169 The following changes to getcwd.c have effect only when used in
1170 gnulib; they have no effect inside glibc proper.
1171 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
1172 as alloca isn't used.
1173 (alloca, __alloca): Likewise.
1174 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
1175 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1176 unconditionally, as gnulib assumes C89 or better.
1177 Do not include <sys/param.h>.
1178 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
1179 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
1181 (NULL) [!defined NULL]: Remove; we assume C89 or better.
1182 Include <dirent.h> in a way that is compatible with modern Autoconf.
1183 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
1184 New macros, if not already defined.
1185 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
1186 Use "_LIBC", not "defined _LIBC", for consistency.
1187 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
1189 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
1190 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
1191 * xgetcwd.c: David MacKenzie's old code was removed, so give
1192 credit only to Jim Meyering and adjust the copyright dates.
1193 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
1194 <stdlib.h>, <unistd.h>, "pathmax.h".
1195 Instead, include "xgetcwd.h" (first) and "getcwd.h".
1196 (INITIAL_BUFFER_SIZE): Remove.
1197 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
1199 2004-11-23 Jim Meyering <jim@meyering.net>
1201 * getopt_.h: Remove trailing blanks.
1203 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1205 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
1206 (futimens): New function, which uses futimes if available.
1207 (futimens, utimens): Support timespec==NULL, with same semantics
1208 as utime and utimens.
1209 * utimens.h (futimens): New decl.
1211 2004-11-23 Jim Meyering <jim@meyering.net>
1213 * __fpending.c: Add comment.
1215 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1217 * getopt_.h: Re-addition of __getopt_argv_const caused
1218 redefinition warnings. To avoid them, include the defines
1219 in `#if !defined __need_getopt ... #endif'. The only place
1220 where __getopt_argv_const is used is in definitions
1221 of getopt_long and getopt_long_only below, which are as well
1222 protected by `#ifndef __need_getopt'.
1223 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
1224 __need_getopt after including <stdio.h> and <unistd.h> These
1225 headers might have defined it.
1227 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
1229 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
1231 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
1232 optopt): Use them instead of invoking ## directly; otherwise, the
1233 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
1235 2004-11-19 Bruno Haible <bruno@clisp.org>
1237 * strtok_r.c: Move comments from here...
1238 * strtok_r.h: ... to here.
1240 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
1242 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
1243 might fail. Problem reported by Yoann Vandoorselaere.
1244 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
1245 that mishandle size_t overflow.
1247 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1249 * canon-host.c: Include "strdup.h".
1250 (canon_host): Use getaddrinfo if available, so that IPv6 works.
1251 Use strdup instead of malloc/strcpy to duplicate strings.
1253 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
1254 (human_space_before_unit): New constant.
1255 * human.c (human_readable): Support it.
1257 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
1258 (xgetcwd): Set errno correctly when failing.
1259 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
1260 the failure is actually due to a PATH_MAX problem.
1262 Further getopt changes to make it more likely that glibc will
1263 buy the changes back.
1264 * getopt.c (POSIXLY_CORRECT): New constant.
1265 (getopt): Use it, so to preserve glibc semantic
1266 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
1267 when compiling for libc.
1268 * getopt_.h (__getopt_argv_const): Bring it back.
1269 (getopt_long, getopt_long_only): Use it.
1271 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
1272 New arg POSIXLY_CORRECT. All callers changed.
1273 (getopt): Argv is now char * const *, as per standard.
1274 (_getopt_internal_r, _getopt_internal): Argv is now char **,
1275 not char *__getopt_argv_const *.
1276 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1277 _getopt_long_only_r): Likewise.
1278 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
1279 * getopt_int.h (_getopt_internal, _getopt_internal_r,
1280 _getopt_long_r, _getopt_long_only_r): Likewise.
1281 * getopt_.h (__getopt_argv_const): Remove.
1282 (getopt): Argv is now char * const *, as per standard.
1284 * getdate.y (tORDINAL): New token.
1285 (day, relunit): Allow it for relative times.
1286 (relative_time_table): Use tORDINAL for ordinals.
1288 2004-11-15 Jim Meyering <jim@meyering.net>
1290 * closeout.c: Include "__fpending.h" once again.
1291 Include <stdbool.h>.
1292 (close_stdout): Don't fail just because stdout was closed initially,
1293 since some programs don't write to stdout in the normal course of
1294 operation (other than --version and --help), and we don't want this
1295 function to make e.g. `touch file >&-' fail.
1296 But do fail if it was closed and someone has tried to write to it.
1297 E.g., `printf foo >&-' must fail.
1299 2004-11-11 Simon Josefsson <jas@extundo.com>
1301 * strtok_r.h, strtok_r.c: New file.
1303 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
1305 * getopt_.h (__getopt_argv_const): New macro, to be used so that
1306 we can stop lying to compilers about the constness of argv when we
1307 are compiled outside glibc.
1308 (getopt, getopt_long, getopt_long_only): Use it.
1309 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
1311 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1312 _getopt_long_only_r): Likewise.
1313 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
1314 _getopt_long_only_r): Likewise.
1316 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
1317 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
1318 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
1319 the other external symbols.
1320 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
1321 declaration, since the above renaming now works around collisions.
1323 2004-11-11 Jim Meyering <jim@meyering.net>
1325 * linebreak.c: Remove trailing blanks.
1326 * alloca_.h: Likewise.
1327 * acosl.c: Likewise.
1328 * euidaccess.c: Likewise.
1329 * allocsa.h: Likewise.
1331 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
1333 * mktime.c (SHR): New macro, which is a portable
1334 substitute for >> that should work even on Crays.
1335 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
1336 Problem reported by Mark D. Baushke in
1337 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
1338 * getdate.y (SHR): Likewise.
1340 * strftime.c (SHR): Likewise.
1342 * quotearg.c (struct quoting_options): Use unsigned int for
1343 quote_these_too, so that right shifts are well defined. All uses
1346 2004-11-10 Simon Josefsson <jas@extundo.com>
1348 * getaddrinfo.h, getaddrinfo.c: New files.
1350 2004-11-10 Jim Meyering <jim@meyering.net>
1352 Ensure that no close failure goes unreported.
1353 * closeout.c (close_stdout): Always close stdout. I.e., don't
1354 return early when it seems there's nothing to flush.
1355 Don't include __fpending.h.
1357 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
1359 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
1361 2004-11-05 Bruno Haible <bruno@clisp.org>
1363 * readlink.c: Include stddef.h, needed for size_t on Woe32.
1364 Reported by Mark D. Baushke <mdb@cvshome.org>.
1366 2004-11-04 Bruno Haible <bruno@clisp.org>
1368 2004-09-11 Bruno Haible <bruno@clisp.org>
1369 * allocsa.valgrind: New file.
1370 2004-02-06 Bruno Haible <bruno@clisp.org>
1371 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
1372 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
1373 Reported by Christopher Seip <chris.seip@hp.com>.
1375 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1377 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
1378 with errno == ERANGE if the buffer is too small.
1379 Problem reported by Mark D. Baushke.
1381 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
1383 * xreadlink.c (MAXSIZE): New macro.
1384 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
1385 size does not exceed MAXSIZE. Avoid cast.
1386 As suggested by Mark D. Baushke in
1387 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
1388 if readlink fails with buffer size just under MAXSIZE, try again
1391 2004-11-02 Derek R. Price <derek@ximbiot.com>
1392 and Paul Eggert <eggert@cs.ucla.edu>
1394 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
1395 (get_date): Overparenthesize to avoid GCC warning.
1397 2004-11-02 Bruno Haible <bruno@clisp.org>
1399 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
1400 function returns void.
1402 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
1404 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1405 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
1408 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1410 * getdate.y: Add support for TZ="foo" within a date string.
1411 Fix some bugs near time_t boundaries. Reject dates with
1412 out-of-range components, e.g., "Sept 31".
1413 Include <stdlib.h>, "setenv.h", "xalloc.h".
1414 (ISDIGIT_LOCALE): Remove; unused.
1415 Note that the TZ and time functions used here are not reentrant.
1416 (mktime_ok, get_tz): New functions.
1417 (TZBUFSIZE): New constant.
1418 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
1419 This requires that we sometimes generate our own TZ="XXX..." setting.
1421 2004-10-27 Derek R. Price <derek@ximbiot.com>
1423 * mktime.c (not_equal_tm): Remove redundant check.
1425 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
1427 * getdate.y: Use Bison 1.875 features, and some minor
1428 code cleanups. This change does not affect semantics.
1429 Don't include <stdlib.h>; no longer needed.
1430 Don't include unlocked-io.h; only the "#if TEST" code uses
1431 stdio, and performance isn't crucial there.
1432 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
1433 Bison 1.875 features as described below.
1434 All uses of "PC." replaced by "pc->".
1435 (YYSTYPE): Add a forward declaration.
1436 (yylex, yyerror): Use full prototypes in forward decls.
1437 Use "%pure-parser" rather than obsolescent "%pure_parser".
1438 Use %parse-param and %lex-param instead of obsolescent
1439 YYPARSE_PARAM and YYLEX_PARAM.
1440 (meridian_table, month_and_day_table, time_units_table,
1441 relative_time_table, time_zone_table, military_table,
1442 lookup_zone, lookup_word, get_date):
1443 Use NULL instead of 0 where appropriate.
1444 (to_hour): Avoid abort (), to avoid a dependency on
1446 (yyerror, yylex): Now accepts parser_control * arg.
1447 (main) [TEST]: Use '\0' rather than 0 for char.
1449 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
1451 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
1452 It's now the caller's responsibility to handle the case where
1453 !HAVE_GETPAGESIZE && !defined getpagesize.
1455 * mktime.c (leapyear): Arg is long int, not int.
1457 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
1459 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
1461 2004-10-12 Simon Josefsson <jas@extundo.com>
1463 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1464 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
1467 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
1469 * vsnprintf.h: New file.
1470 * vsnprintf.c: New file.
1472 2004-10-07 Bruno Haible <bruno@clisp.org>
1474 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
1475 into the provided buffer.
1477 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
1479 * diacrit.c, diacrit.h: Add GPL notice.
1481 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
1482 * atanl.c (atanl): Keep the code as similar to glibc as possible.
1483 * logl.c (logl): Keep the code as similar to glibc as possible.
1484 This avoids a potential constant-folding bug.
1486 2004-10-05 Bruno Haible <bruno@clisp.org>
1488 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
1490 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1492 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
1493 * xmalloc.c (xmemdup): Likewise.
1494 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
1495 XFREE): Remove these long-obsolescent macros.
1496 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
1497 * xstrdup.c: Remove.
1499 * regex.c (re_comp): Cast gettext return value to char *,
1500 Problem reported by Martin Neitzel via Mark D. Baushke.
1502 2004-10-04 Simon Josefsson <jas@extundo.com>
1504 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
1505 '#ifdef USE_UNLOCKED_IO'.
1507 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1509 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
1510 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
1511 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
1512 regex.c, sha1.c, version-etc.c, yesno.c:
1513 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
1514 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
1515 the includer's responsibility.
1517 Sync from coreutils.
1519 * modechange.c (mode_compile): Don't decrement a pointer that
1520 points to the start of a string, as the C Standard says the
1521 resulting behavior is undefined.
1523 * backupfile.h (enum backuptype): Rename none -> no_backups,
1524 simple -> simple_backups, numbered_existing ->
1525 numbered_existing_backups, numbered -> numbered_backups
1526 to avoid shadowing problems. All uses changed.
1527 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
1528 * backupfile.c (check_extension, numbered_backup):
1529 Rename locals to avoid shadowing 'basename'.
1530 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
1533 * .cppi-disable: Add getopt_.h, getopt_int.h.
1534 * .cvsignore: Add getopt.h.
1536 2004-10-04 Simon Josefsson <jas@extundo.com>
1538 * memmem.h: New file.
1539 * memmem.c: New file, taken from glibc.
1541 2004-10-02 Jim Meyering <jim@meyering.net>
1543 * dirfd.h, getpagesize.h: Add copyright notice.
1545 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
1547 * snprintf.c: Remove comments as to why each header is needed.
1549 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
1551 * strsep.h: New file.
1552 * strsep.c: New file.
1554 2004-10-01 Simon Josefsson <jas@extundo.com>
1556 * snprintf.c (snprintf): Handle size==0.
1558 2004-10-01 Simon Josefsson <jas@extundo.com>
1559 Bruno Haible <bruno@clisp.org>
1561 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
1562 (snprintf): Declare 'args'.
1564 2004-09-30 Simon Josefsson <jas@extundo.com>
1566 * snprintf.h, snprintf.c: New files.
1568 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1570 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
1571 (hol_entry_help): Never translate an empty string.
1572 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
1573 * argp.h (OPTION_NO_TRANS): New option.
1575 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
1577 * xvasprintf.c: Include xalloc.h.
1578 (xvasprintf): Use xalloc_die, not xmalloc_die.
1580 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
1582 * dummy.c: Change copyright notice to FSF, and license to GPL.
1584 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
1586 * argp-pvh.c (argp_program_version_hook): Provide initial value.
1587 Problem reported by Bruno Haible in:
1588 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
1590 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
1592 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
1593 in case some system header has #define'd it. Problem reported by
1594 Soeren D. Schulze in
1595 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
1597 2004-09-08 Bruno Haible <bruno@clisp.org>
1599 * stdint_.h.in: New file, taken from GNU clisp.
1601 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
1603 * xvasprintf.h: New file.
1604 * xvasprintf.c: New file.
1605 * xasprintf.c: New file.
1607 2004-09-08 Bruno Haible <bruno@clisp.org>
1609 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
1611 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
1613 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
1615 Import from coreutils.
1616 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
1617 strings on unbounded length. alloca's performance benefits aren't
1618 that important here.
1620 (parse_with_separator): New function, with most of the internals
1621 of the old parse_user_spec. Allow user to omit both user and group,
1622 for compatibility with FreeBSD.
1623 Clone only the user name, not the entire spec.
1624 Do not set *uid, *gid unless entirely successful.
1625 Avoid memory leak in some failing cases.
1626 Fix regression for USER.GROUP reported by Dmitry V. Levin in
1627 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1628 (parse_user_spec): Rewrite to use parse_with_separator.
1630 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
1632 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
1633 its complicated substitute.
1634 * argp-help.c: Include <errno.h>, for program_invocation_short_name
1635 and program_invocation_name.
1636 (__argp_basename) [!_LIBC]: Remove; the only use was
1637 replaced by its body.
1638 (__argp_short_program_name): Change condition from
1639 !defined __argp_short_program_name to
1640 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
1641 to match argp-namefrob.h.
1642 (__argp_failure): Don't assume strerror_r returns char *.
1643 * argp-parse.c (N_): Define unconditionally.
1644 (argp_default_options): Fill out initializers with 0 to avoid
1647 2004-08-12 Simon Josefsson <jas@extundo.com>
1649 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
1650 * getopt_.h: Renamed from getopt.h.
1652 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1654 Merge from coreutils.
1656 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
1657 wmemchr or wmemcpy. Problem reported by Robert Dahlem
1658 for Reliant Unix 5.43.
1660 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
1661 (union fooround): Use uintmax_t, not long int.
1662 The rest is a merge from libc:
1663 [defined _LIBC]: Include <shlib-compat.h>.
1664 (_obstack) [defined _LIBC]: Remove after 2.3.4.
1666 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
1668 * strverscmp.c: Convert to UTF-8.
1670 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
1672 * obstack.h (obstack_empty_p):
1673 Don't assume that chunk->contents is suitably aligned.
1674 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
1675 Likewise. Problem reported by Benno in
1676 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
1678 * chown.c (rpl_chown): Work even if the file is writeable but not
1679 readable. This could be improved further but it'd take some work.
1681 2004-08-08 Simon Josefsson <jas@extundo.com>
1683 * xgethostname.c: Don't include error.h (not used).
1686 * getpass.c: Include getpass.h first.
1688 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
1690 * xalloc-die.c: New files.
1691 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
1693 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
1694 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
1695 (_, N_, xalloc_die): Move to xalloc-die.c.
1696 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
1697 so that we needn't mess with xalloc_msg_memory_exhausted.
1699 * sha1.h: Renamed from sha.h.
1700 (SHA1_H): Renamed from _SHA_H.
1701 (sha1_ctx): Renamed from sha_ctx.
1702 (sha1_init_ctx): Renamed from sha_init_ctx.
1703 (sha1_process_block): Renamed from sha_process_block.
1704 (sha1_process_bytes): Renamed from sha_process_bytes.
1705 (sha1_finish_ctx): Renamed from sha_finish_ctx.
1706 (sha1_read_ctx): Renamed from sha_read_ctx.
1707 (sha1_stream): Renamed from sha_stream.
1708 (sha1_buffer): Renamed from sha_buffer.
1709 * sha1.c: Likewise; renamed from sha.c.
1710 Do not include <sys/types.h>.
1711 Include <stddef.h> rather than <stdlib.h>.
1713 2004-08-08 Bruno Haible <bruno@clisp.org>
1715 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
1716 FILESYSTEM_PREFIX_LEN.
1717 * progreloc.c: Likewise.
1718 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
1720 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
1723 * argp-help.c (make_hol, hol_append): Don't assume that
1724 SIZE_MAX is a valid preprocessor constant.
1725 (__argp_basename): Change from "#ifndef _LIBC"
1726 to "#ifndef __argp_short_program_name", so that
1727 we don't compile these functions for tar.
1729 More merges from coreutils.
1730 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
1731 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
1733 * addext.c: Remove; no longer needed.
1734 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
1735 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
1736 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
1737 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
1738 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
1739 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
1740 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
1741 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
1742 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
1743 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
1744 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
1745 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
1746 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
1747 Import changes from coreutils.
1749 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
1751 Merge from coreutils.
1753 * .gdb-history: Remove; this doesn't belong here.
1755 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
1756 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
1757 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
1759 * dirname.h: Include <stdbool.h>.
1760 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
1761 for consistency with POSIX terminology. All uses changed.
1762 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
1763 (strip_trailing_slashes): Use bool for booleans.
1764 * stripslash.c (strip_trailing_slashes): Likewise.
1766 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1767 sometimes returns a positive errno value even when it succeeds.
1768 (print_errno_message) [!LIBC]: Fall back on strerror if
1771 * path-concat.c (mempcpy): Don't define if a system header defines it.
1772 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
1773 (longest_relative_suffix): New function.
1774 (path_concat): Use it. Assume first argument is not NULL.
1775 Port to DOS. Omit redundant separators.
1776 Report an error instead of returning NULL.
1777 Use mempcpy instead of memcpy.
1778 (xpath_concat): Remove: not declared or used.
1780 * same.h: Include <stdbool.h>
1781 (same_name): Return bool, not int.
1782 * same.c (same_name): Likewise.
1783 (errno): Don't declare; we assume C89 or better now.
1785 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
1786 if not already defined.
1788 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
1789 * dup-safer.c (errno): Likewise.
1791 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
1793 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
1796 2004-08-03 Simon Josefsson <jas@extundo.com>
1798 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
1799 * progname.h: Don't include stdbool.h.
1801 2004-08-02 Simon Josefsson <jas@extundo.com>
1803 * getsubopt.h: New file, with comments from Bruno Haible.
1804 * getsubopt.c: New file, from glibc, but slightly modified based on
1805 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
1807 2004-08-01 Simon Josefsson <jas@extundo.com>
1809 * xgetdomainname.c: Include stdlib.h, for free().
1811 2004-07-16 Simon Josefsson <jas@extundo.com>
1813 * dummy.c: New file.
1815 2004-07-16 Bruno Haible <bruno@clisp.org>
1817 * backupfile.h: Add extern "C" for C++.
1818 * closeout.h: Likewise.
1819 * copy-file.h: Likewise.
1820 * findprog.h: Likewise.
1821 * full-write.h: Likewise.
1822 * pathname.h: Likewise.
1823 * progname.h: Likewise.
1824 * stpcpy.h: Likewise.
1825 * stpncpy.h: Likewise.
1826 * strcase.h: Likewise.
1827 * strstr.h: Likewise.
1828 * xalloc.h: Likewise.
1830 * mbswidth.h: Add extern "C" for C++.
1831 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
1833 2004-07-09 Simon Josefsson <jas@extundo.com>
1835 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
1836 failed without this.)
1838 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
1840 * fchown-stub.c: New file.
1842 2004-06-24 Jim Meyering <jim@meyering.net>
1844 * obstack.h (obstack_base): Cast to (void *), per documentation.
1846 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
1848 * argz.c, argz_.h: New files, which are autoupdated from libtool.
1850 2004-06-01 Jim Meyering <jim@meyering.net>
1852 * calloc.c: New file.
1854 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
1856 * getdate.y (yylex): Allow space between sign and number.
1857 Problem reported by Dan Jacobson.
1859 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
1860 and Jim Meyering <jim@meyering.net>
1862 Merge from coreutils CVS.
1864 * stat-macros.h: New file, with contents from file-type.h
1865 and coreutils' system.h.
1866 * file-type.c: Include "stat-macros.h".
1867 * file-type.h (file_type): Move all macro definitions to new file,
1870 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
1871 Wrap old code with this conditional.
1872 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
1873 function that does not dereference symlinks.
1874 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
1876 * xreadlink.c: Include xreadlink.h first, to catch .h file
1877 dependency problems.
1878 (xreadlink): Accept new arg SIZE, for efficiency.
1879 All decls and uses changed.
1880 * xreadlink.h: Include <stddef.h>, for size_t.
1882 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
1883 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
1885 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
1887 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
1889 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
1890 macros to be defined.
1891 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
1892 the allocator returns NULL because the requested size is zero.
1894 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
1896 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
1897 var. Add comment explaining why libc still defines it. This
1898 merges the following patch from glibc:
1899 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
1901 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
1903 * obstack.c (_obstack): Remove unused variable. It hasn't been
1904 present in glibc since revision 1.1 of this file.
1905 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
1906 obstack_alignment_mask, obstack_alloc, obstack_base,
1907 obstack_blank, obstack_blank_fast, obstack_chunk_size,
1908 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
1909 obstack_grow0, obstack_init, obstack_int_grow,
1910 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
1911 obstack_next_free, obstack_object_size, obstack_ptr_grow,
1912 obstack_ptr_grow_fast, obstack_room): Remove declarations of
1913 nonexistent functions.
1915 2004-05-17 Derek R. Price <derek@ximbiot.com>
1916 Paul Eggert <eggert@cs.ucla.edu>
1918 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
1920 2004-05-14 Bruno Haible <bruno@clisp.org>
1922 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
1923 that consists of a '.' followed by an empty digit string.
1924 Patch by Tor Lillqvist <tml@iki.fi>.
1926 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
1928 Port obstack to the AS/400, where pointers are 16 bytes wide and
1929 you cannot cast an integer to a valid pointer. This patch is
1930 currently waiting to be integrated into glibc; see
1931 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
1933 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
1934 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
1935 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
1936 (struct obstack): temp member is now a union of a pointer and
1937 an integer, instead of an integer. All integer uses changed.
1938 This does not affect the physical layout of struct obstack,
1939 except on hosts (like the AS/400) where the size or alignment of
1940 void * is greater than that of ptrdiff_t.
1941 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
1942 __STDC__)]: Store temporary in pointer member of union, not
1944 * obstack.c: Include <stddef.h>, for offsetof.
1945 (struct fooalign): Remove; it doesn't need a name.
1946 (union fooround): Change double to long double, and add void *.
1947 (DEFAULT_ALIGNMENT): Use offsetof to compute.
1948 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
1949 not a macro. Hence the values are always int; so remove all
1950 casts-to-int in uses.
1952 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
1953 Derek Price <derek@ximbiot.com>
1955 * alloca.c: Include <alloca.h>, to get our interface.
1956 * alloca_.h: Use __alloca on AIX, so that we don't have to
1957 include <alloca.h> first. Use C89 prototype for alloca; this
1958 requires including <stddef.h> for size_t. Use extern "C" if C++.
1959 Use #elif for simplicity, since we can assume C89 now.
1960 Don't try to source the system alloca.h since it will not be found
1961 and to prevent recursively including its replacement.
1962 * fnmatch.c: Include <alloca.h> instead of opencoding.
1963 * regex.c: Likewise.
1965 2004-05-16 Derek Price <derek@ximbiot.com>
1966 Paul Eggert <eggert@cs.ucla.edu>
1968 getline cleanup. This changes the getndelim2 API: both order of
1969 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
1972 * getline.c: Don't include stddef.h or stdio.h, since our
1973 interface does that.
1974 (getline): Always use getdelim, so that we don't have two
1975 copies of this code.
1976 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
1978 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
1979 (GETNDELIM2_MAXIMUM): New macro.
1980 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
1981 instead of the old practice of delim2==0. All callers changed.
1982 Return -1 on overflow, instead of returning junk.
1983 Do not set *linesize unless allocation succeeds.
1984 * getndelim2.h: Do not include stddef.h; no longer needed, now
1985 that we include sys/types.h.
1986 * getnline.h: Likewise.
1987 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
1988 (getndelim2): Reorder arguments.
1989 * getnline.c (getnline, getndelim):
1990 Don't discard the NMAX argument.
1991 (getnline): Invoke getndelim, to avoid code duplication.
1992 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
1993 of (size_t) -1 by callers of the getnline family.
1995 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
1997 * nanosleep.c (suspended): Change its type from int to
1998 sig_atomic_t volatile.
1999 (first_call): Make it private to rpl_nanosleep, and have it
2000 be zero initially as that's a bit faster.
2001 (my_usleep): Round up fractional times instead of truncating them,
2002 as this is the usual meaning for 'sleep'.
2004 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
2006 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
2007 (ENOSYS): Define if not defined.
2008 (settime): Fall back on stime if it exists and settimeofday fails.
2009 But don't bother with fallbacks if a method fails with errno == EPERM.
2011 2004-05-11 Jim Meyering <jim@meyering.net>
2013 Prior to this change, the save_cwd caller required read access to the
2014 current directory on most systems (ones with the fchdir function).
2016 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
2017 fails, try write-only, and finally, resort to using xgetcwd.
2019 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
2021 * obstack.c, obstack.h: Import changes from libc.
2023 2004-04-28 Bruno Haible <bruno@clisp.org>
2025 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
2026 implicitly appends .exe to executables.
2027 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
2028 accepts Windows pathnames.
2029 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
2030 Cygwin like Windows, since it now accepts Windows pathnames.
2031 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
2032 Cygwin like Windows, since it now accepts Windows pathnames.
2033 Reported by Derek Robert Price <derek@ximbiot.com>.
2035 2004-04-20 Jim Meyering <jim@meyering.net>
2037 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
2039 2004-04-20 Jim Meyering <jim@meyering.net>
2040 Bruno Haible <bruno@clisp.org>
2042 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
2043 memory when realloc fails.
2045 2004-04-18 Jim Meyering <jim@meyering.net>
2047 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
2048 don't leak memory and do call END_UTMP_ENT.
2050 2004-04-11 Paul Eggert <eggert@twinsun.com>
2052 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
2053 (CHAR_BIT): Remove, since we assume C89.
2054 Include <stdint.h> if available, as per current Autoconf CVS advice.
2056 2004-03-30 Paul Eggert <eggert@twinsun.com>
2058 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
2059 not bool, to be more consistent with Unix conventions.
2060 Suggested by Bruno Haible.
2062 Merge from coreutils.
2064 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
2067 * getdate.h: Include stdbool.h, and timespec.h instead of
2068 the usual <time.h> dance.
2069 (get_date): Change signature to support fractional time stamps.
2070 All callers changed.
2071 * getdate.y: Include "getdate.h" first, as we can now
2072 assume C89 and don't need to worry about 'const'.
2073 Similarly, include "unlocked-io.h" near start, not in middle.
2075 (textint.value): Use long int rather than int.
2076 (textint.digits): Use size_t rather than int.
2077 (BILLION, LOG10_BILLION): New constants.
2078 (parser_control): New member rel_ns. Members day_ordinal,
2079 time_zone, month, day, hour, minutes, rel_year, rel_month,
2080 rel_day, rel_hour, rel_minutes, rel_seconds
2081 are now long int, not int. Member seconds is now struct timespec,
2082 not int. New member timespec_seen. Members dates_seen, days_seen,
2083 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
2085 (%union.intval): Now long int, not int.
2086 New member timespec.
2087 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
2088 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
2089 (spec): Now is a timespec or an item list.
2090 (timespec, items): New nonterminals.
2091 (time, rel, relunit, number, get_date):
2092 Add support for fractional seconds.
2093 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
2094 (gmtime, localtime, mktime): Remove decls; not needed with C89.
2095 (to_hour): First arg is now long int, not int.
2096 (to_year): Returns long int, not int.
2097 Don't treat year -70 like 70.
2098 (tm_diff): Returns long int, not int.
2099 (lookup_word): Use bool instead of int when appropriate.
2100 (yylex): Use size_t for count, not int.
2101 Detect overflow when parsing large integer constants.
2102 Add support for fractions.
2103 (get_date): Make pointers 'const' if possible.
2104 Use more-portable code to detect integer overflow.
2105 (main) [TEST]: Adjust to above changes. Test for localtime failure.
2106 Don't use ctime; it's not reliable if the year has >4 digits.
2108 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
2109 This is for compatibility with BSD.
2111 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
2112 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
2113 From coreutils' system.h.
2115 * userspec.c: Don't include "posixver.h".
2116 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
2117 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
2118 compatible extension. Simplify code by removing a boolean int
2119 that was always nonzero if a string was nonnull.
2121 2004-03-30 Jim Meyering <jim@meyering.net>
2123 Merge from coreutils.
2125 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
2127 * readtokens.c (readtoken): Don't leak 64 bytes when reading
2128 an empty input stream.
2130 * readtokens.c: Include <stdbool.h>.
2131 (readtoken): Use `size_t' rather than int/long.
2132 All callers adjusted.
2133 Use `bool' rather than `int' where appropriate.
2134 Use memset rather than an explicit loop.
2135 Use x2nrealloc rather than xrealloc.
2136 Allow the use of `\0' as a delimiter.
2137 (readtokens): Likewise.
2138 * readtokens.h (readtoken, readtokens): Update prototypes.
2140 2004-03-30 Bruno Haible <bruno@clisp.org>
2142 * getloadavg.c (getloadavg): Don't assume setlocale returns
2145 2004-03-29 Paul Eggert <eggert@twinsun.com>
2147 Merge changes to getloadavg.c from coreutils and Emacs.
2149 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
2150 Define to an expression, not to the empty string.
2151 Include cloexec.h and xalloc.h.
2152 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
2153 Use set_cloexec_flag rather than rolling our own.
2154 * cloexec.c, cloexec.h: New files.
2156 2004-03-18 Paul Eggert <eggert@twinsun.com>
2158 * getopt.h: Sync with libc CVS.
2160 2004-03-18 Paul Eggert <eggert@twinsun.com>
2161 Bruno Haible <bruno@clisp.org>
2163 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
2164 not on all platforms that have <wchar.h>.
2165 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
2167 2004-03-09 Paul Eggert <eggert@twinsun.com>
2169 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
2171 * getopt_int.h: New file, also synced from libc.
2173 2004-03-07 Paul Eggert <eggert@twinsun.com>
2175 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
2176 '#if' expressions. Unlike the code it replaces, it does not
2177 depend on (defined _SC_PAGESIZE). However, it does depend on
2178 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
2179 first reported by Jason Andrade in
2180 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
2182 2004-01-18 Simon Josefsson <jas@extundo.com>
2184 * strdup.h: New file.
2185 * strdup.c: Include it.
2186 * path-concat.c: Include strdup.h. Drop strdup declaration.
2187 * userspec.c: Include strdup.h. Drop strdup declaration.
2189 2004-02-06 Karl Berry <karl@gnu.org>
2191 * config.charset: update from gettext 0.14.1.
2193 2004-02-05 Paul Eggert <eggert@twinsun.com>
2195 Add comments and code, prompted by suggestions from Bruno Haible
2197 * quotearg.h (quotearg_alloc): New decl. Improve the comments
2198 describing the enum quoting_style values.
2199 * quotearg.c (quotearg_alloc): New function.
2200 (quotearg_buffer_restyled): Treat lone { and } as special.
2201 Treat = as special. Work around bug with older shells
2202 that "see" a '\' that is really the 2nd byte of a multibyte char.
2203 Quote empty string with shell_quoting_style.
2205 2004-02-03 Bruno Haible <bruno@clisp.org>
2207 * pipe.h: New file, from GNU gettext.
2208 * pipe.c: New file, from GNU gettext.
2210 2004-01-27 Bruno Haible <bruno@clisp.org>
2212 * execute.h: New file, from GNU gettext.
2213 * execute.c: New file, from GNU gettext.
2214 * w32spawn.h: New file, from GNU gettext.
2216 2004-01-23 Paul Eggert <eggert@twinsun.com>
2218 Exit-status fix from coreutils.
2220 Use exit_failure consistently in place of EXIT_FAILURE,
2221 so that program exit statuses are consistent on failure.
2223 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
2224 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
2225 * argmatch.h: Comment fix to match the above.
2226 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
2227 Now a macro referring to exit_failure, instead of a separate
2228 variable. Include "exitfail.h" to get it.
2229 * xstrtol.h: Include "exitfail.h".
2230 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
2232 * long-options.c (parse_long_options): Use prototype
2233 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
2236 2004-01-21 Jim Meyering <jim@meyering.net>
2238 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
2239 so as not to conflict with a different-sized __mktime_internal
2240 function in GNU libc.
2241 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
2242 Problem building statically-linked `ls' reported by Michael Brunnbauer.
2244 2004-01-18 Paul Eggert <eggert@twinsun.com>
2246 Merge from diffutils.
2248 * file-type.c (file_type): Add typed memory objects.
2249 * file-type.h (S_TYPEISTMO): New macro.
2251 * c-stack.h (c_stack_action): Remove argv argument.
2252 * c-stack.c (c_stack_action): Likewise. All uses changed.
2253 (die): Don't calculate message unless segv_action returns.
2254 (get_stack_location, min_address_from_argv, max_address_from_argv,
2255 volatile stack_base, volatile_stack_size): Remove.
2256 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
2257 that every segmentation violation is a stack overflow. (Ouch!)
2258 See Debian bug 136249 (still outstanding) for more info about why
2259 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
2261 2003-11-30 Bruno Haible <bruno@clisp.org>
2263 Safer stack allocation.
2264 * setenv.c: Include allocsa.h.
2265 (alloca): Remove fallback definition.
2266 (freea): Remove macro.
2267 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
2270 2003-10-17 Bruno Haible <bruno@clisp.org>
2272 * binary-io.h: Avoid warnings on Cygwin.
2274 2003-12-28 Bruno Haible <bruno@clisp.org>
2276 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
2277 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
2279 2003-11-28 Bruno Haible <bruno@clisp.org>
2281 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
2283 2003-11-27 Bruno Haible <bruno@clisp.org>
2285 * wait-process.c: On Windows, include windows.h. Needed on mingw.
2287 2003-11-17 Bruno Haible <bruno@clisp.org>
2289 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
2291 2003-11-24 Bruno Haible <bruno@clisp.org>
2293 * xallocsa.h: New file, from GNU gettext.
2294 * xallocsa.c: New file, from GNU gettext.
2296 2003-11-24 Bruno Haible <bruno@clisp.org>
2298 * allocsa.h: New file, from GNU gettext.
2299 * allocsa.c: New file, from GNU gettext.
2301 2003-11-24 Bruno Haible <bruno@clisp.org>
2303 * eealloc.h: New file.
2305 2004-01-15 Jim Meyering <jim@meyering.net>
2307 Merge from coreutils.
2309 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
2310 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
2311 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
2313 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
2314 optional configure-time default.
2316 * version-etc.c (version_etc_copyright): Update copyright date.
2318 * xreadlink.c (xreadlink): Correct outdated comment.
2320 2004-01-15 Paul Eggert <eggert@twinsun.com>
2322 Merge from coreutils.
2324 * posixver.c: Include posixver.h.
2326 * same.c: Include <stdbool.h>, <limits.h>.
2327 (_POSIX_NAME_MAX): Define if not defined.
2329 (same_name): If file names are silently truncated, report
2330 that the file names are the same if they are the same after
2331 the silent truncation.
2333 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
2334 conversion function.
2335 * xstrtod.c (xstrtod): Likewise. All callers changed to
2336 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
2339 2004-01-14 Paul Eggert <eggert@twinsun.com>
2341 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
2342 with like-named macro in fnmatch.c.
2343 (EXT): Use an internal constant instead.
2345 Merge fnmatch patches from glibc.
2346 * fnmatch.c (mbsinit): Remove define.
2347 Add libc_hidden_ver (__fnmatch, fnmatch).
2348 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
2349 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
2351 2003-12-14 Karl Berry <karl@gnu.org>
2353 * config.charset: update from gettext-runtime.
2355 2003-12-03 Paul Eggert <eggert@twinsun.com>
2357 * getgroups.c (getgroups): xmalloc takes one argument, not two.
2358 Bug reported by Alfred M. Szmidt.
2360 2003-11-29 Karl Berry <karl@gnu.org>
2362 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
2364 2003-11-23 Paul Eggert <eggert@twinsun.com>
2365 Bruno Haible <bruno@clisp.org>
2367 * printf-parse.h: Don't include sys/types.h.
2368 (ARG_NONE): New macro.
2369 (char_directive): Change type of *arg_index fields to size_t.
2370 * printf-parse.c: Don't include sys/types.h.
2371 (SSIZE_MAX): Remove macro.
2372 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
2373 Remove unnecessary overflow check.
2374 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
2377 2003-11-24 Paul Eggert <eggert@twinsun.com>
2379 * alloca.c: Remove dependency on xalloc module.
2380 (xalloc_die): Remove.
2381 (memory_full) [!defined emacs]: New macro.
2382 [!defined emacs]: Don't include xalloc.h.
2383 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
2384 address arithmetic overflows. Change datatypes a bit to avoid
2387 2003-11-22 Jim Meyering <jim@meyering.net>
2389 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
2391 2003-11-17 Bruno Haible <bruno@clisp.org>
2393 * vasnprintf.c (alloca): Remove fallback definition.
2394 (freea): Remove definition.
2395 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
2396 Reported by Paul Eggert.
2398 2003-11-17 Jim Meyering <jim@meyering.net>
2400 On systems without utime and without a utimes function capable of
2401 dealing with a NULL struct utimbuf* argument, this utime replacement
2402 could -- in unusual circumstances -- leak a file descriptor.
2403 * utime.c: Include <unistd.h> and <errno.h>.
2404 (utime_null): Be sure to close `fd' and to preserve errno.
2405 Reported by Geoff Collyer via Arnold Robbins.
2407 2003-11-16 Paul Eggert <eggert@twinsun.com>
2408 Bruno Haible <bruno@clisp.org>
2410 Protect against address arithmetic overflow.
2411 * printf-args.h: Include stddef.h.
2412 (arguments): Change type of field 'count' to size_t.
2413 * printf-args.c (printf_fetchargs): Use size_t instead of
2414 'unsigned int' where appropriate.
2415 * printf-parse.h: Include sys/types.h.
2416 (char_directive): Change type of *arg_index fields to ssize_t.
2417 (char_directives): Change type of fields 'count', max_*_length to
2419 * printf-parse.c: Include sys/types.h and xsize.h.
2420 (SSIZE_MAX): Define fallback value.
2421 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
2422 instead of 'int' where appropriate. Check a_allocated, d_allocated
2423 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
2424 * vasnprintf.c: Include xsize.h.
2425 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
2426 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
2427 overflow. Avoid wraparound when converting a width or precision from
2430 2003-11-16 Bruno Haible <bruno@clisp.org>
2432 Update from GNU gettext.
2433 * printf-parse.c: Generalize to it can be compiled for wide strings.
2434 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
2435 * vasnprintf.c: Generalize to it can be compiled for wide strings.
2436 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
2437 SNPRINTF): New macros.
2438 Don't include <alloca.h> if the file is used inside libintl.
2439 (local_wcslen): New function, for Solaris 2.5.1.
2440 (VASNPRINTF): Use it instead of wcslen.
2442 2003-11-16 Bruno Haible <bruno@clisp.org>
2444 * xsize.h (xmax): New function.
2445 (xsum, xsum3, xsum4): Declare as "pure" functions.
2447 2003-11-12 Paul Eggert <eggert@twinsun.com>
2449 * xalloc.h: Do not include <limits.h> or <stdint.h>.
2450 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
2451 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
2452 heuristic is just as accurate as far as we know, and it removes a
2453 dependency on size_max.m4 and ptrdiff_max.m4.
2455 2003-11-12 Paul Eggert <eggert@twinsun.com>
2457 * xstrtol.c (__xstrtol): Remove "break" immediately after
2458 "return", to pacify some unknown compiler. Problem reported
2461 2003-11-11 Bruno Haible <bruno@clisp.org>
2463 * xsize.h (SIZE_MAX): Remove fallback definition.
2464 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
2467 2003-11-10 Paul Eggert <eggert@twinsun.com>
2469 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
2470 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
2471 rejected some allocations of exactly SIZE_MAX - 2 bytes.
2473 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
2474 not (size_t) -1, since it's defined here.
2476 2003-11-06 Paul Eggert <eggert@twinsun.com>
2478 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
2479 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
2480 Reject sizes of exactly SIZE_MAX bytes.
2481 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
2482 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
2484 2003-11-05 Bruno Haible <bruno@clisp.org>
2486 * xsize.h: Include limits.h, to avoid a possible collision with
2487 SIZE_MAX defined in <limits.h> on Solaris.
2489 2003-11-04 Bruno Haible <bruno@clisp.org>
2491 * xsize.h: New file.
2492 * linebreak.c: Include xsize.h.
2493 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
2494 argument for overflow.
2495 Suggested by Paul Eggert.
2497 2003-10-31 Bruno Haible <bruno@clisp.org>
2499 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
2500 to avoid (extremely rare) race condition.
2501 Suggested by Paul Eggert.
2503 2003-11-03 Jim Meyering <jim@meyering.net>
2505 * userspec.c: Include "userspec.h".
2506 * userspec.h: New file.
2508 2003-10-31 Paul Eggert <eggert@twinsun.com>
2510 * mountlist.h (struct mount_entry.me_type_malloced): New member.
2511 * mountlist.c (SIZE_MAX): Define if not defined already.
2512 (read_filesystem_list): Set and use me_type_malloced.
2513 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
2514 whatever the type happens to be), for brevity and consistency.
2515 Check for size calculation overflow on Alphas running OSF/1.
2517 2003-10-31 Jim Meyering <jim@meyering.net>
2519 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
2521 * linebuffer.c: Include <string.h> for declaration of memset.
2523 2003-10-30 Paul Eggert <eggert@twinsun.com>
2524 Bruno Haible <bruno@clisp.org>
2526 * vasprintf.c: Include <limits.h>, <stdlib.h>.
2527 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
2529 2003-10-29 Paul Eggert <eggert@twinsun.com>
2531 * xalloc.h (xalloc_oversized): Now a macro, not a function,
2532 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
2534 * quotearg.c (quotearg_n_options): Use it.
2535 * group-member.c: Include <stdbool.h>.
2536 (free_group_info): Arg is now const *; don't free arg.
2537 (get_group_info): Now returns bool and accepts struct group_info *,
2538 rather than returning a malloc'ed struct group_info *.
2539 All uses changed. Check for overflow in internal size calculation.
2541 * getusershell.c (readname): Simplify the code by using x2nrealloc
2542 rather than xmalloc/xrealloc.
2543 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
2544 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
2545 conformance bug: the old code used a pointer after freeing the
2546 storage that it addressed.
2547 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
2548 rather than doing it by hand.
2549 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
2550 the buffer preserved. Use free and xmalloc instead.
2551 * quotearg.c (quotearg_n_options): Likewise.
2552 Use a simpler test for size overflow. Don't use xalloc_oversized
2553 because unsigned int might be wider than size_t (!); this suggests
2554 that we should switch from unsigned int to size_t for slot numbers.
2556 2003-10-27 Bruno Haible <bruno@clisp.org>
2558 * stdbool_.h: Better support for BeOS.
2560 2003-10-27 Paul Eggert <eggert@twinsun.com>
2562 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
2563 to allocate the returned structure. Do not allocate a subarray,
2564 as x2nrealloc will do that.
2565 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
2566 instead of xnrealloc.
2567 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
2569 2003-10-26 Paul Eggert <eggert@twinsun.com>
2571 * xalloc.h (xalloc_oversized): New static inline function, for
2572 callers that want to do their own size-overflow checking. Include
2573 <stdbool.h>, since xalloc_oversized returns bool.
2574 * xalloc.c (array_size_overflow): Remove. All callers changed
2575 to use xalloc_oversized.
2577 Add two functions x2realloc, x2nrealloc, for programs that grow
2578 arrays dynamically by doubling their sizes.
2579 * xalloc.h (x2realloc, x2nrealloc): New decls.
2580 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
2583 Port to C99 semantics for 'inline' of external functions.
2584 Bug reported by Bruno Haible.
2585 * xmalloc.c (xnmalloc_inline): New static inline function,
2586 with the old contents of xnmalloc.
2587 (xnmalloc, xmalloc): Use it.
2588 (xnrealloc_inline): New static inline function,
2589 with the old contents of xnrealloc.
2590 (xnrealloc, xrealloc): Use it.
2592 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
2594 2003-10-25 Paul Eggert <eggert@twinsun.com>
2596 Fix several address-calculation bugs in the hash modules,
2597 plus some minor code cleanup.
2599 * hash.h: Include <stdbool.h>, for bool.
2600 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
2601 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
2602 hash_get_n_entries, hash_get_max_bucket_length,
2603 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
2604 hash_rehash): Use size_t rather than unsigned.
2605 * hash.c (struct hash_table, hash_get_n_buckets,
2606 hash_get_n_buckets_used, hash_get_n_entries,
2607 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
2608 hash_get_entries, hash_do_for_each, hash_string, is_prime,
2609 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
2611 (SIZE_MAX): Define if not defined.
2612 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
2613 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
2615 Use const * when possible.
2616 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
2617 (check_tuning): Fix bug: if tuning parameters were very close to
2618 0 or 1, rounding errors could have caused subscript violations.
2619 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
2620 (hash_initialize): Add 'fail:' label
2621 to free table and return NULL, and use it to simplify code.
2622 Use calloc rather than clearing the storage ourself.
2623 (hash_initialize, hash_rehash): Check for arithmetic overflow in
2624 buffer size calculations.
2625 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
2626 Include <stddef.h>, for size_t.
2627 * hash-pjw.c (hash_pjw): Likewise.
2628 Switch to method described by Bruno Haible.
2629 Include <limits.h>, for CHAR_BIT.
2630 (SIZE_BITS): New macro.
2632 2003-10-21 Paul Eggert <eggert@twinsun.com>
2634 * getndelim2.c (getndelim2): When size calculation overflows,
2635 ceiling the allocation at NMAX bytes rather than silently
2636 discarding input bytes before NMAX is reached. This makes
2637 a difference only if NMAX exceeds SIZE_MAX / 2.
2639 * obstack.c: Merge from glibc.
2640 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
2641 Add libc_hidden_def (_obstack_newchunk).
2642 (_obstack_free) [! defined _LIBC]: Remove.
2643 [defined _LIBC]: Make a strong alias from obstack_free, rather than
2644 a clone of the function body.
2645 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
2646 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
2648 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
2649 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
2652 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
2653 (obstack_ptr_grow_fast, obstack_int_grow_fast):
2654 Don't use lvalue casts, as GCC plans to remove support for them
2655 in GCC 3.5. Reported by Joseph S. Myers. This bug
2656 was also present in the non-GCC version, indicating that this
2657 code had always been buggy and had never been widely used.
2658 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
2659 Use the fast variant of each macro, rather than copying the
2660 definiens of the fast variant; that way, we'll be more likely to
2661 catch future bugs in the fast variants.
2663 2003-10-20 Bruno Haible <bruno@clisp.org>
2665 * wait-process.h: New file, from GNU gettext.
2666 * wait-process.c: New file, from GNU gettext.
2668 2003-10-19 Jim Meyering <jim@meyering.net>
2670 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
2672 2003-10-16 Paul Eggert <eggert@twinsun.com>
2674 * getgroups.c: Include <errno.h>, <stdlib.h>.
2675 (getgroups): First arg is int, not size_t.
2676 Don't let 'free' mangle errno.
2678 2003-10-16 Jim Meyering <jim@meyering.net>
2680 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
2682 2003-10-15 Paul Eggert <eggert@twinsun.com>
2684 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
2686 (new_exclude, add_exclude_file): Initial size no longer needs to
2688 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
2689 our own address arithmetic overflow checking.
2691 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
2692 (fnmatch): Do not alloca more than 2000 wide characters;
2693 instead, use malloc for large buffers.
2694 Check for address arithmetic overflow, and return -1
2695 with errno set to ENOMEM in that case.
2696 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
2697 (NEW_PATTERN): Do not alloca more than 8000 bytes;
2698 instead, return -1. Check for address arithmetic overflow.
2700 2003-10-14 Paul Eggert <eggert@twinsun.com>
2702 Handle invalid suffixes and overflow independently, so that
2703 callers can treat them independently as needed. Fix some bugs in
2704 suffix handling, e.g., "100k@" was not diagnosed as an invalid
2705 suffix for a human-readable blocksize. The major caller-visible
2706 change is the addition of a new
2707 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
2708 that both overflow and suffix chars were found.
2710 * human.c (humblock): Don't check separately for invalid suffix
2711 char; that is xstrtoumax's job (now that its bug is fixed).
2712 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
2713 INTMAX_MAX]: New macros.
2714 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
2715 TYPE_MAXIMUM): New macros.
2716 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
2717 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
2718 if overflow occurs, as it's what __strtol does and it's more useful
2720 (__xstrtol): If __strtol reports some error other than ERANGE,
2721 reflect it to the caller as LONGINT_INVALID. If it reports
2722 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
2723 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
2724 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
2726 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
2727 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
2728 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
2729 [defined UINTMAX_MAX]: New macros.
2731 2003-10-14 Bruno Haible <bruno@clisp.org>
2733 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
2734 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
2735 Also use volatile where needed.
2737 2003-10-12 Paul Eggert <eggert@twinsun.com>
2739 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
2740 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
2741 and define in terms of the other primitives.
2742 * xmalloc.c: Include stdbool.h; do not include exit.h.
2743 (SIZE_MAX): Define if not already defined.
2744 (array_size_overflow): New function.
2745 (xalloc_die): Abort instead of exiting if 'error' returns.
2746 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
2747 (xmalloc, xrealloc): Use them.
2748 (xcalloc): Check for address arithmetic overflow.
2749 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
2750 a bit faster than strcpy.
2752 2003-10-08 Paul Eggert <eggert@twinsun.com>
2754 Merge getpass from libc, plus a few fixes.
2756 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
2757 Include <stdbool.h>.
2758 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
2759 __fsetlocking to empty.
2760 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
2761 do include <bits/libc-lock.h>.
2762 Do not include <fcntl.h>; not needed.
2763 [_LIBC]: Include <wchar.h>.
2764 (NOTCANCEL_MODE): New macro.
2765 (flockfile, funlockfile) [_LIBC]: New macros.
2766 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
2767 [!_LIBC]: New macros.
2768 (call_fclose): New function.
2769 (getpass): Use it. Save tty stream separately; this simplifies the
2770 code and makes it more reliable if stdin happens to equal stdout.
2771 Invoke __fsetlocking on tty.
2772 Handle thread cancellation if needed.
2773 Namespace cleanup (use __tcgetattr, __getline).
2774 Use bool for Booleans.
2775 [USE_IN_LIBIO]: Handle wide streams.
2776 [!_LIBC]: Unconditionally do the fseek, since we don't know what
2777 stream might go where.
2779 * unlocked-io.h: Include <stdio.h>, so that the caller
2780 doesn't have to include <stdio.h> before us.
2781 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2782 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2783 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2784 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2785 if not declared, so that we can use getpass.c code from libc without
2787 (flockfile, ftrylockfile, funlockfile): New macros.
2789 2003-10-06 Bruno Haible <bruno@clisp.org>
2791 * version-etc-2.h: Remove file.
2792 * version-etc-2.c: Remove file.
2794 2003-09-25 Jim Meyering <jim@meyering.net>
2795 Bruno Haible <bruno@clisp.org>
2797 This lets translators provide better translations for the
2798 "Written by ..." part of --version output.
2799 * version-etc.h: Include stdarg.h.
2800 (version_etc_copyright): Declare as readonly.
2801 (version_etc): Make this function variadic with a NULL-terminated list
2802 of author name strings.
2803 (version_etc_va): New declaration.
2804 * version-etc.c: Include stdarg.h, stdlib.h.
2805 (version_etc_copyright): Declare as readonly.
2806 (version_etc_va): New function. Provide a different translatable string
2807 for each possible number of authors < 10. Abbreviate when there are 10
2809 (version_etc): Make this function variadic. Call version_etc_va.
2810 Suggestion from Gary V. Vaughan.
2812 * long-options.h (parse_long_options): Change prototype: the authors
2813 string is moved to the end and becomes variadic.
2814 * long-options.c: Include stdarg.h.
2815 (parse_long_options): Make this function variadic, too.
2816 Call version_etc_va, not version_etc.
2818 2003-10-06 Bruno Haible <bruno@clisp.org>
2820 * fatal-signal.h: New file, from GNU gettext.
2821 * fatal-signal.c: New file, from GNU gettext.
2823 2003-10-04 Karl Berry <karl@gnu.org>
2825 * argp*: update from libc.
2827 2003-10-01 Larry Jones <lawrence.jones@eds.com>
2829 * getpass.c (getpass): Use a no-op fseek when switching from input to
2830 output mode on the same stream.
2832 2003-09-29 Paul Eggert <eggert@twinsun.com>
2834 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
2835 Fix arg typo in previous patch.
2837 2003-09-28 Jim Meyering <jim@meyering.net>
2839 * error.c: Correct cpp indentation.
2841 2003-09-27 Paul Eggert <eggert@twinsun.com>
2843 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
2844 Omit the special code that used __typeof__, since we worry that
2845 it could be more trouble than it's worth. See:
2846 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
2847 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
2851 2003-09-26 Jim Meyering <jim@meyering.net>
2853 * error.c (error_tail): Move some declarations
2854 into inner scope where the local variables are used.
2856 2003-09-26 Bruno Haible <bruno@clisp.org>
2858 * stpncpy.h (gnu_stpncpy): New declaration.
2859 (stpncpy): Define as alias for gnu_stpncpy.
2860 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
2862 2003-09-26 Paul Eggert <eggert@twinsun.com>
2864 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
2865 (error_tail): Do not loop, reallocating temporary buffer, since
2866 the output cannot contain more wide characters than the input
2867 contains bytes, the size must be big enough already. This avoids
2868 one potential size overflow calculation. Check for size overflow
2869 when calculating temporary buffer size. Free temporary buffer
2870 when done, if it was allocated with malloc; this plugs a memory
2871 leak. Remove casts from void * to pointers, that are no longer
2872 needed now that we're assuming C89 or better.
2874 Merge error changes from glibc.
2876 * error.c, error.h: Update copyright notice header to match glibc.
2877 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
2878 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
2879 Disable cancellation while printing error.
2880 * error.h: Prepend __ to parameter names.
2882 2003-09-25 Karl Berry <karl@gnu.org>
2884 * argp-fmtstream.c, argp-help.c: update from libc.
2886 2003-09-25 Bruno Haible <bruno@clisp.org>
2888 * version-etc-2.h: New file, from version-etc.h with modifications.
2889 * version-etc-2.c: New file, from version-etc.c with modifications.
2891 2003-09-25 Simon Josefsson <jas@extundo.com>
2893 * xgetdomainname.h: New file.
2894 * xgetdomainname.c: New file.
2896 2003-09-25 Simon Josefsson <jas@extundo.com>
2897 Bruno Haible <bruno@clisp.org>
2899 * getdomainname.h: New file.
2900 * getdomainname.c: New file.
2902 2003-09-24 Paul Eggert <eggert@twinsun.com>
2904 * linebuffer.c (freebuffer): Don't free the argument, just
2905 the buffer associated with the argument. Bug reported by
2908 2003-09-19 Karl Berry <karl@gnu.org>
2910 * argp.h: update from libc.
2912 2003-09-16 Paul Eggert <eggert@twinsun.com>
2914 * linebuffer.c (readlinebuffer): Return NULL immediately upon
2915 input error, instead of returning NULL the next time we are called
2916 (and therefore losing track of errno).
2918 2003-09-15 Paul Eggert <eggert@twinsun.com>
2920 * getndelim2.c (getndelim2): Don't trash errno when a read
2921 fails, so that the caller gets the proper errno.
2923 * readutmp.c (read_utmp): Likewise.
2924 Check for fstat error. Close stream and free storage
2927 2003-09-14 Bruno Haible <bruno@clisp.org>
2929 * fwriteerror.h: New file.
2930 * fwriteerror.c: New file.
2932 2003-09-14 Jim Meyering <jim@meyering.net>
2934 * getloadavg.c: Correct cpp indentation.
2935 * strdup.c: Likewise.
2936 * vasnprintf.c: Likewise.
2938 2003-09-12 Paul Eggert <eggert@twinsun.com>
2940 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
2941 * obstack.c [!defined _LIBC]: Likewise.
2942 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
2943 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
2944 * exitfail.c: Don't include stdlib.h; no longer needed.
2946 More changes to assume C89 or better.
2948 * error.c (error_tail): Assume vprintf.
2950 * argmatch.c (getenv): Remove decl.
2951 * progreloc.c (get_full_program_name): Define via prototype.
2952 * setenv.c (clearenv): Likewise.
2953 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
2955 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
2956 (malloc, memcpy): Remove decls.
2957 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
2958 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
2959 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2960 (memcpy): Remove macro.
2961 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
2962 (__P): Remove. All uses removed.
2963 (PTR): Remove. All uses changed to void *.
2964 (CHAR_BIT, NULL): Remove.
2965 (spaces, zeros, memset_space, memset_zero)
2966 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
2968 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
2969 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
2970 Define with prototype.
2971 Remove now-unnecessary prototype decl.
2972 (extra_args_spec): Assume ANSI C. All uses changed.
2973 (extra_args_spec_iso): Remove.
2974 (my_strftime, emacs_strftimeu): Define via prototype.
2975 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
2977 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
2978 * strtoimax.c: Include <stdlib.h> unconditionally.
2979 (strtoul, strtol): Remove decls.
2980 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
2982 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2983 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
2984 (LOCALE_PARAM_PROTO): New macro.
2985 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
2986 (INTERNAL (strtol), strtol): Define with a prototype.
2987 (PARAMS): Remove. All uses removed.
2988 * tempname.c: Include <string.h> unconditionally.
2989 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
2990 * xgethostname.c (main): Define with a prototype.
2991 * xmalloc.c: Include "xalloc.h" first, to check interface.
2992 Include <stdlib.h> unconditionally.
2993 (calloc, malloc, realloc, free): Remove decls.
2994 * xstrtod.c: Include "xstrtod.h" first, to check interface.
2995 Include <stdlib.h> unconditionally. Sort include file names.
2997 (xstrtod): Define with a prototype.
2998 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
2999 (strtol, strtoul): Remove decls.
3001 2003-09-11 Paul Eggert <eggert@twinsun.com>
3003 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
3004 Include <stdlib.h>, <string.h> unconditionally.
3005 Remove now-unnecessary cast to char *.
3006 * strnlen.c: Include <string.h> unconditionally.
3007 * yesno.c (yesno): Define with a prototype.
3009 2003-09-10 Bruno Haible <bruno@clisp.org>
3011 * strcspn.c: Include <string.h> unconditionally.
3012 * strpbrk.c: Include <string.h> unconditionally.
3013 * strstr.c: Include <string.h> unconditionally.
3014 * unicodeio.c: Include <string.h> unconditionally.
3015 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
3016 * unsetenv.c: Likewise.
3017 * xreadlink.c: Include <stdlib.h> unconditionally.
3018 * yesno.c: Include <stdlib.h> unconditionally.
3019 (rpmatch): Add prototype.
3021 2003-09-10 Jim Meyering <jim@meyering.net>
3023 * error.c: Correct indentation of cpp directives.
3025 2003-09-09 Paul Eggert <eggert@twinsun.com>
3029 * acosl.c (main): Use a prototype.
3030 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
3033 * getloadavg.c (getloadavg, main): Define via prototypes.
3035 * getopt.h (struct option.name): Assume C89, and use 'const'.
3036 (getopt, etopt_long, getopt_long_only, _getopt_internal)
3037 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
3039 * getopt.c (const): Remove macro.
3040 Include <string.h> unconditionally.
3041 (my_index): Remove; all uses changed to strchr.
3042 (strlen): Remove decl.
3043 (exchange): Remove forward decl; no longer needed.
3044 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
3045 Define with prototype.
3046 * getopt1.c (const): Remove macro.
3047 (getopt_long, getopt_long_only, main): Define with prototype.
3049 * getugroups.c: Include <string.h> unconditionally.
3051 * getusershell.c: Include <stdlib.h> unconditionally.
3052 (getusershell, setusershell, endusershell, readname, main):
3053 Define with prototypes.
3055 * group-member.c: Include group-member.h first.
3056 Include <stdlib.h> unconditionally.
3058 * hard-locale.c: Include hard-locale.h first.
3059 Include <stdlib.h>, <string.h> unconditionally.
3061 * hash.c (free, malloc): Remove decls.
3062 Include <stdlib.h> unconditionally.
3064 * human.c: Include <stdlib.h>, <string.h> unconditionally.
3065 (getenv): Do not declare.
3067 * idcache.c: Include <string.h> unconditionally.
3069 * long-options.c: Include long-options.h first, to test interface.
3070 Include <stdlib.h> unconditionally.
3072 * makepath.c: Include makepath.h first, to test interface.
3073 Include <stdlib.h> and <string.h> unconditionally.
3075 * linebuffer.c: Include <stdlib.h>.
3076 (free): Remove decl.
3078 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
3079 rpl_malloc returns void *, not char *.
3080 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
3082 * md5.h: Include <limits.h> unconditionally.
3083 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
3084 (__P): Remove; all uses removed.
3085 * md5.c: Include "md5.h" first.
3086 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
3087 md5_buffer, md5_process_bytes, md5_process_block):
3088 Define with prototypes.
3089 * sha.h (__P): Remove all uses. (It wasn't defined??)
3090 * sha.c: Include "sha.h" first.
3091 Include <stdlib.h>, <string.h> unconditionally.
3093 * memchr.c (__ptr_t): Remove; all uses changed to void *.
3094 * memcmp.c (__ptr_t): Likewise.
3095 * memrchr.c (__ptr_t): Likewise.
3096 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
3097 Include <string.h> unconditionally.
3098 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
3099 * memchr.c: Include <stdlib.h> unconditionally.
3100 * memchr.c (LONG_MAX): Remove.
3101 * memrchr.c (LONG_MAX): Likewise.
3102 * memchr.c (__memchr): Define via a prototype.
3103 * memrchr.c (__memrchr): Likewise.
3104 * memcmp.c (__P): Remove, and remove all uses.
3105 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
3106 Remove forward decls; no longer needed.
3107 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
3108 Use types required by C89 in prototype.
3110 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
3111 * savedir.c: Likewise.
3112 * mkdir.c (free): Remove decl.
3113 * rmdir.c (rmdir): Define with a prototype.
3114 * savedir.c: Include savedir.h first, to test interface.
3116 * mktime.c (STDC_HEADERS): Remove.
3117 Include <stdlib.h>, <string.h> unconditionally.
3119 * modechange.c: Include <stdlib.h> unconditionally.
3120 (malloc): Remove decl.
3122 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
3123 (free): Remove decl.
3125 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
3126 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
3127 (This type really should be intptr_t, but that's a C99ism.)
3128 (_obstack_memcpy): Remove: all uses changed to memcpy.
3129 Include <string.h> unconditionally.
3130 (struct obstack): Assume __STDC__ for types of members
3131 chunkfun, freefun, extra_arg.
3132 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
3133 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
3134 obstack_begin, obstack_specify_allocation,
3135 obstack_specify_allocation_with_arg, obstack_chunkfun,
3136 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
3137 Remove unprototyped decls and the macros that use them.
3138 * obstack.c (POINTER): Remove. All uses changed to void *.
3139 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
3140 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
3141 (defined __STDC__ && __STDC__)]:
3142 Remove nonprototyped code.
3143 Include <stdlib.h> unconditionally.
3144 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
3145 _obstack_allocated_p, _obstack_free, obstack_free,
3146 _obstack_memory_used, print_and_abort):
3147 Define using prototypes.
3148 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
3149 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
3150 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
3151 obstack_next_free, obstack_object_size, obstack_room) [0]:
3152 Remove unused, unprototyped code.
3154 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
3156 * physmem.c (physmem_total, physmem_available, main): Define
3159 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
3160 (main): Define with a prototype.
3162 * posixver.c (getenv): Remove decl.
3164 * putenv.c (malloc): Returns void *, not char *.
3165 Include <string.h> unconditionally.
3166 (strchr, memcpy, NULL): Do not define.
3168 * readtokens.c: Include readtokens.h first, to test interface.
3169 Include <stdlib.h>, <string.h> unconditionally.
3170 (init_tokenbuffer): Define with a prototype.
3172 * regex.c (PARAMS): Remove. All uses removed.
3173 All uses of _RE_ARGS removed, too.
3174 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3176 (bzero): Assume memset exists.
3177 (memcmp, memcpy, NULL): Remove.
3178 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
3179 char, or assignments to local vars of type signed char.
3180 (init_syntax_once, PREFIX(extract_number_and_incr),
3181 PREFIX(print_partial_compiled_pattern),
3182 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
3183 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
3184 PREFIX(regex_grow_registers), PREFIX(regex_compile),
3185 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
3186 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
3187 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
3188 wcs_compile_range, byte_compile_range, truncate_wchar,
3189 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
3190 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
3191 count_mbs_length, wcs_re_match_2_internal,
3192 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
3193 PREFIX(alt_match_null_string_p),
3194 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
3195 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
3196 regfree, PREFIX(extract_number)): Define with prototype. Remove
3197 now-unnecessary declaration, if any.
3198 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
3200 Remove now-unnecessary casts among pointer types.
3201 * regex.h (_RE_ARGS): Remove. All uses removed.
3203 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
3204 (free): Remove decl.
3206 * rpmatch.c: Include <stdlib.h> unconditionally.
3208 * same.c: Include <stdlib.h>, <string.h> unconditionally.
3209 (free): Remove decl.
3211 * save-cwd.c: Include <stdlib.h> unconditionally.
3212 * xgetcwd.c: Likewise.
3214 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
3215 (free): Remove decl.
3217 * strchrnul.c (strchrnul): Define with a prototype.
3218 Fix bug: c_in was not converted to char before searching.
3220 The following changes are not K&R related:
3222 * group-member.h: Include <sys/types.h>, so that this file is
3224 * makepath.h: Likewise.
3226 * getusershell.c (readname, default_index, line_size, readname):
3227 Use size_t, not int, for sizes.
3228 (readname): If the size overflows, report an error instead of
3231 2003-09-09 Derek Robert Price <derek@ximbiot.com>
3233 * getndelim2.c: Assume stdlib.h per the C89 spec.
3235 2003-09-08 Paul Eggert <eggert@twinsun.com>
3237 Assume C89 or better; remove K&R cruft.
3238 A few of these changes were first proposed by Derek Robert Price
3239 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
3241 * addext.c: Include <string.h> unconditionally.
3242 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
3243 Don't declare getenv or malloc.
3245 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
3246 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
3248 (find_stack_direction, alloca): Use prototypes.
3250 * atexit.c (atexit): Define using a prototype.
3252 * basename.c, dirname.c, stripslash.c:
3253 Include <string.h> unconditionally.
3255 * bcopy.c: Include <stddef.h>.
3256 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
3258 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
3260 * error.h (error, error_at_line, error_print_progname)
3261 [! (defined (__STDC__) && __STDC__)]: Remove decls.
3262 * error.c: Include error.h first, to check interface.
3263 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3264 (VA_START): Remove; all uses changeed to va_start.
3265 (exit, strerror): Remove decls.
3266 (error_print_progname): Prototype uncondionally.
3267 Don't include <errno.h>; no longer needed.
3268 (private_strerror): Remove.
3269 (error_tail): Always define.
3270 (error, error_at_line): Assume C89 or better; always use prototypes.
3271 * fatal.c: Include "fatal.h" first, to test interface.
3272 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3273 (VA_START): Remove; all uses changed to va_start.
3274 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
3276 (exit): Remove decl.
3277 (fatal): Prototype unconditionally. Assume va_start works.
3278 Abort at end, to pacify gcc.
3280 * euidaccess.c (main): Define with a prototype.
3282 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
3284 * exitfail.c: Include <stdlib.h> unconditionally.
3286 * fnmatch_.h (__P): Remove. All uses changed to assume
3288 * fnmatch.c: Include fnmatch.h first, to test interface.
3289 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
3290 (getenv): Remove decl.
3291 (fnmatch): Define using a prototype.
3292 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
3293 (FCT): Define using a prototype.
3295 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
3297 * gethostname.c: Include <stddef.h>.
3298 (gethostname): Define with prototype. Length is size_t, not int.
3300 2003-09-08 Paul Eggert <eggert@twinsun.com>
3302 * getversion.c: Remove; was migrated to backupfile.c in 1997.
3303 getversion.c should have been removed then, but was accidentally
3306 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
3307 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
3309 2003-09-07 Paul Eggert <eggert@twinsun.com>
3311 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
3312 copy_tm_result. Bug reported by Simon Josefsson in
3313 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
3315 2003-09-06 Paul Eggert <eggert@twinsun.com>
3317 * time_r.c, time_r.h: New files.
3319 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
3321 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
3322 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
3324 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
3326 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
3327 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
3330 * timegm.c: Switch to glibc implementation, with the following changes:
3331 [defined HAVE_CONFIG_H]: Include <config.h>.
3332 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
3333 (__mktime_internal) [!defined _LIBC]: New decl.
3334 (__gmtime_r) [!defined _LIBC]: New macro and function.
3335 (timegm): Use a prototype, since gnulib assumes C89.
3336 Do not bother declaring tmp to be const, as it's not really usefu.
3337 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
3338 (timegm): Declare only if HAVE_DECL_TIMEGM.
3340 2003-09-03 Paul Eggert <eggert@twinsun.com>
3342 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
3343 Bug reported by Lute Kamstra in
3344 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
3346 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
3347 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
3348 course with correspondingly smaller numbers for tomorrow and
3349 yesterday. From Tadayoshi Funaba. Originally installed into
3350 sh-utils on 1999-08-07, but the patch got lost (I guess during the
3353 2003-08-31 Simon Josefsson <jas@extundo.com>
3355 * timegm.h: New file.
3356 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
3358 2003-08-31 Karl Berry <karl@gnu.org>
3360 * argp.h: update from libc.
3362 2003-08-28 Bruno Haible <bruno@clisp.org>
3364 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
3365 warning on QNX, which defines O_BINARY to 000000.
3367 2003-08-24 Bruno Haible <bruno@clisp.org>
3369 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
3370 MSVC7 <stdio.h> is included later.
3372 2003-08-20 Bruno Haible <bruno@clisp.org>
3374 * progname.h: New file, from GNU gettext.
3375 * progname.c: New file, from GNU gettext.
3376 * progreloc.c: New file, from GNU gettext.
3378 2003-08-19 Bruno Haible <bruno@clisp.org>
3380 * xstrdup.c: Assume <string.h> exists.
3382 2003-08-18 Jim Meyering <jim@meyering.net>
3384 * setenv.h: Indent nested cpp directive.
3385 * vasnprintf.c: Remove trailing blanks.
3387 2003-08-17 Simon Josefsson <jas@extundo.com>
3388 Bruno Haible <bruno@clisp.org>
3390 * xstrndup.h: New file.
3391 * xstrndup.c: New file.
3393 2003-08-17 Bruno Haible <bruno@clisp.org>
3395 * strndup.h: New file.
3397 2003-08-16 Paul Eggert <eggert@twinsun.com>
3399 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
3400 space, undoing this 2003-08-12 change:
3401 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
3403 2003-08-16 Jim Meyering <jim@meyering.net>
3405 Merge from coreutils.
3406 * xstrtoimax.c: #else #if -> #elif.
3407 * xstrtoumax.c: Likewise.
3409 2003-08-15 Paul Eggert <eggert@twinsun.com>
3411 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
3412 rather than tab, after '#' in shell-script copyright notices.
3413 Suggested by Bruno Haible.
3415 2003-08-15 Jim Meyering <jim@meyering.net>
3416 and Paul Eggert <eggert@twinsun.com>
3418 Merge from coreutils.
3419 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
3420 member but strut utmpx does not. Needed for AIX 4.3.3.
3421 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
3423 2003-08-15 Jim Meyering <jim@meyering.net>
3425 Merge from coreutils.
3426 * xgethostname.c: Include <stdlib.h>.
3427 (xghostname): Don't exit for anything other than memory-related
3428 failure; just return NULL.
3429 * userspec.c: Include "posixver.h".
3430 (parse_user_spec): Accept `.' as a separator only
3431 in pre-POSIX-200112 mode.
3432 * strtoimax.c: Use #elif rather than #else #if.
3433 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
3434 Remove function, now that we can rely on a working tzset function.
3435 [!_LIBC]: Ensure that the required autoconf test has been run.
3436 [!defined _NL_CURRENT && HAVE_STRFTIME]:
3437 Use underlying_strftime for %r.
3438 * sha.c: Merge in some clean-up and optimization changes from glibc.
3439 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
3440 Ensure that it is a multiple of 64.
3441 Rearrange loop exit tests so as to avoid performing an
3442 additional fread after encountering an error or EOF.
3443 * realloc.c: Update copyright date.
3445 2003-08-14 Jim Meyering <jim@meyering.net>
3447 Merge from coreutils.
3448 * obstack.h: Whitespace changes.
3449 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
3450 and xcalloc return values.
3451 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
3452 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
3453 hang on OSF/1 5.1 for DIR on both local and remote file systems.
3454 Reported by (and fix confirmed by) Nelson H. F. Beebe.
3455 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3457 Use mntctl's return value to drive the entry-processing loop, since
3458 we can't rely on the value of the vmt_length member in the last
3459 entry. On some systems doing so could result in exhausting
3460 virtual memory. Based in part on a patch from Mike Jetzer.
3462 2003-08-14 Jim Meyering <jim@meyering.net>
3463 and Paul Eggert <eggert@twinsun.com>
3465 Merges from coreutils, plus other fixes.
3466 * physmem.c: Merge in portability changes from gcc/libiberty
3467 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
3468 for credits and details. Thanks to Kaveh Ghazi for helping
3469 to keep these files in sync.
3470 (ARRAY_SIZE): Define it.
3471 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
3472 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
3473 (memcasecmp): Don't assume size_t fits in unsigned int.
3474 Remove casts and duplicate code.
3475 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
3476 (memcpy): Remove definition.
3477 Merge in some clean-up and optimization changes from glibc.
3478 [BLOCKSIZE]: Move definition to top of file.
3479 Ensure that it is a multiple of 64.
3480 Rearrange loop exit tests so as to avoid performing an
3481 additional fread after encountering an error or EOF.
3482 * md5.h (md5_uintptr): Define.
3483 * makepath.c (CLEANUP_CWD): Report an error if we failed to
3484 return to the initial working directory. Preserve errno
3486 * idcache.c: Include "xalloc.h".
3487 (xmalloc, xrealloc): Remove decls.
3488 (getuser): Remove casts no longer required in C89.
3489 * human.c: Include stdio.h, for sprintf.
3490 * group-member.c: Include "xalloc.h".
3491 (xmalloc, xrealloc): Remove decls.
3492 (get_group_info): Remove casts no longer required in C89.
3493 * getusershell.c (readname): Remove casts no longer required in C89.
3494 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
3495 * getline.c: Whitespace fix, from coreutils.
3497 2003-08-13 Paul Eggert <eggert@twinsun.com>
3499 * exclude.c: Include <ctype.h>
3500 (IN_CTYPE_DOMAIN): New macro.
3502 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
3505 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3506 Undo previous (whitespace-only) change.
3508 2003-08-12 Paul Eggert <eggert@twinsun.com>
3510 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3511 Normalize leading white space and remove trailing white space.
3512 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
3513 notice, as per ../config/srclist-update.
3515 Merge from coreutils.
3516 * euidaccess.h: New file.
3517 * euidaccess.c: Include it.
3518 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
3519 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
3520 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
3522 2003-08-11 Bruno Haible <bruno@clisp.org>
3524 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
3525 (vasnprintf): Use it instead of wcslen.
3527 2003-08-11 Bruno Haible <bruno@clisp.org>
3529 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
3530 value to ensure that _Bool promotes to int. Use #define for _Bool when
3531 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
3533 2003-08-10 Karl Berry <karl@gnu.org>
3535 * regex.h: update from libc (whitespace fix).
3537 2003-08-09 Paul Eggert <eggert@twinsun.com>
3539 Merge some files from coreutils. These changes were
3540 originally made by Jim Meyering.
3541 * acl.c: Include <sys/types.h> before <sys/stat.h>;
3542 many older Unixes require this.
3543 * alloca.c (alloca): Remove cast to argument of free;
3544 no longer needed in C89.
3545 * alloca_.h, regex.h: Fix white space to match
3546 what GNU indent does.
3548 2003-08-05 Paul Eggert <eggert@twinsun.com>
3550 * bumpalloc.h: Remove.
3552 2003-08-04 Paul Eggert <eggert@twinsun.com>
3554 * getloadavg.c: Change copyright notice and spacing to conform to
3557 Merge from coreutils.
3558 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
3560 * getdate.y (date): Also accept dates like May-23-2003; suggestion
3561 from Karl Berry, implemented by Jim Meyering.
3562 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
3563 from Dmitry V. Levin.
3564 Remove anachronistic cast of xrealloc.
3565 * fnmatch_.h (__const): Remove. Use 'const'.
3566 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
3567 type. Otherwise, it wouldn't compile with at least /bin/cc on
3568 ymp-cray-unicos9.0.2.X.
3569 Combine two mostly-identical uses of alloca into one.
3570 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
3572 2003-08-04 Dave Love <d.love@dl.ac.uk>
3576 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
3577 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
3578 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
3579 obsolete NLIST_NAME_UNION.
3580 [__GNU__]: Undef BSD and FSCALE.
3581 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
3583 2003-08-03 Paul Eggert <eggert@twinsun.com>
3585 * stdbool_.h (_Bool): Make it signed char, instead of
3586 an enum type, so that it's guaranteed to promote to int. See:
3587 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
3589 2003-07-31 Paul Eggert <eggert@twinsun.com>
3591 * strerror.c: Include config.h, limits.h. Declare sprintf.
3592 (strerror): Don't assume that a printable int fits in 14 bytes.
3594 2003-07-24 Derek Robert Price <derek@ximbiot.com>
3595 Bruno Haible <bruno@clisp.org>
3597 * getline.h (getline, getdelim): Change return type to ssize_t.
3598 * getline.c (getline, getdelim): Likewise.
3599 Remove _GNU_SOURCE define; now it's defined in config.h through
3602 2003-07-22 Paul Eggert <eggert@twinsun.com>
3604 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
3605 over-parenthesization in macros.
3607 Sync with coreutils.
3609 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
3612 Use `exit_failure' for xalloc and xmemcoll instead of their own
3613 private exit-failure variables.
3614 * xalloc.h (xalloc_exit_failure): Remove.
3615 * xmalloc.c: Likewise. Include exitfail.h.
3616 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
3617 * xmemcoll.h (xmemcoll_exit_failure): Remove.
3618 * xmemcoll.c: Likewise. Include exitfail.h.
3619 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
3621 2003-07-18 Paul Eggert <eggert@twinsun.com>
3623 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
3624 * closeout.c: Likewise. Include "closeout.h" right after config.h,
3625 to test that it can stand by itself. Include "exitfail.h".
3626 Clients should set exit_failure instead.
3627 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
3629 2003-07-18 Andreas Schwab <schwab@suse.de>
3631 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
3633 2003-07-18 Bruno Haible <bruno@clisp.org>
3635 * getndelim2.h: New file.
3636 * getndelim2.c: Make into a module of its own. Include config.h,
3638 (getndelim2): Make non-static. Change return type to ssize_t.
3639 * getline.h: Change argument names.
3640 * getline.c: Include getndelim2.h instead of getndelim2.c.
3641 * getnline.c: Include getndelim2.h.
3643 2003-07-17 Bruno Haible <bruno@clisp.org>
3645 * Makefile.am: Remove file.
3646 * Makefile.in: Remove file.
3648 2003-07-17 Bruno Haible <bruno@clisp.org>
3650 * getnline.h: New file.
3651 * getnline.c: New file.
3652 * getndelim2.c: New file, extracted from getline.c.
3653 (getndelim2): Renamed from getdelim2, with added nmax argument.
3654 * getline.c: Include getndelim2.c.
3655 (getdelim2): Moved out to getndelim2.c.
3656 (getline, getdelim): Update.
3658 2003-07-15 <karl@gnu.org>
3660 * vasnprintf.c: update from gettext.
3662 2003-07-15 Jim Meyering <jim@meyering.net>
3664 * makepath.c (make_path): Enclose diagnostic in _(...).
3666 2003-07-14 Paul Eggert <eggert@twinsun.com>
3668 * asnprintf.c, asprintf.c, config.charset, gettext.h,
3669 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
3670 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
3671 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
3672 vasprintf.c, vasprintf.h: Regenerate. These files are now being
3673 updated automatically by ../config/srclist-update. This changes
3674 their license from LPGL to GPL.
3676 2003-07-14 Jim Meyering <jim@meyering.net>
3678 Don't emit diagnostics. Let callers do that.
3679 * save-cwd.c: Don't include "error.h".
3680 (save_cwd): Don't call error. Ensure that errno is valid
3681 when returning nonzero.
3683 * save-cwd.h (restore_cwd): Update prototype.
3684 * save-cwd.c (restore_cwd): Remove two parameters.
3685 Simplify. Don't call error upon failure. Let callers do that.
3686 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
3687 when auditing is enabled. But don't bother updating the #if.
3689 2003-07-14 Simon Josefsson <jas@extundo.com>
3691 * mempcpy.h: New file.
3692 * mempcpy.c: New file.
3694 2003-07-14 Paul Eggert <eggert@twinsun.com>
3696 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
3697 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
3698 unicodeio.c, unicodeio.h, unlocked-io.h:
3699 Switch from LGPL to GPL.
3701 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
3703 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
3704 it breaks C++ compilation.
3705 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
3707 2003-07-10 Jim Meyering <jim@meyering.net>
3709 * vasnprintf.c: Remove trailing blanks.
3710 Make cpp indentation consistent.
3712 2003-07-09 Paul Eggert <eggert@twinsun.com>
3714 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
3715 posixver.c, strftime.c, strnlen.c, strverscmp.c:
3716 Switch from LGPL to GPL.
3718 2003-07-07 Paul Eggert <eggert@twinsun.com>
3720 * mktime.c: Fix some boundary cases and remove need for floating point.
3722 Issue a compile-time diagnostic if time_t is floating point, or if
3723 two's complement arithmetic is not in effect, or if arithmetic
3724 right shift does not propagate the sign. These assumptions were
3725 all in the original code but they weren't checked.
3727 (TIME_T_MIDPOINT, verify): New macros.
3728 (__isleap): Remove; it has integer overflow problems.
3729 (leapyear): New function, without those problems.
3730 (ydhms_tm_diff): Remove; splitting into two parts.
3731 (ydhms_diff): New function, containing the arithmetic part of
3732 the old ydhms_tm_diff function. Issue a compile-time
3733 diagnostic if we are not using C99 integer division.
3734 Avoid casts when possible.
3735 (guess_time_tm): New function, containing the checking part of
3736 the old ydhms_tm_diff function. Return the new value, rather than
3737 the difference between it and the old. Accept a new argument T
3738 so that *T specifies the old value. Check for overflow in the result.
3740 (__mktime_internal): Use a time_t offset, not a long int offset.
3741 This undoes the 2003-06-04 change, which is no longer needed now
3742 that we have better overflow checking.
3743 (localtime_offset): Likewise.
3745 (__mktime_internal): Avoid harmful overflow on hosts where time_t
3746 and long are 64-bit but int is only 32-bit.
3747 (ydhms_diff): Use long int to store year1 and yday1.
3748 Issue a compile-time diagnostic if long int is not wide enough.
3750 (__mktime_internal): Use long int to store adjusted year and yday.
3751 Use plain C rather than preprocessor commands, if that doesn't
3753 Check for overflow (and try to repair) after each probe
3754 rather than checking only at the very end. This avoids some bugs
3755 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
3756 does not equal GMT offset at maximum time).
3757 Use integer to check for overflow rather than floating point; this
3758 is more portable to non-IEEE hosts, and is a tad faster.
3759 When we detect that we are oscillating between two values,
3760 don't check whether tm_isdst has the requested value, since
3761 we already know the answer. When tm_isdst has the wrong value,
3762 use a different heuristic to find the right one, based on the
3763 extreme values actually observed in practice in tz2003a,
3764 rather than the (overly optimistic) "previous 3 calendar quarters".
3766 (not_equal_tm, print_tm, check_result): Use "const T" rather than
3767 "T const" to accommodate glibc style.
3768 (check_result): Use less-confusing report format. "long" -> "long int.
3770 Don't loop if the iteration overflows time_t.
3771 Allow a negative step in the iteration.
3773 2003-07-01 Paul Eggert <eggert@twinsun.com>
3775 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3776 having it depend on HAVE_SYS_TYPES_H.
3778 2003-06-25 Bruno Haible <bruno@clisp.org>
3780 * readlink.c: New file.
3782 2003-06-20 Bruno Haible <bruno@clisp.org>
3784 Assume C89, so PARAMS isn't needed.
3785 * unicodeio.h (PARAMS): Remove.
3786 * unicodeio.c: Don't use PARAMS.
3788 2003-06-18 Jim Meyering <jim@meyering.net>
3790 Merge changes from coreutils.
3791 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
3792 Remove explicit declarations of xmalloc and realloc.
3794 (read_utmp): Remove anachronistic cast of xmalloc.
3796 2003-06-17 Paul Eggert <eggert@twinsun.com>
3798 Assume C89, so PARAMS isn't needed.
3799 * backupfile.h (PARAMS): Remove. All uses removed.
3800 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
3801 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
3802 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
3803 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
3804 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
3805 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
3806 xstrtol.h: Likewise.
3807 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
3808 same.h, strverscmp.h: Do not include config.h; no longer needed.
3809 Anyway, config.h should always be included before any other file.
3811 2003-06-11 Simon Josefsson <jas@extundo.com>
3813 * sysexit_.h: New file.
3815 2003-05-20 Derek Price <derek@ximbiot.com>
3817 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
3819 2003-06-10 Simon Josefsson <jas@extundo.com>
3821 * strchrnul.h: New file.
3822 * strchrnul.c: New file.
3824 2003-06-10 Simon Josefsson <jas@extundo.com>
3826 * argp.h: New file, from glibc.
3827 * argp-ba.c: New file, from glibc.
3828 * argp-eexst.c: New file, from glibc.
3829 * argp-fmtstream.c: New file, from glibc.
3830 * argp-fmtstream.h: New file, from glibc.
3831 * argp-fs-xinl.c: New file, from glibc.
3832 * argp-help.c: New file, from glibc.
3833 * argp-namefrob.h: New file, from glibc.
3834 * argp-parse.c: New file, from glibc.
3835 * argp-pv.c: New file, from glibc.
3836 * argp-pvh.c: New file, from glibc.
3837 * argp-xinl.c: New file, from glibc.
3839 2003-06-07 Jim Meyering <jim@meyering.net>
3841 * readtokens.h: Put `Free Software Foundation, Inc.'
3842 in place of my name in the copyright comment.
3843 Remove definition and uses of __P.
3846 * stat.c: Don't declare xmalloc explicitly.
3847 Instead, include "xalloc.h".
3848 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
3849 xrealloc, and xcalloc return values.
3850 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
3852 * xgetcwd.h: Remove definition/uses of PARAMS.
3854 2003-06-06 Jim Meyering <jim@meyering.net>
3856 * stdbool_.h: Renamed from stdbool.h.in.
3858 2003-06-06 Jim Meyering <jim@meyering.net>
3860 Merge from coreutils.
3861 * same.c: (same_name): Declare *_basename locals to be `const'.
3862 Consolidate declarations and initializations of *_base* locals.
3864 Merge from coreutils.
3865 This avoids a core dump on systems without GNU putenv,
3866 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
3867 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
3868 (unsetenv): New static function, from GNU libc.
3869 (rpl_putenv): Use it.
3871 * modechange.c: Remove trailing blanks.
3873 Merge from coreutils.
3874 * fsusage.c: Remove declaration of statfs.
3875 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
3877 * posixtm.c: Include <stdbool.h> unconditionally.
3879 2003-06-05 Paul Eggert <eggert@twinsun.com>
3881 * mktime.c (__mktime_internal): When resolving a tm_isdst
3882 mismatch, look in future quarters as well as past. This fixes a
3883 bug when processing fall-backwards gaps immediately after a long
3884 period of daylight-saving time.
3886 * mktime.c: Assume freestanding C89 or better.
3887 (HAVE_LIMITS_H): Remove. Assume it's 1.
3888 (__P): Remove; not used.
3889 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
3890 (mktime, not_equal_tm, print_tm, check_result,
3891 main): Use prototypes. Use const * where appropriate.
3892 (main): Fix typo in testing code that uncovered by above changes.
3893 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
3895 2003-06-04 Paul Eggert <eggert@twinsun.com>
3897 * mktime.c: Fix Debian bug 177940
3898 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
3899 (localtime_offset): Now long int, not time_t, because we want it
3900 to be guaranteed to be signed. All uses changed.
3901 (__mktime_internal): If overflow would occur when adding offset,
3904 Merge 'human' changes from coreutils. Rewrite to support
3905 locale-specific notations like thousands separators.
3906 * human.c: Simplify authorship notice.
3907 Include human.h immediately after config.h.
3908 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
3909 <limits.h>: Do not include, since human.h does.
3910 (SIZE_MAX, UINTMAX_MAX): New macros.
3911 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
3912 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
3913 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
3914 (power_letter): Renamed from suffixes.
3915 (generate_suffix_backwards): Remove.
3916 (adjust_value): Now takes int style (because of human.h changes)
3917 and long double value (for greater precision on some platforms).
3918 (group_number): New function.
3919 (human_readable): Use it. Use integer options, not enum.
3920 Put the options before the sizes in the arg list.
3921 Support all the new options.
3922 The old human_readable function has been removed;
3923 use inttostr.h instead.
3924 (human_readable, default_block_size, humblock):
3925 Use uintmax_t, not int, for block sizes.
3926 (human_readable_inexact, block_size_types): Remove.
3927 (block_size_opts): New constant.
3928 (human_options): Renamed from human_block_size, with new signature
3929 that allows block sizes up to UINTMAX_MAX. All callers changed.
3930 * human.h: Add copyright and authorship notice.
3931 Include <limits.h> and <stdbool.h> unconditionally.
3932 (PARAMS): Remove. All uses removed.
3933 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
3934 (enum human_inexact_style): Remove tag; now a nameless enum.
3935 (human_floor, human_ceiling, human_round_to_even): Now have
3936 values 2, 0, 1 rather than -1, 1, 0.
3937 (human_group_digits, human_suppress_point_zero, human_autoscale,
3938 human_base_1024, human_SI, human_B): New constants.
3939 (human_readable_inexact, human_block_size): Remove.
3940 (human_readable): Size args are now uintmax_t, not int.
3941 (human_options): New decl.
3943 * exclude.c: (new_exclude, add_exclude): Remove casts that are
3944 unnecessary now that we assume C89 or better. This change
3945 imported from coreutils.
3947 * mktime.c (__mktime_internal): Do not reject negative timestamps
3948 arbitrarily. This is the same patch as 2003-05-28, but it got lost
3949 in the 2003-05-30 sync from glibc.
3951 .h files should stand alone, but we shouldn't include <sys/types.h>
3952 if we can get away with just <stddef.h>.
3954 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
3955 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
3956 rather than <sys/types.h>, as we merely need size_t.
3957 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
3959 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
3960 Include <stdio.h>, to get FILE.
3961 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
3962 memcasecmp.h has included <stddef.h> and all we need is size_t.
3963 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
3964 our interface, instead of including <sys/types.h>
3966 2003-06-02 Paul Eggert <eggert@twinsun.com>
3969 Fix some minor time-related bugs with POSIX time arguments.
3970 Some valid time stamps were being rejected (notably -1, and
3971 time stamps before 1900 on 64-bit hosts). And some invalid
3972 time stamps were being accepted, e.g. September 31.
3974 * posixtm.h (posixtime): Return bool instead of time_t, so
3975 that we can return (time_t) -1 successfully.
3976 * posixtm.c: Likewise.
3977 [HAVE_STDBOOL_H]: Include <stdbool.h>.
3978 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
3979 (t): Remove static var.
3980 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
3981 of static var. All uses changed.
3982 (year): Do not reject years before 1900; they can occur with
3984 (posix_time_parse): Do not check for out-of-range components;
3985 that is now the caller's responsibility, since our checks were
3986 only approximations.
3987 (posixtime): Use mktime to check for out-of-range components,
3988 since it knows them exactly.
3989 If mktime returns (time_t) -1, check whether an error actually occurred
3990 by invoking localtime on -1.
3991 (main) [TEST_POSIXTIME]: Check for input data errors, and report
3992 posixtime failures better.
3993 Improve the test data (in comments only).
3995 2003-05-30 <karl@gnu.org>
3997 * mktime.c: update from libc.
3999 2003-05-30 Bruno Haible <bruno@clisp.org>
4001 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
4002 * localcharset.h: Likewise.
4003 * localcharset.c: Likewise.
4005 2003-05-28 Paul Eggert <eggert@twinsun.com>
4007 Assume the headers required for C89 freestanding compilers.
4008 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
4009 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
4010 without checking for HAVE_LIMITS_H.
4011 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
4012 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
4014 * fatal.c: Include <stdarg.h> without checking for __STDC__.
4015 * exclude.c: Include <stdbool.h> unconditionally.
4016 * tempname.c: Include <stddef.h> unconditionally.
4017 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
4018 * modechange.c, rpmatch.c (NULL): Don't define, since
4019 <stddef.h> does that.
4020 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
4021 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
4022 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
4023 * xstrtol.c: Likewise.
4024 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
4025 * savedir.c: Include <stddef.h> instead of defining NULL.
4027 * addext.c (addext): Use assignment rather than cast, to avoid
4028 warnings on some platforms.
4030 * mktime.c (__mktime_internal): Do not reject negative timestamps
4033 2003-05-10 Bruno Haible <bruno@clisp.org>
4035 * linebreak.c (iconv_string_length): Don't return -1 just because the
4036 string is longer than 4 KB.
4038 2003-05-12 Jim Meyering <jim@meyering.net>
4040 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
4041 the space-padded-by-default conversion specifiers, %e, %k, %l.
4043 2003-05-03 Bruno Haible <bruno@clisp.org>
4045 Upgrade to Unicode-4.0.
4046 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
4047 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
4048 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
4049 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
4050 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
4051 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
4052 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
4053 Change width of U+E0100..U+E01EF from 1 to 0.
4055 2003-04-25 Bruno Haible <bruno@clisp.org>
4057 * copy-file.c: Include <stddef.h>, for size_t.
4059 2003-04-25 Jim Meyering <jim@meyering.net>
4061 * copy-file.c (copy_file_preserving): Declare buf_size to be
4062 of type size_t, not int.
4064 2003-04-11 Jim Meyering <jim@meyering.net>
4066 Merge changes from Coreutils.
4068 2003-03-22 Jim Meyering <jim@meyering.net>
4070 * strftime.c (widen): Cast alloca return value to proper type.
4072 2003-01-19 Ulrich Drepper <drepper@redhat.com>
4075 * strftime.c (my_strftime): Handle very large width
4076 specifications for numeric values correctly. Improve checks for
4079 2003-01-19 Jim Meyering <jim@meyering.net>
4081 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
4082 (nl_get_alt_digit) [! defined my_strftime]: Define.
4083 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
4084 _nl_get_alt_digit and _nl_get_walt_digit.
4086 * strftime.c (my_strftime): Merge in locale-related changes from libc.
4087 These changes have no effect outside of _LIBC.
4089 2003-04-10 Bruno Haible <bruno@clisp.org>
4091 * findprog.h: New file, from GNU gettext.
4092 * findprog.c: New file, from GNU gettext.
4094 2003-04-05 Jim Meyering <jim@meyering.net>
4096 Merge changes from Coreutils.
4098 * exclude.h (PARAMS): Remove definition and uses.
4099 * exclude.c: Remove uses of `PARAMS'.
4101 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
4102 Add test-cases for DOS filenames. Declare program_name.
4103 (main): Set up program_name. Patch by Rich Dawe.
4105 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4107 Use mntctl's return value to drive the entry-processing loop, since
4108 we can't rely on the value of the vmt_length member in the last
4109 entry. On some systems doing so could result in exhausting
4110 virtual memory. Based in part on a patch from Mike Jetzer.
4112 2003-04-04 Bruno Haible <bruno@clisp.org>
4114 * linebreak.h: New file, from GNU gettext.
4115 * linebreak.c: New file, from GNU gettext with slight modifications.
4116 * lbrkprop.h: New file, from GNU gettext.
4118 2003-04-03 Bruno Haible <bruno@clisp.org>
4120 * utf8-ucs4.h: New file, from GNU gettext.
4121 * utf16-ucs4.h: New file, from GNU gettext.
4122 * ucs4-utf8.h: New file, from GNU gettext.
4123 * ucs4-utf16.h: New file, from GNU gettext.
4125 2003-04-02 Bruno Haible <bruno@clisp.org>
4127 * binary-io.h: New file, from GNU gettext.
4129 2003-04-01 Bruno Haible <bruno@clisp.org>
4131 * pathname.h: New file, from GNU gettext.
4132 * concatpath.c: New file, from GNU gettext.
4134 2003-03-30 Bruno Haible <bruno@clisp.org>
4136 * copy-file.c (copy_file_preserving): Don't set owner if the function
4137 chown() doesn't exist.
4139 2003-03-28 Bruno Haible <bruno@clisp.org>
4141 * copy-file.h: New file, from GNU gettext.
4142 * copy-file.c: New file, from GNU gettext.
4144 2003-03-18 Jim Meyering <jim@meyering.net>
4146 * quote.c (quote_n): Fix typo in comment.
4148 2003-03-14 Jim Meyering <jim@meyering.net>
4150 Merge changes from Coreutils.
4151 * obstack.h (obstack_object_size): Declare temporary, __o,
4152 to be const, in order to avoid warnings.
4153 (obstack_room): Likewise.
4154 (obstack_empty_p): Likewise.
4156 2003-03-13 Paul Eggert <eggert@twinsun.com>
4158 Merge changes from Bison.
4159 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
4160 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
4161 when compiling Bison 1.875's `bitset bset = obstack_alloc
4162 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
4163 * hash.c: Include <stdbool.h> unconditionally.
4165 2003-03-09 Paul Eggert <eggert@twinsun.com>
4167 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
4168 Reported by Bruce Becker; see:
4169 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
4171 2003-03-03 Paul Eggert <eggert@twinsun.com>
4172 Bruno Haible <bruno@clisp.org>
4174 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
4175 Reported by John Hughes, see
4176 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
4178 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
4180 * poll_.h: New file.
4183 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
4185 * mathl.h: New file.
4186 * acosl.c: New file.
4187 * asinl.c: New file.
4188 * atanl.c: New file.
4189 * ceill.c: New file.
4192 * floorl.c: New file.
4193 * frexpl.c: New file.
4194 * ldexpl.c: New file.
4196 * sincosl.c: New file.
4198 * sqrtl.c: New file.
4200 * trigl.c: New file.
4201 * trigl.h: New file.
4203 2003-02-17 Bruno Haible <bruno@clisp.org>
4205 * mkdtemp.h: New file, from GNU gettext.
4206 * mkdtemp.c: New file, from GNU gettext.
4208 2003-01-31 Bruno Haible <bruno@clisp.org>
4210 * rename.c: #undef rename before defining rpl_rename.
4211 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
4213 2003-01-30 Bruno Haible <bruno@clisp.org>
4215 * printf-args.h: New file, from GNU gettext.
4216 * printf-args.c: New file, from GNU gettext.
4217 * printf-parse.h: New file, from GNU gettext.
4218 * printf-parse.c: New file, from GNU gettext.
4219 * vasnprintf.h: New file, from GNU gettext.
4220 * vasnprintf.c: New file, from GNU gettext.
4221 * asnprintf.c: New file, from GNU gettext.
4222 * vasprintf.h: New file, from GNU gettext with modifications.
4223 * vasprintf.c: New file, from GNU gettext.
4224 * asprintf.c: New file, from GNU gettext.
4226 2003-01-29 Bruno Haible <bruno@clisp.org>
4228 * stpncpy.h: New file, from GNU gettext with modifications.
4229 * stpncpy.c: New file, from GNU gettext with modifications.
4231 2003-01-28 Bruno Haible <bruno@clisp.org>
4233 * c-ctype.h: New file, from GNU gettext, with changes suggested by
4235 * c-ctype.c: New file, from GNU gettext, with changes suggested by
4238 2003-01-27 Bruno Haible <bruno@clisp.org>
4240 * xsetenv.h: New file, from GNU gettext.
4241 * xsetenv.c: New file, from GNU gettext.
4243 2003-01-23 Bruno Haible <bruno@clisp.org>
4245 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
4247 2003-01-22 Bruno Haible <bruno@clisp.org>
4249 * exit.h: New file, from GNU gettext.
4251 2003-01-11 Bruno Haible <bruno@clisp.org>
4253 * stpcpy.h (stpcpy): Use ANSI C function declarations.
4254 * strcase.h (strcasecmp, strncasecmp): Likewise.
4256 2003-01-14 Jim Meyering <jim@meyering.net>
4258 * same.c (same_name): Tweak a comment.
4260 2003-01-11 Bruno Haible <bruno@clisp.org>
4262 * same.c (same_name): Reorder tests so as to avoid calling stat()
4263 when a string comparison is sufficient.
4265 2003-01-11 Bruno Haible <bruno@clisp.org>
4267 * readtokens.c (readtoken): Cast character to 'unsigned char', not
4270 2003-01-11 Bruno Haible <bruno@clisp.org>
4272 * hash-pjw.c: Add comment about low quality of this function.
4274 2003-01-12 Paul Eggert <eggert@twinsun.com>
4276 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
4277 to avoid collisions with libcurses and libreadline.
4279 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
4280 * getstr.h, getstr.c: Remove.
4281 * getline.c: Include "getline.h", to check interface.
4282 Move body of old getstr.c here: this defines MIN_CHUNK and
4283 declares getdelim2, which is renamed from getstr.
4284 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
4286 * linebuffer.c (readlinebuffer): Renamed from readline.
4288 * linebuffer.h: Likewise.
4289 (readline): Remove backward-compatibility macro.
4291 2003-01-12 Jim Meyering <jim@meyering.net>
4293 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
4295 2003-01-10 Bruno Haible <bruno@clisp.org>
4297 * alloca_.h: New file.
4298 * getdate.y: Unconditionally include alloca.h.
4299 * makepath.c: Likewise.
4300 * setenv.c: Likewise.
4301 * userspec.c: Likewise.
4303 2003-01-09 Bruno Haible <bruno@clisp.org>
4305 * stdbool.h.in: New file.
4307 2003-01-08 Bruno Haible <bruno@clisp.org>
4309 * safe-read.c: Include specification header first, to ensure its
4311 * full-write.c: Likewise.
4313 2003-01-08 Jim Meyering <jim@meyering.net>
4315 * full-write.c: Undefine and define-away `const' after inclusion
4316 of errno.h, not before. Suggestion from Bruno Haible.
4318 2003-01-07 Jim Meyering <jim@meyering.net>
4320 * full-write.c: Rework so that it may serve to define full_read, too.
4321 * full-read.c: Simply #define FULL_READ and include full-write.c.
4323 2003-01-06 Jim Meyering <jim@meyering.net>
4325 * version-etc.c: Update year in translatable copyright string.
4327 2002-12-25 Bruno Haible <bruno@clisp.org>
4329 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
4330 * xstrtol.h: Likewise.
4331 * xstrtoimax.c: Likewise.
4332 * xstrtoumax.c: Likewise.
4333 * human.h: Likewise.
4335 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
4336 on systems that have <inttypes.h> but not <stdint.h>.
4338 2002-12-31 Paul Eggert <eggert@twinsun.com>
4340 * memcoll.c (memcoll): Fall back on a simple algorithm using
4341 memcmp if strcoll doesn't work.
4343 2002-12-23 Bruno Haible <bruno@clisp.org>
4345 * localcharset.h: New file.
4346 * localcharset.c: Include it.
4347 * unicodeio.c: Likewise.
4349 2002-12-22 Bruno Haible <bruno@clisp.org>
4351 * utime.c (utime_null): No need to call ftruncate if the file was
4354 2002-12-23 Bruno Haible <bruno@clisp.org>
4356 * memcoll.c (STRCOLL): New macro.
4359 2002-12-22 Bruno Haible <bruno@clisp.org>
4361 * getstr.h (getstr): Define, to avoid clash with libcurses.
4362 * linebuffer.h (readline): Define, to avoid clash with libreadline.
4364 2002-12-22 Bruno Haible <bruno@clisp.org>
4366 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
4368 2002-12-23 Bruno Haible <bruno@clisp.org>
4370 * getline.h: Include <stddef.h>, for size_t.
4372 * unicodeio.h: Include <stddef.h>, for size_t.
4373 * unicodeio.c: Don't include <stddef.h>.
4375 2002-12-17 Bruno Haible <bruno@clisp.org>
4377 * canon-host.c (strdup): Remove unused declaration.
4379 * fsusage.c: Include full_read.h.
4380 (get_fs_usage): Use full_read instead of safe_read.
4382 * utime.c (utime_null): Use SAFE_READ_ERROR.
4384 2002-12-11 Bruno Haible <bruno@clisp.org>
4386 * setenv.h: Rewritten to cope with systems that have setenv() but not
4388 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
4391 2002-12-11 Bruno Haible <bruno@clisp.org>
4393 * setenv.c (alloca): Fall back to malloc.
4395 (setenv): Use freea() to free memory allocated with alloca().
4397 2002-11-13 Bruno Haible <bruno@clisp.org>
4399 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
4400 function declarations.
4401 * unsetenv.c (unsetenv): Likewise.
4403 2002-03-04 Bruno Haible <bruno@clisp.org>
4405 Portability to AIX 4.3.3.
4406 * unsetenv.c: New file, extracted from setenv.c.
4407 * setenv.c: Move the unsetenv() function to unsetenv.c.
4409 2001-12-20 Bruno Haible <bruno@clisp.org>
4411 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
4412 use malloc instead. For SunOS 4.
4414 2001-12-11 Bruno Haible <bruno@clisp.org>
4416 * setenv.c: Declare alloca.
4417 (compar_fn_t): New typedef.
4418 (KNOWN_VALUE, STORE_VALUE): Use it.
4420 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
4423 2002-12-10 Paul Eggert <eggert@twinsun.com>
4425 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
4426 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
4427 Choose values that are less likely to collide with system fnmatch
4429 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
4430 defined (e.g., a pure POSIX system).
4431 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
4432 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
4434 2002-12-06 Jim Meyering <jim@meyering.net>
4436 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
4438 Merge in changes from libc's misc/error.c, in preparation
4439 for the merge of gnulib's changes back into libc.
4441 * error.c (_): Define only if not already defined.
4442 Move definition to follow all #include directives.
4443 Include unlocked-io.h only if !_LIBC.
4444 [_LIBC]: Include <libio/libioP.h>.
4445 [USE_IN_LIBIO]: Include <libio/iolibio.h>
4446 (fflush): Tweak definition to use INTUSE.
4449 2002-12-05 Paul Eggert <eggert@twinsun.com>
4451 * alloca.c [defined emacs]: Include "lisp.h".
4452 (xalloc_die) [defined emacs]: New macro.
4453 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
4454 [! defined emacs]: Include <xalloc.h>.
4455 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
4456 (pointer): Typedef to POINTER_TYPE *.
4457 (malloc): Remove decl; we now always use xmalloc.
4458 (alloca): Use old-style definition, since Emacs needs this.
4459 Check for arithmetic overflow when computing combined size.
4461 2002-12-04 Paul Eggert <eggert@twinsun.com>
4463 Do not generate unlocked-io.h automatically, since it's easier to
4464 maintain it by hand.
4466 * unlocked-io.h: New file, from GNU diffutils,
4467 but with proper copyright notice and attribution.
4469 * Makefile.am: Add copyright notice.
4470 (libfetish_a_SOURCES): Add unlocked-io.h.
4471 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
4472 (DISTCLEANFILES, io_functions): Remove macros.
4473 (EXTRA_DIST): Remove gen_uio.
4474 (unlocked-io.h): Remove rule.
4476 2002-12-04 Jim Meyering <jim@meyering.net>
4478 Reflect the fact that stat.c and lstat.c are no longer generated.
4479 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
4480 (DISTCLEANFILES): Likewise.
4481 (EXTRA_DIST): Likewise.
4482 (all_local): Don't depend on stat.c or lstat.c.
4483 (stat.c, lstat.c): Remove rules.
4484 (EXTRA_DIST): Remove xstat.in.
4486 * xstat.in: Remove file. Contents moved into stat.c.
4487 * stat.c: New file. Contents mostly from xstat.in.
4488 * stat.c: Rework so that it may serve to define rpl_lstat, too.
4489 * lstat.c: New file. Simply #define LSTAT and include stat.c.
4491 * safe-read.c: Rework so that it may serve to define safe_write, too.
4492 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
4494 2002-12-03 Jim Meyering <jim@meyering.net>
4496 * safe-read.c, safe-write.c: Change variable names and comments, but
4497 not semantics, to minimize the differences between these two files.
4498 (safe_read): Change comment to mention SAFE_READ_ERROR.
4500 * safe-read.c (IS_EINTR): Define.
4501 (safe_read): Use IS_EINTR in place of in-function cpp directives.
4503 2002-12-02 Bruno Haible <bruno@clisp.org>
4505 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
4506 Define, taken from safe-read.c.
4507 (INT_MAX): Provide fallback.
4508 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
4509 * safe-write.h (SAFE_WRITE_ERROR): Define.
4511 * safe-read.c (EINTR): Remove definition.
4512 (safe_read): Don't use EINTR if it is absent.
4514 2002-12-02 Jim Meyering <jim@meyering.net>
4516 * safe-read.c (EINTR): Define.
4517 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4518 (INT_MAX): Provide fallback.
4519 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
4521 * safe-read.h (SAFE_READ_ERROR): Define.
4523 2002-12-01 Jim Meyering <jim@meyering.net>
4525 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
4526 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
4528 2002-11-27 Paul Eggert <eggert@twinsun.com>
4530 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4531 hash_rehash): Replace `if (limit <= value) abort ();' with
4532 `if (! (value < limit)) abort ();', for readability.
4534 2002-11-26 <karl@gnu.org>
4536 * strdup.c: copy from libc again, with jim's ok.
4537 * .cppi-disable: re-add strdup.c
4539 2002-11-25 <karl@gnu.org>
4541 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
4542 instead of "strtol.c".
4544 2002-11-25 Jim Meyering <jim@meyering.net>
4546 * mktime.c: Sync from libc, now that it has the latest fix.
4548 2002-11-24 <karl@gnu.org>
4550 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
4551 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
4553 2002-11-24 Jim Meyering <jim@meyering.net>
4555 Update from coreutils:
4557 * mktime.c: Merge in changes from libc.
4559 Avoid a link-time failure on some Linux systems.
4560 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
4561 (__mon_yday): Declare with the STATIC attribute.
4562 (__mktime_internal): Likewise.
4563 Based on a report from Greg Schafer.
4565 2002-11-23 Jim Meyering <jim@meyering.net>
4567 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
4568 Use `unsigned', not `int', as type of index.
4570 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
4572 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
4574 2002-11-22 Paul Eggert <eggert@twinsun.com>
4576 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
4577 hint that one should use `if (! x) abort ();' rather than `assert
4578 (x);', and anyway it's one less thing to worry about configuring.
4579 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4580 hash_rehash, hash_insert): Use abort rather than assert.
4582 2002-11-22 Paul Eggert <eggert@twinsun.com>
4584 * quotearg.h: Allow multiple inclusion by surrounding with
4585 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
4586 so that we can be included first.
4587 (PARAMS): Remove; we now assume C89 or later. All uses removed.
4588 * quotearg.c: Include quotearg.h immediately after config.h.
4589 No need to include stddef.h or sys/types.h any more.
4590 Surround local include files with "", not "<>".
4591 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
4592 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
4593 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
4594 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
4595 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
4596 (ISPRINT): Remove; no longer needed now that we assume C89.
4598 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
4601 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
4602 quotearg_char): Use SIZE_MAX rather than
4603 (size_t) -1 when we are talking about "infinity".
4605 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
4607 2002-11-22 Bruno Haible <bruno@clisp.org>
4609 * safe-read.h: Assume C89. Add comments.
4610 (safe_read): Change return type to size_t.
4611 * safe-read.c (safe_read): Change return type to size_t. Handle byte
4612 counts > SSIZE_MAX correctly.
4613 * safe-write.h: New file.
4614 * safe-write.c: New file.
4615 * full-read.h: New file.
4616 * full-read.c: New file.
4617 * full-write.h: Assume C89. Add comments.
4618 * full-write.c: Include safe-write.h.
4619 (full_write): Rewritten to use safe_write.
4620 Suggested by Jim Meyering and Paul Eggert.
4622 2002-11-21 Bruno Haible <bruno@clisp.org>
4624 Remove case insensitive option matching.
4625 * argmatch.h (argcasematch): Remove declaration.
4626 (ARGCASEMATCH): Remove macro.
4627 (__xargmatch_internal): Remove case_sensitive argument.
4628 (XARGMATCH): Update.
4629 (XARGCASEMATCH): Remove macro.
4630 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
4631 case_sensitive argument.
4632 (argcasematch): Remove function.
4633 (__xargmatch_internal): Remove case_sensitive argument.
4634 (main): Use XARGMATCH instead of XARGCASEMATCH.
4636 * xmalloc.c: Change compile-time error message. Add comment about
4637 required autoconf version.
4639 2002-11-21 Jim Meyering <jim@meyering.net>
4641 * strdup.c (strdup): Tweak comment and initial #if/#include.
4643 Merge in changes from the coreutils.
4645 2002-09-25 Paul Eggert <eggert@twinsun.com>
4646 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
4647 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
4648 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
4649 int. Work more efficiently if X is the same width as uintmax_t.
4650 Do not compare X to -1, to avoid bogus compiler warning.
4651 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
4652 Don't assume that f_frsize and f_bsize are the same type.
4654 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
4657 * makepath.c (make_path): Restore umask *before* creating the final
4659 (make_path): Minor reformatting.
4661 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
4662 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
4664 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
4665 ones. At least on GNU/Linux systems, `auto' means something else.
4668 2002-11-20 Paul Eggert <eggert@twinsun.com>
4670 Merge argmatch cleanups from Bison. Assume C89.
4672 * argmatch.c: Include config.h here, not in argmatch.h.
4673 Include stdlib.h, for EXIT_FAILURE.
4674 Always include <string.h>, since we assume C89.
4675 (EXIT_FAILURE): Remove pre-C89 bug workaround.
4676 * argmatch.h: Do not include <config.h> or <sys/types.h>.
4677 Include <stddef.h> instead, since it's all we need for size_t.
4678 (PARAMS): Remove. All uses removed.
4679 (ARRAY_CARDINALITY): Do not bother to #undef.
4680 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
4681 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4682 Remove unnecessary parentheses.
4683 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4684 Insert necessary parentheses.
4685 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
4686 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
4688 2002-11-19 Bruno Haible <bruno@clisp.org>
4690 * mbswidth.c: Include mbswidth.h right at the beginning.
4691 * mbswidth.h: Include <stddef.h>, for size_t.
4693 * mbswidth.h (PARAMS): Remove macro.
4694 (mbswidth, mbsnwidth): Use ANSI C function declarations.
4695 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
4697 * gcd.h (PARAMS): Remove macro.
4698 (gcd): Use ANSI C function declarations.
4699 * gcd.c (gcd): Likewise.
4701 2002-11-15 Bruno Haible <bruno@clisp.org>
4703 * strcspn.c: Include <stddef.h>.
4704 (strcspn): Use ANSI C function declaration. Change return type to
4706 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
4707 (strpbrk): Use NULL.
4708 * strpbrk.h (PARAMS): Remove macro.
4709 (strpbrk): Use ANSI C function declaration.
4710 * strstr.c: Don't include <sys/types.h>.
4711 * strstr.h (PARAMS): Remove macro.
4712 (strstr): Use ANSI C function declarations.
4714 2002-11-06 Bruno Haible <bruno@clisp.org>
4716 * gcd.h (gcd): Change argument type to 'unsigned long'.
4717 * gcd.c (gcd): Likewise.
4719 2002-11-05 Bruno Haible <bruno@clisp.org>
4721 * gcd.h: New file, from gettext-0.11.5.
4722 * gcd.c: New file, from gettext-0.11.5.
4724 2002-11-05 Bruno Haible <bruno@clisp.org>
4726 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4727 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4728 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4729 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4731 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4732 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4734 * closeout.c: Include gettext.h instead of <libintl.h>.
4735 * human.c: Include gettext.h instead of <libintl.h>.
4736 * quotearg.c: Include gettext.h instead of <libintl.h>.
4737 * rpmatch.c: Include gettext.h instead of <libintl.h>.
4738 * unicodeio.c: Include gettext.h instead of <libintl.h>.
4739 * userspec.c: Include gettext.h instead of <libintl.h>.
4740 * version-etc.c: Include gettext.h instead of <libintl.h>.
4741 * xmalloc.c: Include gettext.h instead of <libintl.h>.
4742 (textdomain): Remove definition.
4743 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
4745 * long-options.c: Remove include of <libintl.h> and definition of _.
4746 * same.c: Remove include of <libintl.h> and definition of _.
4748 2002-11-04 Bruno Haible <bruno@clisp.org>
4750 * stpcpy.h: New file, from GNU gettext-0.11.5.
4751 * strcase.h: New file, from GNU gettext-0.11.5.
4752 * strpbrk.h: New file, from GNU gettext-0.11.5.
4753 * strstr.h: New file, from GNU gettext-0.11.5.
4754 * xgetcwd.h: New file, from GNU gettext-0.11.5.
4756 2002-05-09 Bruno Haible <bruno@clisp.org>
4758 * config.charset: Update for newest glibc. Add canonical names
4759 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
4761 2002-05-09 Bruno Haible <bruno@clisp.org>
4763 * localcharset.c (get_charset_aliases): Add more Windows specific
4766 2002-05-08 Owen Taylor <otaylor@redhat.com>
4768 * config.charset: A few additions for Solaris.
4770 2001-12-05 Bruno Haible <bruno@clisp.org>
4772 * localcharset.c (locale_charset): Don't return an empty string.
4774 2001-10-23 Bruno Haible <haible@clisp.cons.org>
4776 * config.charset: msdos in uk_UA uses CP1125.
4778 2001-08-05 Bruno Haible <haible@clisp.cons.org>
4780 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
4781 * localcharset.c (locale_charset): Declare as extern "C".
4783 2002-02-15 Bruno Haible <bruno@clisp.org>
4785 * config.charset [msdosdjgpp]: For Russian, use CP866.
4787 2002-02-11 Bruno Haible <bruno@clisp.org>
4789 * config.charset: Add support for NetBSD.
4791 2002-09-25 <karl@gnu.org>
4793 * strdup.c: copy from libc/string (via ../config/srclist*).
4794 * getopt*: copy from libc/posix.
4795 * gettext.h: copy from gettext.
4796 * .cppi-disable: add strdup.c, gettext.h.
4798 2002-07-01 Jim Meyering <meyering@lucent.com>
4800 * c-stack.c: Include sys/time.h.
4801 From Volker Borchert.
4803 2002-06-11 Paul Eggert <eggert@twinsun.com>
4805 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
4806 New macro. Use it uniformly instead of
4807 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
4808 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
4809 reported by Vin Shelton.
4811 2002-06-22 Jim Meyering <meyering@lucent.com>
4813 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
4814 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
4816 2002-06-22 Paul Eggert <eggert@twinsun.com>
4818 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
4819 Do not assume SA_SIGINFO behavior.
4820 Bug reported by Jim Meyering on NetBSD 1.5.2.
4822 2002-06-22 Jim Meyering <meyering@lucent.com>
4824 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
4826 * exitfail.c, exitfail.h: Likewise.
4827 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
4829 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
4831 (EXTRA_DIST): Add fnmatch_loop.c.
4832 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
4834 * fnmatch_loop.c: New file, from diffutils-2.8.2.
4835 * fnmatch.c: Update from diffutils-2.8.2.
4836 * fnmatch_.h: New file. From diffutils-2.8.2.
4837 * fnmatch.h: Remove file.
4839 2002-06-18 Paul Eggert <eggert@twinsun.com>
4841 * file-type.h: Report an error if neither S_ISREG nor
4842 S_IFREG is defined, instead of using a test specific to glibc
4843 2.2. This should be safe, since POSIX requires S_ISREG and
4844 Unix Version 7 had S_IFREG. We don't need to check for
4845 <sys/types.h> since we don't use any symbols that it defines.
4847 2002-06-15 Jim Meyering <meyering@lucent.com>
4849 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
4850 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
4851 have been included before this file.
4853 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
4855 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
4856 so that each temporary file name is unique and valid in the first
4857 8 characters, for operation under DOS.
4859 2002-06-15 Jim Meyering <meyering@lucent.com>
4861 Work even with DJGPP 2.03, which lacks support for symlinks.
4863 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
4865 * lchown.c (S_ISLNK): Likewise.
4867 2002-06-14 Jim Meyering <meyering@lucent.com>
4869 * file-type.h: Use the version from diffutils-2.8.2.
4870 * file-type.c: Likewise.
4872 2002-05-27 Jim Meyering <meyering@lucent.com>
4874 Fix a problem seen only on nonconforming systems whereby ls.c's
4875 use of localtime, and then of gettimeofday would cause trouble:
4876 the localtime call used to initialize rpl_gettimeofday's save
4877 mechanism would clobber ls's current local time information so
4878 that in any long listing the first file would always be listed
4879 with date 1970-01-01. Analysis by Volker Borchert.
4881 * gettimeofday.c (localtime): Undefine.
4882 (rpl_localtime): New function.
4884 2002-05-22 Jim Meyering <meyering@lucent.com>
4886 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
4887 * file-type.h: New file.
4888 * file-type.c (file_type): New file/function. Extracted from diffutils.
4890 2002-04-29 Paul Eggert <eggert@twinsun.com>
4892 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
4894 2002-04-28 Paul Eggert <eggert@twinsun.com>
4896 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
4897 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
4898 of 127, since 64 is the largest conceivable number for ancient
4900 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
4902 2002-04-28 Jim Meyering <meyering@lucent.com>
4904 * sig2str.c (WTERMSIG): Remove definition (unused).
4906 2002-04-28 Paul Eggert <eggert@twinsun.com>
4908 * sig2str.h, sig2str.c: New files.
4909 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
4911 2002-04-24 Jim Meyering <meyering@lucent.com>
4913 * gettext.h: New file, from Gettext.
4914 * Makefile.am (INCLUDES): Remove -I../intl.
4915 (libfetish_a_SOURCES): Add gettext.h.
4917 2002-04-16 Jim Meyering <meyering@lucent.com>
4919 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
4920 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
4921 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
4923 2002-04-12 Jim Meyering <meyering@lucent.com>
4925 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
4927 2002-03-10 Jim Meyering <meyering@lucent.com>
4929 * makepath.c (make_path): Remove a comma from a diagnostic.
4930 Suggestion from Santiago Vila.
4932 2002-03-08 Jim Meyering <meyering@lucent.com>
4934 * rename.c: Mention that this wrapper is needed also on
4935 mips-dec-ultrix4.4 systems.
4937 2002-03-02 Jim Meyering <meyering@lucent.com>
4939 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
4940 not HAVE_CLOCK_SETTIME.
4942 2002-02-27 Paul Eggert <eggert@twinsun.com>
4944 * nanosleep.h: Rename to....
4945 * timespec.h: New name for nanosleep.h. All uses changed.
4947 * gettime.c: New file.
4948 * settime.c: New file.
4951 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
4952 timespec.h. Remove nanosleep.h.
4954 2002-02-25 Paul Eggert <eggert@twinsun.com>
4956 * acl.c, acl.h: New files.
4957 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
4959 2002-02-24 Jim Meyering <meyering@lucent.com>
4961 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
4962 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
4963 cause trouble. Reported by Nelson Beebe.
4965 2002-02-23 Paul Eggert <eggert@twinsun.com>
4967 * path-concat.c (xpath_concat): Reorder code to pacify
4968 compilers that don't know that xalloc_die never returns.
4970 2002-02-20 Jim Meyering <meyering@lucent.com>
4972 * getdate.c: Regenerate using bison-1.33.
4974 2002-02-15 Paul Eggert <eggert@twinsun.com>
4976 * posixver.c, posixver.h: New files.
4977 * Makefile.am (libfetish_a_SOURCES): Add them.
4979 2002-02-02 Paul Eggert <eggert@twinsun.com>
4980 Bruno Haible <bruno@clisp.org>
4982 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
4983 (fwrite_success_callback): New declaration.
4984 * unicodeio.c (unicode_to_mb): New function, extracted from
4985 print_unicode_char. Call failure callback instead of error.
4986 (fwrite_success_callback): New function.
4987 (exit_failure_callback): New function.
4988 (fallback_failure_callback): New function.
4989 (print_unicode_char): Call unicode_to_mb.
4991 2002-01-26 Jim Meyering <meyering@lucent.com>
4993 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
4995 2002-01-22 Jim Meyering <meyering@lucent.com>
4997 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
4998 Otherwise, some versions of automake would omit the rule that makes
4999 Makefile from Makefile.in.
5001 2001-01-21 Paul Eggert <eggert@twinsun.com>
5003 * xmemcoll.h, xmemcoll.c: New files.
5004 * Makefile.am (libfetish_a_SOURCES): Add them.
5005 * memcoll.c: Include errno.h, and declare errno if not defined.
5006 (memcoll): Set errno to zero if there is no error.
5008 * quotearg.c (quotearg_buffer_restyled):
5009 Fix bug with quoting buffers containing NUL when backslashing escapes.
5010 This bug was exposed by the other changes in this patch.
5011 (quotearg_n_options): New arg ARGSIZE.
5012 All callers changed.
5013 (quoting_options_from_style): New function.
5014 (quotearg_n_style): Use it.
5015 (quotearg_n_style_mem): New function.
5017 * quotearg.h (quotearg_n_style_mem): New function.
5019 2002-01-16 Jim Meyering <meyering@lucent.com>
5021 * getdate.y: Add three semicolons, each just before a closing brace.
5022 Bison (as of version 1.31) no longer papers over that mistake.
5024 2002-02-14 Paul Eggert <eggert@twinsun.com>
5026 * backupfile.c (ISDIGIT): Comment fix.
5027 * getdate.y (ISDIGIT): Likewise.
5028 * posixtm.c (ISDIGIT, year): Likewise.
5029 * strverscmp.c (ISDIGIT): Likewise.
5030 * userspec.c (ISDIGIT): Likewise.
5032 2002-01-05 Jim Meyering <meyering@lucent.com>
5034 * version-etc.c (version_etc_copyright): Update copyright year.
5036 2001-01-19 Paul Eggert <eggert@twinsun.com>
5038 * closeout.c (close_stdout_status): If ferror (stdout), do
5039 not silently exit merely because the output buffer happens to
5040 have nothing pending.
5042 2001-12-18 Paul Eggert <eggert@twinsun.com>
5044 See the big note in ../ChangeLog.
5045 * human.c (suffixes): Prefer K to k for 1024.
5046 (generate_suffix_backwards): New function.
5047 (human_readable_inexact): Use it.
5048 * xstrtol.c (__xstrtol): If there is no number but there
5049 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
5050 Accept 'K' as well as 'k'.
5052 2001-12-15 Jim Meyering <meyering@lucent.com>
5054 * regex.h (__restrict_arr): Update from libc.
5056 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
5057 as `remote' if the name starts with `//'. Suggested by Michael Stone.
5060 2001-12-10 Jim Meyering <meyering@lucent.com>
5062 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
5063 Instead, include "xalloc.h".
5064 (initbuffer): Don't cast xmalloc return value to char*.
5065 (readline): Reword comment.
5066 Don't cast xrealloc return value to char*
5069 2001-12-09 Jim Meyering <meyering@lucent.com>
5071 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
5072 `signed and unsigned type in conditional expression'.
5073 * posixtm.c (posix_time_parse): Likewise.
5075 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
5077 * readtokens.c (readtoken): Declare an index to be of type unsigned
5078 to avoid a pedantic warning.
5080 * getstr.c: Don't include assert.h.
5081 (getstr): Remove warning-evoking assertions.
5082 Return -1 if offset parameter is out of bounds.
5083 Change the type of a local from int to size_t.
5085 * strftime.c (my_strftime_localtime_r): Include this function
5086 definition in the `#if ! HAVE_TM_GMTOFF' block.
5088 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
5089 Include xalloc.h instead.
5091 2001-12-02 Jim Meyering <meyering@lucent.com>
5093 * tempname.c: Don't declare getenv, thus reverting the change of
5094 2001-11-18. It's no longer necessary, now that stdlib.h is always
5097 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
5098 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
5100 2001-11-30 Akim Demaille <akim@epita.fr>
5102 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
5103 before being defined.
5105 2001-11-27 Paul Eggert <eggert@twinsun.com>
5107 * quotearg.h (quotearg_n, quotearg_n_style):
5108 First arg is int, not unsigned.
5109 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
5110 (SIZE_MAX, UINT_MAX): New macros.
5111 (quotearg_n_options): Abort if N is negative.
5112 Avoid overflow check on hosts where size_t is 64 bits and int
5113 is 32 bits, as overflow is impossible there.
5114 Fix off-by-one typo that caused unnecessary reallocation.
5116 2001-11-27 Jim Meyering <meyering@lucent.com>
5118 * tempname.c: Merge with version from libc.
5119 * regex.c: Likewise.
5121 * tempname.c: Include stdlib.h unconditionally. On some old systems
5122 for which STDC_HEADERS is 0, it was not included, resulting in a
5123 warning about an integer-to-pointer conversion problem with getenv.
5124 Reported by Volker Borchert.
5126 2001-11-26 Jim Meyering <meyering@lucent.com>
5128 * gtod.h: Remove file.
5129 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
5130 * gettimeofday.c: Don't include gtod.h.
5131 (GTOD_init): Remove function.
5132 (rpl_gettimeofday): Do its job here instead, rather than aborting.
5133 Suggestion from Volker Borchert.
5135 2001-11-23 Jim Meyering <meyering@lucent.com>
5137 * hash.h (struct hash_table): Don't define here. Merely declare it.
5138 * hash.c (struct hash_table): Define it here instead.
5140 2001-11-22 Jim Meyering <meyering@lucent.com>
5142 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
5144 2001-11-18 Paul Eggert <eggert@twinsun.com>
5146 * tempname.c (TMP_MAX): Remove; no longer needed.
5147 (TEMPORARIES): New macro.
5148 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
5149 removes an artificial limitation (e.g. HP-UX 10.20, where
5152 2001-11-18 Jim Meyering <meyering@lucent.com>
5154 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
5157 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
5158 files will be created before anything else.
5160 2001-11-17 Jim Meyering <meyering@lucent.com>
5162 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
5163 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
5164 rather than group writable. Patch by Juan F. Codagnone.
5166 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
5167 Instead, include "xalloc.h".
5169 * mountlist.c: Include unlocked-io.h after all system headers.
5170 Remove explicit declarations of xmalloc, xrealloc,
5171 and xstrdup. Instead, include "xalloc.h".
5173 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
5174 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
5175 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
5177 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
5178 Reported by Padraig Brady.
5180 * mkstemp.c: #undef mkstemp.
5182 (rpl_mkstemp): Rename from mkstemp.
5185 2001-11-16 Jim Meyering <meyering@lucent.com>
5187 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
5188 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
5189 determine the amount of total physical memory, use pstat_getstatic.
5190 HPUX-11 doesn't define _SC_PHYS_PAGES.
5191 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
5192 If sysconf couldn't be used to determine the amount of available
5193 physical memory, use both pstat_getstatic and pstat_getdynamic.
5194 Based on a patch from Bob Proulx.
5196 2001-11-05 Jim Meyering <meyering@lucent.com>
5198 * xstat.in (slash_aware_lstat): Correct a misleading comment.
5200 2001-11-03 Jim Meyering <meyering@lucent.com>
5202 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
5203 in argmatch_to_argument call.
5205 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
5208 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
5209 e.g., a fault due to an attempt to free a NULL pointer.
5211 2001-11-01 Jim Meyering <meyering@lucent.com>
5213 * dirfd.c, dirfd.h: New files.
5214 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
5216 * hash.c (hash_print) [TESTING]: Clean up.
5218 2001-10-22 Paul Eggert <eggert@twinsun.com>
5220 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
5221 to avoid a warning if -Wall.
5223 2001-10-21 Paul Eggert <eggert@twinsun.com>
5225 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
5227 2001-10-21 Jim Meyering <meyering@lucent.com>
5229 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
5230 this code would end up calling gettext even in packages built
5232 * getopt.c (_): Likewise.
5233 * regex.c (_): Likewise.
5235 2001-10-20 Paul Eggert <eggert@twinsun.com>
5237 * error.c (strerror_r): Do not declare unless !_LIBC.
5238 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
5239 Use strerror_r that is only a macro, even if it is not a function.
5240 (strerror): Check for HAVE_DECL_STRERROR before declaring.
5241 (private_strerror): Use prototypes, not old-style function definition.
5242 (print_errno_message): New function.
5243 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
5245 (error_tail, error, error_at_line): Use it.
5247 2001-10-11 Jim Meyering <meyering@lucent.com>
5249 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
5250 and quote_n (1, ... to avoid clobbering a buffer.
5252 2001-10-05 Jim Meyering <meyering@lucent.com>
5254 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
5255 * hash-pjw.c: New file (factored out of fileutils' remove.c).
5256 * hash-pjw.h: New file.
5258 2001-09-30 Jim Meyering <meyering@lucent.com>
5260 * mountlist.c [MOUNTED_GETFSSTAT]:
5261 Include <sys/ucred.h>, for Apple Darwin.
5262 Include sys/mount.h and sys/fs_types.h only if available.
5264 (read_filesystem_list): Use FS_TYPE.
5266 2001-09-29 Paul Eggert <eggert@twinsun.com>
5268 * exclude.c (excluded_filename): 0 -> false, since it's
5271 2001-09-28 Paul Eggert <eggert@twinsun.com>
5273 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
5274 #defines strtoimax. Also treat the other strto* functions
5277 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
5278 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
5279 (strtoimax, strtoumax): Do not declare if already defined as a macro.
5281 2001-09-26 Jim Meyering <meyering@lucent.com>
5283 Most macros in unlocked-io.h had the wrong number of arguments.
5284 * gen-uio: New script.
5285 (USE_UNLOCKED_IO): Define to 1 if not already defined.
5286 * unlocked-io.hin: Remove file.
5287 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
5288 rather than trying to embed it here.
5289 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
5290 Reported by Padraig Brady.
5292 2001-09-25 Volker Borchert <bt@teknon.de>
5294 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
5296 2001-09-23 Jim Meyering <meyering@lucent.com>
5298 * mountlist.c: Remove useless parentheses in #if directives.
5299 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
5300 the deprecated MOUNTED symbol is no longer defined in mntent.h.
5302 2001-09-22 Jim Meyering <meyering@lucent.com>
5304 * localcharset.c: Update from latest gettext.
5305 * config.charset: Likewise.
5307 2001-09-20 Jim Meyering <meyering@lucent.com>
5309 * xstrtol.c (strtoimax): Guard declaration with
5310 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
5311 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
5312 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
5313 (strtoumax): Likewise, for completeness (it wasn't necessary).
5315 2001-09-06 Paul Eggert <eggert@twinsun.com>
5317 * strtoimax.c (HAVE_LONG_LONG):
5318 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
5319 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
5320 to work around bug in IBM C compiler.
5322 2001-09-16 Jim Meyering <meyering@lucent.com>
5324 * mkdir.c: New file.
5326 2001-09-04 Paul Eggert <eggert@twinsun.com>
5328 * xgetcwd.c: Revert some of the previous change; intead,
5329 fix the HAVE_GETCWD_NULL code to behave more like the
5330 !HAVE_GETCWD_NULL code used to.
5333 (xgetcwd): Do not return NULL when memory is exhausted; instead,
5336 2001-09-04 Paul Eggert <eggert@twinsun.com>
5338 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
5339 Use ssize_t, not int, to store result of readlink.
5340 Check for ssize_t overflow as well as size_t overflow,
5341 as POSIX says the result of readlink is implementation-defined
5342 when ssize_t overflows.
5343 Remove unnecessary cast to char*.
5344 Use free+malloc instead of realloc, as the storage doesn't need
5345 to be preserved and it's clearer and can be more efficient that way.
5346 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
5347 * xreadlink.h (xreadlink): Update prototype.
5349 2001-09-03 Paul Eggert <eggert@twinsun.com>
5351 * exclude.c (fnmatch_no_wildcards): Fix confusion between
5352 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
5353 spotted by Jim Meyering.
5355 2001-09-03 Jim Meyering <meyering@lucent.com>
5357 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
5359 2001-09-03 Paul Eggert <eggert@twinsun.com>
5361 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
5362 like the HAVE_GETCWD_NULL code.
5363 Include pathmax.h if not HAVE_GETCWD.
5364 Do not include xalloc.h.
5365 (INITIAL_BUFFER_SIZE): New symbol.
5366 Do not use xmalloc / xrealloc, since the caller is responsible for
5367 handling errors. Preserve errno around `free' during failure.
5368 Do not overrun buffer when using getwd.
5370 2001-09-03 Paul Eggert <eggert@twinsun.com>
5372 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
5373 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
5375 2001-09-02 Jim Meyering <meyering@lucent.com>
5377 * error.c: Update from GNU libc.
5379 2001-09-01 Jim Meyering <meyering@lucent.com>
5381 * xreadlink.c: New file.
5382 * xreadlink.h: New file.
5383 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
5385 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
5386 doesn't conflict with sparc Solaris 7's definition in
5387 /usr/include/sys/int_types.h.
5389 * exclude.c: Use `""', not `<>' to #include non-system header files.
5390 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
5391 and strncasecmp as r-values. Unixware didn't have declarations.
5393 2001-08-31 Jim Meyering <meyering@lucent.com>
5395 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
5396 Use an initial, malloc'd, buffer of length 128 rather than
5397 a statically allocated one of length 1024.
5399 2001-08-30 Paul Eggert <eggert@twinsun.com>
5401 * xgetcwd.c: Don't include pathmax.h.
5402 Include stdlib.h and unistd.h if available.
5404 (xmalloc, xstrdup, free): Remove decls.
5405 (xgetcwd): Don't assume sizes fit in unsigned.
5406 Check for overflow when computing sizes.
5407 Simplify reallocation code.
5409 2001-08-28 Paul Eggert <eggert@twinsun.com>
5411 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
5413 * strtoimax.c: Renamed from strtoxmax.c, removing the
5416 Also, make the following further changes to make this file's
5417 configuration more similar to that of strtol.c:
5418 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
5419 (strtoumax, uintmax_t, strtoull, strtol): Remove.
5420 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
5421 (strtoimax): Renamed from strtoumax. All uses of unsigned values
5422 changed to signed values.
5424 And make the following changes as well:
5425 Fix copyright notice, as 1999 was missing.
5426 (verify): New macro.
5427 (strtoimax): Check sizes at compile-time, not run-time.
5428 Prefer strtol to strtoll if both work.
5429 (main): Remove; it was not that useful and was a pain to maintain.
5431 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
5433 2001-08-30 Paul Eggert <eggert@twinsun.com>
5435 * savedir.c (savedir): Remove size parameter, as POSIX says that
5436 a directory's st_size can have an arbitrary value, so the old
5437 usage could waste an arbitrary amount of memory. All uses
5439 * savedir.h: Update prototype.
5441 2001-08-30 Paul Eggert <eggert@twinsun.com>
5443 * xstrtol.c (strtoimax): New decl.
5445 2001-08-28 Paul Eggert <eggert@twinsun.com>
5447 * xstrtol.h: Add copyright notice.
5448 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
5449 LONGINT_INVALID_SUFFIX_CHAR.
5451 2001-08-30 Paul Eggert <eggert@twinsun.com>
5453 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5456 2001-08-30 Paul Eggert <eggert@twinsun.com>
5458 * hash.c: Remove '2001' from copyright notice.
5460 2001-08-30 Paul Eggert <eggert@twinsun.com>
5462 * full-write.h: New file.
5463 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
5464 * full-write.c: Correct credits, as cccp.c no longer
5465 exists and anyway it was so heavily changed from the old cccp
5466 code as to be unrecognizable. Include full-write.h.
5467 (full_write) Return size_t, with short writes meaning failure.
5468 All callers changed. This fixes a bug with large buffers
5470 * utime.c: Include full-write.h.
5472 2001-08-30 Paul Eggert <eggert@twinsun.com>
5474 Merge 'exclude' changes from tar 1.13.22.
5475 This fixes one or two unlikely storage allocation overflow bugs,
5476 but doesn't change user-visible behavior otherwise.
5478 2001-08-30 Paul Eggert <eggert@twinsun.com>
5480 * exclude.c (bool): Declare, perhaps by including stdbool.h.
5481 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
5482 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
5483 Include if available.
5484 (<xalloc.h>): Include
5485 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
5486 (verify): New macro. Use it to verify that EXCLUDE macros do not
5487 collide with FNM macros.
5488 (struct patopts): New struct.
5489 (struct exclude): Use it, as exclude patterns now come with options.
5490 (new_exclude): Support above changes.
5491 (new_exclude, add_exclude_file):
5492 Initial size must now be a power of two to simplify overflow checking.
5493 (free_exclude, fnmatch_no_wildcards): New function.
5494 (excluded_filename): No longer requires options arg, as the options
5495 are determined by add_exclude. Now returns bool, not int.
5496 (excluded_filename, add_exclude):
5497 Add support for the fancy new exclusion options.
5498 (add_exclude, add_exclude_file): Now takes int options arg.
5499 Check for arithmetic overflow when computing sizes.
5500 (add_exclude_file): xrealloc might modify errno, so don't
5501 realloc until after errno might be used.
5503 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
5505 (free_exclude): New decl.
5506 (add_exclude, add_exclude_file): Now takes int options arg.
5507 (excluded_filename): No longer requires options arg, as the options
5508 are determined by add_exclude. Now returns bool, not int.
5510 2001-08-30 Paul Eggert <eggert@twinsun.com>
5512 * alloca.c (alloca): Arg is of type size_t, not unsigned.
5514 2001-08-27 Jim Meyering <meyering@lucent.com>
5516 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
5518 * version-etc.c (N_): Remove definition.
5519 Revert most of last change.
5520 Instead, simply don't mark the `Copyright...' string for translation.
5521 Based on advice from Paul Eggert.
5523 * strtoxmax.c: Tweak comment.
5525 2001-08-26 Jim Meyering <meyering@lucent.com>
5527 * version-etc.c (version_etc_copyright_fmt): Replace literal year
5528 of copyright with `%s' so translators don't get an untranslated
5530 (COPYRIGHT_YEAR): Define.
5531 (version_etc): Use fprintf rather than fputs.
5532 Suggestion from Ulrich Drepper.
5534 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5536 * strtoll.c: New file, from GNU libc.
5537 * xstrtoimax.c: New file.
5539 * xstrtol.h: Add xstrtoimax.
5540 * strtoumax.c: New file. Simply include "strtoumax.c".
5541 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
5543 * strtoumax.c: Factor to work both for unsigned and signed types, ...
5544 * strtoxmax.c: ... then renamed to this.
5546 2001-08-13 Paul Eggert <eggert@twinsun.com>
5548 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
5549 Port to Solaris 8, where 'sed' requires a space after the 'r'
5550 command, and where sh dislikes "$/". Clean up the spacing a bit.
5551 Redirect output to $tmp just once.
5553 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
5555 * addext.c (<errno.h>): Include.
5556 (errno): Declare if not defined.
5557 (addext): Work correctly when pathconf returns -1 and leaves
5558 errno alone because there is no limit. Also, work even if
5559 pathconf returns a value greater than SIZE_MAX.
5561 2001-08-12 Jim Meyering <meyering@lucent.com>
5563 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
5564 Simply `return getcwd (NULL, 0);'.
5565 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
5566 Use 1300 as initial value for length, not PATH_MAX.
5568 * pathmax.h: Clean up cpp syntax.
5570 2001-08-12 Jim Meyering <meyering@lucent.com>
5572 * gettimeofday.c: New file.
5574 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
5576 2001-08-04 Jim Meyering <meyering@lucent.com>
5578 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
5579 to get in sync with glibc.
5581 2001-08-03 Paul Eggert <eggert@twinsun.com>
5583 The following changes are from gettext 0.10.39 as maintained by
5586 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
5587 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
5588 with inverted sense. All uses changed.
5590 * mbswidth.c: Don't include <limits.h>.
5591 Include <stdlib.h> and <string.h> unconditionally.
5592 (iswcntrl, mbsinit, ISCNTRL): New macros.
5593 (mbsnwidth): Use K&R style function declarations.
5594 Don't bother checking for MB_LEN_MAX == 1, since the compiler
5595 can optimize it when MB_CUR_MAX == 1.
5596 The width of control characters is zero, not 1.
5598 2001-07-15 Jim Meyering <meyering@lucent.com>
5600 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
5601 (BUILT_SOURCES): Add unlocked-io.h.
5602 (io_functions): Define.
5603 (unlocked-io.h): New rule.
5604 (DISTCLEANFILES): Add unlocked-io.h.
5605 (all-local): Depend on unlocked-io.h, to ensure it is created.
5607 * unlocked-io.hin: New file
5609 * regex.c: Update from glibc.
5611 2001-07-05 Jim Meyering <meyering@lucent.com>
5613 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
5615 (libfetish_a_SOURCES): Put all .h files here instead.
5616 Remove a thus-exposed (better checks in automake) duplicate and
5617 two unnecessary .h files.
5619 2001-06-11 Jim Meyering <meyering@lucent.com>
5621 * regex.c: Update from GNU libc.
5623 2001-05-27 Jim Meyering <meyering@lucent.com>
5625 * readutmp.h (UT_TYPE): Define.
5627 2001-05-24 Jim Meyering <meyering@lucent.com>
5629 * argmatch.c: Include "quote.h".
5630 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
5631 quote function. Reported by Göran Uddeborg.
5633 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
5635 * dirname.c (dir_name): Compute append_dot using path, not newpath
5636 which is not yet declared.
5638 2001-05-11 Paul Eggert <eggert@twinsun.com>
5640 * Makefile.am (libfetish_a_SOURCES):
5641 Add strftime.c, since we now compile it on all hosts.
5643 * strftime.c (my_strftime):
5644 Define to nstrftime if emacs, but only if my_strftime is not defined.
5645 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
5646 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
5647 Add one more extra argument: a nanoseconds value.
5650 (my_strftime function): Add %N format.
5651 (emacs_strftimeu): Renamed from emacs_strftime,
5652 with extra ut argument.
5654 2001-05-11 Paul Eggert <eggert@twinsun.com>
5656 dirname code cleanup. base_name now behaves more compatibly
5657 with POSIX basename when given file names that have trailing
5658 slashes, and similarly for dir_name. Add new primitives
5659 base_len and dir_len. Put the directory-name-related decls
5662 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
5663 * backupfile.c (base_name): Likewise.
5664 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
5665 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
5666 * makepath.c (strip_trailing_slashes): Likewise.
5667 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
5669 * rename.c (strip_trailing_slashes): Likewise.
5670 * same.c (base_name): Likewise.
5671 * stripslash.c (ISSLASH): Likewise.
5673 * addext.c: Include <dirname.h> after size_t is defined.
5674 * backupfile.c: Likewise.
5676 * addext.c (addext): Use base_len to trim redundant
5677 trailing slashes instead of doing it ourselves.
5678 But do not trim the last slash if it is not redundant.
5680 * backupfile.c (find_backup_file_name,
5681 max_backup_version): Use base_len instead of rolling it ourselves.
5682 Handle the case of "" and (on DOS) "C:" correctly.
5684 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
5685 Include <string.h>, <dirname.h>.
5686 (base_name): Allow file names ending in slashes, other than names
5687 that are all slashes. In this case, return the basename followed
5688 by the slashes. This is more general, and can be used in places
5689 where the original base_name purposely had an assertion failure.
5690 (base_len): New function.
5692 * dirname.c: Include <string.h> instead of <stdlib.h>.
5693 Do not include <assert.h>; no longer needed.
5695 (memrchr): Remove decl.
5696 (dir_name_r): Remove.
5697 (dir_len): Renamed from dirlen. All callers changed.
5698 Rewrite in terms of base_name, for simplicity and consistency.
5699 (dir_name): Never return NULL. All callers changed.
5700 Do not include <stdlib.h> in test program; no longer needed.
5701 return 0; is fine for test program.
5703 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
5705 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
5707 * path-concat.c (path_concat): Use base_len to compute
5708 base length, not strlen; this means we cannot rely on memcpy
5711 * same.c (STREQ): Remove.
5712 (same_name): Handle the case where the basename ends in trailing '/'.
5714 * stripslash.c (strip_trailing_slashes): Return nonzero if
5715 a slash was stripped. Do not strip the last slash after a
5718 2001-04-08 Jim Meyering <meyering@lucent.com>
5720 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
5721 recomputed; that's necessary when the offset spans a DST transition.
5722 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
5724 2001-04-02 Jim Meyering <meyering@lucent.com>
5726 * regex.h, regex.c: Update from GNU libc.
5728 2001-03-19 Paul Eggert <eggert@twinsun.com>
5730 * version-etc.c (version_etc_copyright): Update to 2001.
5732 2001-03-16 Paul Eggert <eggert@twinsun.com>
5734 * tempname.c (uint64_t): Define to uintmax_t if
5735 not defined, and if UINT64_MAX is not defined.
5736 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5737 Reported by John David Anglin.
5739 2001-03-10 Bruno Haible <haible@clisp.cons.org>
5741 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5742 alias if codeset is empty.
5743 * config.charset (BeOS): Use wildcard syntax.
5745 2001-03-13 Jim Meyering <meyering@lucent.com>
5747 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5748 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5751 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5753 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5755 * unicodeio.c (print_unicode_char): Simplify accordingly.
5757 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5759 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5760 support for DOS/DJGPP.
5762 2001-02-28 Paul Eggert <eggert@twinsun.com>
5764 * Makefile.am (libfetish_a_SOURCES):
5765 Add dup-safer.c, fopen-safer.c.
5766 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5768 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5770 2001-02-25 Paul Eggert <eggert@twinsun.com>
5772 The mkstemp replacement is taken from glibc 2.2.2, with some
5773 portability fixes for use outside glibc, as follows:
5775 * tempname.c (struct_stat64): New macro.
5776 (direxists, __gen_tempname): Use it.
5777 This avoids a portability problem with Solaris 8.
5779 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5780 (<stddef.h>, <stdint.h>, <string.h>):
5781 Include only if STDC_HEADERS || _LIBC.
5782 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5783 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5784 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5785 (__set_errno): Define this macro if <errno.h> doesn't.
5786 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
5787 Define these macros if <stdio.h> doesn't.
5788 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
5789 Define these macros if <sys/stat.h>
5790 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
5791 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
5792 __xstat64): Define if not _LIBC.
5793 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
5794 (__gen_tempname): Invoke gettimeofday only if
5795 HAVE_GETTIMEOFDAY || _LIBC;
5796 otherwise, fall back on plain "time".
5797 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
5799 * mkstemp.c (__GT_FILE): Define to zero if not defined.
5801 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
5803 2001-02-17 Jim Meyering <meyering@lucent.com>
5805 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
5806 around included file name.
5808 * strnlen.c (__strnlen): Merge in a change from GNU libc.
5810 * strftime.c: Update from GNU libc (the only changes were to comments).
5812 2001-02-13 Bruno Haible <haible@clisp.cons.org>
5814 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
5816 2001-02-17 Paul Eggert <eggert@twinsun.com>
5818 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
5819 Remove workaround macros for hosts that have mbrtowc but not
5820 mbstate_t, as we now insist on proper declarations for both
5821 before using mbrtowc.
5823 2001-02-17 Jim Meyering <meyering@lucent.com>
5825 * regex.c: Update from libc.
5827 2001-02-16 Paul Eggert <eggert@twinsun.com>
5829 * alloca.c (malloc): Undef before defining, since stdlib.h
5830 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
5831 Reported by Mark Hounschell via Paul Eggert.
5833 2001-01-30 Bruno Haible <haible@clisp.cons.org>
5835 * config.charset: Update for FreeBSD 4.2.
5837 2001-01-26 Jim Meyering <meyering@lucent.com>
5839 * quotearg.c: Include stddef.h.
5840 * quote.c: Include stddef.h.
5841 Reported by Axel Kittenberger.
5843 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
5844 line in double quotes so that it evokes a better diagnostic.
5845 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
5846 Reported by Axel Kittenberger.
5848 2001-01-15 Bruno Haible <haible@clisp.cons.org>
5850 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
5851 to avoid a warning. Add back 'const' to inptr.
5853 2001-01-16 Jim Meyering <meyering@lucent.com>
5855 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
5858 2001-01-14 Jim Meyering <meyering@lucent.com>
5860 * rename.c: New file. From Volker Borchert.
5861 Include stdlib.h, string.h or strings.h, and xalloc.h.
5862 Use strip_trailing_slashes rather than open-coding it.
5864 2001-01-03 Paul Eggert <eggert@twinsun.com>
5866 * strftime.c: Sync with glibc time/strftime.c 1.81.
5868 2001-01-03 Jim Meyering <meyering@lucent.com>
5870 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
5871 local `inptr' to avoid warning with some system declarations of iconv.
5873 2000-12-29 Paul Eggert <eggert@twinsun.com>
5875 * modechange.c: Do not assume that mode_t uses the
5876 traditional octal encoding. E.g. "chmod 1 FOO" should set
5877 the other-execute bit of FOO even if S_IXOTH != 1.
5879 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
5880 WOTH, XOTH, ALLM): New macros.
5881 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
5882 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
5884 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
5885 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
5887 No need to use uintmax_t; unsigned long is long enough.
5888 Don't bother to get suffix since we don't use it.
5890 2000-12-24 Jim Meyering <meyering@lucent.com>
5892 * hash.c (is_prime): Return explicit boolean values.
5893 (hash_get_first): Return NULL to appease Irix5.6's 89.
5894 Reported by Nelson Beebe.
5896 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5898 * localcharset.c (locale_charset): Add support for Win32.
5900 2000-12-18 Paul Eggert <eggert@twinsun.com>
5902 * physmem.h, physmem.c: New files.
5904 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
5905 (noinst_HEADERS): Add physmem.h.
5907 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
5908 't' for compatibility with Solaris 8 sort.
5910 2000-12-18 Bruno Haible <haible@clisp.cons.org>
5912 * config.charset: Add support for BeOS.
5914 2000-12-16 Jim Meyering <meyering@lucent.com>
5916 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
5917 SHELLS_FILE to a file name that's useful on djgpp systems.
5919 (ADDITIONAL_DEFAULT_SHELLS): Define.
5920 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
5921 Based mostly on a patch from Prashant TR.
5923 2000-12-16 Jim Meyering <meyering@lucent.com>
5925 This bug had a serious impact on chown: `chown N:M FILE' (for integer
5926 N and M) would have treated it like `chown N:N FILE'.
5928 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
5930 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5932 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
5933 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
5934 to the list of canonical encodings. Rename EUC-CN to GB2312.
5936 2000-12-08 Andreas Schwab <schwab@suse.de>
5938 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
5939 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
5941 2000-12-07 Jim Meyering <meyering@lucent.com>
5943 * stripslash.c (ISSLASH): Define.
5944 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
5947 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
5948 (dir_name_r): Declare this function as static.
5949 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
5950 manifest itself on a name containing a mix of slashes and
5952 Make this function work with names starting with a DOS-style
5953 drive letter and colon prefix.
5954 (dir_name): Append `.' if necessary.
5955 Based mostly on patches from Prashant TR and Eli Zaretskii.
5957 * dirname.h (dir_name_r): Remove prototype.
5959 2000-12-05 Jim Meyering <meyering@lucent.com>
5961 * dirname.c (dir_name_r): Add `const' in a few local declarations.
5963 2000-12-04 Jim Meyering <meyering@lucent.com>
5965 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
5966 Also include memory.h, stdlib.h, unistd.h if appropriate.
5967 Reported by Andreas Jaeger (conflicting declaration of malloc).
5969 2000-12-02 Jim Meyering <meyering@lucent.com>
5971 * closeout.h: Make idempotent, to avoid some obscure warnings.
5973 2000-12-01 Paul Eggert <eggert@twinsun.com>
5975 * memrchr.c: Include <config.h> before any system include file.
5977 2000-11-29 Paul Eggert <eggert@twinsun.com>
5979 * dirname.c (dir_name_r): Fix typo: int -> size_t.
5981 2000-11-26 Jim Meyering <meyering@lucent.com>
5983 * memcoll.c: Include sys/types.h. From Werner Almesberger.
5985 2000-11-22 Paul Eggert <eggert@twinsun.com>
5987 * strftime.c (my_strftime): Do not invoke mbrlen with a
5988 size of (size_t) -1; it's not portable.
5990 2000-11-17 Akim Demaille <akim@epita.fr>
5992 * obstack.h: Formatting changes.
5993 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
5994 prevent type checking.
5995 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
5996 cast the value to (void *): assigning a `foo *' to a `void *'
5998 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
6000 2000-11-17 Jim Meyering <meyering@lucent.com>
6002 * strstr.c: Update from GNU libc.
6004 2000-11-16 Jim Meyering <meyering@lucent.com>
6006 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
6008 2000-11-11 Jim Meyering <meyering@lucent.com>
6010 * error.c: Add a couple #includes, merging from GNU libc version.
6012 2000-11-10 Jim Meyering <meyering@lucent.com>
6014 * obstack.h: Update from GNU libc.
6015 * obstack.c: Likewise.
6017 2000-11-06 Paul Eggert <eggert@twinsun.com>
6019 * getusershell.c (setusershell): Use rewind rather than
6020 fseek/fseeko, to avoid configuration hassles with fseeko.
6021 Don't bother opening SHELLS_FILE if shellstream is NULL;
6024 2000-11-05 Jim Meyering <meyering@lucent.com>
6026 * makepath.h (make_dir): Declare.
6027 * makepath.c (make_dir): Remove `static' attribute.
6030 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
6032 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
6033 last one in a bucket, advance to the next bucket.
6035 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
6037 * fnmatch.c: Do not comment out all the code if we are using
6038 the GNU C library, because in some cases we are replacing buggy
6039 code in the GNU C library itself.
6041 2000-10-30 Paul Eggert <eggert@twinsun.com>
6043 * error.h, getline.h, modechange.h:
6044 Remove "2000" from Copyright line, as the file hasn't been
6045 changed this year other than in the copyright notice.
6047 * xalloc.h: Add "2000" to Copyright line, as this file
6048 was changed this year.
6050 2000-10-30 Paul Eggert <eggert@twinsun.com>
6052 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
6053 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
6054 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
6056 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
6058 * regex.h (__restrict_arr): Move definition out of #ifndef block.
6059 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
6060 doesn't define __restrict_arr.
6062 2000-10-29 Jim Meyering <meyering@lucent.com>
6064 * xstat.in: Fix grammar in comment.
6066 2000-10-28 Jim Meyering <meyering@lucent.com>
6068 * memchr.c: Update from libc.
6069 Adjust for portability:
6070 [HAVE_STDLIB_H]: Include stdlib.h.
6071 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
6072 Undef __memchr, too.
6073 [!weak_alias]: Define __memchr to memchr.
6075 * regex.c: Update from libc.
6076 * regex.h: Likewise.
6077 * getopt1.c: Likewise.
6078 * memcmp.c: Likewise.
6080 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
6081 Avoid using fseek, when possible -- it's broken by design.
6082 Patch by Ulrich Drepper.
6084 2000-10-26 Jim Meyering <meyering@lucent.com>
6086 * strftime.c: Update from libc.
6088 2000-10-25 Jim Meyering <meyering@lucent.com>
6090 * obstack.c: Update from libc.
6092 2000-10-23 Jim Meyering <meyering@lucent.com>
6094 * hard-locale.c (hard_locale): Revert last change -- it was simply
6095 wrong. That set_locale call must not have any side effects.
6098 2000-10-22 Jim Meyering <meyering@lucent.com>
6100 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
6101 [CYCLIC]: Remove now-unused definition.
6103 * save-cwd.c (O_DIRECTORY): Define, if needed.
6104 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
6105 Suggestion from Ulrich Drepper.
6107 2000-10-21 Jim Meyering <meyering@lucent.com>
6109 * dirname.c (dir_name_r): New function, factored out of dir_name.
6110 (dir_name): Use dir_name_r.
6111 * dirname.h (dir_name_r): Declare it.
6113 2000-10-21 Jim Meyering <meyering@lucent.com>
6115 * dirname.c (memrchr): Declare if necessary.
6116 (dir_name): Remove the restriction that there be no
6117 trailing slashes. Now, this code skips past them, effectively
6119 [TEST_DIRNAME] (main): New unit tests.
6121 * memrchr.c: New file from GNU libc.
6122 Undef __memrchr, too.
6123 [!weak_alias]: Define __memrchr to memrchr.
6124 Guard weak_alias use with `#ifdef weak_alias'.
6126 2000-10-17 Jim Meyering <meyering@lucent.com>
6128 * quote.h (PARAMS): Define and use.
6129 Reported by Akim Demaille.
6131 * getopt.c: Update from libc.
6133 2000-10-16 Jim Meyering <meyering@lucent.com>
6135 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
6138 2000-09-25 Jim Meyering <meyering@lucent.com>
6140 * md5.h (rol): Define (from GnuPG).
6142 * sha.c: Give credit (GnuPG) where due.
6143 (M): Use rol rather than open-coding it.
6144 Add a FIXME comment.
6146 2000-09-21 Jim Meyering <meyering@lucent.com>
6148 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
6149 Reported by Michael Stone.
6151 2000-09-20 Jim Meyering <meyering@lucent.com>
6153 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
6154 (noinst_HEADERS): Add sha.h.
6155 Based on code from Scott G. Miller and from GnuPG.
6157 2000-09-15 Jim Meyering <meyering@lucent.com>
6159 * regex.c: Update from libc.
6161 2000-09-10 Jim Meyering <meyering@lucent.com>
6163 * getopt.c (_getopt_internal): Update from glibc.
6165 2000-09-09 Jim Meyering <meyering@lucent.com>
6167 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
6168 think it should be used as a general replacement for isascii.
6169 * fnmatch.c: Likewise.
6170 * mbswidth.c: Likewise
6171 * regex.c: Likewise.
6174 * userspec.c: Include sys/param.h and limits.h.
6176 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6177 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
6178 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
6179 UID, GID. Check range.
6181 2000-09-06 Jim Meyering <meyering@lucent.com>
6183 * getopt.c (_getopt_internal): Update from glibc.
6185 2000-08-30 Jim Meyering <meyering@lucent.com>
6187 * strftime.c: Merge in changes from GNU libc.
6189 2000-08-26 Jim Meyering <meyering@lucent.com>
6191 * closeout.c: Include "__fpending.h".
6192 (close_stdout_status): Return right away if there's nothing to flush.
6194 * Makefile.am (noinst_HEADERS): Add __fpending.h.
6195 * __fpending.c: New file.
6196 * __fpending.h: New file.
6198 2000-08-07 Paul Eggert <eggert@twinsun.com>
6200 Standardize on "memory exhausted" instead of "Memory exhausted"
6201 or "virtual memory exhausted".
6202 * obstack.c (print_and_abort): Use "memory exhausted", not
6203 "virtual memory exhausted".
6204 * same.c (same_name): Invoke xalloc_die instead of printing
6206 * userspec.c (parse_user_spec): Likewise.
6207 * bumpalloc.h: comment fix
6208 * same.c, userspec.c: Include xalloc.h.
6210 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
6211 not char *const and pointing to a constant array.
6212 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
6213 (xrealloc): Comment fix.
6215 * userspec.c (parse_user_spec):
6216 Don't translate a message until just before returning,
6217 to avoid unnecessary translation.
6219 2000-08-07 Jim Meyering <meyering@lucent.com>
6221 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
6222 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
6223 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
6224 getgroups.c, gethostname.c, getopt.h, group-member.c,
6225 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
6226 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
6227 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
6228 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
6229 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
6230 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
6231 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
6232 yesno.c: Back out Copyright date changes for each file with no change
6233 this year. This eases coordination with other programs using the same
6234 source code modules. From Paul Eggert.
6236 2000-08-03 Greg McGary <greg@mcgary.org>
6238 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
6239 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
6240 (EXTEND_BUFFER): Use them.
6242 2000-08-01 Jim Meyering <meyering@lucent.com>
6244 * dirname.c (ISSLASH): Define.
6245 (BACKSLASH_IS_PATH_SEPARATOR): Define.
6246 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
6247 both `\' and `/' may be use as path separators.
6248 Based on a patch from Prashant TR.
6250 2000-07-31 Paul Eggert <eggert@twinsun.com>
6252 * quotearg.c (quotearg_n_options): Don't make the initial
6253 slot vector a constant, since it might get modified.
6255 2000-07-31 Jim Meyering <meyering@lucent.com>
6257 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
6258 * obstack.c (print_and_abort): Likewise.
6260 2000-07-30 Paul Eggert <eggert@twinsun.com>
6262 * quotearg.c (quotearg_n_options): Preallocate a slot 0
6263 buffer, so that the caller can always quote one small
6264 component of a "memory exhausted" message in slot 0.
6265 From a suggestion by Jim Meyering.
6267 2000-07-30 Jim Meyering <meyering@lucent.com>
6269 * makepath.c (make_path): Quote the other instance, too.
6271 * quotearg.c (N_STATIC_SLOTVECS): Define.
6272 (STATIC_BUF_SIZE): Define.
6273 (quotearg_n_options): Use only statically allocated storage when
6274 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
6275 than STATIC_BUF_SIZE.
6277 2000-07-29 Jim Meyering <meyering@lucent.com>
6279 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
6280 * dirname.c (dir_name): Likewise.
6282 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
6284 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
6285 (dir_name): Assert that there are no trailing slashes.
6287 2000-07-18 Bruno Haible <haible@clisp.cons.org>
6289 * mbswidth.h (mbswidth): Add a flags argument.
6290 (mbswidth): New declaration.
6291 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
6292 * mbswidth.c (mbswidth): Add a flags argument.
6293 (mbsnwidth): New function.
6295 2000-07-24 Jim Meyering <meyering@lucent.com>
6297 * mbswidth.c: Remove useless #else. From Bruno Haible.
6299 2000-07-23 Paul Eggert <eggert@twinsun.com>
6301 * mbswidth.c (_XOPEN_SOURCE):
6302 Don't define; this causes problems on Solaris 7.
6303 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
6305 2000-07-23 Paul Eggert <eggert@twinsun.com>
6308 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
6309 so that mbstate_t is always defined.
6311 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
6312 be 1 in at least one GCC installation, and this configuration
6313 error is likely to be common. Ignoring MB_LEN_MAX hurts
6314 performance on hosts that have mbrtowc but have only unibyte
6315 locales, but I assume these hosts are rare.
6317 2000-07-23 Paul Eggert <eggert@twinsun.com>
6319 * quotearg.c: Streamline by invoking multibyte code only if needed.
6320 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
6321 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
6322 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
6323 invoke multibyte primitives.
6325 2000-07-23 Jim Meyering <meyering@lucent.com>
6327 * basename.c (base_name): Add an assertion.
6329 2000-07-15 Bruno Haible <clisp.cons.org>
6331 * quotearg.c: When the system forces us to redefine mbstate_t,
6332 shadow its mbsinit function.
6334 2000-07-16 Bruno Haible <haible@clisp.cons.org>
6336 * mbswidth.h: New file.
6337 * mbswidth.c: New file.
6338 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
6339 (noinst_HEADERS): Add mbswidth.h.
6341 2000-07-17 Bruno Haible <haible@clisp.cons.org>
6343 * config.charset: Add support for FreeBSD. Improve support for HP-UX
6346 2000-07-15 Jim Meyering <meyering@lucent.com>
6348 * makepath.c: Include quote.h.
6349 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
6350 corresponding argument in a `quote (...)' call.
6351 Give better diagnostics.
6353 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
6354 (noinst_HEADERS): Add quote.h.
6356 * quote.c (quote, quote_n): New file. Two functions taken verbatim
6357 from tar's src/misc.c.
6358 * quote.h: New file. Prototypes for same.
6360 2000-07-10 Paul Eggert <eggert@twinsun.com>
6362 From a suggestion by Bruno Haible.
6363 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
6364 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
6365 to decide whether to define the BeOS workaround macro;
6366 this adjusts to the change to AC_MBSTATE_T.
6368 2000-07-13 Paul Eggert <eggert@twinsun.com>
6370 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
6372 * quotearg.c (quoting_style_args, quoting_style_vals,
6373 quotearg_buffer_restyled): Add support for
6374 clocale_quoting_style. Undo previous change to
6375 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
6376 and "{RIGHT QUOTATION MARK}" msgids.
6378 2000-07-05 Paul Eggert <eggert@twinsun.com>
6380 The old behavior of quoting `like this' doesn't look good with
6381 newer, ISO-style fonts. See:
6382 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
6384 Instead, quote "like this" by default. Let the translator
6385 tailor the locale-specific quoting behavior by providing
6386 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
6388 * quotearg.c (N_): New macro.
6389 (gettext_default): New function.
6390 (quotearg_buffer_restyled): Use
6391 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
6392 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
6394 2000-07-09 Jim Meyering <meyering@lucent.com>
6396 * Most files: Update copyright dates to include 2000.
6398 2000-07-08 Jim Meyering <meyering@lucent.com>
6400 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
6402 (xgethostname): Remove now-unnecessary #ifdef.
6403 Move declaration of `err' into loop where it's used.
6405 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6407 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
6408 by allocating a larger buffer. Test the gethostname return value for
6409 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
6410 returns an error and ENAMETOOLONG isn't defined.
6412 2000-07-05 Paul Eggert <eggert@twinsun.com>
6413 and Bruno Haible <haible@clisp.cons.org>
6415 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
6417 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6419 * quotearg.c (struct quoting_options): Simplify quote_these_too
6422 2000-07-03 Jim Meyering <meyering@lucent.com>
6424 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
6425 Reported by Bruno Haible.
6427 2000-07-04 Jim Meyering <meyering@lucent.com>
6429 * quotearg.c: Make inclusion of <wchar.h> independent of whether
6430 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
6433 2000-07-03 Paul Eggert <eggert@twinsun.com>
6434 and Bruno Haible <haible@clisp.cons.org>
6436 * quotearg.c (mbrtowc):
6437 Assign to *pwc, and return 1 only if result is nonzero.
6438 (iswprint): Use ISPRINT when substituting our own mbrtowc.
6440 2000-07-03 Jim Meyering <meyering@lucent.com>
6442 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
6443 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
6446 2000-07-02 Jim Meyering <meyering@lucent.com>
6448 * quotearg.c (mbstate_t): Don't define here.
6450 2000-07-02 Jim Meyering <meyering@lucent.com>
6452 * nanosleep.c (SIGCONT): Define if not already defined.
6454 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6456 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
6457 per change in ../m4/ls-mntd-fs.m4.
6458 (read_filesystem_list): Ignore symbolic links.
6460 2000-06-29 Jim Meyering <meyering@lucent.com>
6462 * same.c: Include <string.h> or <strings.h>, as appropriate,
6463 for declaration of strcmp.
6465 * long-options.c: Include <stdlib.h>, for declaration of exit.
6467 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
6468 Avoid warning by casting result to `char *' to remove `const'.
6470 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6472 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
6474 2000-06-26 Paul Eggert <eggert@twinsun.com>
6476 savedir now sets errno on failure and invokes xmalloc to get memory.
6477 Fix a couple of other minor bugs while we're at it.
6479 * savedir.c (<unistd.h>): Do not include; there's no need.
6480 (NAMLEN): Remove macro.
6481 (malloc, realloc): Remove decls.
6483 ("xalloc.h"): Include.
6484 (NAME_SIZE_DEFAULT): New macro.
6485 (savedir): Use xmalloc / xrealloc to allocate memory.
6486 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
6487 Skip "" directory entries.
6488 Use strlen to calculate directory entry length, since the old method
6489 is rarely used these days and isn't worth supporting.
6490 Don't use a pointer after freeing it.
6491 Check for integer overflow when calculating allocation size.
6492 Use memcpy to copy entries, instead of stpcpy.
6493 Set errno properly when returning NULL.
6494 Check for readdir error.
6496 2000-06-26 Jim Meyering <meyering@lucent.com>
6498 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
6500 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6502 * getusershell.c (xmalloc, xrealloc): Remove functions.
6504 Don't include <stdlib.h>. Don't declare malloc, realloc.
6506 2000-06-23 Bruno Haible <haible@clisp.cons.org>
6508 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
6510 2000-06-24 Jim Meyering <meyering@lucent.com>
6512 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
6514 2000-06-21 Jim Meyering <meyering@lucent.com>
6516 * getpass.c: New file, from Bruno Haible. Required for BeOS.
6518 2000-06-19 Paul Eggert <eggert@twinsun.com>
6520 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
6521 (mbrtowc, mbstate_t): Define substitutes if
6522 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
6523 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
6524 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
6526 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6528 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
6529 than 1024, return a memory chunk of least possible size, instead
6530 of size PATH_MAX + 2. In the loop, increment the size proportionally.
6531 Use free/xmalloc instead of xrealloc to avoid copying for very long
6534 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6536 * canon-host.c (canon_host): Use malloc and memcpy to copy an
6537 address, not strdup. Include <stdlib.h> and don't declare free().
6539 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6541 * path-concat.c (path_concat): Don't access dir[-1] if dir is
6544 2000-06-21 Jim Meyering <meyering@lucent.com>
6546 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
6547 (noinst_HEADERS): Add getstr.h.
6549 * getline.c (getstr): Move into a separate file.
6550 * getstr.c (getstr): New file, extracted from getline.c, with
6551 the following changes: new parameter, delim2; both delim[12]
6552 parameters have type `int', not `char'. The latter would lose
6553 with 8-bit delimiters.
6554 * getstr.h: New file.
6556 2000-06-19 Jim Meyering <meyering@lucent.com>
6558 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
6560 2000-06-18 Jim Meyering <meyering@lucent.com>
6562 * mkdir.c: Remove file, due mainly to copyright incompatibility.
6563 Besides, these days every porting target provides a mkdir function.
6565 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
6566 (this snippet comes from src/system.h).
6568 2000-06-15 Paul Eggert <eggert@twinsun.com>
6570 * human.c (adjust_value): New function.
6571 (human_readable_inexact): Apply rounding style even when
6572 printing approximate values.
6574 2000-06-14 Paul Eggert <eggert@twinsun.com>
6576 * human.c (human_readable_inexact): Allow an input block
6577 size that is not a multiple of the output block size, and vice versa.
6578 Reported by Piergiorgio Sartor.
6580 2000-06-14 Paul Eggert <eggert@twinsun.com>
6582 * getdate.y (get_date): Apply relative times after time
6583 zone indicator, not before. Reported by Todd A. Jacobs.
6585 2000-06-13 Jim Meyering <meyering@lucent.com>
6587 * Makefile.am (all-local): Depend on lstat.c and stat.c.
6589 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
6591 2000-06-12 Paul Eggert <eggert@twinsun.com>
6593 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
6595 2000-06-04 Paul Eggert <eggert@twinsun.com>
6597 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
6599 2000-06-04 Jim Meyering <meyering@lucent.com>
6601 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
6602 SunOS 4.1.4 for which gid_t is an unsigned type.
6604 2000-06-03 Jim Meyering <meyering@lucent.com>
6606 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
6608 2000-05-26 Bruno Haible <haible@clisp.cons.org>
6610 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
6611 newer, don't install charset.alias.
6612 * config.charset: Change the Linux/glibc rules so they become empty
6613 on glibc-2.1 or newer.
6615 2000-06-02 Jim Meyering <meyering@lucent.com>
6617 * mountlist.c: Back out last change. Instead, do this...
6618 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
6619 member using the same `ignore'-testing code.
6620 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
6624 2000-05-29 Jim Meyering <meyering@lucent.com>
6626 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
6627 with the `ignore' attribute. Based on a patch from Mark D. Roth.
6629 2000-05-22 Jim Meyering <meyering@lucent.com>
6631 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
6633 2000-05-18 Jim Meyering <meyering@lucent.com>
6635 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
6636 back, too, since it may have been modified by allocate_entry.
6637 (hash_delete): Rewrite to use neither the assignment operator
6638 nor the comma operator in an if-expression.
6640 2000-05-15 Paul Eggert <eggert@twinsun.com>
6643 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
6644 Remove; no longer needed.
6645 "quotearg.h": Add include.
6646 (file_name): Do not bother to explicitly initialize to NULL; it's less
6647 efficient on some hosts.
6648 (close_stdout_status): Remove test as to whether stdout was already
6649 closed; it breaks for the case "echo x | sort >&-".
6650 Quote file name colons.
6651 Do not assume that _("write error") lacks format strings.
6653 2000-05-15 Jim Meyering <meyering@lucent.com>
6655 * version-etc.c (version_etc_copyright): Update the copyright string
6656 used in all --version output.
6658 2000-05-14 Jim Meyering <meyering@lucent.com>
6660 * closeout.c (close_stdout_set_file_name): New function.
6661 (close_stdout_status): Use new file-scoped global.
6662 Return right away if fstat says the stdout file descriptor is invalid.
6663 * closeout.h (close_stdout_set_file_name): Declare.
6665 2000-05-10 Jim Meyering <meyering@lucent.com>
6667 * closeout.c [default_exit_status]: New file-scoped variable.
6668 (close_stdout_set_status): New function.
6669 * closeout.h (close_stdout_set_status): Declare.
6671 2000-05-08 Jim Meyering <meyering@lucent.com>
6673 * long-options.c: Don't include closeout.h.
6674 (parse_long_options): Don't call close_stdout for --version.
6676 2000-05-06 Jim Meyering <meyering@lucent.com>
6678 * strnlen.c: Undefine __strnlen and strnlen.
6679 [!weak_alias]: Define __strnlen to strnlen.
6681 * atexit.c: New file, from libiberty.
6683 2000-05-06 Jim Meyering <meyering@lucent.com>
6685 * closeout.c (close_stdout_status): Also check for errors on the
6688 2000-05-05 Bruno Haible <haible@clisp.cons.org>
6690 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
6691 instead of xmalloc, xrealloc, path_concat.
6692 (locale_charset): Treat empty environment variables as absent.
6693 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
6695 2000-05-04 Jim Meyering <meyering@lucent.com>
6697 * getopt.c: Update from glibc.
6698 * obstack.c: Likewise.
6699 * obstack.h: Likewise.
6700 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
6702 * regex.h: Likewise.
6703 * strndup.c: Likewise.
6704 * strnlen.c: New file, from glibc.
6706 2000-05-01 Jim Meyering <meyering@lucent.com>
6708 * full-write.c (full_write): Remove `FIXME' part of comment.
6710 2000-04-29 Jim Meyering <meyering@lucent.com>
6712 * path-concat.c: Declare strdup only if it's not defined.
6713 * canon-host.c: Likewise.
6715 2000-04-28 Jim Meyering <meyering@lucent.com>
6717 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
6718 redefinition warning on some systems (HPUX). Otherwise, regex.h is
6719 included first, then limits.h is included by locale.h by libintl.h.
6720 From John David Anglin.
6722 2000-04-25 Jim Meyering <meyering@lucent.com>
6724 * makepath.c (S_IRWXUGO): Define.
6725 (make_path): Always perform explicit chmod if MODE specifies any
6726 of the `special' permission bits. Prompted by a bug report against
6727 install from Mate Wierdl and Joost van Baal.
6729 2000-04-18 Jim Meyering <meyering@lucent.com>
6733 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
6734 getpagesize. For BeOS. Based on a patch from Bruno Haible.
6736 2000-04-17 Jim Meyering <meyering@lucent.com>
6738 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6739 the definition of it to rpl_strftime also defined-away the system's
6742 2000-04-15 Jim Meyering <meyering@lucent.com>
6744 Use `C' to denote so-called `contiguous' files, the same way
6746 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6747 (ftypelet): Use S_ISCTG.
6748 From Michael Deutschmann.
6750 2000-04-14 Jim Meyering <meyering@lucent.com>
6752 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6754 2000-04-08 Jim Meyering <meyering@lucent.com>
6756 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6757 names don't conflict. Reported by Eli Zaretskii.
6759 2000-03-28 Bruno Haible <haible@clisp.cons.org>
6761 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6762 bug. Deal with the different error behavior of Irix iconv.
6764 2000-04-07 Jim Meyering <meyering@lucent.com>
6766 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6767 to work around system header problems on AIX 3.2.5. From Bruno Haible.
6769 2000-04-05 Jim Meyering <meyering@lucent.com>
6771 Portability tweaks required for ultrix4.3.
6772 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6773 * readutmp.c: Include sys/types.h before sys/stat.h.
6774 * canon-host.c: Declare strdup.
6775 * path-concat.c: Likewise.
6776 From John David Anglin.
6778 2000-04-04 Jim Meyering <meyering@lucent.com>
6780 Be more DOS 8.3-friendly.
6781 * ref-add.sin: Renamed from ref-add.sed.in.
6782 * ref-del.sin: Renamed from ref-del.sed.in.
6783 * Makefile.am: Reflect renaming.
6784 Reported by Eli Zaretskii.
6786 Use a temporary file name that won't clash with `charset.alias'
6787 in the DOS 8.3 name space.
6788 * Makefile.am (charset_tmp): Define.
6789 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
6790 (uninstall-local): Likewise.
6791 Reported by Eli Zaretskii.
6793 2000-03-29 Paul Eggert <eggert@twinsun.com>
6795 * time/strftime.c (my_strftime): Make sure we call the system
6796 strftime, not ourselves, when invoking the underlying strftime.
6798 2000-03-24 Jim Meyering <meyering@lucent.com>
6800 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
6801 (charset_alias): Define.
6802 (install-exec-local): Factor out common code.
6803 (uninstall-local): Split lines longer than 80.
6804 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
6806 (.sed.in.sed): New rule. Don't redirect directly to $@.
6807 (CLEANFILES): Add ref-add.sed and ref-del.sed.
6809 2000-03-19 Bruno Haible <haible@clisp.cons.org>
6811 * config.charset: Output a line containing "Packages using this file".
6812 * ref-add.sed.in, ref-del.sed.in: New files.
6813 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
6814 ref-del.sed): New rules.
6816 2000-03-17 Jim Meyering <meyering@lucent.com>
6818 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
6819 Otherwise, include <strings.h>
6821 2000-03-17 Bruno Haible <haible@clisp.cons.org>
6823 * unicodeio.c (utf8_wctomb): New function.
6824 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
6825 format instead of in UCS-4 with platform dependent endianness.
6827 2000-03-07 Paul Eggert <eggert@twinsun.com>
6829 * savedir.c (savedir): Work even if directory size is
6830 negative; this can happen with some screwy NFS configurations.
6832 2000-03-06 Jim Meyering <meyering@lucent.com>
6834 * localcharset.c (get_charset_aliases): Don't try to free file_name
6835 if it's NULL (because we ran out of memory). From Bruno Haible.
6837 2000-03-05 Jim Meyering <meyering@lucent.com>
6839 * localcharset.c ("path-concat.h"): Include.
6840 (get_charset_aliases): Use path_concat instead of ANSI string
6843 * unicodeio.h (PARAMS): Define.
6844 Use it to guard prototype.
6846 2000-03-04 Jim Meyering <meyering@lucent.com>
6848 * Makefile.am (install-exec-local): Create $(libdir) before installing
6850 (uninstall-local): Uncomment this rule so `make distcheck' works
6853 * unicodeio.c (<errno.h>): Include it.
6854 (errno): Declare if not defined.
6856 * localcharset.c: Add Bruno's comment justifying use of volatile.
6858 * config.charset: New version, incorporating remarks from a linux
6859 i18n mailing list. From Bruno Haible.
6861 2000-03-02 Jim Meyering <meyering@lucent.com>
6863 * Makefile.am (EXTRA_DIST): Add config.charset.
6865 2000-03-01 Jim Meyering <meyering@lucent.com>
6867 * localcharset.c: Guard some #includes with `#if HAVE_...'.
6868 * unicodeio.c: Likewise.
6870 2000-02-02 Bruno Haible <haible@clisp.cons.org>
6872 * config.charset: New file.
6873 * localcharset.c: New file.
6874 * unicodeio.h, unicodeio.c: New files.
6875 * Makefile.am (DEFS): Add -DLIBDIR=...
6876 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
6877 (noinst_HEADERS): Add unicodeio.h.
6878 (all-local, install-exec-local, charset.alias): New targets.
6880 2000-02-28 Paul Eggert <eggert@twinsun.com>
6882 * quotearg.c (ALERT_CHAR): New macro.
6883 (quotearg_buffer_restyled): Use it.
6885 2000-02-27 Jim Meyering <meyering@lucent.com>
6887 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
6888 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
6890 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
6891 not `#if STDC_HEADERS'.
6892 Declare malloc if needed.
6894 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
6895 now that autoconf always defines the HAVE_DECL_ symbols.
6896 * human.c: Likewise.
6898 * strtoumax.c: Likewise.
6900 * backupfile.c: Arrange for cpp to fail if the configure-time
6901 declaration check was not run.
6903 * human.c: Likewise.
6905 * strtoumax.c: Likewise.
6907 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
6908 then first look up the entire `.'-containing string as a login name.
6910 2000-02-18 Paul Eggert <eggert@twinsun.com>
6912 * getdate.y: Handle two-digit years with leading zeros correctly.
6913 (textint): New typedef.
6914 (parser_control): Member year changed from int to textint.
6916 (YYSTYPE): Removed; replaced by %union with int and textint members.
6917 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
6918 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
6919 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
6920 (tSNUMBER, tUNUMBER): Now of type <textintval>.
6921 (date, number, to_year): Use width of number in digits, not its value,
6922 to determine whether it's a 2-digit year, or a 2-digit time.
6923 (yylex): Store number of digits of numeric tokens.
6924 Reported by John Kendall.
6926 (parser_control): Changed from struct parser_control to typedef (for
6927 consistency). All uses changed.
6929 (tID): Removed; not used.
6930 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
6932 2000-02-14 Paul Eggert <eggert@twinsun.com>
6934 * getpagesize.h (getpagesize): Port to VMS for Alpha;
6935 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
6937 2000-02-12 Jim Meyering <meyering@lucent.com>
6939 * userspec.c (ISDIGIT): Define it.
6940 (isdigit): Remove definition.
6941 (is_number): Use ISDIGIT, not isdigit.
6942 <libintl.h>: Include.
6944 (parse_user_spec): Mark translatable strings.
6946 2000-02-10 Jim Meyering <meyering@lucent.com>
6948 With these changes, nanosleep.[ch] are finally enough like the other
6949 lib/* replacement files to compile on a few more losing systems.
6951 * nanosleep.h: Don't include config.h.
6952 Remove prototype from declaration of nanosleep.
6953 (PARAMS): Remove now-unneeded definition.
6954 * nanosleep.c: #undef nanosleep.
6955 (rpl_nanosleep): Rename from nanosleep.
6957 2000-02-03 Jim Meyering <meyering@lucent.com>
6959 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
6960 rather than with `#if HAVE_UTMPNAME'.
6962 2000-02-01 Jim Meyering <meyering@lucent.com>
6964 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
6966 2000-01-31 Jim Meyering <meyering@lucent.com>
6968 * nanosleep.h (nanosleep): Guard declaration with
6969 `#if ! HAVE_DECL_NANOSLEEP'.
6970 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
6971 the declaration in that vendor's sys/timers.h.
6972 Reported by Christian Krackowizer.
6974 * quotearg.c (ISASCII): Add #undef and move definition to follow
6975 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
6976 (ISPRINT): Likewise.
6977 Reported by Tom Tromey.
6979 2000-01-30 Jim Meyering <meyering@lucent.com>
6981 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
6982 uses of ->ut_name. The latter doesn't work with new Linux header files
6983 where only utmpx.ut_user is declared.
6985 * readutmp.h (UT_USER): Define.
6987 2000-01-23 Jim Meyering <meyering@lucent.com>
6989 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
6992 2000-01-22 Jim Meyering <meyering@lucent.com>
6994 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
6995 [! HAVE_DECL_STRTOULL]: Declare strtoull.
6996 Required for some AIX systems. Reported by Christian Krackowizer.
6997 [TESTING] (main): New function.
6999 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
7000 * dirname.c (dir_name): Support for DOS-style file names with drive
7003 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
7005 * strverscmp.c (ISDIGIT): Define.
7006 (strverscmp): Use ISDIGIT, not isdigit.
7008 2000-01-17 Paul Eggert <eggert@twinsun.com>
7010 * nanosleep.c (nanosleep):
7011 Don't use SA_INTERRUPT to decide whether to call sigaction, as
7012 POSIX.1 doesn't require SA_INTERRUPT and some systems
7013 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
7014 it's been part of POSIX.1 since day 1 (in 1988).
7016 2000-01-17 Jim Meyering <meyering@lucent.com>
7018 * interlock: Remove unused file. Reported by François Pinard.
7020 2000-01-16 Paul Eggert <eggert@twinsun.com>
7022 * quotearg.c (quotearg_buffer_restyled): Do not quote
7023 alert, backslash, formfeed, and vertical tab unnecessarily in
7024 shell quoting style.
7027 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
7028 Free Software Foundation, Inc.
7029 Copying and distribution of this file, with or without modification,
7030 are permitted provided the copyright notice and this notice are preserved.