1 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
3 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
4 declares only 'struct timespec;' (!).
6 2005-06-29 Jim Meyering <jim@meyering.net>
8 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
9 type name. Use the variable name instead.
10 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
12 2005-06-28 Simon Josefsson <jas@extundo.com>
14 * check-version.h, check-version.c: New files.
16 2005-06-28 Simon Josefsson <jas@extundo.com>
18 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
19 collision with global variable. Better indentation. Don't
20 increment buffer pointer beyond buffer end. Based on comments
21 from Paul Eggert <eggert@cs.ucla.edu>.
25 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
27 * canon-host.c (canon-host): Append trailing "," to 0 in
28 initializer of struct addrinfo, as an indication that we don't
29 care how many members the structure has.
31 2005-06-24 Derek Price <derek@ximbiot.com>
32 and Bruno Haible <bruno@clisp.org>
34 Remove stat module & update lstat.
35 * stat.c: Remove this file...
36 (slash_aware_lstat): ...moving this content and its support...
37 * lstat.c (rpl_lstat): ...into here.
40 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
42 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
43 (ranged_convert): Don't save conversion in a temporary struct.
44 This causes a warning with GCC 4.0.0, and anyway in the typical
45 case it's not worth the extra 100 bytes or so of code.
46 (ranged_convert, __mktime_internal): When calling a function via a
47 pointer P, use P () rather than (*P) (), as we now assume C89 or
50 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
52 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
53 "who -r" failed to give output. Problem reported by Tim Waugh.
55 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
56 (xcalloc): Use it to avoid needless tests.
57 Problem reported by Jim Meyering.
59 2005-06-16 Jim Meyering <jim@meyering.net>
61 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
62 when either N or S is zero.
64 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
66 * argp.h (__option_is_short): Check upper limit of
67 __key. Isprint() requires its argument to have the value
68 of an unsigned char or EOF.
70 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
72 * fnmatch.c (fnmatch): If there is an encoding error in a
73 multibyte string or pattern, fall back on unibyte matching.
74 Problem reported by James Youngman.
76 2005-06-08 Bruno Haible <bruno@clisp.org>
78 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
81 2005-06-08 Bruno Haible <bruno@clisp.org>
83 * csharpcomp.h: New file, from GNU gettext.
84 * csharpcomp.c: New file, from GNU gettext.
85 * csharpcomp.sh.in: New file, from GNU gettext.
87 2005-06-07 Derek Price <derek@ximbiot.com>
90 * glob_.h: Indent nested #ifdef.
92 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
95 Use "file name" when talking about file names, instead of "filename"
96 or "path", as per the GNU coding standards.
97 * mkdir-p.c: Renamed from makepath.c.
98 (make_dir_parents): Renamed from make_path. All callers changed.
99 * mkdir-p.h: Likewise. All includers changed.
100 * filenamecat.c: Renamed from path-concat.c.
101 (file_name_concat): Renamed from path_concat. All callers changed.
102 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
103 * filenamecat.h: Likewise. All includers changed.
104 * acl.c: Don't use "path" or "filename" to mean "file name"
105 in comments or local variable names.
106 * basename.c: Likewise.
107 * canonicalize.c, canonicalize.h: Likewise.
108 * dirname.c, dirname.h: Likewise.
109 * euidaccess.c: Likewise.
110 * exclude.c: Likewise
111 * fnmatch_.h, fnmatch_loop.c: Likewise.
112 * fsusage.c, fsuage.h: Likewise.
113 * fts.c, fts_.h: Likewise.
114 * getcwd.c: Likewise.
115 * getloadavg.c: Likewise.
116 * mkstemp.c: Likewise.
117 * mountlist.c, mountlist.h: Likewise.
118 * openat.c, openat.h: Likewise.
119 * readlink-stub.c: Likewise.
120 * readutmp.c, readutmp.h: Likewise.
121 * rename.c: Likewise.
124 * savedir.c: Likewise.
125 * stripslash.c: Likewise.
126 * tempname.c: Likewise.
127 * xreadlink.c: Likewise.
128 * exclude.c (excluded_file_name): Renamed from excluded_filename.
130 * exclude.h: Likewise.
132 * euidaccess.c (getuid, getgid, getuid, getegid)
133 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
134 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
135 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
136 * pathmax.h: Include <limits.h> unconditionally, since other
137 files have been getting away with it for years (MORE/BSD 4.3
139 * userspec.c (getpwnam, getgrnam, getgrgid)
140 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
142 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
143 Define to 256, not 255, as per modern POSIX.
145 2005-06-01 Bruno Haible <bruno@clisp.org>
147 * csharpexec.h: New file, from GNU gettext.
148 * csharpexec.c: New file, from GNU gettext.
149 * csharpexec.sh.in: New file, from GNU gettext.
151 2005-05-31 Derek Price <derek@ximbiot.com>
152 Paul Eggert <eggert@cs.ucla.edu>
155 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
157 2005-05-29 Derek Price <derek@ximbiot.com>
158 Paul Eggert <eggert@cs.ucla.edu>
160 * glob_.h, glob.c: New files.
162 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
164 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
166 * fts.c: Don't worry about debugging on pre-C99-comopatible hosts;
167 the configuration hassle isn't worth it.
168 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
169 (LONGEST_MODIFIER, PRIuMAX): Remove.
171 2005-05-27 Bruno Haible <bruno@clisp.org>
173 * getlogin_r.h: Remove second include of <stddef.h>.
175 2005-05-25 Bruno Haible <bruno@clisp.org>
176 Derek Price <derek@ximbiot.com>
178 * getlogin_r.h: Simplify API documentation.
180 2005-05-25 Derek Price <derek@ximbiot.com>
181 Paul Eggert <eggert@cs.ucla.edu>
183 * getlogin_r.c, getlogin_r.h: New files.
185 2005-05-22 Bruno Haible <bruno@clisp.org>
187 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
188 Also include <sys/param.h> if it defines MIN, MAX.
189 Based on a patch by Derek Price <derek@ximbiot.com>.
191 2005-05-22 Bruno Haible <bruno@clisp.org>
193 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
194 (INT64_MIN): Fix definition.
195 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
197 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
198 NEED_SIGNED_INT_TYPES.
200 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
201 HAVE_SYSTEM_INTTYPES.
203 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
205 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
206 so that unistd-safer.h (GPL'ed code) need not be included.
208 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
211 * fts.c: Don't include "cycle-check.h" or "hash.h".
212 (setup_dir, free_dir): New functions.
213 (enter_dir, leave_dir): Define trivial
214 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
215 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
216 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
217 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
219 (fts_open): Use setup_dir.
220 (fts_close): Use free_dir.
221 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
222 This adds a label and some gotos, but the alternatives were messier.
223 Check for memory allocation failure when entering a dir.
224 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
225 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
226 (FTS): New member fts_cycle, that is a union that contains the
227 old active_dir_ht and cycle_state. All uses changed to mention
228 fts_cycle.ht and fts_cycle.state.
229 * fts-cycle.c: New file, containing GPL'ed code migrated out of
230 fts.c, with the following changes:
231 (setup_dir, free_dir): New functions.
232 (enter_dir): Now returns bool. Return true if successful, false
233 if memory exhausted. All callers changed.
234 Do not bother partly cleaning up on
235 memory allocation failure; that is free_dir's job.
236 However, free ad if hash_insert fails, to avoid memory leak.
237 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
238 fts->fts_options to see which union member to use.
240 2005-05-20 Jim Meyering <jim@meyering.net>
242 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
243 Now a macro, to pacify GCC.
245 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
247 * chown.c (rpl_chown): Return -1 on failure.
249 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
251 * canonicalize.c: Include canonicalize.h first, to test interface.
252 Include <stddef.h> unconditionally, since we assume C89 now.
253 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
254 * fts.c: Include fts_.h first, to check interface.
255 Do not include intprops.h; no longer needed.
256 Include cycle-check.h and hash.h, since fts_.h no longer does.
257 Remove unnecessary casts of closedir to void.
258 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
259 decide whether to decrement nlinks.
260 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
261 (FTS): Use struct hash_table * instead of Hash_table, so that
262 we no longer need to include hash.h here.
264 2005-05-17 Jim Meyering <jim@meyering.net>
266 * fts.c, fts_.h: New files, from coreutils.
268 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
271 * unlinkdir.c, unlinkdir.h: New files.
272 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
273 regex.h, unlocked-io.h, xtime.h:
274 White space changes only.
275 * makepath.c (make_path): Port to hosts where leading "//" is special.
276 * yesno.c: Include getline.h, not ctype.h.
277 (yesno): Don't remove leading white space; POSIX doesn't allow it.
278 Use getline to remove arbitrary restriction on response length.
280 2005-05-13 Bruno Haible <bruno@clisp.org>
282 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
283 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
284 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
285 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
286 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
287 Add support for 64-bit integers in the MSVC compiler.
289 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
291 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
292 Change the initial comment to refer to GPL, not LGPL.
293 gnulib-tool will change it to LGPL as needed.
295 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
296 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
297 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
298 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
299 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
300 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
301 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
302 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
303 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
304 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
305 concatpath.c, config.charset, copy-file.c, copy-file.h,
306 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
307 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
308 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
309 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
310 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
311 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
312 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
313 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
314 full-read.c, full-read.h, full-write.c, full-write.h,
315 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
316 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
317 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
318 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
319 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
320 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
321 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
322 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
323 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
324 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
325 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
326 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
327 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
328 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
329 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
330 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
331 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
332 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
333 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
334 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
335 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
336 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
337 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
338 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
339 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
340 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
341 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
342 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
343 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
344 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
345 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
346 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
347 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
348 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
349 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
350 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
351 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
352 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
353 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
354 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
355 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
356 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
357 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
358 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
359 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
360 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
361 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
362 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
363 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
364 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
365 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
366 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
367 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
368 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
369 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
370 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
371 Update FSF postal mail address.
373 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
375 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
376 specified in ai_socktype. Fix invalid ai_protocol
377 check. ai_protocol is usually set to 0 or depending on
378 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
379 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
380 ai_socktype / ai_protocol in the returned addrinfo structure.
382 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
383 Bruno Haible <bruno@clisp.org>
385 * inet_ntop.h: New file.
386 * inet_ntop.c: New file, from glibc with modifications.
388 2005-05-08 Jim Meyering <jim@meyering.net>
390 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
392 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
394 Merge from coreutils. Among other things,
395 add bulletproofing for cases where stdin, stdout, or stderr are closed.
396 * fd-safer.c: New file.
397 * fcntl-safer.h, open-safer.c: Remove.
398 * chdir-long.c: Fix comment "fetish" -> "coreutils".
399 * dup-safer.c: Include unistd-safer.h first.
400 Don't include errno.h.
401 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
402 * file-type.h: Don't assume invoker included sys/stat.h first.
403 * file-type.c: Rely on file-type.h change.
404 * getloadavg.c: Include unistd-safer.h.
405 (getloadavg): Use safer open.
406 * getusershell.c: Include "stdio-safer.h".
407 (getusershell): Use safer fopen.
408 * long-options.c (long_options): Use NULL rather than 0.
409 * modechange.h (mode_free): Remove; all callers changed to invoke
411 * modechange.c: Likewise.
412 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
413 (MODE_DONE): New constant.
414 (struct mode_change): Remove 'next' member.
415 (make_node_op_equals): New function; like the old one of the
416 same name, except it allocates an array.
417 (mode_compile, mode_create_from_ref): Use it.
418 (mode_compile): Allocate result as an array, not a linked list.
419 Parse octal string ourself, so that we catch mistakes like "+0".
420 (mode_adjust): Arg is an array, not a linked list.
421 * modechange.c: Include stat-macros.h, xalloc.h.
422 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
423 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
424 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
425 Remove. This is now stat-macros.h's job.
426 (talloc): Remove. All callers replaced by xalloc, so that
427 our invokers don't have to worry about reporting memory failures.
428 (make_node_op_equals): Remove.
429 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
431 (struct mode_change): Moved here from modechange.h.
432 (mode_append_entry): Remove.
433 (mode_compile): Remove MASKED_OPS arg, since it encouraged
434 apps to have incorrect behavior. Use simpler algorithm for head
435 and tail. Don't futz with umask; that's now the job of mode_adjust.
436 Detect more invalid usages rather than having somewhat-random behavior.
437 Don't insert an "a=" action, as that leads to incorrect behavior.
438 (mode_compile, mode_create_from_ref): Return NULL on error instead
439 of an enum, since now there's only one way to have an error. All
441 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
442 at the correct time. Simplify calculation of "+u" and its ilk.
443 Don't mishandle "+X".
444 (mode_free): Remove "register" and localize decls.
445 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
446 (struct mode_change): Move to modechange.c; callers don't
447 need to see this stuff.
448 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
449 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
450 (mode_change, mode_adjust): Reflect the new signatures noted above.
451 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
452 that might redefine system include files.
453 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
454 (my_usleep): Use NULL rather than (void *) 0.
455 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
456 Use siginterrupt to specify that system calls should be interrupted.
457 (rpl_nanosleep): Move initialization of suspended closer to call of
459 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
460 * readutmp.c: Likewise. Include signal.h, stdbool.h.
461 (desirable_utmp_entry): New function.
462 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
463 using x2nrealloc, to simplify logic.
464 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
465 size calculation. Do not assume utmp file is a regular file.
466 * readutmp.h (UT_PID): Moved here from ../src/who.c.
467 (READ_UTMP_CHECK_PIDS): New constant.
468 * save-cwd.c: Include unistd-safer.h.
469 (save_cwd): Use fd_safer.
470 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
471 [!_LIBC] Include "stat-macros.h" instead.
472 * unistd-safer.h (fd_safer): New decl.
474 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
476 * byteswap_.h: New file.
478 2005-04-25 Albert Chin <china@thewrittenword.com>
480 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
483 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
485 * getdate.y (zone): Allow relunit_snumber after tZONE, so
486 that "UTC +1 second" continues to work. Problem reported
488 (relunit_snumber): New rule.
491 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
493 * getdate.y (universal_time_zone_table): New constant.
494 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
495 universal_time_zone_table.
496 (lookup_zone): Prefer universal_time_zone_table to
497 local_time_zone_table, so that "GMT" time stamps are allowed in
498 London during the summer. Problem reported by Ian Abbott.
500 2005-04-12 Jim Meyering <jim@meyering.net>
502 * human.c (humblock): Set *options even when returning due to
503 xstrtoumax conversion failure. Thanks to a used-uninitialized
506 2005-04-09 Jim Meyering <jim@meyering.net>
508 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
509 -Wuninitialized: initialize tm0.tm_year.
511 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
513 * getdate.y (parser_control): rels_seen is now a boolean, not a
514 count, since there's no maximum. All uses changed.
515 Add member dsts_seen.
516 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
518 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
519 Use pc_rels_seen to decide whther a date is absolute.
521 * getdate.y (number): Don't overwrite year.
522 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
525 2005-04-02 Simon Josefsson <jas@extundo.com>
527 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
528 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
530 2005-03-27 Jim Meyering <jim@meyering.net>
532 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
534 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
536 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
537 "one's complement" -> "ones' complement" in comment, as per Knuth.
538 "value of type" -> "type or expression" in comment.
539 * mktime.c, strftime.c: Propagate intprops.h comment nits.
541 2005-03-26 Jim Meyering <jim@meyering.net>
544 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
545 Correct typos: s/or/of/.
547 2005-03-23 Jim Meyering <jim@meyering.net>
549 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
551 2005-03-21 Jim Meyering <jim@meyering.net>
553 Changes imported from coreutils.
555 * cycle-check.c: Don't include xalloc.h.
557 * path-concat.c: Don't include assert.h.
558 (path_concat): Remove assertion that would have triggered
559 for ABASE starting with more than one slash.
560 Reported by Andreas Schwab.
562 * path-concat.c (path_concat): Set *BASE_IN_RESULT
563 properly when ABASE is an absolute file name.
564 Correct the description of this function.
566 Add an assertion and a test driver.
567 This fixes a bug introduced on 2004-07-02.
568 Andreas Schwab reported the resulting failure of cp --parents:
569 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
571 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
573 * strftime.c (my_strftime): If the underlying strftime returns 0
574 (which shouldn't happen), generate nothing instead of returning 0
575 immediately, so that nstrftime (NULL, ...) doesn't return 0.
577 2005-03-16 Bruno Haible <bruno@clisp.org>
579 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
581 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
583 * strftime.c (my_strftime): Prepend space to format so that we can
584 reliably distinguish strftime failure from empty output on POSIX
587 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
589 * iconvme.c (SIZE_MAX): New macro, if not already defined.
590 (iconv_string): Don't guess a size-zero buffer, as that might cause
591 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
592 result would be 'too large', where 'too large' is (heuristically)
593 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
594 overflow concerns. This will prevent some unwanted malloc failures
595 when the inputs are very large.
597 2005-03-15 Bruno Haible <bruno@clisp.org>
599 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
602 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
605 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
607 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
609 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
610 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
612 * strtol.c: Likewise.
614 2005-03-14 Simon Josefsson <jas@extundo.com>
616 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
619 2005-03-14 Jim Meyering <jim@meyering.net>
621 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
622 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
623 to be nonzero so that we (and caller) can detect the difference
624 between a valid zero-length expansion and an error return, even
625 when the underlying strftime fails before writing anything into
628 2005-03-10 Jim Meyering <jim@meyering.net>
630 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
631 so that this module works on systems without fchdir.
633 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
635 Factor int-properties macros into a single file, except for
637 * intprops.h: New file.
638 * getloadavg.c: Include it instead of limits.h.
639 (INT_STRLEN_BOUND): Remove.
640 * human.c: Include intprops.h.
641 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
642 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
643 * inttostr.h: Include intprops.h instead of limits.h.
644 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
645 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
646 for consistency with intprops.h.
647 (time_t_is_integer, twos_complement_arithmetic): Use them.
648 * sig2str.h: Include <signal.h>, intprops.h.
649 (INT_STRLEN_BOUND): Remove.
650 * strftime.c (TYPE_SIGNED): Remove.
651 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
652 * strtol.c: Adjust comments to match intprops.h.
653 * userspec.c: Include intprops.h.
654 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
655 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
656 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
657 instead of rolling our own expressions.
658 * xstrtol.c: Include xstrtol.h first, to test interface.
660 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
662 (my_strftime): Do not mishandle years close to INT_MAX, by doing
663 the right thing even if adding 1900 would overflow. Similarly
664 for tm_mon + 1 and tm_yday + 1.
665 Make %Y always equivalent to %C%y, and similarly for %G and %g.
666 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
667 (DO_SIGNED_NUMBER): New macro.
668 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
670 2005-03-07 Bruno Haible <bruno@clisp.org>
672 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
674 2005-03-03 Derek R. Price <derek@ximbiot.com>
675 Bruno Haible <bruno@clisp.org>
677 * pagealign_alloc.h: New file.
678 * pagealign_alloc.c: New file.
680 2005-01-28 Bruno Haible <bruno@clisp.org>
682 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
685 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
687 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
688 The workaround isn't strictly needed for POSIX conformance, and
689 it's too much of a pain to configure and maintain. We'll ask
690 people to fix their kernels instead.
691 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
692 (NANOSLEEP_BUG_WORKAROUND): Remove.
693 (xnanosleep): Remove the workaround.
695 2005-02-12 Bruno Haible <bruno@clisp.org>
697 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
699 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
701 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
702 * timespec.h (gettime): Return void, since it always
703 succeeds now. All uses changed.
704 * gettime.c (gettime) Likewise.
705 [HAVE_NANOTIME]: Prefer nanotime.
706 Assume gettimeofday succeeds, as POSIX requires.
707 Assime time () succeeds, since other code already does.
708 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
709 (timespec_subtract): Remove.
710 (NANOSLEEP_BUG_WORKAROUND): New constant.
711 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
712 things considerably. Use it only on GNU/Linux hosts, since the
713 workaround shouldn't be needed elsewhere.
715 2005-02-24 Bruno Haible <bruno@clisp.org>
717 * gettext.h: Update from GNU gettext 0.14.2.
719 2005-02-24 Bruno Haible <bruno@clisp.org>
721 * localcharset.c: Update from GNU gettext 0.14.2.
722 * config.charset: Update from GNU gettext 0.14.2.
724 2005-02-22 Simon Josefsson <jas@extundo.com>
726 * iconvme.h, iconvme.c: New files, from libc.
728 2005-02-20 Neil Conway <neilc@samurai.com>
730 * xgethostname.c (xgethostname): Check for ENOMEM, which is
731 returned by OSX/Darwin if the specified buffer is not large
732 enough for the hostname.
734 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
736 * memrchr.h: New file.
737 * chdir-long.c: Include it.
738 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
739 Don't bother including stddef.h.
741 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
743 * argp-help.c (__argp_help): Create a fake struct argp_state and
744 pass it to _help, otherwise the latter coredumps trying to
745 dereference state.root_argp.
747 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
749 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
751 Include <sys/types.h>, for dev_t.
752 (ME_DUMMY, ME_REMOTE): Move from here....
753 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
754 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
756 Include mountlist.h first, to test the interface.
758 2005-01-29 Bruno Haible <bruno@clisp.org>
760 * progname.c (program_name): Initialize.
761 Needed when linking statically on MacOS X.
763 2005-01-28 Bruno Haible <bruno@clisp.org>
765 * javacomp.sh.in: New file, from GNU gettext.
766 * javacomp.h: New file, from GNU gettext.
767 * javacomp.c: New file, from GNU gettext.
769 2005-01-26 Bruno Haible <bruno@clisp.org>
771 * javaexec.sh.in: New file, from GNU gettext.
772 * javaexec.h: New file, from GNU gettext.
773 * javaexec.c: New file, from GNU gettext.
775 2005-01-26 Simon Josefsson <jas@extundo.com>
777 * gai_strerror.c: Use GPL in header.
779 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
781 * argp-help.c (hol_entry_help): Avoid using non-constant
782 initializers for struct pentry_state.
783 (__argp_error): Check return value of __asprintf
784 (__argp_failure): Translate error message
786 * argp-parse.c: Removed braces around the expansion of N_()
788 2005-01-21 Jim Meyering <jim@meyering.net>
790 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
791 same value as for Solaris 9.
793 * chdir-long.c (chdir_long): Rewrite to remove limitation on
794 component length. This included changing the parameter to be
795 of type `char *' rather than `char const *'.
796 * chdir-long.h (chdir_long): Update prototype.
798 * openat.c (fdopendir, fstatat): New functions.
799 * openat.h: Include headers required for use of DIR and struct stat.
800 [AT_SYMLINK_NOFOLLOW]: Define.
801 (fdopendir, fstatat): Add prototypes.
803 2005-01-21 Bruno Haible <bruno@clisp.org>
805 * classpath.h: New file, from GNU gettext.
806 * classpath.c: New file, from GNU gettext.
808 2005-01-20 Simon Josefsson <jas@extundo.com>
810 * version-etc-fsf.c: New file, with version_etc_copyright.
811 * version-etc.c: Remove version_etc_copyright.
812 * version-etc.h (version_etc_copyright): Use [] instead of * in
813 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
815 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
817 * save-cwd.c (save_cwd): Remove code to support the case
818 where fchdir is missing or flaky.
820 2005-01-20 Simon Josefsson <jas@extundo.com>
822 * base64.h (isbase64): Add.
824 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
825 using a unsigned prototype, don't inline.
826 (base64_decode): Use it.
828 2005-01-19 Bruno Haible <bruno@clisp.org>
830 * sh-quote.h: New file, from GNU gettext.
831 * sh-quote.c: New file, from GNU gettext.
833 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
835 Merge changes from coreutils, as described below in several
836 changelogs dated today.
838 * save-cwd.c: Include "save-cwd.h" before other include files.
839 (O_DIRECTORY): Remove; not needed here, since "." must be
840 a directory. All uses removed.
841 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
842 universal on Suns, and we also need to test for IRIX.
843 Revamp code to use 'if' rather than '#if'.
844 Avoid unnecessary comparison of cwd->desc to 0.
846 * utimens.c (futimens): Robustify the previous patch, by checking
847 for known valid error numbers rather than observed invalid ones.
849 2005-01-18 Jim Meyering <jim@meyering.net>
851 * version-etc.c (version_etc_copyright): Update copyright date.
853 * utimens.c (futimens): Account for the fact that futimes
854 can also fail with errno == ENOSYS or errno == ENOENT.
855 Patch from Dmitry V. Levin.
857 Change the name of the robust chdir function from chdir to chdir_long.
858 * save-cwd.c: Include chdir-long.h rather than chdir.h.
859 (restore_cwd): Use chdir_long, not chdir.
860 * chdir-long.c: Renamed from chdir.c.
861 * chdir-long.h: Renamed from chdir.h.
862 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
865 2005-01-18 Bob Proulx <bob@proulx.com>
867 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
868 offsetof() macro construct to avoid compile failure with native HP-UX
869 11.0 ANSI C compiler.
871 2005-01-06 Bruno Haible <bruno@clisp.org>
873 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
874 because stpncpy.m4 takes care of it.
876 2004-01-24 Bruno Haible <bruno@clisp.org>
878 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
880 2003-10-09 Bruno Haible <bruno@clisp.org>
882 * progreloc.c: Include xalloc.h instead of xmalloc.h.
884 2005-01-06 Bruno Haible <bruno@clisp.org>
886 * fwriteerror.h (fwriteerror): Change specification to include fclose.
887 * fwriteerror.c: Include <stdbool.h>.
888 (fwriteerror): At the end, close the file stream. Record whether
889 stdout was already closed.
891 2004-05-27 Bruno Haible <bruno@clisp.org>
893 * execute.c (environ): Declare if needed.
894 * pipe.c (environ): Likewise.
895 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
897 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
899 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
900 definitions to be after all include files, to avoid collisions.
901 Problem reported by Bob Proulx.
903 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
905 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
906 not needed. This removes a dependency on the gettext module.
907 [defined _LIBC]: Do not include <libintl.h>; not needed.
909 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
911 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
914 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
916 * argp-parse.c: Include <stddef.h>.
917 (alignof, alignto): New macros.
918 (parser_init): Don't assume that void * is aligned sufficiently
921 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
922 need to extend the stack.
923 (YYINITDEPTH): New macro, so that the initial stack isn't overly
926 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
928 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
930 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
932 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
933 Remove now-obsolete comment about AIX.
934 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
935 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
936 (YYMAXDEPTH): New macro.
938 2004-12-18 Bruno Haible <bruno@clisp.org>
940 * fatal-signal.c (fatal_signals): Make non-const.
941 (init_fatal_signals): New function.
942 (uninstall_handlers, install_handlers): Ignore signals that were set to
944 (at_fatal_signal): Call init_fatal_signals.
945 (init_fatal_signal_set): Likewise. Ignore signals that were set to
947 Reported by Paul Eggert.
949 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
951 * getdate.y (textint): New member "negative".
952 (time_zone_hhmm): New function.
953 Expect 14 shift-reduce conflicts, not 13.
954 (o_colon_minutes): New rule.
955 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
956 (yylex): Set the "negative" member of signed numbers.
958 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
960 Changes imported from coreutils.
961 * hard-locale.c: Assume <locale.h> exists.
963 (GLIBC_VERSION): New macro.
964 (hard_locale): Assume setlocale exists.
965 Rewrite to avoid #ifdef.
966 Use strdup rather than malloc + strcpy.
967 * human.c: Assume <locale.h> exists.
968 (human_readable): Assume localeconv exists.
970 2004-12-01 Jakub Jelinek <jakub@redhat.com>
972 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
973 convert T2, not T. (Imported from libc.)
975 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
977 * getcwd.c (is_ENAMETOOLONG): New macro.
978 (__getcwd.c): Don't restore errno; glibc doesn't.
979 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
980 first, falling back to our code only if its results look suspicious.
981 Ensure that the resulting buffer is only as large as necessary.
983 * readutmp.c: Include readutmp.h first.
984 Include <errno.h>, since readutmp.h no longer does that.
985 * readutmp.h: Don't include <errno.h>,
986 <sys/param.h>, <time.h>; not needed to establish interface.
987 (errno): Remove decl.
988 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
989 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
990 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
992 2004-11-28 Simon Josefsson <jas@extundo.com>
994 * base64.h, base64.c: New file.
996 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
998 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
1000 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
1002 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
1003 HP's ANSI C compiler.
1004 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
1005 Declaring int functions causes warnings on some modern systems and
1006 shouldn't be needed to compile on ancient ones.
1007 * same.c (MIN) [defined MIN]: Don't define, since it's already
1010 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
1011 with the following changes.
1012 (__set_errno): Parenthesize properly.
1013 Include <stdbool.h>.
1014 (MIN, MAX, MATCHING_INO): New macros.
1015 (__getcwd): Define with prototype, not K&R form.
1016 Use heuristics to allocate default buffer on stack if possible.
1017 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
1018 behavior, and to avoid the PATH_MAX limit when computing
1020 Use MATCHING_INO to compare inode number to file.
1021 Check for arithmetic overflow in size calculations.
1022 Fix bug in reallocation of dot array that caused getcwd to fail
1023 on directories nested deeper than 75.
1024 Be more careful about saving errno on error.
1025 Do not use realloc; use only free+malloc, as this is a bit
1026 more flexible and avoids a needless copy operation.
1027 Do not inspect st_dev and st_ino for symbolic links; POSIX
1028 doesn't specify the latter.
1029 Check for closedir errors.
1030 Avoid needless casts.
1031 Use "#ifdef weak_alias" around weak_alias, to be like other
1033 The following changes to getcwd.c have effect only when used in
1034 gnulib; they have no effect inside glibc proper.
1035 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
1036 as alloca isn't used.
1037 (alloca, __alloca): Likewise.
1038 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
1039 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1040 unconditionally, as gnulib assumes C89 or better.
1041 Do not include <sys/param.h>.
1042 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
1043 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
1045 (NULL) [!defined NULL]: Remove; we assume C89 or better.
1046 Include <dirent.h> in a way that is compatible with modern Autoconf.
1047 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
1048 New macros, if not already defined.
1049 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
1050 Use "_LIBC", not "defined _LIBC", for consistency.
1051 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
1053 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
1054 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
1055 * xgetcwd.c: David MacKenzie's old code was removed, so give
1056 credit only to Jim Meyering and adjust the copyright dates.
1057 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
1058 <stdlib.h>, <unistd.h>, "pathmax.h".
1059 Instead, include "xgetcwd.h" (first) and "getcwd.h".
1060 (INITIAL_BUFFER_SIZE): Remove.
1061 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
1063 2004-11-23 Jim Meyering <jim@meyering.net>
1065 * getopt_.h: Remove trailing blanks.
1067 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1069 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
1070 (futimens): New function, which uses futimes if available.
1071 (futimens, utimens): Support timespec==NULL, with same semantics
1072 as utime and utimens.
1073 * utimens.h (futimens): New decl.
1075 2004-11-23 Jim Meyering <jim@meyering.net>
1077 * __fpending.c: Add comment.
1079 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1081 * getopt_.h: Re-addition of __getopt_argv_const caused
1082 redefinition warnings. To avoid them, include the defines
1083 in `#if !defined __need_getopt ... #endif'. The only place
1084 where __getopt_argv_const is used is in definitions
1085 of getopt_long and getopt_long_only below, which are as well
1086 protected by `#ifndef __need_getopt'.
1087 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
1088 __need_getopt after including <stdio.h> and <unistd.h> These
1089 headers might have defined it.
1091 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
1093 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
1095 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
1096 optopt): Use them instead of invoking ## directly; otherwise, the
1097 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
1099 2004-11-19 Bruno Haible <bruno@clisp.org>
1101 * strtok_r.c: Move comments from here...
1102 * strtok_r.h: ... to here.
1104 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
1106 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
1107 might fail. Problem reported by Yoann Vandoorselaere.
1108 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
1109 that mishandle size_t overflow.
1111 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1113 * canon-host.c: Include "strdup.h".
1114 (canon_host): Use getaddrinfo if available, so that IPv6 works.
1115 Use strdup instead of malloc/strcpy to duplicate strings.
1117 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
1118 (human_space_before_unit): New constant.
1119 * human.c (human_readable): Support it.
1121 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
1122 (xgetcwd): Set errno correctly when failing.
1123 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
1124 the failure is actually due to a PATH_MAX problem.
1126 Further getopt changes to make it more likely that glibc will
1127 buy the changes back.
1128 * getopt.c (POSIXLY_CORRECT): New constant.
1129 (getopt): Use it, so to preserve glibc semantic
1130 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
1131 when compiling for libc.
1132 * getopt_.h (__getopt_argv_const): Bring it back.
1133 (getopt_long, getopt_long_only): Use it.
1135 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
1136 New arg POSIXLY_CORRECT. All callers changed.
1137 (getopt): Argv is now char * const *, as per standard.
1138 (_getopt_internal_r, _getopt_internal): Argv is now char **,
1139 not char *__getopt_argv_const *.
1140 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1141 _getopt_long_only_r): Likewise.
1142 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
1143 * getopt_int.h (_getopt_internal, _getopt_internal_r,
1144 _getopt_long_r, _getopt_long_only_r): Likewise.
1145 * getopt_.h (__getopt_argv_const): Remove.
1146 (getopt): Argv is now char * const *, as per standard.
1148 * getdate.y (tORDINAL): New token.
1149 (day, relunit): Allow it for relative times.
1150 (relative_time_table): Use tORDINAL for ordinals.
1152 2004-11-15 Jim Meyering <jim@meyering.net>
1154 * closeout.c: Include "__fpending.h" once again.
1155 Include <stdbool.h>.
1156 (close_stdout): Don't fail just because stdout was closed initially,
1157 since some programs don't write to stdout in the normal course of
1158 operation (other than --version and --help), and we don't want this
1159 function to make e.g. `touch file >&-' fail.
1160 But do fail if it was closed and someone has tried to write to it.
1161 E.g., `printf foo >&-' must fail.
1163 2004-11-11 Simon Josefsson <jas@extundo.com>
1165 * strtok_r.h, strtok_r.c: New file.
1167 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
1169 * getopt_.h (__getopt_argv_const): New macro, to be used so that
1170 we can stop lying to compilers about the constness of argv when we
1171 are compiled outside glibc.
1172 (getopt, getopt_long, getopt_long_only): Use it.
1173 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
1175 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1176 _getopt_long_only_r): Likewise.
1177 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
1178 _getopt_long_only_r): Likewise.
1180 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
1181 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
1182 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
1183 the other external symbols.
1184 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
1185 declaration, since the above renaming now works around collisions.
1187 2004-11-11 Jim Meyering <jim@meyering.net>
1189 * linebreak.c: Remove trailing blanks.
1190 * alloca_.h: Likewise.
1191 * acosl.c: Likewise.
1192 * euidaccess.c: Likewise.
1193 * allocsa.h: Likewise.
1195 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
1197 * mktime.c (SHR): New macro, which is a portable
1198 substitute for >> that should work even on Crays.
1199 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
1200 Problem reported by Mark D. Baushke in
1201 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
1202 * getdate.y (SHR): Likewise.
1204 * strftime.c (SHR): Likewise.
1206 * quotearg.c (struct quoting_options): Use unsigned int for
1207 quote_these_too, so that right shifts are well defined. All uses
1210 2004-11-10 Simon Josefsson <jas@extundo.com>
1212 * getaddrinfo.h, getaddrinfo.c: New files.
1214 2004-11-10 Jim Meyering <jim@meyering.net>
1216 Ensure that no close failure goes unreported.
1217 * closeout.c (close_stdout): Always close stdout. I.e., don't
1218 return early when it seems there's nothing to flush.
1219 Don't include __fpending.h.
1221 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
1223 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
1225 2004-11-05 Bruno Haible <bruno@clisp.org>
1227 * readlink.c: Include stddef.h, needed for size_t on Woe32.
1228 Reported by Mark D. Baushke <mdb@cvshome.org>.
1230 2004-11-04 Bruno Haible <bruno@clisp.org>
1232 2004-09-11 Bruno Haible <bruno@clisp.org>
1233 * allocsa.valgrind: New file.
1234 2004-02-06 Bruno Haible <bruno@clisp.org>
1235 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
1236 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
1237 Reported by Christopher Seip <chris.seip@hp.com>.
1239 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1241 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
1242 with errno == ERANGE if the buffer is too small.
1243 Problem reported by Mark D. Baushke.
1245 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
1247 * xreadlink.c (MAXSIZE): New macro.
1248 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
1249 size does not exceed MAXSIZE. Avoid cast.
1250 As suggested by Mark D. Baushke in
1251 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
1252 if readlink fails with buffer size just under MAXSIZE, try again
1255 2004-11-02 Derek R. Price <derek@ximbiot.com>
1256 and Paul Eggert <eggert@cs.ucla.edu>
1258 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
1259 (get_date): Overparenthesize to avoid GCC warning.
1261 2004-11-02 Bruno Haible <bruno@clisp.org>
1263 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
1264 function returns void.
1266 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
1268 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1269 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
1272 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1274 * getdate.y: Add support for TZ="foo" within a date string.
1275 Fix some bugs near time_t boundaries. Reject dates with
1276 out-of-range components, e.g., "Sept 31".
1277 Include <stdlib.h>, "setenv.h", "xalloc.h".
1278 (ISDIGIT_LOCALE): Remove; unused.
1279 Note that the TZ and time functions used here are not reentrant.
1280 (mktime_ok, get_tz): New functions.
1281 (TZBUFSIZE): New constant.
1282 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
1283 This requires that we sometimes generate our own TZ="XXX..." setting.
1285 2004-10-27 Derek R. Price <derek@ximbiot.com>
1287 * mktime.c (not_equal_tm): Remove redundant check.
1289 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
1291 * getdate.y: Use Bison 1.875 features, and some minor
1292 code cleanups. This change does not affect semantics.
1293 Don't include <stdlib.h>; no longer needed.
1294 Don't include unlocked-io.h; only the "#if TEST" code uses
1295 stdio, and performance isn't crucial there.
1296 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
1297 Bison 1.875 features as described below.
1298 All uses of "PC." replaced by "pc->".
1299 (YYSTYPE): Add a forward declaration.
1300 (yylex, yyerror): Use full prototypes in forward decls.
1301 Use "%pure-parser" rather than obsolescent "%pure_parser".
1302 Use %parse-param and %lex-param instead of obsolescent
1303 YYPARSE_PARAM and YYLEX_PARAM.
1304 (meridian_table, month_and_day_table, time_units_table,
1305 relative_time_table, time_zone_table, military_table,
1306 lookup_zone, lookup_word, get_date):
1307 Use NULL instead of 0 where appropriate.
1308 (to_hour): Avoid abort (), to avoid a dependency on
1310 (yyerror, yylex): Now accepts parser_control * arg.
1311 (main) [TEST]: Use '\0' rather than 0 for char.
1313 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
1315 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
1316 It's now the caller's responsibility to handle the case where
1317 !HAVE_GETPAGESIZE && !defined getpagesize.
1319 * mktime.c (leapyear): Arg is long int, not int.
1321 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
1323 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
1325 2004-10-12 Simon Josefsson <jas@extundo.com>
1327 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1328 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
1331 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
1333 * vsnprintf.h: New file.
1334 * vsnprintf.c: New file.
1336 2004-10-07 Bruno Haible <bruno@clisp.org>
1338 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
1339 into the provided buffer.
1341 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
1343 * diacrit.c, diacrit.h: Add GPL notice.
1345 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
1346 * atanl.c (atanl): Keep the code as similar to glibc as possible.
1347 * logl.c (logl): Keep the code as similar to glibc as possible.
1348 This avoids a potential constant-folding bug.
1350 2004-10-05 Bruno Haible <bruno@clisp.org>
1352 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
1354 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1356 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
1357 * xmalloc.c (xmemdup): Likewise.
1358 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
1359 XFREE): Remove these long-obsolescent macros.
1360 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
1361 * xstrdup.c: Remove.
1363 * regex.c (re_comp): Cast gettext return value to char *,
1364 Problem reported by Martin Neitzel via Mark D. Baushke.
1366 2004-10-04 Simon Josefsson <jas@extundo.com>
1368 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
1369 '#ifdef USE_UNLOCKED_IO'.
1371 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1373 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
1374 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
1375 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
1376 regex.c, sha1.c, version-etc.c, yesno.c:
1377 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
1378 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
1379 the includer's responsibility.
1381 Sync from coreutils.
1383 * modechange.c (mode_compile): Don't decrement a pointer that
1384 points to the start of a string, as the C Standard says the
1385 resulting behavior is undefined.
1387 * backupfile.h (enum backuptype): Rename none -> no_backups,
1388 simple -> simple_backups, numbered_existing ->
1389 numbered_existing_backups, numbered -> numbered_backups
1390 to avoid shadowing problems. All uses changed.
1391 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
1392 * backupfile.c (check_extension, numbered_backup):
1393 Rename locals to avoid shadowing 'basename'.
1394 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
1397 * .cppi-disable: Add getopt_.h, getopt_int.h.
1398 * .cvsignore: Add getopt.h.
1400 2004-10-04 Simon Josefsson <jas@extundo.com>
1402 * memmem.h: New file.
1403 * memmem.c: New file, taken from glibc.
1405 2004-10-02 Jim Meyering <jim@meyering.net>
1407 * dirfd.h, getpagesize.h: Add copyright notice.
1409 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
1411 * snprintf.c: Remove comments as to why each header is needed.
1413 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
1415 * strsep.h: New file.
1416 * strsep.c: New file.
1418 2004-10-01 Simon Josefsson <jas@extundo.com>
1420 * snprintf.c (snprintf): Handle size==0.
1422 2004-10-01 Simon Josefsson <jas@extundo.com>
1423 Bruno Haible <bruno@clisp.org>
1425 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
1426 (snprintf): Declare 'args'.
1428 2004-09-30 Simon Josefsson <jas@extundo.com>
1430 * snprintf.h, snprintf.c: New files.
1432 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1434 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
1435 (hol_entry_help): Never translate an empty string.
1436 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
1437 * argp.h (OPTION_NO_TRANS): New option.
1439 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
1441 * xvasprintf.c: Include xalloc.h.
1442 (xvasprintf): Use xalloc_die, not xmalloc_die.
1444 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
1446 * dummy.c: Change copyright notice to FSF, and license to GPL.
1448 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
1450 * argp-pvh.c (argp_program_version_hook): Provide initial value.
1451 Problem reported by Bruno Haible in:
1452 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
1454 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
1456 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
1457 in case some system header has #define'd it. Problem reported by
1458 Soeren D. Schulze in
1459 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
1461 2004-09-08 Bruno Haible <bruno@clisp.org>
1463 * stdint_.h.in: New file, taken from GNU clisp.
1465 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
1467 * xvasprintf.h: New file.
1468 * xvasprintf.c: New file.
1469 * xasprintf.c: New file.
1471 2004-09-08 Bruno Haible <bruno@clisp.org>
1473 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
1475 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
1477 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
1479 Import from coreutils.
1480 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
1481 strings on unbounded length. alloca's performance benefits aren't
1482 that important here.
1484 (parse_with_separator): New function, with most of the internals
1485 of the old parse_user_spec. Allow user to omit both user and group,
1486 for compatibility with FreeBSD.
1487 Clone only the user name, not the entire spec.
1488 Do not set *uid, *gid unless entirely successful.
1489 Avoid memory leak in some failing cases.
1490 Fix regression for USER.GROUP reported by Dmitry V. Levin in
1491 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1492 (parse_user_spec): Rewrite to use parse_with_separator.
1494 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
1496 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
1497 its complicated substitute.
1498 * argp-help.c: Include <errno.h>, for program_invocation_short_name
1499 and program_invocation_name.
1500 (__argp_basename) [!_LIBC]: Remove; the only use was
1501 replaced by its body.
1502 (__argp_short_program_name): Change condition from
1503 !defined __argp_short_program_name to
1504 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
1505 to match argp-namefrob.h.
1506 (__argp_failure): Don't assume strerror_r returns char *.
1507 * argp-parse.c (N_): Define unconditionally.
1508 (argp_default_options): Fill out initializers with 0 to avoid
1511 2004-08-12 Simon Josefsson <jas@extundo.com>
1513 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
1514 * getopt_.h: Renamed from getopt.h.
1516 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1518 Merge from coreutils.
1520 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
1521 wmemchr or wmemcpy. Problem reported by Robert Dahlem
1522 for Reliant Unix 5.43.
1524 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
1525 (union fooround): Use uintmax_t, not long int.
1526 The rest is a merge from libc:
1527 [defined _LIBC]: Include <shlib-compat.h>.
1528 (_obstack) [defined _LIBC]: Remove after 2.3.4.
1530 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
1532 * strverscmp.c: Convert to UTF-8.
1534 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
1536 * obstack.h (obstack_empty_p):
1537 Don't assume that chunk->contents is suitably aligned.
1538 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
1539 Likewise. Problem reported by Benno in
1540 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
1542 * chown.c (rpl_chown): Work even if the file is writeable but not
1543 readable. This could be improved further but it'd take some work.
1545 2004-08-08 Simon Josefsson <jas@extundo.com>
1547 * xgethostname.c: Don't include error.h (not used).
1550 * getpass.c: Include getpass.h first.
1552 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
1554 * xalloc-die.c: New files.
1555 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
1557 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
1558 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
1559 (_, N_, xalloc_die): Move to xalloc-die.c.
1560 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
1561 so that we needn't mess with xalloc_msg_memory_exhausted.
1563 * sha1.h: Renamed from sha.h.
1564 (SHA1_H): Renamed from _SHA_H.
1565 (sha1_ctx): Renamed from sha_ctx.
1566 (sha1_init_ctx): Renamed from sha_init_ctx.
1567 (sha1_process_block): Renamed from sha_process_block.
1568 (sha1_process_bytes): Renamed from sha_process_bytes.
1569 (sha1_finish_ctx): Renamed from sha_finish_ctx.
1570 (sha1_read_ctx): Renamed from sha_read_ctx.
1571 (sha1_stream): Renamed from sha_stream.
1572 (sha1_buffer): Renamed from sha_buffer.
1573 * sha1.c: Likewise; renamed from sha.c.
1574 Do not include <sys/types.h>.
1575 Include <stddef.h> rather than <stdlib.h>.
1577 2004-08-08 Bruno Haible <bruno@clisp.org>
1579 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
1580 FILESYSTEM_PREFIX_LEN.
1581 * progreloc.c: Likewise.
1582 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
1584 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
1587 * argp-help.c (make_hol, hol_append): Don't assume that
1588 SIZE_MAX is a valid preprocessor constant.
1589 (__argp_basename): Change from "#ifndef _LIBC"
1590 to "#ifndef __argp_short_program_name", so that
1591 we don't compile these functions for tar.
1593 More merges from coreutils.
1594 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
1595 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
1597 * addext.c: Remove; no longer needed.
1598 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
1599 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
1600 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
1601 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
1602 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
1603 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
1604 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
1605 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
1606 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
1607 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
1608 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
1609 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
1610 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
1611 Import changes from coreutils.
1613 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
1615 Merge from coreutils.
1617 * .gdb-history: Remove; this doesn't belong here.
1619 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
1620 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
1621 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
1623 * dirname.h: Include <stdbool.h>.
1624 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
1625 for consistency with POSIX terminology. All uses changed.
1626 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
1627 (strip_trailing_slashes): Use bool for booleans.
1628 * stripslash.c (strip_trailing_slashes): Likewise.
1630 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1631 sometimes returns a positive errno value even when it succeeds.
1632 (print_errno_message) [!LIBC]: Fall back on strerror if
1635 * path-concat.c (mempcpy): Don't define if a system header defines it.
1636 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
1637 (longest_relative_suffix): New function.
1638 (path_concat): Use it. Assume first argument is not NULL.
1639 Port to DOS. Omit redundant separators.
1640 Report an error instead of returning NULL.
1641 Use mempcpy instead of memcpy.
1642 (xpath_concat): Remove: not declared or used.
1644 * same.h: Include <stdbool.h>
1645 (same_name): Return bool, not int.
1646 * same.c (same_name): Likewise.
1647 (errno): Don't declare; we assume C89 or better now.
1649 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
1650 if not already defined.
1652 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
1653 * dup-safer.c (errno): Likewise.
1655 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
1657 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
1660 2004-08-03 Simon Josefsson <jas@extundo.com>
1662 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
1663 * progname.h: Don't include stdbool.h.
1665 2004-08-02 Simon Josefsson <jas@extundo.com>
1667 * getsubopt.h: New file, with comments from Bruno Haible.
1668 * getsubopt.c: New file, from glibc, but slightly modified based on
1669 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
1671 2004-08-01 Simon Josefsson <jas@extundo.com>
1673 * xgetdomainname.c: Include stdlib.h, for free().
1675 2004-07-16 Simon Josefsson <jas@extundo.com>
1677 * dummy.c: New file.
1679 2004-07-16 Bruno Haible <bruno@clisp.org>
1681 * backupfile.h: Add extern "C" for C++.
1682 * closeout.h: Likewise.
1683 * copy-file.h: Likewise.
1684 * findprog.h: Likewise.
1685 * full-write.h: Likewise.
1686 * pathname.h: Likewise.
1687 * progname.h: Likewise.
1688 * stpcpy.h: Likewise.
1689 * stpncpy.h: Likewise.
1690 * strcase.h: Likewise.
1691 * strstr.h: Likewise.
1692 * xalloc.h: Likewise.
1694 * mbswidth.h: Add extern "C" for C++.
1695 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
1697 2004-07-09 Simon Josefsson <jas@extundo.com>
1699 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
1700 failed without this.)
1702 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
1704 * fchown-stub.c: New file.
1706 2004-06-24 Jim Meyering <jim@meyering.net>
1708 * obstack.h (obstack_base): Cast to (void *), per documentation.
1710 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
1712 * argz.c, argz_.h: New files, which are autoupdated from libtool.
1714 2004-06-01 Jim Meyering <jim@meyering.net>
1716 * calloc.c: New file.
1718 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
1720 * getdate.y (yylex): Allow space between sign and number.
1721 Problem reported by Dan Jacobson.
1723 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
1724 and Jim Meyering <jim@meyering.net>
1726 Merge from coreutils CVS.
1728 * stat-macros.h: New file, with contents from file-type.h
1729 and coreutils' system.h.
1730 * file-type.c: Include "stat-macros.h".
1731 * file-type.h (file_type): Move all macro definitions to new file,
1734 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
1735 Wrap old code with this conditional.
1736 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
1737 function that does not dereference symlinks.
1738 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
1740 * xreadlink.c: Include xreadlink.h first, to catch .h file
1741 dependency problems.
1742 (xreadlink): Accept new arg SIZE, for efficiency.
1743 All decls and uses changed.
1744 * xreadlink.h: Include <stddef.h>, for size_t.
1746 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
1747 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
1749 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
1751 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
1753 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
1754 macros to be defined.
1755 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
1756 the allocator returns NULL because the requested size is zero.
1758 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
1760 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
1761 var. Add comment explaining why libc still defines it. This
1762 merges the following patch from glibc:
1763 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
1765 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
1767 * obstack.c (_obstack): Remove unused variable. It hasn't been
1768 present in glibc since revision 1.1 of this file.
1769 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
1770 obstack_alignment_mask, obstack_alloc, obstack_base,
1771 obstack_blank, obstack_blank_fast, obstack_chunk_size,
1772 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
1773 obstack_grow0, obstack_init, obstack_int_grow,
1774 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
1775 obstack_next_free, obstack_object_size, obstack_ptr_grow,
1776 obstack_ptr_grow_fast, obstack_room): Remove declarations of
1777 nonexistent functions.
1779 2004-05-17 Derek R. Price <derek@ximbiot.com>
1780 Paul Eggert <eggert@cs.ucla.edu>
1782 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
1784 2004-05-14 Bruno Haible <bruno@clisp.org>
1786 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
1787 that consists of a '.' followed by an empty digit string.
1788 Patch by Tor Lillqvist <tml@iki.fi>.
1790 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
1792 Port obstack to the AS/400, where pointers are 16 bytes wide and
1793 you cannot cast an integer to a valid pointer. This patch is
1794 currently waiting to be integrated into glibc; see
1795 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
1797 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
1798 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
1799 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
1800 (struct obstack): temp member is now a union of a pointer and
1801 an integer, instead of an integer. All integer uses changed.
1802 This does not affect the physical layout of struct obstack,
1803 except on hosts (like the AS/400) where the size or alignment of
1804 void * is greater than that of ptrdiff_t.
1805 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
1806 __STDC__)]: Store temporary in pointer member of union, not
1808 * obstack.c: Include <stddef.h>, for offsetof.
1809 (struct fooalign): Remove; it doesn't need a name.
1810 (union fooround): Change double to long double, and add void *.
1811 (DEFAULT_ALIGNMENT): Use offsetof to compute.
1812 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
1813 not a macro. Hence the values are always int; so remove all
1814 casts-to-int in uses.
1816 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
1817 Derek Price <derek@ximbiot.com>
1819 * alloca.c: Include <alloca.h>, to get our interface.
1820 * alloca_.h: Use __alloca on AIX, so that we don't have to
1821 include <alloca.h> first. Use C89 prototype for alloca; this
1822 requires including <stddef.h> for size_t. Use extern "C" if C++.
1823 Use #elif for simplicity, since we can assume C89 now.
1824 Don't try to source the system alloca.h since it will not be found
1825 and to prevent recursively including its replacement.
1826 * fnmatch.c: Include <alloca.h> instead of opencoding.
1827 * regex.c: Likewise.
1829 2004-05-16 Derek Price <derek@ximbiot.com>
1830 Paul Eggert <eggert@cs.ucla.edu>
1832 getline cleanup. This changes the getndelim2 API: both order of
1833 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
1836 * getline.c: Don't include stddef.h or stdio.h, since our
1837 interface does that.
1838 (getline): Always use getdelim, so that we don't have two
1839 copies of this code.
1840 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
1842 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
1843 (GETNDELIM2_MAXIMUM): New macro.
1844 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
1845 instead of the old practice of delim2==0. All callers changed.
1846 Return -1 on overflow, instead of returning junk.
1847 Do not set *linesize unless allocation succeeds.
1848 * getndelim2.h: Do not include stddef.h; no longer needed, now
1849 that we include sys/types.h.
1850 * getnline.h: Likewise.
1851 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
1852 (getndelim2): Reorder arguments.
1853 * getnline.c (getnline, getndelim):
1854 Don't discard the NMAX argument.
1855 (getnline): Invoke getndelim, to avoid code duplication.
1856 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
1857 of (size_t) -1 by callers of the getnline family.
1859 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
1861 * nanosleep.c (suspended): Change its type from int to
1862 sig_atomic_t volatile.
1863 (first_call): Make it private to rpl_nanosleep, and have it
1864 be zero initially as that's a bit faster.
1865 (my_usleep): Round up fractional times instead of truncating them,
1866 as this is the usual meaning for 'sleep'.
1868 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
1870 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
1871 (ENOSYS): Define if not defined.
1872 (settime): Fall back on stime if it exists and settimeofday fails.
1873 But don't bother with fallbacks if a method fails with errno == EPERM.
1875 2004-05-11 Jim Meyering <jim@meyering.net>
1877 Prior to this change, the save_cwd caller required read access to the
1878 current directory on most systems (ones with the fchdir function).
1880 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
1881 fails, try write-only, and finally, resort to using xgetcwd.
1883 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
1885 * obstack.c, obstack.h: Import changes from libc.
1887 2004-04-28 Bruno Haible <bruno@clisp.org>
1889 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
1890 implicitly appends .exe to executables.
1891 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
1892 accepts Windows pathnames.
1893 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1894 Cygwin like Windows, since it now accepts Windows pathnames.
1895 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1896 Cygwin like Windows, since it now accepts Windows pathnames.
1897 Reported by Derek Robert Price <derek@ximbiot.com>.
1899 2004-04-20 Jim Meyering <jim@meyering.net>
1901 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
1903 2004-04-20 Jim Meyering <jim@meyering.net>
1904 Bruno Haible <bruno@clisp.org>
1906 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
1907 memory when realloc fails.
1909 2004-04-18 Jim Meyering <jim@meyering.net>
1911 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
1912 don't leak memory and do call END_UTMP_ENT.
1914 2004-04-11 Paul Eggert <eggert@twinsun.com>
1916 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
1917 (CHAR_BIT): Remove, since we assume C89.
1918 Include <stdint.h> if available, as per current Autoconf CVS advice.
1920 2004-03-30 Paul Eggert <eggert@twinsun.com>
1922 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
1923 not bool, to be more consistent with Unix conventions.
1924 Suggested by Bruno Haible.
1926 Merge from coreutils.
1928 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
1931 * getdate.h: Include stdbool.h, and timespec.h instead of
1932 the usual <time.h> dance.
1933 (get_date): Change signature to support fractional time stamps.
1934 All callers changed.
1935 * getdate.y: Include "getdate.h" first, as we can now
1936 assume C89 and don't need to worry about 'const'.
1937 Similarly, include "unlocked-io.h" near start, not in middle.
1939 (textint.value): Use long int rather than int.
1940 (textint.digits): Use size_t rather than int.
1941 (BILLION, LOG10_BILLION): New constants.
1942 (parser_control): New member rel_ns. Members day_ordinal,
1943 time_zone, month, day, hour, minutes, rel_year, rel_month,
1944 rel_day, rel_hour, rel_minutes, rel_seconds
1945 are now long int, not int. Member seconds is now struct timespec,
1946 not int. New member timespec_seen. Members dates_seen, days_seen,
1947 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
1949 (%union.intval): Now long int, not int.
1950 New member timespec.
1951 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
1952 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
1953 (spec): Now is a timespec or an item list.
1954 (timespec, items): New nonterminals.
1955 (time, rel, relunit, number, get_date):
1956 Add support for fractional seconds.
1957 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
1958 (gmtime, localtime, mktime): Remove decls; not needed with C89.
1959 (to_hour): First arg is now long int, not int.
1960 (to_year): Returns long int, not int.
1961 Don't treat year -70 like 70.
1962 (tm_diff): Returns long int, not int.
1963 (lookup_word): Use bool instead of int when appropriate.
1964 (yylex): Use size_t for count, not int.
1965 Detect overflow when parsing large integer constants.
1966 Add support for fractions.
1967 (get_date): Make pointers 'const' if possible.
1968 Use more-portable code to detect integer overflow.
1969 (main) [TEST]: Adjust to above changes. Test for localtime failure.
1970 Don't use ctime; it's not reliable if the year has >4 digits.
1972 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
1973 This is for compatibility with BSD.
1975 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
1976 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
1977 From coreutils' system.h.
1979 * userspec.c: Don't include "posixver.h".
1980 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
1981 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
1982 compatible extension. Simplify code by removing a boolean int
1983 that was always nonzero if a string was nonnull.
1985 2004-03-30 Jim Meyering <jim@meyering.net>
1987 Merge from coreutils.
1989 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
1991 * readtokens.c (readtoken): Don't leak 64 bytes when reading
1992 an empty input stream.
1994 * readtokens.c: Include <stdbool.h>.
1995 (readtoken): Use `size_t' rather than int/long.
1996 All callers adjusted.
1997 Use `bool' rather than `int' where appropriate.
1998 Use memset rather than an explicit loop.
1999 Use x2nrealloc rather than xrealloc.
2000 Allow the use of `\0' as a delimiter.
2001 (readtokens): Likewise.
2002 * readtokens.h (readtoken, readtokens): Update prototypes.
2004 2004-03-30 Bruno Haible <bruno@clisp.org>
2006 * getloadavg.c (getloadavg): Don't assume setlocale returns
2009 2004-03-29 Paul Eggert <eggert@twinsun.com>
2011 Merge changes to getloadavg.c from coreutils and Emacs.
2013 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
2014 Define to an expression, not to the empty string.
2015 Include cloexec.h and xalloc.h.
2016 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
2017 Use set_cloexec_flag rather than rolling our own.
2018 * cloexec.c, cloexec.h: New files.
2020 2004-03-18 Paul Eggert <eggert@twinsun.com>
2022 * getopt.h: Sync with libc CVS.
2024 2004-03-18 Paul Eggert <eggert@twinsun.com>
2025 Bruno Haible <bruno@clisp.org>
2027 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
2028 not on all platforms that have <wchar.h>.
2029 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
2031 2004-03-09 Paul Eggert <eggert@twinsun.com>
2033 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
2035 * getopt_int.h: New file, also synced from libc.
2037 2004-03-07 Paul Eggert <eggert@twinsun.com>
2039 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
2040 '#if' expressions. Unlike the code it replaces, it does not
2041 depend on (defined _SC_PAGESIZE). However, it does depend on
2042 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
2043 first reported by Jason Andrade in
2044 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
2046 2004-01-18 Simon Josefsson <jas@extundo.com>
2048 * strdup.h: New file.
2049 * strdup.c: Include it.
2050 * path-concat.c: Include strdup.h. Drop strdup declaration.
2051 * userspec.c: Include strdup.h. Drop strdup declaration.
2053 2004-02-06 Karl Berry <karl@gnu.org>
2055 * config.charset: update from gettext 0.14.1.
2057 2004-02-05 Paul Eggert <eggert@twinsun.com>
2059 Add comments and code, prompted by suggestions from Bruno Haible
2061 * quotearg.h (quotearg_alloc): New decl. Improve the comments
2062 describing the enum quoting_style values.
2063 * quotearg.c (quotearg_alloc): New function.
2064 (quotearg_buffer_restyled): Treat lone { and } as special.
2065 Treat = as special. Work around bug with older shells
2066 that "see" a '\' that is really the 2nd byte of a multibyte char.
2067 Quote empty string with shell_quoting_style.
2069 2004-02-03 Bruno Haible <bruno@clisp.org>
2071 * pipe.h: New file, from GNU gettext.
2072 * pipe.c: New file, from GNU gettext.
2074 2004-01-27 Bruno Haible <bruno@clisp.org>
2076 * execute.h: New file, from GNU gettext.
2077 * execute.c: New file, from GNU gettext.
2078 * w32spawn.h: New file, from GNU gettext.
2080 2004-01-23 Paul Eggert <eggert@twinsun.com>
2082 Exit-status fix from coreutils.
2084 Use exit_failure consistently in place of EXIT_FAILURE,
2085 so that program exit statuses are consistent on failure.
2087 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
2088 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
2089 * argmatch.h: Comment fix to match the above.
2090 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
2091 Now a macro referring to exit_failure, instead of a separate
2092 variable. Include "exitfail.h" to get it.
2093 * xstrtol.h: Include "exitfail.h".
2094 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
2096 * long-options.c (parse_long_options): Use prototype
2097 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
2100 2004-01-21 Jim Meyering <jim@meyering.net>
2102 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
2103 so as not to conflict with a different-sized __mktime_internal
2104 function in GNU libc.
2105 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
2106 Problem building statically-linked `ls' reported by Michael Brunnbauer.
2108 2004-01-18 Paul Eggert <eggert@twinsun.com>
2110 Merge from diffutils.
2112 * file-type.c (file_type): Add typed memory objects.
2113 * file-type.h (S_TYPEISTMO): New macro.
2115 * c-stack.h (c_stack_action): Remove argv argument.
2116 * c-stack.c (c_stack_action): Likewise. All uses changed.
2117 (die): Don't calculate message unless segv_action returns.
2118 (get_stack_location, min_address_from_argv, max_address_from_argv,
2119 volatile stack_base, volatile_stack_size): Remove.
2120 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
2121 that every segmentation violation is a stack overflow. (Ouch!)
2122 See Debian bug 136249 (still outstanding) for more info about why
2123 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
2125 2003-11-30 Bruno Haible <bruno@clisp.org>
2127 Safer stack allocation.
2128 * setenv.c: Include allocsa.h.
2129 (alloca): Remove fallback definition.
2130 (freea): Remove macro.
2131 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
2134 2003-10-17 Bruno Haible <bruno@clisp.org>
2136 * binary-io.h: Avoid warnings on Cygwin.
2138 2003-12-28 Bruno Haible <bruno@clisp.org>
2140 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
2141 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
2143 2003-11-28 Bruno Haible <bruno@clisp.org>
2145 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
2147 2003-11-27 Bruno Haible <bruno@clisp.org>
2149 * wait-process.c: On Windows, include windows.h. Needed on mingw.
2151 2003-11-17 Bruno Haible <bruno@clisp.org>
2153 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
2155 2003-11-24 Bruno Haible <bruno@clisp.org>
2157 * xallocsa.h: New file, from GNU gettext.
2158 * xallocsa.c: New file, from GNU gettext.
2160 2003-11-24 Bruno Haible <bruno@clisp.org>
2162 * allocsa.h: New file, from GNU gettext.
2163 * allocsa.c: New file, from GNU gettext.
2165 2003-11-24 Bruno Haible <bruno@clisp.org>
2167 * eealloc.h: New file.
2169 2004-01-15 Jim Meyering <jim@meyering.net>
2171 Merge from coreutils.
2173 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
2174 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
2175 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
2177 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
2178 optional configure-time default.
2180 * version-etc.c (version_etc_copyright): Update copyright date.
2182 * xreadlink.c (xreadlink): Correct outdated comment.
2184 2004-01-15 Paul Eggert <eggert@twinsun.com>
2186 Merge from coreutils.
2188 * posixver.c: Include posixver.h.
2190 * same.c: Include <stdbool.h>, <limits.h>.
2191 (_POSIX_NAME_MAX): Define if not defined.
2193 (same_name): If file names are silently truncated, report
2194 that the file names are the same if they are the same after
2195 the silent truncation.
2197 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
2198 conversion function.
2199 * xstrtod.c (xstrtod): Likewise. All callers changed to
2200 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
2203 2004-01-14 Paul Eggert <eggert@twinsun.com>
2205 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
2206 with like-named macro in fnmatch.c.
2207 (EXT): Use an internal constant instead.
2209 Merge fnmatch patches from glibc.
2210 * fnmatch.c (mbsinit): Remove define.
2211 Add libc_hidden_ver (__fnmatch, fnmatch).
2212 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
2213 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
2215 2003-12-14 Karl Berry <karl@gnu.org>
2217 * config.charset: update from gettext-runtime.
2219 2003-12-03 Paul Eggert <eggert@twinsun.com>
2221 * getgroups.c (getgroups): xmalloc takes one argument, not two.
2222 Bug reported by Alfred M. Szmidt.
2224 2003-11-29 Karl Berry <karl@gnu.org>
2226 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
2228 2003-11-23 Paul Eggert <eggert@twinsun.com>
2229 Bruno Haible <bruno@clisp.org>
2231 * printf-parse.h: Don't include sys/types.h.
2232 (ARG_NONE): New macro.
2233 (char_directive): Change type of *arg_index fields to size_t.
2234 * printf-parse.c: Don't include sys/types.h.
2235 (SSIZE_MAX): Remove macro.
2236 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
2237 Remove unnecessary overflow check.
2238 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
2241 2003-11-24 Paul Eggert <eggert@twinsun.com>
2243 * alloca.c: Remove dependency on xalloc module.
2244 (xalloc_die): Remove.
2245 (memory_full) [!defined emacs]: New macro.
2246 [!defined emacs]: Don't include xalloc.h.
2247 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
2248 address arithmetic overflows. Change datatypes a bit to avoid
2251 2003-11-22 Jim Meyering <jim@meyering.net>
2253 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
2255 2003-11-17 Bruno Haible <bruno@clisp.org>
2257 * vasnprintf.c (alloca): Remove fallback definition.
2258 (freea): Remove definition.
2259 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
2260 Reported by Paul Eggert.
2262 2003-11-17 Jim Meyering <jim@meyering.net>
2264 On systems without utime and without a utimes function capable of
2265 dealing with a NULL struct utimbuf* argument, this utime replacement
2266 could -- in unusual circumstances -- leak a file descriptor.
2267 * utime.c: Include <unistd.h> and <errno.h>.
2268 (utime_null): Be sure to close `fd' and to preserve errno.
2269 Reported by Geoff Collyer via Arnold Robbins.
2271 2003-11-16 Paul Eggert <eggert@twinsun.com>
2272 Bruno Haible <bruno@clisp.org>
2274 Protect against address arithmetic overflow.
2275 * printf-args.h: Include stddef.h.
2276 (arguments): Change type of field 'count' to size_t.
2277 * printf-args.c (printf_fetchargs): Use size_t instead of
2278 'unsigned int' where appropriate.
2279 * printf-parse.h: Include sys/types.h.
2280 (char_directive): Change type of *arg_index fields to ssize_t.
2281 (char_directives): Change type of fields 'count', max_*_length to
2283 * printf-parse.c: Include sys/types.h and xsize.h.
2284 (SSIZE_MAX): Define fallback value.
2285 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
2286 instead of 'int' where appropriate. Check a_allocated, d_allocated
2287 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
2288 * vasnprintf.c: Include xsize.h.
2289 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
2290 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
2291 overflow. Avoid wraparound when converting a width or precision from
2294 2003-11-16 Bruno Haible <bruno@clisp.org>
2296 Update from GNU gettext.
2297 * printf-parse.c: Generalize to it can be compiled for wide strings.
2298 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
2299 * vasnprintf.c: Generalize to it can be compiled for wide strings.
2300 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
2301 SNPRINTF): New macros.
2302 Don't include <alloca.h> if the file is used inside libintl.
2303 (local_wcslen): New function, for Solaris 2.5.1.
2304 (VASNPRINTF): Use it instead of wcslen.
2306 2003-11-16 Bruno Haible <bruno@clisp.org>
2308 * xsize.h (xmax): New function.
2309 (xsum, xsum3, xsum4): Declare as "pure" functions.
2311 2003-11-12 Paul Eggert <eggert@twinsun.com>
2313 * xalloc.h: Do not include <limits.h> or <stdint.h>.
2314 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
2315 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
2316 heuristic is just as accurate as far as we know, and it removes a
2317 dependency on size_max.m4 and ptrdiff_max.m4.
2319 2003-11-12 Paul Eggert <eggert@twinsun.com>
2321 * xstrtol.c (__xstrtol): Remove "break" immediately after
2322 "return", to pacify some unknown compiler. Problem reported
2325 2003-11-11 Bruno Haible <bruno@clisp.org>
2327 * xsize.h (SIZE_MAX): Remove fallback definition.
2328 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
2331 2003-11-10 Paul Eggert <eggert@twinsun.com>
2333 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
2334 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
2335 rejected some allocations of exactly SIZE_MAX - 2 bytes.
2337 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
2338 not (size_t) -1, since it's defined here.
2340 2003-11-06 Paul Eggert <eggert@twinsun.com>
2342 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
2343 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
2344 Reject sizes of exactly SIZE_MAX bytes.
2345 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
2346 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
2348 2003-11-05 Bruno Haible <bruno@clisp.org>
2350 * xsize.h: Include limits.h, to avoid a possible collision with
2351 SIZE_MAX defined in <limits.h> on Solaris.
2353 2003-11-04 Bruno Haible <bruno@clisp.org>
2355 * xsize.h: New file.
2356 * linebreak.c: Include xsize.h.
2357 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
2358 argument for overflow.
2359 Suggested by Paul Eggert.
2361 2003-10-31 Bruno Haible <bruno@clisp.org>
2363 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
2364 to avoid (extremely rare) race condition.
2365 Suggested by Paul Eggert.
2367 2003-11-03 Jim Meyering <jim@meyering.net>
2369 * userspec.c: Include "userspec.h".
2370 * userspec.h: New file.
2372 2003-10-31 Paul Eggert <eggert@twinsun.com>
2374 * mountlist.h (struct mount_entry.me_type_malloced): New member.
2375 * mountlist.c (SIZE_MAX): Define if not defined already.
2376 (read_filesystem_list): Set and use me_type_malloced.
2377 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
2378 whatever the type happens to be), for brevity and consistency.
2379 Check for size calculation overflow on Alphas running OSF/1.
2381 2003-10-31 Jim Meyering <jim@meyering.net>
2383 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
2385 * linebuffer.c: Include <string.h> for declaration of memset.
2387 2003-10-30 Paul Eggert <eggert@twinsun.com>
2388 Bruno Haible <bruno@clisp.org>
2390 * vasprintf.c: Include <limits.h>, <stdlib.h>.
2391 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
2393 2003-10-29 Paul Eggert <eggert@twinsun.com>
2395 * xalloc.h (xalloc_oversized): Now a macro, not a function,
2396 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
2398 * quotearg.c (quotearg_n_options): Use it.
2399 * group-member.c: Include <stdbool.h>.
2400 (free_group_info): Arg is now const *; don't free arg.
2401 (get_group_info): Now returns bool and accepts struct group_info *,
2402 rather than returning a malloc'ed struct group_info *.
2403 All uses changed. Check for overflow in internal size calculation.
2405 * getusershell.c (readname): Simplify the code by using x2nrealloc
2406 rather than xmalloc/xrealloc.
2407 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
2408 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
2409 conformance bug: the old code used a pointer after freeing the
2410 storage that it addressed.
2411 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
2412 rather than doing it by hand.
2413 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
2414 the buffer preserved. Use free and xmalloc instead.
2415 * quotearg.c (quotearg_n_options): Likewise.
2416 Use a simpler test for size overflow. Don't use xalloc_oversized
2417 because unsigned int might be wider than size_t (!); this suggests
2418 that we should switch from unsigned int to size_t for slot numbers.
2420 2003-10-27 Bruno Haible <bruno@clisp.org>
2422 * stdbool_.h: Better support for BeOS.
2424 2003-10-27 Paul Eggert <eggert@twinsun.com>
2426 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
2427 to allocate the returned structure. Do not allocate a subarray,
2428 as x2nrealloc will do that.
2429 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
2430 instead of xnrealloc.
2431 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
2433 2003-10-26 Paul Eggert <eggert@twinsun.com>
2435 * xalloc.h (xalloc_oversized): New static inline function, for
2436 callers that want to do their own size-overflow checking. Include
2437 <stdbool.h>, since xalloc_oversized returns bool.
2438 * xalloc.c (array_size_overflow): Remove. All callers changed
2439 to use xalloc_oversized.
2441 Add two functions x2realloc, x2nrealloc, for programs that grow
2442 arrays dynamically by doubling their sizes.
2443 * xalloc.h (x2realloc, x2nrealloc): New decls.
2444 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
2447 Port to C99 semantics for 'inline' of external functions.
2448 Bug reported by Bruno Haible.
2449 * xmalloc.c (xnmalloc_inline): New static inline function,
2450 with the old contents of xnmalloc.
2451 (xnmalloc, xmalloc): Use it.
2452 (xnrealloc_inline): New static inline function,
2453 with the old contents of xnrealloc.
2454 (xnrealloc, xrealloc): Use it.
2456 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
2458 2003-10-25 Paul Eggert <eggert@twinsun.com>
2460 Fix several address-calculation bugs in the hash modules,
2461 plus some minor code cleanup.
2463 * hash.h: Include <stdbool.h>, for bool.
2464 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
2465 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
2466 hash_get_n_entries, hash_get_max_bucket_length,
2467 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
2468 hash_rehash): Use size_t rather than unsigned.
2469 * hash.c (struct hash_table, hash_get_n_buckets,
2470 hash_get_n_buckets_used, hash_get_n_entries,
2471 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
2472 hash_get_entries, hash_do_for_each, hash_string, is_prime,
2473 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
2475 (SIZE_MAX): Define if not defined.
2476 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
2477 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
2479 Use const * when possible.
2480 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
2481 (check_tuning): Fix bug: if tuning parameters were very close to
2482 0 or 1, rounding errors could have caused subscript violations.
2483 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
2484 (hash_initialize): Add 'fail:' label
2485 to free table and return NULL, and use it to simplify code.
2486 Use calloc rather than clearing the storage ourself.
2487 (hash_initialize, hash_rehash): Check for arithmetic overflow in
2488 buffer size calculations.
2489 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
2490 Include <stddef.h>, for size_t.
2491 * hash-pjw.c (hash_pjw): Likewise.
2492 Switch to method described by Bruno Haible.
2493 Include <limits.h>, for CHAR_BIT.
2494 (SIZE_BITS): New macro.
2496 2003-10-21 Paul Eggert <eggert@twinsun.com>
2498 * getndelim2.c (getndelim2): When size calculation overflows,
2499 ceiling the allocation at NMAX bytes rather than silently
2500 discarding input bytes before NMAX is reached. This makes
2501 a difference only if NMAX exceeds SIZE_MAX / 2.
2503 * obstack.c: Merge from glibc.
2504 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
2505 Add libc_hidden_def (_obstack_newchunk).
2506 (_obstack_free) [! defined _LIBC]: Remove.
2507 [defined _LIBC]: Make a strong alias from obstack_free, rather than
2508 a clone of the function body.
2509 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
2510 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
2512 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
2513 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
2516 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
2517 (obstack_ptr_grow_fast, obstack_int_grow_fast):
2518 Don't use lvalue casts, as GCC plans to remove support for them
2519 in GCC 3.5. Reported by Joseph S. Myers. This bug
2520 was also present in the non-GCC version, indicating that this
2521 code had always been buggy and had never been widely used.
2522 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
2523 Use the fast variant of each macro, rather than copying the
2524 definiens of the fast variant; that way, we'll be more likely to
2525 catch future bugs in the fast variants.
2527 2003-10-20 Bruno Haible <bruno@clisp.org>
2529 * wait-process.h: New file, from GNU gettext.
2530 * wait-process.c: New file, from GNU gettext.
2532 2003-10-19 Jim Meyering <jim@meyering.net>
2534 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
2536 2003-10-16 Paul Eggert <eggert@twinsun.com>
2538 * getgroups.c: Include <errno.h>, <stdlib.h>.
2539 (getgroups): First arg is int, not size_t.
2540 Don't let 'free' mangle errno.
2542 2003-10-16 Jim Meyering <jim@meyering.net>
2544 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
2546 2003-10-15 Paul Eggert <eggert@twinsun.com>
2548 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
2550 (new_exclude, add_exclude_file): Initial size no longer needs to
2552 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
2553 our own address arithmetic overflow checking.
2555 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
2556 (fnmatch): Do not alloca more than 2000 wide characters;
2557 instead, use malloc for large buffers.
2558 Check for address arithmetic overflow, and return -1
2559 with errno set to ENOMEM in that case.
2560 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
2561 (NEW_PATTERN): Do not alloca more than 8000 bytes;
2562 instead, return -1. Check for address arithmetic overflow.
2564 2003-10-14 Paul Eggert <eggert@twinsun.com>
2566 Handle invalid suffixes and overflow independently, so that
2567 callers can treat them independently as needed. Fix some bugs in
2568 suffix handling, e.g., "100k@" was not diagnosed as an invalid
2569 suffix for a human-readable blocksize. The major caller-visible
2570 change is the addition of a new
2571 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
2572 that both overflow and suffix chars were found.
2574 * human.c (humblock): Don't check separately for invalid suffix
2575 char; that is xstrtoumax's job (now that its bug is fixed).
2576 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
2577 INTMAX_MAX]: New macros.
2578 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
2579 TYPE_MAXIMUM): New macros.
2580 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
2581 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
2582 if overflow occurs, as it's what __strtol does and it's more useful
2584 (__xstrtol): If __strtol reports some error other than ERANGE,
2585 reflect it to the caller as LONGINT_INVALID. If it reports
2586 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
2587 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
2588 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
2590 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
2591 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
2592 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
2593 [defined UINTMAX_MAX]: New macros.
2595 2003-10-14 Bruno Haible <bruno@clisp.org>
2597 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
2598 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
2599 Also use volatile where needed.
2601 2003-10-12 Paul Eggert <eggert@twinsun.com>
2603 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
2604 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
2605 and define in terms of the other primitives.
2606 * xmalloc.c: Include stdbool.h; do not include exit.h.
2607 (SIZE_MAX): Define if not already defined.
2608 (array_size_overflow): New function.
2609 (xalloc_die): Abort instead of exiting if 'error' returns.
2610 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
2611 (xmalloc, xrealloc): Use them.
2612 (xcalloc): Check for address arithmetic overflow.
2613 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
2614 a bit faster than strcpy.
2616 2003-10-08 Paul Eggert <eggert@twinsun.com>
2618 Merge getpass from libc, plus a few fixes.
2620 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
2621 Include <stdbool.h>.
2622 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
2623 __fsetlocking to empty.
2624 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
2625 do include <bits/libc-lock.h>.
2626 Do not include <fcntl.h>; not needed.
2627 [_LIBC]: Include <wchar.h>.
2628 (NOTCANCEL_MODE): New macro.
2629 (flockfile, funlockfile) [_LIBC]: New macros.
2630 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
2631 [!_LIBC]: New macros.
2632 (call_fclose): New function.
2633 (getpass): Use it. Save tty stream separately; this simplifies the
2634 code and makes it more reliable if stdin happens to equal stdout.
2635 Invoke __fsetlocking on tty.
2636 Handle thread cancellation if needed.
2637 Namespace cleanup (use __tcgetattr, __getline).
2638 Use bool for Booleans.
2639 [USE_IN_LIBIO]: Handle wide streams.
2640 [!_LIBC]: Unconditionally do the fseek, since we don't know what
2641 stream might go where.
2643 * unlocked-io.h: Include <stdio.h>, so that the caller
2644 doesn't have to include <stdio.h> before us.
2645 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2646 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2647 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2648 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2649 if not declared, so that we can use getpass.c code from libc without
2651 (flockfile, ftrylockfile, funlockfile): New macros.
2653 2003-10-06 Bruno Haible <bruno@clisp.org>
2655 * version-etc-2.h: Remove file.
2656 * version-etc-2.c: Remove file.
2658 2003-09-25 Jim Meyering <jim@meyering.net>
2659 Bruno Haible <bruno@clisp.org>
2661 This lets translators provide better translations for the
2662 "Written by ..." part of --version output.
2663 * version-etc.h: Include stdarg.h.
2664 (version_etc_copyright): Declare as readonly.
2665 (version_etc): Make this function variadic with a NULL-terminated list
2666 of author name strings.
2667 (version_etc_va): New declaration.
2668 * version-etc.c: Include stdarg.h, stdlib.h.
2669 (version_etc_copyright): Declare as readonly.
2670 (version_etc_va): New function. Provide a different translatable string
2671 for each possible number of authors < 10. Abbreviate when there are 10
2673 (version_etc): Make this function variadic. Call version_etc_va.
2674 Suggestion from Gary V. Vaughan.
2676 * long-options.h (parse_long_options): Change prototype: the authors
2677 string is moved to the end and becomes variadic.
2678 * long-options.c: Include stdarg.h.
2679 (parse_long_options): Make this function variadic, too.
2680 Call version_etc_va, not version_etc.
2682 2003-10-06 Bruno Haible <bruno@clisp.org>
2684 * fatal-signal.h: New file, from GNU gettext.
2685 * fatal-signal.c: New file, from GNU gettext.
2687 2003-10-04 Karl Berry <karl@gnu.org>
2689 * argp*: update from libc.
2691 2003-10-01 Larry Jones <lawrence.jones@eds.com>
2693 * getpass.c (getpass): Use a no-op fseek when switching from input to
2694 output mode on the same stream.
2696 2003-09-29 Paul Eggert <eggert@twinsun.com>
2698 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
2699 Fix arg typo in previous patch.
2701 2003-09-28 Jim Meyering <jim@meyering.net>
2703 * error.c: Correct cpp indentation.
2705 2003-09-27 Paul Eggert <eggert@twinsun.com>
2707 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
2708 Omit the special code that used __typeof__, since we worry that
2709 it could be more trouble than it's worth. See:
2710 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
2711 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
2715 2003-09-26 Jim Meyering <jim@meyering.net>
2717 * error.c (error_tail): Move some declarations
2718 into inner scope where the local variables are used.
2720 2003-09-26 Bruno Haible <bruno@clisp.org>
2722 * stpncpy.h (gnu_stpncpy): New declaration.
2723 (stpncpy): Define as alias for gnu_stpncpy.
2724 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
2726 2003-09-26 Paul Eggert <eggert@twinsun.com>
2728 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
2729 (error_tail): Do not loop, reallocating temporary buffer, since
2730 the output cannot contain more wide characters than the input
2731 contains bytes, the size must be big enough already. This avoids
2732 one potential size overflow calculation. Check for size overflow
2733 when calculating temporary buffer size. Free temporary buffer
2734 when done, if it was allocated with malloc; this plugs a memory
2735 leak. Remove casts from void * to pointers, that are no longer
2736 needed now that we're assuming C89 or better.
2738 Merge error changes from glibc.
2740 * error.c, error.h: Update copyright notice header to match glibc.
2741 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
2742 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
2743 Disable cancellation while printing error.
2744 * error.h: Prepend __ to parameter names.
2746 2003-09-25 Karl Berry <karl@gnu.org>
2748 * argp-fmtstream.c, argp-help.c: update from libc.
2750 2003-09-25 Bruno Haible <bruno@clisp.org>
2752 * version-etc-2.h: New file, from version-etc.h with modifications.
2753 * version-etc-2.c: New file, from version-etc.c with modifications.
2755 2003-09-25 Simon Josefsson <jas@extundo.com>
2757 * xgetdomainname.h: New file.
2758 * xgetdomainname.c: New file.
2760 2003-09-25 Simon Josefsson <jas@extundo.com>
2761 Bruno Haible <bruno@clisp.org>
2763 * getdomainname.h: New file.
2764 * getdomainname.c: New file.
2766 2003-09-24 Paul Eggert <eggert@twinsun.com>
2768 * linebuffer.c (freebuffer): Don't free the argument, just
2769 the buffer associated with the argument. Bug reported by
2772 2003-09-19 Karl Berry <karl@gnu.org>
2774 * argp.h: update from libc.
2776 2003-09-16 Paul Eggert <eggert@twinsun.com>
2778 * linebuffer.c (readlinebuffer): Return NULL immediately upon
2779 input error, instead of returning NULL the next time we are called
2780 (and therefore losing track of errno).
2782 2003-09-15 Paul Eggert <eggert@twinsun.com>
2784 * getndelim2.c (getndelim2): Don't trash errno when a read
2785 fails, so that the caller gets the proper errno.
2787 * readutmp.c (read_utmp): Likewise.
2788 Check for fstat error. Close stream and free storage
2791 2003-09-14 Bruno Haible <bruno@clisp.org>
2793 * fwriteerror.h: New file.
2794 * fwriteerror.c: New file.
2796 2003-09-14 Jim Meyering <jim@meyering.net>
2798 * getloadavg.c: Correct cpp indentation.
2799 * strdup.c: Likewise.
2800 * vasnprintf.c: Likewise.
2802 2003-09-12 Paul Eggert <eggert@twinsun.com>
2804 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
2805 * obstack.c [!defined _LIBC]: Likewise.
2806 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
2807 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
2808 * exitfail.c: Don't include stdlib.h; no longer needed.
2810 More changes to assume C89 or better.
2812 * error.c (error_tail): Assume vprintf.
2814 * argmatch.c (getenv): Remove decl.
2815 * progreloc.c (get_full_program_name): Define via prototype.
2816 * setenv.c (clearenv): Likewise.
2817 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
2819 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
2820 (malloc, memcpy): Remove decls.
2821 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
2822 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
2823 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2824 (memcpy): Remove macro.
2825 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
2826 (__P): Remove. All uses removed.
2827 (PTR): Remove. All uses changed to void *.
2828 (CHAR_BIT, NULL): Remove.
2829 (spaces, zeros, memset_space, memset_zero)
2830 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
2832 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
2833 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
2834 Define with prototype.
2835 Remove now-unnecessary prototype decl.
2836 (extra_args_spec): Assume ANSI C. All uses changed.
2837 (extra_args_spec_iso): Remove.
2838 (my_strftime, emacs_strftimeu): Define via prototype.
2839 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
2841 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
2842 * strtoimax.c: Include <stdlib.h> unconditionally.
2843 (strtoul, strtol): Remove decls.
2844 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
2846 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2847 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
2848 (LOCALE_PARAM_PROTO): New macro.
2849 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
2850 (INTERNAL (strtol), strtol): Define with a prototype.
2851 (PARAMS): Remove. All uses removed.
2852 * tempname.c: Include <string.h> unconditionally.
2853 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
2854 * xgethostname.c (main): Define with a prototype.
2855 * xmalloc.c: Include "xalloc.h" first, to check interface.
2856 Include <stdlib.h> unconditionally.
2857 (calloc, malloc, realloc, free): Remove decls.
2858 * xstrtod.c: Include "xstrtod.h" first, to check interface.
2859 Include <stdlib.h> unconditionally. Sort include file names.
2861 (xstrtod): Define with a prototype.
2862 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
2863 (strtol, strtoul): Remove decls.
2865 2003-09-11 Paul Eggert <eggert@twinsun.com>
2867 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
2868 Include <stdlib.h>, <string.h> unconditionally.
2869 Remove now-unnecessary cast to char *.
2870 * strnlen.c: Include <string.h> unconditionally.
2871 * yesno.c (yesno): Define with a prototype.
2873 2003-09-10 Bruno Haible <bruno@clisp.org>
2875 * strcspn.c: Include <string.h> unconditionally.
2876 * strpbrk.c: Include <string.h> unconditionally.
2877 * strstr.c: Include <string.h> unconditionally.
2878 * unicodeio.c: Include <string.h> unconditionally.
2879 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
2880 * unsetenv.c: Likewise.
2881 * xreadlink.c: Include <stdlib.h> unconditionally.
2882 * yesno.c: Include <stdlib.h> unconditionally.
2883 (rpmatch): Add prototype.
2885 2003-09-10 Jim Meyering <jim@meyering.net>
2887 * error.c: Correct indentation of cpp directives.
2889 2003-09-09 Paul Eggert <eggert@twinsun.com>
2893 * acosl.c (main): Use a prototype.
2894 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
2897 * getloadavg.c (getloadavg, main): Define via prototypes.
2899 * getopt.h (struct option.name): Assume C89, and use 'const'.
2900 (getopt, etopt_long, getopt_long_only, _getopt_internal)
2901 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
2903 * getopt.c (const): Remove macro.
2904 Include <string.h> unconditionally.
2905 (my_index): Remove; all uses changed to strchr.
2906 (strlen): Remove decl.
2907 (exchange): Remove forward decl; no longer needed.
2908 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
2909 Define with prototype.
2910 * getopt1.c (const): Remove macro.
2911 (getopt_long, getopt_long_only, main): Define with prototype.
2913 * getugroups.c: Include <string.h> unconditionally.
2915 * getusershell.c: Include <stdlib.h> unconditionally.
2916 (getusershell, setusershell, endusershell, readname, main):
2917 Define with prototypes.
2919 * group-member.c: Include group-member.h first.
2920 Include <stdlib.h> unconditionally.
2922 * hard-locale.c: Include hard-locale.h first.
2923 Include <stdlib.h>, <string.h> unconditionally.
2925 * hash.c (free, malloc): Remove decls.
2926 Include <stdlib.h> unconditionally.
2928 * human.c: Include <stdlib.h>, <string.h> unconditionally.
2929 (getenv): Do not declare.
2931 * idcache.c: Include <string.h> unconditionally.
2933 * long-options.c: Include long-options.h first, to test interface.
2934 Include <stdlib.h> unconditionally.
2936 * makepath.c: Include makepath.h first, to test interface.
2937 Include <stdlib.h> and <string.h> unconditionally.
2939 * linebuffer.c: Include <stdlib.h>.
2940 (free): Remove decl.
2942 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
2943 rpl_malloc returns void *, not char *.
2944 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
2946 * md5.h: Include <limits.h> unconditionally.
2947 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
2948 (__P): Remove; all uses removed.
2949 * md5.c: Include "md5.h" first.
2950 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
2951 md5_buffer, md5_process_bytes, md5_process_block):
2952 Define with prototypes.
2953 * sha.h (__P): Remove all uses. (It wasn't defined??)
2954 * sha.c: Include "sha.h" first.
2955 Include <stdlib.h>, <string.h> unconditionally.
2957 * memchr.c (__ptr_t): Remove; all uses changed to void *.
2958 * memcmp.c (__ptr_t): Likewise.
2959 * memrchr.c (__ptr_t): Likewise.
2960 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
2961 Include <string.h> unconditionally.
2962 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
2963 * memchr.c: Include <stdlib.h> unconditionally.
2964 * memchr.c (LONG_MAX): Remove.
2965 * memrchr.c (LONG_MAX): Likewise.
2966 * memchr.c (__memchr): Define via a prototype.
2967 * memrchr.c (__memrchr): Likewise.
2968 * memcmp.c (__P): Remove, and remove all uses.
2969 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
2970 Remove forward decls; no longer needed.
2971 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
2972 Use types required by C89 in prototype.
2974 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
2975 * savedir.c: Likewise.
2976 * mkdir.c (free): Remove decl.
2977 * rmdir.c (rmdir): Define with a prototype.
2978 * savedir.c: Include savedir.h first, to test interface.
2980 * mktime.c (STDC_HEADERS): Remove.
2981 Include <stdlib.h>, <string.h> unconditionally.
2983 * modechange.c: Include <stdlib.h> unconditionally.
2984 (malloc): Remove decl.
2986 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
2987 (free): Remove decl.
2989 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
2990 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
2991 (This type really should be intptr_t, but that's a C99ism.)
2992 (_obstack_memcpy): Remove: all uses changed to memcpy.
2993 Include <string.h> unconditionally.
2994 (struct obstack): Assume __STDC__ for types of members
2995 chunkfun, freefun, extra_arg.
2996 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
2997 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
2998 obstack_begin, obstack_specify_allocation,
2999 obstack_specify_allocation_with_arg, obstack_chunkfun,
3000 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
3001 Remove unprototyped decls and the macros that use them.
3002 * obstack.c (POINTER): Remove. All uses changed to void *.
3003 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
3004 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
3005 (defined __STDC__ && __STDC__)]:
3006 Remove nonprototyped code.
3007 Include <stdlib.h> unconditionally.
3008 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
3009 _obstack_allocated_p, _obstack_free, obstack_free,
3010 _obstack_memory_used, print_and_abort):
3011 Define using prototypes.
3012 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
3013 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
3014 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
3015 obstack_next_free, obstack_object_size, obstack_room) [0]:
3016 Remove unused, unprototyped code.
3018 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
3020 * physmem.c (physmem_total, physmem_available, main): Define
3023 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
3024 (main): Define with a prototype.
3026 * posixver.c (getenv): Remove decl.
3028 * putenv.c (malloc): Returns void *, not char *.
3029 Include <string.h> unconditionally.
3030 (strchr, memcpy, NULL): Do not define.
3032 * readtokens.c: Include readtokens.h first, to test interface.
3033 Include <stdlib.h>, <string.h> unconditionally.
3034 (init_tokenbuffer): Define with a prototype.
3036 * regex.c (PARAMS): Remove. All uses removed.
3037 All uses of _RE_ARGS removed, too.
3038 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3040 (bzero): Assume memset exists.
3041 (memcmp, memcpy, NULL): Remove.
3042 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
3043 char, or assignments to local vars of type signed char.
3044 (init_syntax_once, PREFIX(extract_number_and_incr),
3045 PREFIX(print_partial_compiled_pattern),
3046 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
3047 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
3048 PREFIX(regex_grow_registers), PREFIX(regex_compile),
3049 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
3050 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
3051 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
3052 wcs_compile_range, byte_compile_range, truncate_wchar,
3053 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
3054 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
3055 count_mbs_length, wcs_re_match_2_internal,
3056 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
3057 PREFIX(alt_match_null_string_p),
3058 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
3059 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
3060 regfree, PREFIX(extract_number)): Define with prototype. Remove
3061 now-unnecessary declaration, if any.
3062 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
3064 Remove now-unnecessary casts among pointer types.
3065 * regex.h (_RE_ARGS): Remove. All uses removed.
3067 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
3068 (free): Remove decl.
3070 * rpmatch.c: Include <stdlib.h> unconditionally.
3072 * same.c: Include <stdlib.h>, <string.h> unconditionally.
3073 (free): Remove decl.
3075 * save-cwd.c: Include <stdlib.h> unconditionally.
3076 * xgetcwd.c: Likewise.
3078 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
3079 (free): Remove decl.
3081 * strchrnul.c (strchrnul): Define with a prototype.
3082 Fix bug: c_in was not converted to char before searching.
3084 The following changes are not K&R related:
3086 * group-member.h: Include <sys/types.h>, so that this file is
3088 * makepath.h: Likewise.
3090 * getusershell.c (readname, default_index, line_size, readname):
3091 Use size_t, not int, for sizes.
3092 (readname): If the size overflows, report an error instead of
3095 2003-09-09 Derek Robert Price <derek@ximbiot.com>
3097 * getndelim2.c: Assume stdlib.h per the C89 spec.
3099 2003-09-08 Paul Eggert <eggert@twinsun.com>
3101 Assume C89 or better; remove K&R cruft.
3102 A few of these changes were first proposed by Derek Robert Price
3103 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
3105 * addext.c: Include <string.h> unconditionally.
3106 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
3107 Don't declare getenv or malloc.
3109 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
3110 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
3112 (find_stack_direction, alloca): Use prototypes.
3114 * atexit.c (atexit): Define using a prototype.
3116 * basename.c, dirname.c, stripslash.c:
3117 Include <string.h> unconditionally.
3119 * bcopy.c: Include <stddef.h>.
3120 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
3122 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
3124 * error.h (error, error_at_line, error_print_progname)
3125 [! (defined (__STDC__) && __STDC__)]: Remove decls.
3126 * error.c: Include error.h first, to check interface.
3127 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3128 (VA_START): Remove; all uses changeed to va_start.
3129 (exit, strerror): Remove decls.
3130 (error_print_progname): Prototype uncondionally.
3131 Don't include <errno.h>; no longer needed.
3132 (private_strerror): Remove.
3133 (error_tail): Always define.
3134 (error, error_at_line): Assume C89 or better; always use prototypes.
3135 * fatal.c: Include "fatal.h" first, to test interface.
3136 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3137 (VA_START): Remove; all uses changed to va_start.
3138 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
3140 (exit): Remove decl.
3141 (fatal): Prototype unconditionally. Assume va_start works.
3142 Abort at end, to pacify gcc.
3144 * euidaccess.c (main): Define with a prototype.
3146 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
3148 * exitfail.c: Include <stdlib.h> unconditionally.
3150 * fnmatch_.h (__P): Remove. All uses changed to assume
3152 * fnmatch.c: Include fnmatch.h first, to test interface.
3153 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
3154 (getenv): Remove decl.
3155 (fnmatch): Define using a prototype.
3156 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
3157 (FCT): Define using a prototype.
3159 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
3161 * gethostname.c: Include <stddef.h>.
3162 (gethostname): Define with prototype. Length is size_t, not int.
3164 2003-09-08 Paul Eggert <eggert@twinsun.com>
3166 * getversion.c: Remove; was migrated to backupfile.c in 1997.
3167 getversion.c should have been removed then, but was accidentally
3170 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
3171 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
3173 2003-09-07 Paul Eggert <eggert@twinsun.com>
3175 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
3176 copy_tm_result. Bug reported by Simon Josefsson in
3177 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
3179 2003-09-06 Paul Eggert <eggert@twinsun.com>
3181 * time_r.c, time_r.h: New files.
3183 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
3185 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
3186 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
3188 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
3190 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
3191 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
3194 * timegm.c: Switch to glibc implementation, with the following changes:
3195 [defined HAVE_CONFIG_H]: Include <config.h>.
3196 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
3197 (__mktime_internal) [!defined _LIBC]: New decl.
3198 (__gmtime_r) [!defined _LIBC]: New macro and function.
3199 (timegm): Use a prototype, since gnulib assumes C89.
3200 Do not bother declaring tmp to be const, as it's not really usefu.
3201 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
3202 (timegm): Declare only if HAVE_DECL_TIMEGM.
3204 2003-09-03 Paul Eggert <eggert@twinsun.com>
3206 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
3207 Bug reported by Lute Kamstra in
3208 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
3210 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
3211 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
3212 course with correspondingly smaller numbers for tomorrow and
3213 yesterday. From Tadayoshi Funaba. Originally installed into
3214 sh-utils on 1999-08-07, but the patch got lost (I guess during the
3217 2003-08-31 Simon Josefsson <jas@extundo.com>
3219 * timegm.h: New file.
3220 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
3222 2003-08-31 Karl Berry <karl@gnu.org>
3224 * argp.h: update from libc.
3226 2003-08-28 Bruno Haible <bruno@clisp.org>
3228 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
3229 warning on QNX, which defines O_BINARY to 000000.
3231 2003-08-24 Bruno Haible <bruno@clisp.org>
3233 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
3234 MSVC7 <stdio.h> is included later.
3236 2003-08-20 Bruno Haible <bruno@clisp.org>
3238 * progname.h: New file, from GNU gettext.
3239 * progname.c: New file, from GNU gettext.
3240 * progreloc.c: New file, from GNU gettext.
3242 2003-08-19 Bruno Haible <bruno@clisp.org>
3244 * xstrdup.c: Assume <string.h> exists.
3246 2003-08-18 Jim Meyering <jim@meyering.net>
3248 * setenv.h: Indent nested cpp directive.
3249 * vasnprintf.c: Remove trailing blanks.
3251 2003-08-17 Simon Josefsson <jas@extundo.com>
3252 Bruno Haible <bruno@clisp.org>
3254 * xstrndup.h: New file.
3255 * xstrndup.c: New file.
3257 2003-08-17 Bruno Haible <bruno@clisp.org>
3259 * strndup.h: New file.
3261 2003-08-16 Paul Eggert <eggert@twinsun.com>
3263 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
3264 space, undoing this 2003-08-12 change:
3265 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
3267 2003-08-16 Jim Meyering <jim@meyering.net>
3269 Merge from coreutils.
3270 * xstrtoimax.c: #else #if -> #elif.
3271 * xstrtoumax.c: Likewise.
3273 2003-08-15 Paul Eggert <eggert@twinsun.com>
3275 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
3276 rather than tab, after '#' in shell-script copyright notices.
3277 Suggested by Bruno Haible.
3279 2003-08-15 Jim Meyering <jim@meyering.net>
3280 and Paul Eggert <eggert@twinsun.com>
3282 Merge from coreutils.
3283 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
3284 member but strut utmpx does not. Needed for AIX 4.3.3.
3285 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
3287 2003-08-15 Jim Meyering <jim@meyering.net>
3289 Merge from coreutils.
3290 * xgethostname.c: Include <stdlib.h>.
3291 (xghostname): Don't exit for anything other than memory-related
3292 failure; just return NULL.
3293 * userspec.c: Include "posixver.h".
3294 (parse_user_spec): Accept `.' as a separator only
3295 in pre-POSIX-200112 mode.
3296 * strtoimax.c: Use #elif rather than #else #if.
3297 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
3298 Remove function, now that we can rely on a working tzset function.
3299 [!_LIBC]: Ensure that the required autoconf test has been run.
3300 [!defined _NL_CURRENT && HAVE_STRFTIME]:
3301 Use underlying_strftime for %r.
3302 * sha.c: Merge in some clean-up and optimization changes from glibc.
3303 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
3304 Ensure that it is a multiple of 64.
3305 Rearrange loop exit tests so as to avoid performing an
3306 additional fread after encountering an error or EOF.
3307 * realloc.c: Update copyright date.
3309 2003-08-14 Jim Meyering <jim@meyering.net>
3311 Merge from coreutils.
3312 * obstack.h: Whitespace changes.
3313 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
3314 and xcalloc return values.
3315 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
3316 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
3317 hang on OSF/1 5.1 for DIR on both local and remote file systems.
3318 Reported by (and fix confirmed by) Nelson H. F. Beebe.
3319 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3321 Use mntctl's return value to drive the entry-processing loop, since
3322 we can't rely on the value of the vmt_length member in the last
3323 entry. On some systems doing so could result in exhausting
3324 virtual memory. Based in part on a patch from Mike Jetzer.
3326 2003-08-14 Jim Meyering <jim@meyering.net>
3327 and Paul Eggert <eggert@twinsun.com>
3329 Merges from coreutils, plus other fixes.
3330 * physmem.c: Merge in portability changes from gcc/libiberty
3331 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
3332 for credits and details. Thanks to Kaveh Ghazi for helping
3333 to keep these files in sync.
3334 (ARRAY_SIZE): Define it.
3335 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
3336 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
3337 (memcasecmp): Don't assume size_t fits in unsigned int.
3338 Remove casts and duplicate code.
3339 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
3340 (memcpy): Remove definition.
3341 Merge in some clean-up and optimization changes from glibc.
3342 [BLOCKSIZE]: Move definition to top of file.
3343 Ensure that it is a multiple of 64.
3344 Rearrange loop exit tests so as to avoid performing an
3345 additional fread after encountering an error or EOF.
3346 * md5.h (md5_uintptr): Define.
3347 * makepath.c (CLEANUP_CWD): Report an error if we failed to
3348 return to the initial working directory. Preserve errno
3350 * idcache.c: Include "xalloc.h".
3351 (xmalloc, xrealloc): Remove decls.
3352 (getuser): Remove casts no longer required in C89.
3353 * human.c: Include stdio.h, for sprintf.
3354 * group-member.c: Include "xalloc.h".
3355 (xmalloc, xrealloc): Remove decls.
3356 (get_group_info): Remove casts no longer required in C89.
3357 * getusershell.c (readname): Remove casts no longer required in C89.
3358 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
3359 * getline.c: Whitespace fix, from coreutils.
3361 2003-08-13 Paul Eggert <eggert@twinsun.com>
3363 * exclude.c: Include <ctype.h>
3364 (IN_CTYPE_DOMAIN): New macro.
3366 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
3369 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3370 Undo previous (whitespace-only) change.
3372 2003-08-12 Paul Eggert <eggert@twinsun.com>
3374 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3375 Normalize leading white space and remove trailing white space.
3376 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
3377 notice, as per ../config/srclist-update.
3379 Merge from coreutils.
3380 * euidaccess.h: New file.
3381 * euidaccess.c: Include it.
3382 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
3383 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
3384 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
3386 2003-08-11 Bruno Haible <bruno@clisp.org>
3388 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
3389 (vasnprintf): Use it instead of wcslen.
3391 2003-08-11 Bruno Haible <bruno@clisp.org>
3393 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
3394 value to ensure that _Bool promotes to int. Use #define for _Bool when
3395 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
3397 2003-08-10 Karl Berry <karl@gnu.org>
3399 * regex.h: update from libc (whitespace fix).
3401 2003-08-09 Paul Eggert <eggert@twinsun.com>
3403 Merge some files from coreutils. These changes were
3404 originally made by Jim Meyering.
3405 * acl.c: Include <sys/types.h> before <sys/stat.h>;
3406 many older Unixes require this.
3407 * alloca.c (alloca): Remove cast to argument of free;
3408 no longer needed in C89.
3409 * alloca_.h, regex.h: Fix white space to match
3410 what GNU indent does.
3412 2003-08-05 Paul Eggert <eggert@twinsun.com>
3414 * bumpalloc.h: Remove.
3416 2003-08-04 Paul Eggert <eggert@twinsun.com>
3418 * getloadavg.c: Change copyright notice and spacing to conform to
3421 Merge from coreutils.
3422 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
3424 * getdate.y (date): Also accept dates like May-23-2003; suggestion
3425 from Karl Berry, implemented by Jim Meyering.
3426 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
3427 from Dmitry V. Levin.
3428 Remove anachronistic cast of xrealloc.
3429 * fnmatch_.h (__const): Remove. Use 'const'.
3430 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
3431 type. Otherwise, it wouldn't compile with at least /bin/cc on
3432 ymp-cray-unicos9.0.2.X.
3433 Combine two mostly-identical uses of alloca into one.
3434 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
3436 2003-08-04 Dave Love <d.love@dl.ac.uk>
3440 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
3441 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
3442 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
3443 obsolete NLIST_NAME_UNION.
3444 [__GNU__]: Undef BSD and FSCALE.
3445 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
3447 2003-08-03 Paul Eggert <eggert@twinsun.com>
3449 * stdbool_.h (_Bool): Make it signed char, instead of
3450 an enum type, so that it's guaranteed to promote to int. See:
3451 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
3453 2003-07-31 Paul Eggert <eggert@twinsun.com>
3455 * strerror.c: Include config.h, limits.h. Declare sprintf.
3456 (strerror): Don't assume that a printable int fits in 14 bytes.
3458 2003-07-24 Derek Robert Price <derek@ximbiot.com>
3459 Bruno Haible <bruno@clisp.org>
3461 * getline.h (getline, getdelim): Change return type to ssize_t.
3462 * getline.c (getline, getdelim): Likewise.
3463 Remove _GNU_SOURCE define; now it's defined in config.h through
3466 2003-07-22 Paul Eggert <eggert@twinsun.com>
3468 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
3469 over-parenthesization in macros.
3471 Sync with coreutils.
3473 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
3476 Use `exit_failure' for xalloc and xmemcoll instead of their own
3477 private exit-failure variables.
3478 * xalloc.h (xalloc_exit_failure): Remove.
3479 * xmalloc.c: Likewise. Include exitfail.h.
3480 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
3481 * xmemcoll.h (xmemcoll_exit_failure): Remove.
3482 * xmemcoll.c: Likewise. Include exitfail.h.
3483 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
3485 2003-07-18 Paul Eggert <eggert@twinsun.com>
3487 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
3488 * closeout.c: Likewise. Include "closeout.h" right after config.h,
3489 to test that it can stand by itself. Include "exitfail.h".
3490 Clients should set exit_failure instead.
3491 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
3493 2003-07-18 Andreas Schwab <schwab@suse.de>
3495 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
3497 2003-07-18 Bruno Haible <bruno@clisp.org>
3499 * getndelim2.h: New file.
3500 * getndelim2.c: Make into a module of its own. Include config.h,
3502 (getndelim2): Make non-static. Change return type to ssize_t.
3503 * getline.h: Change argument names.
3504 * getline.c: Include getndelim2.h instead of getndelim2.c.
3505 * getnline.c: Include getndelim2.h.
3507 2003-07-17 Bruno Haible <bruno@clisp.org>
3509 * Makefile.am: Remove file.
3510 * Makefile.in: Remove file.
3512 2003-07-17 Bruno Haible <bruno@clisp.org>
3514 * getnline.h: New file.
3515 * getnline.c: New file.
3516 * getndelim2.c: New file, extracted from getline.c.
3517 (getndelim2): Renamed from getdelim2, with added nmax argument.
3518 * getline.c: Include getndelim2.c.
3519 (getdelim2): Moved out to getndelim2.c.
3520 (getline, getdelim): Update.
3522 2003-07-15 <karl@gnu.org>
3524 * vasnprintf.c: update from gettext.
3526 2003-07-15 Jim Meyering <jim@meyering.net>
3528 * makepath.c (make_path): Enclose diagnostic in _(...).
3530 2003-07-14 Paul Eggert <eggert@twinsun.com>
3532 * asnprintf.c, asprintf.c, config.charset, gettext.h,
3533 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
3534 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
3535 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
3536 vasprintf.c, vasprintf.h: Regenerate. These files are now being
3537 updated automatically by ../config/srclist-update. This changes
3538 their license from LPGL to GPL.
3540 2003-07-14 Jim Meyering <jim@meyering.net>
3542 Don't emit diagnostics. Let callers do that.
3543 * save-cwd.c: Don't include "error.h".
3544 (save_cwd): Don't call error. Ensure that errno is valid
3545 when returning nonzero.
3547 * save-cwd.h (restore_cwd): Update prototype.
3548 * save-cwd.c (restore_cwd): Remove two parameters.
3549 Simplify. Don't call error upon failure. Let callers do that.
3550 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
3551 when auditing is enabled. But don't bother updating the #if.
3553 2003-07-14 Simon Josefsson <jas@extundo.com>
3555 * mempcpy.h: New file.
3556 * mempcpy.c: New file.
3558 2003-07-14 Paul Eggert <eggert@twinsun.com>
3560 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
3561 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
3562 unicodeio.c, unicodeio.h, unlocked-io.h:
3563 Switch from LGPL to GPL.
3565 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
3567 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
3568 it breaks C++ compilation.
3569 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
3571 2003-07-10 Jim Meyering <jim@meyering.net>
3573 * vasnprintf.c: Remove trailing blanks.
3574 Make cpp indentation consistent.
3576 2003-07-09 Paul Eggert <eggert@twinsun.com>
3578 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
3579 posixver.c, strftime.c, strnlen.c, strverscmp.c:
3580 Switch from LGPL to GPL.
3582 2003-07-07 Paul Eggert <eggert@twinsun.com>
3584 * mktime.c: Fix some boundary cases and remove need for floating point.
3586 Issue a compile-time diagnostic if time_t is floating point, or if
3587 two's complement arithmetic is not in effect, or if arithmetic
3588 right shift does not propagate the sign. These assumptions were
3589 all in the original code but they weren't checked.
3591 (TIME_T_MIDPOINT, verify): New macros.
3592 (__isleap): Remove; it has integer overflow problems.
3593 (leapyear): New function, without those problems.
3594 (ydhms_tm_diff): Remove; splitting into two parts.
3595 (ydhms_diff): New function, containing the arithmetic part of
3596 the old ydhms_tm_diff function. Issue a compile-time
3597 diagnostic if we are not using C99 integer division.
3598 Avoid casts when possible.
3599 (guess_time_tm): New function, containing the checking part of
3600 the old ydhms_tm_diff function. Return the new value, rather than
3601 the difference between it and the old. Accept a new argument T
3602 so that *T specifies the old value. Check for overflow in the result.
3604 (__mktime_internal): Use a time_t offset, not a long int offset.
3605 This undoes the 2003-06-04 change, which is no longer needed now
3606 that we have better overflow checking.
3607 (localtime_offset): Likewise.
3609 (__mktime_internal): Avoid harmful overflow on hosts where time_t
3610 and long are 64-bit but int is only 32-bit.
3611 (ydhms_diff): Use long int to store year1 and yday1.
3612 Issue a compile-time diagnostic if long int is not wide enough.
3614 (__mktime_internal): Use long int to store adjusted year and yday.
3615 Use plain C rather than preprocessor commands, if that doesn't
3617 Check for overflow (and try to repair) after each probe
3618 rather than checking only at the very end. This avoids some bugs
3619 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
3620 does not equal GMT offset at maximum time).
3621 Use integer to check for overflow rather than floating point; this
3622 is more portable to non-IEEE hosts, and is a tad faster.
3623 When we detect that we are oscillating between two values,
3624 don't check whether tm_isdst has the requested value, since
3625 we already know the answer. When tm_isdst has the wrong value,
3626 use a different heuristic to find the right one, based on the
3627 extreme values actually observed in practice in tz2003a,
3628 rather than the (overly optimistic) "previous 3 calendar quarters".
3630 (not_equal_tm, print_tm, check_result): Use "const T" rather than
3631 "T const" to accommodate glibc style.
3632 (check_result): Use less-confusing report format. "long" -> "long int.
3634 Don't loop if the iteration overflows time_t.
3635 Allow a negative step in the iteration.
3637 2003-07-01 Paul Eggert <eggert@twinsun.com>
3639 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3640 having it depend on HAVE_SYS_TYPES_H.
3642 2003-06-25 Bruno Haible <bruno@clisp.org>
3644 * readlink.c: New file.
3646 2003-06-20 Bruno Haible <bruno@clisp.org>
3648 Assume C89, so PARAMS isn't needed.
3649 * unicodeio.h (PARAMS): Remove.
3650 * unicodeio.c: Don't use PARAMS.
3652 2003-06-18 Jim Meyering <jim@meyering.net>
3654 Merge changes from coreutils.
3655 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
3656 Remove explicit declarations of xmalloc and realloc.
3658 (read_utmp): Remove anachronistic cast of xmalloc.
3660 2003-06-17 Paul Eggert <eggert@twinsun.com>
3662 Assume C89, so PARAMS isn't needed.
3663 * backupfile.h (PARAMS): Remove. All uses removed.
3664 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
3665 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
3666 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
3667 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
3668 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
3669 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
3670 xstrtol.h: Likewise.
3671 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
3672 same.h, strverscmp.h: Do not include config.h; no longer needed.
3673 Anyway, config.h should always be included before any other file.
3675 2003-06-11 Simon Josefsson <jas@extundo.com>
3677 * sysexit_.h: New file.
3679 2003-05-20 Derek Price <derek@ximbiot.com>
3681 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
3683 2003-06-10 Simon Josefsson <jas@extundo.com>
3685 * strchrnul.h: New file.
3686 * strchrnul.c: New file.
3688 2003-06-10 Simon Josefsson <jas@extundo.com>
3690 * argp.h: New file, from glibc.
3691 * argp-ba.c: New file, from glibc.
3692 * argp-eexst.c: New file, from glibc.
3693 * argp-fmtstream.c: New file, from glibc.
3694 * argp-fmtstream.h: New file, from glibc.
3695 * argp-fs-xinl.c: New file, from glibc.
3696 * argp-help.c: New file, from glibc.
3697 * argp-namefrob.h: New file, from glibc.
3698 * argp-parse.c: New file, from glibc.
3699 * argp-pv.c: New file, from glibc.
3700 * argp-pvh.c: New file, from glibc.
3701 * argp-xinl.c: New file, from glibc.
3703 2003-06-07 Jim Meyering <jim@meyering.net>
3705 * readtokens.h: Put `Free Software Foundation, Inc.'
3706 in place of my name in the copyright comment.
3707 Remove definition and uses of __P.
3710 * stat.c: Don't declare xmalloc explicitly.
3711 Instead, include "xalloc.h".
3712 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
3713 xrealloc, and xcalloc return values.
3714 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
3716 * xgetcwd.h: Remove definition/uses of PARAMS.
3718 2003-06-06 Jim Meyering <jim@meyering.net>
3720 * stdbool_.h: Renamed from stdbool.h.in.
3722 2003-06-06 Jim Meyering <jim@meyering.net>
3724 Merge from coreutils.
3725 * same.c: (same_name): Declare *_basename locals to be `const'.
3726 Consolidate declarations and initializations of *_base* locals.
3728 Merge from coreutils.
3729 This avoids a core dump on systems without GNU putenv,
3730 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
3731 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
3732 (unsetenv): New static function, from GNU libc.
3733 (rpl_putenv): Use it.
3735 * modechange.c: Remove trailing blanks.
3737 Merge from coreutils.
3738 * fsusage.c: Remove declaration of statfs.
3739 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
3741 * posixtm.c: Include <stdbool.h> unconditionally.
3743 2003-06-05 Paul Eggert <eggert@twinsun.com>
3745 * mktime.c (__mktime_internal): When resolving a tm_isdst
3746 mismatch, look in future quarters as well as past. This fixes a
3747 bug when processing fall-backwards gaps immediately after a long
3748 period of daylight-saving time.
3750 * mktime.c: Assume freestanding C89 or better.
3751 (HAVE_LIMITS_H): Remove. Assume it's 1.
3752 (__P): Remove; not used.
3753 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
3754 (mktime, not_equal_tm, print_tm, check_result,
3755 main): Use prototypes. Use const * where appropriate.
3756 (main): Fix typo in testing code that uncovered by above changes.
3757 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
3759 2003-06-04 Paul Eggert <eggert@twinsun.com>
3761 * mktime.c: Fix Debian bug 177940
3762 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
3763 (localtime_offset): Now long int, not time_t, because we want it
3764 to be guaranteed to be signed. All uses changed.
3765 (__mktime_internal): If overflow would occur when adding offset,
3768 Merge 'human' changes from coreutils. Rewrite to support
3769 locale-specific notations like thousands separators.
3770 * human.c: Simplify authorship notice.
3771 Include human.h immediately after config.h.
3772 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
3773 <limits.h>: Do not include, since human.h does.
3774 (SIZE_MAX, UINTMAX_MAX): New macros.
3775 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
3776 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
3777 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
3778 (power_letter): Renamed from suffixes.
3779 (generate_suffix_backwards): Remove.
3780 (adjust_value): Now takes int style (because of human.h changes)
3781 and long double value (for greater precision on some platforms).
3782 (group_number): New function.
3783 (human_readable): Use it. Use integer options, not enum.
3784 Put the options before the sizes in the arg list.
3785 Support all the new options.
3786 The old human_readable function has been removed;
3787 use inttostr.h instead.
3788 (human_readable, default_block_size, humblock):
3789 Use uintmax_t, not int, for block sizes.
3790 (human_readable_inexact, block_size_types): Remove.
3791 (block_size_opts): New constant.
3792 (human_options): Renamed from human_block_size, with new signature
3793 that allows block sizes up to UINTMAX_MAX. All callers changed.
3794 * human.h: Add copyright and authorship notice.
3795 Include <limits.h> and <stdbool.h> unconditionally.
3796 (PARAMS): Remove. All uses removed.
3797 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
3798 (enum human_inexact_style): Remove tag; now a nameless enum.
3799 (human_floor, human_ceiling, human_round_to_even): Now have
3800 values 2, 0, 1 rather than -1, 1, 0.
3801 (human_group_digits, human_suppress_point_zero, human_autoscale,
3802 human_base_1024, human_SI, human_B): New constants.
3803 (human_readable_inexact, human_block_size): Remove.
3804 (human_readable): Size args are now uintmax_t, not int.
3805 (human_options): New decl.
3807 * exclude.c: (new_exclude, add_exclude): Remove casts that are
3808 unnecessary now that we assume C89 or better. This change
3809 imported from coreutils.
3811 * mktime.c (__mktime_internal): Do not reject negative timestamps
3812 arbitrarily. This is the same patch as 2003-05-28, but it got lost
3813 in the 2003-05-30 sync from glibc.
3815 .h files should stand alone, but we shouldn't include <sys/types.h>
3816 if we can get away with just <stddef.h>.
3818 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
3819 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
3820 rather than <sys/types.h>, as we merely need size_t.
3821 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
3823 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
3824 Include <stdio.h>, to get FILE.
3825 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
3826 memcasecmp.h has included <stddef.h> and all we need is size_t.
3827 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
3828 our interface, instead of including <sys/types.h>
3830 2003-06-02 Paul Eggert <eggert@twinsun.com>
3833 Fix some minor time-related bugs with POSIX time arguments.
3834 Some valid time stamps were being rejected (notably -1, and
3835 time stamps before 1900 on 64-bit hosts). And some invalid
3836 time stamps were being accepted, e.g. September 31.
3838 * posixtm.h (posixtime): Return bool instead of time_t, so
3839 that we can return (time_t) -1 successfully.
3840 * posixtm.c: Likewise.
3841 [HAVE_STDBOOL_H]: Include <stdbool.h>.
3842 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
3843 (t): Remove static var.
3844 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
3845 of static var. All uses changed.
3846 (year): Do not reject years before 1900; they can occur with
3848 (posix_time_parse): Do not check for out-of-range components;
3849 that is now the caller's responsibility, since our checks were
3850 only approximations.
3851 (posixtime): Use mktime to check for out-of-range components,
3852 since it knows them exactly.
3853 If mktime returns (time_t) -1, check whether an error actually occurred
3854 by invoking localtime on -1.
3855 (main) [TEST_POSIXTIME]: Check for input data errors, and report
3856 posixtime failures better.
3857 Improve the test data (in comments only).
3859 2003-05-30 <karl@gnu.org>
3861 * mktime.c: update from libc.
3863 2003-05-30 Bruno Haible <bruno@clisp.org>
3865 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
3866 * localcharset.h: Likewise.
3867 * localcharset.c: Likewise.
3869 2003-05-28 Paul Eggert <eggert@twinsun.com>
3871 Assume the headers required for C89 freestanding compilers.
3872 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
3873 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
3874 without checking for HAVE_LIMITS_H.
3875 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
3876 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
3878 * fatal.c: Include <stdarg.h> without checking for __STDC__.
3879 * exclude.c: Include <stdbool.h> unconditionally.
3880 * tempname.c: Include <stddef.h> unconditionally.
3881 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
3882 * modechange.c, rpmatch.c (NULL): Don't define, since
3883 <stddef.h> does that.
3884 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
3885 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
3886 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
3887 * xstrtol.c: Likewise.
3888 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
3889 * savedir.c: Include <stddef.h> instead of defining NULL.
3891 * addext.c (addext): Use assignment rather than cast, to avoid
3892 warnings on some platforms.
3894 * mktime.c (__mktime_internal): Do not reject negative timestamps
3897 2003-05-10 Bruno Haible <bruno@clisp.org>
3899 * linebreak.c (iconv_string_length): Don't return -1 just because the
3900 string is longer than 4 KB.
3902 2003-05-12 Jim Meyering <jim@meyering.net>
3904 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
3905 the space-padded-by-default conversion specifiers, %e, %k, %l.
3907 2003-05-03 Bruno Haible <bruno@clisp.org>
3909 Upgrade to Unicode-4.0.
3910 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
3911 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
3912 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
3913 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
3914 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
3915 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
3916 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
3917 Change width of U+E0100..U+E01EF from 1 to 0.
3919 2003-04-25 Bruno Haible <bruno@clisp.org>
3921 * copy-file.c: Include <stddef.h>, for size_t.
3923 2003-04-25 Jim Meyering <jim@meyering.net>
3925 * copy-file.c (copy_file_preserving): Declare buf_size to be
3926 of type size_t, not int.
3928 2003-04-11 Jim Meyering <jim@meyering.net>
3930 Merge changes from Coreutils.
3932 2003-03-22 Jim Meyering <jim@meyering.net>
3934 * strftime.c (widen): Cast alloca return value to proper type.
3936 2003-01-19 Ulrich Drepper <drepper@redhat.com>
3939 * strftime.c (my_strftime): Handle very large width
3940 specifications for numeric values correctly. Improve checks for
3943 2003-01-19 Jim Meyering <jim@meyering.net>
3945 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
3946 (nl_get_alt_digit) [! defined my_strftime]: Define.
3947 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
3948 _nl_get_alt_digit and _nl_get_walt_digit.
3950 * strftime.c (my_strftime): Merge in locale-related changes from libc.
3951 These changes have no effect outside of _LIBC.
3953 2003-04-10 Bruno Haible <bruno@clisp.org>
3955 * findprog.h: New file, from GNU gettext.
3956 * findprog.c: New file, from GNU gettext.
3958 2003-04-05 Jim Meyering <jim@meyering.net>
3960 Merge changes from Coreutils.
3962 * exclude.h (PARAMS): Remove definition and uses.
3963 * exclude.c: Remove uses of `PARAMS'.
3965 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
3966 Add test-cases for DOS filenames. Declare program_name.
3967 (main): Set up program_name. Patch by Rich Dawe.
3969 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3971 Use mntctl's return value to drive the entry-processing loop, since
3972 we can't rely on the value of the vmt_length member in the last
3973 entry. On some systems doing so could result in exhausting
3974 virtual memory. Based in part on a patch from Mike Jetzer.
3976 2003-04-04 Bruno Haible <bruno@clisp.org>
3978 * linebreak.h: New file, from GNU gettext.
3979 * linebreak.c: New file, from GNU gettext with slight modifications.
3980 * lbrkprop.h: New file, from GNU gettext.
3982 2003-04-03 Bruno Haible <bruno@clisp.org>
3984 * utf8-ucs4.h: New file, from GNU gettext.
3985 * utf16-ucs4.h: New file, from GNU gettext.
3986 * ucs4-utf8.h: New file, from GNU gettext.
3987 * ucs4-utf16.h: New file, from GNU gettext.
3989 2003-04-02 Bruno Haible <bruno@clisp.org>
3991 * binary-io.h: New file, from GNU gettext.
3993 2003-04-01 Bruno Haible <bruno@clisp.org>
3995 * pathname.h: New file, from GNU gettext.
3996 * concatpath.c: New file, from GNU gettext.
3998 2003-03-30 Bruno Haible <bruno@clisp.org>
4000 * copy-file.c (copy_file_preserving): Don't set owner if the function
4001 chown() doesn't exist.
4003 2003-03-28 Bruno Haible <bruno@clisp.org>
4005 * copy-file.h: New file, from GNU gettext.
4006 * copy-file.c: New file, from GNU gettext.
4008 2003-03-18 Jim Meyering <jim@meyering.net>
4010 * quote.c (quote_n): Fix typo in comment.
4012 2003-03-14 Jim Meyering <jim@meyering.net>
4014 Merge changes from Coreutils.
4015 * obstack.h (obstack_object_size): Declare temporary, __o,
4016 to be const, in order to avoid warnings.
4017 (obstack_room): Likewise.
4018 (obstack_empty_p): Likewise.
4020 2003-03-13 Paul Eggert <eggert@twinsun.com>
4022 Merge changes from Bison.
4023 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
4024 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
4025 when compiling Bison 1.875's `bitset bset = obstack_alloc
4026 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
4027 * hash.c: Include <stdbool.h> unconditionally.
4029 2003-03-09 Paul Eggert <eggert@twinsun.com>
4031 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
4032 Reported by Bruce Becker; see:
4033 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
4035 2003-03-03 Paul Eggert <eggert@twinsun.com>
4036 Bruno Haible <bruno@clisp.org>
4038 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
4039 Reported by John Hughes, see
4040 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
4042 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
4044 * poll_.h: New file.
4047 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
4049 * mathl.h: New file.
4050 * acosl.c: New file.
4051 * asinl.c: New file.
4052 * atanl.c: New file.
4053 * ceill.c: New file.
4056 * floorl.c: New file.
4057 * frexpl.c: New file.
4058 * ldexpl.c: New file.
4060 * sincosl.c: New file.
4062 * sqrtl.c: New file.
4064 * trigl.c: New file.
4065 * trigl.h: New file.
4067 2003-02-17 Bruno Haible <bruno@clisp.org>
4069 * mkdtemp.h: New file, from GNU gettext.
4070 * mkdtemp.c: New file, from GNU gettext.
4072 2003-01-31 Bruno Haible <bruno@clisp.org>
4074 * rename.c: #undef rename before defining rpl_rename.
4075 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
4077 2003-01-30 Bruno Haible <bruno@clisp.org>
4079 * printf-args.h: New file, from GNU gettext.
4080 * printf-args.c: New file, from GNU gettext.
4081 * printf-parse.h: New file, from GNU gettext.
4082 * printf-parse.c: New file, from GNU gettext.
4083 * vasnprintf.h: New file, from GNU gettext.
4084 * vasnprintf.c: New file, from GNU gettext.
4085 * asnprintf.c: New file, from GNU gettext.
4086 * vasprintf.h: New file, from GNU gettext with modifications.
4087 * vasprintf.c: New file, from GNU gettext.
4088 * asprintf.c: New file, from GNU gettext.
4090 2003-01-29 Bruno Haible <bruno@clisp.org>
4092 * stpncpy.h: New file, from GNU gettext with modifications.
4093 * stpncpy.c: New file, from GNU gettext with modifications.
4095 2003-01-28 Bruno Haible <bruno@clisp.org>
4097 * c-ctype.h: New file, from GNU gettext, with changes suggested by
4099 * c-ctype.c: New file, from GNU gettext, with changes suggested by
4102 2003-01-27 Bruno Haible <bruno@clisp.org>
4104 * xsetenv.h: New file, from GNU gettext.
4105 * xsetenv.c: New file, from GNU gettext.
4107 2003-01-23 Bruno Haible <bruno@clisp.org>
4109 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
4111 2003-01-22 Bruno Haible <bruno@clisp.org>
4113 * exit.h: New file, from GNU gettext.
4115 2003-01-11 Bruno Haible <bruno@clisp.org>
4117 * stpcpy.h (stpcpy): Use ANSI C function declarations.
4118 * strcase.h (strcasecmp, strncasecmp): Likewise.
4120 2003-01-14 Jim Meyering <jim@meyering.net>
4122 * same.c (same_name): Tweak a comment.
4124 2003-01-11 Bruno Haible <bruno@clisp.org>
4126 * same.c (same_name): Reorder tests so as to avoid calling stat()
4127 when a string comparison is sufficient.
4129 2003-01-11 Bruno Haible <bruno@clisp.org>
4131 * readtokens.c (readtoken): Cast character to 'unsigned char', not
4134 2003-01-11 Bruno Haible <bruno@clisp.org>
4136 * hash-pjw.c: Add comment about low quality of this function.
4138 2003-01-12 Paul Eggert <eggert@twinsun.com>
4140 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
4141 to avoid collisions with libcurses and libreadline.
4143 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
4144 * getstr.h, getstr.c: Remove.
4145 * getline.c: Include "getline.h", to check interface.
4146 Move body of old getstr.c here: this defines MIN_CHUNK and
4147 declares getdelim2, which is renamed from getstr.
4148 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
4150 * linebuffer.c (readlinebuffer): Renamed from readline.
4152 * linebuffer.h: Likewise.
4153 (readline): Remove backward-compatibility macro.
4155 2003-01-12 Jim Meyering <jim@meyering.net>
4157 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
4159 2003-01-10 Bruno Haible <bruno@clisp.org>
4161 * alloca_.h: New file.
4162 * getdate.y: Unconditionally include alloca.h.
4163 * makepath.c: Likewise.
4164 * setenv.c: Likewise.
4165 * userspec.c: Likewise.
4167 2003-01-09 Bruno Haible <bruno@clisp.org>
4169 * stdbool.h.in: New file.
4171 2003-01-08 Bruno Haible <bruno@clisp.org>
4173 * safe-read.c: Include specification header first, to ensure its
4175 * full-write.c: Likewise.
4177 2003-01-08 Jim Meyering <jim@meyering.net>
4179 * full-write.c: Undefine and define-away `const' after inclusion
4180 of errno.h, not before. Suggestion from Bruno Haible.
4182 2003-01-07 Jim Meyering <jim@meyering.net>
4184 * full-write.c: Rework so that it may serve to define full_read, too.
4185 * full-read.c: Simply #define FULL_READ and include full-write.c.
4187 2003-01-06 Jim Meyering <jim@meyering.net>
4189 * version-etc.c: Update year in translatable copyright string.
4191 2002-12-25 Bruno Haible <bruno@clisp.org>
4193 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
4194 * xstrtol.h: Likewise.
4195 * xstrtoimax.c: Likewise.
4196 * xstrtoumax.c: Likewise.
4197 * human.h: Likewise.
4199 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
4200 on systems that have <inttypes.h> but not <stdint.h>.
4202 2002-12-31 Paul Eggert <eggert@twinsun.com>
4204 * memcoll.c (memcoll): Fall back on a simple algorithm using
4205 memcmp if strcoll doesn't work.
4207 2002-12-23 Bruno Haible <bruno@clisp.org>
4209 * localcharset.h: New file.
4210 * localcharset.c: Include it.
4211 * unicodeio.c: Likewise.
4213 2002-12-22 Bruno Haible <bruno@clisp.org>
4215 * utime.c (utime_null): No need to call ftruncate if the file was
4218 2002-12-23 Bruno Haible <bruno@clisp.org>
4220 * memcoll.c (STRCOLL): New macro.
4223 2002-12-22 Bruno Haible <bruno@clisp.org>
4225 * getstr.h (getstr): Define, to avoid clash with libcurses.
4226 * linebuffer.h (readline): Define, to avoid clash with libreadline.
4228 2002-12-22 Bruno Haible <bruno@clisp.org>
4230 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
4232 2002-12-23 Bruno Haible <bruno@clisp.org>
4234 * getline.h: Include <stddef.h>, for size_t.
4236 * unicodeio.h: Include <stddef.h>, for size_t.
4237 * unicodeio.c: Don't include <stddef.h>.
4239 2002-12-17 Bruno Haible <bruno@clisp.org>
4241 * canon-host.c (strdup): Remove unused declaration.
4243 * fsusage.c: Include full_read.h.
4244 (get_fs_usage): Use full_read instead of safe_read.
4246 * utime.c (utime_null): Use SAFE_READ_ERROR.
4248 2002-12-11 Bruno Haible <bruno@clisp.org>
4250 * setenv.h: Rewritten to cope with systems that have setenv() but not
4252 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
4255 2002-12-11 Bruno Haible <bruno@clisp.org>
4257 * setenv.c (alloca): Fall back to malloc.
4259 (setenv): Use freea() to free memory allocated with alloca().
4261 2002-11-13 Bruno Haible <bruno@clisp.org>
4263 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
4264 function declarations.
4265 * unsetenv.c (unsetenv): Likewise.
4267 2002-03-04 Bruno Haible <bruno@clisp.org>
4269 Portability to AIX 4.3.3.
4270 * unsetenv.c: New file, extracted from setenv.c.
4271 * setenv.c: Move the unsetenv() function to unsetenv.c.
4273 2001-12-20 Bruno Haible <bruno@clisp.org>
4275 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
4276 use malloc instead. For SunOS 4.
4278 2001-12-11 Bruno Haible <bruno@clisp.org>
4280 * setenv.c: Declare alloca.
4281 (compar_fn_t): New typedef.
4282 (KNOWN_VALUE, STORE_VALUE): Use it.
4284 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
4287 2002-12-10 Paul Eggert <eggert@twinsun.com>
4289 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
4290 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
4291 Choose values that are less likely to collide with system fnmatch
4293 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
4294 defined (e.g., a pure POSIX system).
4295 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
4296 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
4298 2002-12-06 Jim Meyering <jim@meyering.net>
4300 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
4302 Merge in changes from libc's misc/error.c, in preparation
4303 for the merge of gnulib's changes back into libc.
4305 * error.c (_): Define only if not already defined.
4306 Move definition to follow all #include directives.
4307 Include unlocked-io.h only if !_LIBC.
4308 [_LIBC]: Include <libio/libioP.h>.
4309 [USE_IN_LIBIO]: Include <libio/iolibio.h>
4310 (fflush): Tweak definition to use INTUSE.
4313 2002-12-05 Paul Eggert <eggert@twinsun.com>
4315 * alloca.c [defined emacs]: Include "lisp.h".
4316 (xalloc_die) [defined emacs]: New macro.
4317 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
4318 [! defined emacs]: Include <xalloc.h>.
4319 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
4320 (pointer): Typedef to POINTER_TYPE *.
4321 (malloc): Remove decl; we now always use xmalloc.
4322 (alloca): Use old-style definition, since Emacs needs this.
4323 Check for arithmetic overflow when computing combined size.
4325 2002-12-04 Paul Eggert <eggert@twinsun.com>
4327 Do not generate unlocked-io.h automatically, since it's easier to
4328 maintain it by hand.
4330 * unlocked-io.h: New file, from GNU diffutils,
4331 but with proper copyright notice and attribution.
4333 * Makefile.am: Add copyright notice.
4334 (libfetish_a_SOURCES): Add unlocked-io.h.
4335 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
4336 (DISTCLEANFILES, io_functions): Remove macros.
4337 (EXTRA_DIST): Remove gen_uio.
4338 (unlocked-io.h): Remove rule.
4340 2002-12-04 Jim Meyering <jim@meyering.net>
4342 Reflect the fact that stat.c and lstat.c are no longer generated.
4343 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
4344 (DISTCLEANFILES): Likewise.
4345 (EXTRA_DIST): Likewise.
4346 (all_local): Don't depend on stat.c or lstat.c.
4347 (stat.c, lstat.c): Remove rules.
4348 (EXTRA_DIST): Remove xstat.in.
4350 * xstat.in: Remove file. Contents moved into stat.c.
4351 * stat.c: New file. Contents mostly from xstat.in.
4352 * stat.c: Rework so that it may serve to define rpl_lstat, too.
4353 * lstat.c: New file. Simply #define LSTAT and include stat.c.
4355 * safe-read.c: Rework so that it may serve to define safe_write, too.
4356 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
4358 2002-12-03 Jim Meyering <jim@meyering.net>
4360 * safe-read.c, safe-write.c: Change variable names and comments, but
4361 not semantics, to minimize the differences between these two files.
4362 (safe_read): Change comment to mention SAFE_READ_ERROR.
4364 * safe-read.c (IS_EINTR): Define.
4365 (safe_read): Use IS_EINTR in place of in-function cpp directives.
4367 2002-12-02 Bruno Haible <bruno@clisp.org>
4369 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
4370 Define, taken from safe-read.c.
4371 (INT_MAX): Provide fallback.
4372 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
4373 * safe-write.h (SAFE_WRITE_ERROR): Define.
4375 * safe-read.c (EINTR): Remove definition.
4376 (safe_read): Don't use EINTR if it is absent.
4378 2002-12-02 Jim Meyering <jim@meyering.net>
4380 * safe-read.c (EINTR): Define.
4381 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4382 (INT_MAX): Provide fallback.
4383 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
4385 * safe-read.h (SAFE_READ_ERROR): Define.
4387 2002-12-01 Jim Meyering <jim@meyering.net>
4389 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
4390 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
4392 2002-11-27 Paul Eggert <eggert@twinsun.com>
4394 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4395 hash_rehash): Replace `if (limit <= value) abort ();' with
4396 `if (! (value < limit)) abort ();', for readability.
4398 2002-11-26 <karl@gnu.org>
4400 * strdup.c: copy from libc again, with jim's ok.
4401 * .cppi-disable: re-add strdup.c
4403 2002-11-25 <karl@gnu.org>
4405 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
4406 instead of "strtol.c".
4408 2002-11-25 Jim Meyering <jim@meyering.net>
4410 * mktime.c: Sync from libc, now that it has the latest fix.
4412 2002-11-24 <karl@gnu.org>
4414 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
4415 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
4417 2002-11-24 Jim Meyering <jim@meyering.net>
4419 Update from coreutils:
4421 * mktime.c: Merge in changes from libc.
4423 Avoid a link-time failure on some Linux systems.
4424 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
4425 (__mon_yday): Declare with the STATIC attribute.
4426 (__mktime_internal): Likewise.
4427 Based on a report from Greg Schafer.
4429 2002-11-23 Jim Meyering <jim@meyering.net>
4431 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
4432 Use `unsigned', not `int', as type of index.
4434 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
4436 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
4438 2002-11-22 Paul Eggert <eggert@twinsun.com>
4440 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
4441 hint that one should use `if (! x) abort ();' rather than `assert
4442 (x);', and anyway it's one less thing to worry about configuring.
4443 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4444 hash_rehash, hash_insert): Use abort rather than assert.
4446 2002-11-22 Paul Eggert <eggert@twinsun.com>
4448 * quotearg.h: Allow multiple inclusion by surrounding with
4449 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
4450 so that we can be included first.
4451 (PARAMS): Remove; we now assume C89 or later. All uses removed.
4452 * quotearg.c: Include quotearg.h immediately after config.h.
4453 No need to include stddef.h or sys/types.h any more.
4454 Surround local include files with "", not "<>".
4455 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
4456 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
4457 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
4458 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
4459 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
4460 (ISPRINT): Remove; no longer needed now that we assume C89.
4462 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
4465 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
4466 quotearg_char): Use SIZE_MAX rather than
4467 (size_t) -1 when we are talking about "infinity".
4469 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
4471 2002-11-22 Bruno Haible <bruno@clisp.org>
4473 * safe-read.h: Assume C89. Add comments.
4474 (safe_read): Change return type to size_t.
4475 * safe-read.c (safe_read): Change return type to size_t. Handle byte
4476 counts > SSIZE_MAX correctly.
4477 * safe-write.h: New file.
4478 * safe-write.c: New file.
4479 * full-read.h: New file.
4480 * full-read.c: New file.
4481 * full-write.h: Assume C89. Add comments.
4482 * full-write.c: Include safe-write.h.
4483 (full_write): Rewritten to use safe_write.
4484 Suggested by Jim Meyering and Paul Eggert.
4486 2002-11-21 Bruno Haible <bruno@clisp.org>
4488 Remove case insensitive option matching.
4489 * argmatch.h (argcasematch): Remove declaration.
4490 (ARGCASEMATCH): Remove macro.
4491 (__xargmatch_internal): Remove case_sensitive argument.
4492 (XARGMATCH): Update.
4493 (XARGCASEMATCH): Remove macro.
4494 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
4495 case_sensitive argument.
4496 (argcasematch): Remove function.
4497 (__xargmatch_internal): Remove case_sensitive argument.
4498 (main): Use XARGMATCH instead of XARGCASEMATCH.
4500 * xmalloc.c: Change compile-time error message. Add comment about
4501 required autoconf version.
4503 2002-11-21 Jim Meyering <jim@meyering.net>
4505 * strdup.c (strdup): Tweak comment and initial #if/#include.
4507 Merge in changes from the coreutils.
4509 2002-09-25 Paul Eggert <eggert@twinsun.com>
4510 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
4511 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
4512 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
4513 int. Work more efficiently if X is the same width as uintmax_t.
4514 Do not compare X to -1, to avoid bogus compiler warning.
4515 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
4516 Don't assume that f_frsize and f_bsize are the same type.
4518 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
4521 * makepath.c (make_path): Restore umask *before* creating the final
4523 (make_path): Minor reformatting.
4525 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
4526 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
4528 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
4529 ones. At least on GNU/Linux systems, `auto' means something else.
4532 2002-11-20 Paul Eggert <eggert@twinsun.com>
4534 Merge argmatch cleanups from Bison. Assume C89.
4536 * argmatch.c: Include config.h here, not in argmatch.h.
4537 Include stdlib.h, for EXIT_FAILURE.
4538 Always include <string.h>, since we assume C89.
4539 (EXIT_FAILURE): Remove pre-C89 bug workaround.
4540 * argmatch.h: Do not include <config.h> or <sys/types.h>.
4541 Include <stddef.h> instead, since it's all we need for size_t.
4542 (PARAMS): Remove. All uses removed.
4543 (ARRAY_CARDINALITY): Do not bother to #undef.
4544 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
4545 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4546 Remove unnecessary parentheses.
4547 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4548 Insert necessary parentheses.
4549 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
4550 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
4552 2002-11-19 Bruno Haible <bruno@clisp.org>
4554 * mbswidth.c: Include mbswidth.h right at the beginning.
4555 * mbswidth.h: Include <stddef.h>, for size_t.
4557 * mbswidth.h (PARAMS): Remove macro.
4558 (mbswidth, mbsnwidth): Use ANSI C function declarations.
4559 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
4561 * gcd.h (PARAMS): Remove macro.
4562 (gcd): Use ANSI C function declarations.
4563 * gcd.c (gcd): Likewise.
4565 2002-11-15 Bruno Haible <bruno@clisp.org>
4567 * strcspn.c: Include <stddef.h>.
4568 (strcspn): Use ANSI C function declaration. Change return type to
4570 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
4571 (strpbrk): Use NULL.
4572 * strpbrk.h (PARAMS): Remove macro.
4573 (strpbrk): Use ANSI C function declaration.
4574 * strstr.c: Don't include <sys/types.h>.
4575 * strstr.h (PARAMS): Remove macro.
4576 (strstr): Use ANSI C function declarations.
4578 2002-11-06 Bruno Haible <bruno@clisp.org>
4580 * gcd.h (gcd): Change argument type to 'unsigned long'.
4581 * gcd.c (gcd): Likewise.
4583 2002-11-05 Bruno Haible <bruno@clisp.org>
4585 * gcd.h: New file, from gettext-0.11.5.
4586 * gcd.c: New file, from gettext-0.11.5.
4588 2002-11-05 Bruno Haible <bruno@clisp.org>
4590 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4591 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4592 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4593 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4595 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4596 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4598 * closeout.c: Include gettext.h instead of <libintl.h>.
4599 * human.c: Include gettext.h instead of <libintl.h>.
4600 * quotearg.c: Include gettext.h instead of <libintl.h>.
4601 * rpmatch.c: Include gettext.h instead of <libintl.h>.
4602 * unicodeio.c: Include gettext.h instead of <libintl.h>.
4603 * userspec.c: Include gettext.h instead of <libintl.h>.
4604 * version-etc.c: Include gettext.h instead of <libintl.h>.
4605 * xmalloc.c: Include gettext.h instead of <libintl.h>.
4606 (textdomain): Remove definition.
4607 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
4609 * long-options.c: Remove include of <libintl.h> and definition of _.
4610 * same.c: Remove include of <libintl.h> and definition of _.
4612 2002-11-04 Bruno Haible <bruno@clisp.org>
4614 * stpcpy.h: New file, from GNU gettext-0.11.5.
4615 * strcase.h: New file, from GNU gettext-0.11.5.
4616 * strpbrk.h: New file, from GNU gettext-0.11.5.
4617 * strstr.h: New file, from GNU gettext-0.11.5.
4618 * xgetcwd.h: New file, from GNU gettext-0.11.5.
4620 2002-05-09 Bruno Haible <bruno@clisp.org>
4622 * config.charset: Update for newest glibc. Add canonical names
4623 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
4625 2002-05-09 Bruno Haible <bruno@clisp.org>
4627 * localcharset.c (get_charset_aliases): Add more Windows specific
4630 2002-05-08 Owen Taylor <otaylor@redhat.com>
4632 * config.charset: A few additions for Solaris.
4634 2001-12-05 Bruno Haible <bruno@clisp.org>
4636 * localcharset.c (locale_charset): Don't return an empty string.
4638 2001-10-23 Bruno Haible <haible@clisp.cons.org>
4640 * config.charset: msdos in uk_UA uses CP1125.
4642 2001-08-05 Bruno Haible <haible@clisp.cons.org>
4644 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
4645 * localcharset.c (locale_charset): Declare as extern "C".
4647 2002-02-15 Bruno Haible <bruno@clisp.org>
4649 * config.charset [msdosdjgpp]: For Russian, use CP866.
4651 2002-02-11 Bruno Haible <bruno@clisp.org>
4653 * config.charset: Add support for NetBSD.
4655 2002-09-25 <karl@gnu.org>
4657 * strdup.c: copy from libc/string (via ../config/srclist*).
4658 * getopt*: copy from libc/posix.
4659 * gettext.h: copy from gettext.
4660 * .cppi-disable: add strdup.c, gettext.h.
4662 2002-07-01 Jim Meyering <meyering@lucent.com>
4664 * c-stack.c: Include sys/time.h.
4665 From Volker Borchert.
4667 2002-06-11 Paul Eggert <eggert@twinsun.com>
4669 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
4670 New macro. Use it uniformly instead of
4671 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
4672 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
4673 reported by Vin Shelton.
4675 2002-06-22 Jim Meyering <meyering@lucent.com>
4677 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
4678 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
4680 2002-06-22 Paul Eggert <eggert@twinsun.com>
4682 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
4683 Do not assume SA_SIGINFO behavior.
4684 Bug reported by Jim Meyering on NetBSD 1.5.2.
4686 2002-06-22 Jim Meyering <meyering@lucent.com>
4688 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
4690 * exitfail.c, exitfail.h: Likewise.
4691 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
4693 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
4695 (EXTRA_DIST): Add fnmatch_loop.c.
4696 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
4698 * fnmatch_loop.c: New file, from diffutils-2.8.2.
4699 * fnmatch.c: Update from diffutils-2.8.2.
4700 * fnmatch_.h: New file. From diffutils-2.8.2.
4701 * fnmatch.h: Remove file.
4703 2002-06-18 Paul Eggert <eggert@twinsun.com>
4705 * file-type.h: Report an error if neither S_ISREG nor
4706 S_IFREG is defined, instead of using a test specific to glibc
4707 2.2. This should be safe, since POSIX requires S_ISREG and
4708 Unix Version 7 had S_IFREG. We don't need to check for
4709 <sys/types.h> since we don't use any symbols that it defines.
4711 2002-06-15 Jim Meyering <meyering@lucent.com>
4713 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
4714 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
4715 have been included before this file.
4717 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
4719 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
4720 so that each temporary file name is unique and valid in the first
4721 8 characters, for operation under DOS.
4723 2002-06-15 Jim Meyering <meyering@lucent.com>
4725 Work even with DJGPP 2.03, which lacks support for symlinks.
4727 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
4729 * lchown.c (S_ISLNK): Likewise.
4731 2002-06-14 Jim Meyering <meyering@lucent.com>
4733 * file-type.h: Use the version from diffutils-2.8.2.
4734 * file-type.c: Likewise.
4736 2002-05-27 Jim Meyering <meyering@lucent.com>
4738 Fix a problem seen only on nonconforming systems whereby ls.c's
4739 use of localtime, and then of gettimeofday would cause trouble:
4740 the localtime call used to initialize rpl_gettimeofday's save
4741 mechanism would clobber ls's current local time information so
4742 that in any long listing the first file would always be listed
4743 with date 1970-01-01. Analysis by Volker Borchert.
4745 * gettimeofday.c (localtime): Undefine.
4746 (rpl_localtime): New function.
4748 2002-05-22 Jim Meyering <meyering@lucent.com>
4750 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
4751 * file-type.h: New file.
4752 * file-type.c (file_type): New file/function. Extracted from diffutils.
4754 2002-04-29 Paul Eggert <eggert@twinsun.com>
4756 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
4758 2002-04-28 Paul Eggert <eggert@twinsun.com>
4760 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
4761 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
4762 of 127, since 64 is the largest conceivable number for ancient
4764 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
4766 2002-04-28 Jim Meyering <meyering@lucent.com>
4768 * sig2str.c (WTERMSIG): Remove definition (unused).
4770 2002-04-28 Paul Eggert <eggert@twinsun.com>
4772 * sig2str.h, sig2str.c: New files.
4773 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
4775 2002-04-24 Jim Meyering <meyering@lucent.com>
4777 * gettext.h: New file, from Gettext.
4778 * Makefile.am (INCLUDES): Remove -I../intl.
4779 (libfetish_a_SOURCES): Add gettext.h.
4781 2002-04-16 Jim Meyering <meyering@lucent.com>
4783 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
4784 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
4785 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
4787 2002-04-12 Jim Meyering <meyering@lucent.com>
4789 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
4791 2002-03-10 Jim Meyering <meyering@lucent.com>
4793 * makepath.c (make_path): Remove a comma from a diagnostic.
4794 Suggestion from Santiago Vila.
4796 2002-03-08 Jim Meyering <meyering@lucent.com>
4798 * rename.c: Mention that this wrapper is needed also on
4799 mips-dec-ultrix4.4 systems.
4801 2002-03-02 Jim Meyering <meyering@lucent.com>
4803 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
4804 not HAVE_CLOCK_SETTIME.
4806 2002-02-27 Paul Eggert <eggert@twinsun.com>
4808 * nanosleep.h: Rename to....
4809 * timespec.h: New name for nanosleep.h. All uses changed.
4811 * gettime.c: New file.
4812 * settime.c: New file.
4815 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
4816 timespec.h. Remove nanosleep.h.
4818 2002-02-25 Paul Eggert <eggert@twinsun.com>
4820 * acl.c, acl.h: New files.
4821 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
4823 2002-02-24 Jim Meyering <meyering@lucent.com>
4825 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
4826 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
4827 cause trouble. Reported by Nelson Beebe.
4829 2002-02-23 Paul Eggert <eggert@twinsun.com>
4831 * path-concat.c (xpath_concat): Reorder code to pacify
4832 compilers that don't know that xalloc_die never returns.
4834 2002-02-20 Jim Meyering <meyering@lucent.com>
4836 * getdate.c: Regenerate using bison-1.33.
4838 2002-02-15 Paul Eggert <eggert@twinsun.com>
4840 * posixver.c, posixver.h: New files.
4841 * Makefile.am (libfetish_a_SOURCES): Add them.
4843 2002-02-02 Paul Eggert <eggert@twinsun.com>
4844 Bruno Haible <bruno@clisp.org>
4846 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
4847 (fwrite_success_callback): New declaration.
4848 * unicodeio.c (unicode_to_mb): New function, extracted from
4849 print_unicode_char. Call failure callback instead of error.
4850 (fwrite_success_callback): New function.
4851 (exit_failure_callback): New function.
4852 (fallback_failure_callback): New function.
4853 (print_unicode_char): Call unicode_to_mb.
4855 2002-01-26 Jim Meyering <meyering@lucent.com>
4857 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
4859 2002-01-22 Jim Meyering <meyering@lucent.com>
4861 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
4862 Otherwise, some versions of automake would omit the rule that makes
4863 Makefile from Makefile.in.
4865 2001-01-21 Paul Eggert <eggert@twinsun.com>
4867 * xmemcoll.h, xmemcoll.c: New files.
4868 * Makefile.am (libfetish_a_SOURCES): Add them.
4869 * memcoll.c: Include errno.h, and declare errno if not defined.
4870 (memcoll): Set errno to zero if there is no error.
4872 * quotearg.c (quotearg_buffer_restyled):
4873 Fix bug with quoting buffers containing NUL when backslashing escapes.
4874 This bug was exposed by the other changes in this patch.
4875 (quotearg_n_options): New arg ARGSIZE.
4876 All callers changed.
4877 (quoting_options_from_style): New function.
4878 (quotearg_n_style): Use it.
4879 (quotearg_n_style_mem): New function.
4881 * quotearg.h (quotearg_n_style_mem): New function.
4883 2002-01-16 Jim Meyering <meyering@lucent.com>
4885 * getdate.y: Add three semicolons, each just before a closing brace.
4886 Bison (as of version 1.31) no longer papers over that mistake.
4888 2002-02-14 Paul Eggert <eggert@twinsun.com>
4890 * backupfile.c (ISDIGIT): Comment fix.
4891 * getdate.y (ISDIGIT): Likewise.
4892 * posixtm.c (ISDIGIT, year): Likewise.
4893 * strverscmp.c (ISDIGIT): Likewise.
4894 * userspec.c (ISDIGIT): Likewise.
4896 2002-01-05 Jim Meyering <meyering@lucent.com>
4898 * version-etc.c (version_etc_copyright): Update copyright year.
4900 2001-01-19 Paul Eggert <eggert@twinsun.com>
4902 * closeout.c (close_stdout_status): If ferror (stdout), do
4903 not silently exit merely because the output buffer happens to
4904 have nothing pending.
4906 2001-12-18 Paul Eggert <eggert@twinsun.com>
4908 See the big note in ../ChangeLog.
4909 * human.c (suffixes): Prefer K to k for 1024.
4910 (generate_suffix_backwards): New function.
4911 (human_readable_inexact): Use it.
4912 * xstrtol.c (__xstrtol): If there is no number but there
4913 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
4914 Accept 'K' as well as 'k'.
4916 2001-12-15 Jim Meyering <meyering@lucent.com>
4918 * regex.h (__restrict_arr): Update from libc.
4920 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
4921 as `remote' if the name starts with `//'. Suggested by Michael Stone.
4924 2001-12-10 Jim Meyering <meyering@lucent.com>
4926 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
4927 Instead, include "xalloc.h".
4928 (initbuffer): Don't cast xmalloc return value to char*.
4929 (readline): Reword comment.
4930 Don't cast xrealloc return value to char*
4933 2001-12-09 Jim Meyering <meyering@lucent.com>
4935 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
4936 `signed and unsigned type in conditional expression'.
4937 * posixtm.c (posix_time_parse): Likewise.
4939 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
4941 * readtokens.c (readtoken): Declare an index to be of type unsigned
4942 to avoid a pedantic warning.
4944 * getstr.c: Don't include assert.h.
4945 (getstr): Remove warning-evoking assertions.
4946 Return -1 if offset parameter is out of bounds.
4947 Change the type of a local from int to size_t.
4949 * strftime.c (my_strftime_localtime_r): Include this function
4950 definition in the `#if ! HAVE_TM_GMTOFF' block.
4952 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
4953 Include xalloc.h instead.
4955 2001-12-02 Jim Meyering <meyering@lucent.com>
4957 * tempname.c: Don't declare getenv, thus reverting the change of
4958 2001-11-18. It's no longer necessary, now that stdlib.h is always
4961 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
4962 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
4964 2001-11-30 Akim Demaille <akim@epita.fr>
4966 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
4967 before being defined.
4969 2001-11-27 Paul Eggert <eggert@twinsun.com>
4971 * quotearg.h (quotearg_n, quotearg_n_style):
4972 First arg is int, not unsigned.
4973 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
4974 (SIZE_MAX, UINT_MAX): New macros.
4975 (quotearg_n_options): Abort if N is negative.
4976 Avoid overflow check on hosts where size_t is 64 bits and int
4977 is 32 bits, as overflow is impossible there.
4978 Fix off-by-one typo that caused unnecessary reallocation.
4980 2001-11-27 Jim Meyering <meyering@lucent.com>
4982 * tempname.c: Merge with version from libc.
4983 * regex.c: Likewise.
4985 * tempname.c: Include stdlib.h unconditionally. On some old systems
4986 for which STDC_HEADERS is 0, it was not included, resulting in a
4987 warning about an integer-to-pointer conversion problem with getenv.
4988 Reported by Volker Borchert.
4990 2001-11-26 Jim Meyering <meyering@lucent.com>
4992 * gtod.h: Remove file.
4993 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
4994 * gettimeofday.c: Don't include gtod.h.
4995 (GTOD_init): Remove function.
4996 (rpl_gettimeofday): Do its job here instead, rather than aborting.
4997 Suggestion from Volker Borchert.
4999 2001-11-23 Jim Meyering <meyering@lucent.com>
5001 * hash.h (struct hash_table): Don't define here. Merely declare it.
5002 * hash.c (struct hash_table): Define it here instead.
5004 2001-11-22 Jim Meyering <meyering@lucent.com>
5006 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
5008 2001-11-18 Paul Eggert <eggert@twinsun.com>
5010 * tempname.c (TMP_MAX): Remove; no longer needed.
5011 (TEMPORARIES): New macro.
5012 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
5013 removes an artificial limitation (e.g. HP-UX 10.20, where
5016 2001-11-18 Jim Meyering <meyering@lucent.com>
5018 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
5021 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
5022 files will be created before anything else.
5024 2001-11-17 Jim Meyering <meyering@lucent.com>
5026 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
5027 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
5028 rather than group writable. Patch by Juan F. Codagnone.
5030 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
5031 Instead, include "xalloc.h".
5033 * mountlist.c: Include unlocked-io.h after all system headers.
5034 Remove explicit declarations of xmalloc, xrealloc,
5035 and xstrdup. Instead, include "xalloc.h".
5037 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
5038 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
5039 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
5041 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
5042 Reported by Padraig Brady.
5044 * mkstemp.c: #undef mkstemp.
5046 (rpl_mkstemp): Rename from mkstemp.
5049 2001-11-16 Jim Meyering <meyering@lucent.com>
5051 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
5052 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
5053 determine the amount of total physical memory, use pstat_getstatic.
5054 HPUX-11 doesn't define _SC_PHYS_PAGES.
5055 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
5056 If sysconf couldn't be used to determine the amount of available
5057 physical memory, use both pstat_getstatic and pstat_getdynamic.
5058 Based on a patch from Bob Proulx.
5060 2001-11-05 Jim Meyering <meyering@lucent.com>
5062 * xstat.in (slash_aware_lstat): Correct a misleading comment.
5064 2001-11-03 Jim Meyering <meyering@lucent.com>
5066 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
5067 in argmatch_to_argument call.
5069 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
5072 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
5073 e.g., a fault due to an attempt to free a NULL pointer.
5075 2001-11-01 Jim Meyering <meyering@lucent.com>
5077 * dirfd.c, dirfd.h: New files.
5078 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
5080 * hash.c (hash_print) [TESTING]: Clean up.
5082 2001-10-22 Paul Eggert <eggert@twinsun.com>
5084 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
5085 to avoid a warning if -Wall.
5087 2001-10-21 Paul Eggert <eggert@twinsun.com>
5089 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
5091 2001-10-21 Jim Meyering <meyering@lucent.com>
5093 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
5094 this code would end up calling gettext even in packages built
5096 * getopt.c (_): Likewise.
5097 * regex.c (_): Likewise.
5099 2001-10-20 Paul Eggert <eggert@twinsun.com>
5101 * error.c (strerror_r): Do not declare unless !_LIBC.
5102 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
5103 Use strerror_r that is only a macro, even if it is not a function.
5104 (strerror): Check for HAVE_DECL_STRERROR before declaring.
5105 (private_strerror): Use prototypes, not old-style function definition.
5106 (print_errno_message): New function.
5107 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
5109 (error_tail, error, error_at_line): Use it.
5111 2001-10-11 Jim Meyering <meyering@lucent.com>
5113 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
5114 and quote_n (1, ... to avoid clobbering a buffer.
5116 2001-10-05 Jim Meyering <meyering@lucent.com>
5118 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
5119 * hash-pjw.c: New file (factored out of fileutils' remove.c).
5120 * hash-pjw.h: New file.
5122 2001-09-30 Jim Meyering <meyering@lucent.com>
5124 * mountlist.c [MOUNTED_GETFSSTAT]:
5125 Include <sys/ucred.h>, for Apple Darwin.
5126 Include sys/mount.h and sys/fs_types.h only if available.
5128 (read_filesystem_list): Use FS_TYPE.
5130 2001-09-29 Paul Eggert <eggert@twinsun.com>
5132 * exclude.c (excluded_filename): 0 -> false, since it's
5135 2001-09-28 Paul Eggert <eggert@twinsun.com>
5137 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
5138 #defines strtoimax. Also treat the other strto* functions
5141 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
5142 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
5143 (strtoimax, strtoumax): Do not declare if already defined as a macro.
5145 2001-09-26 Jim Meyering <meyering@lucent.com>
5147 Most macros in unlocked-io.h had the wrong number of arguments.
5148 * gen-uio: New script.
5149 (USE_UNLOCKED_IO): Define to 1 if not already defined.
5150 * unlocked-io.hin: Remove file.
5151 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
5152 rather than trying to embed it here.
5153 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
5154 Reported by Padraig Brady.
5156 2001-09-25 Volker Borchert <bt@teknon.de>
5158 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
5160 2001-09-23 Jim Meyering <meyering@lucent.com>
5162 * mountlist.c: Remove useless parentheses in #if directives.
5163 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
5164 the deprecated MOUNTED symbol is no longer defined in mntent.h.
5166 2001-09-22 Jim Meyering <meyering@lucent.com>
5168 * localcharset.c: Update from latest gettext.
5169 * config.charset: Likewise.
5171 2001-09-20 Jim Meyering <meyering@lucent.com>
5173 * xstrtol.c (strtoimax): Guard declaration with
5174 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
5175 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
5176 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
5177 (strtoumax): Likewise, for completeness (it wasn't necessary).
5179 2001-09-06 Paul Eggert <eggert@twinsun.com>
5181 * strtoimax.c (HAVE_LONG_LONG):
5182 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
5183 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
5184 to work around bug in IBM C compiler.
5186 2001-09-16 Jim Meyering <meyering@lucent.com>
5188 * mkdir.c: New file.
5190 2001-09-04 Paul Eggert <eggert@twinsun.com>
5192 * xgetcwd.c: Revert some of the previous change; intead,
5193 fix the HAVE_GETCWD_NULL code to behave more like the
5194 !HAVE_GETCWD_NULL code used to.
5197 (xgetcwd): Do not return NULL when memory is exhausted; instead,
5200 2001-09-04 Paul Eggert <eggert@twinsun.com>
5202 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
5203 Use ssize_t, not int, to store result of readlink.
5204 Check for ssize_t overflow as well as size_t overflow,
5205 as POSIX says the result of readlink is implementation-defined
5206 when ssize_t overflows.
5207 Remove unnecessary cast to char*.
5208 Use free+malloc instead of realloc, as the storage doesn't need
5209 to be preserved and it's clearer and can be more efficient that way.
5210 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
5211 * xreadlink.h (xreadlink): Update prototype.
5213 2001-09-03 Paul Eggert <eggert@twinsun.com>
5215 * exclude.c (fnmatch_no_wildcards): Fix confusion between
5216 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
5217 spotted by Jim Meyering.
5219 2001-09-03 Jim Meyering <meyering@lucent.com>
5221 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
5223 2001-09-03 Paul Eggert <eggert@twinsun.com>
5225 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
5226 like the HAVE_GETCWD_NULL code.
5227 Include pathmax.h if not HAVE_GETCWD.
5228 Do not include xalloc.h.
5229 (INITIAL_BUFFER_SIZE): New symbol.
5230 Do not use xmalloc / xrealloc, since the caller is responsible for
5231 handling errors. Preserve errno around `free' during failure.
5232 Do not overrun buffer when using getwd.
5234 2001-09-03 Paul Eggert <eggert@twinsun.com>
5236 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
5237 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
5239 2001-09-02 Jim Meyering <meyering@lucent.com>
5241 * error.c: Update from GNU libc.
5243 2001-09-01 Jim Meyering <meyering@lucent.com>
5245 * xreadlink.c: New file.
5246 * xreadlink.h: New file.
5247 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
5249 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
5250 doesn't conflict with sparc Solaris 7's definition in
5251 /usr/include/sys/int_types.h.
5253 * exclude.c: Use `""', not `<>' to #include non-system header files.
5254 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
5255 and strncasecmp as r-values. Unixware didn't have declarations.
5257 2001-08-31 Jim Meyering <meyering@lucent.com>
5259 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
5260 Use an initial, malloc'd, buffer of length 128 rather than
5261 a statically allocated one of length 1024.
5263 2001-08-30 Paul Eggert <eggert@twinsun.com>
5265 * xgetcwd.c: Don't include pathmax.h.
5266 Include stdlib.h and unistd.h if available.
5268 (xmalloc, xstrdup, free): Remove decls.
5269 (xgetcwd): Don't assume sizes fit in unsigned.
5270 Check for overflow when computing sizes.
5271 Simplify reallocation code.
5273 2001-08-28 Paul Eggert <eggert@twinsun.com>
5275 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
5277 * strtoimax.c: Renamed from strtoxmax.c, removing the
5280 Also, make the following further changes to make this file's
5281 configuration more similar to that of strtol.c:
5282 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
5283 (strtoumax, uintmax_t, strtoull, strtol): Remove.
5284 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
5285 (strtoimax): Renamed from strtoumax. All uses of unsigned values
5286 changed to signed values.
5288 And make the following changes as well:
5289 Fix copyright notice, as 1999 was missing.
5290 (verify): New macro.
5291 (strtoimax): Check sizes at compile-time, not run-time.
5292 Prefer strtol to strtoll if both work.
5293 (main): Remove; it was not that useful and was a pain to maintain.
5295 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
5297 2001-08-30 Paul Eggert <eggert@twinsun.com>
5299 * savedir.c (savedir): Remove size parameter, as POSIX says that
5300 a directory's st_size can have an arbitrary value, so the old
5301 usage could waste an arbitrary amount of memory. All uses
5303 * savedir.h: Update prototype.
5305 2001-08-30 Paul Eggert <eggert@twinsun.com>
5307 * xstrtol.c (strtoimax): New decl.
5309 2001-08-28 Paul Eggert <eggert@twinsun.com>
5311 * xstrtol.h: Add copyright notice.
5312 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
5313 LONGINT_INVALID_SUFFIX_CHAR.
5315 2001-08-30 Paul Eggert <eggert@twinsun.com>
5317 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5320 2001-08-30 Paul Eggert <eggert@twinsun.com>
5322 * hash.c: Remove '2001' from copyright notice.
5324 2001-08-30 Paul Eggert <eggert@twinsun.com>
5326 * full-write.h: New file.
5327 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
5328 * full-write.c: Correct credits, as cccp.c no longer
5329 exists and anyway it was so heavily changed from the old cccp
5330 code as to be unrecognizable. Include full-write.h.
5331 (full_write) Return size_t, with short writes meaning failure.
5332 All callers changed. This fixes a bug with large buffers
5334 * utime.c: Include full-write.h.
5336 2001-08-30 Paul Eggert <eggert@twinsun.com>
5338 Merge 'exclude' changes from tar 1.13.22.
5339 This fixes one or two unlikely storage allocation overflow bugs,
5340 but doesn't change user-visible behavior otherwise.
5342 2001-08-30 Paul Eggert <eggert@twinsun.com>
5344 * exclude.c (bool): Declare, perhaps by including stdbool.h.
5345 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
5346 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
5347 Include if available.
5348 (<xalloc.h>): Include
5349 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
5350 (verify): New macro. Use it to verify that EXCLUDE macros do not
5351 collide with FNM macros.
5352 (struct patopts): New struct.
5353 (struct exclude): Use it, as exclude patterns now come with options.
5354 (new_exclude): Support above changes.
5355 (new_exclude, add_exclude_file):
5356 Initial size must now be a power of two to simplify overflow checking.
5357 (free_exclude, fnmatch_no_wildcards): New function.
5358 (excluded_filename): No longer requires options arg, as the options
5359 are determined by add_exclude. Now returns bool, not int.
5360 (excluded_filename, add_exclude):
5361 Add support for the fancy new exclusion options.
5362 (add_exclude, add_exclude_file): Now takes int options arg.
5363 Check for arithmetic overflow when computing sizes.
5364 (add_exclude_file): xrealloc might modify errno, so don't
5365 realloc until after errno might be used.
5367 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
5369 (free_exclude): New decl.
5370 (add_exclude, add_exclude_file): Now takes int options arg.
5371 (excluded_filename): No longer requires options arg, as the options
5372 are determined by add_exclude. Now returns bool, not int.
5374 2001-08-30 Paul Eggert <eggert@twinsun.com>
5376 * alloca.c (alloca): Arg is of type size_t, not unsigned.
5378 2001-08-27 Jim Meyering <meyering@lucent.com>
5380 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
5382 * version-etc.c (N_): Remove definition.
5383 Revert most of last change.
5384 Instead, simply don't mark the `Copyright...' string for translation.
5385 Based on advice from Paul Eggert.
5387 * strtoxmax.c: Tweak comment.
5389 2001-08-26 Jim Meyering <meyering@lucent.com>
5391 * version-etc.c (version_etc_copyright_fmt): Replace literal year
5392 of copyright with `%s' so translators don't get an untranslated
5394 (COPYRIGHT_YEAR): Define.
5395 (version_etc): Use fprintf rather than fputs.
5396 Suggestion from Ulrich Drepper.
5398 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5400 * strtoll.c: New file, from GNU libc.
5401 * xstrtoimax.c: New file.
5403 * xstrtol.h: Add xstrtoimax.
5404 * strtoumax.c: New file. Simply include "strtoumax.c".
5405 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
5407 * strtoumax.c: Factor to work both for unsigned and signed types, ...
5408 * strtoxmax.c: ... then renamed to this.
5410 2001-08-13 Paul Eggert <eggert@twinsun.com>
5412 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
5413 Port to Solaris 8, where 'sed' requires a space after the 'r'
5414 command, and where sh dislikes "$/". Clean up the spacing a bit.
5415 Redirect output to $tmp just once.
5417 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
5419 * addext.c (<errno.h>): Include.
5420 (errno): Declare if not defined.
5421 (addext): Work correctly when pathconf returns -1 and leaves
5422 errno alone because there is no limit. Also, work even if
5423 pathconf returns a value greater than SIZE_MAX.
5425 2001-08-12 Jim Meyering <meyering@lucent.com>
5427 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
5428 Simply `return getcwd (NULL, 0);'.
5429 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
5430 Use 1300 as initial value for length, not PATH_MAX.
5432 * pathmax.h: Clean up cpp syntax.
5434 2001-08-12 Jim Meyering <meyering@lucent.com>
5436 * gettimeofday.c: New file.
5438 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
5440 2001-08-04 Jim Meyering <meyering@lucent.com>
5442 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
5443 to get in sync with glibc.
5445 2001-08-03 Paul Eggert <eggert@twinsun.com>
5447 The following changes are from gettext 0.10.39 as maintained by
5450 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
5451 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
5452 with inverted sense. All uses changed.
5454 * mbswidth.c: Don't include <limits.h>.
5455 Include <stdlib.h> and <string.h> unconditionally.
5456 (iswcntrl, mbsinit, ISCNTRL): New macros.
5457 (mbsnwidth): Use K&R style function declarations.
5458 Don't bother checking for MB_LEN_MAX == 1, since the compiler
5459 can optimize it when MB_CUR_MAX == 1.
5460 The width of control characters is zero, not 1.
5462 2001-07-15 Jim Meyering <meyering@lucent.com>
5464 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
5465 (BUILT_SOURCES): Add unlocked-io.h.
5466 (io_functions): Define.
5467 (unlocked-io.h): New rule.
5468 (DISTCLEANFILES): Add unlocked-io.h.
5469 (all-local): Depend on unlocked-io.h, to ensure it is created.
5471 * unlocked-io.hin: New file
5473 * regex.c: Update from glibc.
5475 2001-07-05 Jim Meyering <meyering@lucent.com>
5477 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
5479 (libfetish_a_SOURCES): Put all .h files here instead.
5480 Remove a thus-exposed (better checks in automake) duplicate and
5481 two unnecessary .h files.
5483 2001-06-11 Jim Meyering <meyering@lucent.com>
5485 * regex.c: Update from GNU libc.
5487 2001-05-27 Jim Meyering <meyering@lucent.com>
5489 * readutmp.h (UT_TYPE): Define.
5491 2001-05-24 Jim Meyering <meyering@lucent.com>
5493 * argmatch.c: Include "quote.h".
5494 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
5495 quote function. Reported by Göran Uddeborg.
5497 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
5499 * dirname.c (dir_name): Compute append_dot using path, not newpath
5500 which is not yet declared.
5502 2001-05-11 Paul Eggert <eggert@twinsun.com>
5504 * Makefile.am (libfetish_a_SOURCES):
5505 Add strftime.c, since we now compile it on all hosts.
5507 * strftime.c (my_strftime):
5508 Define to nstrftime if emacs, but only if my_strftime is not defined.
5509 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
5510 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
5511 Add one more extra argument: a nanoseconds value.
5514 (my_strftime function): Add %N format.
5515 (emacs_strftimeu): Renamed from emacs_strftime,
5516 with extra ut argument.
5518 2001-05-11 Paul Eggert <eggert@twinsun.com>
5520 dirname code cleanup. base_name now behaves more compatibly
5521 with POSIX basename when given file names that have trailing
5522 slashes, and similarly for dir_name. Add new primitives
5523 base_len and dir_len. Put the directory-name-related decls
5526 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
5527 * backupfile.c (base_name): Likewise.
5528 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
5529 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
5530 * makepath.c (strip_trailing_slashes): Likewise.
5531 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
5533 * rename.c (strip_trailing_slashes): Likewise.
5534 * same.c (base_name): Likewise.
5535 * stripslash.c (ISSLASH): Likewise.
5537 * addext.c: Include <dirname.h> after size_t is defined.
5538 * backupfile.c: Likewise.
5540 * addext.c (addext): Use base_len to trim redundant
5541 trailing slashes instead of doing it ourselves.
5542 But do not trim the last slash if it is not redundant.
5544 * backupfile.c (find_backup_file_name,
5545 max_backup_version): Use base_len instead of rolling it ourselves.
5546 Handle the case of "" and (on DOS) "C:" correctly.
5548 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
5549 Include <string.h>, <dirname.h>.
5550 (base_name): Allow file names ending in slashes, other than names
5551 that are all slashes. In this case, return the basename followed
5552 by the slashes. This is more general, and can be used in places
5553 where the original base_name purposely had an assertion failure.
5554 (base_len): New function.
5556 * dirname.c: Include <string.h> instead of <stdlib.h>.
5557 Do not include <assert.h>; no longer needed.
5559 (memrchr): Remove decl.
5560 (dir_name_r): Remove.
5561 (dir_len): Renamed from dirlen. All callers changed.
5562 Rewrite in terms of base_name, for simplicity and consistency.
5563 (dir_name): Never return NULL. All callers changed.
5564 Do not include <stdlib.h> in test program; no longer needed.
5565 return 0; is fine for test program.
5567 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
5569 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
5571 * path-concat.c (path_concat): Use base_len to compute
5572 base length, not strlen; this means we cannot rely on memcpy
5575 * same.c (STREQ): Remove.
5576 (same_name): Handle the case where the basename ends in trailing '/'.
5578 * stripslash.c (strip_trailing_slashes): Return nonzero if
5579 a slash was stripped. Do not strip the last slash after a
5582 2001-04-08 Jim Meyering <meyering@lucent.com>
5584 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
5585 recomputed; that's necessary when the offset spans a DST transition.
5586 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
5588 2001-04-02 Jim Meyering <meyering@lucent.com>
5590 * regex.h, regex.c: Update from GNU libc.
5592 2001-03-19 Paul Eggert <eggert@twinsun.com>
5594 * version-etc.c (version_etc_copyright): Update to 2001.
5596 2001-03-16 Paul Eggert <eggert@twinsun.com>
5598 * tempname.c (uint64_t): Define to uintmax_t if
5599 not defined, and if UINT64_MAX is not defined.
5600 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5601 Reported by John David Anglin.
5603 2001-03-10 Bruno Haible <haible@clisp.cons.org>
5605 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5606 alias if codeset is empty.
5607 * config.charset (BeOS): Use wildcard syntax.
5609 2001-03-13 Jim Meyering <meyering@lucent.com>
5611 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5612 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5615 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5617 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5619 * unicodeio.c (print_unicode_char): Simplify accordingly.
5621 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5623 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5624 support for DOS/DJGPP.
5626 2001-02-28 Paul Eggert <eggert@twinsun.com>
5628 * Makefile.am (libfetish_a_SOURCES):
5629 Add dup-safer.c, fopen-safer.c.
5630 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5632 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5634 2001-02-25 Paul Eggert <eggert@twinsun.com>
5636 The mkstemp replacement is taken from glibc 2.2.2, with some
5637 portability fixes for use outside glibc, as follows:
5639 * tempname.c (struct_stat64): New macro.
5640 (direxists, __gen_tempname): Use it.
5641 This avoids a portability problem with Solaris 8.
5643 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5644 (<stddef.h>, <stdint.h>, <string.h>):
5645 Include only if STDC_HEADERS || _LIBC.
5646 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5647 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5648 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5649 (__set_errno): Define this macro if <errno.h> doesn't.
5650 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
5651 Define these macros if <stdio.h> doesn't.
5652 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
5653 Define these macros if <sys/stat.h>
5654 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
5655 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
5656 __xstat64): Define if not _LIBC.
5657 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
5658 (__gen_tempname): Invoke gettimeofday only if
5659 HAVE_GETTIMEOFDAY || _LIBC;
5660 otherwise, fall back on plain "time".
5661 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
5663 * mkstemp.c (__GT_FILE): Define to zero if not defined.
5665 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
5667 2001-02-17 Jim Meyering <meyering@lucent.com>
5669 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
5670 around included file name.
5672 * strnlen.c (__strnlen): Merge in a change from GNU libc.
5674 * strftime.c: Update from GNU libc (the only changes were to comments).
5676 2001-02-13 Bruno Haible <haible@clisp.cons.org>
5678 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
5680 2001-02-17 Paul Eggert <eggert@twinsun.com>
5682 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
5683 Remove workaround macros for hosts that have mbrtowc but not
5684 mbstate_t, as we now insist on proper declarations for both
5685 before using mbrtowc.
5687 2001-02-17 Jim Meyering <meyering@lucent.com>
5689 * regex.c: Update from libc.
5691 2001-02-16 Paul Eggert <eggert@twinsun.com>
5693 * alloca.c (malloc): Undef before defining, since stdlib.h
5694 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
5695 Reported by Mark Hounschell via Paul Eggert.
5697 2001-01-30 Bruno Haible <haible@clisp.cons.org>
5699 * config.charset: Update for FreeBSD 4.2.
5701 2001-01-26 Jim Meyering <meyering@lucent.com>
5703 * quotearg.c: Include stddef.h.
5704 * quote.c: Include stddef.h.
5705 Reported by Axel Kittenberger.
5707 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
5708 line in double quotes so that it evokes a better diagnostic.
5709 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
5710 Reported by Axel Kittenberger.
5712 2001-01-15 Bruno Haible <haible@clisp.cons.org>
5714 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
5715 to avoid a warning. Add back 'const' to inptr.
5717 2001-01-16 Jim Meyering <meyering@lucent.com>
5719 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
5722 2001-01-14 Jim Meyering <meyering@lucent.com>
5724 * rename.c: New file. From Volker Borchert.
5725 Include stdlib.h, string.h or strings.h, and xalloc.h.
5726 Use strip_trailing_slashes rather than open-coding it.
5728 2001-01-03 Paul Eggert <eggert@twinsun.com>
5730 * strftime.c: Sync with glibc time/strftime.c 1.81.
5732 2001-01-03 Jim Meyering <meyering@lucent.com>
5734 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
5735 local `inptr' to avoid warning with some system declarations of iconv.
5737 2000-12-29 Paul Eggert <eggert@twinsun.com>
5739 * modechange.c: Do not assume that mode_t uses the
5740 traditional octal encoding. E.g. "chmod 1 FOO" should set
5741 the other-execute bit of FOO even if S_IXOTH != 1.
5743 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
5744 WOTH, XOTH, ALLM): New macros.
5745 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
5746 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
5748 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
5749 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
5751 No need to use uintmax_t; unsigned long is long enough.
5752 Don't bother to get suffix since we don't use it.
5754 2000-12-24 Jim Meyering <meyering@lucent.com>
5756 * hash.c (is_prime): Return explicit boolean values.
5757 (hash_get_first): Return NULL to appease Irix5.6's 89.
5758 Reported by Nelson Beebe.
5760 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5762 * localcharset.c (locale_charset): Add support for Win32.
5764 2000-12-18 Paul Eggert <eggert@twinsun.com>
5766 * physmem.h, physmem.c: New files.
5768 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
5769 (noinst_HEADERS): Add physmem.h.
5771 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
5772 't' for compatibility with Solaris 8 sort.
5774 2000-12-18 Bruno Haible <haible@clisp.cons.org>
5776 * config.charset: Add support for BeOS.
5778 2000-12-16 Jim Meyering <meyering@lucent.com>
5780 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
5781 SHELLS_FILE to a file name that's useful on djgpp systems.
5783 (ADDITIONAL_DEFAULT_SHELLS): Define.
5784 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
5785 Based mostly on a patch from Prashant TR.
5787 2000-12-16 Jim Meyering <meyering@lucent.com>
5789 This bug had a serious impact on chown: `chown N:M FILE' (for integer
5790 N and M) would have treated it like `chown N:N FILE'.
5792 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
5794 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5796 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
5797 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
5798 to the list of canonical encodings. Rename EUC-CN to GB2312.
5800 2000-12-08 Andreas Schwab <schwab@suse.de>
5802 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
5803 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
5805 2000-12-07 Jim Meyering <meyering@lucent.com>
5807 * stripslash.c (ISSLASH): Define.
5808 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
5811 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
5812 (dir_name_r): Declare this function as static.
5813 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
5814 manifest itself on a name containing a mix of slashes and
5816 Make this function work with names starting with a DOS-style
5817 drive letter and colon prefix.
5818 (dir_name): Append `.' if necessary.
5819 Based mostly on patches from Prashant TR and Eli Zaretskii.
5821 * dirname.h (dir_name_r): Remove prototype.
5823 2000-12-05 Jim Meyering <meyering@lucent.com>
5825 * dirname.c (dir_name_r): Add `const' in a few local declarations.
5827 2000-12-04 Jim Meyering <meyering@lucent.com>
5829 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
5830 Also include memory.h, stdlib.h, unistd.h if appropriate.
5831 Reported by Andreas Jaeger (conflicting declaration of malloc).
5833 2000-12-02 Jim Meyering <meyering@lucent.com>
5835 * closeout.h: Make idempotent, to avoid some obscure warnings.
5837 2000-12-01 Paul Eggert <eggert@twinsun.com>
5839 * memrchr.c: Include <config.h> before any system include file.
5841 2000-11-29 Paul Eggert <eggert@twinsun.com>
5843 * dirname.c (dir_name_r): Fix typo: int -> size_t.
5845 2000-11-26 Jim Meyering <meyering@lucent.com>
5847 * memcoll.c: Include sys/types.h. From Werner Almesberger.
5849 2000-11-22 Paul Eggert <eggert@twinsun.com>
5851 * strftime.c (my_strftime): Do not invoke mbrlen with a
5852 size of (size_t) -1; it's not portable.
5854 2000-11-17 Akim Demaille <akim@epita.fr>
5856 * obstack.h: Formatting changes.
5857 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
5858 prevent type checking.
5859 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
5860 cast the value to (void *): assigning a `foo *' to a `void *'
5862 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
5864 2000-11-17 Jim Meyering <meyering@lucent.com>
5866 * strstr.c: Update from GNU libc.
5868 2000-11-16 Jim Meyering <meyering@lucent.com>
5870 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
5872 2000-11-11 Jim Meyering <meyering@lucent.com>
5874 * error.c: Add a couple #includes, merging from GNU libc version.
5876 2000-11-10 Jim Meyering <meyering@lucent.com>
5878 * obstack.h: Update from GNU libc.
5879 * obstack.c: Likewise.
5881 2000-11-06 Paul Eggert <eggert@twinsun.com>
5883 * getusershell.c (setusershell): Use rewind rather than
5884 fseek/fseeko, to avoid configuration hassles with fseeko.
5885 Don't bother opening SHELLS_FILE if shellstream is NULL;
5888 2000-11-05 Jim Meyering <meyering@lucent.com>
5890 * makepath.h (make_dir): Declare.
5891 * makepath.c (make_dir): Remove `static' attribute.
5894 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
5896 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
5897 last one in a bucket, advance to the next bucket.
5899 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
5901 * fnmatch.c: Do not comment out all the code if we are using
5902 the GNU C library, because in some cases we are replacing buggy
5903 code in the GNU C library itself.
5905 2000-10-30 Paul Eggert <eggert@twinsun.com>
5907 * error.h, getline.h, modechange.h:
5908 Remove "2000" from Copyright line, as the file hasn't been
5909 changed this year other than in the copyright notice.
5911 * xalloc.h: Add "2000" to Copyright line, as this file
5912 was changed this year.
5914 2000-10-30 Paul Eggert <eggert@twinsun.com>
5916 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
5917 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
5918 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
5920 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
5922 * regex.h (__restrict_arr): Move definition out of #ifndef block.
5923 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
5924 doesn't define __restrict_arr.
5926 2000-10-29 Jim Meyering <meyering@lucent.com>
5928 * xstat.in: Fix grammar in comment.
5930 2000-10-28 Jim Meyering <meyering@lucent.com>
5932 * memchr.c: Update from libc.
5933 Adjust for portability:
5934 [HAVE_STDLIB_H]: Include stdlib.h.
5935 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
5936 Undef __memchr, too.
5937 [!weak_alias]: Define __memchr to memchr.
5939 * regex.c: Update from libc.
5940 * regex.h: Likewise.
5941 * getopt1.c: Likewise.
5942 * memcmp.c: Likewise.
5944 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
5945 Avoid using fseek, when possible -- it's broken by design.
5946 Patch by Ulrich Drepper.
5948 2000-10-26 Jim Meyering <meyering@lucent.com>
5950 * strftime.c: Update from libc.
5952 2000-10-25 Jim Meyering <meyering@lucent.com>
5954 * obstack.c: Update from libc.
5956 2000-10-23 Jim Meyering <meyering@lucent.com>
5958 * hard-locale.c (hard_locale): Revert last change -- it was simply
5959 wrong. That set_locale call must not have any side effects.
5962 2000-10-22 Jim Meyering <meyering@lucent.com>
5964 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
5965 [CYCLIC]: Remove now-unused definition.
5967 * save-cwd.c (O_DIRECTORY): Define, if needed.
5968 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
5969 Suggestion from Ulrich Drepper.
5971 2000-10-21 Jim Meyering <meyering@lucent.com>
5973 * dirname.c (dir_name_r): New function, factored out of dir_name.
5974 (dir_name): Use dir_name_r.
5975 * dirname.h (dir_name_r): Declare it.
5977 2000-10-21 Jim Meyering <meyering@lucent.com>
5979 * dirname.c (memrchr): Declare if necessary.
5980 (dir_name): Remove the restriction that there be no
5981 trailing slashes. Now, this code skips past them, effectively
5983 [TEST_DIRNAME] (main): New unit tests.
5985 * memrchr.c: New file from GNU libc.
5986 Undef __memrchr, too.
5987 [!weak_alias]: Define __memrchr to memrchr.
5988 Guard weak_alias use with `#ifdef weak_alias'.
5990 2000-10-17 Jim Meyering <meyering@lucent.com>
5992 * quote.h (PARAMS): Define and use.
5993 Reported by Akim Demaille.
5995 * getopt.c: Update from libc.
5997 2000-10-16 Jim Meyering <meyering@lucent.com>
5999 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
6002 2000-09-25 Jim Meyering <meyering@lucent.com>
6004 * md5.h (rol): Define (from GnuPG).
6006 * sha.c: Give credit (GnuPG) where due.
6007 (M): Use rol rather than open-coding it.
6008 Add a FIXME comment.
6010 2000-09-21 Jim Meyering <meyering@lucent.com>
6012 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
6013 Reported by Michael Stone.
6015 2000-09-20 Jim Meyering <meyering@lucent.com>
6017 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
6018 (noinst_HEADERS): Add sha.h.
6019 Based on code from Scott G. Miller and from GnuPG.
6021 2000-09-15 Jim Meyering <meyering@lucent.com>
6023 * regex.c: Update from libc.
6025 2000-09-10 Jim Meyering <meyering@lucent.com>
6027 * getopt.c (_getopt_internal): Update from glibc.
6029 2000-09-09 Jim Meyering <meyering@lucent.com>
6031 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
6032 think it should be used as a general replacement for isascii.
6033 * fnmatch.c: Likewise.
6034 * mbswidth.c: Likewise
6035 * regex.c: Likewise.
6038 * userspec.c: Include sys/param.h and limits.h.
6040 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6041 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
6042 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
6043 UID, GID. Check range.
6045 2000-09-06 Jim Meyering <meyering@lucent.com>
6047 * getopt.c (_getopt_internal): Update from glibc.
6049 2000-08-30 Jim Meyering <meyering@lucent.com>
6051 * strftime.c: Merge in changes from GNU libc.
6053 2000-08-26 Jim Meyering <meyering@lucent.com>
6055 * closeout.c: Include "__fpending.h".
6056 (close_stdout_status): Return right away if there's nothing to flush.
6058 * Makefile.am (noinst_HEADERS): Add __fpending.h.
6059 * __fpending.c: New file.
6060 * __fpending.h: New file.
6062 2000-08-07 Paul Eggert <eggert@twinsun.com>
6064 Standardize on "memory exhausted" instead of "Memory exhausted"
6065 or "virtual memory exhausted".
6066 * obstack.c (print_and_abort): Use "memory exhausted", not
6067 "virtual memory exhausted".
6068 * same.c (same_name): Invoke xalloc_die instead of printing
6070 * userspec.c (parse_user_spec): Likewise.
6071 * bumpalloc.h: comment fix
6072 * same.c, userspec.c: Include xalloc.h.
6074 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
6075 not char *const and pointing to a constant array.
6076 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
6077 (xrealloc): Comment fix.
6079 * userspec.c (parse_user_spec):
6080 Don't translate a message until just before returning,
6081 to avoid unnecessary translation.
6083 2000-08-07 Jim Meyering <meyering@lucent.com>
6085 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
6086 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
6087 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
6088 getgroups.c, gethostname.c, getopt.h, group-member.c,
6089 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
6090 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
6091 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
6092 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
6093 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
6094 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
6095 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
6096 yesno.c: Back out Copyright date changes for each file with no change
6097 this year. This eases coordination with other programs using the same
6098 source code modules. From Paul Eggert.
6100 2000-08-03 Greg McGary <greg@mcgary.org>
6102 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
6103 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
6104 (EXTEND_BUFFER): Use them.
6106 2000-08-01 Jim Meyering <meyering@lucent.com>
6108 * dirname.c (ISSLASH): Define.
6109 (BACKSLASH_IS_PATH_SEPARATOR): Define.
6110 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
6111 both `\' and `/' may be use as path separators.
6112 Based on a patch from Prashant TR.
6114 2000-07-31 Paul Eggert <eggert@twinsun.com>
6116 * quotearg.c (quotearg_n_options): Don't make the initial
6117 slot vector a constant, since it might get modified.
6119 2000-07-31 Jim Meyering <meyering@lucent.com>
6121 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
6122 * obstack.c (print_and_abort): Likewise.
6124 2000-07-30 Paul Eggert <eggert@twinsun.com>
6126 * quotearg.c (quotearg_n_options): Preallocate a slot 0
6127 buffer, so that the caller can always quote one small
6128 component of a "memory exhausted" message in slot 0.
6129 From a suggestion by Jim Meyering.
6131 2000-07-30 Jim Meyering <meyering@lucent.com>
6133 * makepath.c (make_path): Quote the other instance, too.
6135 * quotearg.c (N_STATIC_SLOTVECS): Define.
6136 (STATIC_BUF_SIZE): Define.
6137 (quotearg_n_options): Use only statically allocated storage when
6138 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
6139 than STATIC_BUF_SIZE.
6141 2000-07-29 Jim Meyering <meyering@lucent.com>
6143 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
6144 * dirname.c (dir_name): Likewise.
6146 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
6148 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
6149 (dir_name): Assert that there are no trailing slashes.
6151 2000-07-18 Bruno Haible <haible@clisp.cons.org>
6153 * mbswidth.h (mbswidth): Add a flags argument.
6154 (mbswidth): New declaration.
6155 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
6156 * mbswidth.c (mbswidth): Add a flags argument.
6157 (mbsnwidth): New function.
6159 2000-07-24 Jim Meyering <meyering@lucent.com>
6161 * mbswidth.c: Remove useless #else. From Bruno Haible.
6163 2000-07-23 Paul Eggert <eggert@twinsun.com>
6165 * mbswidth.c (_XOPEN_SOURCE):
6166 Don't define; this causes problems on Solaris 7.
6167 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
6169 2000-07-23 Paul Eggert <eggert@twinsun.com>
6172 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
6173 so that mbstate_t is always defined.
6175 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
6176 be 1 in at least one GCC installation, and this configuration
6177 error is likely to be common. Ignoring MB_LEN_MAX hurts
6178 performance on hosts that have mbrtowc but have only unibyte
6179 locales, but I assume these hosts are rare.
6181 2000-07-23 Paul Eggert <eggert@twinsun.com>
6183 * quotearg.c: Streamline by invoking multibyte code only if needed.
6184 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
6185 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
6186 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
6187 invoke multibyte primitives.
6189 2000-07-23 Jim Meyering <meyering@lucent.com>
6191 * basename.c (base_name): Add an assertion.
6193 2000-07-15 Bruno Haible <clisp.cons.org>
6195 * quotearg.c: When the system forces us to redefine mbstate_t,
6196 shadow its mbsinit function.
6198 2000-07-16 Bruno Haible <haible@clisp.cons.org>
6200 * mbswidth.h: New file.
6201 * mbswidth.c: New file.
6202 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
6203 (noinst_HEADERS): Add mbswidth.h.
6205 2000-07-17 Bruno Haible <haible@clisp.cons.org>
6207 * config.charset: Add support for FreeBSD. Improve support for HP-UX
6210 2000-07-15 Jim Meyering <meyering@lucent.com>
6212 * makepath.c: Include quote.h.
6213 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
6214 corresponding argument in a `quote (...)' call.
6215 Give better diagnostics.
6217 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
6218 (noinst_HEADERS): Add quote.h.
6220 * quote.c (quote, quote_n): New file. Two functions taken verbatim
6221 from tar's src/misc.c.
6222 * quote.h: New file. Prototypes for same.
6224 2000-07-10 Paul Eggert <eggert@twinsun.com>
6226 From a suggestion by Bruno Haible.
6227 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
6228 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
6229 to decide whether to define the BeOS workaround macro;
6230 this adjusts to the change to AC_MBSTATE_T.
6232 2000-07-13 Paul Eggert <eggert@twinsun.com>
6234 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
6236 * quotearg.c (quoting_style_args, quoting_style_vals,
6237 quotearg_buffer_restyled): Add support for
6238 clocale_quoting_style. Undo previous change to
6239 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
6240 and "{RIGHT QUOTATION MARK}" msgids.
6242 2000-07-05 Paul Eggert <eggert@twinsun.com>
6244 The old behavior of quoting `like this' doesn't look good with
6245 newer, ISO-style fonts. See:
6246 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
6248 Instead, quote "like this" by default. Let the translator
6249 tailor the locale-specific quoting behavior by providing
6250 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
6252 * quotearg.c (N_): New macro.
6253 (gettext_default): New function.
6254 (quotearg_buffer_restyled): Use
6255 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
6256 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
6258 2000-07-09 Jim Meyering <meyering@lucent.com>
6260 * Most files: Update copyright dates to include 2000.
6262 2000-07-08 Jim Meyering <meyering@lucent.com>
6264 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
6266 (xgethostname): Remove now-unnecessary #ifdef.
6267 Move declaration of `err' into loop where it's used.
6269 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6271 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
6272 by allocating a larger buffer. Test the gethostname return value for
6273 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
6274 returns an error and ENAMETOOLONG isn't defined.
6276 2000-07-05 Paul Eggert <eggert@twinsun.com>
6277 and Bruno Haible <haible@clisp.cons.org>
6279 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
6281 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6283 * quotearg.c (struct quoting_options): Simplify quote_these_too
6286 2000-07-03 Jim Meyering <meyering@lucent.com>
6288 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
6289 Reported by Bruno Haible.
6291 2000-07-04 Jim Meyering <meyering@lucent.com>
6293 * quotearg.c: Make inclusion of <wchar.h> independent of whether
6294 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
6297 2000-07-03 Paul Eggert <eggert@twinsun.com>
6298 and Bruno Haible <haible@clisp.cons.org>
6300 * quotearg.c (mbrtowc):
6301 Assign to *pwc, and return 1 only if result is nonzero.
6302 (iswprint): Use ISPRINT when substituting our own mbrtowc.
6304 2000-07-03 Jim Meyering <meyering@lucent.com>
6306 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
6307 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
6310 2000-07-02 Jim Meyering <meyering@lucent.com>
6312 * quotearg.c (mbstate_t): Don't define here.
6314 2000-07-02 Jim Meyering <meyering@lucent.com>
6316 * nanosleep.c (SIGCONT): Define if not already defined.
6318 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6320 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
6321 per change in ../m4/ls-mntd-fs.m4.
6322 (read_filesystem_list): Ignore symbolic links.
6324 2000-06-29 Jim Meyering <meyering@lucent.com>
6326 * same.c: Include <string.h> or <strings.h>, as appropriate,
6327 for declaration of strcmp.
6329 * long-options.c: Include <stdlib.h>, for declaration of exit.
6331 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
6332 Avoid warning by casting result to `char *' to remove `const'.
6334 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6336 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
6338 2000-06-26 Paul Eggert <eggert@twinsun.com>
6340 savedir now sets errno on failure and invokes xmalloc to get memory.
6341 Fix a couple of other minor bugs while we're at it.
6343 * savedir.c (<unistd.h>): Do not include; there's no need.
6344 (NAMLEN): Remove macro.
6345 (malloc, realloc): Remove decls.
6347 ("xalloc.h"): Include.
6348 (NAME_SIZE_DEFAULT): New macro.
6349 (savedir): Use xmalloc / xrealloc to allocate memory.
6350 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
6351 Skip "" directory entries.
6352 Use strlen to calculate directory entry length, since the old method
6353 is rarely used these days and isn't worth supporting.
6354 Don't use a pointer after freeing it.
6355 Check for integer overflow when calculating allocation size.
6356 Use memcpy to copy entries, instead of stpcpy.
6357 Set errno properly when returning NULL.
6358 Check for readdir error.
6360 2000-06-26 Jim Meyering <meyering@lucent.com>
6362 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
6364 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6366 * getusershell.c (xmalloc, xrealloc): Remove functions.
6368 Don't include <stdlib.h>. Don't declare malloc, realloc.
6370 2000-06-23 Bruno Haible <haible@clisp.cons.org>
6372 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
6374 2000-06-24 Jim Meyering <meyering@lucent.com>
6376 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
6378 2000-06-21 Jim Meyering <meyering@lucent.com>
6380 * getpass.c: New file, from Bruno Haible. Required for BeOS.
6382 2000-06-19 Paul Eggert <eggert@twinsun.com>
6384 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
6385 (mbrtowc, mbstate_t): Define substitutes if
6386 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
6387 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
6388 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
6390 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6392 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
6393 than 1024, return a memory chunk of least possible size, instead
6394 of size PATH_MAX + 2. In the loop, increment the size proportionally.
6395 Use free/xmalloc instead of xrealloc to avoid copying for very long
6398 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6400 * canon-host.c (canon_host): Use malloc and memcpy to copy an
6401 address, not strdup. Include <stdlib.h> and don't declare free().
6403 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6405 * path-concat.c (path_concat): Don't access dir[-1] if dir is
6408 2000-06-21 Jim Meyering <meyering@lucent.com>
6410 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
6411 (noinst_HEADERS): Add getstr.h.
6413 * getline.c (getstr): Move into a separate file.
6414 * getstr.c (getstr): New file, extracted from getline.c, with
6415 the following changes: new parameter, delim2; both delim[12]
6416 parameters have type `int', not `char'. The latter would lose
6417 with 8-bit delimiters.
6418 * getstr.h: New file.
6420 2000-06-19 Jim Meyering <meyering@lucent.com>
6422 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
6424 2000-06-18 Jim Meyering <meyering@lucent.com>
6426 * mkdir.c: Remove file, due mainly to copyright incompatibility.
6427 Besides, these days every porting target provides a mkdir function.
6429 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
6430 (this snippet comes from src/system.h).
6432 2000-06-15 Paul Eggert <eggert@twinsun.com>
6434 * human.c (adjust_value): New function.
6435 (human_readable_inexact): Apply rounding style even when
6436 printing approximate values.
6438 2000-06-14 Paul Eggert <eggert@twinsun.com>
6440 * human.c (human_readable_inexact): Allow an input block
6441 size that is not a multiple of the output block size, and vice versa.
6442 Reported by Piergiorgio Sartor.
6444 2000-06-14 Paul Eggert <eggert@twinsun.com>
6446 * getdate.y (get_date): Apply relative times after time
6447 zone indicator, not before. Reported by Todd A. Jacobs.
6449 2000-06-13 Jim Meyering <meyering@lucent.com>
6451 * Makefile.am (all-local): Depend on lstat.c and stat.c.
6453 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
6455 2000-06-12 Paul Eggert <eggert@twinsun.com>
6457 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
6459 2000-06-04 Paul Eggert <eggert@twinsun.com>
6461 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
6463 2000-06-04 Jim Meyering <meyering@lucent.com>
6465 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
6466 SunOS 4.1.4 for which gid_t is an unsigned type.
6468 2000-06-03 Jim Meyering <meyering@lucent.com>
6470 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
6472 2000-05-26 Bruno Haible <haible@clisp.cons.org>
6474 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
6475 newer, don't install charset.alias.
6476 * config.charset: Change the Linux/glibc rules so they become empty
6477 on glibc-2.1 or newer.
6479 2000-06-02 Jim Meyering <meyering@lucent.com>
6481 * mountlist.c: Back out last change. Instead, do this...
6482 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
6483 member using the same `ignore'-testing code.
6484 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
6488 2000-05-29 Jim Meyering <meyering@lucent.com>
6490 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
6491 with the `ignore' attribute. Based on a patch from Mark D. Roth.
6493 2000-05-22 Jim Meyering <meyering@lucent.com>
6495 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
6497 2000-05-18 Jim Meyering <meyering@lucent.com>
6499 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
6500 back, too, since it may have been modified by allocate_entry.
6501 (hash_delete): Rewrite to use neither the assignment operator
6502 nor the comma operator in an if-expression.
6504 2000-05-15 Paul Eggert <eggert@twinsun.com>
6507 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
6508 Remove; no longer needed.
6509 "quotearg.h": Add include.
6510 (file_name): Do not bother to explicitly initialize to NULL; it's less
6511 efficient on some hosts.
6512 (close_stdout_status): Remove test as to whether stdout was already
6513 closed; it breaks for the case "echo x | sort >&-".
6514 Quote file name colons.
6515 Do not assume that _("write error") lacks format strings.
6517 2000-05-15 Jim Meyering <meyering@lucent.com>
6519 * version-etc.c (version_etc_copyright): Update the copyright string
6520 used in all --version output.
6522 2000-05-14 Jim Meyering <meyering@lucent.com>
6524 * closeout.c (close_stdout_set_file_name): New function.
6525 (close_stdout_status): Use new file-scoped global.
6526 Return right away if fstat says the stdout file descriptor is invalid.
6527 * closeout.h (close_stdout_set_file_name): Declare.
6529 2000-05-10 Jim Meyering <meyering@lucent.com>
6531 * closeout.c [default_exit_status]: New file-scoped variable.
6532 (close_stdout_set_status): New function.
6533 * closeout.h (close_stdout_set_status): Declare.
6535 2000-05-08 Jim Meyering <meyering@lucent.com>
6537 * long-options.c: Don't include closeout.h.
6538 (parse_long_options): Don't call close_stdout for --version.
6540 2000-05-06 Jim Meyering <meyering@lucent.com>
6542 * strnlen.c: Undefine __strnlen and strnlen.
6543 [!weak_alias]: Define __strnlen to strnlen.
6545 * atexit.c: New file, from libiberty.
6547 2000-05-06 Jim Meyering <meyering@lucent.com>
6549 * closeout.c (close_stdout_status): Also check for errors on the
6552 2000-05-05 Bruno Haible <haible@clisp.cons.org>
6554 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
6555 instead of xmalloc, xrealloc, path_concat.
6556 (locale_charset): Treat empty environment variables as absent.
6557 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
6559 2000-05-04 Jim Meyering <meyering@lucent.com>
6561 * getopt.c: Update from glibc.
6562 * obstack.c: Likewise.
6563 * obstack.h: Likewise.
6564 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
6566 * regex.h: Likewise.
6567 * strndup.c: Likewise.
6568 * strnlen.c: New file, from glibc.
6570 2000-05-01 Jim Meyering <meyering@lucent.com>
6572 * full-write.c (full_write): Remove `FIXME' part of comment.
6574 2000-04-29 Jim Meyering <meyering@lucent.com>
6576 * path-concat.c: Declare strdup only if it's not defined.
6577 * canon-host.c: Likewise.
6579 2000-04-28 Jim Meyering <meyering@lucent.com>
6581 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
6582 redefinition warning on some systems (HPUX). Otherwise, regex.h is
6583 included first, then limits.h is included by locale.h by libintl.h.
6584 From John David Anglin.
6586 2000-04-25 Jim Meyering <meyering@lucent.com>
6588 * makepath.c (S_IRWXUGO): Define.
6589 (make_path): Always perform explicit chmod if MODE specifies any
6590 of the `special' permission bits. Prompted by a bug report against
6591 install from Mate Wierdl and Joost van Baal.
6593 2000-04-18 Jim Meyering <meyering@lucent.com>
6597 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
6598 getpagesize. For BeOS. Based on a patch from Bruno Haible.
6600 2000-04-17 Jim Meyering <meyering@lucent.com>
6602 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6603 the definition of it to rpl_strftime also defined-away the system's
6606 2000-04-15 Jim Meyering <meyering@lucent.com>
6608 Use `C' to denote so-called `contiguous' files, the same way
6610 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6611 (ftypelet): Use S_ISCTG.
6612 From Michael Deutschmann.
6614 2000-04-14 Jim Meyering <meyering@lucent.com>
6616 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6618 2000-04-08 Jim Meyering <meyering@lucent.com>
6620 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6621 names don't conflict. Reported by Eli Zaretskii.
6623 2000-03-28 Bruno Haible <haible@clisp.cons.org>
6625 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6626 bug. Deal with the different error behavior of Irix iconv.
6628 2000-04-07 Jim Meyering <meyering@lucent.com>
6630 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6631 to work around system header problems on AIX 3.2.5. From Bruno Haible.
6633 2000-04-05 Jim Meyering <meyering@lucent.com>
6635 Portability tweaks required for ultrix4.3.
6636 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6637 * readutmp.c: Include sys/types.h before sys/stat.h.
6638 * canon-host.c: Declare strdup.
6639 * path-concat.c: Likewise.
6640 From John David Anglin.
6642 2000-04-04 Jim Meyering <meyering@lucent.com>
6644 Be more DOS 8.3-friendly.
6645 * ref-add.sin: Renamed from ref-add.sed.in.
6646 * ref-del.sin: Renamed from ref-del.sed.in.
6647 * Makefile.am: Reflect renaming.
6648 Reported by Eli Zaretskii.
6650 Use a temporary file name that won't clash with `charset.alias'
6651 in the DOS 8.3 name space.
6652 * Makefile.am (charset_tmp): Define.
6653 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
6654 (uninstall-local): Likewise.
6655 Reported by Eli Zaretskii.
6657 2000-03-29 Paul Eggert <eggert@twinsun.com>
6659 * time/strftime.c (my_strftime): Make sure we call the system
6660 strftime, not ourselves, when invoking the underlying strftime.
6662 2000-03-24 Jim Meyering <meyering@lucent.com>
6664 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
6665 (charset_alias): Define.
6666 (install-exec-local): Factor out common code.
6667 (uninstall-local): Split lines longer than 80.
6668 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
6670 (.sed.in.sed): New rule. Don't redirect directly to $@.
6671 (CLEANFILES): Add ref-add.sed and ref-del.sed.
6673 2000-03-19 Bruno Haible <haible@clisp.cons.org>
6675 * config.charset: Output a line containing "Packages using this file".
6676 * ref-add.sed.in, ref-del.sed.in: New files.
6677 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
6678 ref-del.sed): New rules.
6680 2000-03-17 Jim Meyering <meyering@lucent.com>
6682 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
6683 Otherwise, include <strings.h>
6685 2000-03-17 Bruno Haible <haible@clisp.cons.org>
6687 * unicodeio.c (utf8_wctomb): New function.
6688 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
6689 format instead of in UCS-4 with platform dependent endianness.
6691 2000-03-07 Paul Eggert <eggert@twinsun.com>
6693 * savedir.c (savedir): Work even if directory size is
6694 negative; this can happen with some screwy NFS configurations.
6696 2000-03-06 Jim Meyering <meyering@lucent.com>
6698 * localcharset.c (get_charset_aliases): Don't try to free file_name
6699 if it's NULL (because we ran out of memory). From Bruno Haible.
6701 2000-03-05 Jim Meyering <meyering@lucent.com>
6703 * localcharset.c ("path-concat.h"): Include.
6704 (get_charset_aliases): Use path_concat instead of ANSI string
6707 * unicodeio.h (PARAMS): Define.
6708 Use it to guard prototype.
6710 2000-03-04 Jim Meyering <meyering@lucent.com>
6712 * Makefile.am (install-exec-local): Create $(libdir) before installing
6714 (uninstall-local): Uncomment this rule so `make distcheck' works
6717 * unicodeio.c (<errno.h>): Include it.
6718 (errno): Declare if not defined.
6720 * localcharset.c: Add Bruno's comment justifying use of volatile.
6722 * config.charset: New version, incorporating remarks from a linux
6723 i18n mailing list. From Bruno Haible.
6725 2000-03-02 Jim Meyering <meyering@lucent.com>
6727 * Makefile.am (EXTRA_DIST): Add config.charset.
6729 2000-03-01 Jim Meyering <meyering@lucent.com>
6731 * localcharset.c: Guard some #includes with `#if HAVE_...'.
6732 * unicodeio.c: Likewise.
6734 2000-02-02 Bruno Haible <haible@clisp.cons.org>
6736 * config.charset: New file.
6737 * localcharset.c: New file.
6738 * unicodeio.h, unicodeio.c: New files.
6739 * Makefile.am (DEFS): Add -DLIBDIR=...
6740 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
6741 (noinst_HEADERS): Add unicodeio.h.
6742 (all-local, install-exec-local, charset.alias): New targets.
6744 2000-02-28 Paul Eggert <eggert@twinsun.com>
6746 * quotearg.c (ALERT_CHAR): New macro.
6747 (quotearg_buffer_restyled): Use it.
6749 2000-02-27 Jim Meyering <meyering@lucent.com>
6751 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
6752 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
6754 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
6755 not `#if STDC_HEADERS'.
6756 Declare malloc if needed.
6758 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
6759 now that autoconf always defines the HAVE_DECL_ symbols.
6760 * human.c: Likewise.
6762 * strtoumax.c: Likewise.
6764 * backupfile.c: Arrange for cpp to fail if the configure-time
6765 declaration check was not run.
6767 * human.c: Likewise.
6769 * strtoumax.c: Likewise.
6771 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
6772 then first look up the entire `.'-containing string as a login name.
6774 2000-02-18 Paul Eggert <eggert@twinsun.com>
6776 * getdate.y: Handle two-digit years with leading zeros correctly.
6777 (textint): New typedef.
6778 (parser_control): Member year changed from int to textint.
6780 (YYSTYPE): Removed; replaced by %union with int and textint members.
6781 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
6782 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
6783 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
6784 (tSNUMBER, tUNUMBER): Now of type <textintval>.
6785 (date, number, to_year): Use width of number in digits, not its value,
6786 to determine whether it's a 2-digit year, or a 2-digit time.
6787 (yylex): Store number of digits of numeric tokens.
6788 Reported by John Kendall.
6790 (parser_control): Changed from struct parser_control to typedef (for
6791 consistency). All uses changed.
6793 (tID): Removed; not used.
6794 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
6796 2000-02-14 Paul Eggert <eggert@twinsun.com>
6798 * getpagesize.h (getpagesize): Port to VMS for Alpha;
6799 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
6801 2000-02-12 Jim Meyering <meyering@lucent.com>
6803 * userspec.c (ISDIGIT): Define it.
6804 (isdigit): Remove definition.
6805 (is_number): Use ISDIGIT, not isdigit.
6806 <libintl.h>: Include.
6808 (parse_user_spec): Mark translatable strings.
6810 2000-02-10 Jim Meyering <meyering@lucent.com>
6812 With these changes, nanosleep.[ch] are finally enough like the other
6813 lib/* replacement files to compile on a few more losing systems.
6815 * nanosleep.h: Don't include config.h.
6816 Remove prototype from declaration of nanosleep.
6817 (PARAMS): Remove now-unneeded definition.
6818 * nanosleep.c: #undef nanosleep.
6819 (rpl_nanosleep): Rename from nanosleep.
6821 2000-02-03 Jim Meyering <meyering@lucent.com>
6823 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
6824 rather than with `#if HAVE_UTMPNAME'.
6826 2000-02-01 Jim Meyering <meyering@lucent.com>
6828 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
6830 2000-01-31 Jim Meyering <meyering@lucent.com>
6832 * nanosleep.h (nanosleep): Guard declaration with
6833 `#if ! HAVE_DECL_NANOSLEEP'.
6834 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
6835 the declaration in that vendor's sys/timers.h.
6836 Reported by Christian Krackowizer.
6838 * quotearg.c (ISASCII): Add #undef and move definition to follow
6839 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
6840 (ISPRINT): Likewise.
6841 Reported by Tom Tromey.
6843 2000-01-30 Jim Meyering <meyering@lucent.com>
6845 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
6846 uses of ->ut_name. The latter doesn't work with new Linux header files
6847 where only utmpx.ut_user is declared.
6849 * readutmp.h (UT_USER): Define.
6851 2000-01-23 Jim Meyering <meyering@lucent.com>
6853 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
6856 2000-01-22 Jim Meyering <meyering@lucent.com>
6858 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
6859 [! HAVE_DECL_STRTOULL]: Declare strtoull.
6860 Required for some AIX systems. Reported by Christian Krackowizer.
6861 [TESTING] (main): New function.
6863 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
6864 * dirname.c (dir_name): Support for DOS-style file names with drive
6867 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
6869 * strverscmp.c (ISDIGIT): Define.
6870 (strverscmp): Use ISDIGIT, not isdigit.
6872 2000-01-17 Paul Eggert <eggert@twinsun.com>
6874 * nanosleep.c (nanosleep):
6875 Don't use SA_INTERRUPT to decide whether to call sigaction, as
6876 POSIX.1 doesn't require SA_INTERRUPT and some systems
6877 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
6878 it's been part of POSIX.1 since day 1 (in 1988).
6880 2000-01-17 Jim Meyering <meyering@lucent.com>
6882 * interlock: Remove unused file. Reported by François Pinard.
6884 2000-01-16 Paul Eggert <eggert@twinsun.com>
6886 * quotearg.c (quotearg_buffer_restyled): Do not quote
6887 alert, backslash, formfeed, and vertical tab unnecessarily in
6888 shell quoting style.
6891 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
6892 Free Software Foundation, Inc.
6893 Copying and distribution of this file, with or without modification,
6894 are permitted provided the copyright notice and this notice are preserved.