1 2005-08-02 Simon Josefsson <jas@extundo.com>
3 * getline.h, getline.c: Rewrite.
5 * getdelim.h, getdelim.c: New files, ported from glibc.
7 2005-07-31 Bruno Haible <bruno@clisp.org>
9 * lock.h (gl_lock_initializer): New macro.
10 (gl_lock_define_initialized): Use it.
11 (gl_rwlock_initializer): New macro.
12 (gl_rwlock_define_initialized): Use it.
13 (gl_recursive_lock_initializer): New macro.
14 (gl_recursive_lock_define_initialized): Use it.
16 2005-07-26 Bruno Haible <bruno@clisp.org>
18 * lock.h: Update from GNU gettext.
19 * lock.c: Update from GNU gettext.
21 2005-07-18 Bruno Haible <bruno@clisp.org>
23 * lock.h (gl_once_t): New type.
24 (gl_once_define, gl_once): New macros.
25 * lock.c (fresh_once): New variable.
26 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
29 2005-07-18 Simon Josefsson <jas@extundo.com>
31 * check-version.c (check_version): Accept identical versions too.
33 2005-07-18 Bruno Haible <bruno@clisp.org>
35 * lock.h: New file, from GNU gettext.
36 * lock.c: New file, from GNU gettext.
38 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
40 * quotearg.c: Add translator comment suggested by Bruno Haible,
43 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
45 * version-etc-fsf.c (version_etc_copyright): Parameterize the
46 copyright symbol and the year.
47 * version-etc.c (COPYRIGHT_YEAR): New constant.
48 (version_etc_va): Use parameterized copyright notice.
49 Reword to conform to the current GNU coding standards.
51 2005-07-11 Simon Josefsson <jas@extundo.com>
53 * size_max.h: New file.
55 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
57 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
60 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
61 and Paul Eggert <eggert@cs.ucla.edu>
63 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
64 in wint_t, not wchar_t. Remove now-unnecessary cast.
66 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
68 * regex.c, regex.h: Sync from libc.
69 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
70 New files, synced from libc, except that regex_internal.h
71 currently has a small porting fix.
73 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
75 Remove the dependency of the strftime module on the tzset module.
76 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
77 Copy the input structure, to work around some of the bug with
78 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
79 Solaris releases, you should also use the tzset module, but we won't
80 require it as a dependency any more since we don't want LGPLed code
81 to depend on GPLed code.
83 2005-07-02 Jim Meyering <jim@meyering.net>
85 * backupfile.c (backup_args): Change a `0' to NULL.
87 2005-07-01 Jim Meyering <jim@meyering.net>
89 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
90 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
91 * save-cwd.c, tempname.c:
92 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
93 and don't include <sys/file.h>).
95 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
97 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
98 declares only 'struct timespec;' (!).
100 2005-06-29 Jim Meyering <jim@meyering.net>
102 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
103 type name. Use the variable name instead.
104 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
106 2005-06-28 Simon Josefsson <jas@extundo.com>
108 * check-version.h, check-version.c: New files.
110 2005-06-28 Simon Josefsson <jas@extundo.com>
112 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
113 collision with global variable. Better indentation. Don't
114 increment buffer pointer beyond buffer end. Based on comments
115 from Paul Eggert <eggert@cs.ucla.edu>.
119 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
121 * canon-host.c (canon-host): Append trailing "," to 0 in
122 initializer of struct addrinfo, as an indication that we don't
123 care how many members the structure has.
125 2005-06-24 Derek Price <derek@ximbiot.com>
126 and Bruno Haible <bruno@clisp.org>
128 Remove stat module & update lstat.
129 * stat.c: Remove this file...
130 (slash_aware_lstat): ...moving this content and its support...
131 * lstat.c (rpl_lstat): ...into here.
134 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
136 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
137 (ranged_convert): Don't save conversion in a temporary struct.
138 This causes a warning with GCC 4.0.0, and anyway in the typical
139 case it's not worth the extra 100 bytes or so of code.
140 (ranged_convert, __mktime_internal): When calling a function via a
141 pointer P, use P () rather than (*P) (), as we now assume C89 or
144 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
146 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
147 "who -r" failed to give output. Problem reported by Tim Waugh.
149 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
150 (xcalloc): Use it to avoid needless tests.
151 Problem reported by Jim Meyering.
153 2005-06-16 Jim Meyering <jim@meyering.net>
155 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
156 when either N or S is zero.
158 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
160 * argp.h (__option_is_short): Check upper limit of
161 __key. Isprint() requires its argument to have the value
162 of an unsigned char or EOF.
164 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
166 * fnmatch.c (fnmatch): If there is an encoding error in a
167 multibyte string or pattern, fall back on unibyte matching.
168 Problem reported by James Youngman.
170 2005-06-08 Bruno Haible <bruno@clisp.org>
172 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
175 2005-06-08 Bruno Haible <bruno@clisp.org>
177 * csharpcomp.h: New file, from GNU gettext.
178 * csharpcomp.c: New file, from GNU gettext.
179 * csharpcomp.sh.in: New file, from GNU gettext.
181 2005-06-07 Derek Price <derek@ximbiot.com>
184 * glob_.h: Indent nested #ifdef.
186 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
189 Use "file name" when talking about file names, instead of "filename"
190 or "path", as per the GNU coding standards.
191 * mkdir-p.c: Renamed from makepath.c.
192 (make_dir_parents): Renamed from make_path. All callers changed.
193 * mkdir-p.h: Likewise. All includers changed.
194 * filenamecat.c: Renamed from path-concat.c.
195 (file_name_concat): Renamed from path_concat. All callers changed.
196 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
197 * filenamecat.h: Likewise. All includers changed.
198 * acl.c: Don't use "path" or "filename" to mean "file name"
199 in comments or local variable names.
200 * basename.c: Likewise.
201 * canonicalize.c, canonicalize.h: Likewise.
202 * dirname.c, dirname.h: Likewise.
203 * euidaccess.c: Likewise.
204 * exclude.c: Likewise
205 * fnmatch_.h, fnmatch_loop.c: Likewise.
206 * fsusage.c, fsuage.h: Likewise.
207 * fts.c, fts_.h: Likewise.
208 * getcwd.c: Likewise.
209 * getloadavg.c: Likewise.
210 * mkstemp.c: Likewise.
211 * mountlist.c, mountlist.h: Likewise.
212 * openat.c, openat.h: Likewise.
213 * readlink-stub.c: Likewise.
214 * readutmp.c, readutmp.h: Likewise.
215 * rename.c: Likewise.
218 * savedir.c: Likewise.
219 * stripslash.c: Likewise.
220 * tempname.c: Likewise.
221 * xreadlink.c: Likewise.
222 * exclude.c (excluded_file_name): Renamed from excluded_filename.
224 * exclude.h: Likewise.
226 * euidaccess.c (getuid, getgid, getuid, getegid)
227 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
228 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
229 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
230 * pathmax.h: Include <limits.h> unconditionally, since other
231 files have been getting away with it for years (MORE/BSD 4.3
233 * userspec.c (getpwnam, getgrnam, getgrgid)
234 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
236 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
237 Define to 256, not 255, as per modern POSIX.
239 2005-06-01 Bruno Haible <bruno@clisp.org>
241 * csharpexec.h: New file, from GNU gettext.
242 * csharpexec.c: New file, from GNU gettext.
243 * csharpexec.sh.in: New file, from GNU gettext.
245 2005-05-31 Derek Price <derek@ximbiot.com>
246 Paul Eggert <eggert@cs.ucla.edu>
249 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
251 2005-05-29 Derek Price <derek@ximbiot.com>
252 Paul Eggert <eggert@cs.ucla.edu>
254 * glob_.h, glob.c: New files.
256 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
258 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
260 * fts.c: Don't worry about debugging on pre-C99-comopatible hosts;
261 the configuration hassle isn't worth it.
262 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
263 (LONGEST_MODIFIER, PRIuMAX): Remove.
265 2005-05-27 Bruno Haible <bruno@clisp.org>
267 * getlogin_r.h: Remove second include of <stddef.h>.
269 2005-05-25 Bruno Haible <bruno@clisp.org>
270 Derek Price <derek@ximbiot.com>
272 * getlogin_r.h: Simplify API documentation.
274 2005-05-25 Derek Price <derek@ximbiot.com>
275 Paul Eggert <eggert@cs.ucla.edu>
277 * getlogin_r.c, getlogin_r.h: New files.
279 2005-05-22 Bruno Haible <bruno@clisp.org>
281 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
282 Also include <sys/param.h> if it defines MIN, MAX.
283 Based on a patch by Derek Price <derek@ximbiot.com>.
285 2005-05-22 Bruno Haible <bruno@clisp.org>
287 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
288 (INT64_MIN): Fix definition.
289 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
291 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
292 NEED_SIGNED_INT_TYPES.
294 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
295 HAVE_SYSTEM_INTTYPES.
297 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
299 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
300 so that unistd-safer.h (GPL'ed code) need not be included.
302 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
305 * fts.c: Don't include "cycle-check.h" or "hash.h".
306 (setup_dir, free_dir): New functions.
307 (enter_dir, leave_dir): Define trivial
308 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
309 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
310 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
311 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
313 (fts_open): Use setup_dir.
314 (fts_close): Use free_dir.
315 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
316 This adds a label and some gotos, but the alternatives were messier.
317 Check for memory allocation failure when entering a dir.
318 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
319 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
320 (FTS): New member fts_cycle, that is a union that contains the
321 old active_dir_ht and cycle_state. All uses changed to mention
322 fts_cycle.ht and fts_cycle.state.
323 * fts-cycle.c: New file, containing GPL'ed code migrated out of
324 fts.c, with the following changes:
325 (setup_dir, free_dir): New functions.
326 (enter_dir): Now returns bool. Return true if successful, false
327 if memory exhausted. All callers changed.
328 Do not bother partly cleaning up on
329 memory allocation failure; that is free_dir's job.
330 However, free ad if hash_insert fails, to avoid memory leak.
331 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
332 fts->fts_options to see which union member to use.
334 2005-05-20 Jim Meyering <jim@meyering.net>
336 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
337 Now a macro, to pacify GCC.
339 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
341 * chown.c (rpl_chown): Return -1 on failure.
343 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
345 * canonicalize.c: Include canonicalize.h first, to test interface.
346 Include <stddef.h> unconditionally, since we assume C89 now.
347 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
348 * fts.c: Include fts_.h first, to check interface.
349 Do not include intprops.h; no longer needed.
350 Include cycle-check.h and hash.h, since fts_.h no longer does.
351 Remove unnecessary casts of closedir to void.
352 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
353 decide whether to decrement nlinks.
354 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
355 (FTS): Use struct hash_table * instead of Hash_table, so that
356 we no longer need to include hash.h here.
358 2005-05-17 Jim Meyering <jim@meyering.net>
360 * fts.c, fts_.h: New files, from coreutils.
362 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
365 * unlinkdir.c, unlinkdir.h: New files.
366 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
367 regex.h, unlocked-io.h, xtime.h:
368 White space changes only.
369 * makepath.c (make_path): Port to hosts where leading "//" is special.
370 * yesno.c: Include getline.h, not ctype.h.
371 (yesno): Don't remove leading white space; POSIX doesn't allow it.
372 Use getline to remove arbitrary restriction on response length.
374 2005-05-13 Bruno Haible <bruno@clisp.org>
376 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
377 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
378 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
379 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
380 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
381 Add support for 64-bit integers in the MSVC compiler.
383 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
385 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
386 Change the initial comment to refer to GPL, not LGPL.
387 gnulib-tool will change it to LGPL as needed.
389 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
390 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
391 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
392 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
393 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
394 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
395 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
396 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
397 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
398 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
399 concatpath.c, config.charset, copy-file.c, copy-file.h,
400 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
401 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
402 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
403 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
404 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
405 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
406 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
407 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
408 full-read.c, full-read.h, full-write.c, full-write.h,
409 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
410 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
411 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
412 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
413 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
414 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
415 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
416 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
417 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
418 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
419 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
420 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
421 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
422 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
423 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
424 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
425 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
426 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
427 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
428 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
429 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
430 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
431 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
432 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
433 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
434 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
435 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
436 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
437 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
438 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
439 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
440 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
441 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
442 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
443 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
444 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
445 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
446 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
447 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
448 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
449 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
450 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
451 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
452 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
453 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
454 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
455 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
456 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
457 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
458 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
459 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
460 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
461 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
462 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
463 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
464 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
465 Update FSF postal mail address.
467 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
469 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
470 specified in ai_socktype. Fix invalid ai_protocol
471 check. ai_protocol is usually set to 0 or depending on
472 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
473 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
474 ai_socktype / ai_protocol in the returned addrinfo structure.
476 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
477 Bruno Haible <bruno@clisp.org>
479 * inet_ntop.h: New file.
480 * inet_ntop.c: New file, from glibc with modifications.
482 2005-05-08 Jim Meyering <jim@meyering.net>
484 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
486 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
488 Merge from coreutils. Among other things,
489 add bulletproofing for cases where stdin, stdout, or stderr are closed.
490 * fd-safer.c: New file.
491 * fcntl-safer.h, open-safer.c: Remove.
492 * chdir-long.c: Fix comment "fetish" -> "coreutils".
493 * dup-safer.c: Include unistd-safer.h first.
494 Don't include errno.h.
495 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
496 * file-type.h: Don't assume invoker included sys/stat.h first.
497 * file-type.c: Rely on file-type.h change.
498 * getloadavg.c: Include unistd-safer.h.
499 (getloadavg): Use safer open.
500 * getusershell.c: Include "stdio-safer.h".
501 (getusershell): Use safer fopen.
502 * long-options.c (long_options): Use NULL rather than 0.
503 * modechange.h (mode_free): Remove; all callers changed to invoke
505 * modechange.c: Likewise.
506 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
507 (MODE_DONE): New constant.
508 (struct mode_change): Remove 'next' member.
509 (make_node_op_equals): New function; like the old one of the
510 same name, except it allocates an array.
511 (mode_compile, mode_create_from_ref): Use it.
512 (mode_compile): Allocate result as an array, not a linked list.
513 Parse octal string ourself, so that we catch mistakes like "+0".
514 (mode_adjust): Arg is an array, not a linked list.
515 * modechange.c: Include stat-macros.h, xalloc.h.
516 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
517 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
518 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
519 Remove. This is now stat-macros.h's job.
520 (talloc): Remove. All callers replaced by xalloc, so that
521 our invokers don't have to worry about reporting memory failures.
522 (make_node_op_equals): Remove.
523 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
525 (struct mode_change): Moved here from modechange.h.
526 (mode_append_entry): Remove.
527 (mode_compile): Remove MASKED_OPS arg, since it encouraged
528 apps to have incorrect behavior. Use simpler algorithm for head
529 and tail. Don't futz with umask; that's now the job of mode_adjust.
530 Detect more invalid usages rather than having somewhat-random behavior.
531 Don't insert an "a=" action, as that leads to incorrect behavior.
532 (mode_compile, mode_create_from_ref): Return NULL on error instead
533 of an enum, since now there's only one way to have an error. All
535 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
536 at the correct time. Simplify calculation of "+u" and its ilk.
537 Don't mishandle "+X".
538 (mode_free): Remove "register" and localize decls.
539 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
540 (struct mode_change): Move to modechange.c; callers don't
541 need to see this stuff.
542 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
543 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
544 (mode_change, mode_adjust): Reflect the new signatures noted above.
545 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
546 that might redefine system include files.
547 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
548 (my_usleep): Use NULL rather than (void *) 0.
549 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
550 Use siginterrupt to specify that system calls should be interrupted.
551 (rpl_nanosleep): Move initialization of suspended closer to call of
553 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
554 * readutmp.c: Likewise. Include signal.h, stdbool.h.
555 (desirable_utmp_entry): New function.
556 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
557 using x2nrealloc, to simplify logic.
558 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
559 size calculation. Do not assume utmp file is a regular file.
560 * readutmp.h (UT_PID): Moved here from ../src/who.c.
561 (READ_UTMP_CHECK_PIDS): New constant.
562 * save-cwd.c: Include unistd-safer.h.
563 (save_cwd): Use fd_safer.
564 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
565 [!_LIBC] Include "stat-macros.h" instead.
566 * unistd-safer.h (fd_safer): New decl.
568 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
570 * byteswap_.h: New file.
572 2005-04-25 Albert Chin <china@thewrittenword.com>
574 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
577 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
579 * getdate.y (zone): Allow relunit_snumber after tZONE, so
580 that "UTC +1 second" continues to work. Problem reported
582 (relunit_snumber): New rule.
585 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
587 * getdate.y (universal_time_zone_table): New constant.
588 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
589 universal_time_zone_table.
590 (lookup_zone): Prefer universal_time_zone_table to
591 local_time_zone_table, so that "GMT" time stamps are allowed in
592 London during the summer. Problem reported by Ian Abbott.
594 2005-04-12 Jim Meyering <jim@meyering.net>
596 * human.c (humblock): Set *options even when returning due to
597 xstrtoumax conversion failure. Thanks to a used-uninitialized
600 2005-04-09 Jim Meyering <jim@meyering.net>
602 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
603 -Wuninitialized: initialize tm0.tm_year.
605 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
607 * getdate.y (parser_control): rels_seen is now a boolean, not a
608 count, since there's no maximum. All uses changed.
609 Add member dsts_seen.
610 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
612 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
613 Use pc_rels_seen to decide whther a date is absolute.
615 * getdate.y (number): Don't overwrite year.
616 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
619 2005-04-02 Simon Josefsson <jas@extundo.com>
621 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
622 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
624 2005-03-27 Jim Meyering <jim@meyering.net>
626 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
628 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
630 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
631 "one's complement" -> "ones' complement" in comment, as per Knuth.
632 "value of type" -> "type or expression" in comment.
633 * mktime.c, strftime.c: Propagate intprops.h comment nits.
635 2005-03-26 Jim Meyering <jim@meyering.net>
638 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
639 Correct typos: s/or/of/.
641 2005-03-23 Jim Meyering <jim@meyering.net>
643 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
645 2005-03-21 Jim Meyering <jim@meyering.net>
647 Changes imported from coreutils.
649 * cycle-check.c: Don't include xalloc.h.
651 * path-concat.c: Don't include assert.h.
652 (path_concat): Remove assertion that would have triggered
653 for ABASE starting with more than one slash.
654 Reported by Andreas Schwab.
656 * path-concat.c (path_concat): Set *BASE_IN_RESULT
657 properly when ABASE is an absolute file name.
658 Correct the description of this function.
660 Add an assertion and a test driver.
661 This fixes a bug introduced on 2004-07-02.
662 Andreas Schwab reported the resulting failure of cp --parents:
663 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
665 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
667 * strftime.c (my_strftime): If the underlying strftime returns 0
668 (which shouldn't happen), generate nothing instead of returning 0
669 immediately, so that nstrftime (NULL, ...) doesn't return 0.
671 2005-03-16 Bruno Haible <bruno@clisp.org>
673 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
675 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
677 * strftime.c (my_strftime): Prepend space to format so that we can
678 reliably distinguish strftime failure from empty output on POSIX
681 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
683 * iconvme.c (SIZE_MAX): New macro, if not already defined.
684 (iconv_string): Don't guess a size-zero buffer, as that might cause
685 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
686 result would be 'too large', where 'too large' is (heuristically)
687 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
688 overflow concerns. This will prevent some unwanted malloc failures
689 when the inputs are very large.
691 2005-03-15 Bruno Haible <bruno@clisp.org>
693 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
696 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
699 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
701 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
703 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
704 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
706 * strtol.c: Likewise.
708 2005-03-14 Simon Josefsson <jas@extundo.com>
710 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
713 2005-03-14 Jim Meyering <jim@meyering.net>
715 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
716 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
717 to be nonzero so that we (and caller) can detect the difference
718 between a valid zero-length expansion and an error return, even
719 when the underlying strftime fails before writing anything into
722 2005-03-10 Jim Meyering <jim@meyering.net>
724 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
725 so that this module works on systems without fchdir.
727 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
729 Factor int-properties macros into a single file, except for
731 * intprops.h: New file.
732 * getloadavg.c: Include it instead of limits.h.
733 (INT_STRLEN_BOUND): Remove.
734 * human.c: Include intprops.h.
735 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
736 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
737 * inttostr.h: Include intprops.h instead of limits.h.
738 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
739 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
740 for consistency with intprops.h.
741 (time_t_is_integer, twos_complement_arithmetic): Use them.
742 * sig2str.h: Include <signal.h>, intprops.h.
743 (INT_STRLEN_BOUND): Remove.
744 * strftime.c (TYPE_SIGNED): Remove.
745 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
746 * strtol.c: Adjust comments to match intprops.h.
747 * userspec.c: Include intprops.h.
748 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
749 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
750 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
751 instead of rolling our own expressions.
752 * xstrtol.c: Include xstrtol.h first, to test interface.
754 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
756 (my_strftime): Do not mishandle years close to INT_MAX, by doing
757 the right thing even if adding 1900 would overflow. Similarly
758 for tm_mon + 1 and tm_yday + 1.
759 Make %Y always equivalent to %C%y, and similarly for %G and %g.
760 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
761 (DO_SIGNED_NUMBER): New macro.
762 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
764 2005-03-07 Bruno Haible <bruno@clisp.org>
766 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
768 2005-03-03 Derek R. Price <derek@ximbiot.com>
769 Bruno Haible <bruno@clisp.org>
771 * pagealign_alloc.h: New file.
772 * pagealign_alloc.c: New file.
774 2005-01-28 Bruno Haible <bruno@clisp.org>
776 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
779 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
781 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
782 The workaround isn't strictly needed for POSIX conformance, and
783 it's too much of a pain to configure and maintain. We'll ask
784 people to fix their kernels instead.
785 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
786 (NANOSLEEP_BUG_WORKAROUND): Remove.
787 (xnanosleep): Remove the workaround.
789 2005-02-12 Bruno Haible <bruno@clisp.org>
791 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
793 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
795 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
796 * timespec.h (gettime): Return void, since it always
797 succeeds now. All uses changed.
798 * gettime.c (gettime) Likewise.
799 [HAVE_NANOTIME]: Prefer nanotime.
800 Assume gettimeofday succeeds, as POSIX requires.
801 Assime time () succeeds, since other code already does.
802 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
803 (timespec_subtract): Remove.
804 (NANOSLEEP_BUG_WORKAROUND): New constant.
805 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
806 things considerably. Use it only on GNU/Linux hosts, since the
807 workaround shouldn't be needed elsewhere.
809 2005-02-24 Bruno Haible <bruno@clisp.org>
811 * gettext.h: Update from GNU gettext 0.14.2.
813 2005-02-24 Bruno Haible <bruno@clisp.org>
815 * localcharset.c: Update from GNU gettext 0.14.2.
816 * config.charset: Update from GNU gettext 0.14.2.
818 2005-02-22 Simon Josefsson <jas@extundo.com>
820 * iconvme.h, iconvme.c: New files, from libc.
822 2005-02-20 Neil Conway <neilc@samurai.com>
824 * xgethostname.c (xgethostname): Check for ENOMEM, which is
825 returned by OSX/Darwin if the specified buffer is not large
826 enough for the hostname.
828 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
830 * memrchr.h: New file.
831 * chdir-long.c: Include it.
832 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
833 Don't bother including stddef.h.
835 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
837 * argp-help.c (__argp_help): Create a fake struct argp_state and
838 pass it to _help, otherwise the latter coredumps trying to
839 dereference state.root_argp.
841 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
843 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
845 Include <sys/types.h>, for dev_t.
846 (ME_DUMMY, ME_REMOTE): Move from here....
847 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
848 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
850 Include mountlist.h first, to test the interface.
852 2005-01-29 Bruno Haible <bruno@clisp.org>
854 * progname.c (program_name): Initialize.
855 Needed when linking statically on MacOS X.
857 2005-01-28 Bruno Haible <bruno@clisp.org>
859 * javacomp.sh.in: New file, from GNU gettext.
860 * javacomp.h: New file, from GNU gettext.
861 * javacomp.c: New file, from GNU gettext.
863 2005-01-26 Bruno Haible <bruno@clisp.org>
865 * javaexec.sh.in: New file, from GNU gettext.
866 * javaexec.h: New file, from GNU gettext.
867 * javaexec.c: New file, from GNU gettext.
869 2005-01-26 Simon Josefsson <jas@extundo.com>
871 * gai_strerror.c: Use GPL in header.
873 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
875 * argp-help.c (hol_entry_help): Avoid using non-constant
876 initializers for struct pentry_state.
877 (__argp_error): Check return value of __asprintf
878 (__argp_failure): Translate error message
880 * argp-parse.c: Removed braces around the expansion of N_()
882 2005-01-21 Jim Meyering <jim@meyering.net>
884 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
885 same value as for Solaris 9.
887 * chdir-long.c (chdir_long): Rewrite to remove limitation on
888 component length. This included changing the parameter to be
889 of type `char *' rather than `char const *'.
890 * chdir-long.h (chdir_long): Update prototype.
892 * openat.c (fdopendir, fstatat): New functions.
893 * openat.h: Include headers required for use of DIR and struct stat.
894 [AT_SYMLINK_NOFOLLOW]: Define.
895 (fdopendir, fstatat): Add prototypes.
897 2005-01-21 Bruno Haible <bruno@clisp.org>
899 * classpath.h: New file, from GNU gettext.
900 * classpath.c: New file, from GNU gettext.
902 2005-01-20 Simon Josefsson <jas@extundo.com>
904 * version-etc-fsf.c: New file, with version_etc_copyright.
905 * version-etc.c: Remove version_etc_copyright.
906 * version-etc.h (version_etc_copyright): Use [] instead of * in
907 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
909 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
911 * save-cwd.c (save_cwd): Remove code to support the case
912 where fchdir is missing or flaky.
914 2005-01-20 Simon Josefsson <jas@extundo.com>
916 * base64.h (isbase64): Add.
918 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
919 using a unsigned prototype, don't inline.
920 (base64_decode): Use it.
922 2005-01-19 Bruno Haible <bruno@clisp.org>
924 * sh-quote.h: New file, from GNU gettext.
925 * sh-quote.c: New file, from GNU gettext.
927 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
929 Merge changes from coreutils, as described below in several
930 changelogs dated today.
932 * save-cwd.c: Include "save-cwd.h" before other include files.
933 (O_DIRECTORY): Remove; not needed here, since "." must be
934 a directory. All uses removed.
935 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
936 universal on Suns, and we also need to test for IRIX.
937 Revamp code to use 'if' rather than '#if'.
938 Avoid unnecessary comparison of cwd->desc to 0.
940 * utimens.c (futimens): Robustify the previous patch, by checking
941 for known valid error numbers rather than observed invalid ones.
943 2005-01-18 Jim Meyering <jim@meyering.net>
945 * version-etc.c (version_etc_copyright): Update copyright date.
947 * utimens.c (futimens): Account for the fact that futimes
948 can also fail with errno == ENOSYS or errno == ENOENT.
949 Patch from Dmitry V. Levin.
951 Change the name of the robust chdir function from chdir to chdir_long.
952 * save-cwd.c: Include chdir-long.h rather than chdir.h.
953 (restore_cwd): Use chdir_long, not chdir.
954 * chdir-long.c: Renamed from chdir.c.
955 * chdir-long.h: Renamed from chdir.h.
956 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
959 2005-01-18 Bob Proulx <bob@proulx.com>
961 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
962 offsetof() macro construct to avoid compile failure with native HP-UX
963 11.0 ANSI C compiler.
965 2005-01-06 Bruno Haible <bruno@clisp.org>
967 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
968 because stpncpy.m4 takes care of it.
970 2004-01-24 Bruno Haible <bruno@clisp.org>
972 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
974 2003-10-09 Bruno Haible <bruno@clisp.org>
976 * progreloc.c: Include xalloc.h instead of xmalloc.h.
978 2005-01-06 Bruno Haible <bruno@clisp.org>
980 * fwriteerror.h (fwriteerror): Change specification to include fclose.
981 * fwriteerror.c: Include <stdbool.h>.
982 (fwriteerror): At the end, close the file stream. Record whether
983 stdout was already closed.
985 2004-05-27 Bruno Haible <bruno@clisp.org>
987 * execute.c (environ): Declare if needed.
988 * pipe.c (environ): Likewise.
989 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
991 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
993 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
994 definitions to be after all include files, to avoid collisions.
995 Problem reported by Bob Proulx.
997 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
999 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
1000 not needed. This removes a dependency on the gettext module.
1001 [defined _LIBC]: Do not include <libintl.h>; not needed.
1003 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
1005 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
1008 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
1010 * argp-parse.c: Include <stddef.h>.
1011 (alignof, alignto): New macros.
1012 (parser_init): Don't assume that void * is aligned sufficiently
1015 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
1016 need to extend the stack.
1017 (YYINITDEPTH): New macro, so that the initial stack isn't overly
1020 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1022 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
1024 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1026 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
1027 Remove now-obsolete comment about AIX.
1028 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
1029 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
1030 (YYMAXDEPTH): New macro.
1032 2004-12-18 Bruno Haible <bruno@clisp.org>
1034 * fatal-signal.c (fatal_signals): Make non-const.
1035 (init_fatal_signals): New function.
1036 (uninstall_handlers, install_handlers): Ignore signals that were set to
1038 (at_fatal_signal): Call init_fatal_signals.
1039 (init_fatal_signal_set): Likewise. Ignore signals that were set to
1041 Reported by Paul Eggert.
1043 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
1045 * getdate.y (textint): New member "negative".
1046 (time_zone_hhmm): New function.
1047 Expect 14 shift-reduce conflicts, not 13.
1048 (o_colon_minutes): New rule.
1049 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
1050 (yylex): Set the "negative" member of signed numbers.
1052 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
1054 Changes imported from coreutils.
1055 * hard-locale.c: Assume <locale.h> exists.
1057 (GLIBC_VERSION): New macro.
1058 (hard_locale): Assume setlocale exists.
1059 Rewrite to avoid #ifdef.
1060 Use strdup rather than malloc + strcpy.
1061 * human.c: Assume <locale.h> exists.
1062 (human_readable): Assume localeconv exists.
1064 2004-12-01 Jakub Jelinek <jakub@redhat.com>
1066 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
1067 convert T2, not T. (Imported from libc.)
1069 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
1071 * getcwd.c (is_ENAMETOOLONG): New macro.
1072 (__getcwd.c): Don't restore errno; glibc doesn't.
1073 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
1074 first, falling back to our code only if its results look suspicious.
1075 Ensure that the resulting buffer is only as large as necessary.
1077 * readutmp.c: Include readutmp.h first.
1078 Include <errno.h>, since readutmp.h no longer does that.
1079 * readutmp.h: Don't include <errno.h>,
1080 <sys/param.h>, <time.h>; not needed to establish interface.
1081 (errno): Remove decl.
1082 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
1083 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
1084 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
1086 2004-11-28 Simon Josefsson <jas@extundo.com>
1088 * base64.h, base64.c: New file.
1090 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
1092 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
1094 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
1096 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
1097 HP's ANSI C compiler.
1098 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
1099 Declaring int functions causes warnings on some modern systems and
1100 shouldn't be needed to compile on ancient ones.
1101 * same.c (MIN) [defined MIN]: Don't define, since it's already
1104 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
1105 with the following changes.
1106 (__set_errno): Parenthesize properly.
1107 Include <stdbool.h>.
1108 (MIN, MAX, MATCHING_INO): New macros.
1109 (__getcwd): Define with prototype, not K&R form.
1110 Use heuristics to allocate default buffer on stack if possible.
1111 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
1112 behavior, and to avoid the PATH_MAX limit when computing
1114 Use MATCHING_INO to compare inode number to file.
1115 Check for arithmetic overflow in size calculations.
1116 Fix bug in reallocation of dot array that caused getcwd to fail
1117 on directories nested deeper than 75.
1118 Be more careful about saving errno on error.
1119 Do not use realloc; use only free+malloc, as this is a bit
1120 more flexible and avoids a needless copy operation.
1121 Do not inspect st_dev and st_ino for symbolic links; POSIX
1122 doesn't specify the latter.
1123 Check for closedir errors.
1124 Avoid needless casts.
1125 Use "#ifdef weak_alias" around weak_alias, to be like other
1127 The following changes to getcwd.c have effect only when used in
1128 gnulib; they have no effect inside glibc proper.
1129 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
1130 as alloca isn't used.
1131 (alloca, __alloca): Likewise.
1132 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
1133 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1134 unconditionally, as gnulib assumes C89 or better.
1135 Do not include <sys/param.h>.
1136 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
1137 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
1139 (NULL) [!defined NULL]: Remove; we assume C89 or better.
1140 Include <dirent.h> in a way that is compatible with modern Autoconf.
1141 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
1142 New macros, if not already defined.
1143 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
1144 Use "_LIBC", not "defined _LIBC", for consistency.
1145 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
1147 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
1148 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
1149 * xgetcwd.c: David MacKenzie's old code was removed, so give
1150 credit only to Jim Meyering and adjust the copyright dates.
1151 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
1152 <stdlib.h>, <unistd.h>, "pathmax.h".
1153 Instead, include "xgetcwd.h" (first) and "getcwd.h".
1154 (INITIAL_BUFFER_SIZE): Remove.
1155 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
1157 2004-11-23 Jim Meyering <jim@meyering.net>
1159 * getopt_.h: Remove trailing blanks.
1161 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1163 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
1164 (futimens): New function, which uses futimes if available.
1165 (futimens, utimens): Support timespec==NULL, with same semantics
1166 as utime and utimens.
1167 * utimens.h (futimens): New decl.
1169 2004-11-23 Jim Meyering <jim@meyering.net>
1171 * __fpending.c: Add comment.
1173 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1175 * getopt_.h: Re-addition of __getopt_argv_const caused
1176 redefinition warnings. To avoid them, include the defines
1177 in `#if !defined __need_getopt ... #endif'. The only place
1178 where __getopt_argv_const is used is in definitions
1179 of getopt_long and getopt_long_only below, which are as well
1180 protected by `#ifndef __need_getopt'.
1181 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
1182 __need_getopt after including <stdio.h> and <unistd.h> These
1183 headers might have defined it.
1185 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
1187 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
1189 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
1190 optopt): Use them instead of invoking ## directly; otherwise, the
1191 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
1193 2004-11-19 Bruno Haible <bruno@clisp.org>
1195 * strtok_r.c: Move comments from here...
1196 * strtok_r.h: ... to here.
1198 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
1200 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
1201 might fail. Problem reported by Yoann Vandoorselaere.
1202 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
1203 that mishandle size_t overflow.
1205 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1207 * canon-host.c: Include "strdup.h".
1208 (canon_host): Use getaddrinfo if available, so that IPv6 works.
1209 Use strdup instead of malloc/strcpy to duplicate strings.
1211 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
1212 (human_space_before_unit): New constant.
1213 * human.c (human_readable): Support it.
1215 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
1216 (xgetcwd): Set errno correctly when failing.
1217 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
1218 the failure is actually due to a PATH_MAX problem.
1220 Further getopt changes to make it more likely that glibc will
1221 buy the changes back.
1222 * getopt.c (POSIXLY_CORRECT): New constant.
1223 (getopt): Use it, so to preserve glibc semantic
1224 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
1225 when compiling for libc.
1226 * getopt_.h (__getopt_argv_const): Bring it back.
1227 (getopt_long, getopt_long_only): Use it.
1229 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
1230 New arg POSIXLY_CORRECT. All callers changed.
1231 (getopt): Argv is now char * const *, as per standard.
1232 (_getopt_internal_r, _getopt_internal): Argv is now char **,
1233 not char *__getopt_argv_const *.
1234 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1235 _getopt_long_only_r): Likewise.
1236 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
1237 * getopt_int.h (_getopt_internal, _getopt_internal_r,
1238 _getopt_long_r, _getopt_long_only_r): Likewise.
1239 * getopt_.h (__getopt_argv_const): Remove.
1240 (getopt): Argv is now char * const *, as per standard.
1242 * getdate.y (tORDINAL): New token.
1243 (day, relunit): Allow it for relative times.
1244 (relative_time_table): Use tORDINAL for ordinals.
1246 2004-11-15 Jim Meyering <jim@meyering.net>
1248 * closeout.c: Include "__fpending.h" once again.
1249 Include <stdbool.h>.
1250 (close_stdout): Don't fail just because stdout was closed initially,
1251 since some programs don't write to stdout in the normal course of
1252 operation (other than --version and --help), and we don't want this
1253 function to make e.g. `touch file >&-' fail.
1254 But do fail if it was closed and someone has tried to write to it.
1255 E.g., `printf foo >&-' must fail.
1257 2004-11-11 Simon Josefsson <jas@extundo.com>
1259 * strtok_r.h, strtok_r.c: New file.
1261 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
1263 * getopt_.h (__getopt_argv_const): New macro, to be used so that
1264 we can stop lying to compilers about the constness of argv when we
1265 are compiled outside glibc.
1266 (getopt, getopt_long, getopt_long_only): Use it.
1267 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
1269 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1270 _getopt_long_only_r): Likewise.
1271 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
1272 _getopt_long_only_r): Likewise.
1274 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
1275 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
1276 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
1277 the other external symbols.
1278 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
1279 declaration, since the above renaming now works around collisions.
1281 2004-11-11 Jim Meyering <jim@meyering.net>
1283 * linebreak.c: Remove trailing blanks.
1284 * alloca_.h: Likewise.
1285 * acosl.c: Likewise.
1286 * euidaccess.c: Likewise.
1287 * allocsa.h: Likewise.
1289 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
1291 * mktime.c (SHR): New macro, which is a portable
1292 substitute for >> that should work even on Crays.
1293 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
1294 Problem reported by Mark D. Baushke in
1295 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
1296 * getdate.y (SHR): Likewise.
1298 * strftime.c (SHR): Likewise.
1300 * quotearg.c (struct quoting_options): Use unsigned int for
1301 quote_these_too, so that right shifts are well defined. All uses
1304 2004-11-10 Simon Josefsson <jas@extundo.com>
1306 * getaddrinfo.h, getaddrinfo.c: New files.
1308 2004-11-10 Jim Meyering <jim@meyering.net>
1310 Ensure that no close failure goes unreported.
1311 * closeout.c (close_stdout): Always close stdout. I.e., don't
1312 return early when it seems there's nothing to flush.
1313 Don't include __fpending.h.
1315 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
1317 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
1319 2004-11-05 Bruno Haible <bruno@clisp.org>
1321 * readlink.c: Include stddef.h, needed for size_t on Woe32.
1322 Reported by Mark D. Baushke <mdb@cvshome.org>.
1324 2004-11-04 Bruno Haible <bruno@clisp.org>
1326 2004-09-11 Bruno Haible <bruno@clisp.org>
1327 * allocsa.valgrind: New file.
1328 2004-02-06 Bruno Haible <bruno@clisp.org>
1329 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
1330 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
1331 Reported by Christopher Seip <chris.seip@hp.com>.
1333 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1335 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
1336 with errno == ERANGE if the buffer is too small.
1337 Problem reported by Mark D. Baushke.
1339 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
1341 * xreadlink.c (MAXSIZE): New macro.
1342 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
1343 size does not exceed MAXSIZE. Avoid cast.
1344 As suggested by Mark D. Baushke in
1345 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
1346 if readlink fails with buffer size just under MAXSIZE, try again
1349 2004-11-02 Derek R. Price <derek@ximbiot.com>
1350 and Paul Eggert <eggert@cs.ucla.edu>
1352 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
1353 (get_date): Overparenthesize to avoid GCC warning.
1355 2004-11-02 Bruno Haible <bruno@clisp.org>
1357 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
1358 function returns void.
1360 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
1362 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1363 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
1366 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1368 * getdate.y: Add support for TZ="foo" within a date string.
1369 Fix some bugs near time_t boundaries. Reject dates with
1370 out-of-range components, e.g., "Sept 31".
1371 Include <stdlib.h>, "setenv.h", "xalloc.h".
1372 (ISDIGIT_LOCALE): Remove; unused.
1373 Note that the TZ and time functions used here are not reentrant.
1374 (mktime_ok, get_tz): New functions.
1375 (TZBUFSIZE): New constant.
1376 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
1377 This requires that we sometimes generate our own TZ="XXX..." setting.
1379 2004-10-27 Derek R. Price <derek@ximbiot.com>
1381 * mktime.c (not_equal_tm): Remove redundant check.
1383 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
1385 * getdate.y: Use Bison 1.875 features, and some minor
1386 code cleanups. This change does not affect semantics.
1387 Don't include <stdlib.h>; no longer needed.
1388 Don't include unlocked-io.h; only the "#if TEST" code uses
1389 stdio, and performance isn't crucial there.
1390 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
1391 Bison 1.875 features as described below.
1392 All uses of "PC." replaced by "pc->".
1393 (YYSTYPE): Add a forward declaration.
1394 (yylex, yyerror): Use full prototypes in forward decls.
1395 Use "%pure-parser" rather than obsolescent "%pure_parser".
1396 Use %parse-param and %lex-param instead of obsolescent
1397 YYPARSE_PARAM and YYLEX_PARAM.
1398 (meridian_table, month_and_day_table, time_units_table,
1399 relative_time_table, time_zone_table, military_table,
1400 lookup_zone, lookup_word, get_date):
1401 Use NULL instead of 0 where appropriate.
1402 (to_hour): Avoid abort (), to avoid a dependency on
1404 (yyerror, yylex): Now accepts parser_control * arg.
1405 (main) [TEST]: Use '\0' rather than 0 for char.
1407 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
1409 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
1410 It's now the caller's responsibility to handle the case where
1411 !HAVE_GETPAGESIZE && !defined getpagesize.
1413 * mktime.c (leapyear): Arg is long int, not int.
1415 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
1417 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
1419 2004-10-12 Simon Josefsson <jas@extundo.com>
1421 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1422 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
1425 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
1427 * vsnprintf.h: New file.
1428 * vsnprintf.c: New file.
1430 2004-10-07 Bruno Haible <bruno@clisp.org>
1432 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
1433 into the provided buffer.
1435 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
1437 * diacrit.c, diacrit.h: Add GPL notice.
1439 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
1440 * atanl.c (atanl): Keep the code as similar to glibc as possible.
1441 * logl.c (logl): Keep the code as similar to glibc as possible.
1442 This avoids a potential constant-folding bug.
1444 2004-10-05 Bruno Haible <bruno@clisp.org>
1446 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
1448 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1450 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
1451 * xmalloc.c (xmemdup): Likewise.
1452 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
1453 XFREE): Remove these long-obsolescent macros.
1454 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
1455 * xstrdup.c: Remove.
1457 * regex.c (re_comp): Cast gettext return value to char *,
1458 Problem reported by Martin Neitzel via Mark D. Baushke.
1460 2004-10-04 Simon Josefsson <jas@extundo.com>
1462 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
1463 '#ifdef USE_UNLOCKED_IO'.
1465 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1467 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
1468 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
1469 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
1470 regex.c, sha1.c, version-etc.c, yesno.c:
1471 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
1472 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
1473 the includer's responsibility.
1475 Sync from coreutils.
1477 * modechange.c (mode_compile): Don't decrement a pointer that
1478 points to the start of a string, as the C Standard says the
1479 resulting behavior is undefined.
1481 * backupfile.h (enum backuptype): Rename none -> no_backups,
1482 simple -> simple_backups, numbered_existing ->
1483 numbered_existing_backups, numbered -> numbered_backups
1484 to avoid shadowing problems. All uses changed.
1485 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
1486 * backupfile.c (check_extension, numbered_backup):
1487 Rename locals to avoid shadowing 'basename'.
1488 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
1491 * .cppi-disable: Add getopt_.h, getopt_int.h.
1492 * .cvsignore: Add getopt.h.
1494 2004-10-04 Simon Josefsson <jas@extundo.com>
1496 * memmem.h: New file.
1497 * memmem.c: New file, taken from glibc.
1499 2004-10-02 Jim Meyering <jim@meyering.net>
1501 * dirfd.h, getpagesize.h: Add copyright notice.
1503 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
1505 * snprintf.c: Remove comments as to why each header is needed.
1507 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
1509 * strsep.h: New file.
1510 * strsep.c: New file.
1512 2004-10-01 Simon Josefsson <jas@extundo.com>
1514 * snprintf.c (snprintf): Handle size==0.
1516 2004-10-01 Simon Josefsson <jas@extundo.com>
1517 Bruno Haible <bruno@clisp.org>
1519 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
1520 (snprintf): Declare 'args'.
1522 2004-09-30 Simon Josefsson <jas@extundo.com>
1524 * snprintf.h, snprintf.c: New files.
1526 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1528 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
1529 (hol_entry_help): Never translate an empty string.
1530 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
1531 * argp.h (OPTION_NO_TRANS): New option.
1533 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
1535 * xvasprintf.c: Include xalloc.h.
1536 (xvasprintf): Use xalloc_die, not xmalloc_die.
1538 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
1540 * dummy.c: Change copyright notice to FSF, and license to GPL.
1542 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
1544 * argp-pvh.c (argp_program_version_hook): Provide initial value.
1545 Problem reported by Bruno Haible in:
1546 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
1548 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
1550 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
1551 in case some system header has #define'd it. Problem reported by
1552 Soeren D. Schulze in
1553 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
1555 2004-09-08 Bruno Haible <bruno@clisp.org>
1557 * stdint_.h.in: New file, taken from GNU clisp.
1559 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
1561 * xvasprintf.h: New file.
1562 * xvasprintf.c: New file.
1563 * xasprintf.c: New file.
1565 2004-09-08 Bruno Haible <bruno@clisp.org>
1567 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
1569 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
1571 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
1573 Import from coreutils.
1574 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
1575 strings on unbounded length. alloca's performance benefits aren't
1576 that important here.
1578 (parse_with_separator): New function, with most of the internals
1579 of the old parse_user_spec. Allow user to omit both user and group,
1580 for compatibility with FreeBSD.
1581 Clone only the user name, not the entire spec.
1582 Do not set *uid, *gid unless entirely successful.
1583 Avoid memory leak in some failing cases.
1584 Fix regression for USER.GROUP reported by Dmitry V. Levin in
1585 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1586 (parse_user_spec): Rewrite to use parse_with_separator.
1588 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
1590 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
1591 its complicated substitute.
1592 * argp-help.c: Include <errno.h>, for program_invocation_short_name
1593 and program_invocation_name.
1594 (__argp_basename) [!_LIBC]: Remove; the only use was
1595 replaced by its body.
1596 (__argp_short_program_name): Change condition from
1597 !defined __argp_short_program_name to
1598 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
1599 to match argp-namefrob.h.
1600 (__argp_failure): Don't assume strerror_r returns char *.
1601 * argp-parse.c (N_): Define unconditionally.
1602 (argp_default_options): Fill out initializers with 0 to avoid
1605 2004-08-12 Simon Josefsson <jas@extundo.com>
1607 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
1608 * getopt_.h: Renamed from getopt.h.
1610 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1612 Merge from coreutils.
1614 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
1615 wmemchr or wmemcpy. Problem reported by Robert Dahlem
1616 for Reliant Unix 5.43.
1618 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
1619 (union fooround): Use uintmax_t, not long int.
1620 The rest is a merge from libc:
1621 [defined _LIBC]: Include <shlib-compat.h>.
1622 (_obstack) [defined _LIBC]: Remove after 2.3.4.
1624 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
1626 * strverscmp.c: Convert to UTF-8.
1628 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
1630 * obstack.h (obstack_empty_p):
1631 Don't assume that chunk->contents is suitably aligned.
1632 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
1633 Likewise. Problem reported by Benno in
1634 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
1636 * chown.c (rpl_chown): Work even if the file is writeable but not
1637 readable. This could be improved further but it'd take some work.
1639 2004-08-08 Simon Josefsson <jas@extundo.com>
1641 * xgethostname.c: Don't include error.h (not used).
1644 * getpass.c: Include getpass.h first.
1646 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
1648 * xalloc-die.c: New files.
1649 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
1651 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
1652 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
1653 (_, N_, xalloc_die): Move to xalloc-die.c.
1654 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
1655 so that we needn't mess with xalloc_msg_memory_exhausted.
1657 * sha1.h: Renamed from sha.h.
1658 (SHA1_H): Renamed from _SHA_H.
1659 (sha1_ctx): Renamed from sha_ctx.
1660 (sha1_init_ctx): Renamed from sha_init_ctx.
1661 (sha1_process_block): Renamed from sha_process_block.
1662 (sha1_process_bytes): Renamed from sha_process_bytes.
1663 (sha1_finish_ctx): Renamed from sha_finish_ctx.
1664 (sha1_read_ctx): Renamed from sha_read_ctx.
1665 (sha1_stream): Renamed from sha_stream.
1666 (sha1_buffer): Renamed from sha_buffer.
1667 * sha1.c: Likewise; renamed from sha.c.
1668 Do not include <sys/types.h>.
1669 Include <stddef.h> rather than <stdlib.h>.
1671 2004-08-08 Bruno Haible <bruno@clisp.org>
1673 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
1674 FILESYSTEM_PREFIX_LEN.
1675 * progreloc.c: Likewise.
1676 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
1678 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
1681 * argp-help.c (make_hol, hol_append): Don't assume that
1682 SIZE_MAX is a valid preprocessor constant.
1683 (__argp_basename): Change from "#ifndef _LIBC"
1684 to "#ifndef __argp_short_program_name", so that
1685 we don't compile these functions for tar.
1687 More merges from coreutils.
1688 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
1689 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
1691 * addext.c: Remove; no longer needed.
1692 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
1693 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
1694 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
1695 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
1696 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
1697 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
1698 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
1699 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
1700 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
1701 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
1702 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
1703 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
1704 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
1705 Import changes from coreutils.
1707 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
1709 Merge from coreutils.
1711 * .gdb-history: Remove; this doesn't belong here.
1713 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
1714 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
1715 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
1717 * dirname.h: Include <stdbool.h>.
1718 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
1719 for consistency with POSIX terminology. All uses changed.
1720 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
1721 (strip_trailing_slashes): Use bool for booleans.
1722 * stripslash.c (strip_trailing_slashes): Likewise.
1724 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1725 sometimes returns a positive errno value even when it succeeds.
1726 (print_errno_message) [!LIBC]: Fall back on strerror if
1729 * path-concat.c (mempcpy): Don't define if a system header defines it.
1730 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
1731 (longest_relative_suffix): New function.
1732 (path_concat): Use it. Assume first argument is not NULL.
1733 Port to DOS. Omit redundant separators.
1734 Report an error instead of returning NULL.
1735 Use mempcpy instead of memcpy.
1736 (xpath_concat): Remove: not declared or used.
1738 * same.h: Include <stdbool.h>
1739 (same_name): Return bool, not int.
1740 * same.c (same_name): Likewise.
1741 (errno): Don't declare; we assume C89 or better now.
1743 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
1744 if not already defined.
1746 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
1747 * dup-safer.c (errno): Likewise.
1749 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
1751 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
1754 2004-08-03 Simon Josefsson <jas@extundo.com>
1756 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
1757 * progname.h: Don't include stdbool.h.
1759 2004-08-02 Simon Josefsson <jas@extundo.com>
1761 * getsubopt.h: New file, with comments from Bruno Haible.
1762 * getsubopt.c: New file, from glibc, but slightly modified based on
1763 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
1765 2004-08-01 Simon Josefsson <jas@extundo.com>
1767 * xgetdomainname.c: Include stdlib.h, for free().
1769 2004-07-16 Simon Josefsson <jas@extundo.com>
1771 * dummy.c: New file.
1773 2004-07-16 Bruno Haible <bruno@clisp.org>
1775 * backupfile.h: Add extern "C" for C++.
1776 * closeout.h: Likewise.
1777 * copy-file.h: Likewise.
1778 * findprog.h: Likewise.
1779 * full-write.h: Likewise.
1780 * pathname.h: Likewise.
1781 * progname.h: Likewise.
1782 * stpcpy.h: Likewise.
1783 * stpncpy.h: Likewise.
1784 * strcase.h: Likewise.
1785 * strstr.h: Likewise.
1786 * xalloc.h: Likewise.
1788 * mbswidth.h: Add extern "C" for C++.
1789 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
1791 2004-07-09 Simon Josefsson <jas@extundo.com>
1793 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
1794 failed without this.)
1796 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
1798 * fchown-stub.c: New file.
1800 2004-06-24 Jim Meyering <jim@meyering.net>
1802 * obstack.h (obstack_base): Cast to (void *), per documentation.
1804 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
1806 * argz.c, argz_.h: New files, which are autoupdated from libtool.
1808 2004-06-01 Jim Meyering <jim@meyering.net>
1810 * calloc.c: New file.
1812 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
1814 * getdate.y (yylex): Allow space between sign and number.
1815 Problem reported by Dan Jacobson.
1817 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
1818 and Jim Meyering <jim@meyering.net>
1820 Merge from coreutils CVS.
1822 * stat-macros.h: New file, with contents from file-type.h
1823 and coreutils' system.h.
1824 * file-type.c: Include "stat-macros.h".
1825 * file-type.h (file_type): Move all macro definitions to new file,
1828 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
1829 Wrap old code with this conditional.
1830 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
1831 function that does not dereference symlinks.
1832 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
1834 * xreadlink.c: Include xreadlink.h first, to catch .h file
1835 dependency problems.
1836 (xreadlink): Accept new arg SIZE, for efficiency.
1837 All decls and uses changed.
1838 * xreadlink.h: Include <stddef.h>, for size_t.
1840 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
1841 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
1843 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
1845 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
1847 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
1848 macros to be defined.
1849 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
1850 the allocator returns NULL because the requested size is zero.
1852 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
1854 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
1855 var. Add comment explaining why libc still defines it. This
1856 merges the following patch from glibc:
1857 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
1859 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
1861 * obstack.c (_obstack): Remove unused variable. It hasn't been
1862 present in glibc since revision 1.1 of this file.
1863 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
1864 obstack_alignment_mask, obstack_alloc, obstack_base,
1865 obstack_blank, obstack_blank_fast, obstack_chunk_size,
1866 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
1867 obstack_grow0, obstack_init, obstack_int_grow,
1868 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
1869 obstack_next_free, obstack_object_size, obstack_ptr_grow,
1870 obstack_ptr_grow_fast, obstack_room): Remove declarations of
1871 nonexistent functions.
1873 2004-05-17 Derek R. Price <derek@ximbiot.com>
1874 Paul Eggert <eggert@cs.ucla.edu>
1876 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
1878 2004-05-14 Bruno Haible <bruno@clisp.org>
1880 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
1881 that consists of a '.' followed by an empty digit string.
1882 Patch by Tor Lillqvist <tml@iki.fi>.
1884 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
1886 Port obstack to the AS/400, where pointers are 16 bytes wide and
1887 you cannot cast an integer to a valid pointer. This patch is
1888 currently waiting to be integrated into glibc; see
1889 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
1891 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
1892 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
1893 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
1894 (struct obstack): temp member is now a union of a pointer and
1895 an integer, instead of an integer. All integer uses changed.
1896 This does not affect the physical layout of struct obstack,
1897 except on hosts (like the AS/400) where the size or alignment of
1898 void * is greater than that of ptrdiff_t.
1899 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
1900 __STDC__)]: Store temporary in pointer member of union, not
1902 * obstack.c: Include <stddef.h>, for offsetof.
1903 (struct fooalign): Remove; it doesn't need a name.
1904 (union fooround): Change double to long double, and add void *.
1905 (DEFAULT_ALIGNMENT): Use offsetof to compute.
1906 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
1907 not a macro. Hence the values are always int; so remove all
1908 casts-to-int in uses.
1910 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
1911 Derek Price <derek@ximbiot.com>
1913 * alloca.c: Include <alloca.h>, to get our interface.
1914 * alloca_.h: Use __alloca on AIX, so that we don't have to
1915 include <alloca.h> first. Use C89 prototype for alloca; this
1916 requires including <stddef.h> for size_t. Use extern "C" if C++.
1917 Use #elif for simplicity, since we can assume C89 now.
1918 Don't try to source the system alloca.h since it will not be found
1919 and to prevent recursively including its replacement.
1920 * fnmatch.c: Include <alloca.h> instead of opencoding.
1921 * regex.c: Likewise.
1923 2004-05-16 Derek Price <derek@ximbiot.com>
1924 Paul Eggert <eggert@cs.ucla.edu>
1926 getline cleanup. This changes the getndelim2 API: both order of
1927 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
1930 * getline.c: Don't include stddef.h or stdio.h, since our
1931 interface does that.
1932 (getline): Always use getdelim, so that we don't have two
1933 copies of this code.
1934 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
1936 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
1937 (GETNDELIM2_MAXIMUM): New macro.
1938 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
1939 instead of the old practice of delim2==0. All callers changed.
1940 Return -1 on overflow, instead of returning junk.
1941 Do not set *linesize unless allocation succeeds.
1942 * getndelim2.h: Do not include stddef.h; no longer needed, now
1943 that we include sys/types.h.
1944 * getnline.h: Likewise.
1945 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
1946 (getndelim2): Reorder arguments.
1947 * getnline.c (getnline, getndelim):
1948 Don't discard the NMAX argument.
1949 (getnline): Invoke getndelim, to avoid code duplication.
1950 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
1951 of (size_t) -1 by callers of the getnline family.
1953 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
1955 * nanosleep.c (suspended): Change its type from int to
1956 sig_atomic_t volatile.
1957 (first_call): Make it private to rpl_nanosleep, and have it
1958 be zero initially as that's a bit faster.
1959 (my_usleep): Round up fractional times instead of truncating them,
1960 as this is the usual meaning for 'sleep'.
1962 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
1964 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
1965 (ENOSYS): Define if not defined.
1966 (settime): Fall back on stime if it exists and settimeofday fails.
1967 But don't bother with fallbacks if a method fails with errno == EPERM.
1969 2004-05-11 Jim Meyering <jim@meyering.net>
1971 Prior to this change, the save_cwd caller required read access to the
1972 current directory on most systems (ones with the fchdir function).
1974 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
1975 fails, try write-only, and finally, resort to using xgetcwd.
1977 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
1979 * obstack.c, obstack.h: Import changes from libc.
1981 2004-04-28 Bruno Haible <bruno@clisp.org>
1983 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
1984 implicitly appends .exe to executables.
1985 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
1986 accepts Windows pathnames.
1987 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1988 Cygwin like Windows, since it now accepts Windows pathnames.
1989 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1990 Cygwin like Windows, since it now accepts Windows pathnames.
1991 Reported by Derek Robert Price <derek@ximbiot.com>.
1993 2004-04-20 Jim Meyering <jim@meyering.net>
1995 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
1997 2004-04-20 Jim Meyering <jim@meyering.net>
1998 Bruno Haible <bruno@clisp.org>
2000 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
2001 memory when realloc fails.
2003 2004-04-18 Jim Meyering <jim@meyering.net>
2005 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
2006 don't leak memory and do call END_UTMP_ENT.
2008 2004-04-11 Paul Eggert <eggert@twinsun.com>
2010 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
2011 (CHAR_BIT): Remove, since we assume C89.
2012 Include <stdint.h> if available, as per current Autoconf CVS advice.
2014 2004-03-30 Paul Eggert <eggert@twinsun.com>
2016 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
2017 not bool, to be more consistent with Unix conventions.
2018 Suggested by Bruno Haible.
2020 Merge from coreutils.
2022 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
2025 * getdate.h: Include stdbool.h, and timespec.h instead of
2026 the usual <time.h> dance.
2027 (get_date): Change signature to support fractional time stamps.
2028 All callers changed.
2029 * getdate.y: Include "getdate.h" first, as we can now
2030 assume C89 and don't need to worry about 'const'.
2031 Similarly, include "unlocked-io.h" near start, not in middle.
2033 (textint.value): Use long int rather than int.
2034 (textint.digits): Use size_t rather than int.
2035 (BILLION, LOG10_BILLION): New constants.
2036 (parser_control): New member rel_ns. Members day_ordinal,
2037 time_zone, month, day, hour, minutes, rel_year, rel_month,
2038 rel_day, rel_hour, rel_minutes, rel_seconds
2039 are now long int, not int. Member seconds is now struct timespec,
2040 not int. New member timespec_seen. Members dates_seen, days_seen,
2041 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
2043 (%union.intval): Now long int, not int.
2044 New member timespec.
2045 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
2046 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
2047 (spec): Now is a timespec or an item list.
2048 (timespec, items): New nonterminals.
2049 (time, rel, relunit, number, get_date):
2050 Add support for fractional seconds.
2051 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
2052 (gmtime, localtime, mktime): Remove decls; not needed with C89.
2053 (to_hour): First arg is now long int, not int.
2054 (to_year): Returns long int, not int.
2055 Don't treat year -70 like 70.
2056 (tm_diff): Returns long int, not int.
2057 (lookup_word): Use bool instead of int when appropriate.
2058 (yylex): Use size_t for count, not int.
2059 Detect overflow when parsing large integer constants.
2060 Add support for fractions.
2061 (get_date): Make pointers 'const' if possible.
2062 Use more-portable code to detect integer overflow.
2063 (main) [TEST]: Adjust to above changes. Test for localtime failure.
2064 Don't use ctime; it's not reliable if the year has >4 digits.
2066 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
2067 This is for compatibility with BSD.
2069 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
2070 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
2071 From coreutils' system.h.
2073 * userspec.c: Don't include "posixver.h".
2074 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
2075 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
2076 compatible extension. Simplify code by removing a boolean int
2077 that was always nonzero if a string was nonnull.
2079 2004-03-30 Jim Meyering <jim@meyering.net>
2081 Merge from coreutils.
2083 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
2085 * readtokens.c (readtoken): Don't leak 64 bytes when reading
2086 an empty input stream.
2088 * readtokens.c: Include <stdbool.h>.
2089 (readtoken): Use `size_t' rather than int/long.
2090 All callers adjusted.
2091 Use `bool' rather than `int' where appropriate.
2092 Use memset rather than an explicit loop.
2093 Use x2nrealloc rather than xrealloc.
2094 Allow the use of `\0' as a delimiter.
2095 (readtokens): Likewise.
2096 * readtokens.h (readtoken, readtokens): Update prototypes.
2098 2004-03-30 Bruno Haible <bruno@clisp.org>
2100 * getloadavg.c (getloadavg): Don't assume setlocale returns
2103 2004-03-29 Paul Eggert <eggert@twinsun.com>
2105 Merge changes to getloadavg.c from coreutils and Emacs.
2107 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
2108 Define to an expression, not to the empty string.
2109 Include cloexec.h and xalloc.h.
2110 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
2111 Use set_cloexec_flag rather than rolling our own.
2112 * cloexec.c, cloexec.h: New files.
2114 2004-03-18 Paul Eggert <eggert@twinsun.com>
2116 * getopt.h: Sync with libc CVS.
2118 2004-03-18 Paul Eggert <eggert@twinsun.com>
2119 Bruno Haible <bruno@clisp.org>
2121 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
2122 not on all platforms that have <wchar.h>.
2123 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
2125 2004-03-09 Paul Eggert <eggert@twinsun.com>
2127 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
2129 * getopt_int.h: New file, also synced from libc.
2131 2004-03-07 Paul Eggert <eggert@twinsun.com>
2133 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
2134 '#if' expressions. Unlike the code it replaces, it does not
2135 depend on (defined _SC_PAGESIZE). However, it does depend on
2136 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
2137 first reported by Jason Andrade in
2138 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
2140 2004-01-18 Simon Josefsson <jas@extundo.com>
2142 * strdup.h: New file.
2143 * strdup.c: Include it.
2144 * path-concat.c: Include strdup.h. Drop strdup declaration.
2145 * userspec.c: Include strdup.h. Drop strdup declaration.
2147 2004-02-06 Karl Berry <karl@gnu.org>
2149 * config.charset: update from gettext 0.14.1.
2151 2004-02-05 Paul Eggert <eggert@twinsun.com>
2153 Add comments and code, prompted by suggestions from Bruno Haible
2155 * quotearg.h (quotearg_alloc): New decl. Improve the comments
2156 describing the enum quoting_style values.
2157 * quotearg.c (quotearg_alloc): New function.
2158 (quotearg_buffer_restyled): Treat lone { and } as special.
2159 Treat = as special. Work around bug with older shells
2160 that "see" a '\' that is really the 2nd byte of a multibyte char.
2161 Quote empty string with shell_quoting_style.
2163 2004-02-03 Bruno Haible <bruno@clisp.org>
2165 * pipe.h: New file, from GNU gettext.
2166 * pipe.c: New file, from GNU gettext.
2168 2004-01-27 Bruno Haible <bruno@clisp.org>
2170 * execute.h: New file, from GNU gettext.
2171 * execute.c: New file, from GNU gettext.
2172 * w32spawn.h: New file, from GNU gettext.
2174 2004-01-23 Paul Eggert <eggert@twinsun.com>
2176 Exit-status fix from coreutils.
2178 Use exit_failure consistently in place of EXIT_FAILURE,
2179 so that program exit statuses are consistent on failure.
2181 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
2182 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
2183 * argmatch.h: Comment fix to match the above.
2184 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
2185 Now a macro referring to exit_failure, instead of a separate
2186 variable. Include "exitfail.h" to get it.
2187 * xstrtol.h: Include "exitfail.h".
2188 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
2190 * long-options.c (parse_long_options): Use prototype
2191 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
2194 2004-01-21 Jim Meyering <jim@meyering.net>
2196 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
2197 so as not to conflict with a different-sized __mktime_internal
2198 function in GNU libc.
2199 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
2200 Problem building statically-linked `ls' reported by Michael Brunnbauer.
2202 2004-01-18 Paul Eggert <eggert@twinsun.com>
2204 Merge from diffutils.
2206 * file-type.c (file_type): Add typed memory objects.
2207 * file-type.h (S_TYPEISTMO): New macro.
2209 * c-stack.h (c_stack_action): Remove argv argument.
2210 * c-stack.c (c_stack_action): Likewise. All uses changed.
2211 (die): Don't calculate message unless segv_action returns.
2212 (get_stack_location, min_address_from_argv, max_address_from_argv,
2213 volatile stack_base, volatile_stack_size): Remove.
2214 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
2215 that every segmentation violation is a stack overflow. (Ouch!)
2216 See Debian bug 136249 (still outstanding) for more info about why
2217 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
2219 2003-11-30 Bruno Haible <bruno@clisp.org>
2221 Safer stack allocation.
2222 * setenv.c: Include allocsa.h.
2223 (alloca): Remove fallback definition.
2224 (freea): Remove macro.
2225 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
2228 2003-10-17 Bruno Haible <bruno@clisp.org>
2230 * binary-io.h: Avoid warnings on Cygwin.
2232 2003-12-28 Bruno Haible <bruno@clisp.org>
2234 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
2235 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
2237 2003-11-28 Bruno Haible <bruno@clisp.org>
2239 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
2241 2003-11-27 Bruno Haible <bruno@clisp.org>
2243 * wait-process.c: On Windows, include windows.h. Needed on mingw.
2245 2003-11-17 Bruno Haible <bruno@clisp.org>
2247 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
2249 2003-11-24 Bruno Haible <bruno@clisp.org>
2251 * xallocsa.h: New file, from GNU gettext.
2252 * xallocsa.c: New file, from GNU gettext.
2254 2003-11-24 Bruno Haible <bruno@clisp.org>
2256 * allocsa.h: New file, from GNU gettext.
2257 * allocsa.c: New file, from GNU gettext.
2259 2003-11-24 Bruno Haible <bruno@clisp.org>
2261 * eealloc.h: New file.
2263 2004-01-15 Jim Meyering <jim@meyering.net>
2265 Merge from coreutils.
2267 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
2268 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
2269 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
2271 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
2272 optional configure-time default.
2274 * version-etc.c (version_etc_copyright): Update copyright date.
2276 * xreadlink.c (xreadlink): Correct outdated comment.
2278 2004-01-15 Paul Eggert <eggert@twinsun.com>
2280 Merge from coreutils.
2282 * posixver.c: Include posixver.h.
2284 * same.c: Include <stdbool.h>, <limits.h>.
2285 (_POSIX_NAME_MAX): Define if not defined.
2287 (same_name): If file names are silently truncated, report
2288 that the file names are the same if they are the same after
2289 the silent truncation.
2291 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
2292 conversion function.
2293 * xstrtod.c (xstrtod): Likewise. All callers changed to
2294 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
2297 2004-01-14 Paul Eggert <eggert@twinsun.com>
2299 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
2300 with like-named macro in fnmatch.c.
2301 (EXT): Use an internal constant instead.
2303 Merge fnmatch patches from glibc.
2304 * fnmatch.c (mbsinit): Remove define.
2305 Add libc_hidden_ver (__fnmatch, fnmatch).
2306 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
2307 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
2309 2003-12-14 Karl Berry <karl@gnu.org>
2311 * config.charset: update from gettext-runtime.
2313 2003-12-03 Paul Eggert <eggert@twinsun.com>
2315 * getgroups.c (getgroups): xmalloc takes one argument, not two.
2316 Bug reported by Alfred M. Szmidt.
2318 2003-11-29 Karl Berry <karl@gnu.org>
2320 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
2322 2003-11-23 Paul Eggert <eggert@twinsun.com>
2323 Bruno Haible <bruno@clisp.org>
2325 * printf-parse.h: Don't include sys/types.h.
2326 (ARG_NONE): New macro.
2327 (char_directive): Change type of *arg_index fields to size_t.
2328 * printf-parse.c: Don't include sys/types.h.
2329 (SSIZE_MAX): Remove macro.
2330 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
2331 Remove unnecessary overflow check.
2332 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
2335 2003-11-24 Paul Eggert <eggert@twinsun.com>
2337 * alloca.c: Remove dependency on xalloc module.
2338 (xalloc_die): Remove.
2339 (memory_full) [!defined emacs]: New macro.
2340 [!defined emacs]: Don't include xalloc.h.
2341 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
2342 address arithmetic overflows. Change datatypes a bit to avoid
2345 2003-11-22 Jim Meyering <jim@meyering.net>
2347 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
2349 2003-11-17 Bruno Haible <bruno@clisp.org>
2351 * vasnprintf.c (alloca): Remove fallback definition.
2352 (freea): Remove definition.
2353 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
2354 Reported by Paul Eggert.
2356 2003-11-17 Jim Meyering <jim@meyering.net>
2358 On systems without utime and without a utimes function capable of
2359 dealing with a NULL struct utimbuf* argument, this utime replacement
2360 could -- in unusual circumstances -- leak a file descriptor.
2361 * utime.c: Include <unistd.h> and <errno.h>.
2362 (utime_null): Be sure to close `fd' and to preserve errno.
2363 Reported by Geoff Collyer via Arnold Robbins.
2365 2003-11-16 Paul Eggert <eggert@twinsun.com>
2366 Bruno Haible <bruno@clisp.org>
2368 Protect against address arithmetic overflow.
2369 * printf-args.h: Include stddef.h.
2370 (arguments): Change type of field 'count' to size_t.
2371 * printf-args.c (printf_fetchargs): Use size_t instead of
2372 'unsigned int' where appropriate.
2373 * printf-parse.h: Include sys/types.h.
2374 (char_directive): Change type of *arg_index fields to ssize_t.
2375 (char_directives): Change type of fields 'count', max_*_length to
2377 * printf-parse.c: Include sys/types.h and xsize.h.
2378 (SSIZE_MAX): Define fallback value.
2379 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
2380 instead of 'int' where appropriate. Check a_allocated, d_allocated
2381 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
2382 * vasnprintf.c: Include xsize.h.
2383 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
2384 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
2385 overflow. Avoid wraparound when converting a width or precision from
2388 2003-11-16 Bruno Haible <bruno@clisp.org>
2390 Update from GNU gettext.
2391 * printf-parse.c: Generalize to it can be compiled for wide strings.
2392 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
2393 * vasnprintf.c: Generalize to it can be compiled for wide strings.
2394 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
2395 SNPRINTF): New macros.
2396 Don't include <alloca.h> if the file is used inside libintl.
2397 (local_wcslen): New function, for Solaris 2.5.1.
2398 (VASNPRINTF): Use it instead of wcslen.
2400 2003-11-16 Bruno Haible <bruno@clisp.org>
2402 * xsize.h (xmax): New function.
2403 (xsum, xsum3, xsum4): Declare as "pure" functions.
2405 2003-11-12 Paul Eggert <eggert@twinsun.com>
2407 * xalloc.h: Do not include <limits.h> or <stdint.h>.
2408 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
2409 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
2410 heuristic is just as accurate as far as we know, and it removes a
2411 dependency on size_max.m4 and ptrdiff_max.m4.
2413 2003-11-12 Paul Eggert <eggert@twinsun.com>
2415 * xstrtol.c (__xstrtol): Remove "break" immediately after
2416 "return", to pacify some unknown compiler. Problem reported
2419 2003-11-11 Bruno Haible <bruno@clisp.org>
2421 * xsize.h (SIZE_MAX): Remove fallback definition.
2422 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
2425 2003-11-10 Paul Eggert <eggert@twinsun.com>
2427 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
2428 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
2429 rejected some allocations of exactly SIZE_MAX - 2 bytes.
2431 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
2432 not (size_t) -1, since it's defined here.
2434 2003-11-06 Paul Eggert <eggert@twinsun.com>
2436 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
2437 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
2438 Reject sizes of exactly SIZE_MAX bytes.
2439 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
2440 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
2442 2003-11-05 Bruno Haible <bruno@clisp.org>
2444 * xsize.h: Include limits.h, to avoid a possible collision with
2445 SIZE_MAX defined in <limits.h> on Solaris.
2447 2003-11-04 Bruno Haible <bruno@clisp.org>
2449 * xsize.h: New file.
2450 * linebreak.c: Include xsize.h.
2451 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
2452 argument for overflow.
2453 Suggested by Paul Eggert.
2455 2003-10-31 Bruno Haible <bruno@clisp.org>
2457 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
2458 to avoid (extremely rare) race condition.
2459 Suggested by Paul Eggert.
2461 2003-11-03 Jim Meyering <jim@meyering.net>
2463 * userspec.c: Include "userspec.h".
2464 * userspec.h: New file.
2466 2003-10-31 Paul Eggert <eggert@twinsun.com>
2468 * mountlist.h (struct mount_entry.me_type_malloced): New member.
2469 * mountlist.c (SIZE_MAX): Define if not defined already.
2470 (read_filesystem_list): Set and use me_type_malloced.
2471 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
2472 whatever the type happens to be), for brevity and consistency.
2473 Check for size calculation overflow on Alphas running OSF/1.
2475 2003-10-31 Jim Meyering <jim@meyering.net>
2477 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
2479 * linebuffer.c: Include <string.h> for declaration of memset.
2481 2003-10-30 Paul Eggert <eggert@twinsun.com>
2482 Bruno Haible <bruno@clisp.org>
2484 * vasprintf.c: Include <limits.h>, <stdlib.h>.
2485 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
2487 2003-10-29 Paul Eggert <eggert@twinsun.com>
2489 * xalloc.h (xalloc_oversized): Now a macro, not a function,
2490 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
2492 * quotearg.c (quotearg_n_options): Use it.
2493 * group-member.c: Include <stdbool.h>.
2494 (free_group_info): Arg is now const *; don't free arg.
2495 (get_group_info): Now returns bool and accepts struct group_info *,
2496 rather than returning a malloc'ed struct group_info *.
2497 All uses changed. Check for overflow in internal size calculation.
2499 * getusershell.c (readname): Simplify the code by using x2nrealloc
2500 rather than xmalloc/xrealloc.
2501 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
2502 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
2503 conformance bug: the old code used a pointer after freeing the
2504 storage that it addressed.
2505 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
2506 rather than doing it by hand.
2507 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
2508 the buffer preserved. Use free and xmalloc instead.
2509 * quotearg.c (quotearg_n_options): Likewise.
2510 Use a simpler test for size overflow. Don't use xalloc_oversized
2511 because unsigned int might be wider than size_t (!); this suggests
2512 that we should switch from unsigned int to size_t for slot numbers.
2514 2003-10-27 Bruno Haible <bruno@clisp.org>
2516 * stdbool_.h: Better support for BeOS.
2518 2003-10-27 Paul Eggert <eggert@twinsun.com>
2520 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
2521 to allocate the returned structure. Do not allocate a subarray,
2522 as x2nrealloc will do that.
2523 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
2524 instead of xnrealloc.
2525 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
2527 2003-10-26 Paul Eggert <eggert@twinsun.com>
2529 * xalloc.h (xalloc_oversized): New static inline function, for
2530 callers that want to do their own size-overflow checking. Include
2531 <stdbool.h>, since xalloc_oversized returns bool.
2532 * xalloc.c (array_size_overflow): Remove. All callers changed
2533 to use xalloc_oversized.
2535 Add two functions x2realloc, x2nrealloc, for programs that grow
2536 arrays dynamically by doubling their sizes.
2537 * xalloc.h (x2realloc, x2nrealloc): New decls.
2538 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
2541 Port to C99 semantics for 'inline' of external functions.
2542 Bug reported by Bruno Haible.
2543 * xmalloc.c (xnmalloc_inline): New static inline function,
2544 with the old contents of xnmalloc.
2545 (xnmalloc, xmalloc): Use it.
2546 (xnrealloc_inline): New static inline function,
2547 with the old contents of xnrealloc.
2548 (xnrealloc, xrealloc): Use it.
2550 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
2552 2003-10-25 Paul Eggert <eggert@twinsun.com>
2554 Fix several address-calculation bugs in the hash modules,
2555 plus some minor code cleanup.
2557 * hash.h: Include <stdbool.h>, for bool.
2558 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
2559 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
2560 hash_get_n_entries, hash_get_max_bucket_length,
2561 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
2562 hash_rehash): Use size_t rather than unsigned.
2563 * hash.c (struct hash_table, hash_get_n_buckets,
2564 hash_get_n_buckets_used, hash_get_n_entries,
2565 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
2566 hash_get_entries, hash_do_for_each, hash_string, is_prime,
2567 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
2569 (SIZE_MAX): Define if not defined.
2570 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
2571 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
2573 Use const * when possible.
2574 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
2575 (check_tuning): Fix bug: if tuning parameters were very close to
2576 0 or 1, rounding errors could have caused subscript violations.
2577 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
2578 (hash_initialize): Add 'fail:' label
2579 to free table and return NULL, and use it to simplify code.
2580 Use calloc rather than clearing the storage ourself.
2581 (hash_initialize, hash_rehash): Check for arithmetic overflow in
2582 buffer size calculations.
2583 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
2584 Include <stddef.h>, for size_t.
2585 * hash-pjw.c (hash_pjw): Likewise.
2586 Switch to method described by Bruno Haible.
2587 Include <limits.h>, for CHAR_BIT.
2588 (SIZE_BITS): New macro.
2590 2003-10-21 Paul Eggert <eggert@twinsun.com>
2592 * getndelim2.c (getndelim2): When size calculation overflows,
2593 ceiling the allocation at NMAX bytes rather than silently
2594 discarding input bytes before NMAX is reached. This makes
2595 a difference only if NMAX exceeds SIZE_MAX / 2.
2597 * obstack.c: Merge from glibc.
2598 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
2599 Add libc_hidden_def (_obstack_newchunk).
2600 (_obstack_free) [! defined _LIBC]: Remove.
2601 [defined _LIBC]: Make a strong alias from obstack_free, rather than
2602 a clone of the function body.
2603 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
2604 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
2606 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
2607 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
2610 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
2611 (obstack_ptr_grow_fast, obstack_int_grow_fast):
2612 Don't use lvalue casts, as GCC plans to remove support for them
2613 in GCC 3.5. Reported by Joseph S. Myers. This bug
2614 was also present in the non-GCC version, indicating that this
2615 code had always been buggy and had never been widely used.
2616 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
2617 Use the fast variant of each macro, rather than copying the
2618 definiens of the fast variant; that way, we'll be more likely to
2619 catch future bugs in the fast variants.
2621 2003-10-20 Bruno Haible <bruno@clisp.org>
2623 * wait-process.h: New file, from GNU gettext.
2624 * wait-process.c: New file, from GNU gettext.
2626 2003-10-19 Jim Meyering <jim@meyering.net>
2628 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
2630 2003-10-16 Paul Eggert <eggert@twinsun.com>
2632 * getgroups.c: Include <errno.h>, <stdlib.h>.
2633 (getgroups): First arg is int, not size_t.
2634 Don't let 'free' mangle errno.
2636 2003-10-16 Jim Meyering <jim@meyering.net>
2638 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
2640 2003-10-15 Paul Eggert <eggert@twinsun.com>
2642 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
2644 (new_exclude, add_exclude_file): Initial size no longer needs to
2646 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
2647 our own address arithmetic overflow checking.
2649 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
2650 (fnmatch): Do not alloca more than 2000 wide characters;
2651 instead, use malloc for large buffers.
2652 Check for address arithmetic overflow, and return -1
2653 with errno set to ENOMEM in that case.
2654 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
2655 (NEW_PATTERN): Do not alloca more than 8000 bytes;
2656 instead, return -1. Check for address arithmetic overflow.
2658 2003-10-14 Paul Eggert <eggert@twinsun.com>
2660 Handle invalid suffixes and overflow independently, so that
2661 callers can treat them independently as needed. Fix some bugs in
2662 suffix handling, e.g., "100k@" was not diagnosed as an invalid
2663 suffix for a human-readable blocksize. The major caller-visible
2664 change is the addition of a new
2665 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
2666 that both overflow and suffix chars were found.
2668 * human.c (humblock): Don't check separately for invalid suffix
2669 char; that is xstrtoumax's job (now that its bug is fixed).
2670 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
2671 INTMAX_MAX]: New macros.
2672 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
2673 TYPE_MAXIMUM): New macros.
2674 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
2675 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
2676 if overflow occurs, as it's what __strtol does and it's more useful
2678 (__xstrtol): If __strtol reports some error other than ERANGE,
2679 reflect it to the caller as LONGINT_INVALID. If it reports
2680 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
2681 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
2682 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
2684 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
2685 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
2686 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
2687 [defined UINTMAX_MAX]: New macros.
2689 2003-10-14 Bruno Haible <bruno@clisp.org>
2691 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
2692 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
2693 Also use volatile where needed.
2695 2003-10-12 Paul Eggert <eggert@twinsun.com>
2697 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
2698 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
2699 and define in terms of the other primitives.
2700 * xmalloc.c: Include stdbool.h; do not include exit.h.
2701 (SIZE_MAX): Define if not already defined.
2702 (array_size_overflow): New function.
2703 (xalloc_die): Abort instead of exiting if 'error' returns.
2704 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
2705 (xmalloc, xrealloc): Use them.
2706 (xcalloc): Check for address arithmetic overflow.
2707 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
2708 a bit faster than strcpy.
2710 2003-10-08 Paul Eggert <eggert@twinsun.com>
2712 Merge getpass from libc, plus a few fixes.
2714 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
2715 Include <stdbool.h>.
2716 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
2717 __fsetlocking to empty.
2718 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
2719 do include <bits/libc-lock.h>.
2720 Do not include <fcntl.h>; not needed.
2721 [_LIBC]: Include <wchar.h>.
2722 (NOTCANCEL_MODE): New macro.
2723 (flockfile, funlockfile) [_LIBC]: New macros.
2724 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
2725 [!_LIBC]: New macros.
2726 (call_fclose): New function.
2727 (getpass): Use it. Save tty stream separately; this simplifies the
2728 code and makes it more reliable if stdin happens to equal stdout.
2729 Invoke __fsetlocking on tty.
2730 Handle thread cancellation if needed.
2731 Namespace cleanup (use __tcgetattr, __getline).
2732 Use bool for Booleans.
2733 [USE_IN_LIBIO]: Handle wide streams.
2734 [!_LIBC]: Unconditionally do the fseek, since we don't know what
2735 stream might go where.
2737 * unlocked-io.h: Include <stdio.h>, so that the caller
2738 doesn't have to include <stdio.h> before us.
2739 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2740 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2741 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2742 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2743 if not declared, so that we can use getpass.c code from libc without
2745 (flockfile, ftrylockfile, funlockfile): New macros.
2747 2003-10-06 Bruno Haible <bruno@clisp.org>
2749 * version-etc-2.h: Remove file.
2750 * version-etc-2.c: Remove file.
2752 2003-09-25 Jim Meyering <jim@meyering.net>
2753 Bruno Haible <bruno@clisp.org>
2755 This lets translators provide better translations for the
2756 "Written by ..." part of --version output.
2757 * version-etc.h: Include stdarg.h.
2758 (version_etc_copyright): Declare as readonly.
2759 (version_etc): Make this function variadic with a NULL-terminated list
2760 of author name strings.
2761 (version_etc_va): New declaration.
2762 * version-etc.c: Include stdarg.h, stdlib.h.
2763 (version_etc_copyright): Declare as readonly.
2764 (version_etc_va): New function. Provide a different translatable string
2765 for each possible number of authors < 10. Abbreviate when there are 10
2767 (version_etc): Make this function variadic. Call version_etc_va.
2768 Suggestion from Gary V. Vaughan.
2770 * long-options.h (parse_long_options): Change prototype: the authors
2771 string is moved to the end and becomes variadic.
2772 * long-options.c: Include stdarg.h.
2773 (parse_long_options): Make this function variadic, too.
2774 Call version_etc_va, not version_etc.
2776 2003-10-06 Bruno Haible <bruno@clisp.org>
2778 * fatal-signal.h: New file, from GNU gettext.
2779 * fatal-signal.c: New file, from GNU gettext.
2781 2003-10-04 Karl Berry <karl@gnu.org>
2783 * argp*: update from libc.
2785 2003-10-01 Larry Jones <lawrence.jones@eds.com>
2787 * getpass.c (getpass): Use a no-op fseek when switching from input to
2788 output mode on the same stream.
2790 2003-09-29 Paul Eggert <eggert@twinsun.com>
2792 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
2793 Fix arg typo in previous patch.
2795 2003-09-28 Jim Meyering <jim@meyering.net>
2797 * error.c: Correct cpp indentation.
2799 2003-09-27 Paul Eggert <eggert@twinsun.com>
2801 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
2802 Omit the special code that used __typeof__, since we worry that
2803 it could be more trouble than it's worth. See:
2804 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
2805 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
2809 2003-09-26 Jim Meyering <jim@meyering.net>
2811 * error.c (error_tail): Move some declarations
2812 into inner scope where the local variables are used.
2814 2003-09-26 Bruno Haible <bruno@clisp.org>
2816 * stpncpy.h (gnu_stpncpy): New declaration.
2817 (stpncpy): Define as alias for gnu_stpncpy.
2818 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
2820 2003-09-26 Paul Eggert <eggert@twinsun.com>
2822 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
2823 (error_tail): Do not loop, reallocating temporary buffer, since
2824 the output cannot contain more wide characters than the input
2825 contains bytes, the size must be big enough already. This avoids
2826 one potential size overflow calculation. Check for size overflow
2827 when calculating temporary buffer size. Free temporary buffer
2828 when done, if it was allocated with malloc; this plugs a memory
2829 leak. Remove casts from void * to pointers, that are no longer
2830 needed now that we're assuming C89 or better.
2832 Merge error changes from glibc.
2834 * error.c, error.h: Update copyright notice header to match glibc.
2835 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
2836 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
2837 Disable cancellation while printing error.
2838 * error.h: Prepend __ to parameter names.
2840 2003-09-25 Karl Berry <karl@gnu.org>
2842 * argp-fmtstream.c, argp-help.c: update from libc.
2844 2003-09-25 Bruno Haible <bruno@clisp.org>
2846 * version-etc-2.h: New file, from version-etc.h with modifications.
2847 * version-etc-2.c: New file, from version-etc.c with modifications.
2849 2003-09-25 Simon Josefsson <jas@extundo.com>
2851 * xgetdomainname.h: New file.
2852 * xgetdomainname.c: New file.
2854 2003-09-25 Simon Josefsson <jas@extundo.com>
2855 Bruno Haible <bruno@clisp.org>
2857 * getdomainname.h: New file.
2858 * getdomainname.c: New file.
2860 2003-09-24 Paul Eggert <eggert@twinsun.com>
2862 * linebuffer.c (freebuffer): Don't free the argument, just
2863 the buffer associated with the argument. Bug reported by
2866 2003-09-19 Karl Berry <karl@gnu.org>
2868 * argp.h: update from libc.
2870 2003-09-16 Paul Eggert <eggert@twinsun.com>
2872 * linebuffer.c (readlinebuffer): Return NULL immediately upon
2873 input error, instead of returning NULL the next time we are called
2874 (and therefore losing track of errno).
2876 2003-09-15 Paul Eggert <eggert@twinsun.com>
2878 * getndelim2.c (getndelim2): Don't trash errno when a read
2879 fails, so that the caller gets the proper errno.
2881 * readutmp.c (read_utmp): Likewise.
2882 Check for fstat error. Close stream and free storage
2885 2003-09-14 Bruno Haible <bruno@clisp.org>
2887 * fwriteerror.h: New file.
2888 * fwriteerror.c: New file.
2890 2003-09-14 Jim Meyering <jim@meyering.net>
2892 * getloadavg.c: Correct cpp indentation.
2893 * strdup.c: Likewise.
2894 * vasnprintf.c: Likewise.
2896 2003-09-12 Paul Eggert <eggert@twinsun.com>
2898 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
2899 * obstack.c [!defined _LIBC]: Likewise.
2900 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
2901 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
2902 * exitfail.c: Don't include stdlib.h; no longer needed.
2904 More changes to assume C89 or better.
2906 * error.c (error_tail): Assume vprintf.
2908 * argmatch.c (getenv): Remove decl.
2909 * progreloc.c (get_full_program_name): Define via prototype.
2910 * setenv.c (clearenv): Likewise.
2911 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
2913 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
2914 (malloc, memcpy): Remove decls.
2915 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
2916 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
2917 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2918 (memcpy): Remove macro.
2919 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
2920 (__P): Remove. All uses removed.
2921 (PTR): Remove. All uses changed to void *.
2922 (CHAR_BIT, NULL): Remove.
2923 (spaces, zeros, memset_space, memset_zero)
2924 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
2926 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
2927 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
2928 Define with prototype.
2929 Remove now-unnecessary prototype decl.
2930 (extra_args_spec): Assume ANSI C. All uses changed.
2931 (extra_args_spec_iso): Remove.
2932 (my_strftime, emacs_strftimeu): Define via prototype.
2933 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
2935 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
2936 * strtoimax.c: Include <stdlib.h> unconditionally.
2937 (strtoul, strtol): Remove decls.
2938 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
2940 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2941 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
2942 (LOCALE_PARAM_PROTO): New macro.
2943 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
2944 (INTERNAL (strtol), strtol): Define with a prototype.
2945 (PARAMS): Remove. All uses removed.
2946 * tempname.c: Include <string.h> unconditionally.
2947 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
2948 * xgethostname.c (main): Define with a prototype.
2949 * xmalloc.c: Include "xalloc.h" first, to check interface.
2950 Include <stdlib.h> unconditionally.
2951 (calloc, malloc, realloc, free): Remove decls.
2952 * xstrtod.c: Include "xstrtod.h" first, to check interface.
2953 Include <stdlib.h> unconditionally. Sort include file names.
2955 (xstrtod): Define with a prototype.
2956 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
2957 (strtol, strtoul): Remove decls.
2959 2003-09-11 Paul Eggert <eggert@twinsun.com>
2961 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
2962 Include <stdlib.h>, <string.h> unconditionally.
2963 Remove now-unnecessary cast to char *.
2964 * strnlen.c: Include <string.h> unconditionally.
2965 * yesno.c (yesno): Define with a prototype.
2967 2003-09-10 Bruno Haible <bruno@clisp.org>
2969 * strcspn.c: Include <string.h> unconditionally.
2970 * strpbrk.c: Include <string.h> unconditionally.
2971 * strstr.c: Include <string.h> unconditionally.
2972 * unicodeio.c: Include <string.h> unconditionally.
2973 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
2974 * unsetenv.c: Likewise.
2975 * xreadlink.c: Include <stdlib.h> unconditionally.
2976 * yesno.c: Include <stdlib.h> unconditionally.
2977 (rpmatch): Add prototype.
2979 2003-09-10 Jim Meyering <jim@meyering.net>
2981 * error.c: Correct indentation of cpp directives.
2983 2003-09-09 Paul Eggert <eggert@twinsun.com>
2987 * acosl.c (main): Use a prototype.
2988 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
2991 * getloadavg.c (getloadavg, main): Define via prototypes.
2993 * getopt.h (struct option.name): Assume C89, and use 'const'.
2994 (getopt, etopt_long, getopt_long_only, _getopt_internal)
2995 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
2997 * getopt.c (const): Remove macro.
2998 Include <string.h> unconditionally.
2999 (my_index): Remove; all uses changed to strchr.
3000 (strlen): Remove decl.
3001 (exchange): Remove forward decl; no longer needed.
3002 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
3003 Define with prototype.
3004 * getopt1.c (const): Remove macro.
3005 (getopt_long, getopt_long_only, main): Define with prototype.
3007 * getugroups.c: Include <string.h> unconditionally.
3009 * getusershell.c: Include <stdlib.h> unconditionally.
3010 (getusershell, setusershell, endusershell, readname, main):
3011 Define with prototypes.
3013 * group-member.c: Include group-member.h first.
3014 Include <stdlib.h> unconditionally.
3016 * hard-locale.c: Include hard-locale.h first.
3017 Include <stdlib.h>, <string.h> unconditionally.
3019 * hash.c (free, malloc): Remove decls.
3020 Include <stdlib.h> unconditionally.
3022 * human.c: Include <stdlib.h>, <string.h> unconditionally.
3023 (getenv): Do not declare.
3025 * idcache.c: Include <string.h> unconditionally.
3027 * long-options.c: Include long-options.h first, to test interface.
3028 Include <stdlib.h> unconditionally.
3030 * makepath.c: Include makepath.h first, to test interface.
3031 Include <stdlib.h> and <string.h> unconditionally.
3033 * linebuffer.c: Include <stdlib.h>.
3034 (free): Remove decl.
3036 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
3037 rpl_malloc returns void *, not char *.
3038 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
3040 * md5.h: Include <limits.h> unconditionally.
3041 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
3042 (__P): Remove; all uses removed.
3043 * md5.c: Include "md5.h" first.
3044 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
3045 md5_buffer, md5_process_bytes, md5_process_block):
3046 Define with prototypes.
3047 * sha.h (__P): Remove all uses. (It wasn't defined??)
3048 * sha.c: Include "sha.h" first.
3049 Include <stdlib.h>, <string.h> unconditionally.
3051 * memchr.c (__ptr_t): Remove; all uses changed to void *.
3052 * memcmp.c (__ptr_t): Likewise.
3053 * memrchr.c (__ptr_t): Likewise.
3054 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
3055 Include <string.h> unconditionally.
3056 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
3057 * memchr.c: Include <stdlib.h> unconditionally.
3058 * memchr.c (LONG_MAX): Remove.
3059 * memrchr.c (LONG_MAX): Likewise.
3060 * memchr.c (__memchr): Define via a prototype.
3061 * memrchr.c (__memrchr): Likewise.
3062 * memcmp.c (__P): Remove, and remove all uses.
3063 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
3064 Remove forward decls; no longer needed.
3065 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
3066 Use types required by C89 in prototype.
3068 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
3069 * savedir.c: Likewise.
3070 * mkdir.c (free): Remove decl.
3071 * rmdir.c (rmdir): Define with a prototype.
3072 * savedir.c: Include savedir.h first, to test interface.
3074 * mktime.c (STDC_HEADERS): Remove.
3075 Include <stdlib.h>, <string.h> unconditionally.
3077 * modechange.c: Include <stdlib.h> unconditionally.
3078 (malloc): Remove decl.
3080 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
3081 (free): Remove decl.
3083 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
3084 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
3085 (This type really should be intptr_t, but that's a C99ism.)
3086 (_obstack_memcpy): Remove: all uses changed to memcpy.
3087 Include <string.h> unconditionally.
3088 (struct obstack): Assume __STDC__ for types of members
3089 chunkfun, freefun, extra_arg.
3090 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
3091 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
3092 obstack_begin, obstack_specify_allocation,
3093 obstack_specify_allocation_with_arg, obstack_chunkfun,
3094 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
3095 Remove unprototyped decls and the macros that use them.
3096 * obstack.c (POINTER): Remove. All uses changed to void *.
3097 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
3098 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
3099 (defined __STDC__ && __STDC__)]:
3100 Remove nonprototyped code.
3101 Include <stdlib.h> unconditionally.
3102 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
3103 _obstack_allocated_p, _obstack_free, obstack_free,
3104 _obstack_memory_used, print_and_abort):
3105 Define using prototypes.
3106 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
3107 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
3108 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
3109 obstack_next_free, obstack_object_size, obstack_room) [0]:
3110 Remove unused, unprototyped code.
3112 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
3114 * physmem.c (physmem_total, physmem_available, main): Define
3117 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
3118 (main): Define with a prototype.
3120 * posixver.c (getenv): Remove decl.
3122 * putenv.c (malloc): Returns void *, not char *.
3123 Include <string.h> unconditionally.
3124 (strchr, memcpy, NULL): Do not define.
3126 * readtokens.c: Include readtokens.h first, to test interface.
3127 Include <stdlib.h>, <string.h> unconditionally.
3128 (init_tokenbuffer): Define with a prototype.
3130 * regex.c (PARAMS): Remove. All uses removed.
3131 All uses of _RE_ARGS removed, too.
3132 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3134 (bzero): Assume memset exists.
3135 (memcmp, memcpy, NULL): Remove.
3136 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
3137 char, or assignments to local vars of type signed char.
3138 (init_syntax_once, PREFIX(extract_number_and_incr),
3139 PREFIX(print_partial_compiled_pattern),
3140 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
3141 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
3142 PREFIX(regex_grow_registers), PREFIX(regex_compile),
3143 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
3144 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
3145 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
3146 wcs_compile_range, byte_compile_range, truncate_wchar,
3147 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
3148 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
3149 count_mbs_length, wcs_re_match_2_internal,
3150 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
3151 PREFIX(alt_match_null_string_p),
3152 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
3153 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
3154 regfree, PREFIX(extract_number)): Define with prototype. Remove
3155 now-unnecessary declaration, if any.
3156 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
3158 Remove now-unnecessary casts among pointer types.
3159 * regex.h (_RE_ARGS): Remove. All uses removed.
3161 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
3162 (free): Remove decl.
3164 * rpmatch.c: Include <stdlib.h> unconditionally.
3166 * same.c: Include <stdlib.h>, <string.h> unconditionally.
3167 (free): Remove decl.
3169 * save-cwd.c: Include <stdlib.h> unconditionally.
3170 * xgetcwd.c: Likewise.
3172 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
3173 (free): Remove decl.
3175 * strchrnul.c (strchrnul): Define with a prototype.
3176 Fix bug: c_in was not converted to char before searching.
3178 The following changes are not K&R related:
3180 * group-member.h: Include <sys/types.h>, so that this file is
3182 * makepath.h: Likewise.
3184 * getusershell.c (readname, default_index, line_size, readname):
3185 Use size_t, not int, for sizes.
3186 (readname): If the size overflows, report an error instead of
3189 2003-09-09 Derek Robert Price <derek@ximbiot.com>
3191 * getndelim2.c: Assume stdlib.h per the C89 spec.
3193 2003-09-08 Paul Eggert <eggert@twinsun.com>
3195 Assume C89 or better; remove K&R cruft.
3196 A few of these changes were first proposed by Derek Robert Price
3197 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
3199 * addext.c: Include <string.h> unconditionally.
3200 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
3201 Don't declare getenv or malloc.
3203 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
3204 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
3206 (find_stack_direction, alloca): Use prototypes.
3208 * atexit.c (atexit): Define using a prototype.
3210 * basename.c, dirname.c, stripslash.c:
3211 Include <string.h> unconditionally.
3213 * bcopy.c: Include <stddef.h>.
3214 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
3216 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
3218 * error.h (error, error_at_line, error_print_progname)
3219 [! (defined (__STDC__) && __STDC__)]: Remove decls.
3220 * error.c: Include error.h first, to check interface.
3221 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3222 (VA_START): Remove; all uses changeed to va_start.
3223 (exit, strerror): Remove decls.
3224 (error_print_progname): Prototype uncondionally.
3225 Don't include <errno.h>; no longer needed.
3226 (private_strerror): Remove.
3227 (error_tail): Always define.
3228 (error, error_at_line): Assume C89 or better; always use prototypes.
3229 * fatal.c: Include "fatal.h" first, to test interface.
3230 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3231 (VA_START): Remove; all uses changed to va_start.
3232 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
3234 (exit): Remove decl.
3235 (fatal): Prototype unconditionally. Assume va_start works.
3236 Abort at end, to pacify gcc.
3238 * euidaccess.c (main): Define with a prototype.
3240 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
3242 * exitfail.c: Include <stdlib.h> unconditionally.
3244 * fnmatch_.h (__P): Remove. All uses changed to assume
3246 * fnmatch.c: Include fnmatch.h first, to test interface.
3247 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
3248 (getenv): Remove decl.
3249 (fnmatch): Define using a prototype.
3250 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
3251 (FCT): Define using a prototype.
3253 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
3255 * gethostname.c: Include <stddef.h>.
3256 (gethostname): Define with prototype. Length is size_t, not int.
3258 2003-09-08 Paul Eggert <eggert@twinsun.com>
3260 * getversion.c: Remove; was migrated to backupfile.c in 1997.
3261 getversion.c should have been removed then, but was accidentally
3264 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
3265 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
3267 2003-09-07 Paul Eggert <eggert@twinsun.com>
3269 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
3270 copy_tm_result. Bug reported by Simon Josefsson in
3271 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
3273 2003-09-06 Paul Eggert <eggert@twinsun.com>
3275 * time_r.c, time_r.h: New files.
3277 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
3279 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
3280 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
3282 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
3284 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
3285 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
3288 * timegm.c: Switch to glibc implementation, with the following changes:
3289 [defined HAVE_CONFIG_H]: Include <config.h>.
3290 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
3291 (__mktime_internal) [!defined _LIBC]: New decl.
3292 (__gmtime_r) [!defined _LIBC]: New macro and function.
3293 (timegm): Use a prototype, since gnulib assumes C89.
3294 Do not bother declaring tmp to be const, as it's not really usefu.
3295 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
3296 (timegm): Declare only if HAVE_DECL_TIMEGM.
3298 2003-09-03 Paul Eggert <eggert@twinsun.com>
3300 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
3301 Bug reported by Lute Kamstra in
3302 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
3304 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
3305 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
3306 course with correspondingly smaller numbers for tomorrow and
3307 yesterday. From Tadayoshi Funaba. Originally installed into
3308 sh-utils on 1999-08-07, but the patch got lost (I guess during the
3311 2003-08-31 Simon Josefsson <jas@extundo.com>
3313 * timegm.h: New file.
3314 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
3316 2003-08-31 Karl Berry <karl@gnu.org>
3318 * argp.h: update from libc.
3320 2003-08-28 Bruno Haible <bruno@clisp.org>
3322 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
3323 warning on QNX, which defines O_BINARY to 000000.
3325 2003-08-24 Bruno Haible <bruno@clisp.org>
3327 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
3328 MSVC7 <stdio.h> is included later.
3330 2003-08-20 Bruno Haible <bruno@clisp.org>
3332 * progname.h: New file, from GNU gettext.
3333 * progname.c: New file, from GNU gettext.
3334 * progreloc.c: New file, from GNU gettext.
3336 2003-08-19 Bruno Haible <bruno@clisp.org>
3338 * xstrdup.c: Assume <string.h> exists.
3340 2003-08-18 Jim Meyering <jim@meyering.net>
3342 * setenv.h: Indent nested cpp directive.
3343 * vasnprintf.c: Remove trailing blanks.
3345 2003-08-17 Simon Josefsson <jas@extundo.com>
3346 Bruno Haible <bruno@clisp.org>
3348 * xstrndup.h: New file.
3349 * xstrndup.c: New file.
3351 2003-08-17 Bruno Haible <bruno@clisp.org>
3353 * strndup.h: New file.
3355 2003-08-16 Paul Eggert <eggert@twinsun.com>
3357 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
3358 space, undoing this 2003-08-12 change:
3359 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
3361 2003-08-16 Jim Meyering <jim@meyering.net>
3363 Merge from coreutils.
3364 * xstrtoimax.c: #else #if -> #elif.
3365 * xstrtoumax.c: Likewise.
3367 2003-08-15 Paul Eggert <eggert@twinsun.com>
3369 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
3370 rather than tab, after '#' in shell-script copyright notices.
3371 Suggested by Bruno Haible.
3373 2003-08-15 Jim Meyering <jim@meyering.net>
3374 and Paul Eggert <eggert@twinsun.com>
3376 Merge from coreutils.
3377 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
3378 member but strut utmpx does not. Needed for AIX 4.3.3.
3379 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
3381 2003-08-15 Jim Meyering <jim@meyering.net>
3383 Merge from coreutils.
3384 * xgethostname.c: Include <stdlib.h>.
3385 (xghostname): Don't exit for anything other than memory-related
3386 failure; just return NULL.
3387 * userspec.c: Include "posixver.h".
3388 (parse_user_spec): Accept `.' as a separator only
3389 in pre-POSIX-200112 mode.
3390 * strtoimax.c: Use #elif rather than #else #if.
3391 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
3392 Remove function, now that we can rely on a working tzset function.
3393 [!_LIBC]: Ensure that the required autoconf test has been run.
3394 [!defined _NL_CURRENT && HAVE_STRFTIME]:
3395 Use underlying_strftime for %r.
3396 * sha.c: Merge in some clean-up and optimization changes from glibc.
3397 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
3398 Ensure that it is a multiple of 64.
3399 Rearrange loop exit tests so as to avoid performing an
3400 additional fread after encountering an error or EOF.
3401 * realloc.c: Update copyright date.
3403 2003-08-14 Jim Meyering <jim@meyering.net>
3405 Merge from coreutils.
3406 * obstack.h: Whitespace changes.
3407 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
3408 and xcalloc return values.
3409 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
3410 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
3411 hang on OSF/1 5.1 for DIR on both local and remote file systems.
3412 Reported by (and fix confirmed by) Nelson H. F. Beebe.
3413 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3415 Use mntctl's return value to drive the entry-processing loop, since
3416 we can't rely on the value of the vmt_length member in the last
3417 entry. On some systems doing so could result in exhausting
3418 virtual memory. Based in part on a patch from Mike Jetzer.
3420 2003-08-14 Jim Meyering <jim@meyering.net>
3421 and Paul Eggert <eggert@twinsun.com>
3423 Merges from coreutils, plus other fixes.
3424 * physmem.c: Merge in portability changes from gcc/libiberty
3425 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
3426 for credits and details. Thanks to Kaveh Ghazi for helping
3427 to keep these files in sync.
3428 (ARRAY_SIZE): Define it.
3429 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
3430 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
3431 (memcasecmp): Don't assume size_t fits in unsigned int.
3432 Remove casts and duplicate code.
3433 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
3434 (memcpy): Remove definition.
3435 Merge in some clean-up and optimization changes from glibc.
3436 [BLOCKSIZE]: Move definition to top of file.
3437 Ensure that it is a multiple of 64.
3438 Rearrange loop exit tests so as to avoid performing an
3439 additional fread after encountering an error or EOF.
3440 * md5.h (md5_uintptr): Define.
3441 * makepath.c (CLEANUP_CWD): Report an error if we failed to
3442 return to the initial working directory. Preserve errno
3444 * idcache.c: Include "xalloc.h".
3445 (xmalloc, xrealloc): Remove decls.
3446 (getuser): Remove casts no longer required in C89.
3447 * human.c: Include stdio.h, for sprintf.
3448 * group-member.c: Include "xalloc.h".
3449 (xmalloc, xrealloc): Remove decls.
3450 (get_group_info): Remove casts no longer required in C89.
3451 * getusershell.c (readname): Remove casts no longer required in C89.
3452 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
3453 * getline.c: Whitespace fix, from coreutils.
3455 2003-08-13 Paul Eggert <eggert@twinsun.com>
3457 * exclude.c: Include <ctype.h>
3458 (IN_CTYPE_DOMAIN): New macro.
3460 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
3463 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3464 Undo previous (whitespace-only) change.
3466 2003-08-12 Paul Eggert <eggert@twinsun.com>
3468 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3469 Normalize leading white space and remove trailing white space.
3470 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
3471 notice, as per ../config/srclist-update.
3473 Merge from coreutils.
3474 * euidaccess.h: New file.
3475 * euidaccess.c: Include it.
3476 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
3477 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
3478 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
3480 2003-08-11 Bruno Haible <bruno@clisp.org>
3482 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
3483 (vasnprintf): Use it instead of wcslen.
3485 2003-08-11 Bruno Haible <bruno@clisp.org>
3487 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
3488 value to ensure that _Bool promotes to int. Use #define for _Bool when
3489 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
3491 2003-08-10 Karl Berry <karl@gnu.org>
3493 * regex.h: update from libc (whitespace fix).
3495 2003-08-09 Paul Eggert <eggert@twinsun.com>
3497 Merge some files from coreutils. These changes were
3498 originally made by Jim Meyering.
3499 * acl.c: Include <sys/types.h> before <sys/stat.h>;
3500 many older Unixes require this.
3501 * alloca.c (alloca): Remove cast to argument of free;
3502 no longer needed in C89.
3503 * alloca_.h, regex.h: Fix white space to match
3504 what GNU indent does.
3506 2003-08-05 Paul Eggert <eggert@twinsun.com>
3508 * bumpalloc.h: Remove.
3510 2003-08-04 Paul Eggert <eggert@twinsun.com>
3512 * getloadavg.c: Change copyright notice and spacing to conform to
3515 Merge from coreutils.
3516 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
3518 * getdate.y (date): Also accept dates like May-23-2003; suggestion
3519 from Karl Berry, implemented by Jim Meyering.
3520 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
3521 from Dmitry V. Levin.
3522 Remove anachronistic cast of xrealloc.
3523 * fnmatch_.h (__const): Remove. Use 'const'.
3524 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
3525 type. Otherwise, it wouldn't compile with at least /bin/cc on
3526 ymp-cray-unicos9.0.2.X.
3527 Combine two mostly-identical uses of alloca into one.
3528 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
3530 2003-08-04 Dave Love <d.love@dl.ac.uk>
3534 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
3535 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
3536 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
3537 obsolete NLIST_NAME_UNION.
3538 [__GNU__]: Undef BSD and FSCALE.
3539 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
3541 2003-08-03 Paul Eggert <eggert@twinsun.com>
3543 * stdbool_.h (_Bool): Make it signed char, instead of
3544 an enum type, so that it's guaranteed to promote to int. See:
3545 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
3547 2003-07-31 Paul Eggert <eggert@twinsun.com>
3549 * strerror.c: Include config.h, limits.h. Declare sprintf.
3550 (strerror): Don't assume that a printable int fits in 14 bytes.
3552 2003-07-24 Derek Robert Price <derek@ximbiot.com>
3553 Bruno Haible <bruno@clisp.org>
3555 * getline.h (getline, getdelim): Change return type to ssize_t.
3556 * getline.c (getline, getdelim): Likewise.
3557 Remove _GNU_SOURCE define; now it's defined in config.h through
3560 2003-07-22 Paul Eggert <eggert@twinsun.com>
3562 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
3563 over-parenthesization in macros.
3565 Sync with coreutils.
3567 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
3570 Use `exit_failure' for xalloc and xmemcoll instead of their own
3571 private exit-failure variables.
3572 * xalloc.h (xalloc_exit_failure): Remove.
3573 * xmalloc.c: Likewise. Include exitfail.h.
3574 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
3575 * xmemcoll.h (xmemcoll_exit_failure): Remove.
3576 * xmemcoll.c: Likewise. Include exitfail.h.
3577 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
3579 2003-07-18 Paul Eggert <eggert@twinsun.com>
3581 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
3582 * closeout.c: Likewise. Include "closeout.h" right after config.h,
3583 to test that it can stand by itself. Include "exitfail.h".
3584 Clients should set exit_failure instead.
3585 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
3587 2003-07-18 Andreas Schwab <schwab@suse.de>
3589 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
3591 2003-07-18 Bruno Haible <bruno@clisp.org>
3593 * getndelim2.h: New file.
3594 * getndelim2.c: Make into a module of its own. Include config.h,
3596 (getndelim2): Make non-static. Change return type to ssize_t.
3597 * getline.h: Change argument names.
3598 * getline.c: Include getndelim2.h instead of getndelim2.c.
3599 * getnline.c: Include getndelim2.h.
3601 2003-07-17 Bruno Haible <bruno@clisp.org>
3603 * Makefile.am: Remove file.
3604 * Makefile.in: Remove file.
3606 2003-07-17 Bruno Haible <bruno@clisp.org>
3608 * getnline.h: New file.
3609 * getnline.c: New file.
3610 * getndelim2.c: New file, extracted from getline.c.
3611 (getndelim2): Renamed from getdelim2, with added nmax argument.
3612 * getline.c: Include getndelim2.c.
3613 (getdelim2): Moved out to getndelim2.c.
3614 (getline, getdelim): Update.
3616 2003-07-15 <karl@gnu.org>
3618 * vasnprintf.c: update from gettext.
3620 2003-07-15 Jim Meyering <jim@meyering.net>
3622 * makepath.c (make_path): Enclose diagnostic in _(...).
3624 2003-07-14 Paul Eggert <eggert@twinsun.com>
3626 * asnprintf.c, asprintf.c, config.charset, gettext.h,
3627 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
3628 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
3629 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
3630 vasprintf.c, vasprintf.h: Regenerate. These files are now being
3631 updated automatically by ../config/srclist-update. This changes
3632 their license from LPGL to GPL.
3634 2003-07-14 Jim Meyering <jim@meyering.net>
3636 Don't emit diagnostics. Let callers do that.
3637 * save-cwd.c: Don't include "error.h".
3638 (save_cwd): Don't call error. Ensure that errno is valid
3639 when returning nonzero.
3641 * save-cwd.h (restore_cwd): Update prototype.
3642 * save-cwd.c (restore_cwd): Remove two parameters.
3643 Simplify. Don't call error upon failure. Let callers do that.
3644 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
3645 when auditing is enabled. But don't bother updating the #if.
3647 2003-07-14 Simon Josefsson <jas@extundo.com>
3649 * mempcpy.h: New file.
3650 * mempcpy.c: New file.
3652 2003-07-14 Paul Eggert <eggert@twinsun.com>
3654 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
3655 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
3656 unicodeio.c, unicodeio.h, unlocked-io.h:
3657 Switch from LGPL to GPL.
3659 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
3661 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
3662 it breaks C++ compilation.
3663 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
3665 2003-07-10 Jim Meyering <jim@meyering.net>
3667 * vasnprintf.c: Remove trailing blanks.
3668 Make cpp indentation consistent.
3670 2003-07-09 Paul Eggert <eggert@twinsun.com>
3672 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
3673 posixver.c, strftime.c, strnlen.c, strverscmp.c:
3674 Switch from LGPL to GPL.
3676 2003-07-07 Paul Eggert <eggert@twinsun.com>
3678 * mktime.c: Fix some boundary cases and remove need for floating point.
3680 Issue a compile-time diagnostic if time_t is floating point, or if
3681 two's complement arithmetic is not in effect, or if arithmetic
3682 right shift does not propagate the sign. These assumptions were
3683 all in the original code but they weren't checked.
3685 (TIME_T_MIDPOINT, verify): New macros.
3686 (__isleap): Remove; it has integer overflow problems.
3687 (leapyear): New function, without those problems.
3688 (ydhms_tm_diff): Remove; splitting into two parts.
3689 (ydhms_diff): New function, containing the arithmetic part of
3690 the old ydhms_tm_diff function. Issue a compile-time
3691 diagnostic if we are not using C99 integer division.
3692 Avoid casts when possible.
3693 (guess_time_tm): New function, containing the checking part of
3694 the old ydhms_tm_diff function. Return the new value, rather than
3695 the difference between it and the old. Accept a new argument T
3696 so that *T specifies the old value. Check for overflow in the result.
3698 (__mktime_internal): Use a time_t offset, not a long int offset.
3699 This undoes the 2003-06-04 change, which is no longer needed now
3700 that we have better overflow checking.
3701 (localtime_offset): Likewise.
3703 (__mktime_internal): Avoid harmful overflow on hosts where time_t
3704 and long are 64-bit but int is only 32-bit.
3705 (ydhms_diff): Use long int to store year1 and yday1.
3706 Issue a compile-time diagnostic if long int is not wide enough.
3708 (__mktime_internal): Use long int to store adjusted year and yday.
3709 Use plain C rather than preprocessor commands, if that doesn't
3711 Check for overflow (and try to repair) after each probe
3712 rather than checking only at the very end. This avoids some bugs
3713 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
3714 does not equal GMT offset at maximum time).
3715 Use integer to check for overflow rather than floating point; this
3716 is more portable to non-IEEE hosts, and is a tad faster.
3717 When we detect that we are oscillating between two values,
3718 don't check whether tm_isdst has the requested value, since
3719 we already know the answer. When tm_isdst has the wrong value,
3720 use a different heuristic to find the right one, based on the
3721 extreme values actually observed in practice in tz2003a,
3722 rather than the (overly optimistic) "previous 3 calendar quarters".
3724 (not_equal_tm, print_tm, check_result): Use "const T" rather than
3725 "T const" to accommodate glibc style.
3726 (check_result): Use less-confusing report format. "long" -> "long int.
3728 Don't loop if the iteration overflows time_t.
3729 Allow a negative step in the iteration.
3731 2003-07-01 Paul Eggert <eggert@twinsun.com>
3733 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3734 having it depend on HAVE_SYS_TYPES_H.
3736 2003-06-25 Bruno Haible <bruno@clisp.org>
3738 * readlink.c: New file.
3740 2003-06-20 Bruno Haible <bruno@clisp.org>
3742 Assume C89, so PARAMS isn't needed.
3743 * unicodeio.h (PARAMS): Remove.
3744 * unicodeio.c: Don't use PARAMS.
3746 2003-06-18 Jim Meyering <jim@meyering.net>
3748 Merge changes from coreutils.
3749 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
3750 Remove explicit declarations of xmalloc and realloc.
3752 (read_utmp): Remove anachronistic cast of xmalloc.
3754 2003-06-17 Paul Eggert <eggert@twinsun.com>
3756 Assume C89, so PARAMS isn't needed.
3757 * backupfile.h (PARAMS): Remove. All uses removed.
3758 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
3759 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
3760 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
3761 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
3762 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
3763 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
3764 xstrtol.h: Likewise.
3765 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
3766 same.h, strverscmp.h: Do not include config.h; no longer needed.
3767 Anyway, config.h should always be included before any other file.
3769 2003-06-11 Simon Josefsson <jas@extundo.com>
3771 * sysexit_.h: New file.
3773 2003-05-20 Derek Price <derek@ximbiot.com>
3775 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
3777 2003-06-10 Simon Josefsson <jas@extundo.com>
3779 * strchrnul.h: New file.
3780 * strchrnul.c: New file.
3782 2003-06-10 Simon Josefsson <jas@extundo.com>
3784 * argp.h: New file, from glibc.
3785 * argp-ba.c: New file, from glibc.
3786 * argp-eexst.c: New file, from glibc.
3787 * argp-fmtstream.c: New file, from glibc.
3788 * argp-fmtstream.h: New file, from glibc.
3789 * argp-fs-xinl.c: New file, from glibc.
3790 * argp-help.c: New file, from glibc.
3791 * argp-namefrob.h: New file, from glibc.
3792 * argp-parse.c: New file, from glibc.
3793 * argp-pv.c: New file, from glibc.
3794 * argp-pvh.c: New file, from glibc.
3795 * argp-xinl.c: New file, from glibc.
3797 2003-06-07 Jim Meyering <jim@meyering.net>
3799 * readtokens.h: Put `Free Software Foundation, Inc.'
3800 in place of my name in the copyright comment.
3801 Remove definition and uses of __P.
3804 * stat.c: Don't declare xmalloc explicitly.
3805 Instead, include "xalloc.h".
3806 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
3807 xrealloc, and xcalloc return values.
3808 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
3810 * xgetcwd.h: Remove definition/uses of PARAMS.
3812 2003-06-06 Jim Meyering <jim@meyering.net>
3814 * stdbool_.h: Renamed from stdbool.h.in.
3816 2003-06-06 Jim Meyering <jim@meyering.net>
3818 Merge from coreutils.
3819 * same.c: (same_name): Declare *_basename locals to be `const'.
3820 Consolidate declarations and initializations of *_base* locals.
3822 Merge from coreutils.
3823 This avoids a core dump on systems without GNU putenv,
3824 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
3825 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
3826 (unsetenv): New static function, from GNU libc.
3827 (rpl_putenv): Use it.
3829 * modechange.c: Remove trailing blanks.
3831 Merge from coreutils.
3832 * fsusage.c: Remove declaration of statfs.
3833 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
3835 * posixtm.c: Include <stdbool.h> unconditionally.
3837 2003-06-05 Paul Eggert <eggert@twinsun.com>
3839 * mktime.c (__mktime_internal): When resolving a tm_isdst
3840 mismatch, look in future quarters as well as past. This fixes a
3841 bug when processing fall-backwards gaps immediately after a long
3842 period of daylight-saving time.
3844 * mktime.c: Assume freestanding C89 or better.
3845 (HAVE_LIMITS_H): Remove. Assume it's 1.
3846 (__P): Remove; not used.
3847 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
3848 (mktime, not_equal_tm, print_tm, check_result,
3849 main): Use prototypes. Use const * where appropriate.
3850 (main): Fix typo in testing code that uncovered by above changes.
3851 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
3853 2003-06-04 Paul Eggert <eggert@twinsun.com>
3855 * mktime.c: Fix Debian bug 177940
3856 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
3857 (localtime_offset): Now long int, not time_t, because we want it
3858 to be guaranteed to be signed. All uses changed.
3859 (__mktime_internal): If overflow would occur when adding offset,
3862 Merge 'human' changes from coreutils. Rewrite to support
3863 locale-specific notations like thousands separators.
3864 * human.c: Simplify authorship notice.
3865 Include human.h immediately after config.h.
3866 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
3867 <limits.h>: Do not include, since human.h does.
3868 (SIZE_MAX, UINTMAX_MAX): New macros.
3869 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
3870 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
3871 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
3872 (power_letter): Renamed from suffixes.
3873 (generate_suffix_backwards): Remove.
3874 (adjust_value): Now takes int style (because of human.h changes)
3875 and long double value (for greater precision on some platforms).
3876 (group_number): New function.
3877 (human_readable): Use it. Use integer options, not enum.
3878 Put the options before the sizes in the arg list.
3879 Support all the new options.
3880 The old human_readable function has been removed;
3881 use inttostr.h instead.
3882 (human_readable, default_block_size, humblock):
3883 Use uintmax_t, not int, for block sizes.
3884 (human_readable_inexact, block_size_types): Remove.
3885 (block_size_opts): New constant.
3886 (human_options): Renamed from human_block_size, with new signature
3887 that allows block sizes up to UINTMAX_MAX. All callers changed.
3888 * human.h: Add copyright and authorship notice.
3889 Include <limits.h> and <stdbool.h> unconditionally.
3890 (PARAMS): Remove. All uses removed.
3891 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
3892 (enum human_inexact_style): Remove tag; now a nameless enum.
3893 (human_floor, human_ceiling, human_round_to_even): Now have
3894 values 2, 0, 1 rather than -1, 1, 0.
3895 (human_group_digits, human_suppress_point_zero, human_autoscale,
3896 human_base_1024, human_SI, human_B): New constants.
3897 (human_readable_inexact, human_block_size): Remove.
3898 (human_readable): Size args are now uintmax_t, not int.
3899 (human_options): New decl.
3901 * exclude.c: (new_exclude, add_exclude): Remove casts that are
3902 unnecessary now that we assume C89 or better. This change
3903 imported from coreutils.
3905 * mktime.c (__mktime_internal): Do not reject negative timestamps
3906 arbitrarily. This is the same patch as 2003-05-28, but it got lost
3907 in the 2003-05-30 sync from glibc.
3909 .h files should stand alone, but we shouldn't include <sys/types.h>
3910 if we can get away with just <stddef.h>.
3912 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
3913 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
3914 rather than <sys/types.h>, as we merely need size_t.
3915 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
3917 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
3918 Include <stdio.h>, to get FILE.
3919 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
3920 memcasecmp.h has included <stddef.h> and all we need is size_t.
3921 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
3922 our interface, instead of including <sys/types.h>
3924 2003-06-02 Paul Eggert <eggert@twinsun.com>
3927 Fix some minor time-related bugs with POSIX time arguments.
3928 Some valid time stamps were being rejected (notably -1, and
3929 time stamps before 1900 on 64-bit hosts). And some invalid
3930 time stamps were being accepted, e.g. September 31.
3932 * posixtm.h (posixtime): Return bool instead of time_t, so
3933 that we can return (time_t) -1 successfully.
3934 * posixtm.c: Likewise.
3935 [HAVE_STDBOOL_H]: Include <stdbool.h>.
3936 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
3937 (t): Remove static var.
3938 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
3939 of static var. All uses changed.
3940 (year): Do not reject years before 1900; they can occur with
3942 (posix_time_parse): Do not check for out-of-range components;
3943 that is now the caller's responsibility, since our checks were
3944 only approximations.
3945 (posixtime): Use mktime to check for out-of-range components,
3946 since it knows them exactly.
3947 If mktime returns (time_t) -1, check whether an error actually occurred
3948 by invoking localtime on -1.
3949 (main) [TEST_POSIXTIME]: Check for input data errors, and report
3950 posixtime failures better.
3951 Improve the test data (in comments only).
3953 2003-05-30 <karl@gnu.org>
3955 * mktime.c: update from libc.
3957 2003-05-30 Bruno Haible <bruno@clisp.org>
3959 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
3960 * localcharset.h: Likewise.
3961 * localcharset.c: Likewise.
3963 2003-05-28 Paul Eggert <eggert@twinsun.com>
3965 Assume the headers required for C89 freestanding compilers.
3966 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
3967 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
3968 without checking for HAVE_LIMITS_H.
3969 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
3970 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
3972 * fatal.c: Include <stdarg.h> without checking for __STDC__.
3973 * exclude.c: Include <stdbool.h> unconditionally.
3974 * tempname.c: Include <stddef.h> unconditionally.
3975 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
3976 * modechange.c, rpmatch.c (NULL): Don't define, since
3977 <stddef.h> does that.
3978 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
3979 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
3980 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
3981 * xstrtol.c: Likewise.
3982 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
3983 * savedir.c: Include <stddef.h> instead of defining NULL.
3985 * addext.c (addext): Use assignment rather than cast, to avoid
3986 warnings on some platforms.
3988 * mktime.c (__mktime_internal): Do not reject negative timestamps
3991 2003-05-10 Bruno Haible <bruno@clisp.org>
3993 * linebreak.c (iconv_string_length): Don't return -1 just because the
3994 string is longer than 4 KB.
3996 2003-05-12 Jim Meyering <jim@meyering.net>
3998 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
3999 the space-padded-by-default conversion specifiers, %e, %k, %l.
4001 2003-05-03 Bruno Haible <bruno@clisp.org>
4003 Upgrade to Unicode-4.0.
4004 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
4005 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
4006 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
4007 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
4008 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
4009 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
4010 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
4011 Change width of U+E0100..U+E01EF from 1 to 0.
4013 2003-04-25 Bruno Haible <bruno@clisp.org>
4015 * copy-file.c: Include <stddef.h>, for size_t.
4017 2003-04-25 Jim Meyering <jim@meyering.net>
4019 * copy-file.c (copy_file_preserving): Declare buf_size to be
4020 of type size_t, not int.
4022 2003-04-11 Jim Meyering <jim@meyering.net>
4024 Merge changes from Coreutils.
4026 2003-03-22 Jim Meyering <jim@meyering.net>
4028 * strftime.c (widen): Cast alloca return value to proper type.
4030 2003-01-19 Ulrich Drepper <drepper@redhat.com>
4033 * strftime.c (my_strftime): Handle very large width
4034 specifications for numeric values correctly. Improve checks for
4037 2003-01-19 Jim Meyering <jim@meyering.net>
4039 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
4040 (nl_get_alt_digit) [! defined my_strftime]: Define.
4041 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
4042 _nl_get_alt_digit and _nl_get_walt_digit.
4044 * strftime.c (my_strftime): Merge in locale-related changes from libc.
4045 These changes have no effect outside of _LIBC.
4047 2003-04-10 Bruno Haible <bruno@clisp.org>
4049 * findprog.h: New file, from GNU gettext.
4050 * findprog.c: New file, from GNU gettext.
4052 2003-04-05 Jim Meyering <jim@meyering.net>
4054 Merge changes from Coreutils.
4056 * exclude.h (PARAMS): Remove definition and uses.
4057 * exclude.c: Remove uses of `PARAMS'.
4059 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
4060 Add test-cases for DOS filenames. Declare program_name.
4061 (main): Set up program_name. Patch by Rich Dawe.
4063 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4065 Use mntctl's return value to drive the entry-processing loop, since
4066 we can't rely on the value of the vmt_length member in the last
4067 entry. On some systems doing so could result in exhausting
4068 virtual memory. Based in part on a patch from Mike Jetzer.
4070 2003-04-04 Bruno Haible <bruno@clisp.org>
4072 * linebreak.h: New file, from GNU gettext.
4073 * linebreak.c: New file, from GNU gettext with slight modifications.
4074 * lbrkprop.h: New file, from GNU gettext.
4076 2003-04-03 Bruno Haible <bruno@clisp.org>
4078 * utf8-ucs4.h: New file, from GNU gettext.
4079 * utf16-ucs4.h: New file, from GNU gettext.
4080 * ucs4-utf8.h: New file, from GNU gettext.
4081 * ucs4-utf16.h: New file, from GNU gettext.
4083 2003-04-02 Bruno Haible <bruno@clisp.org>
4085 * binary-io.h: New file, from GNU gettext.
4087 2003-04-01 Bruno Haible <bruno@clisp.org>
4089 * pathname.h: New file, from GNU gettext.
4090 * concatpath.c: New file, from GNU gettext.
4092 2003-03-30 Bruno Haible <bruno@clisp.org>
4094 * copy-file.c (copy_file_preserving): Don't set owner if the function
4095 chown() doesn't exist.
4097 2003-03-28 Bruno Haible <bruno@clisp.org>
4099 * copy-file.h: New file, from GNU gettext.
4100 * copy-file.c: New file, from GNU gettext.
4102 2003-03-18 Jim Meyering <jim@meyering.net>
4104 * quote.c (quote_n): Fix typo in comment.
4106 2003-03-14 Jim Meyering <jim@meyering.net>
4108 Merge changes from Coreutils.
4109 * obstack.h (obstack_object_size): Declare temporary, __o,
4110 to be const, in order to avoid warnings.
4111 (obstack_room): Likewise.
4112 (obstack_empty_p): Likewise.
4114 2003-03-13 Paul Eggert <eggert@twinsun.com>
4116 Merge changes from Bison.
4117 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
4118 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
4119 when compiling Bison 1.875's `bitset bset = obstack_alloc
4120 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
4121 * hash.c: Include <stdbool.h> unconditionally.
4123 2003-03-09 Paul Eggert <eggert@twinsun.com>
4125 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
4126 Reported by Bruce Becker; see:
4127 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
4129 2003-03-03 Paul Eggert <eggert@twinsun.com>
4130 Bruno Haible <bruno@clisp.org>
4132 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
4133 Reported by John Hughes, see
4134 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
4136 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
4138 * poll_.h: New file.
4141 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
4143 * mathl.h: New file.
4144 * acosl.c: New file.
4145 * asinl.c: New file.
4146 * atanl.c: New file.
4147 * ceill.c: New file.
4150 * floorl.c: New file.
4151 * frexpl.c: New file.
4152 * ldexpl.c: New file.
4154 * sincosl.c: New file.
4156 * sqrtl.c: New file.
4158 * trigl.c: New file.
4159 * trigl.h: New file.
4161 2003-02-17 Bruno Haible <bruno@clisp.org>
4163 * mkdtemp.h: New file, from GNU gettext.
4164 * mkdtemp.c: New file, from GNU gettext.
4166 2003-01-31 Bruno Haible <bruno@clisp.org>
4168 * rename.c: #undef rename before defining rpl_rename.
4169 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
4171 2003-01-30 Bruno Haible <bruno@clisp.org>
4173 * printf-args.h: New file, from GNU gettext.
4174 * printf-args.c: New file, from GNU gettext.
4175 * printf-parse.h: New file, from GNU gettext.
4176 * printf-parse.c: New file, from GNU gettext.
4177 * vasnprintf.h: New file, from GNU gettext.
4178 * vasnprintf.c: New file, from GNU gettext.
4179 * asnprintf.c: New file, from GNU gettext.
4180 * vasprintf.h: New file, from GNU gettext with modifications.
4181 * vasprintf.c: New file, from GNU gettext.
4182 * asprintf.c: New file, from GNU gettext.
4184 2003-01-29 Bruno Haible <bruno@clisp.org>
4186 * stpncpy.h: New file, from GNU gettext with modifications.
4187 * stpncpy.c: New file, from GNU gettext with modifications.
4189 2003-01-28 Bruno Haible <bruno@clisp.org>
4191 * c-ctype.h: New file, from GNU gettext, with changes suggested by
4193 * c-ctype.c: New file, from GNU gettext, with changes suggested by
4196 2003-01-27 Bruno Haible <bruno@clisp.org>
4198 * xsetenv.h: New file, from GNU gettext.
4199 * xsetenv.c: New file, from GNU gettext.
4201 2003-01-23 Bruno Haible <bruno@clisp.org>
4203 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
4205 2003-01-22 Bruno Haible <bruno@clisp.org>
4207 * exit.h: New file, from GNU gettext.
4209 2003-01-11 Bruno Haible <bruno@clisp.org>
4211 * stpcpy.h (stpcpy): Use ANSI C function declarations.
4212 * strcase.h (strcasecmp, strncasecmp): Likewise.
4214 2003-01-14 Jim Meyering <jim@meyering.net>
4216 * same.c (same_name): Tweak a comment.
4218 2003-01-11 Bruno Haible <bruno@clisp.org>
4220 * same.c (same_name): Reorder tests so as to avoid calling stat()
4221 when a string comparison is sufficient.
4223 2003-01-11 Bruno Haible <bruno@clisp.org>
4225 * readtokens.c (readtoken): Cast character to 'unsigned char', not
4228 2003-01-11 Bruno Haible <bruno@clisp.org>
4230 * hash-pjw.c: Add comment about low quality of this function.
4232 2003-01-12 Paul Eggert <eggert@twinsun.com>
4234 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
4235 to avoid collisions with libcurses and libreadline.
4237 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
4238 * getstr.h, getstr.c: Remove.
4239 * getline.c: Include "getline.h", to check interface.
4240 Move body of old getstr.c here: this defines MIN_CHUNK and
4241 declares getdelim2, which is renamed from getstr.
4242 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
4244 * linebuffer.c (readlinebuffer): Renamed from readline.
4246 * linebuffer.h: Likewise.
4247 (readline): Remove backward-compatibility macro.
4249 2003-01-12 Jim Meyering <jim@meyering.net>
4251 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
4253 2003-01-10 Bruno Haible <bruno@clisp.org>
4255 * alloca_.h: New file.
4256 * getdate.y: Unconditionally include alloca.h.
4257 * makepath.c: Likewise.
4258 * setenv.c: Likewise.
4259 * userspec.c: Likewise.
4261 2003-01-09 Bruno Haible <bruno@clisp.org>
4263 * stdbool.h.in: New file.
4265 2003-01-08 Bruno Haible <bruno@clisp.org>
4267 * safe-read.c: Include specification header first, to ensure its
4269 * full-write.c: Likewise.
4271 2003-01-08 Jim Meyering <jim@meyering.net>
4273 * full-write.c: Undefine and define-away `const' after inclusion
4274 of errno.h, not before. Suggestion from Bruno Haible.
4276 2003-01-07 Jim Meyering <jim@meyering.net>
4278 * full-write.c: Rework so that it may serve to define full_read, too.
4279 * full-read.c: Simply #define FULL_READ and include full-write.c.
4281 2003-01-06 Jim Meyering <jim@meyering.net>
4283 * version-etc.c: Update year in translatable copyright string.
4285 2002-12-25 Bruno Haible <bruno@clisp.org>
4287 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
4288 * xstrtol.h: Likewise.
4289 * xstrtoimax.c: Likewise.
4290 * xstrtoumax.c: Likewise.
4291 * human.h: Likewise.
4293 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
4294 on systems that have <inttypes.h> but not <stdint.h>.
4296 2002-12-31 Paul Eggert <eggert@twinsun.com>
4298 * memcoll.c (memcoll): Fall back on a simple algorithm using
4299 memcmp if strcoll doesn't work.
4301 2002-12-23 Bruno Haible <bruno@clisp.org>
4303 * localcharset.h: New file.
4304 * localcharset.c: Include it.
4305 * unicodeio.c: Likewise.
4307 2002-12-22 Bruno Haible <bruno@clisp.org>
4309 * utime.c (utime_null): No need to call ftruncate if the file was
4312 2002-12-23 Bruno Haible <bruno@clisp.org>
4314 * memcoll.c (STRCOLL): New macro.
4317 2002-12-22 Bruno Haible <bruno@clisp.org>
4319 * getstr.h (getstr): Define, to avoid clash with libcurses.
4320 * linebuffer.h (readline): Define, to avoid clash with libreadline.
4322 2002-12-22 Bruno Haible <bruno@clisp.org>
4324 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
4326 2002-12-23 Bruno Haible <bruno@clisp.org>
4328 * getline.h: Include <stddef.h>, for size_t.
4330 * unicodeio.h: Include <stddef.h>, for size_t.
4331 * unicodeio.c: Don't include <stddef.h>.
4333 2002-12-17 Bruno Haible <bruno@clisp.org>
4335 * canon-host.c (strdup): Remove unused declaration.
4337 * fsusage.c: Include full_read.h.
4338 (get_fs_usage): Use full_read instead of safe_read.
4340 * utime.c (utime_null): Use SAFE_READ_ERROR.
4342 2002-12-11 Bruno Haible <bruno@clisp.org>
4344 * setenv.h: Rewritten to cope with systems that have setenv() but not
4346 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
4349 2002-12-11 Bruno Haible <bruno@clisp.org>
4351 * setenv.c (alloca): Fall back to malloc.
4353 (setenv): Use freea() to free memory allocated with alloca().
4355 2002-11-13 Bruno Haible <bruno@clisp.org>
4357 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
4358 function declarations.
4359 * unsetenv.c (unsetenv): Likewise.
4361 2002-03-04 Bruno Haible <bruno@clisp.org>
4363 Portability to AIX 4.3.3.
4364 * unsetenv.c: New file, extracted from setenv.c.
4365 * setenv.c: Move the unsetenv() function to unsetenv.c.
4367 2001-12-20 Bruno Haible <bruno@clisp.org>
4369 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
4370 use malloc instead. For SunOS 4.
4372 2001-12-11 Bruno Haible <bruno@clisp.org>
4374 * setenv.c: Declare alloca.
4375 (compar_fn_t): New typedef.
4376 (KNOWN_VALUE, STORE_VALUE): Use it.
4378 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
4381 2002-12-10 Paul Eggert <eggert@twinsun.com>
4383 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
4384 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
4385 Choose values that are less likely to collide with system fnmatch
4387 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
4388 defined (e.g., a pure POSIX system).
4389 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
4390 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
4392 2002-12-06 Jim Meyering <jim@meyering.net>
4394 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
4396 Merge in changes from libc's misc/error.c, in preparation
4397 for the merge of gnulib's changes back into libc.
4399 * error.c (_): Define only if not already defined.
4400 Move definition to follow all #include directives.
4401 Include unlocked-io.h only if !_LIBC.
4402 [_LIBC]: Include <libio/libioP.h>.
4403 [USE_IN_LIBIO]: Include <libio/iolibio.h>
4404 (fflush): Tweak definition to use INTUSE.
4407 2002-12-05 Paul Eggert <eggert@twinsun.com>
4409 * alloca.c [defined emacs]: Include "lisp.h".
4410 (xalloc_die) [defined emacs]: New macro.
4411 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
4412 [! defined emacs]: Include <xalloc.h>.
4413 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
4414 (pointer): Typedef to POINTER_TYPE *.
4415 (malloc): Remove decl; we now always use xmalloc.
4416 (alloca): Use old-style definition, since Emacs needs this.
4417 Check for arithmetic overflow when computing combined size.
4419 2002-12-04 Paul Eggert <eggert@twinsun.com>
4421 Do not generate unlocked-io.h automatically, since it's easier to
4422 maintain it by hand.
4424 * unlocked-io.h: New file, from GNU diffutils,
4425 but with proper copyright notice and attribution.
4427 * Makefile.am: Add copyright notice.
4428 (libfetish_a_SOURCES): Add unlocked-io.h.
4429 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
4430 (DISTCLEANFILES, io_functions): Remove macros.
4431 (EXTRA_DIST): Remove gen_uio.
4432 (unlocked-io.h): Remove rule.
4434 2002-12-04 Jim Meyering <jim@meyering.net>
4436 Reflect the fact that stat.c and lstat.c are no longer generated.
4437 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
4438 (DISTCLEANFILES): Likewise.
4439 (EXTRA_DIST): Likewise.
4440 (all_local): Don't depend on stat.c or lstat.c.
4441 (stat.c, lstat.c): Remove rules.
4442 (EXTRA_DIST): Remove xstat.in.
4444 * xstat.in: Remove file. Contents moved into stat.c.
4445 * stat.c: New file. Contents mostly from xstat.in.
4446 * stat.c: Rework so that it may serve to define rpl_lstat, too.
4447 * lstat.c: New file. Simply #define LSTAT and include stat.c.
4449 * safe-read.c: Rework so that it may serve to define safe_write, too.
4450 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
4452 2002-12-03 Jim Meyering <jim@meyering.net>
4454 * safe-read.c, safe-write.c: Change variable names and comments, but
4455 not semantics, to minimize the differences between these two files.
4456 (safe_read): Change comment to mention SAFE_READ_ERROR.
4458 * safe-read.c (IS_EINTR): Define.
4459 (safe_read): Use IS_EINTR in place of in-function cpp directives.
4461 2002-12-02 Bruno Haible <bruno@clisp.org>
4463 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
4464 Define, taken from safe-read.c.
4465 (INT_MAX): Provide fallback.
4466 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
4467 * safe-write.h (SAFE_WRITE_ERROR): Define.
4469 * safe-read.c (EINTR): Remove definition.
4470 (safe_read): Don't use EINTR if it is absent.
4472 2002-12-02 Jim Meyering <jim@meyering.net>
4474 * safe-read.c (EINTR): Define.
4475 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4476 (INT_MAX): Provide fallback.
4477 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
4479 * safe-read.h (SAFE_READ_ERROR): Define.
4481 2002-12-01 Jim Meyering <jim@meyering.net>
4483 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
4484 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
4486 2002-11-27 Paul Eggert <eggert@twinsun.com>
4488 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4489 hash_rehash): Replace `if (limit <= value) abort ();' with
4490 `if (! (value < limit)) abort ();', for readability.
4492 2002-11-26 <karl@gnu.org>
4494 * strdup.c: copy from libc again, with jim's ok.
4495 * .cppi-disable: re-add strdup.c
4497 2002-11-25 <karl@gnu.org>
4499 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
4500 instead of "strtol.c".
4502 2002-11-25 Jim Meyering <jim@meyering.net>
4504 * mktime.c: Sync from libc, now that it has the latest fix.
4506 2002-11-24 <karl@gnu.org>
4508 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
4509 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
4511 2002-11-24 Jim Meyering <jim@meyering.net>
4513 Update from coreutils:
4515 * mktime.c: Merge in changes from libc.
4517 Avoid a link-time failure on some Linux systems.
4518 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
4519 (__mon_yday): Declare with the STATIC attribute.
4520 (__mktime_internal): Likewise.
4521 Based on a report from Greg Schafer.
4523 2002-11-23 Jim Meyering <jim@meyering.net>
4525 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
4526 Use `unsigned', not `int', as type of index.
4528 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
4530 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
4532 2002-11-22 Paul Eggert <eggert@twinsun.com>
4534 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
4535 hint that one should use `if (! x) abort ();' rather than `assert
4536 (x);', and anyway it's one less thing to worry about configuring.
4537 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4538 hash_rehash, hash_insert): Use abort rather than assert.
4540 2002-11-22 Paul Eggert <eggert@twinsun.com>
4542 * quotearg.h: Allow multiple inclusion by surrounding with
4543 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
4544 so that we can be included first.
4545 (PARAMS): Remove; we now assume C89 or later. All uses removed.
4546 * quotearg.c: Include quotearg.h immediately after config.h.
4547 No need to include stddef.h or sys/types.h any more.
4548 Surround local include files with "", not "<>".
4549 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
4550 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
4551 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
4552 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
4553 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
4554 (ISPRINT): Remove; no longer needed now that we assume C89.
4556 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
4559 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
4560 quotearg_char): Use SIZE_MAX rather than
4561 (size_t) -1 when we are talking about "infinity".
4563 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
4565 2002-11-22 Bruno Haible <bruno@clisp.org>
4567 * safe-read.h: Assume C89. Add comments.
4568 (safe_read): Change return type to size_t.
4569 * safe-read.c (safe_read): Change return type to size_t. Handle byte
4570 counts > SSIZE_MAX correctly.
4571 * safe-write.h: New file.
4572 * safe-write.c: New file.
4573 * full-read.h: New file.
4574 * full-read.c: New file.
4575 * full-write.h: Assume C89. Add comments.
4576 * full-write.c: Include safe-write.h.
4577 (full_write): Rewritten to use safe_write.
4578 Suggested by Jim Meyering and Paul Eggert.
4580 2002-11-21 Bruno Haible <bruno@clisp.org>
4582 Remove case insensitive option matching.
4583 * argmatch.h (argcasematch): Remove declaration.
4584 (ARGCASEMATCH): Remove macro.
4585 (__xargmatch_internal): Remove case_sensitive argument.
4586 (XARGMATCH): Update.
4587 (XARGCASEMATCH): Remove macro.
4588 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
4589 case_sensitive argument.
4590 (argcasematch): Remove function.
4591 (__xargmatch_internal): Remove case_sensitive argument.
4592 (main): Use XARGMATCH instead of XARGCASEMATCH.
4594 * xmalloc.c: Change compile-time error message. Add comment about
4595 required autoconf version.
4597 2002-11-21 Jim Meyering <jim@meyering.net>
4599 * strdup.c (strdup): Tweak comment and initial #if/#include.
4601 Merge in changes from the coreutils.
4603 2002-09-25 Paul Eggert <eggert@twinsun.com>
4604 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
4605 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
4606 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
4607 int. Work more efficiently if X is the same width as uintmax_t.
4608 Do not compare X to -1, to avoid bogus compiler warning.
4609 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
4610 Don't assume that f_frsize and f_bsize are the same type.
4612 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
4615 * makepath.c (make_path): Restore umask *before* creating the final
4617 (make_path): Minor reformatting.
4619 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
4620 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
4622 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
4623 ones. At least on GNU/Linux systems, `auto' means something else.
4626 2002-11-20 Paul Eggert <eggert@twinsun.com>
4628 Merge argmatch cleanups from Bison. Assume C89.
4630 * argmatch.c: Include config.h here, not in argmatch.h.
4631 Include stdlib.h, for EXIT_FAILURE.
4632 Always include <string.h>, since we assume C89.
4633 (EXIT_FAILURE): Remove pre-C89 bug workaround.
4634 * argmatch.h: Do not include <config.h> or <sys/types.h>.
4635 Include <stddef.h> instead, since it's all we need for size_t.
4636 (PARAMS): Remove. All uses removed.
4637 (ARRAY_CARDINALITY): Do not bother to #undef.
4638 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
4639 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4640 Remove unnecessary parentheses.
4641 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4642 Insert necessary parentheses.
4643 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
4644 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
4646 2002-11-19 Bruno Haible <bruno@clisp.org>
4648 * mbswidth.c: Include mbswidth.h right at the beginning.
4649 * mbswidth.h: Include <stddef.h>, for size_t.
4651 * mbswidth.h (PARAMS): Remove macro.
4652 (mbswidth, mbsnwidth): Use ANSI C function declarations.
4653 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
4655 * gcd.h (PARAMS): Remove macro.
4656 (gcd): Use ANSI C function declarations.
4657 * gcd.c (gcd): Likewise.
4659 2002-11-15 Bruno Haible <bruno@clisp.org>
4661 * strcspn.c: Include <stddef.h>.
4662 (strcspn): Use ANSI C function declaration. Change return type to
4664 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
4665 (strpbrk): Use NULL.
4666 * strpbrk.h (PARAMS): Remove macro.
4667 (strpbrk): Use ANSI C function declaration.
4668 * strstr.c: Don't include <sys/types.h>.
4669 * strstr.h (PARAMS): Remove macro.
4670 (strstr): Use ANSI C function declarations.
4672 2002-11-06 Bruno Haible <bruno@clisp.org>
4674 * gcd.h (gcd): Change argument type to 'unsigned long'.
4675 * gcd.c (gcd): Likewise.
4677 2002-11-05 Bruno Haible <bruno@clisp.org>
4679 * gcd.h: New file, from gettext-0.11.5.
4680 * gcd.c: New file, from gettext-0.11.5.
4682 2002-11-05 Bruno Haible <bruno@clisp.org>
4684 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4685 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4686 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4687 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4689 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4690 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4692 * closeout.c: Include gettext.h instead of <libintl.h>.
4693 * human.c: Include gettext.h instead of <libintl.h>.
4694 * quotearg.c: Include gettext.h instead of <libintl.h>.
4695 * rpmatch.c: Include gettext.h instead of <libintl.h>.
4696 * unicodeio.c: Include gettext.h instead of <libintl.h>.
4697 * userspec.c: Include gettext.h instead of <libintl.h>.
4698 * version-etc.c: Include gettext.h instead of <libintl.h>.
4699 * xmalloc.c: Include gettext.h instead of <libintl.h>.
4700 (textdomain): Remove definition.
4701 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
4703 * long-options.c: Remove include of <libintl.h> and definition of _.
4704 * same.c: Remove include of <libintl.h> and definition of _.
4706 2002-11-04 Bruno Haible <bruno@clisp.org>
4708 * stpcpy.h: New file, from GNU gettext-0.11.5.
4709 * strcase.h: New file, from GNU gettext-0.11.5.
4710 * strpbrk.h: New file, from GNU gettext-0.11.5.
4711 * strstr.h: New file, from GNU gettext-0.11.5.
4712 * xgetcwd.h: New file, from GNU gettext-0.11.5.
4714 2002-05-09 Bruno Haible <bruno@clisp.org>
4716 * config.charset: Update for newest glibc. Add canonical names
4717 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
4719 2002-05-09 Bruno Haible <bruno@clisp.org>
4721 * localcharset.c (get_charset_aliases): Add more Windows specific
4724 2002-05-08 Owen Taylor <otaylor@redhat.com>
4726 * config.charset: A few additions for Solaris.
4728 2001-12-05 Bruno Haible <bruno@clisp.org>
4730 * localcharset.c (locale_charset): Don't return an empty string.
4732 2001-10-23 Bruno Haible <haible@clisp.cons.org>
4734 * config.charset: msdos in uk_UA uses CP1125.
4736 2001-08-05 Bruno Haible <haible@clisp.cons.org>
4738 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
4739 * localcharset.c (locale_charset): Declare as extern "C".
4741 2002-02-15 Bruno Haible <bruno@clisp.org>
4743 * config.charset [msdosdjgpp]: For Russian, use CP866.
4745 2002-02-11 Bruno Haible <bruno@clisp.org>
4747 * config.charset: Add support for NetBSD.
4749 2002-09-25 <karl@gnu.org>
4751 * strdup.c: copy from libc/string (via ../config/srclist*).
4752 * getopt*: copy from libc/posix.
4753 * gettext.h: copy from gettext.
4754 * .cppi-disable: add strdup.c, gettext.h.
4756 2002-07-01 Jim Meyering <meyering@lucent.com>
4758 * c-stack.c: Include sys/time.h.
4759 From Volker Borchert.
4761 2002-06-11 Paul Eggert <eggert@twinsun.com>
4763 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
4764 New macro. Use it uniformly instead of
4765 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
4766 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
4767 reported by Vin Shelton.
4769 2002-06-22 Jim Meyering <meyering@lucent.com>
4771 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
4772 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
4774 2002-06-22 Paul Eggert <eggert@twinsun.com>
4776 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
4777 Do not assume SA_SIGINFO behavior.
4778 Bug reported by Jim Meyering on NetBSD 1.5.2.
4780 2002-06-22 Jim Meyering <meyering@lucent.com>
4782 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
4784 * exitfail.c, exitfail.h: Likewise.
4785 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
4787 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
4789 (EXTRA_DIST): Add fnmatch_loop.c.
4790 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
4792 * fnmatch_loop.c: New file, from diffutils-2.8.2.
4793 * fnmatch.c: Update from diffutils-2.8.2.
4794 * fnmatch_.h: New file. From diffutils-2.8.2.
4795 * fnmatch.h: Remove file.
4797 2002-06-18 Paul Eggert <eggert@twinsun.com>
4799 * file-type.h: Report an error if neither S_ISREG nor
4800 S_IFREG is defined, instead of using a test specific to glibc
4801 2.2. This should be safe, since POSIX requires S_ISREG and
4802 Unix Version 7 had S_IFREG. We don't need to check for
4803 <sys/types.h> since we don't use any symbols that it defines.
4805 2002-06-15 Jim Meyering <meyering@lucent.com>
4807 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
4808 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
4809 have been included before this file.
4811 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
4813 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
4814 so that each temporary file name is unique and valid in the first
4815 8 characters, for operation under DOS.
4817 2002-06-15 Jim Meyering <meyering@lucent.com>
4819 Work even with DJGPP 2.03, which lacks support for symlinks.
4821 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
4823 * lchown.c (S_ISLNK): Likewise.
4825 2002-06-14 Jim Meyering <meyering@lucent.com>
4827 * file-type.h: Use the version from diffutils-2.8.2.
4828 * file-type.c: Likewise.
4830 2002-05-27 Jim Meyering <meyering@lucent.com>
4832 Fix a problem seen only on nonconforming systems whereby ls.c's
4833 use of localtime, and then of gettimeofday would cause trouble:
4834 the localtime call used to initialize rpl_gettimeofday's save
4835 mechanism would clobber ls's current local time information so
4836 that in any long listing the first file would always be listed
4837 with date 1970-01-01. Analysis by Volker Borchert.
4839 * gettimeofday.c (localtime): Undefine.
4840 (rpl_localtime): New function.
4842 2002-05-22 Jim Meyering <meyering@lucent.com>
4844 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
4845 * file-type.h: New file.
4846 * file-type.c (file_type): New file/function. Extracted from diffutils.
4848 2002-04-29 Paul Eggert <eggert@twinsun.com>
4850 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
4852 2002-04-28 Paul Eggert <eggert@twinsun.com>
4854 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
4855 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
4856 of 127, since 64 is the largest conceivable number for ancient
4858 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
4860 2002-04-28 Jim Meyering <meyering@lucent.com>
4862 * sig2str.c (WTERMSIG): Remove definition (unused).
4864 2002-04-28 Paul Eggert <eggert@twinsun.com>
4866 * sig2str.h, sig2str.c: New files.
4867 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
4869 2002-04-24 Jim Meyering <meyering@lucent.com>
4871 * gettext.h: New file, from Gettext.
4872 * Makefile.am (INCLUDES): Remove -I../intl.
4873 (libfetish_a_SOURCES): Add gettext.h.
4875 2002-04-16 Jim Meyering <meyering@lucent.com>
4877 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
4878 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
4879 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
4881 2002-04-12 Jim Meyering <meyering@lucent.com>
4883 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
4885 2002-03-10 Jim Meyering <meyering@lucent.com>
4887 * makepath.c (make_path): Remove a comma from a diagnostic.
4888 Suggestion from Santiago Vila.
4890 2002-03-08 Jim Meyering <meyering@lucent.com>
4892 * rename.c: Mention that this wrapper is needed also on
4893 mips-dec-ultrix4.4 systems.
4895 2002-03-02 Jim Meyering <meyering@lucent.com>
4897 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
4898 not HAVE_CLOCK_SETTIME.
4900 2002-02-27 Paul Eggert <eggert@twinsun.com>
4902 * nanosleep.h: Rename to....
4903 * timespec.h: New name for nanosleep.h. All uses changed.
4905 * gettime.c: New file.
4906 * settime.c: New file.
4909 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
4910 timespec.h. Remove nanosleep.h.
4912 2002-02-25 Paul Eggert <eggert@twinsun.com>
4914 * acl.c, acl.h: New files.
4915 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
4917 2002-02-24 Jim Meyering <meyering@lucent.com>
4919 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
4920 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
4921 cause trouble. Reported by Nelson Beebe.
4923 2002-02-23 Paul Eggert <eggert@twinsun.com>
4925 * path-concat.c (xpath_concat): Reorder code to pacify
4926 compilers that don't know that xalloc_die never returns.
4928 2002-02-20 Jim Meyering <meyering@lucent.com>
4930 * getdate.c: Regenerate using bison-1.33.
4932 2002-02-15 Paul Eggert <eggert@twinsun.com>
4934 * posixver.c, posixver.h: New files.
4935 * Makefile.am (libfetish_a_SOURCES): Add them.
4937 2002-02-02 Paul Eggert <eggert@twinsun.com>
4938 Bruno Haible <bruno@clisp.org>
4940 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
4941 (fwrite_success_callback): New declaration.
4942 * unicodeio.c (unicode_to_mb): New function, extracted from
4943 print_unicode_char. Call failure callback instead of error.
4944 (fwrite_success_callback): New function.
4945 (exit_failure_callback): New function.
4946 (fallback_failure_callback): New function.
4947 (print_unicode_char): Call unicode_to_mb.
4949 2002-01-26 Jim Meyering <meyering@lucent.com>
4951 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
4953 2002-01-22 Jim Meyering <meyering@lucent.com>
4955 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
4956 Otherwise, some versions of automake would omit the rule that makes
4957 Makefile from Makefile.in.
4959 2001-01-21 Paul Eggert <eggert@twinsun.com>
4961 * xmemcoll.h, xmemcoll.c: New files.
4962 * Makefile.am (libfetish_a_SOURCES): Add them.
4963 * memcoll.c: Include errno.h, and declare errno if not defined.
4964 (memcoll): Set errno to zero if there is no error.
4966 * quotearg.c (quotearg_buffer_restyled):
4967 Fix bug with quoting buffers containing NUL when backslashing escapes.
4968 This bug was exposed by the other changes in this patch.
4969 (quotearg_n_options): New arg ARGSIZE.
4970 All callers changed.
4971 (quoting_options_from_style): New function.
4972 (quotearg_n_style): Use it.
4973 (quotearg_n_style_mem): New function.
4975 * quotearg.h (quotearg_n_style_mem): New function.
4977 2002-01-16 Jim Meyering <meyering@lucent.com>
4979 * getdate.y: Add three semicolons, each just before a closing brace.
4980 Bison (as of version 1.31) no longer papers over that mistake.
4982 2002-02-14 Paul Eggert <eggert@twinsun.com>
4984 * backupfile.c (ISDIGIT): Comment fix.
4985 * getdate.y (ISDIGIT): Likewise.
4986 * posixtm.c (ISDIGIT, year): Likewise.
4987 * strverscmp.c (ISDIGIT): Likewise.
4988 * userspec.c (ISDIGIT): Likewise.
4990 2002-01-05 Jim Meyering <meyering@lucent.com>
4992 * version-etc.c (version_etc_copyright): Update copyright year.
4994 2001-01-19 Paul Eggert <eggert@twinsun.com>
4996 * closeout.c (close_stdout_status): If ferror (stdout), do
4997 not silently exit merely because the output buffer happens to
4998 have nothing pending.
5000 2001-12-18 Paul Eggert <eggert@twinsun.com>
5002 See the big note in ../ChangeLog.
5003 * human.c (suffixes): Prefer K to k for 1024.
5004 (generate_suffix_backwards): New function.
5005 (human_readable_inexact): Use it.
5006 * xstrtol.c (__xstrtol): If there is no number but there
5007 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
5008 Accept 'K' as well as 'k'.
5010 2001-12-15 Jim Meyering <meyering@lucent.com>
5012 * regex.h (__restrict_arr): Update from libc.
5014 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
5015 as `remote' if the name starts with `//'. Suggested by Michael Stone.
5018 2001-12-10 Jim Meyering <meyering@lucent.com>
5020 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
5021 Instead, include "xalloc.h".
5022 (initbuffer): Don't cast xmalloc return value to char*.
5023 (readline): Reword comment.
5024 Don't cast xrealloc return value to char*
5027 2001-12-09 Jim Meyering <meyering@lucent.com>
5029 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
5030 `signed and unsigned type in conditional expression'.
5031 * posixtm.c (posix_time_parse): Likewise.
5033 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
5035 * readtokens.c (readtoken): Declare an index to be of type unsigned
5036 to avoid a pedantic warning.
5038 * getstr.c: Don't include assert.h.
5039 (getstr): Remove warning-evoking assertions.
5040 Return -1 if offset parameter is out of bounds.
5041 Change the type of a local from int to size_t.
5043 * strftime.c (my_strftime_localtime_r): Include this function
5044 definition in the `#if ! HAVE_TM_GMTOFF' block.
5046 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
5047 Include xalloc.h instead.
5049 2001-12-02 Jim Meyering <meyering@lucent.com>
5051 * tempname.c: Don't declare getenv, thus reverting the change of
5052 2001-11-18. It's no longer necessary, now that stdlib.h is always
5055 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
5056 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
5058 2001-11-30 Akim Demaille <akim@epita.fr>
5060 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
5061 before being defined.
5063 2001-11-27 Paul Eggert <eggert@twinsun.com>
5065 * quotearg.h (quotearg_n, quotearg_n_style):
5066 First arg is int, not unsigned.
5067 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
5068 (SIZE_MAX, UINT_MAX): New macros.
5069 (quotearg_n_options): Abort if N is negative.
5070 Avoid overflow check on hosts where size_t is 64 bits and int
5071 is 32 bits, as overflow is impossible there.
5072 Fix off-by-one typo that caused unnecessary reallocation.
5074 2001-11-27 Jim Meyering <meyering@lucent.com>
5076 * tempname.c: Merge with version from libc.
5077 * regex.c: Likewise.
5079 * tempname.c: Include stdlib.h unconditionally. On some old systems
5080 for which STDC_HEADERS is 0, it was not included, resulting in a
5081 warning about an integer-to-pointer conversion problem with getenv.
5082 Reported by Volker Borchert.
5084 2001-11-26 Jim Meyering <meyering@lucent.com>
5086 * gtod.h: Remove file.
5087 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
5088 * gettimeofday.c: Don't include gtod.h.
5089 (GTOD_init): Remove function.
5090 (rpl_gettimeofday): Do its job here instead, rather than aborting.
5091 Suggestion from Volker Borchert.
5093 2001-11-23 Jim Meyering <meyering@lucent.com>
5095 * hash.h (struct hash_table): Don't define here. Merely declare it.
5096 * hash.c (struct hash_table): Define it here instead.
5098 2001-11-22 Jim Meyering <meyering@lucent.com>
5100 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
5102 2001-11-18 Paul Eggert <eggert@twinsun.com>
5104 * tempname.c (TMP_MAX): Remove; no longer needed.
5105 (TEMPORARIES): New macro.
5106 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
5107 removes an artificial limitation (e.g. HP-UX 10.20, where
5110 2001-11-18 Jim Meyering <meyering@lucent.com>
5112 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
5115 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
5116 files will be created before anything else.
5118 2001-11-17 Jim Meyering <meyering@lucent.com>
5120 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
5121 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
5122 rather than group writable. Patch by Juan F. Codagnone.
5124 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
5125 Instead, include "xalloc.h".
5127 * mountlist.c: Include unlocked-io.h after all system headers.
5128 Remove explicit declarations of xmalloc, xrealloc,
5129 and xstrdup. Instead, include "xalloc.h".
5131 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
5132 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
5133 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
5135 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
5136 Reported by Padraig Brady.
5138 * mkstemp.c: #undef mkstemp.
5140 (rpl_mkstemp): Rename from mkstemp.
5143 2001-11-16 Jim Meyering <meyering@lucent.com>
5145 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
5146 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
5147 determine the amount of total physical memory, use pstat_getstatic.
5148 HPUX-11 doesn't define _SC_PHYS_PAGES.
5149 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
5150 If sysconf couldn't be used to determine the amount of available
5151 physical memory, use both pstat_getstatic and pstat_getdynamic.
5152 Based on a patch from Bob Proulx.
5154 2001-11-05 Jim Meyering <meyering@lucent.com>
5156 * xstat.in (slash_aware_lstat): Correct a misleading comment.
5158 2001-11-03 Jim Meyering <meyering@lucent.com>
5160 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
5161 in argmatch_to_argument call.
5163 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
5166 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
5167 e.g., a fault due to an attempt to free a NULL pointer.
5169 2001-11-01 Jim Meyering <meyering@lucent.com>
5171 * dirfd.c, dirfd.h: New files.
5172 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
5174 * hash.c (hash_print) [TESTING]: Clean up.
5176 2001-10-22 Paul Eggert <eggert@twinsun.com>
5178 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
5179 to avoid a warning if -Wall.
5181 2001-10-21 Paul Eggert <eggert@twinsun.com>
5183 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
5185 2001-10-21 Jim Meyering <meyering@lucent.com>
5187 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
5188 this code would end up calling gettext even in packages built
5190 * getopt.c (_): Likewise.
5191 * regex.c (_): Likewise.
5193 2001-10-20 Paul Eggert <eggert@twinsun.com>
5195 * error.c (strerror_r): Do not declare unless !_LIBC.
5196 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
5197 Use strerror_r that is only a macro, even if it is not a function.
5198 (strerror): Check for HAVE_DECL_STRERROR before declaring.
5199 (private_strerror): Use prototypes, not old-style function definition.
5200 (print_errno_message): New function.
5201 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
5203 (error_tail, error, error_at_line): Use it.
5205 2001-10-11 Jim Meyering <meyering@lucent.com>
5207 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
5208 and quote_n (1, ... to avoid clobbering a buffer.
5210 2001-10-05 Jim Meyering <meyering@lucent.com>
5212 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
5213 * hash-pjw.c: New file (factored out of fileutils' remove.c).
5214 * hash-pjw.h: New file.
5216 2001-09-30 Jim Meyering <meyering@lucent.com>
5218 * mountlist.c [MOUNTED_GETFSSTAT]:
5219 Include <sys/ucred.h>, for Apple Darwin.
5220 Include sys/mount.h and sys/fs_types.h only if available.
5222 (read_filesystem_list): Use FS_TYPE.
5224 2001-09-29 Paul Eggert <eggert@twinsun.com>
5226 * exclude.c (excluded_filename): 0 -> false, since it's
5229 2001-09-28 Paul Eggert <eggert@twinsun.com>
5231 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
5232 #defines strtoimax. Also treat the other strto* functions
5235 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
5236 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
5237 (strtoimax, strtoumax): Do not declare if already defined as a macro.
5239 2001-09-26 Jim Meyering <meyering@lucent.com>
5241 Most macros in unlocked-io.h had the wrong number of arguments.
5242 * gen-uio: New script.
5243 (USE_UNLOCKED_IO): Define to 1 if not already defined.
5244 * unlocked-io.hin: Remove file.
5245 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
5246 rather than trying to embed it here.
5247 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
5248 Reported by Padraig Brady.
5250 2001-09-25 Volker Borchert <bt@teknon.de>
5252 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
5254 2001-09-23 Jim Meyering <meyering@lucent.com>
5256 * mountlist.c: Remove useless parentheses in #if directives.
5257 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
5258 the deprecated MOUNTED symbol is no longer defined in mntent.h.
5260 2001-09-22 Jim Meyering <meyering@lucent.com>
5262 * localcharset.c: Update from latest gettext.
5263 * config.charset: Likewise.
5265 2001-09-20 Jim Meyering <meyering@lucent.com>
5267 * xstrtol.c (strtoimax): Guard declaration with
5268 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
5269 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
5270 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
5271 (strtoumax): Likewise, for completeness (it wasn't necessary).
5273 2001-09-06 Paul Eggert <eggert@twinsun.com>
5275 * strtoimax.c (HAVE_LONG_LONG):
5276 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
5277 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
5278 to work around bug in IBM C compiler.
5280 2001-09-16 Jim Meyering <meyering@lucent.com>
5282 * mkdir.c: New file.
5284 2001-09-04 Paul Eggert <eggert@twinsun.com>
5286 * xgetcwd.c: Revert some of the previous change; intead,
5287 fix the HAVE_GETCWD_NULL code to behave more like the
5288 !HAVE_GETCWD_NULL code used to.
5291 (xgetcwd): Do not return NULL when memory is exhausted; instead,
5294 2001-09-04 Paul Eggert <eggert@twinsun.com>
5296 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
5297 Use ssize_t, not int, to store result of readlink.
5298 Check for ssize_t overflow as well as size_t overflow,
5299 as POSIX says the result of readlink is implementation-defined
5300 when ssize_t overflows.
5301 Remove unnecessary cast to char*.
5302 Use free+malloc instead of realloc, as the storage doesn't need
5303 to be preserved and it's clearer and can be more efficient that way.
5304 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
5305 * xreadlink.h (xreadlink): Update prototype.
5307 2001-09-03 Paul Eggert <eggert@twinsun.com>
5309 * exclude.c (fnmatch_no_wildcards): Fix confusion between
5310 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
5311 spotted by Jim Meyering.
5313 2001-09-03 Jim Meyering <meyering@lucent.com>
5315 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
5317 2001-09-03 Paul Eggert <eggert@twinsun.com>
5319 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
5320 like the HAVE_GETCWD_NULL code.
5321 Include pathmax.h if not HAVE_GETCWD.
5322 Do not include xalloc.h.
5323 (INITIAL_BUFFER_SIZE): New symbol.
5324 Do not use xmalloc / xrealloc, since the caller is responsible for
5325 handling errors. Preserve errno around `free' during failure.
5326 Do not overrun buffer when using getwd.
5328 2001-09-03 Paul Eggert <eggert@twinsun.com>
5330 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
5331 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
5333 2001-09-02 Jim Meyering <meyering@lucent.com>
5335 * error.c: Update from GNU libc.
5337 2001-09-01 Jim Meyering <meyering@lucent.com>
5339 * xreadlink.c: New file.
5340 * xreadlink.h: New file.
5341 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
5343 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
5344 doesn't conflict with sparc Solaris 7's definition in
5345 /usr/include/sys/int_types.h.
5347 * exclude.c: Use `""', not `<>' to #include non-system header files.
5348 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
5349 and strncasecmp as r-values. Unixware didn't have declarations.
5351 2001-08-31 Jim Meyering <meyering@lucent.com>
5353 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
5354 Use an initial, malloc'd, buffer of length 128 rather than
5355 a statically allocated one of length 1024.
5357 2001-08-30 Paul Eggert <eggert@twinsun.com>
5359 * xgetcwd.c: Don't include pathmax.h.
5360 Include stdlib.h and unistd.h if available.
5362 (xmalloc, xstrdup, free): Remove decls.
5363 (xgetcwd): Don't assume sizes fit in unsigned.
5364 Check for overflow when computing sizes.
5365 Simplify reallocation code.
5367 2001-08-28 Paul Eggert <eggert@twinsun.com>
5369 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
5371 * strtoimax.c: Renamed from strtoxmax.c, removing the
5374 Also, make the following further changes to make this file's
5375 configuration more similar to that of strtol.c:
5376 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
5377 (strtoumax, uintmax_t, strtoull, strtol): Remove.
5378 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
5379 (strtoimax): Renamed from strtoumax. All uses of unsigned values
5380 changed to signed values.
5382 And make the following changes as well:
5383 Fix copyright notice, as 1999 was missing.
5384 (verify): New macro.
5385 (strtoimax): Check sizes at compile-time, not run-time.
5386 Prefer strtol to strtoll if both work.
5387 (main): Remove; it was not that useful and was a pain to maintain.
5389 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
5391 2001-08-30 Paul Eggert <eggert@twinsun.com>
5393 * savedir.c (savedir): Remove size parameter, as POSIX says that
5394 a directory's st_size can have an arbitrary value, so the old
5395 usage could waste an arbitrary amount of memory. All uses
5397 * savedir.h: Update prototype.
5399 2001-08-30 Paul Eggert <eggert@twinsun.com>
5401 * xstrtol.c (strtoimax): New decl.
5403 2001-08-28 Paul Eggert <eggert@twinsun.com>
5405 * xstrtol.h: Add copyright notice.
5406 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
5407 LONGINT_INVALID_SUFFIX_CHAR.
5409 2001-08-30 Paul Eggert <eggert@twinsun.com>
5411 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5414 2001-08-30 Paul Eggert <eggert@twinsun.com>
5416 * hash.c: Remove '2001' from copyright notice.
5418 2001-08-30 Paul Eggert <eggert@twinsun.com>
5420 * full-write.h: New file.
5421 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
5422 * full-write.c: Correct credits, as cccp.c no longer
5423 exists and anyway it was so heavily changed from the old cccp
5424 code as to be unrecognizable. Include full-write.h.
5425 (full_write) Return size_t, with short writes meaning failure.
5426 All callers changed. This fixes a bug with large buffers
5428 * utime.c: Include full-write.h.
5430 2001-08-30 Paul Eggert <eggert@twinsun.com>
5432 Merge 'exclude' changes from tar 1.13.22.
5433 This fixes one or two unlikely storage allocation overflow bugs,
5434 but doesn't change user-visible behavior otherwise.
5436 2001-08-30 Paul Eggert <eggert@twinsun.com>
5438 * exclude.c (bool): Declare, perhaps by including stdbool.h.
5439 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
5440 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
5441 Include if available.
5442 (<xalloc.h>): Include
5443 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
5444 (verify): New macro. Use it to verify that EXCLUDE macros do not
5445 collide with FNM macros.
5446 (struct patopts): New struct.
5447 (struct exclude): Use it, as exclude patterns now come with options.
5448 (new_exclude): Support above changes.
5449 (new_exclude, add_exclude_file):
5450 Initial size must now be a power of two to simplify overflow checking.
5451 (free_exclude, fnmatch_no_wildcards): New function.
5452 (excluded_filename): No longer requires options arg, as the options
5453 are determined by add_exclude. Now returns bool, not int.
5454 (excluded_filename, add_exclude):
5455 Add support for the fancy new exclusion options.
5456 (add_exclude, add_exclude_file): Now takes int options arg.
5457 Check for arithmetic overflow when computing sizes.
5458 (add_exclude_file): xrealloc might modify errno, so don't
5459 realloc until after errno might be used.
5461 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
5463 (free_exclude): New decl.
5464 (add_exclude, add_exclude_file): Now takes int options arg.
5465 (excluded_filename): No longer requires options arg, as the options
5466 are determined by add_exclude. Now returns bool, not int.
5468 2001-08-30 Paul Eggert <eggert@twinsun.com>
5470 * alloca.c (alloca): Arg is of type size_t, not unsigned.
5472 2001-08-27 Jim Meyering <meyering@lucent.com>
5474 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
5476 * version-etc.c (N_): Remove definition.
5477 Revert most of last change.
5478 Instead, simply don't mark the `Copyright...' string for translation.
5479 Based on advice from Paul Eggert.
5481 * strtoxmax.c: Tweak comment.
5483 2001-08-26 Jim Meyering <meyering@lucent.com>
5485 * version-etc.c (version_etc_copyright_fmt): Replace literal year
5486 of copyright with `%s' so translators don't get an untranslated
5488 (COPYRIGHT_YEAR): Define.
5489 (version_etc): Use fprintf rather than fputs.
5490 Suggestion from Ulrich Drepper.
5492 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5494 * strtoll.c: New file, from GNU libc.
5495 * xstrtoimax.c: New file.
5497 * xstrtol.h: Add xstrtoimax.
5498 * strtoumax.c: New file. Simply include "strtoumax.c".
5499 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
5501 * strtoumax.c: Factor to work both for unsigned and signed types, ...
5502 * strtoxmax.c: ... then renamed to this.
5504 2001-08-13 Paul Eggert <eggert@twinsun.com>
5506 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
5507 Port to Solaris 8, where 'sed' requires a space after the 'r'
5508 command, and where sh dislikes "$/". Clean up the spacing a bit.
5509 Redirect output to $tmp just once.
5511 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
5513 * addext.c (<errno.h>): Include.
5514 (errno): Declare if not defined.
5515 (addext): Work correctly when pathconf returns -1 and leaves
5516 errno alone because there is no limit. Also, work even if
5517 pathconf returns a value greater than SIZE_MAX.
5519 2001-08-12 Jim Meyering <meyering@lucent.com>
5521 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
5522 Simply `return getcwd (NULL, 0);'.
5523 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
5524 Use 1300 as initial value for length, not PATH_MAX.
5526 * pathmax.h: Clean up cpp syntax.
5528 2001-08-12 Jim Meyering <meyering@lucent.com>
5530 * gettimeofday.c: New file.
5532 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
5534 2001-08-04 Jim Meyering <meyering@lucent.com>
5536 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
5537 to get in sync with glibc.
5539 2001-08-03 Paul Eggert <eggert@twinsun.com>
5541 The following changes are from gettext 0.10.39 as maintained by
5544 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
5545 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
5546 with inverted sense. All uses changed.
5548 * mbswidth.c: Don't include <limits.h>.
5549 Include <stdlib.h> and <string.h> unconditionally.
5550 (iswcntrl, mbsinit, ISCNTRL): New macros.
5551 (mbsnwidth): Use K&R style function declarations.
5552 Don't bother checking for MB_LEN_MAX == 1, since the compiler
5553 can optimize it when MB_CUR_MAX == 1.
5554 The width of control characters is zero, not 1.
5556 2001-07-15 Jim Meyering <meyering@lucent.com>
5558 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
5559 (BUILT_SOURCES): Add unlocked-io.h.
5560 (io_functions): Define.
5561 (unlocked-io.h): New rule.
5562 (DISTCLEANFILES): Add unlocked-io.h.
5563 (all-local): Depend on unlocked-io.h, to ensure it is created.
5565 * unlocked-io.hin: New file
5567 * regex.c: Update from glibc.
5569 2001-07-05 Jim Meyering <meyering@lucent.com>
5571 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
5573 (libfetish_a_SOURCES): Put all .h files here instead.
5574 Remove a thus-exposed (better checks in automake) duplicate and
5575 two unnecessary .h files.
5577 2001-06-11 Jim Meyering <meyering@lucent.com>
5579 * regex.c: Update from GNU libc.
5581 2001-05-27 Jim Meyering <meyering@lucent.com>
5583 * readutmp.h (UT_TYPE): Define.
5585 2001-05-24 Jim Meyering <meyering@lucent.com>
5587 * argmatch.c: Include "quote.h".
5588 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
5589 quote function. Reported by Göran Uddeborg.
5591 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
5593 * dirname.c (dir_name): Compute append_dot using path, not newpath
5594 which is not yet declared.
5596 2001-05-11 Paul Eggert <eggert@twinsun.com>
5598 * Makefile.am (libfetish_a_SOURCES):
5599 Add strftime.c, since we now compile it on all hosts.
5601 * strftime.c (my_strftime):
5602 Define to nstrftime if emacs, but only if my_strftime is not defined.
5603 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
5604 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
5605 Add one more extra argument: a nanoseconds value.
5608 (my_strftime function): Add %N format.
5609 (emacs_strftimeu): Renamed from emacs_strftime,
5610 with extra ut argument.
5612 2001-05-11 Paul Eggert <eggert@twinsun.com>
5614 dirname code cleanup. base_name now behaves more compatibly
5615 with POSIX basename when given file names that have trailing
5616 slashes, and similarly for dir_name. Add new primitives
5617 base_len and dir_len. Put the directory-name-related decls
5620 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
5621 * backupfile.c (base_name): Likewise.
5622 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
5623 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
5624 * makepath.c (strip_trailing_slashes): Likewise.
5625 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
5627 * rename.c (strip_trailing_slashes): Likewise.
5628 * same.c (base_name): Likewise.
5629 * stripslash.c (ISSLASH): Likewise.
5631 * addext.c: Include <dirname.h> after size_t is defined.
5632 * backupfile.c: Likewise.
5634 * addext.c (addext): Use base_len to trim redundant
5635 trailing slashes instead of doing it ourselves.
5636 But do not trim the last slash if it is not redundant.
5638 * backupfile.c (find_backup_file_name,
5639 max_backup_version): Use base_len instead of rolling it ourselves.
5640 Handle the case of "" and (on DOS) "C:" correctly.
5642 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
5643 Include <string.h>, <dirname.h>.
5644 (base_name): Allow file names ending in slashes, other than names
5645 that are all slashes. In this case, return the basename followed
5646 by the slashes. This is more general, and can be used in places
5647 where the original base_name purposely had an assertion failure.
5648 (base_len): New function.
5650 * dirname.c: Include <string.h> instead of <stdlib.h>.
5651 Do not include <assert.h>; no longer needed.
5653 (memrchr): Remove decl.
5654 (dir_name_r): Remove.
5655 (dir_len): Renamed from dirlen. All callers changed.
5656 Rewrite in terms of base_name, for simplicity and consistency.
5657 (dir_name): Never return NULL. All callers changed.
5658 Do not include <stdlib.h> in test program; no longer needed.
5659 return 0; is fine for test program.
5661 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
5663 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
5665 * path-concat.c (path_concat): Use base_len to compute
5666 base length, not strlen; this means we cannot rely on memcpy
5669 * same.c (STREQ): Remove.
5670 (same_name): Handle the case where the basename ends in trailing '/'.
5672 * stripslash.c (strip_trailing_slashes): Return nonzero if
5673 a slash was stripped. Do not strip the last slash after a
5676 2001-04-08 Jim Meyering <meyering@lucent.com>
5678 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
5679 recomputed; that's necessary when the offset spans a DST transition.
5680 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
5682 2001-04-02 Jim Meyering <meyering@lucent.com>
5684 * regex.h, regex.c: Update from GNU libc.
5686 2001-03-19 Paul Eggert <eggert@twinsun.com>
5688 * version-etc.c (version_etc_copyright): Update to 2001.
5690 2001-03-16 Paul Eggert <eggert@twinsun.com>
5692 * tempname.c (uint64_t): Define to uintmax_t if
5693 not defined, and if UINT64_MAX is not defined.
5694 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5695 Reported by John David Anglin.
5697 2001-03-10 Bruno Haible <haible@clisp.cons.org>
5699 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5700 alias if codeset is empty.
5701 * config.charset (BeOS): Use wildcard syntax.
5703 2001-03-13 Jim Meyering <meyering@lucent.com>
5705 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5706 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5709 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5711 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5713 * unicodeio.c (print_unicode_char): Simplify accordingly.
5715 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5717 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5718 support for DOS/DJGPP.
5720 2001-02-28 Paul Eggert <eggert@twinsun.com>
5722 * Makefile.am (libfetish_a_SOURCES):
5723 Add dup-safer.c, fopen-safer.c.
5724 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5726 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5728 2001-02-25 Paul Eggert <eggert@twinsun.com>
5730 The mkstemp replacement is taken from glibc 2.2.2, with some
5731 portability fixes for use outside glibc, as follows:
5733 * tempname.c (struct_stat64): New macro.
5734 (direxists, __gen_tempname): Use it.
5735 This avoids a portability problem with Solaris 8.
5737 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5738 (<stddef.h>, <stdint.h>, <string.h>):
5739 Include only if STDC_HEADERS || _LIBC.
5740 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5741 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5742 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5743 (__set_errno): Define this macro if <errno.h> doesn't.
5744 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
5745 Define these macros if <stdio.h> doesn't.
5746 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
5747 Define these macros if <sys/stat.h>
5748 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
5749 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
5750 __xstat64): Define if not _LIBC.
5751 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
5752 (__gen_tempname): Invoke gettimeofday only if
5753 HAVE_GETTIMEOFDAY || _LIBC;
5754 otherwise, fall back on plain "time".
5755 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
5757 * mkstemp.c (__GT_FILE): Define to zero if not defined.
5759 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
5761 2001-02-17 Jim Meyering <meyering@lucent.com>
5763 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
5764 around included file name.
5766 * strnlen.c (__strnlen): Merge in a change from GNU libc.
5768 * strftime.c: Update from GNU libc (the only changes were to comments).
5770 2001-02-13 Bruno Haible <haible@clisp.cons.org>
5772 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
5774 2001-02-17 Paul Eggert <eggert@twinsun.com>
5776 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
5777 Remove workaround macros for hosts that have mbrtowc but not
5778 mbstate_t, as we now insist on proper declarations for both
5779 before using mbrtowc.
5781 2001-02-17 Jim Meyering <meyering@lucent.com>
5783 * regex.c: Update from libc.
5785 2001-02-16 Paul Eggert <eggert@twinsun.com>
5787 * alloca.c (malloc): Undef before defining, since stdlib.h
5788 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
5789 Reported by Mark Hounschell via Paul Eggert.
5791 2001-01-30 Bruno Haible <haible@clisp.cons.org>
5793 * config.charset: Update for FreeBSD 4.2.
5795 2001-01-26 Jim Meyering <meyering@lucent.com>
5797 * quotearg.c: Include stddef.h.
5798 * quote.c: Include stddef.h.
5799 Reported by Axel Kittenberger.
5801 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
5802 line in double quotes so that it evokes a better diagnostic.
5803 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
5804 Reported by Axel Kittenberger.
5806 2001-01-15 Bruno Haible <haible@clisp.cons.org>
5808 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
5809 to avoid a warning. Add back 'const' to inptr.
5811 2001-01-16 Jim Meyering <meyering@lucent.com>
5813 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
5816 2001-01-14 Jim Meyering <meyering@lucent.com>
5818 * rename.c: New file. From Volker Borchert.
5819 Include stdlib.h, string.h or strings.h, and xalloc.h.
5820 Use strip_trailing_slashes rather than open-coding it.
5822 2001-01-03 Paul Eggert <eggert@twinsun.com>
5824 * strftime.c: Sync with glibc time/strftime.c 1.81.
5826 2001-01-03 Jim Meyering <meyering@lucent.com>
5828 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
5829 local `inptr' to avoid warning with some system declarations of iconv.
5831 2000-12-29 Paul Eggert <eggert@twinsun.com>
5833 * modechange.c: Do not assume that mode_t uses the
5834 traditional octal encoding. E.g. "chmod 1 FOO" should set
5835 the other-execute bit of FOO even if S_IXOTH != 1.
5837 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
5838 WOTH, XOTH, ALLM): New macros.
5839 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
5840 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
5842 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
5843 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
5845 No need to use uintmax_t; unsigned long is long enough.
5846 Don't bother to get suffix since we don't use it.
5848 2000-12-24 Jim Meyering <meyering@lucent.com>
5850 * hash.c (is_prime): Return explicit boolean values.
5851 (hash_get_first): Return NULL to appease Irix5.6's 89.
5852 Reported by Nelson Beebe.
5854 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5856 * localcharset.c (locale_charset): Add support for Win32.
5858 2000-12-18 Paul Eggert <eggert@twinsun.com>
5860 * physmem.h, physmem.c: New files.
5862 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
5863 (noinst_HEADERS): Add physmem.h.
5865 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
5866 't' for compatibility with Solaris 8 sort.
5868 2000-12-18 Bruno Haible <haible@clisp.cons.org>
5870 * config.charset: Add support for BeOS.
5872 2000-12-16 Jim Meyering <meyering@lucent.com>
5874 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
5875 SHELLS_FILE to a file name that's useful on djgpp systems.
5877 (ADDITIONAL_DEFAULT_SHELLS): Define.
5878 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
5879 Based mostly on a patch from Prashant TR.
5881 2000-12-16 Jim Meyering <meyering@lucent.com>
5883 This bug had a serious impact on chown: `chown N:M FILE' (for integer
5884 N and M) would have treated it like `chown N:N FILE'.
5886 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
5888 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5890 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
5891 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
5892 to the list of canonical encodings. Rename EUC-CN to GB2312.
5894 2000-12-08 Andreas Schwab <schwab@suse.de>
5896 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
5897 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
5899 2000-12-07 Jim Meyering <meyering@lucent.com>
5901 * stripslash.c (ISSLASH): Define.
5902 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
5905 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
5906 (dir_name_r): Declare this function as static.
5907 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
5908 manifest itself on a name containing a mix of slashes and
5910 Make this function work with names starting with a DOS-style
5911 drive letter and colon prefix.
5912 (dir_name): Append `.' if necessary.
5913 Based mostly on patches from Prashant TR and Eli Zaretskii.
5915 * dirname.h (dir_name_r): Remove prototype.
5917 2000-12-05 Jim Meyering <meyering@lucent.com>
5919 * dirname.c (dir_name_r): Add `const' in a few local declarations.
5921 2000-12-04 Jim Meyering <meyering@lucent.com>
5923 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
5924 Also include memory.h, stdlib.h, unistd.h if appropriate.
5925 Reported by Andreas Jaeger (conflicting declaration of malloc).
5927 2000-12-02 Jim Meyering <meyering@lucent.com>
5929 * closeout.h: Make idempotent, to avoid some obscure warnings.
5931 2000-12-01 Paul Eggert <eggert@twinsun.com>
5933 * memrchr.c: Include <config.h> before any system include file.
5935 2000-11-29 Paul Eggert <eggert@twinsun.com>
5937 * dirname.c (dir_name_r): Fix typo: int -> size_t.
5939 2000-11-26 Jim Meyering <meyering@lucent.com>
5941 * memcoll.c: Include sys/types.h. From Werner Almesberger.
5943 2000-11-22 Paul Eggert <eggert@twinsun.com>
5945 * strftime.c (my_strftime): Do not invoke mbrlen with a
5946 size of (size_t) -1; it's not portable.
5948 2000-11-17 Akim Demaille <akim@epita.fr>
5950 * obstack.h: Formatting changes.
5951 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
5952 prevent type checking.
5953 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
5954 cast the value to (void *): assigning a `foo *' to a `void *'
5956 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
5958 2000-11-17 Jim Meyering <meyering@lucent.com>
5960 * strstr.c: Update from GNU libc.
5962 2000-11-16 Jim Meyering <meyering@lucent.com>
5964 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
5966 2000-11-11 Jim Meyering <meyering@lucent.com>
5968 * error.c: Add a couple #includes, merging from GNU libc version.
5970 2000-11-10 Jim Meyering <meyering@lucent.com>
5972 * obstack.h: Update from GNU libc.
5973 * obstack.c: Likewise.
5975 2000-11-06 Paul Eggert <eggert@twinsun.com>
5977 * getusershell.c (setusershell): Use rewind rather than
5978 fseek/fseeko, to avoid configuration hassles with fseeko.
5979 Don't bother opening SHELLS_FILE if shellstream is NULL;
5982 2000-11-05 Jim Meyering <meyering@lucent.com>
5984 * makepath.h (make_dir): Declare.
5985 * makepath.c (make_dir): Remove `static' attribute.
5988 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
5990 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
5991 last one in a bucket, advance to the next bucket.
5993 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
5995 * fnmatch.c: Do not comment out all the code if we are using
5996 the GNU C library, because in some cases we are replacing buggy
5997 code in the GNU C library itself.
5999 2000-10-30 Paul Eggert <eggert@twinsun.com>
6001 * error.h, getline.h, modechange.h:
6002 Remove "2000" from Copyright line, as the file hasn't been
6003 changed this year other than in the copyright notice.
6005 * xalloc.h: Add "2000" to Copyright line, as this file
6006 was changed this year.
6008 2000-10-30 Paul Eggert <eggert@twinsun.com>
6010 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
6011 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
6012 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
6014 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
6016 * regex.h (__restrict_arr): Move definition out of #ifndef block.
6017 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
6018 doesn't define __restrict_arr.
6020 2000-10-29 Jim Meyering <meyering@lucent.com>
6022 * xstat.in: Fix grammar in comment.
6024 2000-10-28 Jim Meyering <meyering@lucent.com>
6026 * memchr.c: Update from libc.
6027 Adjust for portability:
6028 [HAVE_STDLIB_H]: Include stdlib.h.
6029 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
6030 Undef __memchr, too.
6031 [!weak_alias]: Define __memchr to memchr.
6033 * regex.c: Update from libc.
6034 * regex.h: Likewise.
6035 * getopt1.c: Likewise.
6036 * memcmp.c: Likewise.
6038 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
6039 Avoid using fseek, when possible -- it's broken by design.
6040 Patch by Ulrich Drepper.
6042 2000-10-26 Jim Meyering <meyering@lucent.com>
6044 * strftime.c: Update from libc.
6046 2000-10-25 Jim Meyering <meyering@lucent.com>
6048 * obstack.c: Update from libc.
6050 2000-10-23 Jim Meyering <meyering@lucent.com>
6052 * hard-locale.c (hard_locale): Revert last change -- it was simply
6053 wrong. That set_locale call must not have any side effects.
6056 2000-10-22 Jim Meyering <meyering@lucent.com>
6058 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
6059 [CYCLIC]: Remove now-unused definition.
6061 * save-cwd.c (O_DIRECTORY): Define, if needed.
6062 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
6063 Suggestion from Ulrich Drepper.
6065 2000-10-21 Jim Meyering <meyering@lucent.com>
6067 * dirname.c (dir_name_r): New function, factored out of dir_name.
6068 (dir_name): Use dir_name_r.
6069 * dirname.h (dir_name_r): Declare it.
6071 2000-10-21 Jim Meyering <meyering@lucent.com>
6073 * dirname.c (memrchr): Declare if necessary.
6074 (dir_name): Remove the restriction that there be no
6075 trailing slashes. Now, this code skips past them, effectively
6077 [TEST_DIRNAME] (main): New unit tests.
6079 * memrchr.c: New file from GNU libc.
6080 Undef __memrchr, too.
6081 [!weak_alias]: Define __memrchr to memrchr.
6082 Guard weak_alias use with `#ifdef weak_alias'.
6084 2000-10-17 Jim Meyering <meyering@lucent.com>
6086 * quote.h (PARAMS): Define and use.
6087 Reported by Akim Demaille.
6089 * getopt.c: Update from libc.
6091 2000-10-16 Jim Meyering <meyering@lucent.com>
6093 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
6096 2000-09-25 Jim Meyering <meyering@lucent.com>
6098 * md5.h (rol): Define (from GnuPG).
6100 * sha.c: Give credit (GnuPG) where due.
6101 (M): Use rol rather than open-coding it.
6102 Add a FIXME comment.
6104 2000-09-21 Jim Meyering <meyering@lucent.com>
6106 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
6107 Reported by Michael Stone.
6109 2000-09-20 Jim Meyering <meyering@lucent.com>
6111 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
6112 (noinst_HEADERS): Add sha.h.
6113 Based on code from Scott G. Miller and from GnuPG.
6115 2000-09-15 Jim Meyering <meyering@lucent.com>
6117 * regex.c: Update from libc.
6119 2000-09-10 Jim Meyering <meyering@lucent.com>
6121 * getopt.c (_getopt_internal): Update from glibc.
6123 2000-09-09 Jim Meyering <meyering@lucent.com>
6125 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
6126 think it should be used as a general replacement for isascii.
6127 * fnmatch.c: Likewise.
6128 * mbswidth.c: Likewise
6129 * regex.c: Likewise.
6132 * userspec.c: Include sys/param.h and limits.h.
6134 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6135 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
6136 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
6137 UID, GID. Check range.
6139 2000-09-06 Jim Meyering <meyering@lucent.com>
6141 * getopt.c (_getopt_internal): Update from glibc.
6143 2000-08-30 Jim Meyering <meyering@lucent.com>
6145 * strftime.c: Merge in changes from GNU libc.
6147 2000-08-26 Jim Meyering <meyering@lucent.com>
6149 * closeout.c: Include "__fpending.h".
6150 (close_stdout_status): Return right away if there's nothing to flush.
6152 * Makefile.am (noinst_HEADERS): Add __fpending.h.
6153 * __fpending.c: New file.
6154 * __fpending.h: New file.
6156 2000-08-07 Paul Eggert <eggert@twinsun.com>
6158 Standardize on "memory exhausted" instead of "Memory exhausted"
6159 or "virtual memory exhausted".
6160 * obstack.c (print_and_abort): Use "memory exhausted", not
6161 "virtual memory exhausted".
6162 * same.c (same_name): Invoke xalloc_die instead of printing
6164 * userspec.c (parse_user_spec): Likewise.
6165 * bumpalloc.h: comment fix
6166 * same.c, userspec.c: Include xalloc.h.
6168 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
6169 not char *const and pointing to a constant array.
6170 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
6171 (xrealloc): Comment fix.
6173 * userspec.c (parse_user_spec):
6174 Don't translate a message until just before returning,
6175 to avoid unnecessary translation.
6177 2000-08-07 Jim Meyering <meyering@lucent.com>
6179 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
6180 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
6181 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
6182 getgroups.c, gethostname.c, getopt.h, group-member.c,
6183 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
6184 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
6185 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
6186 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
6187 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
6188 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
6189 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
6190 yesno.c: Back out Copyright date changes for each file with no change
6191 this year. This eases coordination with other programs using the same
6192 source code modules. From Paul Eggert.
6194 2000-08-03 Greg McGary <greg@mcgary.org>
6196 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
6197 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
6198 (EXTEND_BUFFER): Use them.
6200 2000-08-01 Jim Meyering <meyering@lucent.com>
6202 * dirname.c (ISSLASH): Define.
6203 (BACKSLASH_IS_PATH_SEPARATOR): Define.
6204 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
6205 both `\' and `/' may be use as path separators.
6206 Based on a patch from Prashant TR.
6208 2000-07-31 Paul Eggert <eggert@twinsun.com>
6210 * quotearg.c (quotearg_n_options): Don't make the initial
6211 slot vector a constant, since it might get modified.
6213 2000-07-31 Jim Meyering <meyering@lucent.com>
6215 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
6216 * obstack.c (print_and_abort): Likewise.
6218 2000-07-30 Paul Eggert <eggert@twinsun.com>
6220 * quotearg.c (quotearg_n_options): Preallocate a slot 0
6221 buffer, so that the caller can always quote one small
6222 component of a "memory exhausted" message in slot 0.
6223 From a suggestion by Jim Meyering.
6225 2000-07-30 Jim Meyering <meyering@lucent.com>
6227 * makepath.c (make_path): Quote the other instance, too.
6229 * quotearg.c (N_STATIC_SLOTVECS): Define.
6230 (STATIC_BUF_SIZE): Define.
6231 (quotearg_n_options): Use only statically allocated storage when
6232 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
6233 than STATIC_BUF_SIZE.
6235 2000-07-29 Jim Meyering <meyering@lucent.com>
6237 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
6238 * dirname.c (dir_name): Likewise.
6240 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
6242 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
6243 (dir_name): Assert that there are no trailing slashes.
6245 2000-07-18 Bruno Haible <haible@clisp.cons.org>
6247 * mbswidth.h (mbswidth): Add a flags argument.
6248 (mbswidth): New declaration.
6249 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
6250 * mbswidth.c (mbswidth): Add a flags argument.
6251 (mbsnwidth): New function.
6253 2000-07-24 Jim Meyering <meyering@lucent.com>
6255 * mbswidth.c: Remove useless #else. From Bruno Haible.
6257 2000-07-23 Paul Eggert <eggert@twinsun.com>
6259 * mbswidth.c (_XOPEN_SOURCE):
6260 Don't define; this causes problems on Solaris 7.
6261 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
6263 2000-07-23 Paul Eggert <eggert@twinsun.com>
6266 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
6267 so that mbstate_t is always defined.
6269 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
6270 be 1 in at least one GCC installation, and this configuration
6271 error is likely to be common. Ignoring MB_LEN_MAX hurts
6272 performance on hosts that have mbrtowc but have only unibyte
6273 locales, but I assume these hosts are rare.
6275 2000-07-23 Paul Eggert <eggert@twinsun.com>
6277 * quotearg.c: Streamline by invoking multibyte code only if needed.
6278 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
6279 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
6280 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
6281 invoke multibyte primitives.
6283 2000-07-23 Jim Meyering <meyering@lucent.com>
6285 * basename.c (base_name): Add an assertion.
6287 2000-07-15 Bruno Haible <clisp.cons.org>
6289 * quotearg.c: When the system forces us to redefine mbstate_t,
6290 shadow its mbsinit function.
6292 2000-07-16 Bruno Haible <haible@clisp.cons.org>
6294 * mbswidth.h: New file.
6295 * mbswidth.c: New file.
6296 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
6297 (noinst_HEADERS): Add mbswidth.h.
6299 2000-07-17 Bruno Haible <haible@clisp.cons.org>
6301 * config.charset: Add support for FreeBSD. Improve support for HP-UX
6304 2000-07-15 Jim Meyering <meyering@lucent.com>
6306 * makepath.c: Include quote.h.
6307 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
6308 corresponding argument in a `quote (...)' call.
6309 Give better diagnostics.
6311 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
6312 (noinst_HEADERS): Add quote.h.
6314 * quote.c (quote, quote_n): New file. Two functions taken verbatim
6315 from tar's src/misc.c.
6316 * quote.h: New file. Prototypes for same.
6318 2000-07-10 Paul Eggert <eggert@twinsun.com>
6320 From a suggestion by Bruno Haible.
6321 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
6322 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
6323 to decide whether to define the BeOS workaround macro;
6324 this adjusts to the change to AC_MBSTATE_T.
6326 2000-07-13 Paul Eggert <eggert@twinsun.com>
6328 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
6330 * quotearg.c (quoting_style_args, quoting_style_vals,
6331 quotearg_buffer_restyled): Add support for
6332 clocale_quoting_style. Undo previous change to
6333 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
6334 and "{RIGHT QUOTATION MARK}" msgids.
6336 2000-07-05 Paul Eggert <eggert@twinsun.com>
6338 The old behavior of quoting `like this' doesn't look good with
6339 newer, ISO-style fonts. See:
6340 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
6342 Instead, quote "like this" by default. Let the translator
6343 tailor the locale-specific quoting behavior by providing
6344 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
6346 * quotearg.c (N_): New macro.
6347 (gettext_default): New function.
6348 (quotearg_buffer_restyled): Use
6349 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
6350 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
6352 2000-07-09 Jim Meyering <meyering@lucent.com>
6354 * Most files: Update copyright dates to include 2000.
6356 2000-07-08 Jim Meyering <meyering@lucent.com>
6358 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
6360 (xgethostname): Remove now-unnecessary #ifdef.
6361 Move declaration of `err' into loop where it's used.
6363 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6365 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
6366 by allocating a larger buffer. Test the gethostname return value for
6367 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
6368 returns an error and ENAMETOOLONG isn't defined.
6370 2000-07-05 Paul Eggert <eggert@twinsun.com>
6371 and Bruno Haible <haible@clisp.cons.org>
6373 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
6375 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6377 * quotearg.c (struct quoting_options): Simplify quote_these_too
6380 2000-07-03 Jim Meyering <meyering@lucent.com>
6382 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
6383 Reported by Bruno Haible.
6385 2000-07-04 Jim Meyering <meyering@lucent.com>
6387 * quotearg.c: Make inclusion of <wchar.h> independent of whether
6388 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
6391 2000-07-03 Paul Eggert <eggert@twinsun.com>
6392 and Bruno Haible <haible@clisp.cons.org>
6394 * quotearg.c (mbrtowc):
6395 Assign to *pwc, and return 1 only if result is nonzero.
6396 (iswprint): Use ISPRINT when substituting our own mbrtowc.
6398 2000-07-03 Jim Meyering <meyering@lucent.com>
6400 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
6401 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
6404 2000-07-02 Jim Meyering <meyering@lucent.com>
6406 * quotearg.c (mbstate_t): Don't define here.
6408 2000-07-02 Jim Meyering <meyering@lucent.com>
6410 * nanosleep.c (SIGCONT): Define if not already defined.
6412 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6414 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
6415 per change in ../m4/ls-mntd-fs.m4.
6416 (read_filesystem_list): Ignore symbolic links.
6418 2000-06-29 Jim Meyering <meyering@lucent.com>
6420 * same.c: Include <string.h> or <strings.h>, as appropriate,
6421 for declaration of strcmp.
6423 * long-options.c: Include <stdlib.h>, for declaration of exit.
6425 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
6426 Avoid warning by casting result to `char *' to remove `const'.
6428 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6430 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
6432 2000-06-26 Paul Eggert <eggert@twinsun.com>
6434 savedir now sets errno on failure and invokes xmalloc to get memory.
6435 Fix a couple of other minor bugs while we're at it.
6437 * savedir.c (<unistd.h>): Do not include; there's no need.
6438 (NAMLEN): Remove macro.
6439 (malloc, realloc): Remove decls.
6441 ("xalloc.h"): Include.
6442 (NAME_SIZE_DEFAULT): New macro.
6443 (savedir): Use xmalloc / xrealloc to allocate memory.
6444 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
6445 Skip "" directory entries.
6446 Use strlen to calculate directory entry length, since the old method
6447 is rarely used these days and isn't worth supporting.
6448 Don't use a pointer after freeing it.
6449 Check for integer overflow when calculating allocation size.
6450 Use memcpy to copy entries, instead of stpcpy.
6451 Set errno properly when returning NULL.
6452 Check for readdir error.
6454 2000-06-26 Jim Meyering <meyering@lucent.com>
6456 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
6458 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6460 * getusershell.c (xmalloc, xrealloc): Remove functions.
6462 Don't include <stdlib.h>. Don't declare malloc, realloc.
6464 2000-06-23 Bruno Haible <haible@clisp.cons.org>
6466 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
6468 2000-06-24 Jim Meyering <meyering@lucent.com>
6470 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
6472 2000-06-21 Jim Meyering <meyering@lucent.com>
6474 * getpass.c: New file, from Bruno Haible. Required for BeOS.
6476 2000-06-19 Paul Eggert <eggert@twinsun.com>
6478 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
6479 (mbrtowc, mbstate_t): Define substitutes if
6480 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
6481 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
6482 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
6484 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6486 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
6487 than 1024, return a memory chunk of least possible size, instead
6488 of size PATH_MAX + 2. In the loop, increment the size proportionally.
6489 Use free/xmalloc instead of xrealloc to avoid copying for very long
6492 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6494 * canon-host.c (canon_host): Use malloc and memcpy to copy an
6495 address, not strdup. Include <stdlib.h> and don't declare free().
6497 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6499 * path-concat.c (path_concat): Don't access dir[-1] if dir is
6502 2000-06-21 Jim Meyering <meyering@lucent.com>
6504 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
6505 (noinst_HEADERS): Add getstr.h.
6507 * getline.c (getstr): Move into a separate file.
6508 * getstr.c (getstr): New file, extracted from getline.c, with
6509 the following changes: new parameter, delim2; both delim[12]
6510 parameters have type `int', not `char'. The latter would lose
6511 with 8-bit delimiters.
6512 * getstr.h: New file.
6514 2000-06-19 Jim Meyering <meyering@lucent.com>
6516 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
6518 2000-06-18 Jim Meyering <meyering@lucent.com>
6520 * mkdir.c: Remove file, due mainly to copyright incompatibility.
6521 Besides, these days every porting target provides a mkdir function.
6523 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
6524 (this snippet comes from src/system.h).
6526 2000-06-15 Paul Eggert <eggert@twinsun.com>
6528 * human.c (adjust_value): New function.
6529 (human_readable_inexact): Apply rounding style even when
6530 printing approximate values.
6532 2000-06-14 Paul Eggert <eggert@twinsun.com>
6534 * human.c (human_readable_inexact): Allow an input block
6535 size that is not a multiple of the output block size, and vice versa.
6536 Reported by Piergiorgio Sartor.
6538 2000-06-14 Paul Eggert <eggert@twinsun.com>
6540 * getdate.y (get_date): Apply relative times after time
6541 zone indicator, not before. Reported by Todd A. Jacobs.
6543 2000-06-13 Jim Meyering <meyering@lucent.com>
6545 * Makefile.am (all-local): Depend on lstat.c and stat.c.
6547 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
6549 2000-06-12 Paul Eggert <eggert@twinsun.com>
6551 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
6553 2000-06-04 Paul Eggert <eggert@twinsun.com>
6555 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
6557 2000-06-04 Jim Meyering <meyering@lucent.com>
6559 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
6560 SunOS 4.1.4 for which gid_t is an unsigned type.
6562 2000-06-03 Jim Meyering <meyering@lucent.com>
6564 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
6566 2000-05-26 Bruno Haible <haible@clisp.cons.org>
6568 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
6569 newer, don't install charset.alias.
6570 * config.charset: Change the Linux/glibc rules so they become empty
6571 on glibc-2.1 or newer.
6573 2000-06-02 Jim Meyering <meyering@lucent.com>
6575 * mountlist.c: Back out last change. Instead, do this...
6576 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
6577 member using the same `ignore'-testing code.
6578 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
6582 2000-05-29 Jim Meyering <meyering@lucent.com>
6584 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
6585 with the `ignore' attribute. Based on a patch from Mark D. Roth.
6587 2000-05-22 Jim Meyering <meyering@lucent.com>
6589 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
6591 2000-05-18 Jim Meyering <meyering@lucent.com>
6593 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
6594 back, too, since it may have been modified by allocate_entry.
6595 (hash_delete): Rewrite to use neither the assignment operator
6596 nor the comma operator in an if-expression.
6598 2000-05-15 Paul Eggert <eggert@twinsun.com>
6601 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
6602 Remove; no longer needed.
6603 "quotearg.h": Add include.
6604 (file_name): Do not bother to explicitly initialize to NULL; it's less
6605 efficient on some hosts.
6606 (close_stdout_status): Remove test as to whether stdout was already
6607 closed; it breaks for the case "echo x | sort >&-".
6608 Quote file name colons.
6609 Do not assume that _("write error") lacks format strings.
6611 2000-05-15 Jim Meyering <meyering@lucent.com>
6613 * version-etc.c (version_etc_copyright): Update the copyright string
6614 used in all --version output.
6616 2000-05-14 Jim Meyering <meyering@lucent.com>
6618 * closeout.c (close_stdout_set_file_name): New function.
6619 (close_stdout_status): Use new file-scoped global.
6620 Return right away if fstat says the stdout file descriptor is invalid.
6621 * closeout.h (close_stdout_set_file_name): Declare.
6623 2000-05-10 Jim Meyering <meyering@lucent.com>
6625 * closeout.c [default_exit_status]: New file-scoped variable.
6626 (close_stdout_set_status): New function.
6627 * closeout.h (close_stdout_set_status): Declare.
6629 2000-05-08 Jim Meyering <meyering@lucent.com>
6631 * long-options.c: Don't include closeout.h.
6632 (parse_long_options): Don't call close_stdout for --version.
6634 2000-05-06 Jim Meyering <meyering@lucent.com>
6636 * strnlen.c: Undefine __strnlen and strnlen.
6637 [!weak_alias]: Define __strnlen to strnlen.
6639 * atexit.c: New file, from libiberty.
6641 2000-05-06 Jim Meyering <meyering@lucent.com>
6643 * closeout.c (close_stdout_status): Also check for errors on the
6646 2000-05-05 Bruno Haible <haible@clisp.cons.org>
6648 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
6649 instead of xmalloc, xrealloc, path_concat.
6650 (locale_charset): Treat empty environment variables as absent.
6651 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
6653 2000-05-04 Jim Meyering <meyering@lucent.com>
6655 * getopt.c: Update from glibc.
6656 * obstack.c: Likewise.
6657 * obstack.h: Likewise.
6658 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
6660 * regex.h: Likewise.
6661 * strndup.c: Likewise.
6662 * strnlen.c: New file, from glibc.
6664 2000-05-01 Jim Meyering <meyering@lucent.com>
6666 * full-write.c (full_write): Remove `FIXME' part of comment.
6668 2000-04-29 Jim Meyering <meyering@lucent.com>
6670 * path-concat.c: Declare strdup only if it's not defined.
6671 * canon-host.c: Likewise.
6673 2000-04-28 Jim Meyering <meyering@lucent.com>
6675 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
6676 redefinition warning on some systems (HPUX). Otherwise, regex.h is
6677 included first, then limits.h is included by locale.h by libintl.h.
6678 From John David Anglin.
6680 2000-04-25 Jim Meyering <meyering@lucent.com>
6682 * makepath.c (S_IRWXUGO): Define.
6683 (make_path): Always perform explicit chmod if MODE specifies any
6684 of the `special' permission bits. Prompted by a bug report against
6685 install from Mate Wierdl and Joost van Baal.
6687 2000-04-18 Jim Meyering <meyering@lucent.com>
6691 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
6692 getpagesize. For BeOS. Based on a patch from Bruno Haible.
6694 2000-04-17 Jim Meyering <meyering@lucent.com>
6696 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6697 the definition of it to rpl_strftime also defined-away the system's
6700 2000-04-15 Jim Meyering <meyering@lucent.com>
6702 Use `C' to denote so-called `contiguous' files, the same way
6704 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6705 (ftypelet): Use S_ISCTG.
6706 From Michael Deutschmann.
6708 2000-04-14 Jim Meyering <meyering@lucent.com>
6710 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6712 2000-04-08 Jim Meyering <meyering@lucent.com>
6714 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6715 names don't conflict. Reported by Eli Zaretskii.
6717 2000-03-28 Bruno Haible <haible@clisp.cons.org>
6719 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6720 bug. Deal with the different error behavior of Irix iconv.
6722 2000-04-07 Jim Meyering <meyering@lucent.com>
6724 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6725 to work around system header problems on AIX 3.2.5. From Bruno Haible.
6727 2000-04-05 Jim Meyering <meyering@lucent.com>
6729 Portability tweaks required for ultrix4.3.
6730 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6731 * readutmp.c: Include sys/types.h before sys/stat.h.
6732 * canon-host.c: Declare strdup.
6733 * path-concat.c: Likewise.
6734 From John David Anglin.
6736 2000-04-04 Jim Meyering <meyering@lucent.com>
6738 Be more DOS 8.3-friendly.
6739 * ref-add.sin: Renamed from ref-add.sed.in.
6740 * ref-del.sin: Renamed from ref-del.sed.in.
6741 * Makefile.am: Reflect renaming.
6742 Reported by Eli Zaretskii.
6744 Use a temporary file name that won't clash with `charset.alias'
6745 in the DOS 8.3 name space.
6746 * Makefile.am (charset_tmp): Define.
6747 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
6748 (uninstall-local): Likewise.
6749 Reported by Eli Zaretskii.
6751 2000-03-29 Paul Eggert <eggert@twinsun.com>
6753 * time/strftime.c (my_strftime): Make sure we call the system
6754 strftime, not ourselves, when invoking the underlying strftime.
6756 2000-03-24 Jim Meyering <meyering@lucent.com>
6758 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
6759 (charset_alias): Define.
6760 (install-exec-local): Factor out common code.
6761 (uninstall-local): Split lines longer than 80.
6762 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
6764 (.sed.in.sed): New rule. Don't redirect directly to $@.
6765 (CLEANFILES): Add ref-add.sed and ref-del.sed.
6767 2000-03-19 Bruno Haible <haible@clisp.cons.org>
6769 * config.charset: Output a line containing "Packages using this file".
6770 * ref-add.sed.in, ref-del.sed.in: New files.
6771 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
6772 ref-del.sed): New rules.
6774 2000-03-17 Jim Meyering <meyering@lucent.com>
6776 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
6777 Otherwise, include <strings.h>
6779 2000-03-17 Bruno Haible <haible@clisp.cons.org>
6781 * unicodeio.c (utf8_wctomb): New function.
6782 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
6783 format instead of in UCS-4 with platform dependent endianness.
6785 2000-03-07 Paul Eggert <eggert@twinsun.com>
6787 * savedir.c (savedir): Work even if directory size is
6788 negative; this can happen with some screwy NFS configurations.
6790 2000-03-06 Jim Meyering <meyering@lucent.com>
6792 * localcharset.c (get_charset_aliases): Don't try to free file_name
6793 if it's NULL (because we ran out of memory). From Bruno Haible.
6795 2000-03-05 Jim Meyering <meyering@lucent.com>
6797 * localcharset.c ("path-concat.h"): Include.
6798 (get_charset_aliases): Use path_concat instead of ANSI string
6801 * unicodeio.h (PARAMS): Define.
6802 Use it to guard prototype.
6804 2000-03-04 Jim Meyering <meyering@lucent.com>
6806 * Makefile.am (install-exec-local): Create $(libdir) before installing
6808 (uninstall-local): Uncomment this rule so `make distcheck' works
6811 * unicodeio.c (<errno.h>): Include it.
6812 (errno): Declare if not defined.
6814 * localcharset.c: Add Bruno's comment justifying use of volatile.
6816 * config.charset: New version, incorporating remarks from a linux
6817 i18n mailing list. From Bruno Haible.
6819 2000-03-02 Jim Meyering <meyering@lucent.com>
6821 * Makefile.am (EXTRA_DIST): Add config.charset.
6823 2000-03-01 Jim Meyering <meyering@lucent.com>
6825 * localcharset.c: Guard some #includes with `#if HAVE_...'.
6826 * unicodeio.c: Likewise.
6828 2000-02-02 Bruno Haible <haible@clisp.cons.org>
6830 * config.charset: New file.
6831 * localcharset.c: New file.
6832 * unicodeio.h, unicodeio.c: New files.
6833 * Makefile.am (DEFS): Add -DLIBDIR=...
6834 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
6835 (noinst_HEADERS): Add unicodeio.h.
6836 (all-local, install-exec-local, charset.alias): New targets.
6838 2000-02-28 Paul Eggert <eggert@twinsun.com>
6840 * quotearg.c (ALERT_CHAR): New macro.
6841 (quotearg_buffer_restyled): Use it.
6843 2000-02-27 Jim Meyering <meyering@lucent.com>
6845 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
6846 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
6848 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
6849 not `#if STDC_HEADERS'.
6850 Declare malloc if needed.
6852 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
6853 now that autoconf always defines the HAVE_DECL_ symbols.
6854 * human.c: Likewise.
6856 * strtoumax.c: Likewise.
6858 * backupfile.c: Arrange for cpp to fail if the configure-time
6859 declaration check was not run.
6861 * human.c: Likewise.
6863 * strtoumax.c: Likewise.
6865 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
6866 then first look up the entire `.'-containing string as a login name.
6868 2000-02-18 Paul Eggert <eggert@twinsun.com>
6870 * getdate.y: Handle two-digit years with leading zeros correctly.
6871 (textint): New typedef.
6872 (parser_control): Member year changed from int to textint.
6874 (YYSTYPE): Removed; replaced by %union with int and textint members.
6875 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
6876 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
6877 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
6878 (tSNUMBER, tUNUMBER): Now of type <textintval>.
6879 (date, number, to_year): Use width of number in digits, not its value,
6880 to determine whether it's a 2-digit year, or a 2-digit time.
6881 (yylex): Store number of digits of numeric tokens.
6882 Reported by John Kendall.
6884 (parser_control): Changed from struct parser_control to typedef (for
6885 consistency). All uses changed.
6887 (tID): Removed; not used.
6888 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
6890 2000-02-14 Paul Eggert <eggert@twinsun.com>
6892 * getpagesize.h (getpagesize): Port to VMS for Alpha;
6893 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
6895 2000-02-12 Jim Meyering <meyering@lucent.com>
6897 * userspec.c (ISDIGIT): Define it.
6898 (isdigit): Remove definition.
6899 (is_number): Use ISDIGIT, not isdigit.
6900 <libintl.h>: Include.
6902 (parse_user_spec): Mark translatable strings.
6904 2000-02-10 Jim Meyering <meyering@lucent.com>
6906 With these changes, nanosleep.[ch] are finally enough like the other
6907 lib/* replacement files to compile on a few more losing systems.
6909 * nanosleep.h: Don't include config.h.
6910 Remove prototype from declaration of nanosleep.
6911 (PARAMS): Remove now-unneeded definition.
6912 * nanosleep.c: #undef nanosleep.
6913 (rpl_nanosleep): Rename from nanosleep.
6915 2000-02-03 Jim Meyering <meyering@lucent.com>
6917 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
6918 rather than with `#if HAVE_UTMPNAME'.
6920 2000-02-01 Jim Meyering <meyering@lucent.com>
6922 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
6924 2000-01-31 Jim Meyering <meyering@lucent.com>
6926 * nanosleep.h (nanosleep): Guard declaration with
6927 `#if ! HAVE_DECL_NANOSLEEP'.
6928 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
6929 the declaration in that vendor's sys/timers.h.
6930 Reported by Christian Krackowizer.
6932 * quotearg.c (ISASCII): Add #undef and move definition to follow
6933 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
6934 (ISPRINT): Likewise.
6935 Reported by Tom Tromey.
6937 2000-01-30 Jim Meyering <meyering@lucent.com>
6939 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
6940 uses of ->ut_name. The latter doesn't work with new Linux header files
6941 where only utmpx.ut_user is declared.
6943 * readutmp.h (UT_USER): Define.
6945 2000-01-23 Jim Meyering <meyering@lucent.com>
6947 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
6950 2000-01-22 Jim Meyering <meyering@lucent.com>
6952 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
6953 [! HAVE_DECL_STRTOULL]: Declare strtoull.
6954 Required for some AIX systems. Reported by Christian Krackowizer.
6955 [TESTING] (main): New function.
6957 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
6958 * dirname.c (dir_name): Support for DOS-style file names with drive
6961 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
6963 * strverscmp.c (ISDIGIT): Define.
6964 (strverscmp): Use ISDIGIT, not isdigit.
6966 2000-01-17 Paul Eggert <eggert@twinsun.com>
6968 * nanosleep.c (nanosleep):
6969 Don't use SA_INTERRUPT to decide whether to call sigaction, as
6970 POSIX.1 doesn't require SA_INTERRUPT and some systems
6971 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
6972 it's been part of POSIX.1 since day 1 (in 1988).
6974 2000-01-17 Jim Meyering <meyering@lucent.com>
6976 * interlock: Remove unused file. Reported by François Pinard.
6978 2000-01-16 Paul Eggert <eggert@twinsun.com>
6980 * quotearg.c (quotearg_buffer_restyled): Do not quote
6981 alert, backslash, formfeed, and vertical tab unnecessarily in
6982 shell quoting style.
6985 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
6986 Free Software Foundation, Inc.
6987 Copying and distribution of this file, with or without modification,
6988 are permitted provided the copyright notice and this notice are preserved.