1 2005-05-25 Derek Price <derek@ximbiot.com>
2 Paul Eggert <eggert@cs.ucla.edu>
4 * getlogin_r.c, getlogin_r.h: New files.
6 2005-05-22 Bruno Haible <bruno@clisp.org>
8 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
9 Also include <sys/param.h> if it defines MIN, MAX.
10 Based on a patch by Derek Price <derek@ximbiot.com>.
12 2005-05-22 Bruno Haible <bruno@clisp.org>
14 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
15 (INT64_MIN): Fix definition.
16 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
18 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
19 NEED_SIGNED_INT_TYPES.
21 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
24 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
26 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
27 so that unistd-safer.h (GPL'ed code) need not be included.
29 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
32 * fts.c: Don't include "cycle-check.h" or "hash.h".
33 (setup_dir, free_dir): New functions.
34 (enter_dir, leave_dir): Define trivial
35 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
36 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
37 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
38 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
40 (fts_open): Use setup_dir.
41 (fts_close): Use free_dir.
42 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
43 This adds a label and some gotos, but the alternatives were messier.
44 Check for memory allocation failure when entering a dir.
45 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
46 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
47 (FTS): New member fts_cycle, that is a union that contains the
48 old active_dir_ht and cycle_state. All uses changed to mention
49 fts_cycle.ht and fts_cycle.state.
50 * fts-cycle.c: New file, containing GPL'ed code migrated out of
51 fts.c, with the following changes:
52 (setup_dir, free_dir): New functions.
53 (enter_dir): Now returns bool. Return true if successful, false
54 if memory exhausted. All callers changed.
55 Do not bother partly cleaning up on
56 memory allocation failure; that is free_dir's job.
57 However, free ad if hash_insert fails, to avoid memory leak.
58 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
59 fts->fts_options to see which union member to use.
61 2005-05-20 Jim Meyering <jim@meyering.net>
63 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
64 Now a macro, to pacify GCC.
66 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
68 * chown.c (rpl_chown): Return -1 on failure.
70 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
72 * canonicalize.c: Include canonicalize.h first, to test interface.
73 Include <stddef.h> unconditionally, since we assume C89 now.
74 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
75 * fts.c: Include fts_.h first, to check interface.
76 Do not include intprops.h; no longer needed.
77 Include cycle-check.h and hash.h, since fts_.h no longer does.
78 Remove unnecessary casts of closedir to void.
79 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
80 decide whether to decrement nlinks.
81 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
82 (FTS): Use struct hash_table * instead of Hash_table, so that
83 we no longer need to include hash.h here.
85 2005-05-17 Jim Meyering <jim@meyering.net>
87 * fts.c, fts_.h: New files, from coreutils.
89 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
92 * unlinkdir.c, unlinkdir.h: New files.
93 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
94 regex.h, unlocked-io.h, xtime.h:
95 White space changes only.
96 * makepath.c (make_path): Port to hosts where leading "//" is special.
97 * yesno.c: Include getline.h, not ctype.h.
98 (yesno): Don't remove leading white space; POSIX doesn't allow it.
99 Use getline to remove arbitrary restriction on response length.
101 2005-05-13 Bruno Haible <bruno@clisp.org>
103 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
104 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
105 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
106 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
107 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
108 Add support for 64-bit integers in the MSVC compiler.
110 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
112 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
113 Change the initial comment to refer to GPL, not LGPL.
114 gnulib-tool will change it to LGPL as needed.
116 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
117 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
118 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
119 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
120 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
121 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
122 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
123 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
124 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
125 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
126 concatpath.c, config.charset, copy-file.c, copy-file.h,
127 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
128 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
129 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
130 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
131 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
132 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
133 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
134 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
135 full-read.c, full-read.h, full-write.c, full-write.h,
136 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
137 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
138 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
139 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
140 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
141 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
142 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
143 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
144 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
145 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
146 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
147 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
148 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
149 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
150 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
151 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
152 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
153 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
154 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
155 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
156 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
157 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
158 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
159 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
160 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
161 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
162 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
163 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
164 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
165 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
166 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
167 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
168 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
169 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
170 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
171 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
172 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
173 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
174 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
175 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
176 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
177 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
178 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
179 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
180 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
181 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
182 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
183 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
184 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
185 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
186 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
187 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
188 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
189 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
190 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
191 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
192 Update FSF postal mail address.
194 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
196 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
197 specified in ai_socktype. Fix invalid ai_protocol
198 check. ai_protocol is usually set to 0 or depending on
199 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
200 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
201 ai_socktype / ai_protocol in the returned addrinfo structure.
203 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
204 Bruno Haible <bruno@clisp.org>
206 * inet_ntop.h: New file.
207 * inet_ntop.c: New file, from glibc with modifications.
209 2005-05-08 Jim Meyering <jim@meyering.net>
211 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
213 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
215 Merge from coreutils. Among other things,
216 add bulletproofing for cases where stdin, stdout, or stderr are closed.
217 * fd-safer.c: New file.
218 * fcntl-safer.h, open-safer.c: Remove.
219 * chdir-long.c: Fix comment "fetish" -> "coreutils".
220 * dup-safer.c: Include unistd-safer.h first.
221 Don't include errno.h.
222 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
223 * file-type.h: Don't assume invoker included sys/stat.h first.
224 * file-type.c: Rely on file-type.h change.
225 * getloadavg.c: Include unistd-safer.h.
226 (getloadavg): Use safer open.
227 * getusershell.c: Include "stdio-safer.h".
228 (getusershell): Use safer fopen.
229 * long-options.c (long_options): Use NULL rather than 0.
230 * modechange.h (mode_free): Remove; all callers changed to invoke
232 * modechange.c: Likewise.
233 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
234 (MODE_DONE): New constant.
235 (struct mode_change): Remove 'next' member.
236 (make_node_op_equals): New function; like the old one of the
237 same name, except it allocates an array.
238 (mode_compile, mode_create_from_ref): Use it.
239 (mode_compile): Allocate result as an array, not a linked list.
240 Parse octal string ourself, so that we catch mistakes like "+0".
241 (mode_adjust): Arg is an array, not a linked list.
242 * modechange.c: Include stat-macros.h, xalloc.h.
243 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
244 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
245 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
246 Remove. This is now stat-macros.h's job.
247 (talloc): Remove. All callers replaced by xalloc, so that
248 our invokers don't have to worry about reporting memory failures.
249 (make_node_op_equals): Remove.
250 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
252 (struct mode_change): Moved here from modechange.h.
253 (mode_append_entry): Remove.
254 (mode_compile): Remove MASKED_OPS arg, since it encouraged
255 apps to have incorrect behavior. Use simpler algorithm for head
256 and tail. Don't futz with umask; that's now the job of mode_adjust.
257 Detect more invalid usages rather than having somewhat-random behavior.
258 Don't insert an "a=" action, as that leads to incorrect behavior.
259 (mode_compile, mode_create_from_ref): Return NULL on error instead
260 of an enum, since now there's only one way to have an error. All
262 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
263 at the correct time. Simplify calculation of "+u" and its ilk.
264 Don't mishandle "+X".
265 (mode_free): Remove "register" and localize decls.
266 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
267 (struct mode_change): Move to modechange.c; callers don't
268 need to see this stuff.
269 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
270 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
271 (mode_change, mode_adjust): Reflect the new signatures noted above.
272 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
273 that might redefine system include files.
274 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
275 (my_usleep): Use NULL rather than (void *) 0.
276 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
277 Use siginterrupt to specify that system calls should be interrupted.
278 (rpl_nanosleep): Move initialization of suspended closer to call of
280 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
281 * readutmp.c: Likewise. Include signal.h, stdbool.h.
282 (desirable_utmp_entry): New function.
283 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
284 using x2nrealloc, to simplify logic.
285 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
286 size calculation. Do not assume utmp file is a regular file.
287 * readutmp.h (UT_PID): Moved here from ../src/who.c.
288 (READ_UTMP_CHECK_PIDS): New constant.
289 * save-cwd.c: Include unistd-safer.h.
290 (save_cwd): Use fd_safer.
291 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
292 [!_LIBC] Include "stat-macros.h" instead.
293 * unistd-safer.h (fd_safer): New decl.
295 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
297 * byteswap_.h: New file.
299 2005-04-25 Albert Chin <china@thewrittenword.com>
301 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
304 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
306 * getdate.y (zone): Allow relunit_snumber after tZONE, so
307 that "UTC +1 second" continues to work. Problem reported
309 (relunit_snumber): New rule.
312 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
314 * getdate.y (universal_time_zone_table): New constant.
315 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
316 universal_time_zone_table.
317 (lookup_zone): Prefer universal_time_zone_table to
318 local_time_zone_table, so that "GMT" time stamps are allowed in
319 London during the summer. Problem reported by Ian Abbott.
321 2005-04-12 Jim Meyering <jim@meyering.net>
323 * human.c (humblock): Set *options even when returning due to
324 xstrtoumax conversion failure. Thanks to a used-uninitialized
327 2005-04-09 Jim Meyering <jim@meyering.net>
329 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
330 -Wuninitialized: initialize tm0.tm_year.
332 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
334 * getdate.y (parser_control): rels_seen is now a boolean, not a
335 count, since there's no maximum. All uses changed.
336 Add member dsts_seen.
337 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
339 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
340 Use pc_rels_seen to decide whther a date is absolute.
342 * getdate.y (number): Don't overwrite year.
343 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
346 2005-04-02 Simon Josefsson <jas@extundo.com>
348 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
349 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
351 2005-03-27 Jim Meyering <jim@meyering.net>
353 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
355 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
357 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
358 "one's complement" -> "ones' complement" in comment, as per Knuth.
359 "value of type" -> "type or expression" in comment.
360 * mktime.c, strftime.c: Propagate intprops.h comment nits.
362 2005-03-26 Jim Meyering <jim@meyering.net>
365 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
366 Correct typos: s/or/of/.
368 2005-03-23 Jim Meyering <jim@meyering.net>
370 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
372 2005-03-21 Jim Meyering <jim@meyering.net>
374 Changes imported from coreutils.
376 * cycle-check.c: Don't include xalloc.h.
378 * path-concat.c: Don't include assert.h.
379 (path_concat): Remove assertion that would have triggered
380 for ABASE starting with more than one slash.
381 Reported by Andreas Schwab.
383 * path-concat.c (path_concat): Set *BASE_IN_RESULT
384 properly when ABASE is an absolute file name.
385 Correct the description of this function.
387 Add an assertion and a test driver.
388 This fixes a bug introduced on 2004-07-02.
389 Andreas Schwab reported the resulting failure of cp --parents:
390 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
392 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
394 * strftime.c (my_strftime): If the underlying strftime returns 0
395 (which shouldn't happen), generate nothing instead of returning 0
396 immediately, so that nstrftime (NULL, ...) doesn't return 0.
398 2005-03-16 Bruno Haible <bruno@clisp.org>
400 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
402 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
404 * strftime.c (my_strftime): Prepend space to format so that we can
405 reliably distinguish strftime failure from empty output on POSIX
408 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
410 * iconvme.c (SIZE_MAX): New macro, if not already defined.
411 (iconv_string): Don't guess a size-zero buffer, as that might cause
412 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
413 result would be 'too large', where 'too large' is (heuristically)
414 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
415 overflow concerns. This will prevent some unwanted malloc failures
416 when the inputs are very large.
418 2005-03-15 Bruno Haible <bruno@clisp.org>
420 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
423 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
426 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
428 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
430 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
431 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
433 * strtol.c: Likewise.
435 2005-03-14 Simon Josefsson <jas@extundo.com>
437 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
440 2005-03-14 Jim Meyering <jim@meyering.net>
442 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
443 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
444 to be nonzero so that we (and caller) can detect the difference
445 between a valid zero-length expansion and an error return, even
446 when the underlying strftime fails before writing anything into
449 2005-03-10 Jim Meyering <jim@meyering.net>
451 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
452 so that this module works on systems without fchdir.
454 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
456 Factor int-properties macros into a single file, except for
458 * intprops.h: New file.
459 * getloadavg.c: Include it instead of limits.h.
460 (INT_STRLEN_BOUND): Remove.
461 * human.c: Include intprops.h.
462 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
463 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
464 * inttostr.h: Include intprops.h instead of limits.h.
465 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
466 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
467 for consistency with intprops.h.
468 (time_t_is_integer, twos_complement_arithmetic): Use them.
469 * sig2str.h: Include <signal.h>, intprops.h.
470 (INT_STRLEN_BOUND): Remove.
471 * strftime.c (TYPE_SIGNED): Remove.
472 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
473 * strtol.c: Adjust comments to match intprops.h.
474 * userspec.c: Include intprops.h.
475 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
476 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
477 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
478 instead of rolling our own expressions.
479 * xstrtol.c: Include xstrtol.h first, to test interface.
481 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
483 (my_strftime): Do not mishandle years close to INT_MAX, by doing
484 the right thing even if adding 1900 would overflow. Similarly
485 for tm_mon + 1 and tm_yday + 1.
486 Make %Y always equivalent to %C%y, and similarly for %G and %g.
487 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
488 (DO_SIGNED_NUMBER): New macro.
489 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
491 2005-03-07 Bruno Haible <bruno@clisp.org>
493 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
495 2005-03-03 Derek R. Price <derek@ximbiot.com>
496 Bruno Haible <bruno@clisp.org>
498 * pagealign_alloc.h: New file.
499 * pagealign_alloc.c: New file.
501 2005-01-28 Bruno Haible <bruno@clisp.org>
503 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
506 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
508 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
509 The workaround isn't strictly needed for POSIX conformance, and
510 it's too much of a pain to configure and maintain. We'll ask
511 people to fix their kernels instead.
512 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
513 (NANOSLEEP_BUG_WORKAROUND): Remove.
514 (xnanosleep): Remove the workaround.
516 2005-02-12 Bruno Haible <bruno@clisp.org>
518 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
520 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
522 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
523 * timespec.h (gettime): Return void, since it always
524 succeeds now. All uses changed.
525 * gettime.c (gettime) Likewise.
526 [HAVE_NANOTIME]: Prefer nanotime.
527 Assume gettimeofday succeeds, as POSIX requires.
528 Assime time () succeeds, since other code already does.
529 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
530 (timespec_subtract): Remove.
531 (NANOSLEEP_BUG_WORKAROUND): New constant.
532 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
533 things considerably. Use it only on GNU/Linux hosts, since the
534 workaround shouldn't be needed elsewhere.
536 2005-02-24 Bruno Haible <bruno@clisp.org>
538 * gettext.h: Update from GNU gettext 0.14.2.
540 2005-02-24 Bruno Haible <bruno@clisp.org>
542 * localcharset.c: Update from GNU gettext 0.14.2.
543 * config.charset: Update from GNU gettext 0.14.2.
545 2005-02-22 Simon Josefsson <jas@extundo.com>
547 * iconvme.h, iconvme.c: New files, from libc.
549 2005-02-20 Neil Conway <neilc@samurai.com>
551 * xgethostname.c (xgethostname): Check for ENOMEM, which is
552 returned by OSX/Darwin if the specified buffer is not large
553 enough for the hostname.
555 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
557 * memrchr.h: New file.
558 * chdir-long.c: Include it.
559 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
560 Don't bother including stddef.h.
562 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
564 * argp-help.c (__argp_help): Create a fake struct argp_state and
565 pass it to _help, otherwise the latter coredumps trying to
566 dereference state.root_argp.
568 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
570 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
572 Include <sys/types.h>, for dev_t.
573 (ME_DUMMY, ME_REMOTE): Move from here....
574 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
575 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
577 Include mountlist.h first, to test the interface.
579 2005-01-29 Bruno Haible <bruno@clisp.org>
581 * progname.c (program_name): Initialize.
582 Needed when linking statically on MacOS X.
584 2005-01-28 Bruno Haible <bruno@clisp.org>
586 * javacomp.sh.in: New file, from GNU gettext.
587 * javacomp.h: New file, from GNU gettext.
588 * javacomp.c: New file, from GNU gettext.
590 2005-01-26 Bruno Haible <bruno@clisp.org>
592 * javaexec.sh.in: New file, from GNU gettext.
593 * javaexec.h: New file, from GNU gettext.
594 * javaexec.c: New file, from GNU gettext.
596 2005-01-26 Simon Josefsson <jas@extundo.com>
598 * gai_strerror.c: Use GPL in header.
600 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
602 * argp-help.c (hol_entry_help): Avoid using non-constant
603 initializers for struct pentry_state.
604 (__argp_error): Check return value of __asprintf
605 (__argp_failure): Translate error message
607 * argp-parse.c: Removed braces around the expansion of N_()
609 2005-01-21 Jim Meyering <jim@meyering.net>
611 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
612 same value as for Solaris 9.
614 * chdir-long.c (chdir_long): Rewrite to remove limitation on
615 component length. This included changing the parameter to be
616 of type `char *' rather than `char const *'.
617 * chdir-long.h (chdir_long): Update prototype.
619 * openat.c (fdopendir, fstatat): New functions.
620 * openat.h: Include headers required for use of DIR and struct stat.
621 [AT_SYMLINK_NOFOLLOW]: Define.
622 (fdopendir, fstatat): Add prototypes.
624 2005-01-21 Bruno Haible <bruno@clisp.org>
626 * classpath.h: New file, from GNU gettext.
627 * classpath.c: New file, from GNU gettext.
629 2005-01-20 Simon Josefsson <jas@extundo.com>
631 * version-etc-fsf.c: New file, with version_etc_copyright.
632 * version-etc.c: Remove version_etc_copyright.
633 * version-etc.h (version_etc_copyright): Use [] instead of * in
634 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
636 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
638 * save-cwd.c (save_cwd): Remove code to support the case
639 where fchdir is missing or flaky.
641 2005-01-20 Simon Josefsson <jas@extundo.com>
643 * base64.h (isbase64): Add.
645 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
646 using a unsigned prototype, don't inline.
647 (base64_decode): Use it.
649 2005-01-19 Bruno Haible <bruno@clisp.org>
651 * sh-quote.h: New file, from GNU gettext.
652 * sh-quote.c: New file, from GNU gettext.
654 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
656 Merge changes from coreutils, as described below in several
657 changelogs dated today.
659 * save-cwd.c: Include "save-cwd.h" before other include files.
660 (O_DIRECTORY): Remove; not needed here, since "." must be
661 a directory. All uses removed.
662 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
663 universal on Suns, and we also need to test for IRIX.
664 Revamp code to use 'if' rather than '#if'.
665 Avoid unnecessary comparison of cwd->desc to 0.
667 * utimens.c (futimens): Robustify the previous patch, by checking
668 for known valid error numbers rather than observed invalid ones.
670 2005-01-18 Jim Meyering <jim@meyering.net>
672 * version-etc.c (version_etc_copyright): Update copyright date.
674 * utimens.c (futimens): Account for the fact that futimes
675 can also fail with errno == ENOSYS or errno == ENOENT.
676 Patch from Dmitry V. Levin.
678 Change the name of the robust chdir function from chdir to chdir_long.
679 * save-cwd.c: Include chdir-long.h rather than chdir.h.
680 (restore_cwd): Use chdir_long, not chdir.
681 * chdir-long.c: Renamed from chdir.c.
682 * chdir-long.h: Renamed from chdir.h.
683 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
686 2005-01-18 Bob Proulx <bob@proulx.com>
688 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
689 offsetof() macro construct to avoid compile failure with native HP-UX
690 11.0 ANSI C compiler.
692 2005-01-06 Bruno Haible <bruno@clisp.org>
694 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
695 because stpncpy.m4 takes care of it.
697 2004-01-24 Bruno Haible <bruno@clisp.org>
699 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
701 2003-10-09 Bruno Haible <bruno@clisp.org>
703 * progreloc.c: Include xalloc.h instead of xmalloc.h.
705 2005-01-06 Bruno Haible <bruno@clisp.org>
707 * fwriteerror.h (fwriteerror): Change specification to include fclose.
708 * fwriteerror.c: Include <stdbool.h>.
709 (fwriteerror): At the end, close the file stream. Record whether
710 stdout was already closed.
712 2004-05-27 Bruno Haible <bruno@clisp.org>
714 * execute.c (environ): Declare if needed.
715 * pipe.c (environ): Likewise.
716 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
718 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
720 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
721 definitions to be after all include files, to avoid collisions.
722 Problem reported by Bob Proulx.
724 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
726 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
727 not needed. This removes a dependency on the gettext module.
728 [defined _LIBC]: Do not include <libintl.h>; not needed.
730 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
732 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
735 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
737 * argp-parse.c: Include <stddef.h>.
738 (alignof, alignto): New macros.
739 (parser_init): Don't assume that void * is aligned sufficiently
742 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
743 need to extend the stack.
744 (YYINITDEPTH): New macro, so that the initial stack isn't overly
747 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
749 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
751 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
753 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
754 Remove now-obsolete comment about AIX.
755 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
756 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
757 (YYMAXDEPTH): New macro.
759 2004-12-18 Bruno Haible <bruno@clisp.org>
761 * fatal-signal.c (fatal_signals): Make non-const.
762 (init_fatal_signals): New function.
763 (uninstall_handlers, install_handlers): Ignore signals that were set to
765 (at_fatal_signal): Call init_fatal_signals.
766 (init_fatal_signal_set): Likewise. Ignore signals that were set to
768 Reported by Paul Eggert.
770 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
772 * getdate.y (textint): New member "negative".
773 (time_zone_hhmm): New function.
774 Expect 14 shift-reduce conflicts, not 13.
775 (o_colon_minutes): New rule.
776 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
777 (yylex): Set the "negative" member of signed numbers.
779 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
781 Changes imported from coreutils.
782 * hard-locale.c: Assume <locale.h> exists.
784 (GLIBC_VERSION): New macro.
785 (hard_locale): Assume setlocale exists.
786 Rewrite to avoid #ifdef.
787 Use strdup rather than malloc + strcpy.
788 * human.c: Assume <locale.h> exists.
789 (human_readable): Assume localeconv exists.
791 2004-12-01 Jakub Jelinek <jakub@redhat.com>
793 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
794 convert T2, not T. (Imported from libc.)
796 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
798 * getcwd.c (is_ENAMETOOLONG): New macro.
799 (__getcwd.c): Don't restore errno; glibc doesn't.
800 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
801 first, falling back to our code only if its results look suspicious.
802 Ensure that the resulting buffer is only as large as necessary.
804 * readutmp.c: Include readutmp.h first.
805 Include <errno.h>, since readutmp.h no longer does that.
806 * readutmp.h: Don't include <errno.h>,
807 <sys/param.h>, <time.h>; not needed to establish interface.
808 (errno): Remove decl.
809 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
810 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
811 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
813 2004-11-28 Simon Josefsson <jas@extundo.com>
815 * base64.h, base64.c: New file.
817 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
819 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
821 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
823 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
824 HP's ANSI C compiler.
825 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
826 Declaring int functions causes warnings on some modern systems and
827 shouldn't be needed to compile on ancient ones.
828 * same.c (MIN) [defined MIN]: Don't define, since it's already
831 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
832 with the following changes.
833 (__set_errno): Parenthesize properly.
835 (MIN, MAX, MATCHING_INO): New macros.
836 (__getcwd): Define with prototype, not K&R form.
837 Use heuristics to allocate default buffer on stack if possible.
838 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
839 behavior, and to avoid the PATH_MAX limit when computing
841 Use MATCHING_INO to compare inode number to file.
842 Check for arithmetic overflow in size calculations.
843 Fix bug in reallocation of dot array that caused getcwd to fail
844 on directories nested deeper than 75.
845 Be more careful about saving errno on error.
846 Do not use realloc; use only free+malloc, as this is a bit
847 more flexible and avoids a needless copy operation.
848 Do not inspect st_dev and st_ino for symbolic links; POSIX
849 doesn't specify the latter.
850 Check for closedir errors.
851 Avoid needless casts.
852 Use "#ifdef weak_alias" around weak_alias, to be like other
854 The following changes to getcwd.c have effect only when used in
855 gnulib; they have no effect inside glibc proper.
856 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
857 as alloca isn't used.
858 (alloca, __alloca): Likewise.
859 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
860 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
861 unconditionally, as gnulib assumes C89 or better.
862 Do not include <sys/param.h>.
863 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
864 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
866 (NULL) [!defined NULL]: Remove; we assume C89 or better.
867 Include <dirent.h> in a way that is compatible with modern Autoconf.
868 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
869 New macros, if not already defined.
870 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
871 Use "_LIBC", not "defined _LIBC", for consistency.
872 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
874 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
875 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
876 * xgetcwd.c: David MacKenzie's old code was removed, so give
877 credit only to Jim Meyering and adjust the copyright dates.
878 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
879 <stdlib.h>, <unistd.h>, "pathmax.h".
880 Instead, include "xgetcwd.h" (first) and "getcwd.h".
881 (INITIAL_BUFFER_SIZE): Remove.
882 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
884 2004-11-23 Jim Meyering <jim@meyering.net>
886 * getopt_.h: Remove trailing blanks.
888 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
890 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
891 (futimens): New function, which uses futimes if available.
892 (futimens, utimens): Support timespec==NULL, with same semantics
893 as utime and utimens.
894 * utimens.h (futimens): New decl.
896 2004-11-23 Jim Meyering <jim@meyering.net>
898 * __fpending.c: Add comment.
900 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
902 * getopt_.h: Re-addition of __getopt_argv_const caused
903 redefinition warnings. To avoid them, include the defines
904 in `#if !defined __need_getopt ... #endif'. The only place
905 where __getopt_argv_const is used is in definitions
906 of getopt_long and getopt_long_only below, which are as well
907 protected by `#ifndef __need_getopt'.
908 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
909 __need_getopt after including <stdio.h> and <unistd.h> These
910 headers might have defined it.
912 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
914 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
916 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
917 optopt): Use them instead of invoking ## directly; otherwise, the
918 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
920 2004-11-19 Bruno Haible <bruno@clisp.org>
922 * strtok_r.c: Move comments from here...
923 * strtok_r.h: ... to here.
925 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
927 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
928 might fail. Problem reported by Yoann Vandoorselaere.
929 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
930 that mishandle size_t overflow.
932 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
934 * canon-host.c: Include "strdup.h".
935 (canon_host): Use getaddrinfo if available, so that IPv6 works.
936 Use strdup instead of malloc/strcpy to duplicate strings.
938 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
939 (human_space_before_unit): New constant.
940 * human.c (human_readable): Support it.
942 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
943 (xgetcwd): Set errno correctly when failing.
944 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
945 the failure is actually due to a PATH_MAX problem.
947 Further getopt changes to make it more likely that glibc will
948 buy the changes back.
949 * getopt.c (POSIXLY_CORRECT): New constant.
950 (getopt): Use it, so to preserve glibc semantic
951 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
952 when compiling for libc.
953 * getopt_.h (__getopt_argv_const): Bring it back.
954 (getopt_long, getopt_long_only): Use it.
956 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
957 New arg POSIXLY_CORRECT. All callers changed.
958 (getopt): Argv is now char * const *, as per standard.
959 (_getopt_internal_r, _getopt_internal): Argv is now char **,
960 not char *__getopt_argv_const *.
961 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
962 _getopt_long_only_r): Likewise.
963 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
964 * getopt_int.h (_getopt_internal, _getopt_internal_r,
965 _getopt_long_r, _getopt_long_only_r): Likewise.
966 * getopt_.h (__getopt_argv_const): Remove.
967 (getopt): Argv is now char * const *, as per standard.
969 * getdate.y (tORDINAL): New token.
970 (day, relunit): Allow it for relative times.
971 (relative_time_table): Use tORDINAL for ordinals.
973 2004-11-15 Jim Meyering <jim@meyering.net>
975 * closeout.c: Include "__fpending.h" once again.
977 (close_stdout): Don't fail just because stdout was closed initially,
978 since some programs don't write to stdout in the normal course of
979 operation (other than --version and --help), and we don't want this
980 function to make e.g. `touch file >&-' fail.
981 But do fail if it was closed and someone has tried to write to it.
982 E.g., `printf foo >&-' must fail.
984 2004-11-11 Simon Josefsson <jas@extundo.com>
986 * strtok_r.h, strtok_r.c: New file.
988 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
990 * getopt_.h (__getopt_argv_const): New macro, to be used so that
991 we can stop lying to compilers about the constness of argv when we
992 are compiled outside glibc.
993 (getopt, getopt_long, getopt_long_only): Use it.
994 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
996 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
997 _getopt_long_only_r): Likewise.
998 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
999 _getopt_long_only_r): Likewise.
1001 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
1002 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
1003 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
1004 the other external symbols.
1005 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
1006 declaration, since the above renaming now works around collisions.
1008 2004-11-11 Jim Meyering <jim@meyering.net>
1010 * linebreak.c: Remove trailing blanks.
1011 * alloca_.h: Likewise.
1012 * acosl.c: Likewise.
1013 * euidaccess.c: Likewise.
1014 * allocsa.h: Likewise.
1016 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
1018 * mktime.c (SHR): New macro, which is a portable
1019 substitute for >> that should work even on Crays.
1020 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
1021 Problem reported by Mark D. Baushke in
1022 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
1023 * getdate.y (SHR): Likewise.
1025 * strftime.c (SHR): Likewise.
1027 * quotearg.c (struct quoting_options): Use unsigned int for
1028 quote_these_too, so that right shifts are well defined. All uses
1031 2004-11-10 Simon Josefsson <jas@extundo.com>
1033 * getaddrinfo.h, getaddrinfo.c: New files.
1035 2004-11-10 Jim Meyering <jim@meyering.net>
1037 Ensure that no close failure goes unreported.
1038 * closeout.c (close_stdout): Always close stdout. I.e., don't
1039 return early when it seems there's nothing to flush.
1040 Don't include __fpending.h.
1042 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
1044 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
1046 2004-11-05 Bruno Haible <bruno@clisp.org>
1048 * readlink.c: Include stddef.h, needed for size_t on Woe32.
1049 Reported by Mark D. Baushke <mdb@cvshome.org>.
1051 2004-11-04 Bruno Haible <bruno@clisp.org>
1053 2004-09-11 Bruno Haible <bruno@clisp.org>
1054 * allocsa.valgrind: New file.
1055 2004-02-06 Bruno Haible <bruno@clisp.org>
1056 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
1057 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
1058 Reported by Christopher Seip <chris.seip@hp.com>.
1060 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1062 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
1063 with errno == ERANGE if the buffer is too small.
1064 Problem reported by Mark D. Baushke.
1066 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
1068 * xreadlink.c (MAXSIZE): New macro.
1069 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
1070 size does not exceed MAXSIZE. Avoid cast.
1071 As suggested by Mark D. Baushke in
1072 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
1073 if readlink fails with buffer size just under MAXSIZE, try again
1076 2004-11-02 Derek R. Price <derek@ximbiot.com>
1077 and Paul Eggert <eggert@cs.ucla.edu>
1079 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
1080 (get_date): Overparenthesize to avoid GCC warning.
1082 2004-11-02 Bruno Haible <bruno@clisp.org>
1084 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
1085 function returns void.
1087 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
1089 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1090 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
1093 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1095 * getdate.y: Add support for TZ="foo" within a date string.
1096 Fix some bugs near time_t boundaries. Reject dates with
1097 out-of-range components, e.g., "Sept 31".
1098 Include <stdlib.h>, "setenv.h", "xalloc.h".
1099 (ISDIGIT_LOCALE): Remove; unused.
1100 Note that the TZ and time functions used here are not reentrant.
1101 (mktime_ok, get_tz): New functions.
1102 (TZBUFSIZE): New constant.
1103 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
1104 This requires that we sometimes generate our own TZ="XXX..." setting.
1106 2004-10-27 Derek R. Price <derek@ximbiot.com>
1108 * mktime.c (not_equal_tm): Remove redundant check.
1110 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
1112 * getdate.y: Use Bison 1.875 features, and some minor
1113 code cleanups. This change does not affect semantics.
1114 Don't include <stdlib.h>; no longer needed.
1115 Don't include unlocked-io.h; only the "#if TEST" code uses
1116 stdio, and performance isn't crucial there.
1117 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
1118 Bison 1.875 features as described below.
1119 All uses of "PC." replaced by "pc->".
1120 (YYSTYPE): Add a forward declaration.
1121 (yylex, yyerror): Use full prototypes in forward decls.
1122 Use "%pure-parser" rather than obsolescent "%pure_parser".
1123 Use %parse-param and %lex-param instead of obsolescent
1124 YYPARSE_PARAM and YYLEX_PARAM.
1125 (meridian_table, month_and_day_table, time_units_table,
1126 relative_time_table, time_zone_table, military_table,
1127 lookup_zone, lookup_word, get_date):
1128 Use NULL instead of 0 where appropriate.
1129 (to_hour): Avoid abort (), to avoid a dependency on
1131 (yyerror, yylex): Now accepts parser_control * arg.
1132 (main) [TEST]: Use '\0' rather than 0 for char.
1134 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
1136 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
1137 It's now the caller's responsibility to handle the case where
1138 !HAVE_GETPAGESIZE && !defined getpagesize.
1140 * mktime.c (leapyear): Arg is long int, not int.
1142 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
1144 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
1146 2004-10-12 Simon Josefsson <jas@extundo.com>
1148 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1149 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
1152 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
1154 * vsnprintf.h: New file.
1155 * vsnprintf.c: New file.
1157 2004-10-07 Bruno Haible <bruno@clisp.org>
1159 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
1160 into the provided buffer.
1162 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
1164 * diacrit.c, diacrit.h: Add GPL notice.
1166 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
1167 * atanl.c (atanl): Keep the code as similar to glibc as possible.
1168 * logl.c (logl): Keep the code as similar to glibc as possible.
1169 This avoids a potential constant-folding bug.
1171 2004-10-05 Bruno Haible <bruno@clisp.org>
1173 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
1175 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1177 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
1178 * xmalloc.c (xmemdup): Likewise.
1179 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
1180 XFREE): Remove these long-obsolescent macros.
1181 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
1182 * xstrdup.c: Remove.
1184 * regex.c (re_comp): Cast gettext return value to char *,
1185 Problem reported by Martin Neitzel via Mark D. Baushke.
1187 2004-10-04 Simon Josefsson <jas@extundo.com>
1189 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
1190 '#ifdef USE_UNLOCKED_IO'.
1192 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1194 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
1195 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
1196 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
1197 regex.c, sha1.c, version-etc.c, yesno.c:
1198 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
1199 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
1200 the includer's responsibility.
1202 Sync from coreutils.
1204 * modechange.c (mode_compile): Don't decrement a pointer that
1205 points to the start of a string, as the C Standard says the
1206 resulting behavior is undefined.
1208 * backupfile.h (enum backuptype): Rename none -> no_backups,
1209 simple -> simple_backups, numbered_existing ->
1210 numbered_existing_backups, numbered -> numbered_backups
1211 to avoid shadowing problems. All uses changed.
1212 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
1213 * backupfile.c (check_extension, numbered_backup):
1214 Rename locals to avoid shadowing 'basename'.
1215 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
1218 * .cppi-disable: Add getopt_.h, getopt_int.h.
1219 * .cvsignore: Add getopt.h.
1221 2004-10-04 Simon Josefsson <jas@extundo.com>
1223 * memmem.h: New file.
1224 * memmem.c: New file, taken from glibc.
1226 2004-10-02 Jim Meyering <jim@meyering.net>
1228 * dirfd.h, getpagesize.h: Add copyright notice.
1230 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
1232 * snprintf.c: Remove comments as to why each header is needed.
1234 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
1236 * strsep.h: New file.
1237 * strsep.c: New file.
1239 2004-10-01 Simon Josefsson <jas@extundo.com>
1241 * snprintf.c (snprintf): Handle size==0.
1243 2004-10-01 Simon Josefsson <jas@extundo.com>
1244 Bruno Haible <bruno@clisp.org>
1246 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
1247 (snprintf): Declare 'args'.
1249 2004-09-30 Simon Josefsson <jas@extundo.com>
1251 * snprintf.h, snprintf.c: New files.
1253 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1255 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
1256 (hol_entry_help): Never translate an empty string.
1257 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
1258 * argp.h (OPTION_NO_TRANS): New option.
1260 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
1262 * xvasprintf.c: Include xalloc.h.
1263 (xvasprintf): Use xalloc_die, not xmalloc_die.
1265 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
1267 * dummy.c: Change copyright notice to FSF, and license to GPL.
1269 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
1271 * argp-pvh.c (argp_program_version_hook): Provide initial value.
1272 Problem reported by Bruno Haible in:
1273 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
1275 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
1277 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
1278 in case some system header has #define'd it. Problem reported by
1279 Soeren D. Schulze in
1280 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
1282 2004-09-08 Bruno Haible <bruno@clisp.org>
1284 * stdint_.h.in: New file, taken from GNU clisp.
1286 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
1288 * xvasprintf.h: New file.
1289 * xvasprintf.c: New file.
1290 * xasprintf.c: New file.
1292 2004-09-08 Bruno Haible <bruno@clisp.org>
1294 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
1296 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
1298 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
1300 Import from coreutils.
1301 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
1302 strings on unbounded length. alloca's performance benefits aren't
1303 that important here.
1305 (parse_with_separator): New function, with most of the internals
1306 of the old parse_user_spec. Allow user to omit both user and group,
1307 for compatibility with FreeBSD.
1308 Clone only the user name, not the entire spec.
1309 Do not set *uid, *gid unless entirely successful.
1310 Avoid memory leak in some failing cases.
1311 Fix regression for USER.GROUP reported by Dmitry V. Levin in
1312 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1313 (parse_user_spec): Rewrite to use parse_with_separator.
1315 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
1317 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
1318 its complicated substitute.
1319 * argp-help.c: Include <errno.h>, for program_invocation_short_name
1320 and program_invocation_name.
1321 (__argp_basename) [!_LIBC]: Remove; the only use was
1322 replaced by its body.
1323 (__argp_short_program_name): Change condition from
1324 !defined __argp_short_program_name to
1325 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
1326 to match argp-namefrob.h.
1327 (__argp_failure): Don't assume strerror_r returns char *.
1328 * argp-parse.c (N_): Define unconditionally.
1329 (argp_default_options): Fill out initializers with 0 to avoid
1332 2004-08-12 Simon Josefsson <jas@extundo.com>
1334 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
1335 * getopt_.h: Renamed from getopt.h.
1337 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1339 Merge from coreutils.
1341 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
1342 wmemchr or wmemcpy. Problem reported by Robert Dahlem
1343 for Reliant Unix 5.43.
1345 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
1346 (union fooround): Use uintmax_t, not long int.
1347 The rest is a merge from libc:
1348 [defined _LIBC]: Include <shlib-compat.h>.
1349 (_obstack) [defined _LIBC]: Remove after 2.3.4.
1351 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
1353 * strverscmp.c: Convert to UTF-8.
1355 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
1357 * obstack.h (obstack_empty_p):
1358 Don't assume that chunk->contents is suitably aligned.
1359 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
1360 Likewise. Problem reported by Benno in
1361 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
1363 * chown.c (rpl_chown): Work even if the file is writeable but not
1364 readable. This could be improved further but it'd take some work.
1366 2004-08-08 Simon Josefsson <jas@extundo.com>
1368 * xgethostname.c: Don't include error.h (not used).
1371 * getpass.c: Include getpass.h first.
1373 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
1375 * xalloc-die.c: New files.
1376 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
1378 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
1379 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
1380 (_, N_, xalloc_die): Move to xalloc-die.c.
1381 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
1382 so that we needn't mess with xalloc_msg_memory_exhausted.
1384 * sha1.h: Renamed from sha.h.
1385 (SHA1_H): Renamed from _SHA_H.
1386 (sha1_ctx): Renamed from sha_ctx.
1387 (sha1_init_ctx): Renamed from sha_init_ctx.
1388 (sha1_process_block): Renamed from sha_process_block.
1389 (sha1_process_bytes): Renamed from sha_process_bytes.
1390 (sha1_finish_ctx): Renamed from sha_finish_ctx.
1391 (sha1_read_ctx): Renamed from sha_read_ctx.
1392 (sha1_stream): Renamed from sha_stream.
1393 (sha1_buffer): Renamed from sha_buffer.
1394 * sha1.c: Likewise; renamed from sha.c.
1395 Do not include <sys/types.h>.
1396 Include <stddef.h> rather than <stdlib.h>.
1398 2004-08-08 Bruno Haible <bruno@clisp.org>
1400 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
1401 FILESYSTEM_PREFIX_LEN.
1402 * progreloc.c: Likewise.
1403 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
1405 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
1408 * argp-help.c (make_hol, hol_append): Don't assume that
1409 SIZE_MAX is a valid preprocessor constant.
1410 (__argp_basename): Change from "#ifndef _LIBC"
1411 to "#ifndef __argp_short_program_name", so that
1412 we don't compile these functions for tar.
1414 More merges from coreutils.
1415 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
1416 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
1418 * addext.c: Remove; no longer needed.
1419 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
1420 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
1421 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
1422 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
1423 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
1424 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
1425 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
1426 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
1427 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
1428 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
1429 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
1430 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
1431 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
1432 Import changes from coreutils.
1434 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
1436 Merge from coreutils.
1438 * .gdb-history: Remove; this doesn't belong here.
1440 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
1441 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
1442 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
1444 * dirname.h: Include <stdbool.h>.
1445 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
1446 for consistency with POSIX terminology. All uses changed.
1447 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
1448 (strip_trailing_slashes): Use bool for booleans.
1449 * stripslash.c (strip_trailing_slashes): Likewise.
1451 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1452 sometimes returns a positive errno value even when it succeeds.
1453 (print_errno_message) [!LIBC]: Fall back on strerror if
1456 * path-concat.c (mempcpy): Don't define if a system header defines it.
1457 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
1458 (longest_relative_suffix): New function.
1459 (path_concat): Use it. Assume first argument is not NULL.
1460 Port to DOS. Omit redundant separators.
1461 Report an error instead of returning NULL.
1462 Use mempcpy instead of memcpy.
1463 (xpath_concat): Remove: not declared or used.
1465 * same.h: Include <stdbool.h>
1466 (same_name): Return bool, not int.
1467 * same.c (same_name): Likewise.
1468 (errno): Don't declare; we assume C89 or better now.
1470 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
1471 if not already defined.
1473 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
1474 * dup-safer.c (errno): Likewise.
1476 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
1478 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
1481 2004-08-03 Simon Josefsson <jas@extundo.com>
1483 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
1484 * progname.h: Don't include stdbool.h.
1486 2004-08-02 Simon Josefsson <jas@extundo.com>
1488 * getsubopt.h: New file, with comments from Bruno Haible.
1489 * getsubopt.c: New file, from glibc, but slightly modified based on
1490 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
1492 2004-08-01 Simon Josefsson <jas@extundo.com>
1494 * xgetdomainname.c: Include stdlib.h, for free().
1496 2004-07-16 Simon Josefsson <jas@extundo.com>
1498 * dummy.c: New file.
1500 2004-07-16 Bruno Haible <bruno@clisp.org>
1502 * backupfile.h: Add extern "C" for C++.
1503 * closeout.h: Likewise.
1504 * copy-file.h: Likewise.
1505 * findprog.h: Likewise.
1506 * full-write.h: Likewise.
1507 * pathname.h: Likewise.
1508 * progname.h: Likewise.
1509 * stpcpy.h: Likewise.
1510 * stpncpy.h: Likewise.
1511 * strcase.h: Likewise.
1512 * strstr.h: Likewise.
1513 * xalloc.h: Likewise.
1515 * mbswidth.h: Add extern "C" for C++.
1516 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
1518 2004-07-09 Simon Josefsson <jas@extundo.com>
1520 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
1521 failed without this.)
1523 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
1525 * fchown-stub.c: New file.
1527 2004-06-24 Jim Meyering <jim@meyering.net>
1529 * obstack.h (obstack_base): Cast to (void *), per documentation.
1531 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
1533 * argz.c, argz_.h: New files, which are autoupdated from libtool.
1535 2004-06-01 Jim Meyering <jim@meyering.net>
1537 * calloc.c: New file.
1539 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
1541 * getdate.y (yylex): Allow space between sign and number.
1542 Problem reported by Dan Jacobson.
1544 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
1545 and Jim Meyering <jim@meyering.net>
1547 Merge from coreutils CVS.
1549 * stat-macros.h: New file, with contents from file-type.h
1550 and coreutils' system.h.
1551 * file-type.c: Include "stat-macros.h".
1552 * file-type.h (file_type): Move all macro definitions to new file,
1555 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
1556 Wrap old code with this conditional.
1557 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
1558 function that does not dereference symlinks.
1559 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
1561 * xreadlink.c: Include xreadlink.h first, to catch .h file
1562 dependency problems.
1563 (xreadlink): Accept new arg SIZE, for efficiency.
1564 All decls and uses changed.
1565 * xreadlink.h: Include <stddef.h>, for size_t.
1567 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
1568 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
1570 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
1572 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
1574 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
1575 macros to be defined.
1576 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
1577 the allocator returns NULL because the requested size is zero.
1579 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
1581 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
1582 var. Add comment explaining why libc still defines it. This
1583 merges the following patch from glibc:
1584 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
1586 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
1588 * obstack.c (_obstack): Remove unused variable. It hasn't been
1589 present in glibc since revision 1.1 of this file.
1590 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
1591 obstack_alignment_mask, obstack_alloc, obstack_base,
1592 obstack_blank, obstack_blank_fast, obstack_chunk_size,
1593 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
1594 obstack_grow0, obstack_init, obstack_int_grow,
1595 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
1596 obstack_next_free, obstack_object_size, obstack_ptr_grow,
1597 obstack_ptr_grow_fast, obstack_room): Remove declarations of
1598 nonexistent functions.
1600 2004-05-17 Derek R. Price <derek@ximbiot.com>
1601 Paul Eggert <eggert@cs.ucla.edu>
1603 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
1605 2004-05-14 Bruno Haible <bruno@clisp.org>
1607 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
1608 that consists of a '.' followed by an empty digit string.
1609 Patch by Tor Lillqvist <tml@iki.fi>.
1611 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
1613 Port obstack to the AS/400, where pointers are 16 bytes wide and
1614 you cannot cast an integer to a valid pointer. This patch is
1615 currently waiting to be integrated into glibc; see
1616 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
1618 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
1619 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
1620 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
1621 (struct obstack): temp member is now a union of a pointer and
1622 an integer, instead of an integer. All integer uses changed.
1623 This does not affect the physical layout of struct obstack,
1624 except on hosts (like the AS/400) where the size or alignment of
1625 void * is greater than that of ptrdiff_t.
1626 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
1627 __STDC__)]: Store temporary in pointer member of union, not
1629 * obstack.c: Include <stddef.h>, for offsetof.
1630 (struct fooalign): Remove; it doesn't need a name.
1631 (union fooround): Change double to long double, and add void *.
1632 (DEFAULT_ALIGNMENT): Use offsetof to compute.
1633 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
1634 not a macro. Hence the values are always int; so remove all
1635 casts-to-int in uses.
1637 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
1638 Derek Price <derek@ximbiot.com>
1640 * alloca.c: Include <alloca.h>, to get our interface.
1641 * alloca_.h: Use __alloca on AIX, so that we don't have to
1642 include <alloca.h> first. Use C89 prototype for alloca; this
1643 requires including <stddef.h> for size_t. Use extern "C" if C++.
1644 Use #elif for simplicity, since we can assume C89 now.
1645 Don't try to source the system alloca.h since it will not be found
1646 and to prevent recursively including its replacement.
1647 * fnmatch.c: Include <alloca.h> instead of opencoding.
1648 * regex.c: Likewise.
1650 2004-05-16 Derek Price <derek@ximbiot.com>
1651 Paul Eggert <eggert@cs.ucla.edu>
1653 getline cleanup. This changes the getndelim2 API: both order of
1654 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
1657 * getline.c: Don't include stddef.h or stdio.h, since our
1658 interface does that.
1659 (getline): Always use getdelim, so that we don't have two
1660 copies of this code.
1661 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
1663 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
1664 (GETNDELIM2_MAXIMUM): New macro.
1665 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
1666 instead of the old practice of delim2==0. All callers changed.
1667 Return -1 on overflow, instead of returning junk.
1668 Do not set *linesize unless allocation succeeds.
1669 * getndelim2.h: Do not include stddef.h; no longer needed, now
1670 that we include sys/types.h.
1671 * getnline.h: Likewise.
1672 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
1673 (getndelim2): Reorder arguments.
1674 * getnline.c (getnline, getndelim):
1675 Don't discard the NMAX argument.
1676 (getnline): Invoke getndelim, to avoid code duplication.
1677 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
1678 of (size_t) -1 by callers of the getnline family.
1680 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
1682 * nanosleep.c (suspended): Change its type from int to
1683 sig_atomic_t volatile.
1684 (first_call): Make it private to rpl_nanosleep, and have it
1685 be zero initially as that's a bit faster.
1686 (my_usleep): Round up fractional times instead of truncating them,
1687 as this is the usual meaning for 'sleep'.
1689 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
1691 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
1692 (ENOSYS): Define if not defined.
1693 (settime): Fall back on stime if it exists and settimeofday fails.
1694 But don't bother with fallbacks if a method fails with errno == EPERM.
1696 2004-05-11 Jim Meyering <jim@meyering.net>
1698 Prior to this change, the save_cwd caller required read access to the
1699 current directory on most systems (ones with the fchdir function).
1701 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
1702 fails, try write-only, and finally, resort to using xgetcwd.
1704 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
1706 * obstack.c, obstack.h: Import changes from libc.
1708 2004-04-28 Bruno Haible <bruno@clisp.org>
1710 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
1711 implicitly appends .exe to executables.
1712 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
1713 accepts Windows pathnames.
1714 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1715 Cygwin like Windows, since it now accepts Windows pathnames.
1716 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1717 Cygwin like Windows, since it now accepts Windows pathnames.
1718 Reported by Derek Robert Price <derek@ximbiot.com>.
1720 2004-04-20 Jim Meyering <jim@meyering.net>
1722 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
1724 2004-04-20 Jim Meyering <jim@meyering.net>
1725 Bruno Haible <bruno@clisp.org>
1727 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
1728 memory when realloc fails.
1730 2004-04-18 Jim Meyering <jim@meyering.net>
1732 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
1733 don't leak memory and do call END_UTMP_ENT.
1735 2004-04-11 Paul Eggert <eggert@twinsun.com>
1737 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
1738 (CHAR_BIT): Remove, since we assume C89.
1739 Include <stdint.h> if available, as per current Autoconf CVS advice.
1741 2004-03-30 Paul Eggert <eggert@twinsun.com>
1743 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
1744 not bool, to be more consistent with Unix conventions.
1745 Suggested by Bruno Haible.
1747 Merge from coreutils.
1749 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
1752 * getdate.h: Include stdbool.h, and timespec.h instead of
1753 the usual <time.h> dance.
1754 (get_date): Change signature to support fractional time stamps.
1755 All callers changed.
1756 * getdate.y: Include "getdate.h" first, as we can now
1757 assume C89 and don't need to worry about 'const'.
1758 Similarly, include "unlocked-io.h" near start, not in middle.
1760 (textint.value): Use long int rather than int.
1761 (textint.digits): Use size_t rather than int.
1762 (BILLION, LOG10_BILLION): New constants.
1763 (parser_control): New member rel_ns. Members day_ordinal,
1764 time_zone, month, day, hour, minutes, rel_year, rel_month,
1765 rel_day, rel_hour, rel_minutes, rel_seconds
1766 are now long int, not int. Member seconds is now struct timespec,
1767 not int. New member timespec_seen. Members dates_seen, days_seen,
1768 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
1770 (%union.intval): Now long int, not int.
1771 New member timespec.
1772 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
1773 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
1774 (spec): Now is a timespec or an item list.
1775 (timespec, items): New nonterminals.
1776 (time, rel, relunit, number, get_date):
1777 Add support for fractional seconds.
1778 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
1779 (gmtime, localtime, mktime): Remove decls; not needed with C89.
1780 (to_hour): First arg is now long int, not int.
1781 (to_year): Returns long int, not int.
1782 Don't treat year -70 like 70.
1783 (tm_diff): Returns long int, not int.
1784 (lookup_word): Use bool instead of int when appropriate.
1785 (yylex): Use size_t for count, not int.
1786 Detect overflow when parsing large integer constants.
1787 Add support for fractions.
1788 (get_date): Make pointers 'const' if possible.
1789 Use more-portable code to detect integer overflow.
1790 (main) [TEST]: Adjust to above changes. Test for localtime failure.
1791 Don't use ctime; it's not reliable if the year has >4 digits.
1793 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
1794 This is for compatibility with BSD.
1796 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
1797 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
1798 From coreutils' system.h.
1800 * userspec.c: Don't include "posixver.h".
1801 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
1802 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
1803 compatible extension. Simplify code by removing a boolean int
1804 that was always nonzero if a string was nonnull.
1806 2004-03-30 Jim Meyering <jim@meyering.net>
1808 Merge from coreutils.
1810 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
1812 * readtokens.c (readtoken): Don't leak 64 bytes when reading
1813 an empty input stream.
1815 * readtokens.c: Include <stdbool.h>.
1816 (readtoken): Use `size_t' rather than int/long.
1817 All callers adjusted.
1818 Use `bool' rather than `int' where appropriate.
1819 Use memset rather than an explicit loop.
1820 Use x2nrealloc rather than xrealloc.
1821 Allow the use of `\0' as a delimiter.
1822 (readtokens): Likewise.
1823 * readtokens.h (readtoken, readtokens): Update prototypes.
1825 2004-03-30 Bruno Haible <bruno@clisp.org>
1827 * getloadavg.c (getloadavg): Don't assume setlocale returns
1830 2004-03-29 Paul Eggert <eggert@twinsun.com>
1832 Merge changes to getloadavg.c from coreutils and Emacs.
1834 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
1835 Define to an expression, not to the empty string.
1836 Include cloexec.h and xalloc.h.
1837 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
1838 Use set_cloexec_flag rather than rolling our own.
1839 * cloexec.c, cloexec.h: New files.
1841 2004-03-18 Paul Eggert <eggert@twinsun.com>
1843 * getopt.h: Sync with libc CVS.
1845 2004-03-18 Paul Eggert <eggert@twinsun.com>
1846 Bruno Haible <bruno@clisp.org>
1848 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
1849 not on all platforms that have <wchar.h>.
1850 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
1852 2004-03-09 Paul Eggert <eggert@twinsun.com>
1854 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
1856 * getopt_int.h: New file, also synced from libc.
1858 2004-03-07 Paul Eggert <eggert@twinsun.com>
1860 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
1861 '#if' expressions. Unlike the code it replaces, it does not
1862 depend on (defined _SC_PAGESIZE). However, it does depend on
1863 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
1864 first reported by Jason Andrade in
1865 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
1867 2004-01-18 Simon Josefsson <jas@extundo.com>
1869 * strdup.h: New file.
1870 * strdup.c: Include it.
1871 * path-concat.c: Include strdup.h. Drop strdup declaration.
1872 * userspec.c: Include strdup.h. Drop strdup declaration.
1874 2004-02-06 Karl Berry <karl@gnu.org>
1876 * config.charset: update from gettext 0.14.1.
1878 2004-02-05 Paul Eggert <eggert@twinsun.com>
1880 Add comments and code, prompted by suggestions from Bruno Haible
1882 * quotearg.h (quotearg_alloc): New decl. Improve the comments
1883 describing the enum quoting_style values.
1884 * quotearg.c (quotearg_alloc): New function.
1885 (quotearg_buffer_restyled): Treat lone { and } as special.
1886 Treat = as special. Work around bug with older shells
1887 that "see" a '\' that is really the 2nd byte of a multibyte char.
1888 Quote empty string with shell_quoting_style.
1890 2004-02-03 Bruno Haible <bruno@clisp.org>
1892 * pipe.h: New file, from GNU gettext.
1893 * pipe.c: New file, from GNU gettext.
1895 2004-01-27 Bruno Haible <bruno@clisp.org>
1897 * execute.h: New file, from GNU gettext.
1898 * execute.c: New file, from GNU gettext.
1899 * w32spawn.h: New file, from GNU gettext.
1901 2004-01-23 Paul Eggert <eggert@twinsun.com>
1903 Exit-status fix from coreutils.
1905 Use exit_failure consistently in place of EXIT_FAILURE,
1906 so that program exit statuses are consistent on failure.
1908 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
1909 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
1910 * argmatch.h: Comment fix to match the above.
1911 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
1912 Now a macro referring to exit_failure, instead of a separate
1913 variable. Include "exitfail.h" to get it.
1914 * xstrtol.h: Include "exitfail.h".
1915 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
1917 * long-options.c (parse_long_options): Use prototype
1918 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
1921 2004-01-21 Jim Meyering <jim@meyering.net>
1923 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
1924 so as not to conflict with a different-sized __mktime_internal
1925 function in GNU libc.
1926 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
1927 Problem building statically-linked `ls' reported by Michael Brunnbauer.
1929 2004-01-18 Paul Eggert <eggert@twinsun.com>
1931 Merge from diffutils.
1933 * file-type.c (file_type): Add typed memory objects.
1934 * file-type.h (S_TYPEISTMO): New macro.
1936 * c-stack.h (c_stack_action): Remove argv argument.
1937 * c-stack.c (c_stack_action): Likewise. All uses changed.
1938 (die): Don't calculate message unless segv_action returns.
1939 (get_stack_location, min_address_from_argv, max_address_from_argv,
1940 volatile stack_base, volatile_stack_size): Remove.
1941 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
1942 that every segmentation violation is a stack overflow. (Ouch!)
1943 See Debian bug 136249 (still outstanding) for more info about why
1944 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
1946 2003-11-30 Bruno Haible <bruno@clisp.org>
1948 Safer stack allocation.
1949 * setenv.c: Include allocsa.h.
1950 (alloca): Remove fallback definition.
1951 (freea): Remove macro.
1952 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
1955 2003-10-17 Bruno Haible <bruno@clisp.org>
1957 * binary-io.h: Avoid warnings on Cygwin.
1959 2003-12-28 Bruno Haible <bruno@clisp.org>
1961 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
1962 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
1964 2003-11-28 Bruno Haible <bruno@clisp.org>
1966 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
1968 2003-11-27 Bruno Haible <bruno@clisp.org>
1970 * wait-process.c: On Windows, include windows.h. Needed on mingw.
1972 2003-11-17 Bruno Haible <bruno@clisp.org>
1974 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
1976 2003-11-24 Bruno Haible <bruno@clisp.org>
1978 * xallocsa.h: New file, from GNU gettext.
1979 * xallocsa.c: New file, from GNU gettext.
1981 2003-11-24 Bruno Haible <bruno@clisp.org>
1983 * allocsa.h: New file, from GNU gettext.
1984 * allocsa.c: New file, from GNU gettext.
1986 2003-11-24 Bruno Haible <bruno@clisp.org>
1988 * eealloc.h: New file.
1990 2004-01-15 Jim Meyering <jim@meyering.net>
1992 Merge from coreutils.
1994 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
1995 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
1996 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
1998 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
1999 optional configure-time default.
2001 * version-etc.c (version_etc_copyright): Update copyright date.
2003 * xreadlink.c (xreadlink): Correct outdated comment.
2005 2004-01-15 Paul Eggert <eggert@twinsun.com>
2007 Merge from coreutils.
2009 * posixver.c: Include posixver.h.
2011 * same.c: Include <stdbool.h>, <limits.h>.
2012 (_POSIX_NAME_MAX): Define if not defined.
2014 (same_name): If file names are silently truncated, report
2015 that the file names are the same if they are the same after
2016 the silent truncation.
2018 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
2019 conversion function.
2020 * xstrtod.c (xstrtod): Likewise. All callers changed to
2021 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
2024 2004-01-14 Paul Eggert <eggert@twinsun.com>
2026 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
2027 with like-named macro in fnmatch.c.
2028 (EXT): Use an internal constant instead.
2030 Merge fnmatch patches from glibc.
2031 * fnmatch.c (mbsinit): Remove define.
2032 Add libc_hidden_ver (__fnmatch, fnmatch).
2033 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
2034 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
2036 2003-12-14 Karl Berry <karl@gnu.org>
2038 * config.charset: update from gettext-runtime.
2040 2003-12-03 Paul Eggert <eggert@twinsun.com>
2042 * getgroups.c (getgroups): xmalloc takes one argument, not two.
2043 Bug reported by Alfred M. Szmidt.
2045 2003-11-29 Karl Berry <karl@gnu.org>
2047 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
2049 2003-11-23 Paul Eggert <eggert@twinsun.com>
2050 Bruno Haible <bruno@clisp.org>
2052 * printf-parse.h: Don't include sys/types.h.
2053 (ARG_NONE): New macro.
2054 (char_directive): Change type of *arg_index fields to size_t.
2055 * printf-parse.c: Don't include sys/types.h.
2056 (SSIZE_MAX): Remove macro.
2057 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
2058 Remove unnecessary overflow check.
2059 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
2062 2003-11-24 Paul Eggert <eggert@twinsun.com>
2064 * alloca.c: Remove dependency on xalloc module.
2065 (xalloc_die): Remove.
2066 (memory_full) [!defined emacs]: New macro.
2067 [!defined emacs]: Don't include xalloc.h.
2068 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
2069 address arithmetic overflows. Change datatypes a bit to avoid
2072 2003-11-22 Jim Meyering <jim@meyering.net>
2074 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
2076 2003-11-17 Bruno Haible <bruno@clisp.org>
2078 * vasnprintf.c (alloca): Remove fallback definition.
2079 (freea): Remove definition.
2080 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
2081 Reported by Paul Eggert.
2083 2003-11-17 Jim Meyering <jim@meyering.net>
2085 On systems without utime and without a utimes function capable of
2086 dealing with a NULL struct utimbuf* argument, this utime replacement
2087 could -- in unusual circumstances -- leak a file descriptor.
2088 * utime.c: Include <unistd.h> and <errno.h>.
2089 (utime_null): Be sure to close `fd' and to preserve errno.
2090 Reported by Geoff Collyer via Arnold Robbins.
2092 2003-11-16 Paul Eggert <eggert@twinsun.com>
2093 Bruno Haible <bruno@clisp.org>
2095 Protect against address arithmetic overflow.
2096 * printf-args.h: Include stddef.h.
2097 (arguments): Change type of field 'count' to size_t.
2098 * printf-args.c (printf_fetchargs): Use size_t instead of
2099 'unsigned int' where appropriate.
2100 * printf-parse.h: Include sys/types.h.
2101 (char_directive): Change type of *arg_index fields to ssize_t.
2102 (char_directives): Change type of fields 'count', max_*_length to
2104 * printf-parse.c: Include sys/types.h and xsize.h.
2105 (SSIZE_MAX): Define fallback value.
2106 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
2107 instead of 'int' where appropriate. Check a_allocated, d_allocated
2108 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
2109 * vasnprintf.c: Include xsize.h.
2110 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
2111 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
2112 overflow. Avoid wraparound when converting a width or precision from
2115 2003-11-16 Bruno Haible <bruno@clisp.org>
2117 Update from GNU gettext.
2118 * printf-parse.c: Generalize to it can be compiled for wide strings.
2119 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
2120 * vasnprintf.c: Generalize to it can be compiled for wide strings.
2121 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
2122 SNPRINTF): New macros.
2123 Don't include <alloca.h> if the file is used inside libintl.
2124 (local_wcslen): New function, for Solaris 2.5.1.
2125 (VASNPRINTF): Use it instead of wcslen.
2127 2003-11-16 Bruno Haible <bruno@clisp.org>
2129 * xsize.h (xmax): New function.
2130 (xsum, xsum3, xsum4): Declare as "pure" functions.
2132 2003-11-12 Paul Eggert <eggert@twinsun.com>
2134 * xalloc.h: Do not include <limits.h> or <stdint.h>.
2135 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
2136 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
2137 heuristic is just as accurate as far as we know, and it removes a
2138 dependency on size_max.m4 and ptrdiff_max.m4.
2140 2003-11-12 Paul Eggert <eggert@twinsun.com>
2142 * xstrtol.c (__xstrtol): Remove "break" immediately after
2143 "return", to pacify some unknown compiler. Problem reported
2146 2003-11-11 Bruno Haible <bruno@clisp.org>
2148 * xsize.h (SIZE_MAX): Remove fallback definition.
2149 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
2152 2003-11-10 Paul Eggert <eggert@twinsun.com>
2154 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
2155 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
2156 rejected some allocations of exactly SIZE_MAX - 2 bytes.
2158 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
2159 not (size_t) -1, since it's defined here.
2161 2003-11-06 Paul Eggert <eggert@twinsun.com>
2163 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
2164 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
2165 Reject sizes of exactly SIZE_MAX bytes.
2166 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
2167 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
2169 2003-11-05 Bruno Haible <bruno@clisp.org>
2171 * xsize.h: Include limits.h, to avoid a possible collision with
2172 SIZE_MAX defined in <limits.h> on Solaris.
2174 2003-11-04 Bruno Haible <bruno@clisp.org>
2176 * xsize.h: New file.
2177 * linebreak.c: Include xsize.h.
2178 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
2179 argument for overflow.
2180 Suggested by Paul Eggert.
2182 2003-10-31 Bruno Haible <bruno@clisp.org>
2184 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
2185 to avoid (extremely rare) race condition.
2186 Suggested by Paul Eggert.
2188 2003-11-03 Jim Meyering <jim@meyering.net>
2190 * userspec.c: Include "userspec.h".
2191 * userspec.h: New file.
2193 2003-10-31 Paul Eggert <eggert@twinsun.com>
2195 * mountlist.h (struct mount_entry.me_type_malloced): New member.
2196 * mountlist.c (SIZE_MAX): Define if not defined already.
2197 (read_filesystem_list): Set and use me_type_malloced.
2198 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
2199 whatever the type happens to be), for brevity and consistency.
2200 Check for size calculation overflow on Alphas running OSF/1.
2202 2003-10-31 Jim Meyering <jim@meyering.net>
2204 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
2206 * linebuffer.c: Include <string.h> for declaration of memset.
2208 2003-10-30 Paul Eggert <eggert@twinsun.com>
2209 Bruno Haible <bruno@clisp.org>
2211 * vasprintf.c: Include <limits.h>, <stdlib.h>.
2212 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
2214 2003-10-29 Paul Eggert <eggert@twinsun.com>
2216 * xalloc.h (xalloc_oversized): Now a macro, not a function,
2217 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
2219 * quotearg.c (quotearg_n_options): Use it.
2220 * group-member.c: Include <stdbool.h>.
2221 (free_group_info): Arg is now const *; don't free arg.
2222 (get_group_info): Now returns bool and accepts struct group_info *,
2223 rather than returning a malloc'ed struct group_info *.
2224 All uses changed. Check for overflow in internal size calculation.
2226 * getusershell.c (readname): Simplify the code by using x2nrealloc
2227 rather than xmalloc/xrealloc.
2228 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
2229 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
2230 conformance bug: the old code used a pointer after freeing the
2231 storage that it addressed.
2232 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
2233 rather than doing it by hand.
2234 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
2235 the buffer preserved. Use free and xmalloc instead.
2236 * quotearg.c (quotearg_n_options): Likewise.
2237 Use a simpler test for size overflow. Don't use xalloc_oversized
2238 because unsigned int might be wider than size_t (!); this suggests
2239 that we should switch from unsigned int to size_t for slot numbers.
2241 2003-10-27 Bruno Haible <bruno@clisp.org>
2243 * stdbool_.h: Better support for BeOS.
2245 2003-10-27 Paul Eggert <eggert@twinsun.com>
2247 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
2248 to allocate the returned structure. Do not allocate a subarray,
2249 as x2nrealloc will do that.
2250 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
2251 instead of xnrealloc.
2252 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
2254 2003-10-26 Paul Eggert <eggert@twinsun.com>
2256 * xalloc.h (xalloc_oversized): New static inline function, for
2257 callers that want to do their own size-overflow checking. Include
2258 <stdbool.h>, since xalloc_oversized returns bool.
2259 * xalloc.c (array_size_overflow): Remove. All callers changed
2260 to use xalloc_oversized.
2262 Add two functions x2realloc, x2nrealloc, for programs that grow
2263 arrays dynamically by doubling their sizes.
2264 * xalloc.h (x2realloc, x2nrealloc): New decls.
2265 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
2268 Port to C99 semantics for 'inline' of external functions.
2269 Bug reported by Bruno Haible.
2270 * xmalloc.c (xnmalloc_inline): New static inline function,
2271 with the old contents of xnmalloc.
2272 (xnmalloc, xmalloc): Use it.
2273 (xnrealloc_inline): New static inline function,
2274 with the old contents of xnrealloc.
2275 (xnrealloc, xrealloc): Use it.
2277 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
2279 2003-10-25 Paul Eggert <eggert@twinsun.com>
2281 Fix several address-calculation bugs in the hash modules,
2282 plus some minor code cleanup.
2284 * hash.h: Include <stdbool.h>, for bool.
2285 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
2286 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
2287 hash_get_n_entries, hash_get_max_bucket_length,
2288 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
2289 hash_rehash): Use size_t rather than unsigned.
2290 * hash.c (struct hash_table, hash_get_n_buckets,
2291 hash_get_n_buckets_used, hash_get_n_entries,
2292 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
2293 hash_get_entries, hash_do_for_each, hash_string, is_prime,
2294 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
2296 (SIZE_MAX): Define if not defined.
2297 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
2298 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
2300 Use const * when possible.
2301 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
2302 (check_tuning): Fix bug: if tuning parameters were very close to
2303 0 or 1, rounding errors could have caused subscript violations.
2304 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
2305 (hash_initialize): Add 'fail:' label
2306 to free table and return NULL, and use it to simplify code.
2307 Use calloc rather than clearing the storage ourself.
2308 (hash_initialize, hash_rehash): Check for arithmetic overflow in
2309 buffer size calculations.
2310 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
2311 Include <stddef.h>, for size_t.
2312 * hash-pjw.c (hash_pjw): Likewise.
2313 Switch to method described by Bruno Haible.
2314 Include <limits.h>, for CHAR_BIT.
2315 (SIZE_BITS): New macro.
2317 2003-10-21 Paul Eggert <eggert@twinsun.com>
2319 * getndelim2.c (getndelim2): When size calculation overflows,
2320 ceiling the allocation at NMAX bytes rather than silently
2321 discarding input bytes before NMAX is reached. This makes
2322 a difference only if NMAX exceeds SIZE_MAX / 2.
2324 * obstack.c: Merge from glibc.
2325 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
2326 Add libc_hidden_def (_obstack_newchunk).
2327 (_obstack_free) [! defined _LIBC]: Remove.
2328 [defined _LIBC]: Make a strong alias from obstack_free, rather than
2329 a clone of the function body.
2330 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
2331 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
2333 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
2334 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
2337 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
2338 (obstack_ptr_grow_fast, obstack_int_grow_fast):
2339 Don't use lvalue casts, as GCC plans to remove support for them
2340 in GCC 3.5. Reported by Joseph S. Myers. This bug
2341 was also present in the non-GCC version, indicating that this
2342 code had always been buggy and had never been widely used.
2343 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
2344 Use the fast variant of each macro, rather than copying the
2345 definiens of the fast variant; that way, we'll be more likely to
2346 catch future bugs in the fast variants.
2348 2003-10-20 Bruno Haible <bruno@clisp.org>
2350 * wait-process.h: New file, from GNU gettext.
2351 * wait-process.c: New file, from GNU gettext.
2353 2003-10-19 Jim Meyering <jim@meyering.net>
2355 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
2357 2003-10-16 Paul Eggert <eggert@twinsun.com>
2359 * getgroups.c: Include <errno.h>, <stdlib.h>.
2360 (getgroups): First arg is int, not size_t.
2361 Don't let 'free' mangle errno.
2363 2003-10-16 Jim Meyering <jim@meyering.net>
2365 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
2367 2003-10-15 Paul Eggert <eggert@twinsun.com>
2369 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
2371 (new_exclude, add_exclude_file): Initial size no longer needs to
2373 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
2374 our own address arithmetic overflow checking.
2376 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
2377 (fnmatch): Do not alloca more than 2000 wide characters;
2378 instead, use malloc for large buffers.
2379 Check for address arithmetic overflow, and return -1
2380 with errno set to ENOMEM in that case.
2381 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
2382 (NEW_PATTERN): Do not alloca more than 8000 bytes;
2383 instead, return -1. Check for address arithmetic overflow.
2385 2003-10-14 Paul Eggert <eggert@twinsun.com>
2387 Handle invalid suffixes and overflow independently, so that
2388 callers can treat them independently as needed. Fix some bugs in
2389 suffix handling, e.g., "100k@" was not diagnosed as an invalid
2390 suffix for a human-readable blocksize. The major caller-visible
2391 change is the addition of a new
2392 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
2393 that both overflow and suffix chars were found.
2395 * human.c (humblock): Don't check separately for invalid suffix
2396 char; that is xstrtoumax's job (now that its bug is fixed).
2397 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
2398 INTMAX_MAX]: New macros.
2399 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
2400 TYPE_MAXIMUM): New macros.
2401 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
2402 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
2403 if overflow occurs, as it's what __strtol does and it's more useful
2405 (__xstrtol): If __strtol reports some error other than ERANGE,
2406 reflect it to the caller as LONGINT_INVALID. If it reports
2407 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
2408 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
2409 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
2411 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
2412 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
2413 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
2414 [defined UINTMAX_MAX]: New macros.
2416 2003-10-14 Bruno Haible <bruno@clisp.org>
2418 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
2419 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
2420 Also use volatile where needed.
2422 2003-10-12 Paul Eggert <eggert@twinsun.com>
2424 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
2425 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
2426 and define in terms of the other primitives.
2427 * xmalloc.c: Include stdbool.h; do not include exit.h.
2428 (SIZE_MAX): Define if not already defined.
2429 (array_size_overflow): New function.
2430 (xalloc_die): Abort instead of exiting if 'error' returns.
2431 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
2432 (xmalloc, xrealloc): Use them.
2433 (xcalloc): Check for address arithmetic overflow.
2434 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
2435 a bit faster than strcpy.
2437 2003-10-08 Paul Eggert <eggert@twinsun.com>
2439 Merge getpass from libc, plus a few fixes.
2441 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
2442 Include <stdbool.h>.
2443 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
2444 __fsetlocking to empty.
2445 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
2446 do include <bits/libc-lock.h>.
2447 Do not include <fcntl.h>; not needed.
2448 [_LIBC]: Include <wchar.h>.
2449 (NOTCANCEL_MODE): New macro.
2450 (flockfile, funlockfile) [_LIBC]: New macros.
2451 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
2452 [!_LIBC]: New macros.
2453 (call_fclose): New function.
2454 (getpass): Use it. Save tty stream separately; this simplifies the
2455 code and makes it more reliable if stdin happens to equal stdout.
2456 Invoke __fsetlocking on tty.
2457 Handle thread cancellation if needed.
2458 Namespace cleanup (use __tcgetattr, __getline).
2459 Use bool for Booleans.
2460 [USE_IN_LIBIO]: Handle wide streams.
2461 [!_LIBC]: Unconditionally do the fseek, since we don't know what
2462 stream might go where.
2464 * unlocked-io.h: Include <stdio.h>, so that the caller
2465 doesn't have to include <stdio.h> before us.
2466 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2467 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2468 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2469 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2470 if not declared, so that we can use getpass.c code from libc without
2472 (flockfile, ftrylockfile, funlockfile): New macros.
2474 2003-10-06 Bruno Haible <bruno@clisp.org>
2476 * version-etc-2.h: Remove file.
2477 * version-etc-2.c: Remove file.
2479 2003-09-25 Jim Meyering <jim@meyering.net>
2480 Bruno Haible <bruno@clisp.org>
2482 This lets translators provide better translations for the
2483 "Written by ..." part of --version output.
2484 * version-etc.h: Include stdarg.h.
2485 (version_etc_copyright): Declare as readonly.
2486 (version_etc): Make this function variadic with a NULL-terminated list
2487 of author name strings.
2488 (version_etc_va): New declaration.
2489 * version-etc.c: Include stdarg.h, stdlib.h.
2490 (version_etc_copyright): Declare as readonly.
2491 (version_etc_va): New function. Provide a different translatable string
2492 for each possible number of authors < 10. Abbreviate when there are 10
2494 (version_etc): Make this function variadic. Call version_etc_va.
2495 Suggestion from Gary V. Vaughan.
2497 * long-options.h (parse_long_options): Change prototype: the authors
2498 string is moved to the end and becomes variadic.
2499 * long-options.c: Include stdarg.h.
2500 (parse_long_options): Make this function variadic, too.
2501 Call version_etc_va, not version_etc.
2503 2003-10-06 Bruno Haible <bruno@clisp.org>
2505 * fatal-signal.h: New file, from GNU gettext.
2506 * fatal-signal.c: New file, from GNU gettext.
2508 2003-10-04 Karl Berry <karl@gnu.org>
2510 * argp*: update from libc.
2512 2003-10-01 Larry Jones <lawrence.jones@eds.com>
2514 * getpass.c (getpass): Use a no-op fseek when switching from input to
2515 output mode on the same stream.
2517 2003-09-29 Paul Eggert <eggert@twinsun.com>
2519 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
2520 Fix arg typo in previous patch.
2522 2003-09-28 Jim Meyering <jim@meyering.net>
2524 * error.c: Correct cpp indentation.
2526 2003-09-27 Paul Eggert <eggert@twinsun.com>
2528 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
2529 Omit the special code that used __typeof__, since we worry that
2530 it could be more trouble than it's worth. See:
2531 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
2532 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
2536 2003-09-26 Jim Meyering <jim@meyering.net>
2538 * error.c (error_tail): Move some declarations
2539 into inner scope where the local variables are used.
2541 2003-09-26 Bruno Haible <bruno@clisp.org>
2543 * stpncpy.h (gnu_stpncpy): New declaration.
2544 (stpncpy): Define as alias for gnu_stpncpy.
2545 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
2547 2003-09-26 Paul Eggert <eggert@twinsun.com>
2549 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
2550 (error_tail): Do not loop, reallocating temporary buffer, since
2551 the output cannot contain more wide characters than the input
2552 contains bytes, the size must be big enough already. This avoids
2553 one potential size overflow calculation. Check for size overflow
2554 when calculating temporary buffer size. Free temporary buffer
2555 when done, if it was allocated with malloc; this plugs a memory
2556 leak. Remove casts from void * to pointers, that are no longer
2557 needed now that we're assuming C89 or better.
2559 Merge error changes from glibc.
2561 * error.c, error.h: Update copyright notice header to match glibc.
2562 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
2563 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
2564 Disable cancellation while printing error.
2565 * error.h: Prepend __ to parameter names.
2567 2003-09-25 Karl Berry <karl@gnu.org>
2569 * argp-fmtstream.c, argp-help.c: update from libc.
2571 2003-09-25 Bruno Haible <bruno@clisp.org>
2573 * version-etc-2.h: New file, from version-etc.h with modifications.
2574 * version-etc-2.c: New file, from version-etc.c with modifications.
2576 2003-09-25 Simon Josefsson <jas@extundo.com>
2578 * xgetdomainname.h: New file.
2579 * xgetdomainname.c: New file.
2581 2003-09-25 Simon Josefsson <jas@extundo.com>
2582 Bruno Haible <bruno@clisp.org>
2584 * getdomainname.h: New file.
2585 * getdomainname.c: New file.
2587 2003-09-24 Paul Eggert <eggert@twinsun.com>
2589 * linebuffer.c (freebuffer): Don't free the argument, just
2590 the buffer associated with the argument. Bug reported by
2593 2003-09-19 Karl Berry <karl@gnu.org>
2595 * argp.h: update from libc.
2597 2003-09-16 Paul Eggert <eggert@twinsun.com>
2599 * linebuffer.c (readlinebuffer): Return NULL immediately upon
2600 input error, instead of returning NULL the next time we are called
2601 (and therefore losing track of errno).
2603 2003-09-15 Paul Eggert <eggert@twinsun.com>
2605 * getndelim2.c (getndelim2): Don't trash errno when a read
2606 fails, so that the caller gets the proper errno.
2608 * readutmp.c (read_utmp): Likewise.
2609 Check for fstat error. Close stream and free storage
2612 2003-09-14 Bruno Haible <bruno@clisp.org>
2614 * fwriteerror.h: New file.
2615 * fwriteerror.c: New file.
2617 2003-09-14 Jim Meyering <jim@meyering.net>
2619 * getloadavg.c: Correct cpp indentation.
2620 * strdup.c: Likewise.
2621 * vasnprintf.c: Likewise.
2623 2003-09-12 Paul Eggert <eggert@twinsun.com>
2625 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
2626 * obstack.c [!defined _LIBC]: Likewise.
2627 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
2628 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
2629 * exitfail.c: Don't include stdlib.h; no longer needed.
2631 More changes to assume C89 or better.
2633 * error.c (error_tail): Assume vprintf.
2635 * argmatch.c (getenv): Remove decl.
2636 * progreloc.c (get_full_program_name): Define via prototype.
2637 * setenv.c (clearenv): Likewise.
2638 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
2640 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
2641 (malloc, memcpy): Remove decls.
2642 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
2643 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
2644 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2645 (memcpy): Remove macro.
2646 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
2647 (__P): Remove. All uses removed.
2648 (PTR): Remove. All uses changed to void *.
2649 (CHAR_BIT, NULL): Remove.
2650 (spaces, zeros, memset_space, memset_zero)
2651 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
2653 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
2654 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
2655 Define with prototype.
2656 Remove now-unnecessary prototype decl.
2657 (extra_args_spec): Assume ANSI C. All uses changed.
2658 (extra_args_spec_iso): Remove.
2659 (my_strftime, emacs_strftimeu): Define via prototype.
2660 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
2662 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
2663 * strtoimax.c: Include <stdlib.h> unconditionally.
2664 (strtoul, strtol): Remove decls.
2665 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
2667 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2668 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
2669 (LOCALE_PARAM_PROTO): New macro.
2670 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
2671 (INTERNAL (strtol), strtol): Define with a prototype.
2672 (PARAMS): Remove. All uses removed.
2673 * tempname.c: Include <string.h> unconditionally.
2674 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
2675 * xgethostname.c (main): Define with a prototype.
2676 * xmalloc.c: Include "xalloc.h" first, to check interface.
2677 Include <stdlib.h> unconditionally.
2678 (calloc, malloc, realloc, free): Remove decls.
2679 * xstrtod.c: Include "xstrtod.h" first, to check interface.
2680 Include <stdlib.h> unconditionally. Sort include file names.
2682 (xstrtod): Define with a prototype.
2683 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
2684 (strtol, strtoul): Remove decls.
2686 2003-09-11 Paul Eggert <eggert@twinsun.com>
2688 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
2689 Include <stdlib.h>, <string.h> unconditionally.
2690 Remove now-unnecessary cast to char *.
2691 * strnlen.c: Include <string.h> unconditionally.
2692 * yesno.c (yesno): Define with a prototype.
2694 2003-09-10 Bruno Haible <bruno@clisp.org>
2696 * strcspn.c: Include <string.h> unconditionally.
2697 * strpbrk.c: Include <string.h> unconditionally.
2698 * strstr.c: Include <string.h> unconditionally.
2699 * unicodeio.c: Include <string.h> unconditionally.
2700 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
2701 * unsetenv.c: Likewise.
2702 * xreadlink.c: Include <stdlib.h> unconditionally.
2703 * yesno.c: Include <stdlib.h> unconditionally.
2704 (rpmatch): Add prototype.
2706 2003-09-10 Jim Meyering <jim@meyering.net>
2708 * error.c: Correct indentation of cpp directives.
2710 2003-09-09 Paul Eggert <eggert@twinsun.com>
2714 * acosl.c (main): Use a prototype.
2715 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
2718 * getloadavg.c (getloadavg, main): Define via prototypes.
2720 * getopt.h (struct option.name): Assume C89, and use 'const'.
2721 (getopt, etopt_long, getopt_long_only, _getopt_internal)
2722 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
2724 * getopt.c (const): Remove macro.
2725 Include <string.h> unconditionally.
2726 (my_index): Remove; all uses changed to strchr.
2727 (strlen): Remove decl.
2728 (exchange): Remove forward decl; no longer needed.
2729 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
2730 Define with prototype.
2731 * getopt1.c (const): Remove macro.
2732 (getopt_long, getopt_long_only, main): Define with prototype.
2734 * getugroups.c: Include <string.h> unconditionally.
2736 * getusershell.c: Include <stdlib.h> unconditionally.
2737 (getusershell, setusershell, endusershell, readname, main):
2738 Define with prototypes.
2740 * group-member.c: Include group-member.h first.
2741 Include <stdlib.h> unconditionally.
2743 * hard-locale.c: Include hard-locale.h first.
2744 Include <stdlib.h>, <string.h> unconditionally.
2746 * hash.c (free, malloc): Remove decls.
2747 Include <stdlib.h> unconditionally.
2749 * human.c: Include <stdlib.h>, <string.h> unconditionally.
2750 (getenv): Do not declare.
2752 * idcache.c: Include <string.h> unconditionally.
2754 * long-options.c: Include long-options.h first, to test interface.
2755 Include <stdlib.h> unconditionally.
2757 * makepath.c: Include makepath.h first, to test interface.
2758 Include <stdlib.h> and <string.h> unconditionally.
2760 * linebuffer.c: Include <stdlib.h>.
2761 (free): Remove decl.
2763 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
2764 rpl_malloc returns void *, not char *.
2765 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
2767 * md5.h: Include <limits.h> unconditionally.
2768 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
2769 (__P): Remove; all uses removed.
2770 * md5.c: Include "md5.h" first.
2771 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
2772 md5_buffer, md5_process_bytes, md5_process_block):
2773 Define with prototypes.
2774 * sha.h (__P): Remove all uses. (It wasn't defined??)
2775 * sha.c: Include "sha.h" first.
2776 Include <stdlib.h>, <string.h> unconditionally.
2778 * memchr.c (__ptr_t): Remove; all uses changed to void *.
2779 * memcmp.c (__ptr_t): Likewise.
2780 * memrchr.c (__ptr_t): Likewise.
2781 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
2782 Include <string.h> unconditionally.
2783 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
2784 * memchr.c: Include <stdlib.h> unconditionally.
2785 * memchr.c (LONG_MAX): Remove.
2786 * memrchr.c (LONG_MAX): Likewise.
2787 * memchr.c (__memchr): Define via a prototype.
2788 * memrchr.c (__memrchr): Likewise.
2789 * memcmp.c (__P): Remove, and remove all uses.
2790 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
2791 Remove forward decls; no longer needed.
2792 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
2793 Use types required by C89 in prototype.
2795 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
2796 * savedir.c: Likewise.
2797 * mkdir.c (free): Remove decl.
2798 * rmdir.c (rmdir): Define with a prototype.
2799 * savedir.c: Include savedir.h first, to test interface.
2801 * mktime.c (STDC_HEADERS): Remove.
2802 Include <stdlib.h>, <string.h> unconditionally.
2804 * modechange.c: Include <stdlib.h> unconditionally.
2805 (malloc): Remove decl.
2807 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
2808 (free): Remove decl.
2810 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
2811 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
2812 (This type really should be intptr_t, but that's a C99ism.)
2813 (_obstack_memcpy): Remove: all uses changed to memcpy.
2814 Include <string.h> unconditionally.
2815 (struct obstack): Assume __STDC__ for types of members
2816 chunkfun, freefun, extra_arg.
2817 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
2818 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
2819 obstack_begin, obstack_specify_allocation,
2820 obstack_specify_allocation_with_arg, obstack_chunkfun,
2821 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
2822 Remove unprototyped decls and the macros that use them.
2823 * obstack.c (POINTER): Remove. All uses changed to void *.
2824 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
2825 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
2826 (defined __STDC__ && __STDC__)]:
2827 Remove nonprototyped code.
2828 Include <stdlib.h> unconditionally.
2829 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
2830 _obstack_allocated_p, _obstack_free, obstack_free,
2831 _obstack_memory_used, print_and_abort):
2832 Define using prototypes.
2833 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
2834 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
2835 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
2836 obstack_next_free, obstack_object_size, obstack_room) [0]:
2837 Remove unused, unprototyped code.
2839 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
2841 * physmem.c (physmem_total, physmem_available, main): Define
2844 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
2845 (main): Define with a prototype.
2847 * posixver.c (getenv): Remove decl.
2849 * putenv.c (malloc): Returns void *, not char *.
2850 Include <string.h> unconditionally.
2851 (strchr, memcpy, NULL): Do not define.
2853 * readtokens.c: Include readtokens.h first, to test interface.
2854 Include <stdlib.h>, <string.h> unconditionally.
2855 (init_tokenbuffer): Define with a prototype.
2857 * regex.c (PARAMS): Remove. All uses removed.
2858 All uses of _RE_ARGS removed, too.
2859 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2861 (bzero): Assume memset exists.
2862 (memcmp, memcpy, NULL): Remove.
2863 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
2864 char, or assignments to local vars of type signed char.
2865 (init_syntax_once, PREFIX(extract_number_and_incr),
2866 PREFIX(print_partial_compiled_pattern),
2867 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
2868 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
2869 PREFIX(regex_grow_registers), PREFIX(regex_compile),
2870 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
2871 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
2872 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
2873 wcs_compile_range, byte_compile_range, truncate_wchar,
2874 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
2875 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
2876 count_mbs_length, wcs_re_match_2_internal,
2877 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
2878 PREFIX(alt_match_null_string_p),
2879 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
2880 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
2881 regfree, PREFIX(extract_number)): Define with prototype. Remove
2882 now-unnecessary declaration, if any.
2883 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
2885 Remove now-unnecessary casts among pointer types.
2886 * regex.h (_RE_ARGS): Remove. All uses removed.
2888 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
2889 (free): Remove decl.
2891 * rpmatch.c: Include <stdlib.h> unconditionally.
2893 * same.c: Include <stdlib.h>, <string.h> unconditionally.
2894 (free): Remove decl.
2896 * save-cwd.c: Include <stdlib.h> unconditionally.
2897 * xgetcwd.c: Likewise.
2899 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
2900 (free): Remove decl.
2902 * strchrnul.c (strchrnul): Define with a prototype.
2903 Fix bug: c_in was not converted to char before searching.
2905 The following changes are not K&R related:
2907 * group-member.h: Include <sys/types.h>, so that this file is
2909 * makepath.h: Likewise.
2911 * getusershell.c (readname, default_index, line_size, readname):
2912 Use size_t, not int, for sizes.
2913 (readname): If the size overflows, report an error instead of
2916 2003-09-09 Derek Robert Price <derek@ximbiot.com>
2918 * getndelim2.c: Assume stdlib.h per the C89 spec.
2920 2003-09-08 Paul Eggert <eggert@twinsun.com>
2922 Assume C89 or better; remove K&R cruft.
2923 A few of these changes were first proposed by Derek Robert Price
2924 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
2926 * addext.c: Include <string.h> unconditionally.
2927 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
2928 Don't declare getenv or malloc.
2930 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
2931 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
2933 (find_stack_direction, alloca): Use prototypes.
2935 * atexit.c (atexit): Define using a prototype.
2937 * basename.c, dirname.c, stripslash.c:
2938 Include <string.h> unconditionally.
2940 * bcopy.c: Include <stddef.h>.
2941 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
2943 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
2945 * error.h (error, error_at_line, error_print_progname)
2946 [! (defined (__STDC__) && __STDC__)]: Remove decls.
2947 * error.c: Include error.h first, to check interface.
2948 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
2949 (VA_START): Remove; all uses changeed to va_start.
2950 (exit, strerror): Remove decls.
2951 (error_print_progname): Prototype uncondionally.
2952 Don't include <errno.h>; no longer needed.
2953 (private_strerror): Remove.
2954 (error_tail): Always define.
2955 (error, error_at_line): Assume C89 or better; always use prototypes.
2956 * fatal.c: Include "fatal.h" first, to test interface.
2957 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
2958 (VA_START): Remove; all uses changed to va_start.
2959 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
2961 (exit): Remove decl.
2962 (fatal): Prototype unconditionally. Assume va_start works.
2963 Abort at end, to pacify gcc.
2965 * euidaccess.c (main): Define with a prototype.
2967 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
2969 * exitfail.c: Include <stdlib.h> unconditionally.
2971 * fnmatch_.h (__P): Remove. All uses changed to assume
2973 * fnmatch.c: Include fnmatch.h first, to test interface.
2974 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
2975 (getenv): Remove decl.
2976 (fnmatch): Define using a prototype.
2977 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
2978 (FCT): Define using a prototype.
2980 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
2982 * gethostname.c: Include <stddef.h>.
2983 (gethostname): Define with prototype. Length is size_t, not int.
2985 2003-09-08 Paul Eggert <eggert@twinsun.com>
2987 * getversion.c: Remove; was migrated to backupfile.c in 1997.
2988 getversion.c should have been removed then, but was accidentally
2991 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
2992 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
2994 2003-09-07 Paul Eggert <eggert@twinsun.com>
2996 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
2997 copy_tm_result. Bug reported by Simon Josefsson in
2998 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
3000 2003-09-06 Paul Eggert <eggert@twinsun.com>
3002 * time_r.c, time_r.h: New files.
3004 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
3006 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
3007 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
3009 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
3011 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
3012 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
3015 * timegm.c: Switch to glibc implementation, with the following changes:
3016 [defined HAVE_CONFIG_H]: Include <config.h>.
3017 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
3018 (__mktime_internal) [!defined _LIBC]: New decl.
3019 (__gmtime_r) [!defined _LIBC]: New macro and function.
3020 (timegm): Use a prototype, since gnulib assumes C89.
3021 Do not bother declaring tmp to be const, as it's not really usefu.
3022 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
3023 (timegm): Declare only if HAVE_DECL_TIMEGM.
3025 2003-09-03 Paul Eggert <eggert@twinsun.com>
3027 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
3028 Bug reported by Lute Kamstra in
3029 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
3031 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
3032 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
3033 course with correspondingly smaller numbers for tomorrow and
3034 yesterday. From Tadayoshi Funaba. Originally installed into
3035 sh-utils on 1999-08-07, but the patch got lost (I guess during the
3038 2003-08-31 Simon Josefsson <jas@extundo.com>
3040 * timegm.h: New file.
3041 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
3043 2003-08-31 Karl Berry <karl@gnu.org>
3045 * argp.h: update from libc.
3047 2003-08-28 Bruno Haible <bruno@clisp.org>
3049 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
3050 warning on QNX, which defines O_BINARY to 000000.
3052 2003-08-24 Bruno Haible <bruno@clisp.org>
3054 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
3055 MSVC7 <stdio.h> is included later.
3057 2003-08-20 Bruno Haible <bruno@clisp.org>
3059 * progname.h: New file, from GNU gettext.
3060 * progname.c: New file, from GNU gettext.
3061 * progreloc.c: New file, from GNU gettext.
3063 2003-08-19 Bruno Haible <bruno@clisp.org>
3065 * xstrdup.c: Assume <string.h> exists.
3067 2003-08-18 Jim Meyering <jim@meyering.net>
3069 * setenv.h: Indent nested cpp directive.
3070 * vasnprintf.c: Remove trailing blanks.
3072 2003-08-17 Simon Josefsson <jas@extundo.com>
3073 Bruno Haible <bruno@clisp.org>
3075 * xstrndup.h: New file.
3076 * xstrndup.c: New file.
3078 2003-08-17 Bruno Haible <bruno@clisp.org>
3080 * strndup.h: New file.
3082 2003-08-16 Paul Eggert <eggert@twinsun.com>
3084 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
3085 space, undoing this 2003-08-12 change:
3086 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
3088 2003-08-16 Jim Meyering <jim@meyering.net>
3090 Merge from coreutils.
3091 * xstrtoimax.c: #else #if -> #elif.
3092 * xstrtoumax.c: Likewise.
3094 2003-08-15 Paul Eggert <eggert@twinsun.com>
3096 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
3097 rather than tab, after '#' in shell-script copyright notices.
3098 Suggested by Bruno Haible.
3100 2003-08-15 Jim Meyering <jim@meyering.net>
3101 and Paul Eggert <eggert@twinsun.com>
3103 Merge from coreutils.
3104 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
3105 member but strut utmpx does not. Needed for AIX 4.3.3.
3106 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
3108 2003-08-15 Jim Meyering <jim@meyering.net>
3110 Merge from coreutils.
3111 * xgethostname.c: Include <stdlib.h>.
3112 (xghostname): Don't exit for anything other than memory-related
3113 failure; just return NULL.
3114 * userspec.c: Include "posixver.h".
3115 (parse_user_spec): Accept `.' as a separator only
3116 in pre-POSIX-200112 mode.
3117 * strtoimax.c: Use #elif rather than #else #if.
3118 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
3119 Remove function, now that we can rely on a working tzset function.
3120 [!_LIBC]: Ensure that the required autoconf test has been run.
3121 [!defined _NL_CURRENT && HAVE_STRFTIME]:
3122 Use underlying_strftime for %r.
3123 * sha.c: Merge in some clean-up and optimization changes from glibc.
3124 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
3125 Ensure that it is a multiple of 64.
3126 Rearrange loop exit tests so as to avoid performing an
3127 additional fread after encountering an error or EOF.
3128 * realloc.c: Update copyright date.
3130 2003-08-14 Jim Meyering <jim@meyering.net>
3132 Merge from coreutils.
3133 * obstack.h: Whitespace changes.
3134 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
3135 and xcalloc return values.
3136 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
3137 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
3138 hang on OSF/1 5.1 for DIR on both local and remote file systems.
3139 Reported by (and fix confirmed by) Nelson H. F. Beebe.
3140 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3142 Use mntctl's return value to drive the entry-processing loop, since
3143 we can't rely on the value of the vmt_length member in the last
3144 entry. On some systems doing so could result in exhausting
3145 virtual memory. Based in part on a patch from Mike Jetzer.
3147 2003-08-14 Jim Meyering <jim@meyering.net>
3148 and Paul Eggert <eggert@twinsun.com>
3150 Merges from coreutils, plus other fixes.
3151 * physmem.c: Merge in portability changes from gcc/libiberty
3152 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
3153 for credits and details. Thanks to Kaveh Ghazi for helping
3154 to keep these files in sync.
3155 (ARRAY_SIZE): Define it.
3156 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
3157 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
3158 (memcasecmp): Don't assume size_t fits in unsigned int.
3159 Remove casts and duplicate code.
3160 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
3161 (memcpy): Remove definition.
3162 Merge in some clean-up and optimization changes from glibc.
3163 [BLOCKSIZE]: Move definition to top of file.
3164 Ensure that it is a multiple of 64.
3165 Rearrange loop exit tests so as to avoid performing an
3166 additional fread after encountering an error or EOF.
3167 * md5.h (md5_uintptr): Define.
3168 * makepath.c (CLEANUP_CWD): Report an error if we failed to
3169 return to the initial working directory. Preserve errno
3171 * idcache.c: Include "xalloc.h".
3172 (xmalloc, xrealloc): Remove decls.
3173 (getuser): Remove casts no longer required in C89.
3174 * human.c: Include stdio.h, for sprintf.
3175 * group-member.c: Include "xalloc.h".
3176 (xmalloc, xrealloc): Remove decls.
3177 (get_group_info): Remove casts no longer required in C89.
3178 * getusershell.c (readname): Remove casts no longer required in C89.
3179 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
3180 * getline.c: Whitespace fix, from coreutils.
3182 2003-08-13 Paul Eggert <eggert@twinsun.com>
3184 * exclude.c: Include <ctype.h>
3185 (IN_CTYPE_DOMAIN): New macro.
3187 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
3190 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3191 Undo previous (whitespace-only) change.
3193 2003-08-12 Paul Eggert <eggert@twinsun.com>
3195 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3196 Normalize leading white space and remove trailing white space.
3197 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
3198 notice, as per ../config/srclist-update.
3200 Merge from coreutils.
3201 * euidaccess.h: New file.
3202 * euidaccess.c: Include it.
3203 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
3204 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
3205 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
3207 2003-08-11 Bruno Haible <bruno@clisp.org>
3209 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
3210 (vasnprintf): Use it instead of wcslen.
3212 2003-08-11 Bruno Haible <bruno@clisp.org>
3214 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
3215 value to ensure that _Bool promotes to int. Use #define for _Bool when
3216 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
3218 2003-08-10 Karl Berry <karl@gnu.org>
3220 * regex.h: update from libc (whitespace fix).
3222 2003-08-09 Paul Eggert <eggert@twinsun.com>
3224 Merge some files from coreutils. These changes were
3225 originally made by Jim Meyering.
3226 * acl.c: Include <sys/types.h> before <sys/stat.h>;
3227 many older Unixes require this.
3228 * alloca.c (alloca): Remove cast to argument of free;
3229 no longer needed in C89.
3230 * alloca_.h, regex.h: Fix white space to match
3231 what GNU indent does.
3233 2003-08-05 Paul Eggert <eggert@twinsun.com>
3235 * bumpalloc.h: Remove.
3237 2003-08-04 Paul Eggert <eggert@twinsun.com>
3239 * getloadavg.c: Change copyright notice and spacing to conform to
3242 Merge from coreutils.
3243 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
3245 * getdate.y (date): Also accept dates like May-23-2003; suggestion
3246 from Karl Berry, implemented by Jim Meyering.
3247 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
3248 from Dmitry V. Levin.
3249 Remove anachronistic cast of xrealloc.
3250 * fnmatch_.h (__const): Remove. Use 'const'.
3251 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
3252 type. Otherwise, it wouldn't compile with at least /bin/cc on
3253 ymp-cray-unicos9.0.2.X.
3254 Combine two mostly-identical uses of alloca into one.
3255 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
3257 2003-08-04 Dave Love <d.love@dl.ac.uk>
3261 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
3262 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
3263 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
3264 obsolete NLIST_NAME_UNION.
3265 [__GNU__]: Undef BSD and FSCALE.
3266 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
3268 2003-08-03 Paul Eggert <eggert@twinsun.com>
3270 * stdbool_.h (_Bool): Make it signed char, instead of
3271 an enum type, so that it's guaranteed to promote to int. See:
3272 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
3274 2003-07-31 Paul Eggert <eggert@twinsun.com>
3276 * strerror.c: Include config.h, limits.h. Declare sprintf.
3277 (strerror): Don't assume that a printable int fits in 14 bytes.
3279 2003-07-24 Derek Robert Price <derek@ximbiot.com>
3280 Bruno Haible <bruno@clisp.org>
3282 * getline.h (getline, getdelim): Change return type to ssize_t.
3283 * getline.c (getline, getdelim): Likewise.
3284 Remove _GNU_SOURCE define; now it's defined in config.h through
3287 2003-07-22 Paul Eggert <eggert@twinsun.com>
3289 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
3290 over-parenthesization in macros.
3292 Sync with coreutils.
3294 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
3297 Use `exit_failure' for xalloc and xmemcoll instead of their own
3298 private exit-failure variables.
3299 * xalloc.h (xalloc_exit_failure): Remove.
3300 * xmalloc.c: Likewise. Include exitfail.h.
3301 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
3302 * xmemcoll.h (xmemcoll_exit_failure): Remove.
3303 * xmemcoll.c: Likewise. Include exitfail.h.
3304 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
3306 2003-07-18 Paul Eggert <eggert@twinsun.com>
3308 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
3309 * closeout.c: Likewise. Include "closeout.h" right after config.h,
3310 to test that it can stand by itself. Include "exitfail.h".
3311 Clients should set exit_failure instead.
3312 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
3314 2003-07-18 Andreas Schwab <schwab@suse.de>
3316 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
3318 2003-07-18 Bruno Haible <bruno@clisp.org>
3320 * getndelim2.h: New file.
3321 * getndelim2.c: Make into a module of its own. Include config.h,
3323 (getndelim2): Make non-static. Change return type to ssize_t.
3324 * getline.h: Change argument names.
3325 * getline.c: Include getndelim2.h instead of getndelim2.c.
3326 * getnline.c: Include getndelim2.h.
3328 2003-07-17 Bruno Haible <bruno@clisp.org>
3330 * Makefile.am: Remove file.
3331 * Makefile.in: Remove file.
3333 2003-07-17 Bruno Haible <bruno@clisp.org>
3335 * getnline.h: New file.
3336 * getnline.c: New file.
3337 * getndelim2.c: New file, extracted from getline.c.
3338 (getndelim2): Renamed from getdelim2, with added nmax argument.
3339 * getline.c: Include getndelim2.c.
3340 (getdelim2): Moved out to getndelim2.c.
3341 (getline, getdelim): Update.
3343 2003-07-15 <karl@gnu.org>
3345 * vasnprintf.c: update from gettext.
3347 2003-07-15 Jim Meyering <jim@meyering.net>
3349 * makepath.c (make_path): Enclose diagnostic in _(...).
3351 2003-07-14 Paul Eggert <eggert@twinsun.com>
3353 * asnprintf.c, asprintf.c, config.charset, gettext.h,
3354 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
3355 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
3356 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
3357 vasprintf.c, vasprintf.h: Regenerate. These files are now being
3358 updated automatically by ../config/srclist-update. This changes
3359 their license from LPGL to GPL.
3361 2003-07-14 Jim Meyering <jim@meyering.net>
3363 Don't emit diagnostics. Let callers do that.
3364 * save-cwd.c: Don't include "error.h".
3365 (save_cwd): Don't call error. Ensure that errno is valid
3366 when returning nonzero.
3368 * save-cwd.h (restore_cwd): Update prototype.
3369 * save-cwd.c (restore_cwd): Remove two parameters.
3370 Simplify. Don't call error upon failure. Let callers do that.
3371 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
3372 when auditing is enabled. But don't bother updating the #if.
3374 2003-07-14 Simon Josefsson <jas@extundo.com>
3376 * mempcpy.h: New file.
3377 * mempcpy.c: New file.
3379 2003-07-14 Paul Eggert <eggert@twinsun.com>
3381 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
3382 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
3383 unicodeio.c, unicodeio.h, unlocked-io.h:
3384 Switch from LGPL to GPL.
3386 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
3388 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
3389 it breaks C++ compilation.
3390 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
3392 2003-07-10 Jim Meyering <jim@meyering.net>
3394 * vasnprintf.c: Remove trailing blanks.
3395 Make cpp indentation consistent.
3397 2003-07-09 Paul Eggert <eggert@twinsun.com>
3399 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
3400 posixver.c, strftime.c, strnlen.c, strverscmp.c:
3401 Switch from LGPL to GPL.
3403 2003-07-07 Paul Eggert <eggert@twinsun.com>
3405 * mktime.c: Fix some boundary cases and remove need for floating point.
3407 Issue a compile-time diagnostic if time_t is floating point, or if
3408 two's complement arithmetic is not in effect, or if arithmetic
3409 right shift does not propagate the sign. These assumptions were
3410 all in the original code but they weren't checked.
3412 (TIME_T_MIDPOINT, verify): New macros.
3413 (__isleap): Remove; it has integer overflow problems.
3414 (leapyear): New function, without those problems.
3415 (ydhms_tm_diff): Remove; splitting into two parts.
3416 (ydhms_diff): New function, containing the arithmetic part of
3417 the old ydhms_tm_diff function. Issue a compile-time
3418 diagnostic if we are not using C99 integer division.
3419 Avoid casts when possible.
3420 (guess_time_tm): New function, containing the checking part of
3421 the old ydhms_tm_diff function. Return the new value, rather than
3422 the difference between it and the old. Accept a new argument T
3423 so that *T specifies the old value. Check for overflow in the result.
3425 (__mktime_internal): Use a time_t offset, not a long int offset.
3426 This undoes the 2003-06-04 change, which is no longer needed now
3427 that we have better overflow checking.
3428 (localtime_offset): Likewise.
3430 (__mktime_internal): Avoid harmful overflow on hosts where time_t
3431 and long are 64-bit but int is only 32-bit.
3432 (ydhms_diff): Use long int to store year1 and yday1.
3433 Issue a compile-time diagnostic if long int is not wide enough.
3435 (__mktime_internal): Use long int to store adjusted year and yday.
3436 Use plain C rather than preprocessor commands, if that doesn't
3438 Check for overflow (and try to repair) after each probe
3439 rather than checking only at the very end. This avoids some bugs
3440 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
3441 does not equal GMT offset at maximum time).
3442 Use integer to check for overflow rather than floating point; this
3443 is more portable to non-IEEE hosts, and is a tad faster.
3444 When we detect that we are oscillating between two values,
3445 don't check whether tm_isdst has the requested value, since
3446 we already know the answer. When tm_isdst has the wrong value,
3447 use a different heuristic to find the right one, based on the
3448 extreme values actually observed in practice in tz2003a,
3449 rather than the (overly optimistic) "previous 3 calendar quarters".
3451 (not_equal_tm, print_tm, check_result): Use "const T" rather than
3452 "T const" to accommodate glibc style.
3453 (check_result): Use less-confusing report format. "long" -> "long int.
3455 Don't loop if the iteration overflows time_t.
3456 Allow a negative step in the iteration.
3458 2003-07-01 Paul Eggert <eggert@twinsun.com>
3460 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3461 having it depend on HAVE_SYS_TYPES_H.
3463 2003-06-25 Bruno Haible <bruno@clisp.org>
3465 * readlink.c: New file.
3467 2003-06-20 Bruno Haible <bruno@clisp.org>
3469 Assume C89, so PARAMS isn't needed.
3470 * unicodeio.h (PARAMS): Remove.
3471 * unicodeio.c: Don't use PARAMS.
3473 2003-06-18 Jim Meyering <jim@meyering.net>
3475 Merge changes from coreutils.
3476 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
3477 Remove explicit declarations of xmalloc and realloc.
3479 (read_utmp): Remove anachronistic cast of xmalloc.
3481 2003-06-17 Paul Eggert <eggert@twinsun.com>
3483 Assume C89, so PARAMS isn't needed.
3484 * backupfile.h (PARAMS): Remove. All uses removed.
3485 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
3486 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
3487 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
3488 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
3489 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
3490 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
3491 xstrtol.h: Likewise.
3492 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
3493 same.h, strverscmp.h: Do not include config.h; no longer needed.
3494 Anyway, config.h should always be included before any other file.
3496 2003-06-11 Simon Josefsson <jas@extundo.com>
3498 * sysexit_.h: New file.
3500 2003-05-20 Derek Price <derek@ximbiot.com>
3502 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
3504 2003-06-10 Simon Josefsson <jas@extundo.com>
3506 * strchrnul.h: New file.
3507 * strchrnul.c: New file.
3509 2003-06-10 Simon Josefsson <jas@extundo.com>
3511 * argp.h: New file, from glibc.
3512 * argp-ba.c: New file, from glibc.
3513 * argp-eexst.c: New file, from glibc.
3514 * argp-fmtstream.c: New file, from glibc.
3515 * argp-fmtstream.h: New file, from glibc.
3516 * argp-fs-xinl.c: New file, from glibc.
3517 * argp-help.c: New file, from glibc.
3518 * argp-namefrob.h: New file, from glibc.
3519 * argp-parse.c: New file, from glibc.
3520 * argp-pv.c: New file, from glibc.
3521 * argp-pvh.c: New file, from glibc.
3522 * argp-xinl.c: New file, from glibc.
3524 2003-06-07 Jim Meyering <jim@meyering.net>
3526 * readtokens.h: Put `Free Software Foundation, Inc.'
3527 in place of my name in the copyright comment.
3528 Remove definition and uses of __P.
3531 * stat.c: Don't declare xmalloc explicitly.
3532 Instead, include "xalloc.h".
3533 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
3534 xrealloc, and xcalloc return values.
3535 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
3537 * xgetcwd.h: Remove definition/uses of PARAMS.
3539 2003-06-06 Jim Meyering <jim@meyering.net>
3541 * stdbool_.h: Renamed from stdbool.h.in.
3543 2003-06-06 Jim Meyering <jim@meyering.net>
3545 Merge from coreutils.
3546 * same.c: (same_name): Declare *_basename locals to be `const'.
3547 Consolidate declarations and initializations of *_base* locals.
3549 Merge from coreutils.
3550 This avoids a core dump on systems without GNU putenv,
3551 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
3552 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
3553 (unsetenv): New static function, from GNU libc.
3554 (rpl_putenv): Use it.
3556 * modechange.c: Remove trailing blanks.
3558 Merge from coreutils.
3559 * fsusage.c: Remove declaration of statfs.
3560 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
3562 * posixtm.c: Include <stdbool.h> unconditionally.
3564 2003-06-05 Paul Eggert <eggert@twinsun.com>
3566 * mktime.c (__mktime_internal): When resolving a tm_isdst
3567 mismatch, look in future quarters as well as past. This fixes a
3568 bug when processing fall-backwards gaps immediately after a long
3569 period of daylight-saving time.
3571 * mktime.c: Assume freestanding C89 or better.
3572 (HAVE_LIMITS_H): Remove. Assume it's 1.
3573 (__P): Remove; not used.
3574 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
3575 (mktime, not_equal_tm, print_tm, check_result,
3576 main): Use prototypes. Use const * where appropriate.
3577 (main): Fix typo in testing code that uncovered by above changes.
3578 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
3580 2003-06-04 Paul Eggert <eggert@twinsun.com>
3582 * mktime.c: Fix Debian bug 177940
3583 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
3584 (localtime_offset): Now long int, not time_t, because we want it
3585 to be guaranteed to be signed. All uses changed.
3586 (__mktime_internal): If overflow would occur when adding offset,
3589 Merge 'human' changes from coreutils. Rewrite to support
3590 locale-specific notations like thousands separators.
3591 * human.c: Simplify authorship notice.
3592 Include human.h immediately after config.h.
3593 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
3594 <limits.h>: Do not include, since human.h does.
3595 (SIZE_MAX, UINTMAX_MAX): New macros.
3596 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
3597 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
3598 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
3599 (power_letter): Renamed from suffixes.
3600 (generate_suffix_backwards): Remove.
3601 (adjust_value): Now takes int style (because of human.h changes)
3602 and long double value (for greater precision on some platforms).
3603 (group_number): New function.
3604 (human_readable): Use it. Use integer options, not enum.
3605 Put the options before the sizes in the arg list.
3606 Support all the new options.
3607 The old human_readable function has been removed;
3608 use inttostr.h instead.
3609 (human_readable, default_block_size, humblock):
3610 Use uintmax_t, not int, for block sizes.
3611 (human_readable_inexact, block_size_types): Remove.
3612 (block_size_opts): New constant.
3613 (human_options): Renamed from human_block_size, with new signature
3614 that allows block sizes up to UINTMAX_MAX. All callers changed.
3615 * human.h: Add copyright and authorship notice.
3616 Include <limits.h> and <stdbool.h> unconditionally.
3617 (PARAMS): Remove. All uses removed.
3618 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
3619 (enum human_inexact_style): Remove tag; now a nameless enum.
3620 (human_floor, human_ceiling, human_round_to_even): Now have
3621 values 2, 0, 1 rather than -1, 1, 0.
3622 (human_group_digits, human_suppress_point_zero, human_autoscale,
3623 human_base_1024, human_SI, human_B): New constants.
3624 (human_readable_inexact, human_block_size): Remove.
3625 (human_readable): Size args are now uintmax_t, not int.
3626 (human_options): New decl.
3628 * exclude.c: (new_exclude, add_exclude): Remove casts that are
3629 unnecessary now that we assume C89 or better. This change
3630 imported from coreutils.
3632 * mktime.c (__mktime_internal): Do not reject negative timestamps
3633 arbitrarily. This is the same patch as 2003-05-28, but it got lost
3634 in the 2003-05-30 sync from glibc.
3636 .h files should stand alone, but we shouldn't include <sys/types.h>
3637 if we can get away with just <stddef.h>.
3639 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
3640 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
3641 rather than <sys/types.h>, as we merely need size_t.
3642 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
3644 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
3645 Include <stdio.h>, to get FILE.
3646 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
3647 memcasecmp.h has included <stddef.h> and all we need is size_t.
3648 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
3649 our interface, instead of including <sys/types.h>
3651 2003-06-02 Paul Eggert <eggert@twinsun.com>
3654 Fix some minor time-related bugs with POSIX time arguments.
3655 Some valid time stamps were being rejected (notably -1, and
3656 time stamps before 1900 on 64-bit hosts). And some invalid
3657 time stamps were being accepted, e.g. September 31.
3659 * posixtm.h (posixtime): Return bool instead of time_t, so
3660 that we can return (time_t) -1 successfully.
3661 * posixtm.c: Likewise.
3662 [HAVE_STDBOOL_H]: Include <stdbool.h>.
3663 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
3664 (t): Remove static var.
3665 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
3666 of static var. All uses changed.
3667 (year): Do not reject years before 1900; they can occur with
3669 (posix_time_parse): Do not check for out-of-range components;
3670 that is now the caller's responsibility, since our checks were
3671 only approximations.
3672 (posixtime): Use mktime to check for out-of-range components,
3673 since it knows them exactly.
3674 If mktime returns (time_t) -1, check whether an error actually occurred
3675 by invoking localtime on -1.
3676 (main) [TEST_POSIXTIME]: Check for input data errors, and report
3677 posixtime failures better.
3678 Improve the test data (in comments only).
3680 2003-05-30 <karl@gnu.org>
3682 * mktime.c: update from libc.
3684 2003-05-30 Bruno Haible <bruno@clisp.org>
3686 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
3687 * localcharset.h: Likewise.
3688 * localcharset.c: Likewise.
3690 2003-05-28 Paul Eggert <eggert@twinsun.com>
3692 Assume the headers required for C89 freestanding compilers.
3693 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
3694 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
3695 without checking for HAVE_LIMITS_H.
3696 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
3697 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
3699 * fatal.c: Include <stdarg.h> without checking for __STDC__.
3700 * exclude.c: Include <stdbool.h> unconditionally.
3701 * tempname.c: Include <stddef.h> unconditionally.
3702 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
3703 * modechange.c, rpmatch.c (NULL): Don't define, since
3704 <stddef.h> does that.
3705 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
3706 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
3707 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
3708 * xstrtol.c: Likewise.
3709 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
3710 * savedir.c: Include <stddef.h> instead of defining NULL.
3712 * addext.c (addext): Use assignment rather than cast, to avoid
3713 warnings on some platforms.
3715 * mktime.c (__mktime_internal): Do not reject negative timestamps
3718 2003-05-10 Bruno Haible <bruno@clisp.org>
3720 * linebreak.c (iconv_string_length): Don't return -1 just because the
3721 string is longer than 4 KB.
3723 2003-05-12 Jim Meyering <jim@meyering.net>
3725 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
3726 the space-padded-by-default conversion specifiers, %e, %k, %l.
3728 2003-05-03 Bruno Haible <bruno@clisp.org>
3730 Upgrade to Unicode-4.0.
3731 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
3732 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
3733 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
3734 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
3735 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
3736 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
3737 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
3738 Change width of U+E0100..U+E01EF from 1 to 0.
3740 2003-04-25 Bruno Haible <bruno@clisp.org>
3742 * copy-file.c: Include <stddef.h>, for size_t.
3744 2003-04-25 Jim Meyering <jim@meyering.net>
3746 * copy-file.c (copy_file_preserving): Declare buf_size to be
3747 of type size_t, not int.
3749 2003-04-11 Jim Meyering <jim@meyering.net>
3751 Merge changes from Coreutils.
3753 2003-03-22 Jim Meyering <jim@meyering.net>
3755 * strftime.c (widen): Cast alloca return value to proper type.
3757 2003-01-19 Ulrich Drepper <drepper@redhat.com>
3760 * strftime.c (my_strftime): Handle very large width
3761 specifications for numeric values correctly. Improve checks for
3764 2003-01-19 Jim Meyering <jim@meyering.net>
3766 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
3767 (nl_get_alt_digit) [! defined my_strftime]: Define.
3768 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
3769 _nl_get_alt_digit and _nl_get_walt_digit.
3771 * strftime.c (my_strftime): Merge in locale-related changes from libc.
3772 These changes have no effect outside of _LIBC.
3774 2003-04-10 Bruno Haible <bruno@clisp.org>
3776 * findprog.h: New file, from GNU gettext.
3777 * findprog.c: New file, from GNU gettext.
3779 2003-04-05 Jim Meyering <jim@meyering.net>
3781 Merge changes from Coreutils.
3783 * exclude.h (PARAMS): Remove definition and uses.
3784 * exclude.c: Remove uses of `PARAMS'.
3786 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
3787 Add test-cases for DOS filenames. Declare program_name.
3788 (main): Set up program_name. Patch by Rich Dawe.
3790 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3792 Use mntctl's return value to drive the entry-processing loop, since
3793 we can't rely on the value of the vmt_length member in the last
3794 entry. On some systems doing so could result in exhausting
3795 virtual memory. Based in part on a patch from Mike Jetzer.
3797 2003-04-04 Bruno Haible <bruno@clisp.org>
3799 * linebreak.h: New file, from GNU gettext.
3800 * linebreak.c: New file, from GNU gettext with slight modifications.
3801 * lbrkprop.h: New file, from GNU gettext.
3803 2003-04-03 Bruno Haible <bruno@clisp.org>
3805 * utf8-ucs4.h: New file, from GNU gettext.
3806 * utf16-ucs4.h: New file, from GNU gettext.
3807 * ucs4-utf8.h: New file, from GNU gettext.
3808 * ucs4-utf16.h: New file, from GNU gettext.
3810 2003-04-02 Bruno Haible <bruno@clisp.org>
3812 * binary-io.h: New file, from GNU gettext.
3814 2003-04-01 Bruno Haible <bruno@clisp.org>
3816 * pathname.h: New file, from GNU gettext.
3817 * concatpath.c: New file, from GNU gettext.
3819 2003-03-30 Bruno Haible <bruno@clisp.org>
3821 * copy-file.c (copy_file_preserving): Don't set owner if the function
3822 chown() doesn't exist.
3824 2003-03-28 Bruno Haible <bruno@clisp.org>
3826 * copy-file.h: New file, from GNU gettext.
3827 * copy-file.c: New file, from GNU gettext.
3829 2003-03-18 Jim Meyering <jim@meyering.net>
3831 * quote.c (quote_n): Fix typo in comment.
3833 2003-03-14 Jim Meyering <jim@meyering.net>
3835 Merge changes from Coreutils.
3836 * obstack.h (obstack_object_size): Declare temporary, __o,
3837 to be const, in order to avoid warnings.
3838 (obstack_room): Likewise.
3839 (obstack_empty_p): Likewise.
3841 2003-03-13 Paul Eggert <eggert@twinsun.com>
3843 Merge changes from Bison.
3844 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
3845 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
3846 when compiling Bison 1.875's `bitset bset = obstack_alloc
3847 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
3848 * hash.c: Include <stdbool.h> unconditionally.
3850 2003-03-09 Paul Eggert <eggert@twinsun.com>
3852 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
3853 Reported by Bruce Becker; see:
3854 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
3856 2003-03-03 Paul Eggert <eggert@twinsun.com>
3857 Bruno Haible <bruno@clisp.org>
3859 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
3860 Reported by John Hughes, see
3861 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
3863 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
3865 * poll_.h: New file.
3868 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
3870 * mathl.h: New file.
3871 * acosl.c: New file.
3872 * asinl.c: New file.
3873 * atanl.c: New file.
3874 * ceill.c: New file.
3877 * floorl.c: New file.
3878 * frexpl.c: New file.
3879 * ldexpl.c: New file.
3881 * sincosl.c: New file.
3883 * sqrtl.c: New file.
3885 * trigl.c: New file.
3886 * trigl.h: New file.
3888 2003-02-17 Bruno Haible <bruno@clisp.org>
3890 * mkdtemp.h: New file, from GNU gettext.
3891 * mkdtemp.c: New file, from GNU gettext.
3893 2003-01-31 Bruno Haible <bruno@clisp.org>
3895 * rename.c: #undef rename before defining rpl_rename.
3896 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
3898 2003-01-30 Bruno Haible <bruno@clisp.org>
3900 * printf-args.h: New file, from GNU gettext.
3901 * printf-args.c: New file, from GNU gettext.
3902 * printf-parse.h: New file, from GNU gettext.
3903 * printf-parse.c: New file, from GNU gettext.
3904 * vasnprintf.h: New file, from GNU gettext.
3905 * vasnprintf.c: New file, from GNU gettext.
3906 * asnprintf.c: New file, from GNU gettext.
3907 * vasprintf.h: New file, from GNU gettext with modifications.
3908 * vasprintf.c: New file, from GNU gettext.
3909 * asprintf.c: New file, from GNU gettext.
3911 2003-01-29 Bruno Haible <bruno@clisp.org>
3913 * stpncpy.h: New file, from GNU gettext with modifications.
3914 * stpncpy.c: New file, from GNU gettext with modifications.
3916 2003-01-28 Bruno Haible <bruno@clisp.org>
3918 * c-ctype.h: New file, from GNU gettext, with changes suggested by
3920 * c-ctype.c: New file, from GNU gettext, with changes suggested by
3923 2003-01-27 Bruno Haible <bruno@clisp.org>
3925 * xsetenv.h: New file, from GNU gettext.
3926 * xsetenv.c: New file, from GNU gettext.
3928 2003-01-23 Bruno Haible <bruno@clisp.org>
3930 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
3932 2003-01-22 Bruno Haible <bruno@clisp.org>
3934 * exit.h: New file, from GNU gettext.
3936 2003-01-11 Bruno Haible <bruno@clisp.org>
3938 * stpcpy.h (stpcpy): Use ANSI C function declarations.
3939 * strcase.h (strcasecmp, strncasecmp): Likewise.
3941 2003-01-14 Jim Meyering <jim@meyering.net>
3943 * same.c (same_name): Tweak a comment.
3945 2003-01-11 Bruno Haible <bruno@clisp.org>
3947 * same.c (same_name): Reorder tests so as to avoid calling stat()
3948 when a string comparison is sufficient.
3950 2003-01-11 Bruno Haible <bruno@clisp.org>
3952 * readtokens.c (readtoken): Cast character to 'unsigned char', not
3955 2003-01-11 Bruno Haible <bruno@clisp.org>
3957 * hash-pjw.c: Add comment about low quality of this function.
3959 2003-01-12 Paul Eggert <eggert@twinsun.com>
3961 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
3962 to avoid collisions with libcurses and libreadline.
3964 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
3965 * getstr.h, getstr.c: Remove.
3966 * getline.c: Include "getline.h", to check interface.
3967 Move body of old getstr.c here: this defines MIN_CHUNK and
3968 declares getdelim2, which is renamed from getstr.
3969 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
3971 * linebuffer.c (readlinebuffer): Renamed from readline.
3973 * linebuffer.h: Likewise.
3974 (readline): Remove backward-compatibility macro.
3976 2003-01-12 Jim Meyering <jim@meyering.net>
3978 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
3980 2003-01-10 Bruno Haible <bruno@clisp.org>
3982 * alloca_.h: New file.
3983 * getdate.y: Unconditionally include alloca.h.
3984 * makepath.c: Likewise.
3985 * setenv.c: Likewise.
3986 * userspec.c: Likewise.
3988 2003-01-09 Bruno Haible <bruno@clisp.org>
3990 * stdbool.h.in: New file.
3992 2003-01-08 Bruno Haible <bruno@clisp.org>
3994 * safe-read.c: Include specification header first, to ensure its
3996 * full-write.c: Likewise.
3998 2003-01-08 Jim Meyering <jim@meyering.net>
4000 * full-write.c: Undefine and define-away `const' after inclusion
4001 of errno.h, not before. Suggestion from Bruno Haible.
4003 2003-01-07 Jim Meyering <jim@meyering.net>
4005 * full-write.c: Rework so that it may serve to define full_read, too.
4006 * full-read.c: Simply #define FULL_READ and include full-write.c.
4008 2003-01-06 Jim Meyering <jim@meyering.net>
4010 * version-etc.c: Update year in translatable copyright string.
4012 2002-12-25 Bruno Haible <bruno@clisp.org>
4014 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
4015 * xstrtol.h: Likewise.
4016 * xstrtoimax.c: Likewise.
4017 * xstrtoumax.c: Likewise.
4018 * human.h: Likewise.
4020 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
4021 on systems that have <inttypes.h> but not <stdint.h>.
4023 2002-12-31 Paul Eggert <eggert@twinsun.com>
4025 * memcoll.c (memcoll): Fall back on a simple algorithm using
4026 memcmp if strcoll doesn't work.
4028 2002-12-23 Bruno Haible <bruno@clisp.org>
4030 * localcharset.h: New file.
4031 * localcharset.c: Include it.
4032 * unicodeio.c: Likewise.
4034 2002-12-22 Bruno Haible <bruno@clisp.org>
4036 * utime.c (utime_null): No need to call ftruncate if the file was
4039 2002-12-23 Bruno Haible <bruno@clisp.org>
4041 * memcoll.c (STRCOLL): New macro.
4044 2002-12-22 Bruno Haible <bruno@clisp.org>
4046 * getstr.h (getstr): Define, to avoid clash with libcurses.
4047 * linebuffer.h (readline): Define, to avoid clash with libreadline.
4049 2002-12-22 Bruno Haible <bruno@clisp.org>
4051 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
4053 2002-12-23 Bruno Haible <bruno@clisp.org>
4055 * getline.h: Include <stddef.h>, for size_t.
4057 * unicodeio.h: Include <stddef.h>, for size_t.
4058 * unicodeio.c: Don't include <stddef.h>.
4060 2002-12-17 Bruno Haible <bruno@clisp.org>
4062 * canon-host.c (strdup): Remove unused declaration.
4064 * fsusage.c: Include full_read.h.
4065 (get_fs_usage): Use full_read instead of safe_read.
4067 * utime.c (utime_null): Use SAFE_READ_ERROR.
4069 2002-12-11 Bruno Haible <bruno@clisp.org>
4071 * setenv.h: Rewritten to cope with systems that have setenv() but not
4073 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
4076 2002-12-11 Bruno Haible <bruno@clisp.org>
4078 * setenv.c (alloca): Fall back to malloc.
4080 (setenv): Use freea() to free memory allocated with alloca().
4082 2002-11-13 Bruno Haible <bruno@clisp.org>
4084 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
4085 function declarations.
4086 * unsetenv.c (unsetenv): Likewise.
4088 2002-03-04 Bruno Haible <bruno@clisp.org>
4090 Portability to AIX 4.3.3.
4091 * unsetenv.c: New file, extracted from setenv.c.
4092 * setenv.c: Move the unsetenv() function to unsetenv.c.
4094 2001-12-20 Bruno Haible <bruno@clisp.org>
4096 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
4097 use malloc instead. For SunOS 4.
4099 2001-12-11 Bruno Haible <bruno@clisp.org>
4101 * setenv.c: Declare alloca.
4102 (compar_fn_t): New typedef.
4103 (KNOWN_VALUE, STORE_VALUE): Use it.
4105 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
4108 2002-12-10 Paul Eggert <eggert@twinsun.com>
4110 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
4111 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
4112 Choose values that are less likely to collide with system fnmatch
4114 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
4115 defined (e.g., a pure POSIX system).
4116 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
4117 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
4119 2002-12-06 Jim Meyering <jim@meyering.net>
4121 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
4123 Merge in changes from libc's misc/error.c, in preparation
4124 for the merge of gnulib's changes back into libc.
4126 * error.c (_): Define only if not already defined.
4127 Move definition to follow all #include directives.
4128 Include unlocked-io.h only if !_LIBC.
4129 [_LIBC]: Include <libio/libioP.h>.
4130 [USE_IN_LIBIO]: Include <libio/iolibio.h>
4131 (fflush): Tweak definition to use INTUSE.
4134 2002-12-05 Paul Eggert <eggert@twinsun.com>
4136 * alloca.c [defined emacs]: Include "lisp.h".
4137 (xalloc_die) [defined emacs]: New macro.
4138 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
4139 [! defined emacs]: Include <xalloc.h>.
4140 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
4141 (pointer): Typedef to POINTER_TYPE *.
4142 (malloc): Remove decl; we now always use xmalloc.
4143 (alloca): Use old-style definition, since Emacs needs this.
4144 Check for arithmetic overflow when computing combined size.
4146 2002-12-04 Paul Eggert <eggert@twinsun.com>
4148 Do not generate unlocked-io.h automatically, since it's easier to
4149 maintain it by hand.
4151 * unlocked-io.h: New file, from GNU diffutils,
4152 but with proper copyright notice and attribution.
4154 * Makefile.am: Add copyright notice.
4155 (libfetish_a_SOURCES): Add unlocked-io.h.
4156 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
4157 (DISTCLEANFILES, io_functions): Remove macros.
4158 (EXTRA_DIST): Remove gen_uio.
4159 (unlocked-io.h): Remove rule.
4161 2002-12-04 Jim Meyering <jim@meyering.net>
4163 Reflect the fact that stat.c and lstat.c are no longer generated.
4164 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
4165 (DISTCLEANFILES): Likewise.
4166 (EXTRA_DIST): Likewise.
4167 (all_local): Don't depend on stat.c or lstat.c.
4168 (stat.c, lstat.c): Remove rules.
4169 (EXTRA_DIST): Remove xstat.in.
4171 * xstat.in: Remove file. Contents moved into stat.c.
4172 * stat.c: New file. Contents mostly from xstat.in.
4173 * stat.c: Rework so that it may serve to define rpl_lstat, too.
4174 * lstat.c: New file. Simply #define LSTAT and include stat.c.
4176 * safe-read.c: Rework so that it may serve to define safe_write, too.
4177 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
4179 2002-12-03 Jim Meyering <jim@meyering.net>
4181 * safe-read.c, safe-write.c: Change variable names and comments, but
4182 not semantics, to minimize the differences between these two files.
4183 (safe_read): Change comment to mention SAFE_READ_ERROR.
4185 * safe-read.c (IS_EINTR): Define.
4186 (safe_read): Use IS_EINTR in place of in-function cpp directives.
4188 2002-12-02 Bruno Haible <bruno@clisp.org>
4190 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
4191 Define, taken from safe-read.c.
4192 (INT_MAX): Provide fallback.
4193 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
4194 * safe-write.h (SAFE_WRITE_ERROR): Define.
4196 * safe-read.c (EINTR): Remove definition.
4197 (safe_read): Don't use EINTR if it is absent.
4199 2002-12-02 Jim Meyering <jim@meyering.net>
4201 * safe-read.c (EINTR): Define.
4202 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4203 (INT_MAX): Provide fallback.
4204 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
4206 * safe-read.h (SAFE_READ_ERROR): Define.
4208 2002-12-01 Jim Meyering <jim@meyering.net>
4210 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
4211 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
4213 2002-11-27 Paul Eggert <eggert@twinsun.com>
4215 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4216 hash_rehash): Replace `if (limit <= value) abort ();' with
4217 `if (! (value < limit)) abort ();', for readability.
4219 2002-11-26 <karl@gnu.org>
4221 * strdup.c: copy from libc again, with jim's ok.
4222 * .cppi-disable: re-add strdup.c
4224 2002-11-25 <karl@gnu.org>
4226 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
4227 instead of "strtol.c".
4229 2002-11-25 Jim Meyering <jim@meyering.net>
4231 * mktime.c: Sync from libc, now that it has the latest fix.
4233 2002-11-24 <karl@gnu.org>
4235 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
4236 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
4238 2002-11-24 Jim Meyering <jim@meyering.net>
4240 Update from coreutils:
4242 * mktime.c: Merge in changes from libc.
4244 Avoid a link-time failure on some Linux systems.
4245 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
4246 (__mon_yday): Declare with the STATIC attribute.
4247 (__mktime_internal): Likewise.
4248 Based on a report from Greg Schafer.
4250 2002-11-23 Jim Meyering <jim@meyering.net>
4252 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
4253 Use `unsigned', not `int', as type of index.
4255 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
4257 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
4259 2002-11-22 Paul Eggert <eggert@twinsun.com>
4261 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
4262 hint that one should use `if (! x) abort ();' rather than `assert
4263 (x);', and anyway it's one less thing to worry about configuring.
4264 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4265 hash_rehash, hash_insert): Use abort rather than assert.
4267 2002-11-22 Paul Eggert <eggert@twinsun.com>
4269 * quotearg.h: Allow multiple inclusion by surrounding with
4270 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
4271 so that we can be included first.
4272 (PARAMS): Remove; we now assume C89 or later. All uses removed.
4273 * quotearg.c: Include quotearg.h immediately after config.h.
4274 No need to include stddef.h or sys/types.h any more.
4275 Surround local include files with "", not "<>".
4276 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
4277 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
4278 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
4279 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
4280 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
4281 (ISPRINT): Remove; no longer needed now that we assume C89.
4283 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
4286 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
4287 quotearg_char): Use SIZE_MAX rather than
4288 (size_t) -1 when we are talking about "infinity".
4290 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
4292 2002-11-22 Bruno Haible <bruno@clisp.org>
4294 * safe-read.h: Assume C89. Add comments.
4295 (safe_read): Change return type to size_t.
4296 * safe-read.c (safe_read): Change return type to size_t. Handle byte
4297 counts > SSIZE_MAX correctly.
4298 * safe-write.h: New file.
4299 * safe-write.c: New file.
4300 * full-read.h: New file.
4301 * full-read.c: New file.
4302 * full-write.h: Assume C89. Add comments.
4303 * full-write.c: Include safe-write.h.
4304 (full_write): Rewritten to use safe_write.
4305 Suggested by Jim Meyering and Paul Eggert.
4307 2002-11-21 Bruno Haible <bruno@clisp.org>
4309 Remove case insensitive option matching.
4310 * argmatch.h (argcasematch): Remove declaration.
4311 (ARGCASEMATCH): Remove macro.
4312 (__xargmatch_internal): Remove case_sensitive argument.
4313 (XARGMATCH): Update.
4314 (XARGCASEMATCH): Remove macro.
4315 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
4316 case_sensitive argument.
4317 (argcasematch): Remove function.
4318 (__xargmatch_internal): Remove case_sensitive argument.
4319 (main): Use XARGMATCH instead of XARGCASEMATCH.
4321 * xmalloc.c: Change compile-time error message. Add comment about
4322 required autoconf version.
4324 2002-11-21 Jim Meyering <jim@meyering.net>
4326 * strdup.c (strdup): Tweak comment and initial #if/#include.
4328 Merge in changes from the coreutils.
4330 2002-09-25 Paul Eggert <eggert@twinsun.com>
4331 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
4332 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
4333 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
4334 int. Work more efficiently if X is the same width as uintmax_t.
4335 Do not compare X to -1, to avoid bogus compiler warning.
4336 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
4337 Don't assume that f_frsize and f_bsize are the same type.
4339 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
4342 * makepath.c (make_path): Restore umask *before* creating the final
4344 (make_path): Minor reformatting.
4346 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
4347 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
4349 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
4350 ones. At least on GNU/Linux systems, `auto' means something else.
4353 2002-11-20 Paul Eggert <eggert@twinsun.com>
4355 Merge argmatch cleanups from Bison. Assume C89.
4357 * argmatch.c: Include config.h here, not in argmatch.h.
4358 Include stdlib.h, for EXIT_FAILURE.
4359 Always include <string.h>, since we assume C89.
4360 (EXIT_FAILURE): Remove pre-C89 bug workaround.
4361 * argmatch.h: Do not include <config.h> or <sys/types.h>.
4362 Include <stddef.h> instead, since it's all we need for size_t.
4363 (PARAMS): Remove. All uses removed.
4364 (ARRAY_CARDINALITY): Do not bother to #undef.
4365 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
4366 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4367 Remove unnecessary parentheses.
4368 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4369 Insert necessary parentheses.
4370 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
4371 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
4373 2002-11-19 Bruno Haible <bruno@clisp.org>
4375 * mbswidth.c: Include mbswidth.h right at the beginning.
4376 * mbswidth.h: Include <stddef.h>, for size_t.
4378 * mbswidth.h (PARAMS): Remove macro.
4379 (mbswidth, mbsnwidth): Use ANSI C function declarations.
4380 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
4382 * gcd.h (PARAMS): Remove macro.
4383 (gcd): Use ANSI C function declarations.
4384 * gcd.c (gcd): Likewise.
4386 2002-11-15 Bruno Haible <bruno@clisp.org>
4388 * strcspn.c: Include <stddef.h>.
4389 (strcspn): Use ANSI C function declaration. Change return type to
4391 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
4392 (strpbrk): Use NULL.
4393 * strpbrk.h (PARAMS): Remove macro.
4394 (strpbrk): Use ANSI C function declaration.
4395 * strstr.c: Don't include <sys/types.h>.
4396 * strstr.h (PARAMS): Remove macro.
4397 (strstr): Use ANSI C function declarations.
4399 2002-11-06 Bruno Haible <bruno@clisp.org>
4401 * gcd.h (gcd): Change argument type to 'unsigned long'.
4402 * gcd.c (gcd): Likewise.
4404 2002-11-05 Bruno Haible <bruno@clisp.org>
4406 * gcd.h: New file, from gettext-0.11.5.
4407 * gcd.c: New file, from gettext-0.11.5.
4409 2002-11-05 Bruno Haible <bruno@clisp.org>
4411 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4412 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4413 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4414 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4416 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4417 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4419 * closeout.c: Include gettext.h instead of <libintl.h>.
4420 * human.c: Include gettext.h instead of <libintl.h>.
4421 * quotearg.c: Include gettext.h instead of <libintl.h>.
4422 * rpmatch.c: Include gettext.h instead of <libintl.h>.
4423 * unicodeio.c: Include gettext.h instead of <libintl.h>.
4424 * userspec.c: Include gettext.h instead of <libintl.h>.
4425 * version-etc.c: Include gettext.h instead of <libintl.h>.
4426 * xmalloc.c: Include gettext.h instead of <libintl.h>.
4427 (textdomain): Remove definition.
4428 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
4430 * long-options.c: Remove include of <libintl.h> and definition of _.
4431 * same.c: Remove include of <libintl.h> and definition of _.
4433 2002-11-04 Bruno Haible <bruno@clisp.org>
4435 * stpcpy.h: New file, from GNU gettext-0.11.5.
4436 * strcase.h: New file, from GNU gettext-0.11.5.
4437 * strpbrk.h: New file, from GNU gettext-0.11.5.
4438 * strstr.h: New file, from GNU gettext-0.11.5.
4439 * xgetcwd.h: New file, from GNU gettext-0.11.5.
4441 2002-05-09 Bruno Haible <bruno@clisp.org>
4443 * config.charset: Update for newest glibc. Add canonical names
4444 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
4446 2002-05-09 Bruno Haible <bruno@clisp.org>
4448 * localcharset.c (get_charset_aliases): Add more Windows specific
4451 2002-05-08 Owen Taylor <otaylor@redhat.com>
4453 * config.charset: A few additions for Solaris.
4455 2001-12-05 Bruno Haible <bruno@clisp.org>
4457 * localcharset.c (locale_charset): Don't return an empty string.
4459 2001-10-23 Bruno Haible <haible@clisp.cons.org>
4461 * config.charset: msdos in uk_UA uses CP1125.
4463 2001-08-05 Bruno Haible <haible@clisp.cons.org>
4465 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
4466 * localcharset.c (locale_charset): Declare as extern "C".
4468 2002-02-15 Bruno Haible <bruno@clisp.org>
4470 * config.charset [msdosdjgpp]: For Russian, use CP866.
4472 2002-02-11 Bruno Haible <bruno@clisp.org>
4474 * config.charset: Add support for NetBSD.
4476 2002-09-25 <karl@gnu.org>
4478 * strdup.c: copy from libc/string (via ../config/srclist*).
4479 * getopt*: copy from libc/posix.
4480 * gettext.h: copy from gettext.
4481 * .cppi-disable: add strdup.c, gettext.h.
4483 2002-07-01 Jim Meyering <meyering@lucent.com>
4485 * c-stack.c: Include sys/time.h.
4486 From Volker Borchert.
4488 2002-06-11 Paul Eggert <eggert@twinsun.com>
4490 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
4491 New macro. Use it uniformly instead of
4492 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
4493 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
4494 reported by Vin Shelton.
4496 2002-06-22 Jim Meyering <meyering@lucent.com>
4498 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
4499 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
4501 2002-06-22 Paul Eggert <eggert@twinsun.com>
4503 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
4504 Do not assume SA_SIGINFO behavior.
4505 Bug reported by Jim Meyering on NetBSD 1.5.2.
4507 2002-06-22 Jim Meyering <meyering@lucent.com>
4509 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
4511 * exitfail.c, exitfail.h: Likewise.
4512 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
4514 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
4516 (EXTRA_DIST): Add fnmatch_loop.c.
4517 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
4519 * fnmatch_loop.c: New file, from diffutils-2.8.2.
4520 * fnmatch.c: Update from diffutils-2.8.2.
4521 * fnmatch_.h: New file. From diffutils-2.8.2.
4522 * fnmatch.h: Remove file.
4524 2002-06-18 Paul Eggert <eggert@twinsun.com>
4526 * file-type.h: Report an error if neither S_ISREG nor
4527 S_IFREG is defined, instead of using a test specific to glibc
4528 2.2. This should be safe, since POSIX requires S_ISREG and
4529 Unix Version 7 had S_IFREG. We don't need to check for
4530 <sys/types.h> since we don't use any symbols that it defines.
4532 2002-06-15 Jim Meyering <meyering@lucent.com>
4534 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
4535 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
4536 have been included before this file.
4538 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
4540 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
4541 so that each temporary file name is unique and valid in the first
4542 8 characters, for operation under DOS.
4544 2002-06-15 Jim Meyering <meyering@lucent.com>
4546 Work even with DJGPP 2.03, which lacks support for symlinks.
4548 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
4550 * lchown.c (S_ISLNK): Likewise.
4552 2002-06-14 Jim Meyering <meyering@lucent.com>
4554 * file-type.h: Use the version from diffutils-2.8.2.
4555 * file-type.c: Likewise.
4557 2002-05-27 Jim Meyering <meyering@lucent.com>
4559 Fix a problem seen only on nonconforming systems whereby ls.c's
4560 use of localtime, and then of gettimeofday would cause trouble:
4561 the localtime call used to initialize rpl_gettimeofday's save
4562 mechanism would clobber ls's current local time information so
4563 that in any long listing the first file would always be listed
4564 with date 1970-01-01. Analysis by Volker Borchert.
4566 * gettimeofday.c (localtime): Undefine.
4567 (rpl_localtime): New function.
4569 2002-05-22 Jim Meyering <meyering@lucent.com>
4571 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
4572 * file-type.h: New file.
4573 * file-type.c (file_type): New file/function. Extracted from diffutils.
4575 2002-04-29 Paul Eggert <eggert@twinsun.com>
4577 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
4579 2002-04-28 Paul Eggert <eggert@twinsun.com>
4581 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
4582 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
4583 of 127, since 64 is the largest conceivable number for ancient
4585 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
4587 2002-04-28 Jim Meyering <meyering@lucent.com>
4589 * sig2str.c (WTERMSIG): Remove definition (unused).
4591 2002-04-28 Paul Eggert <eggert@twinsun.com>
4593 * sig2str.h, sig2str.c: New files.
4594 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
4596 2002-04-24 Jim Meyering <meyering@lucent.com>
4598 * gettext.h: New file, from Gettext.
4599 * Makefile.am (INCLUDES): Remove -I../intl.
4600 (libfetish_a_SOURCES): Add gettext.h.
4602 2002-04-16 Jim Meyering <meyering@lucent.com>
4604 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
4605 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
4606 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
4608 2002-04-12 Jim Meyering <meyering@lucent.com>
4610 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
4612 2002-03-10 Jim Meyering <meyering@lucent.com>
4614 * makepath.c (make_path): Remove a comma from a diagnostic.
4615 Suggestion from Santiago Vila.
4617 2002-03-08 Jim Meyering <meyering@lucent.com>
4619 * rename.c: Mention that this wrapper is needed also on
4620 mips-dec-ultrix4.4 systems.
4622 2002-03-02 Jim Meyering <meyering@lucent.com>
4624 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
4625 not HAVE_CLOCK_SETTIME.
4627 2002-02-27 Paul Eggert <eggert@twinsun.com>
4629 * nanosleep.h: Rename to....
4630 * timespec.h: New name for nanosleep.h. All uses changed.
4632 * gettime.c: New file.
4633 * settime.c: New file.
4636 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
4637 timespec.h. Remove nanosleep.h.
4639 2002-02-25 Paul Eggert <eggert@twinsun.com>
4641 * acl.c, acl.h: New files.
4642 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
4644 2002-02-24 Jim Meyering <meyering@lucent.com>
4646 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
4647 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
4648 cause trouble. Reported by Nelson Beebe.
4650 2002-02-23 Paul Eggert <eggert@twinsun.com>
4652 * path-concat.c (xpath_concat): Reorder code to pacify
4653 compilers that don't know that xalloc_die never returns.
4655 2002-02-20 Jim Meyering <meyering@lucent.com>
4657 * getdate.c: Regenerate using bison-1.33.
4659 2002-02-15 Paul Eggert <eggert@twinsun.com>
4661 * posixver.c, posixver.h: New files.
4662 * Makefile.am (libfetish_a_SOURCES): Add them.
4664 2002-02-02 Paul Eggert <eggert@twinsun.com>
4665 Bruno Haible <bruno@clisp.org>
4667 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
4668 (fwrite_success_callback): New declaration.
4669 * unicodeio.c (unicode_to_mb): New function, extracted from
4670 print_unicode_char. Call failure callback instead of error.
4671 (fwrite_success_callback): New function.
4672 (exit_failure_callback): New function.
4673 (fallback_failure_callback): New function.
4674 (print_unicode_char): Call unicode_to_mb.
4676 2002-01-26 Jim Meyering <meyering@lucent.com>
4678 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
4680 2002-01-22 Jim Meyering <meyering@lucent.com>
4682 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
4683 Otherwise, some versions of automake would omit the rule that makes
4684 Makefile from Makefile.in.
4686 2001-01-21 Paul Eggert <eggert@twinsun.com>
4688 * xmemcoll.h, xmemcoll.c: New files.
4689 * Makefile.am (libfetish_a_SOURCES): Add them.
4690 * memcoll.c: Include errno.h, and declare errno if not defined.
4691 (memcoll): Set errno to zero if there is no error.
4693 * quotearg.c (quotearg_buffer_restyled):
4694 Fix bug with quoting buffers containing NUL when backslashing escapes.
4695 This bug was exposed by the other changes in this patch.
4696 (quotearg_n_options): New arg ARGSIZE.
4697 All callers changed.
4698 (quoting_options_from_style): New function.
4699 (quotearg_n_style): Use it.
4700 (quotearg_n_style_mem): New function.
4702 * quotearg.h (quotearg_n_style_mem): New function.
4704 2002-01-16 Jim Meyering <meyering@lucent.com>
4706 * getdate.y: Add three semicolons, each just before a closing brace.
4707 Bison (as of version 1.31) no longer papers over that mistake.
4709 2002-02-14 Paul Eggert <eggert@twinsun.com>
4711 * backupfile.c (ISDIGIT): Comment fix.
4712 * getdate.y (ISDIGIT): Likewise.
4713 * posixtm.c (ISDIGIT, year): Likewise.
4714 * strverscmp.c (ISDIGIT): Likewise.
4715 * userspec.c (ISDIGIT): Likewise.
4717 2002-01-05 Jim Meyering <meyering@lucent.com>
4719 * version-etc.c (version_etc_copyright): Update copyright year.
4721 2001-01-19 Paul Eggert <eggert@twinsun.com>
4723 * closeout.c (close_stdout_status): If ferror (stdout), do
4724 not silently exit merely because the output buffer happens to
4725 have nothing pending.
4727 2001-12-18 Paul Eggert <eggert@twinsun.com>
4729 See the big note in ../ChangeLog.
4730 * human.c (suffixes): Prefer K to k for 1024.
4731 (generate_suffix_backwards): New function.
4732 (human_readable_inexact): Use it.
4733 * xstrtol.c (__xstrtol): If there is no number but there
4734 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
4735 Accept 'K' as well as 'k'.
4737 2001-12-15 Jim Meyering <meyering@lucent.com>
4739 * regex.h (__restrict_arr): Update from libc.
4741 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
4742 as `remote' if the name starts with `//'. Suggested by Michael Stone.
4745 2001-12-10 Jim Meyering <meyering@lucent.com>
4747 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
4748 Instead, include "xalloc.h".
4749 (initbuffer): Don't cast xmalloc return value to char*.
4750 (readline): Reword comment.
4751 Don't cast xrealloc return value to char*
4754 2001-12-09 Jim Meyering <meyering@lucent.com>
4756 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
4757 `signed and unsigned type in conditional expression'.
4758 * posixtm.c (posix_time_parse): Likewise.
4760 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
4762 * readtokens.c (readtoken): Declare an index to be of type unsigned
4763 to avoid a pedantic warning.
4765 * getstr.c: Don't include assert.h.
4766 (getstr): Remove warning-evoking assertions.
4767 Return -1 if offset parameter is out of bounds.
4768 Change the type of a local from int to size_t.
4770 * strftime.c (my_strftime_localtime_r): Include this function
4771 definition in the `#if ! HAVE_TM_GMTOFF' block.
4773 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
4774 Include xalloc.h instead.
4776 2001-12-02 Jim Meyering <meyering@lucent.com>
4778 * tempname.c: Don't declare getenv, thus reverting the change of
4779 2001-11-18. It's no longer necessary, now that stdlib.h is always
4782 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
4783 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
4785 2001-11-30 Akim Demaille <akim@epita.fr>
4787 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
4788 before being defined.
4790 2001-11-27 Paul Eggert <eggert@twinsun.com>
4792 * quotearg.h (quotearg_n, quotearg_n_style):
4793 First arg is int, not unsigned.
4794 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
4795 (SIZE_MAX, UINT_MAX): New macros.
4796 (quotearg_n_options): Abort if N is negative.
4797 Avoid overflow check on hosts where size_t is 64 bits and int
4798 is 32 bits, as overflow is impossible there.
4799 Fix off-by-one typo that caused unnecessary reallocation.
4801 2001-11-27 Jim Meyering <meyering@lucent.com>
4803 * tempname.c: Merge with version from libc.
4804 * regex.c: Likewise.
4806 * tempname.c: Include stdlib.h unconditionally. On some old systems
4807 for which STDC_HEADERS is 0, it was not included, resulting in a
4808 warning about an integer-to-pointer conversion problem with getenv.
4809 Reported by Volker Borchert.
4811 2001-11-26 Jim Meyering <meyering@lucent.com>
4813 * gtod.h: Remove file.
4814 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
4815 * gettimeofday.c: Don't include gtod.h.
4816 (GTOD_init): Remove function.
4817 (rpl_gettimeofday): Do its job here instead, rather than aborting.
4818 Suggestion from Volker Borchert.
4820 2001-11-23 Jim Meyering <meyering@lucent.com>
4822 * hash.h (struct hash_table): Don't define here. Merely declare it.
4823 * hash.c (struct hash_table): Define it here instead.
4825 2001-11-22 Jim Meyering <meyering@lucent.com>
4827 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
4829 2001-11-18 Paul Eggert <eggert@twinsun.com>
4831 * tempname.c (TMP_MAX): Remove; no longer needed.
4832 (TEMPORARIES): New macro.
4833 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
4834 removes an artificial limitation (e.g. HP-UX 10.20, where
4837 2001-11-18 Jim Meyering <meyering@lucent.com>
4839 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
4842 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
4843 files will be created before anything else.
4845 2001-11-17 Jim Meyering <meyering@lucent.com>
4847 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
4848 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
4849 rather than group writable. Patch by Juan F. Codagnone.
4851 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
4852 Instead, include "xalloc.h".
4854 * mountlist.c: Include unlocked-io.h after all system headers.
4855 Remove explicit declarations of xmalloc, xrealloc,
4856 and xstrdup. Instead, include "xalloc.h".
4858 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
4859 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
4860 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
4862 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
4863 Reported by Padraig Brady.
4865 * mkstemp.c: #undef mkstemp.
4867 (rpl_mkstemp): Rename from mkstemp.
4870 2001-11-16 Jim Meyering <meyering@lucent.com>
4872 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
4873 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
4874 determine the amount of total physical memory, use pstat_getstatic.
4875 HPUX-11 doesn't define _SC_PHYS_PAGES.
4876 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
4877 If sysconf couldn't be used to determine the amount of available
4878 physical memory, use both pstat_getstatic and pstat_getdynamic.
4879 Based on a patch from Bob Proulx.
4881 2001-11-05 Jim Meyering <meyering@lucent.com>
4883 * xstat.in (slash_aware_lstat): Correct a misleading comment.
4885 2001-11-03 Jim Meyering <meyering@lucent.com>
4887 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
4888 in argmatch_to_argument call.
4890 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
4893 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
4894 e.g., a fault due to an attempt to free a NULL pointer.
4896 2001-11-01 Jim Meyering <meyering@lucent.com>
4898 * dirfd.c, dirfd.h: New files.
4899 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
4901 * hash.c (hash_print) [TESTING]: Clean up.
4903 2001-10-22 Paul Eggert <eggert@twinsun.com>
4905 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
4906 to avoid a warning if -Wall.
4908 2001-10-21 Paul Eggert <eggert@twinsun.com>
4910 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
4912 2001-10-21 Jim Meyering <meyering@lucent.com>
4914 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
4915 this code would end up calling gettext even in packages built
4917 * getopt.c (_): Likewise.
4918 * regex.c (_): Likewise.
4920 2001-10-20 Paul Eggert <eggert@twinsun.com>
4922 * error.c (strerror_r): Do not declare unless !_LIBC.
4923 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
4924 Use strerror_r that is only a macro, even if it is not a function.
4925 (strerror): Check for HAVE_DECL_STRERROR before declaring.
4926 (private_strerror): Use prototypes, not old-style function definition.
4927 (print_errno_message): New function.
4928 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
4930 (error_tail, error, error_at_line): Use it.
4932 2001-10-11 Jim Meyering <meyering@lucent.com>
4934 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
4935 and quote_n (1, ... to avoid clobbering a buffer.
4937 2001-10-05 Jim Meyering <meyering@lucent.com>
4939 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
4940 * hash-pjw.c: New file (factored out of fileutils' remove.c).
4941 * hash-pjw.h: New file.
4943 2001-09-30 Jim Meyering <meyering@lucent.com>
4945 * mountlist.c [MOUNTED_GETFSSTAT]:
4946 Include <sys/ucred.h>, for Apple Darwin.
4947 Include sys/mount.h and sys/fs_types.h only if available.
4949 (read_filesystem_list): Use FS_TYPE.
4951 2001-09-29 Paul Eggert <eggert@twinsun.com>
4953 * exclude.c (excluded_filename): 0 -> false, since it's
4956 2001-09-28 Paul Eggert <eggert@twinsun.com>
4958 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
4959 #defines strtoimax. Also treat the other strto* functions
4962 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
4963 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
4964 (strtoimax, strtoumax): Do not declare if already defined as a macro.
4966 2001-09-26 Jim Meyering <meyering@lucent.com>
4968 Most macros in unlocked-io.h had the wrong number of arguments.
4969 * gen-uio: New script.
4970 (USE_UNLOCKED_IO): Define to 1 if not already defined.
4971 * unlocked-io.hin: Remove file.
4972 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
4973 rather than trying to embed it here.
4974 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
4975 Reported by Padraig Brady.
4977 2001-09-25 Volker Borchert <bt@teknon.de>
4979 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
4981 2001-09-23 Jim Meyering <meyering@lucent.com>
4983 * mountlist.c: Remove useless parentheses in #if directives.
4984 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
4985 the deprecated MOUNTED symbol is no longer defined in mntent.h.
4987 2001-09-22 Jim Meyering <meyering@lucent.com>
4989 * localcharset.c: Update from latest gettext.
4990 * config.charset: Likewise.
4992 2001-09-20 Jim Meyering <meyering@lucent.com>
4994 * xstrtol.c (strtoimax): Guard declaration with
4995 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
4996 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
4997 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
4998 (strtoumax): Likewise, for completeness (it wasn't necessary).
5000 2001-09-06 Paul Eggert <eggert@twinsun.com>
5002 * strtoimax.c (HAVE_LONG_LONG):
5003 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
5004 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
5005 to work around bug in IBM C compiler.
5007 2001-09-16 Jim Meyering <meyering@lucent.com>
5009 * mkdir.c: New file.
5011 2001-09-04 Paul Eggert <eggert@twinsun.com>
5013 * xgetcwd.c: Revert some of the previous change; intead,
5014 fix the HAVE_GETCWD_NULL code to behave more like the
5015 !HAVE_GETCWD_NULL code used to.
5018 (xgetcwd): Do not return NULL when memory is exhausted; instead,
5021 2001-09-04 Paul Eggert <eggert@twinsun.com>
5023 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
5024 Use ssize_t, not int, to store result of readlink.
5025 Check for ssize_t overflow as well as size_t overflow,
5026 as POSIX says the result of readlink is implementation-defined
5027 when ssize_t overflows.
5028 Remove unnecessary cast to char*.
5029 Use free+malloc instead of realloc, as the storage doesn't need
5030 to be preserved and it's clearer and can be more efficient that way.
5031 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
5032 * xreadlink.h (xreadlink): Update prototype.
5034 2001-09-03 Paul Eggert <eggert@twinsun.com>
5036 * exclude.c (fnmatch_no_wildcards): Fix confusion between
5037 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
5038 spotted by Jim Meyering.
5040 2001-09-03 Jim Meyering <meyering@lucent.com>
5042 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
5044 2001-09-03 Paul Eggert <eggert@twinsun.com>
5046 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
5047 like the HAVE_GETCWD_NULL code.
5048 Include pathmax.h if not HAVE_GETCWD.
5049 Do not include xalloc.h.
5050 (INITIAL_BUFFER_SIZE): New symbol.
5051 Do not use xmalloc / xrealloc, since the caller is responsible for
5052 handling errors. Preserve errno around `free' during failure.
5053 Do not overrun buffer when using getwd.
5055 2001-09-03 Paul Eggert <eggert@twinsun.com>
5057 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
5058 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
5060 2001-09-02 Jim Meyering <meyering@lucent.com>
5062 * error.c: Update from GNU libc.
5064 2001-09-01 Jim Meyering <meyering@lucent.com>
5066 * xreadlink.c: New file.
5067 * xreadlink.h: New file.
5068 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
5070 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
5071 doesn't conflict with sparc Solaris 7's definition in
5072 /usr/include/sys/int_types.h.
5074 * exclude.c: Use `""', not `<>' to #include non-system header files.
5075 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
5076 and strncasecmp as r-values. Unixware didn't have declarations.
5078 2001-08-31 Jim Meyering <meyering@lucent.com>
5080 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
5081 Use an initial, malloc'd, buffer of length 128 rather than
5082 a statically allocated one of length 1024.
5084 2001-08-30 Paul Eggert <eggert@twinsun.com>
5086 * xgetcwd.c: Don't include pathmax.h.
5087 Include stdlib.h and unistd.h if available.
5089 (xmalloc, xstrdup, free): Remove decls.
5090 (xgetcwd): Don't assume sizes fit in unsigned.
5091 Check for overflow when computing sizes.
5092 Simplify reallocation code.
5094 2001-08-28 Paul Eggert <eggert@twinsun.com>
5096 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
5098 * strtoimax.c: Renamed from strtoxmax.c, removing the
5101 Also, make the following further changes to make this file's
5102 configuration more similar to that of strtol.c:
5103 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
5104 (strtoumax, uintmax_t, strtoull, strtol): Remove.
5105 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
5106 (strtoimax): Renamed from strtoumax. All uses of unsigned values
5107 changed to signed values.
5109 And make the following changes as well:
5110 Fix copyright notice, as 1999 was missing.
5111 (verify): New macro.
5112 (strtoimax): Check sizes at compile-time, not run-time.
5113 Prefer strtol to strtoll if both work.
5114 (main): Remove; it was not that useful and was a pain to maintain.
5116 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
5118 2001-08-30 Paul Eggert <eggert@twinsun.com>
5120 * savedir.c (savedir): Remove size parameter, as POSIX says that
5121 a directory's st_size can have an arbitrary value, so the old
5122 usage could waste an arbitrary amount of memory. All uses
5124 * savedir.h: Update prototype.
5126 2001-08-30 Paul Eggert <eggert@twinsun.com>
5128 * xstrtol.c (strtoimax): New decl.
5130 2001-08-28 Paul Eggert <eggert@twinsun.com>
5132 * xstrtol.h: Add copyright notice.
5133 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
5134 LONGINT_INVALID_SUFFIX_CHAR.
5136 2001-08-30 Paul Eggert <eggert@twinsun.com>
5138 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5141 2001-08-30 Paul Eggert <eggert@twinsun.com>
5143 * hash.c: Remove '2001' from copyright notice.
5145 2001-08-30 Paul Eggert <eggert@twinsun.com>
5147 * full-write.h: New file.
5148 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
5149 * full-write.c: Correct credits, as cccp.c no longer
5150 exists and anyway it was so heavily changed from the old cccp
5151 code as to be unrecognizable. Include full-write.h.
5152 (full_write) Return size_t, with short writes meaning failure.
5153 All callers changed. This fixes a bug with large buffers
5155 * utime.c: Include full-write.h.
5157 2001-08-30 Paul Eggert <eggert@twinsun.com>
5159 Merge 'exclude' changes from tar 1.13.22.
5160 This fixes one or two unlikely storage allocation overflow bugs,
5161 but doesn't change user-visible behavior otherwise.
5163 2001-08-30 Paul Eggert <eggert@twinsun.com>
5165 * exclude.c (bool): Declare, perhaps by including stdbool.h.
5166 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
5167 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
5168 Include if available.
5169 (<xalloc.h>): Include
5170 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
5171 (verify): New macro. Use it to verify that EXCLUDE macros do not
5172 collide with FNM macros.
5173 (struct patopts): New struct.
5174 (struct exclude): Use it, as exclude patterns now come with options.
5175 (new_exclude): Support above changes.
5176 (new_exclude, add_exclude_file):
5177 Initial size must now be a power of two to simplify overflow checking.
5178 (free_exclude, fnmatch_no_wildcards): New function.
5179 (excluded_filename): No longer requires options arg, as the options
5180 are determined by add_exclude. Now returns bool, not int.
5181 (excluded_filename, add_exclude):
5182 Add support for the fancy new exclusion options.
5183 (add_exclude, add_exclude_file): Now takes int options arg.
5184 Check for arithmetic overflow when computing sizes.
5185 (add_exclude_file): xrealloc might modify errno, so don't
5186 realloc until after errno might be used.
5188 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
5190 (free_exclude): New decl.
5191 (add_exclude, add_exclude_file): Now takes int options arg.
5192 (excluded_filename): No longer requires options arg, as the options
5193 are determined by add_exclude. Now returns bool, not int.
5195 2001-08-30 Paul Eggert <eggert@twinsun.com>
5197 * alloca.c (alloca): Arg is of type size_t, not unsigned.
5199 2001-08-27 Jim Meyering <meyering@lucent.com>
5201 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
5203 * version-etc.c (N_): Remove definition.
5204 Revert most of last change.
5205 Instead, simply don't mark the `Copyright...' string for translation.
5206 Based on advice from Paul Eggert.
5208 * strtoxmax.c: Tweak comment.
5210 2001-08-26 Jim Meyering <meyering@lucent.com>
5212 * version-etc.c (version_etc_copyright_fmt): Replace literal year
5213 of copyright with `%s' so translators don't get an untranslated
5215 (COPYRIGHT_YEAR): Define.
5216 (version_etc): Use fprintf rather than fputs.
5217 Suggestion from Ulrich Drepper.
5219 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5221 * strtoll.c: New file, from GNU libc.
5222 * xstrtoimax.c: New file.
5224 * xstrtol.h: Add xstrtoimax.
5225 * strtoumax.c: New file. Simply include "strtoumax.c".
5226 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
5228 * strtoumax.c: Factor to work both for unsigned and signed types, ...
5229 * strtoxmax.c: ... then renamed to this.
5231 2001-08-13 Paul Eggert <eggert@twinsun.com>
5233 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
5234 Port to Solaris 8, where 'sed' requires a space after the 'r'
5235 command, and where sh dislikes "$/". Clean up the spacing a bit.
5236 Redirect output to $tmp just once.
5238 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
5240 * addext.c (<errno.h>): Include.
5241 (errno): Declare if not defined.
5242 (addext): Work correctly when pathconf returns -1 and leaves
5243 errno alone because there is no limit. Also, work even if
5244 pathconf returns a value greater than SIZE_MAX.
5246 2001-08-12 Jim Meyering <meyering@lucent.com>
5248 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
5249 Simply `return getcwd (NULL, 0);'.
5250 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
5251 Use 1300 as initial value for length, not PATH_MAX.
5253 * pathmax.h: Clean up cpp syntax.
5255 2001-08-12 Jim Meyering <meyering@lucent.com>
5257 * gettimeofday.c: New file.
5259 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
5261 2001-08-04 Jim Meyering <meyering@lucent.com>
5263 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
5264 to get in sync with glibc.
5266 2001-08-03 Paul Eggert <eggert@twinsun.com>
5268 The following changes are from gettext 0.10.39 as maintained by
5271 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
5272 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
5273 with inverted sense. All uses changed.
5275 * mbswidth.c: Don't include <limits.h>.
5276 Include <stdlib.h> and <string.h> unconditionally.
5277 (iswcntrl, mbsinit, ISCNTRL): New macros.
5278 (mbsnwidth): Use K&R style function declarations.
5279 Don't bother checking for MB_LEN_MAX == 1, since the compiler
5280 can optimize it when MB_CUR_MAX == 1.
5281 The width of control characters is zero, not 1.
5283 2001-07-15 Jim Meyering <meyering@lucent.com>
5285 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
5286 (BUILT_SOURCES): Add unlocked-io.h.
5287 (io_functions): Define.
5288 (unlocked-io.h): New rule.
5289 (DISTCLEANFILES): Add unlocked-io.h.
5290 (all-local): Depend on unlocked-io.h, to ensure it is created.
5292 * unlocked-io.hin: New file
5294 * regex.c: Update from glibc.
5296 2001-07-05 Jim Meyering <meyering@lucent.com>
5298 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
5300 (libfetish_a_SOURCES): Put all .h files here instead.
5301 Remove a thus-exposed (better checks in automake) duplicate and
5302 two unnecessary .h files.
5304 2001-06-11 Jim Meyering <meyering@lucent.com>
5306 * regex.c: Update from GNU libc.
5308 2001-05-27 Jim Meyering <meyering@lucent.com>
5310 * readutmp.h (UT_TYPE): Define.
5312 2001-05-24 Jim Meyering <meyering@lucent.com>
5314 * argmatch.c: Include "quote.h".
5315 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
5316 quote function. Reported by Göran Uddeborg.
5318 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
5320 * dirname.c (dir_name): Compute append_dot using path, not newpath
5321 which is not yet declared.
5323 2001-05-11 Paul Eggert <eggert@twinsun.com>
5325 * Makefile.am (libfetish_a_SOURCES):
5326 Add strftime.c, since we now compile it on all hosts.
5328 * strftime.c (my_strftime):
5329 Define to nstrftime if emacs, but only if my_strftime is not defined.
5330 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
5331 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
5332 Add one more extra argument: a nanoseconds value.
5335 (my_strftime function): Add %N format.
5336 (emacs_strftimeu): Renamed from emacs_strftime,
5337 with extra ut argument.
5339 2001-05-11 Paul Eggert <eggert@twinsun.com>
5341 dirname code cleanup. base_name now behaves more compatibly
5342 with POSIX basename when given file names that have trailing
5343 slashes, and similarly for dir_name. Add new primitives
5344 base_len and dir_len. Put the directory-name-related decls
5347 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
5348 * backupfile.c (base_name): Likewise.
5349 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
5350 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
5351 * makepath.c (strip_trailing_slashes): Likewise.
5352 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
5354 * rename.c (strip_trailing_slashes): Likewise.
5355 * same.c (base_name): Likewise.
5356 * stripslash.c (ISSLASH): Likewise.
5358 * addext.c: Include <dirname.h> after size_t is defined.
5359 * backupfile.c: Likewise.
5361 * addext.c (addext): Use base_len to trim redundant
5362 trailing slashes instead of doing it ourselves.
5363 But do not trim the last slash if it is not redundant.
5365 * backupfile.c (find_backup_file_name,
5366 max_backup_version): Use base_len instead of rolling it ourselves.
5367 Handle the case of "" and (on DOS) "C:" correctly.
5369 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
5370 Include <string.h>, <dirname.h>.
5371 (base_name): Allow file names ending in slashes, other than names
5372 that are all slashes. In this case, return the basename followed
5373 by the slashes. This is more general, and can be used in places
5374 where the original base_name purposely had an assertion failure.
5375 (base_len): New function.
5377 * dirname.c: Include <string.h> instead of <stdlib.h>.
5378 Do not include <assert.h>; no longer needed.
5380 (memrchr): Remove decl.
5381 (dir_name_r): Remove.
5382 (dir_len): Renamed from dirlen. All callers changed.
5383 Rewrite in terms of base_name, for simplicity and consistency.
5384 (dir_name): Never return NULL. All callers changed.
5385 Do not include <stdlib.h> in test program; no longer needed.
5386 return 0; is fine for test program.
5388 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
5390 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
5392 * path-concat.c (path_concat): Use base_len to compute
5393 base length, not strlen; this means we cannot rely on memcpy
5396 * same.c (STREQ): Remove.
5397 (same_name): Handle the case where the basename ends in trailing '/'.
5399 * stripslash.c (strip_trailing_slashes): Return nonzero if
5400 a slash was stripped. Do not strip the last slash after a
5403 2001-04-08 Jim Meyering <meyering@lucent.com>
5405 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
5406 recomputed; that's necessary when the offset spans a DST transition.
5407 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
5409 2001-04-02 Jim Meyering <meyering@lucent.com>
5411 * regex.h, regex.c: Update from GNU libc.
5413 2001-03-19 Paul Eggert <eggert@twinsun.com>
5415 * version-etc.c (version_etc_copyright): Update to 2001.
5417 2001-03-16 Paul Eggert <eggert@twinsun.com>
5419 * tempname.c (uint64_t): Define to uintmax_t if
5420 not defined, and if UINT64_MAX is not defined.
5421 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5422 Reported by John David Anglin.
5424 2001-03-10 Bruno Haible <haible@clisp.cons.org>
5426 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5427 alias if codeset is empty.
5428 * config.charset (BeOS): Use wildcard syntax.
5430 2001-03-13 Jim Meyering <meyering@lucent.com>
5432 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5433 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5436 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5438 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5440 * unicodeio.c (print_unicode_char): Simplify accordingly.
5442 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5444 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5445 support for DOS/DJGPP.
5447 2001-02-28 Paul Eggert <eggert@twinsun.com>
5449 * Makefile.am (libfetish_a_SOURCES):
5450 Add dup-safer.c, fopen-safer.c.
5451 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5453 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5455 2001-02-25 Paul Eggert <eggert@twinsun.com>
5457 The mkstemp replacement is taken from glibc 2.2.2, with some
5458 portability fixes for use outside glibc, as follows:
5460 * tempname.c (struct_stat64): New macro.
5461 (direxists, __gen_tempname): Use it.
5462 This avoids a portability problem with Solaris 8.
5464 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5465 (<stddef.h>, <stdint.h>, <string.h>):
5466 Include only if STDC_HEADERS || _LIBC.
5467 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5468 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5469 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5470 (__set_errno): Define this macro if <errno.h> doesn't.
5471 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
5472 Define these macros if <stdio.h> doesn't.
5473 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
5474 Define these macros if <sys/stat.h>
5475 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
5476 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
5477 __xstat64): Define if not _LIBC.
5478 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
5479 (__gen_tempname): Invoke gettimeofday only if
5480 HAVE_GETTIMEOFDAY || _LIBC;
5481 otherwise, fall back on plain "time".
5482 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
5484 * mkstemp.c (__GT_FILE): Define to zero if not defined.
5486 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
5488 2001-02-17 Jim Meyering <meyering@lucent.com>
5490 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
5491 around included file name.
5493 * strnlen.c (__strnlen): Merge in a change from GNU libc.
5495 * strftime.c: Update from GNU libc (the only changes were to comments).
5497 2001-02-13 Bruno Haible <haible@clisp.cons.org>
5499 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
5501 2001-02-17 Paul Eggert <eggert@twinsun.com>
5503 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
5504 Remove workaround macros for hosts that have mbrtowc but not
5505 mbstate_t, as we now insist on proper declarations for both
5506 before using mbrtowc.
5508 2001-02-17 Jim Meyering <meyering@lucent.com>
5510 * regex.c: Update from libc.
5512 2001-02-16 Paul Eggert <eggert@twinsun.com>
5514 * alloca.c (malloc): Undef before defining, since stdlib.h
5515 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
5516 Reported by Mark Hounschell via Paul Eggert.
5518 2001-01-30 Bruno Haible <haible@clisp.cons.org>
5520 * config.charset: Update for FreeBSD 4.2.
5522 2001-01-26 Jim Meyering <meyering@lucent.com>
5524 * quotearg.c: Include stddef.h.
5525 * quote.c: Include stddef.h.
5526 Reported by Axel Kittenberger.
5528 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
5529 line in double quotes so that it evokes a better diagnostic.
5530 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
5531 Reported by Axel Kittenberger.
5533 2001-01-15 Bruno Haible <haible@clisp.cons.org>
5535 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
5536 to avoid a warning. Add back 'const' to inptr.
5538 2001-01-16 Jim Meyering <meyering@lucent.com>
5540 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
5543 2001-01-14 Jim Meyering <meyering@lucent.com>
5545 * rename.c: New file. From Volker Borchert.
5546 Include stdlib.h, string.h or strings.h, and xalloc.h.
5547 Use strip_trailing_slashes rather than open-coding it.
5549 2001-01-03 Paul Eggert <eggert@twinsun.com>
5551 * strftime.c: Sync with glibc time/strftime.c 1.81.
5553 2001-01-03 Jim Meyering <meyering@lucent.com>
5555 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
5556 local `inptr' to avoid warning with some system declarations of iconv.
5558 2000-12-29 Paul Eggert <eggert@twinsun.com>
5560 * modechange.c: Do not assume that mode_t uses the
5561 traditional octal encoding. E.g. "chmod 1 FOO" should set
5562 the other-execute bit of FOO even if S_IXOTH != 1.
5564 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
5565 WOTH, XOTH, ALLM): New macros.
5566 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
5567 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
5569 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
5570 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
5572 No need to use uintmax_t; unsigned long is long enough.
5573 Don't bother to get suffix since we don't use it.
5575 2000-12-24 Jim Meyering <meyering@lucent.com>
5577 * hash.c (is_prime): Return explicit boolean values.
5578 (hash_get_first): Return NULL to appease Irix5.6's 89.
5579 Reported by Nelson Beebe.
5581 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5583 * localcharset.c (locale_charset): Add support for Win32.
5585 2000-12-18 Paul Eggert <eggert@twinsun.com>
5587 * physmem.h, physmem.c: New files.
5589 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
5590 (noinst_HEADERS): Add physmem.h.
5592 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
5593 't' for compatibility with Solaris 8 sort.
5595 2000-12-18 Bruno Haible <haible@clisp.cons.org>
5597 * config.charset: Add support for BeOS.
5599 2000-12-16 Jim Meyering <meyering@lucent.com>
5601 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
5602 SHELLS_FILE to a file name that's useful on djgpp systems.
5604 (ADDITIONAL_DEFAULT_SHELLS): Define.
5605 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
5606 Based mostly on a patch from Prashant TR.
5608 2000-12-16 Jim Meyering <meyering@lucent.com>
5610 This bug had a serious impact on chown: `chown N:M FILE' (for integer
5611 N and M) would have treated it like `chown N:N FILE'.
5613 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
5615 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5617 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
5618 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
5619 to the list of canonical encodings. Rename EUC-CN to GB2312.
5621 2000-12-08 Andreas Schwab <schwab@suse.de>
5623 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
5624 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
5626 2000-12-07 Jim Meyering <meyering@lucent.com>
5628 * stripslash.c (ISSLASH): Define.
5629 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
5632 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
5633 (dir_name_r): Declare this function as static.
5634 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
5635 manifest itself on a name containing a mix of slashes and
5637 Make this function work with names starting with a DOS-style
5638 drive letter and colon prefix.
5639 (dir_name): Append `.' if necessary.
5640 Based mostly on patches from Prashant TR and Eli Zaretskii.
5642 * dirname.h (dir_name_r): Remove prototype.
5644 2000-12-05 Jim Meyering <meyering@lucent.com>
5646 * dirname.c (dir_name_r): Add `const' in a few local declarations.
5648 2000-12-04 Jim Meyering <meyering@lucent.com>
5650 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
5651 Also include memory.h, stdlib.h, unistd.h if appropriate.
5652 Reported by Andreas Jaeger (conflicting declaration of malloc).
5654 2000-12-02 Jim Meyering <meyering@lucent.com>
5656 * closeout.h: Make idempotent, to avoid some obscure warnings.
5658 2000-12-01 Paul Eggert <eggert@twinsun.com>
5660 * memrchr.c: Include <config.h> before any system include file.
5662 2000-11-29 Paul Eggert <eggert@twinsun.com>
5664 * dirname.c (dir_name_r): Fix typo: int -> size_t.
5666 2000-11-26 Jim Meyering <meyering@lucent.com>
5668 * memcoll.c: Include sys/types.h. From Werner Almesberger.
5670 2000-11-22 Paul Eggert <eggert@twinsun.com>
5672 * strftime.c (my_strftime): Do not invoke mbrlen with a
5673 size of (size_t) -1; it's not portable.
5675 2000-11-17 Akim Demaille <akim@epita.fr>
5677 * obstack.h: Formatting changes.
5678 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
5679 prevent type checking.
5680 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
5681 cast the value to (void *): assigning a `foo *' to a `void *'
5683 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
5685 2000-11-17 Jim Meyering <meyering@lucent.com>
5687 * strstr.c: Update from GNU libc.
5689 2000-11-16 Jim Meyering <meyering@lucent.com>
5691 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
5693 2000-11-11 Jim Meyering <meyering@lucent.com>
5695 * error.c: Add a couple #includes, merging from GNU libc version.
5697 2000-11-10 Jim Meyering <meyering@lucent.com>
5699 * obstack.h: Update from GNU libc.
5700 * obstack.c: Likewise.
5702 2000-11-06 Paul Eggert <eggert@twinsun.com>
5704 * getusershell.c (setusershell): Use rewind rather than
5705 fseek/fseeko, to avoid configuration hassles with fseeko.
5706 Don't bother opening SHELLS_FILE if shellstream is NULL;
5709 2000-11-05 Jim Meyering <meyering@lucent.com>
5711 * makepath.h (make_dir): Declare.
5712 * makepath.c (make_dir): Remove `static' attribute.
5715 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
5717 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
5718 last one in a bucket, advance to the next bucket.
5720 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
5722 * fnmatch.c: Do not comment out all the code if we are using
5723 the GNU C library, because in some cases we are replacing buggy
5724 code in the GNU C library itself.
5726 2000-10-30 Paul Eggert <eggert@twinsun.com>
5728 * error.h, getline.h, modechange.h:
5729 Remove "2000" from Copyright line, as the file hasn't been
5730 changed this year other than in the copyright notice.
5732 * xalloc.h: Add "2000" to Copyright line, as this file
5733 was changed this year.
5735 2000-10-30 Paul Eggert <eggert@twinsun.com>
5737 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
5738 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
5739 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
5741 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
5743 * regex.h (__restrict_arr): Move definition out of #ifndef block.
5744 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
5745 doesn't define __restrict_arr.
5747 2000-10-29 Jim Meyering <meyering@lucent.com>
5749 * xstat.in: Fix grammar in comment.
5751 2000-10-28 Jim Meyering <meyering@lucent.com>
5753 * memchr.c: Update from libc.
5754 Adjust for portability:
5755 [HAVE_STDLIB_H]: Include stdlib.h.
5756 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
5757 Undef __memchr, too.
5758 [!weak_alias]: Define __memchr to memchr.
5760 * regex.c: Update from libc.
5761 * regex.h: Likewise.
5762 * getopt1.c: Likewise.
5763 * memcmp.c: Likewise.
5765 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
5766 Avoid using fseek, when possible -- it's broken by design.
5767 Patch by Ulrich Drepper.
5769 2000-10-26 Jim Meyering <meyering@lucent.com>
5771 * strftime.c: Update from libc.
5773 2000-10-25 Jim Meyering <meyering@lucent.com>
5775 * obstack.c: Update from libc.
5777 2000-10-23 Jim Meyering <meyering@lucent.com>
5779 * hard-locale.c (hard_locale): Revert last change -- it was simply
5780 wrong. That set_locale call must not have any side effects.
5783 2000-10-22 Jim Meyering <meyering@lucent.com>
5785 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
5786 [CYCLIC]: Remove now-unused definition.
5788 * save-cwd.c (O_DIRECTORY): Define, if needed.
5789 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
5790 Suggestion from Ulrich Drepper.
5792 2000-10-21 Jim Meyering <meyering@lucent.com>
5794 * dirname.c (dir_name_r): New function, factored out of dir_name.
5795 (dir_name): Use dir_name_r.
5796 * dirname.h (dir_name_r): Declare it.
5798 2000-10-21 Jim Meyering <meyering@lucent.com>
5800 * dirname.c (memrchr): Declare if necessary.
5801 (dir_name): Remove the restriction that there be no
5802 trailing slashes. Now, this code skips past them, effectively
5804 [TEST_DIRNAME] (main): New unit tests.
5806 * memrchr.c: New file from GNU libc.
5807 Undef __memrchr, too.
5808 [!weak_alias]: Define __memrchr to memrchr.
5809 Guard weak_alias use with `#ifdef weak_alias'.
5811 2000-10-17 Jim Meyering <meyering@lucent.com>
5813 * quote.h (PARAMS): Define and use.
5814 Reported by Akim Demaille.
5816 * getopt.c: Update from libc.
5818 2000-10-16 Jim Meyering <meyering@lucent.com>
5820 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
5823 2000-09-25 Jim Meyering <meyering@lucent.com>
5825 * md5.h (rol): Define (from GnuPG).
5827 * sha.c: Give credit (GnuPG) where due.
5828 (M): Use rol rather than open-coding it.
5829 Add a FIXME comment.
5831 2000-09-21 Jim Meyering <meyering@lucent.com>
5833 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
5834 Reported by Michael Stone.
5836 2000-09-20 Jim Meyering <meyering@lucent.com>
5838 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
5839 (noinst_HEADERS): Add sha.h.
5840 Based on code from Scott G. Miller and from GnuPG.
5842 2000-09-15 Jim Meyering <meyering@lucent.com>
5844 * regex.c: Update from libc.
5846 2000-09-10 Jim Meyering <meyering@lucent.com>
5848 * getopt.c (_getopt_internal): Update from glibc.
5850 2000-09-09 Jim Meyering <meyering@lucent.com>
5852 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
5853 think it should be used as a general replacement for isascii.
5854 * fnmatch.c: Likewise.
5855 * mbswidth.c: Likewise
5856 * regex.c: Likewise.
5859 * userspec.c: Include sys/param.h and limits.h.
5861 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
5862 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
5863 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
5864 UID, GID. Check range.
5866 2000-09-06 Jim Meyering <meyering@lucent.com>
5868 * getopt.c (_getopt_internal): Update from glibc.
5870 2000-08-30 Jim Meyering <meyering@lucent.com>
5872 * strftime.c: Merge in changes from GNU libc.
5874 2000-08-26 Jim Meyering <meyering@lucent.com>
5876 * closeout.c: Include "__fpending.h".
5877 (close_stdout_status): Return right away if there's nothing to flush.
5879 * Makefile.am (noinst_HEADERS): Add __fpending.h.
5880 * __fpending.c: New file.
5881 * __fpending.h: New file.
5883 2000-08-07 Paul Eggert <eggert@twinsun.com>
5885 Standardize on "memory exhausted" instead of "Memory exhausted"
5886 or "virtual memory exhausted".
5887 * obstack.c (print_and_abort): Use "memory exhausted", not
5888 "virtual memory exhausted".
5889 * same.c (same_name): Invoke xalloc_die instead of printing
5891 * userspec.c (parse_user_spec): Likewise.
5892 * bumpalloc.h: comment fix
5893 * same.c, userspec.c: Include xalloc.h.
5895 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
5896 not char *const and pointing to a constant array.
5897 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
5898 (xrealloc): Comment fix.
5900 * userspec.c (parse_user_spec):
5901 Don't translate a message until just before returning,
5902 to avoid unnecessary translation.
5904 2000-08-07 Jim Meyering <meyering@lucent.com>
5906 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
5907 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
5908 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
5909 getgroups.c, gethostname.c, getopt.h, group-member.c,
5910 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
5911 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
5912 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
5913 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
5914 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
5915 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
5916 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
5917 yesno.c: Back out Copyright date changes for each file with no change
5918 this year. This eases coordination with other programs using the same
5919 source code modules. From Paul Eggert.
5921 2000-08-03 Greg McGary <greg@mcgary.org>
5923 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
5924 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
5925 (EXTEND_BUFFER): Use them.
5927 2000-08-01 Jim Meyering <meyering@lucent.com>
5929 * dirname.c (ISSLASH): Define.
5930 (BACKSLASH_IS_PATH_SEPARATOR): Define.
5931 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
5932 both `\' and `/' may be use as path separators.
5933 Based on a patch from Prashant TR.
5935 2000-07-31 Paul Eggert <eggert@twinsun.com>
5937 * quotearg.c (quotearg_n_options): Don't make the initial
5938 slot vector a constant, since it might get modified.
5940 2000-07-31 Jim Meyering <meyering@lucent.com>
5942 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
5943 * obstack.c (print_and_abort): Likewise.
5945 2000-07-30 Paul Eggert <eggert@twinsun.com>
5947 * quotearg.c (quotearg_n_options): Preallocate a slot 0
5948 buffer, so that the caller can always quote one small
5949 component of a "memory exhausted" message in slot 0.
5950 From a suggestion by Jim Meyering.
5952 2000-07-30 Jim Meyering <meyering@lucent.com>
5954 * makepath.c (make_path): Quote the other instance, too.
5956 * quotearg.c (N_STATIC_SLOTVECS): Define.
5957 (STATIC_BUF_SIZE): Define.
5958 (quotearg_n_options): Use only statically allocated storage when
5959 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
5960 than STATIC_BUF_SIZE.
5962 2000-07-29 Jim Meyering <meyering@lucent.com>
5964 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
5965 * dirname.c (dir_name): Likewise.
5967 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
5969 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
5970 (dir_name): Assert that there are no trailing slashes.
5972 2000-07-18 Bruno Haible <haible@clisp.cons.org>
5974 * mbswidth.h (mbswidth): Add a flags argument.
5975 (mbswidth): New declaration.
5976 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
5977 * mbswidth.c (mbswidth): Add a flags argument.
5978 (mbsnwidth): New function.
5980 2000-07-24 Jim Meyering <meyering@lucent.com>
5982 * mbswidth.c: Remove useless #else. From Bruno Haible.
5984 2000-07-23 Paul Eggert <eggert@twinsun.com>
5986 * mbswidth.c (_XOPEN_SOURCE):
5987 Don't define; this causes problems on Solaris 7.
5988 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
5990 2000-07-23 Paul Eggert <eggert@twinsun.com>
5993 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
5994 so that mbstate_t is always defined.
5996 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
5997 be 1 in at least one GCC installation, and this configuration
5998 error is likely to be common. Ignoring MB_LEN_MAX hurts
5999 performance on hosts that have mbrtowc but have only unibyte
6000 locales, but I assume these hosts are rare.
6002 2000-07-23 Paul Eggert <eggert@twinsun.com>
6004 * quotearg.c: Streamline by invoking multibyte code only if needed.
6005 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
6006 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
6007 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
6008 invoke multibyte primitives.
6010 2000-07-23 Jim Meyering <meyering@lucent.com>
6012 * basename.c (base_name): Add an assertion.
6014 2000-07-15 Bruno Haible <clisp.cons.org>
6016 * quotearg.c: When the system forces us to redefine mbstate_t,
6017 shadow its mbsinit function.
6019 2000-07-16 Bruno Haible <haible@clisp.cons.org>
6021 * mbswidth.h: New file.
6022 * mbswidth.c: New file.
6023 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
6024 (noinst_HEADERS): Add mbswidth.h.
6026 2000-07-17 Bruno Haible <haible@clisp.cons.org>
6028 * config.charset: Add support for FreeBSD. Improve support for HP-UX
6031 2000-07-15 Jim Meyering <meyering@lucent.com>
6033 * makepath.c: Include quote.h.
6034 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
6035 corresponding argument in a `quote (...)' call.
6036 Give better diagnostics.
6038 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
6039 (noinst_HEADERS): Add quote.h.
6041 * quote.c (quote, quote_n): New file. Two functions taken verbatim
6042 from tar's src/misc.c.
6043 * quote.h: New file. Prototypes for same.
6045 2000-07-10 Paul Eggert <eggert@twinsun.com>
6047 From a suggestion by Bruno Haible.
6048 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
6049 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
6050 to decide whether to define the BeOS workaround macro;
6051 this adjusts to the change to AC_MBSTATE_T.
6053 2000-07-13 Paul Eggert <eggert@twinsun.com>
6055 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
6057 * quotearg.c (quoting_style_args, quoting_style_vals,
6058 quotearg_buffer_restyled): Add support for
6059 clocale_quoting_style. Undo previous change to
6060 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
6061 and "{RIGHT QUOTATION MARK}" msgids.
6063 2000-07-05 Paul Eggert <eggert@twinsun.com>
6065 The old behavior of quoting `like this' doesn't look good with
6066 newer, ISO-style fonts. See:
6067 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
6069 Instead, quote "like this" by default. Let the translator
6070 tailor the locale-specific quoting behavior by providing
6071 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
6073 * quotearg.c (N_): New macro.
6074 (gettext_default): New function.
6075 (quotearg_buffer_restyled): Use
6076 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
6077 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
6079 2000-07-09 Jim Meyering <meyering@lucent.com>
6081 * Most files: Update copyright dates to include 2000.
6083 2000-07-08 Jim Meyering <meyering@lucent.com>
6085 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
6087 (xgethostname): Remove now-unnecessary #ifdef.
6088 Move declaration of `err' into loop where it's used.
6090 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6092 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
6093 by allocating a larger buffer. Test the gethostname return value for
6094 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
6095 returns an error and ENAMETOOLONG isn't defined.
6097 2000-07-05 Paul Eggert <eggert@twinsun.com>
6098 and Bruno Haible <haible@clisp.cons.org>
6100 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
6102 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6104 * quotearg.c (struct quoting_options): Simplify quote_these_too
6107 2000-07-03 Jim Meyering <meyering@lucent.com>
6109 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
6110 Reported by Bruno Haible.
6112 2000-07-04 Jim Meyering <meyering@lucent.com>
6114 * quotearg.c: Make inclusion of <wchar.h> independent of whether
6115 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
6118 2000-07-03 Paul Eggert <eggert@twinsun.com>
6119 and Bruno Haible <haible@clisp.cons.org>
6121 * quotearg.c (mbrtowc):
6122 Assign to *pwc, and return 1 only if result is nonzero.
6123 (iswprint): Use ISPRINT when substituting our own mbrtowc.
6125 2000-07-03 Jim Meyering <meyering@lucent.com>
6127 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
6128 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
6131 2000-07-02 Jim Meyering <meyering@lucent.com>
6133 * quotearg.c (mbstate_t): Don't define here.
6135 2000-07-02 Jim Meyering <meyering@lucent.com>
6137 * nanosleep.c (SIGCONT): Define if not already defined.
6139 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6141 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
6142 per change in ../m4/ls-mntd-fs.m4.
6143 (read_filesystem_list): Ignore symbolic links.
6145 2000-06-29 Jim Meyering <meyering@lucent.com>
6147 * same.c: Include <string.h> or <strings.h>, as appropriate,
6148 for declaration of strcmp.
6150 * long-options.c: Include <stdlib.h>, for declaration of exit.
6152 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
6153 Avoid warning by casting result to `char *' to remove `const'.
6155 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6157 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
6159 2000-06-26 Paul Eggert <eggert@twinsun.com>
6161 savedir now sets errno on failure and invokes xmalloc to get memory.
6162 Fix a couple of other minor bugs while we're at it.
6164 * savedir.c (<unistd.h>): Do not include; there's no need.
6165 (NAMLEN): Remove macro.
6166 (malloc, realloc): Remove decls.
6168 ("xalloc.h"): Include.
6169 (NAME_SIZE_DEFAULT): New macro.
6170 (savedir): Use xmalloc / xrealloc to allocate memory.
6171 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
6172 Skip "" directory entries.
6173 Use strlen to calculate directory entry length, since the old method
6174 is rarely used these days and isn't worth supporting.
6175 Don't use a pointer after freeing it.
6176 Check for integer overflow when calculating allocation size.
6177 Use memcpy to copy entries, instead of stpcpy.
6178 Set errno properly when returning NULL.
6179 Check for readdir error.
6181 2000-06-26 Jim Meyering <meyering@lucent.com>
6183 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
6185 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6187 * getusershell.c (xmalloc, xrealloc): Remove functions.
6189 Don't include <stdlib.h>. Don't declare malloc, realloc.
6191 2000-06-23 Bruno Haible <haible@clisp.cons.org>
6193 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
6195 2000-06-24 Jim Meyering <meyering@lucent.com>
6197 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
6199 2000-06-21 Jim Meyering <meyering@lucent.com>
6201 * getpass.c: New file, from Bruno Haible. Required for BeOS.
6203 2000-06-19 Paul Eggert <eggert@twinsun.com>
6205 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
6206 (mbrtowc, mbstate_t): Define substitutes if
6207 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
6208 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
6209 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
6211 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6213 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
6214 than 1024, return a memory chunk of least possible size, instead
6215 of size PATH_MAX + 2. In the loop, increment the size proportionally.
6216 Use free/xmalloc instead of xrealloc to avoid copying for very long
6219 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6221 * canon-host.c (canon_host): Use malloc and memcpy to copy an
6222 address, not strdup. Include <stdlib.h> and don't declare free().
6224 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6226 * path-concat.c (path_concat): Don't access dir[-1] if dir is
6229 2000-06-21 Jim Meyering <meyering@lucent.com>
6231 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
6232 (noinst_HEADERS): Add getstr.h.
6234 * getline.c (getstr): Move into a separate file.
6235 * getstr.c (getstr): New file, extracted from getline.c, with
6236 the following changes: new parameter, delim2; both delim[12]
6237 parameters have type `int', not `char'. The latter would lose
6238 with 8-bit delimiters.
6239 * getstr.h: New file.
6241 2000-06-19 Jim Meyering <meyering@lucent.com>
6243 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
6245 2000-06-18 Jim Meyering <meyering@lucent.com>
6247 * mkdir.c: Remove file, due mainly to copyright incompatibility.
6248 Besides, these days every porting target provides a mkdir function.
6250 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
6251 (this snippet comes from src/system.h).
6253 2000-06-15 Paul Eggert <eggert@twinsun.com>
6255 * human.c (adjust_value): New function.
6256 (human_readable_inexact): Apply rounding style even when
6257 printing approximate values.
6259 2000-06-14 Paul Eggert <eggert@twinsun.com>
6261 * human.c (human_readable_inexact): Allow an input block
6262 size that is not a multiple of the output block size, and vice versa.
6263 Reported by Piergiorgio Sartor.
6265 2000-06-14 Paul Eggert <eggert@twinsun.com>
6267 * getdate.y (get_date): Apply relative times after time
6268 zone indicator, not before. Reported by Todd A. Jacobs.
6270 2000-06-13 Jim Meyering <meyering@lucent.com>
6272 * Makefile.am (all-local): Depend on lstat.c and stat.c.
6274 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
6276 2000-06-12 Paul Eggert <eggert@twinsun.com>
6278 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
6280 2000-06-04 Paul Eggert <eggert@twinsun.com>
6282 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
6284 2000-06-04 Jim Meyering <meyering@lucent.com>
6286 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
6287 SunOS 4.1.4 for which gid_t is an unsigned type.
6289 2000-06-03 Jim Meyering <meyering@lucent.com>
6291 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
6293 2000-05-26 Bruno Haible <haible@clisp.cons.org>
6295 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
6296 newer, don't install charset.alias.
6297 * config.charset: Change the Linux/glibc rules so they become empty
6298 on glibc-2.1 or newer.
6300 2000-06-02 Jim Meyering <meyering@lucent.com>
6302 * mountlist.c: Back out last change. Instead, do this...
6303 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
6304 member using the same `ignore'-testing code.
6305 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
6309 2000-05-29 Jim Meyering <meyering@lucent.com>
6311 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
6312 with the `ignore' attribute. Based on a patch from Mark D. Roth.
6314 2000-05-22 Jim Meyering <meyering@lucent.com>
6316 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
6318 2000-05-18 Jim Meyering <meyering@lucent.com>
6320 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
6321 back, too, since it may have been modified by allocate_entry.
6322 (hash_delete): Rewrite to use neither the assignment operator
6323 nor the comma operator in an if-expression.
6325 2000-05-15 Paul Eggert <eggert@twinsun.com>
6328 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
6329 Remove; no longer needed.
6330 "quotearg.h": Add include.
6331 (file_name): Do not bother to explicitly initialize to NULL; it's less
6332 efficient on some hosts.
6333 (close_stdout_status): Remove test as to whether stdout was already
6334 closed; it breaks for the case "echo x | sort >&-".
6335 Quote file name colons.
6336 Do not assume that _("write error") lacks format strings.
6338 2000-05-15 Jim Meyering <meyering@lucent.com>
6340 * version-etc.c (version_etc_copyright): Update the copyright string
6341 used in all --version output.
6343 2000-05-14 Jim Meyering <meyering@lucent.com>
6345 * closeout.c (close_stdout_set_file_name): New function.
6346 (close_stdout_status): Use new file-scoped global.
6347 Return right away if fstat says the stdout file descriptor is invalid.
6348 * closeout.h (close_stdout_set_file_name): Declare.
6350 2000-05-10 Jim Meyering <meyering@lucent.com>
6352 * closeout.c [default_exit_status]: New file-scoped variable.
6353 (close_stdout_set_status): New function.
6354 * closeout.h (close_stdout_set_status): Declare.
6356 2000-05-08 Jim Meyering <meyering@lucent.com>
6358 * long-options.c: Don't include closeout.h.
6359 (parse_long_options): Don't call close_stdout for --version.
6361 2000-05-06 Jim Meyering <meyering@lucent.com>
6363 * strnlen.c: Undefine __strnlen and strnlen.
6364 [!weak_alias]: Define __strnlen to strnlen.
6366 * atexit.c: New file, from libiberty.
6368 2000-05-06 Jim Meyering <meyering@lucent.com>
6370 * closeout.c (close_stdout_status): Also check for errors on the
6373 2000-05-05 Bruno Haible <haible@clisp.cons.org>
6375 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
6376 instead of xmalloc, xrealloc, path_concat.
6377 (locale_charset): Treat empty environment variables as absent.
6378 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
6380 2000-05-04 Jim Meyering <meyering@lucent.com>
6382 * getopt.c: Update from glibc.
6383 * obstack.c: Likewise.
6384 * obstack.h: Likewise.
6385 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
6387 * regex.h: Likewise.
6388 * strndup.c: Likewise.
6389 * strnlen.c: New file, from glibc.
6391 2000-05-01 Jim Meyering <meyering@lucent.com>
6393 * full-write.c (full_write): Remove `FIXME' part of comment.
6395 2000-04-29 Jim Meyering <meyering@lucent.com>
6397 * path-concat.c: Declare strdup only if it's not defined.
6398 * canon-host.c: Likewise.
6400 2000-04-28 Jim Meyering <meyering@lucent.com>
6402 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
6403 redefinition warning on some systems (HPUX). Otherwise, regex.h is
6404 included first, then limits.h is included by locale.h by libintl.h.
6405 From John David Anglin.
6407 2000-04-25 Jim Meyering <meyering@lucent.com>
6409 * makepath.c (S_IRWXUGO): Define.
6410 (make_path): Always perform explicit chmod if MODE specifies any
6411 of the `special' permission bits. Prompted by a bug report against
6412 install from Mate Wierdl and Joost van Baal.
6414 2000-04-18 Jim Meyering <meyering@lucent.com>
6418 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
6419 getpagesize. For BeOS. Based on a patch from Bruno Haible.
6421 2000-04-17 Jim Meyering <meyering@lucent.com>
6423 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6424 the definition of it to rpl_strftime also defined-away the system's
6427 2000-04-15 Jim Meyering <meyering@lucent.com>
6429 Use `C' to denote so-called `contiguous' files, the same way
6431 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6432 (ftypelet): Use S_ISCTG.
6433 From Michael Deutschmann.
6435 2000-04-14 Jim Meyering <meyering@lucent.com>
6437 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6439 2000-04-08 Jim Meyering <meyering@lucent.com>
6441 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6442 names don't conflict. Reported by Eli Zaretskii.
6444 2000-03-28 Bruno Haible <haible@clisp.cons.org>
6446 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6447 bug. Deal with the different error behavior of Irix iconv.
6449 2000-04-07 Jim Meyering <meyering@lucent.com>
6451 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6452 to work around system header problems on AIX 3.2.5. From Bruno Haible.
6454 2000-04-05 Jim Meyering <meyering@lucent.com>
6456 Portability tweaks required for ultrix4.3.
6457 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6458 * readutmp.c: Include sys/types.h before sys/stat.h.
6459 * canon-host.c: Declare strdup.
6460 * path-concat.c: Likewise.
6461 From John David Anglin.
6463 2000-04-04 Jim Meyering <meyering@lucent.com>
6465 Be more DOS 8.3-friendly.
6466 * ref-add.sin: Renamed from ref-add.sed.in.
6467 * ref-del.sin: Renamed from ref-del.sed.in.
6468 * Makefile.am: Reflect renaming.
6469 Reported by Eli Zaretskii.
6471 Use a temporary file name that won't clash with `charset.alias'
6472 in the DOS 8.3 name space.
6473 * Makefile.am (charset_tmp): Define.
6474 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
6475 (uninstall-local): Likewise.
6476 Reported by Eli Zaretskii.
6478 2000-03-29 Paul Eggert <eggert@twinsun.com>
6480 * time/strftime.c (my_strftime): Make sure we call the system
6481 strftime, not ourselves, when invoking the underlying strftime.
6483 2000-03-24 Jim Meyering <meyering@lucent.com>
6485 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
6486 (charset_alias): Define.
6487 (install-exec-local): Factor out common code.
6488 (uninstall-local): Split lines longer than 80.
6489 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
6491 (.sed.in.sed): New rule. Don't redirect directly to $@.
6492 (CLEANFILES): Add ref-add.sed and ref-del.sed.
6494 2000-03-19 Bruno Haible <haible@clisp.cons.org>
6496 * config.charset: Output a line containing "Packages using this file".
6497 * ref-add.sed.in, ref-del.sed.in: New files.
6498 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
6499 ref-del.sed): New rules.
6501 2000-03-17 Jim Meyering <meyering@lucent.com>
6503 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
6504 Otherwise, include <strings.h>
6506 2000-03-17 Bruno Haible <haible@clisp.cons.org>
6508 * unicodeio.c (utf8_wctomb): New function.
6509 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
6510 format instead of in UCS-4 with platform dependent endianness.
6512 2000-03-07 Paul Eggert <eggert@twinsun.com>
6514 * savedir.c (savedir): Work even if directory size is
6515 negative; this can happen with some screwy NFS configurations.
6517 2000-03-06 Jim Meyering <meyering@lucent.com>
6519 * localcharset.c (get_charset_aliases): Don't try to free file_name
6520 if it's NULL (because we ran out of memory). From Bruno Haible.
6522 2000-03-05 Jim Meyering <meyering@lucent.com>
6524 * localcharset.c ("path-concat.h"): Include.
6525 (get_charset_aliases): Use path_concat instead of ANSI string
6528 * unicodeio.h (PARAMS): Define.
6529 Use it to guard prototype.
6531 2000-03-04 Jim Meyering <meyering@lucent.com>
6533 * Makefile.am (install-exec-local): Create $(libdir) before installing
6535 (uninstall-local): Uncomment this rule so `make distcheck' works
6538 * unicodeio.c (<errno.h>): Include it.
6539 (errno): Declare if not defined.
6541 * localcharset.c: Add Bruno's comment justifying use of volatile.
6543 * config.charset: New version, incorporating remarks from a linux
6544 i18n mailing list. From Bruno Haible.
6546 2000-03-02 Jim Meyering <meyering@lucent.com>
6548 * Makefile.am (EXTRA_DIST): Add config.charset.
6550 2000-03-01 Jim Meyering <meyering@lucent.com>
6552 * localcharset.c: Guard some #includes with `#if HAVE_...'.
6553 * unicodeio.c: Likewise.
6555 2000-02-02 Bruno Haible <haible@clisp.cons.org>
6557 * config.charset: New file.
6558 * localcharset.c: New file.
6559 * unicodeio.h, unicodeio.c: New files.
6560 * Makefile.am (DEFS): Add -DLIBDIR=...
6561 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
6562 (noinst_HEADERS): Add unicodeio.h.
6563 (all-local, install-exec-local, charset.alias): New targets.
6565 2000-02-28 Paul Eggert <eggert@twinsun.com>
6567 * quotearg.c (ALERT_CHAR): New macro.
6568 (quotearg_buffer_restyled): Use it.
6570 2000-02-27 Jim Meyering <meyering@lucent.com>
6572 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
6573 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
6575 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
6576 not `#if STDC_HEADERS'.
6577 Declare malloc if needed.
6579 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
6580 now that autoconf always defines the HAVE_DECL_ symbols.
6581 * human.c: Likewise.
6583 * strtoumax.c: Likewise.
6585 * backupfile.c: Arrange for cpp to fail if the configure-time
6586 declaration check was not run.
6588 * human.c: Likewise.
6590 * strtoumax.c: Likewise.
6592 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
6593 then first look up the entire `.'-containing string as a login name.
6595 2000-02-18 Paul Eggert <eggert@twinsun.com>
6597 * getdate.y: Handle two-digit years with leading zeros correctly.
6598 (textint): New typedef.
6599 (parser_control): Member year changed from int to textint.
6601 (YYSTYPE): Removed; replaced by %union with int and textint members.
6602 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
6603 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
6604 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
6605 (tSNUMBER, tUNUMBER): Now of type <textintval>.
6606 (date, number, to_year): Use width of number in digits, not its value,
6607 to determine whether it's a 2-digit year, or a 2-digit time.
6608 (yylex): Store number of digits of numeric tokens.
6609 Reported by John Kendall.
6611 (parser_control): Changed from struct parser_control to typedef (for
6612 consistency). All uses changed.
6614 (tID): Removed; not used.
6615 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
6617 2000-02-14 Paul Eggert <eggert@twinsun.com>
6619 * getpagesize.h (getpagesize): Port to VMS for Alpha;
6620 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
6622 2000-02-12 Jim Meyering <meyering@lucent.com>
6624 * userspec.c (ISDIGIT): Define it.
6625 (isdigit): Remove definition.
6626 (is_number): Use ISDIGIT, not isdigit.
6627 <libintl.h>: Include.
6629 (parse_user_spec): Mark translatable strings.
6631 2000-02-10 Jim Meyering <meyering@lucent.com>
6633 With these changes, nanosleep.[ch] are finally enough like the other
6634 lib/* replacement files to compile on a few more losing systems.
6636 * nanosleep.h: Don't include config.h.
6637 Remove prototype from declaration of nanosleep.
6638 (PARAMS): Remove now-unneeded definition.
6639 * nanosleep.c: #undef nanosleep.
6640 (rpl_nanosleep): Rename from nanosleep.
6642 2000-02-03 Jim Meyering <meyering@lucent.com>
6644 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
6645 rather than with `#if HAVE_UTMPNAME'.
6647 2000-02-01 Jim Meyering <meyering@lucent.com>
6649 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
6651 2000-01-31 Jim Meyering <meyering@lucent.com>
6653 * nanosleep.h (nanosleep): Guard declaration with
6654 `#if ! HAVE_DECL_NANOSLEEP'.
6655 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
6656 the declaration in that vendor's sys/timers.h.
6657 Reported by Christian Krackowizer.
6659 * quotearg.c (ISASCII): Add #undef and move definition to follow
6660 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
6661 (ISPRINT): Likewise.
6662 Reported by Tom Tromey.
6664 2000-01-30 Jim Meyering <meyering@lucent.com>
6666 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
6667 uses of ->ut_name. The latter doesn't work with new Linux header files
6668 where only utmpx.ut_user is declared.
6670 * readutmp.h (UT_USER): Define.
6672 2000-01-23 Jim Meyering <meyering@lucent.com>
6674 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
6677 2000-01-22 Jim Meyering <meyering@lucent.com>
6679 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
6680 [! HAVE_DECL_STRTOULL]: Declare strtoull.
6681 Required for some AIX systems. Reported by Christian Krackowizer.
6682 [TESTING] (main): New function.
6684 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
6685 * dirname.c (dir_name): Support for DOS-style file names with drive
6688 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
6690 * strverscmp.c (ISDIGIT): Define.
6691 (strverscmp): Use ISDIGIT, not isdigit.
6693 2000-01-17 Paul Eggert <eggert@twinsun.com>
6695 * nanosleep.c (nanosleep):
6696 Don't use SA_INTERRUPT to decide whether to call sigaction, as
6697 POSIX.1 doesn't require SA_INTERRUPT and some systems
6698 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
6699 it's been part of POSIX.1 since day 1 (in 1988).
6701 2000-01-17 Jim Meyering <meyering@lucent.com>
6703 * interlock: Remove unused file. Reported by François Pinard.
6705 2000-01-16 Paul Eggert <eggert@twinsun.com>
6707 * quotearg.c (quotearg_buffer_restyled): Do not quote
6708 alert, backslash, formfeed, and vertical tab unnecessarily in
6709 shell quoting style.
6712 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
6713 Free Software Foundation, Inc.
6714 Copying and distribution of this file, with or without modification,
6715 are permitted provided the copyright notice and this notice are preserved.