1 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
3 * fnmatch.c (fnmatch): If there is an encoding error in a
4 multibyte string or pattern, fall back on unibyte matching.
5 Problem reported by James Youngman.
7 2005-06-08 Bruno Haible <bruno@clisp.org>
9 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
12 2005-06-08 Bruno Haible <bruno@clisp.org>
14 * csharpcomp.h: New file, from GNU gettext.
15 * csharpcomp.c: New file, from GNU gettext.
16 * csharpcomp.sh.in: New file, from GNU gettext.
18 2005-06-07 Derek Price <derek@ximbiot.com>
21 * glob_.h: Indent nested #ifdef.
23 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
26 Use "file name" when talking about file names, instead of "filename"
27 or "path", as per the GNU coding standards.
28 * mkdir-p.c: Renamed from makepath.c.
29 (make_dir_parents): Renamed from make_path. All callers changed.
30 * mkdir-p.h: Likewise. All includers changed.
31 * filenamecat.c: Renamed from path-concat.c.
32 (file_name_concat): Renamed from path_concat. All callers changed.
33 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
34 * filenamecat.h: Likewise. All includers changed.
35 * acl.c: Don't use "path" or "filename" to mean "file name"
36 in comments or local variable names.
37 * basename.c: Likewise.
38 * canonicalize.c, canonicalize.h: Likewise.
39 * dirname.c, dirname.h: Likewise.
40 * euidaccess.c: Likewise.
42 * fnmatch_.h, fnmatch_loop.c: Likewise.
43 * fsusage.c, fsuage.h: Likewise.
44 * fts.c, fts_.h: Likewise.
46 * getloadavg.c: Likewise.
47 * mkstemp.c: Likewise.
48 * mountlist.c, mountlist.h: Likewise.
49 * openat.c, openat.h: Likewise.
50 * readlink-stub.c: Likewise.
51 * readutmp.c, readutmp.h: Likewise.
55 * savedir.c: Likewise.
56 * stripslash.c: Likewise.
57 * tempname.c: Likewise.
58 * xreadlink.c: Likewise.
59 * exclude.c (excluded_file_name): Renamed from excluded_filename.
61 * exclude.h: Likewise.
63 * euidaccess.c (getuid, getgid, getuid, getegid)
64 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
65 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
66 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
67 * pathmax.h: Include <limits.h> unconditionally, since other
68 files have been getting away with it for years (MORE/BSD 4.3
70 * userspec.c (getpwnam, getgrnam, getgrgid)
71 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
73 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
74 Define to 256, not 255, as per modern POSIX.
76 2005-06-01 Bruno Haible <bruno@clisp.org>
78 * csharpexec.h: New file, from GNU gettext.
79 * csharpexec.c: New file, from GNU gettext.
80 * csharpexec.sh.in: New file, from GNU gettext.
82 2005-05-31 Derek Price <derek@ximbiot.com>
83 Paul Eggert <eggert@cs.ucla.edu>
86 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
88 2005-05-29 Derek Price <derek@ximbiot.com>
89 Paul Eggert <eggert@cs.ucla.edu>
91 * glob_.h, glob.c: New files.
93 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
95 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
97 * fts.c: Don't worry about debugging on pre-C99-comopatible hosts;
98 the configuration hassle isn't worth it.
99 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
100 (LONGEST_MODIFIER, PRIuMAX): Remove.
102 2005-05-27 Bruno Haible <bruno@clisp.org>
104 * getlogin_r.h: Remove second include of <stddef.h>.
106 2005-05-25 Bruno Haible <bruno@clisp.org>
107 Derek Price <derek@ximbiot.com>
109 * getlogin_r.h: Simplify API documentation.
111 2005-05-25 Derek Price <derek@ximbiot.com>
112 Paul Eggert <eggert@cs.ucla.edu>
114 * getlogin_r.c, getlogin_r.h: New files.
116 2005-05-22 Bruno Haible <bruno@clisp.org>
118 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
119 Also include <sys/param.h> if it defines MIN, MAX.
120 Based on a patch by Derek Price <derek@ximbiot.com>.
122 2005-05-22 Bruno Haible <bruno@clisp.org>
124 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
125 (INT64_MIN): Fix definition.
126 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
128 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
129 NEED_SIGNED_INT_TYPES.
131 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
132 HAVE_SYSTEM_INTTYPES.
134 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
136 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
137 so that unistd-safer.h (GPL'ed code) need not be included.
139 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
142 * fts.c: Don't include "cycle-check.h" or "hash.h".
143 (setup_dir, free_dir): New functions.
144 (enter_dir, leave_dir): Define trivial
145 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
146 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
147 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
148 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
150 (fts_open): Use setup_dir.
151 (fts_close): Use free_dir.
152 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
153 This adds a label and some gotos, but the alternatives were messier.
154 Check for memory allocation failure when entering a dir.
155 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
156 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
157 (FTS): New member fts_cycle, that is a union that contains the
158 old active_dir_ht and cycle_state. All uses changed to mention
159 fts_cycle.ht and fts_cycle.state.
160 * fts-cycle.c: New file, containing GPL'ed code migrated out of
161 fts.c, with the following changes:
162 (setup_dir, free_dir): New functions.
163 (enter_dir): Now returns bool. Return true if successful, false
164 if memory exhausted. All callers changed.
165 Do not bother partly cleaning up on
166 memory allocation failure; that is free_dir's job.
167 However, free ad if hash_insert fails, to avoid memory leak.
168 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
169 fts->fts_options to see which union member to use.
171 2005-05-20 Jim Meyering <jim@meyering.net>
173 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
174 Now a macro, to pacify GCC.
176 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
178 * chown.c (rpl_chown): Return -1 on failure.
180 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
182 * canonicalize.c: Include canonicalize.h first, to test interface.
183 Include <stddef.h> unconditionally, since we assume C89 now.
184 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
185 * fts.c: Include fts_.h first, to check interface.
186 Do not include intprops.h; no longer needed.
187 Include cycle-check.h and hash.h, since fts_.h no longer does.
188 Remove unnecessary casts of closedir to void.
189 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
190 decide whether to decrement nlinks.
191 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
192 (FTS): Use struct hash_table * instead of Hash_table, so that
193 we no longer need to include hash.h here.
195 2005-05-17 Jim Meyering <jim@meyering.net>
197 * fts.c, fts_.h: New files, from coreutils.
199 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
202 * unlinkdir.c, unlinkdir.h: New files.
203 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
204 regex.h, unlocked-io.h, xtime.h:
205 White space changes only.
206 * makepath.c (make_path): Port to hosts where leading "//" is special.
207 * yesno.c: Include getline.h, not ctype.h.
208 (yesno): Don't remove leading white space; POSIX doesn't allow it.
209 Use getline to remove arbitrary restriction on response length.
211 2005-05-13 Bruno Haible <bruno@clisp.org>
213 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
214 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
215 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
216 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
217 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
218 Add support for 64-bit integers in the MSVC compiler.
220 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
222 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
223 Change the initial comment to refer to GPL, not LGPL.
224 gnulib-tool will change it to LGPL as needed.
226 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
227 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
228 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
229 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
230 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
231 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
232 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
233 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
234 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
235 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
236 concatpath.c, config.charset, copy-file.c, copy-file.h,
237 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
238 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
239 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
240 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
241 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
242 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
243 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
244 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
245 full-read.c, full-read.h, full-write.c, full-write.h,
246 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
247 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
248 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
249 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
250 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
251 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
252 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
253 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
254 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
255 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
256 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
257 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
258 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
259 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
260 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
261 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
262 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
263 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
264 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
265 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
266 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
267 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
268 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
269 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
270 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
271 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
272 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
273 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
274 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
275 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
276 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
277 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
278 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
279 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
280 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
281 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
282 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
283 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
284 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
285 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
286 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
287 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
288 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
289 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
290 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
291 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
292 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
293 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
294 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
295 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
296 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
297 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
298 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
299 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
300 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
301 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
302 Update FSF postal mail address.
304 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
306 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
307 specified in ai_socktype. Fix invalid ai_protocol
308 check. ai_protocol is usually set to 0 or depending on
309 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
310 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
311 ai_socktype / ai_protocol in the returned addrinfo structure.
313 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
314 Bruno Haible <bruno@clisp.org>
316 * inet_ntop.h: New file.
317 * inet_ntop.c: New file, from glibc with modifications.
319 2005-05-08 Jim Meyering <jim@meyering.net>
321 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
323 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
325 Merge from coreutils. Among other things,
326 add bulletproofing for cases where stdin, stdout, or stderr are closed.
327 * fd-safer.c: New file.
328 * fcntl-safer.h, open-safer.c: Remove.
329 * chdir-long.c: Fix comment "fetish" -> "coreutils".
330 * dup-safer.c: Include unistd-safer.h first.
331 Don't include errno.h.
332 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
333 * file-type.h: Don't assume invoker included sys/stat.h first.
334 * file-type.c: Rely on file-type.h change.
335 * getloadavg.c: Include unistd-safer.h.
336 (getloadavg): Use safer open.
337 * getusershell.c: Include "stdio-safer.h".
338 (getusershell): Use safer fopen.
339 * long-options.c (long_options): Use NULL rather than 0.
340 * modechange.h (mode_free): Remove; all callers changed to invoke
342 * modechange.c: Likewise.
343 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
344 (MODE_DONE): New constant.
345 (struct mode_change): Remove 'next' member.
346 (make_node_op_equals): New function; like the old one of the
347 same name, except it allocates an array.
348 (mode_compile, mode_create_from_ref): Use it.
349 (mode_compile): Allocate result as an array, not a linked list.
350 Parse octal string ourself, so that we catch mistakes like "+0".
351 (mode_adjust): Arg is an array, not a linked list.
352 * modechange.c: Include stat-macros.h, xalloc.h.
353 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
354 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
355 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
356 Remove. This is now stat-macros.h's job.
357 (talloc): Remove. All callers replaced by xalloc, so that
358 our invokers don't have to worry about reporting memory failures.
359 (make_node_op_equals): Remove.
360 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
362 (struct mode_change): Moved here from modechange.h.
363 (mode_append_entry): Remove.
364 (mode_compile): Remove MASKED_OPS arg, since it encouraged
365 apps to have incorrect behavior. Use simpler algorithm for head
366 and tail. Don't futz with umask; that's now the job of mode_adjust.
367 Detect more invalid usages rather than having somewhat-random behavior.
368 Don't insert an "a=" action, as that leads to incorrect behavior.
369 (mode_compile, mode_create_from_ref): Return NULL on error instead
370 of an enum, since now there's only one way to have an error. All
372 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
373 at the correct time. Simplify calculation of "+u" and its ilk.
374 Don't mishandle "+X".
375 (mode_free): Remove "register" and localize decls.
376 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
377 (struct mode_change): Move to modechange.c; callers don't
378 need to see this stuff.
379 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
380 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
381 (mode_change, mode_adjust): Reflect the new signatures noted above.
382 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
383 that might redefine system include files.
384 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
385 (my_usleep): Use NULL rather than (void *) 0.
386 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
387 Use siginterrupt to specify that system calls should be interrupted.
388 (rpl_nanosleep): Move initialization of suspended closer to call of
390 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
391 * readutmp.c: Likewise. Include signal.h, stdbool.h.
392 (desirable_utmp_entry): New function.
393 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
394 using x2nrealloc, to simplify logic.
395 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
396 size calculation. Do not assume utmp file is a regular file.
397 * readutmp.h (UT_PID): Moved here from ../src/who.c.
398 (READ_UTMP_CHECK_PIDS): New constant.
399 * save-cwd.c: Include unistd-safer.h.
400 (save_cwd): Use fd_safer.
401 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
402 [!_LIBC] Include "stat-macros.h" instead.
403 * unistd-safer.h (fd_safer): New decl.
405 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
407 * byteswap_.h: New file.
409 2005-04-25 Albert Chin <china@thewrittenword.com>
411 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
414 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
416 * getdate.y (zone): Allow relunit_snumber after tZONE, so
417 that "UTC +1 second" continues to work. Problem reported
419 (relunit_snumber): New rule.
422 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
424 * getdate.y (universal_time_zone_table): New constant.
425 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
426 universal_time_zone_table.
427 (lookup_zone): Prefer universal_time_zone_table to
428 local_time_zone_table, so that "GMT" time stamps are allowed in
429 London during the summer. Problem reported by Ian Abbott.
431 2005-04-12 Jim Meyering <jim@meyering.net>
433 * human.c (humblock): Set *options even when returning due to
434 xstrtoumax conversion failure. Thanks to a used-uninitialized
437 2005-04-09 Jim Meyering <jim@meyering.net>
439 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
440 -Wuninitialized: initialize tm0.tm_year.
442 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
444 * getdate.y (parser_control): rels_seen is now a boolean, not a
445 count, since there's no maximum. All uses changed.
446 Add member dsts_seen.
447 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
449 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
450 Use pc_rels_seen to decide whther a date is absolute.
452 * getdate.y (number): Don't overwrite year.
453 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
456 2005-04-02 Simon Josefsson <jas@extundo.com>
458 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
459 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
461 2005-03-27 Jim Meyering <jim@meyering.net>
463 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
465 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
467 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
468 "one's complement" -> "ones' complement" in comment, as per Knuth.
469 "value of type" -> "type or expression" in comment.
470 * mktime.c, strftime.c: Propagate intprops.h comment nits.
472 2005-03-26 Jim Meyering <jim@meyering.net>
475 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
476 Correct typos: s/or/of/.
478 2005-03-23 Jim Meyering <jim@meyering.net>
480 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
482 2005-03-21 Jim Meyering <jim@meyering.net>
484 Changes imported from coreutils.
486 * cycle-check.c: Don't include xalloc.h.
488 * path-concat.c: Don't include assert.h.
489 (path_concat): Remove assertion that would have triggered
490 for ABASE starting with more than one slash.
491 Reported by Andreas Schwab.
493 * path-concat.c (path_concat): Set *BASE_IN_RESULT
494 properly when ABASE is an absolute file name.
495 Correct the description of this function.
497 Add an assertion and a test driver.
498 This fixes a bug introduced on 2004-07-02.
499 Andreas Schwab reported the resulting failure of cp --parents:
500 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
502 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
504 * strftime.c (my_strftime): If the underlying strftime returns 0
505 (which shouldn't happen), generate nothing instead of returning 0
506 immediately, so that nstrftime (NULL, ...) doesn't return 0.
508 2005-03-16 Bruno Haible <bruno@clisp.org>
510 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
512 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
514 * strftime.c (my_strftime): Prepend space to format so that we can
515 reliably distinguish strftime failure from empty output on POSIX
518 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
520 * iconvme.c (SIZE_MAX): New macro, if not already defined.
521 (iconv_string): Don't guess a size-zero buffer, as that might cause
522 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
523 result would be 'too large', where 'too large' is (heuristically)
524 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
525 overflow concerns. This will prevent some unwanted malloc failures
526 when the inputs are very large.
528 2005-03-15 Bruno Haible <bruno@clisp.org>
530 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
533 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
536 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
538 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
540 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
541 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
543 * strtol.c: Likewise.
545 2005-03-14 Simon Josefsson <jas@extundo.com>
547 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
550 2005-03-14 Jim Meyering <jim@meyering.net>
552 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
553 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
554 to be nonzero so that we (and caller) can detect the difference
555 between a valid zero-length expansion and an error return, even
556 when the underlying strftime fails before writing anything into
559 2005-03-10 Jim Meyering <jim@meyering.net>
561 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
562 so that this module works on systems without fchdir.
564 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
566 Factor int-properties macros into a single file, except for
568 * intprops.h: New file.
569 * getloadavg.c: Include it instead of limits.h.
570 (INT_STRLEN_BOUND): Remove.
571 * human.c: Include intprops.h.
572 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
573 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
574 * inttostr.h: Include intprops.h instead of limits.h.
575 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
576 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
577 for consistency with intprops.h.
578 (time_t_is_integer, twos_complement_arithmetic): Use them.
579 * sig2str.h: Include <signal.h>, intprops.h.
580 (INT_STRLEN_BOUND): Remove.
581 * strftime.c (TYPE_SIGNED): Remove.
582 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
583 * strtol.c: Adjust comments to match intprops.h.
584 * userspec.c: Include intprops.h.
585 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
586 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
587 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
588 instead of rolling our own expressions.
589 * xstrtol.c: Include xstrtol.h first, to test interface.
591 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
593 (my_strftime): Do not mishandle years close to INT_MAX, by doing
594 the right thing even if adding 1900 would overflow. Similarly
595 for tm_mon + 1 and tm_yday + 1.
596 Make %Y always equivalent to %C%y, and similarly for %G and %g.
597 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
598 (DO_SIGNED_NUMBER): New macro.
599 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
601 2005-03-07 Bruno Haible <bruno@clisp.org>
603 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
605 2005-03-03 Derek R. Price <derek@ximbiot.com>
606 Bruno Haible <bruno@clisp.org>
608 * pagealign_alloc.h: New file.
609 * pagealign_alloc.c: New file.
611 2005-01-28 Bruno Haible <bruno@clisp.org>
613 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
616 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
618 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
619 The workaround isn't strictly needed for POSIX conformance, and
620 it's too much of a pain to configure and maintain. We'll ask
621 people to fix their kernels instead.
622 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
623 (NANOSLEEP_BUG_WORKAROUND): Remove.
624 (xnanosleep): Remove the workaround.
626 2005-02-12 Bruno Haible <bruno@clisp.org>
628 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
630 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
632 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
633 * timespec.h (gettime): Return void, since it always
634 succeeds now. All uses changed.
635 * gettime.c (gettime) Likewise.
636 [HAVE_NANOTIME]: Prefer nanotime.
637 Assume gettimeofday succeeds, as POSIX requires.
638 Assime time () succeeds, since other code already does.
639 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
640 (timespec_subtract): Remove.
641 (NANOSLEEP_BUG_WORKAROUND): New constant.
642 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
643 things considerably. Use it only on GNU/Linux hosts, since the
644 workaround shouldn't be needed elsewhere.
646 2005-02-24 Bruno Haible <bruno@clisp.org>
648 * gettext.h: Update from GNU gettext 0.14.2.
650 2005-02-24 Bruno Haible <bruno@clisp.org>
652 * localcharset.c: Update from GNU gettext 0.14.2.
653 * config.charset: Update from GNU gettext 0.14.2.
655 2005-02-22 Simon Josefsson <jas@extundo.com>
657 * iconvme.h, iconvme.c: New files, from libc.
659 2005-02-20 Neil Conway <neilc@samurai.com>
661 * xgethostname.c (xgethostname): Check for ENOMEM, which is
662 returned by OSX/Darwin if the specified buffer is not large
663 enough for the hostname.
665 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
667 * memrchr.h: New file.
668 * chdir-long.c: Include it.
669 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
670 Don't bother including stddef.h.
672 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
674 * argp-help.c (__argp_help): Create a fake struct argp_state and
675 pass it to _help, otherwise the latter coredumps trying to
676 dereference state.root_argp.
678 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
680 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
682 Include <sys/types.h>, for dev_t.
683 (ME_DUMMY, ME_REMOTE): Move from here....
684 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
685 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
687 Include mountlist.h first, to test the interface.
689 2005-01-29 Bruno Haible <bruno@clisp.org>
691 * progname.c (program_name): Initialize.
692 Needed when linking statically on MacOS X.
694 2005-01-28 Bruno Haible <bruno@clisp.org>
696 * javacomp.sh.in: New file, from GNU gettext.
697 * javacomp.h: New file, from GNU gettext.
698 * javacomp.c: New file, from GNU gettext.
700 2005-01-26 Bruno Haible <bruno@clisp.org>
702 * javaexec.sh.in: New file, from GNU gettext.
703 * javaexec.h: New file, from GNU gettext.
704 * javaexec.c: New file, from GNU gettext.
706 2005-01-26 Simon Josefsson <jas@extundo.com>
708 * gai_strerror.c: Use GPL in header.
710 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
712 * argp-help.c (hol_entry_help): Avoid using non-constant
713 initializers for struct pentry_state.
714 (__argp_error): Check return value of __asprintf
715 (__argp_failure): Translate error message
717 * argp-parse.c: Removed braces around the expansion of N_()
719 2005-01-21 Jim Meyering <jim@meyering.net>
721 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
722 same value as for Solaris 9.
724 * chdir-long.c (chdir_long): Rewrite to remove limitation on
725 component length. This included changing the parameter to be
726 of type `char *' rather than `char const *'.
727 * chdir-long.h (chdir_long): Update prototype.
729 * openat.c (fdopendir, fstatat): New functions.
730 * openat.h: Include headers required for use of DIR and struct stat.
731 [AT_SYMLINK_NOFOLLOW]: Define.
732 (fdopendir, fstatat): Add prototypes.
734 2005-01-21 Bruno Haible <bruno@clisp.org>
736 * classpath.h: New file, from GNU gettext.
737 * classpath.c: New file, from GNU gettext.
739 2005-01-20 Simon Josefsson <jas@extundo.com>
741 * version-etc-fsf.c: New file, with version_etc_copyright.
742 * version-etc.c: Remove version_etc_copyright.
743 * version-etc.h (version_etc_copyright): Use [] instead of * in
744 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
746 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
748 * save-cwd.c (save_cwd): Remove code to support the case
749 where fchdir is missing or flaky.
751 2005-01-20 Simon Josefsson <jas@extundo.com>
753 * base64.h (isbase64): Add.
755 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
756 using a unsigned prototype, don't inline.
757 (base64_decode): Use it.
759 2005-01-19 Bruno Haible <bruno@clisp.org>
761 * sh-quote.h: New file, from GNU gettext.
762 * sh-quote.c: New file, from GNU gettext.
764 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
766 Merge changes from coreutils, as described below in several
767 changelogs dated today.
769 * save-cwd.c: Include "save-cwd.h" before other include files.
770 (O_DIRECTORY): Remove; not needed here, since "." must be
771 a directory. All uses removed.
772 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
773 universal on Suns, and we also need to test for IRIX.
774 Revamp code to use 'if' rather than '#if'.
775 Avoid unnecessary comparison of cwd->desc to 0.
777 * utimens.c (futimens): Robustify the previous patch, by checking
778 for known valid error numbers rather than observed invalid ones.
780 2005-01-18 Jim Meyering <jim@meyering.net>
782 * version-etc.c (version_etc_copyright): Update copyright date.
784 * utimens.c (futimens): Account for the fact that futimes
785 can also fail with errno == ENOSYS or errno == ENOENT.
786 Patch from Dmitry V. Levin.
788 Change the name of the robust chdir function from chdir to chdir_long.
789 * save-cwd.c: Include chdir-long.h rather than chdir.h.
790 (restore_cwd): Use chdir_long, not chdir.
791 * chdir-long.c: Renamed from chdir.c.
792 * chdir-long.h: Renamed from chdir.h.
793 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
796 2005-01-18 Bob Proulx <bob@proulx.com>
798 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
799 offsetof() macro construct to avoid compile failure with native HP-UX
800 11.0 ANSI C compiler.
802 2005-01-06 Bruno Haible <bruno@clisp.org>
804 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
805 because stpncpy.m4 takes care of it.
807 2004-01-24 Bruno Haible <bruno@clisp.org>
809 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
811 2003-10-09 Bruno Haible <bruno@clisp.org>
813 * progreloc.c: Include xalloc.h instead of xmalloc.h.
815 2005-01-06 Bruno Haible <bruno@clisp.org>
817 * fwriteerror.h (fwriteerror): Change specification to include fclose.
818 * fwriteerror.c: Include <stdbool.h>.
819 (fwriteerror): At the end, close the file stream. Record whether
820 stdout was already closed.
822 2004-05-27 Bruno Haible <bruno@clisp.org>
824 * execute.c (environ): Declare if needed.
825 * pipe.c (environ): Likewise.
826 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
828 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
830 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
831 definitions to be after all include files, to avoid collisions.
832 Problem reported by Bob Proulx.
834 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
836 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
837 not needed. This removes a dependency on the gettext module.
838 [defined _LIBC]: Do not include <libintl.h>; not needed.
840 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
842 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
845 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
847 * argp-parse.c: Include <stddef.h>.
848 (alignof, alignto): New macros.
849 (parser_init): Don't assume that void * is aligned sufficiently
852 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
853 need to extend the stack.
854 (YYINITDEPTH): New macro, so that the initial stack isn't overly
857 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
859 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
861 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
863 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
864 Remove now-obsolete comment about AIX.
865 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
866 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
867 (YYMAXDEPTH): New macro.
869 2004-12-18 Bruno Haible <bruno@clisp.org>
871 * fatal-signal.c (fatal_signals): Make non-const.
872 (init_fatal_signals): New function.
873 (uninstall_handlers, install_handlers): Ignore signals that were set to
875 (at_fatal_signal): Call init_fatal_signals.
876 (init_fatal_signal_set): Likewise. Ignore signals that were set to
878 Reported by Paul Eggert.
880 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
882 * getdate.y (textint): New member "negative".
883 (time_zone_hhmm): New function.
884 Expect 14 shift-reduce conflicts, not 13.
885 (o_colon_minutes): New rule.
886 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
887 (yylex): Set the "negative" member of signed numbers.
889 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
891 Changes imported from coreutils.
892 * hard-locale.c: Assume <locale.h> exists.
894 (GLIBC_VERSION): New macro.
895 (hard_locale): Assume setlocale exists.
896 Rewrite to avoid #ifdef.
897 Use strdup rather than malloc + strcpy.
898 * human.c: Assume <locale.h> exists.
899 (human_readable): Assume localeconv exists.
901 2004-12-01 Jakub Jelinek <jakub@redhat.com>
903 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
904 convert T2, not T. (Imported from libc.)
906 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
908 * getcwd.c (is_ENAMETOOLONG): New macro.
909 (__getcwd.c): Don't restore errno; glibc doesn't.
910 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
911 first, falling back to our code only if its results look suspicious.
912 Ensure that the resulting buffer is only as large as necessary.
914 * readutmp.c: Include readutmp.h first.
915 Include <errno.h>, since readutmp.h no longer does that.
916 * readutmp.h: Don't include <errno.h>,
917 <sys/param.h>, <time.h>; not needed to establish interface.
918 (errno): Remove decl.
919 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
920 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
921 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
923 2004-11-28 Simon Josefsson <jas@extundo.com>
925 * base64.h, base64.c: New file.
927 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
929 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
931 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
933 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
934 HP's ANSI C compiler.
935 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
936 Declaring int functions causes warnings on some modern systems and
937 shouldn't be needed to compile on ancient ones.
938 * same.c (MIN) [defined MIN]: Don't define, since it's already
941 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
942 with the following changes.
943 (__set_errno): Parenthesize properly.
945 (MIN, MAX, MATCHING_INO): New macros.
946 (__getcwd): Define with prototype, not K&R form.
947 Use heuristics to allocate default buffer on stack if possible.
948 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
949 behavior, and to avoid the PATH_MAX limit when computing
951 Use MATCHING_INO to compare inode number to file.
952 Check for arithmetic overflow in size calculations.
953 Fix bug in reallocation of dot array that caused getcwd to fail
954 on directories nested deeper than 75.
955 Be more careful about saving errno on error.
956 Do not use realloc; use only free+malloc, as this is a bit
957 more flexible and avoids a needless copy operation.
958 Do not inspect st_dev and st_ino for symbolic links; POSIX
959 doesn't specify the latter.
960 Check for closedir errors.
961 Avoid needless casts.
962 Use "#ifdef weak_alias" around weak_alias, to be like other
964 The following changes to getcwd.c have effect only when used in
965 gnulib; they have no effect inside glibc proper.
966 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
967 as alloca isn't used.
968 (alloca, __alloca): Likewise.
969 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
970 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
971 unconditionally, as gnulib assumes C89 or better.
972 Do not include <sys/param.h>.
973 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
974 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
976 (NULL) [!defined NULL]: Remove; we assume C89 or better.
977 Include <dirent.h> in a way that is compatible with modern Autoconf.
978 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
979 New macros, if not already defined.
980 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
981 Use "_LIBC", not "defined _LIBC", for consistency.
982 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
984 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
985 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
986 * xgetcwd.c: David MacKenzie's old code was removed, so give
987 credit only to Jim Meyering and adjust the copyright dates.
988 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
989 <stdlib.h>, <unistd.h>, "pathmax.h".
990 Instead, include "xgetcwd.h" (first) and "getcwd.h".
991 (INITIAL_BUFFER_SIZE): Remove.
992 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
994 2004-11-23 Jim Meyering <jim@meyering.net>
996 * getopt_.h: Remove trailing blanks.
998 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1000 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
1001 (futimens): New function, which uses futimes if available.
1002 (futimens, utimens): Support timespec==NULL, with same semantics
1003 as utime and utimens.
1004 * utimens.h (futimens): New decl.
1006 2004-11-23 Jim Meyering <jim@meyering.net>
1008 * __fpending.c: Add comment.
1010 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1012 * getopt_.h: Re-addition of __getopt_argv_const caused
1013 redefinition warnings. To avoid them, include the defines
1014 in `#if !defined __need_getopt ... #endif'. The only place
1015 where __getopt_argv_const is used is in definitions
1016 of getopt_long and getopt_long_only below, which are as well
1017 protected by `#ifndef __need_getopt'.
1018 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
1019 __need_getopt after including <stdio.h> and <unistd.h> These
1020 headers might have defined it.
1022 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
1024 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
1026 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
1027 optopt): Use them instead of invoking ## directly; otherwise, the
1028 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
1030 2004-11-19 Bruno Haible <bruno@clisp.org>
1032 * strtok_r.c: Move comments from here...
1033 * strtok_r.h: ... to here.
1035 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
1037 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
1038 might fail. Problem reported by Yoann Vandoorselaere.
1039 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
1040 that mishandle size_t overflow.
1042 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1044 * canon-host.c: Include "strdup.h".
1045 (canon_host): Use getaddrinfo if available, so that IPv6 works.
1046 Use strdup instead of malloc/strcpy to duplicate strings.
1048 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
1049 (human_space_before_unit): New constant.
1050 * human.c (human_readable): Support it.
1052 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
1053 (xgetcwd): Set errno correctly when failing.
1054 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
1055 the failure is actually due to a PATH_MAX problem.
1057 Further getopt changes to make it more likely that glibc will
1058 buy the changes back.
1059 * getopt.c (POSIXLY_CORRECT): New constant.
1060 (getopt): Use it, so to preserve glibc semantic
1061 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
1062 when compiling for libc.
1063 * getopt_.h (__getopt_argv_const): Bring it back.
1064 (getopt_long, getopt_long_only): Use it.
1066 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
1067 New arg POSIXLY_CORRECT. All callers changed.
1068 (getopt): Argv is now char * const *, as per standard.
1069 (_getopt_internal_r, _getopt_internal): Argv is now char **,
1070 not char *__getopt_argv_const *.
1071 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1072 _getopt_long_only_r): Likewise.
1073 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
1074 * getopt_int.h (_getopt_internal, _getopt_internal_r,
1075 _getopt_long_r, _getopt_long_only_r): Likewise.
1076 * getopt_.h (__getopt_argv_const): Remove.
1077 (getopt): Argv is now char * const *, as per standard.
1079 * getdate.y (tORDINAL): New token.
1080 (day, relunit): Allow it for relative times.
1081 (relative_time_table): Use tORDINAL for ordinals.
1083 2004-11-15 Jim Meyering <jim@meyering.net>
1085 * closeout.c: Include "__fpending.h" once again.
1086 Include <stdbool.h>.
1087 (close_stdout): Don't fail just because stdout was closed initially,
1088 since some programs don't write to stdout in the normal course of
1089 operation (other than --version and --help), and we don't want this
1090 function to make e.g. `touch file >&-' fail.
1091 But do fail if it was closed and someone has tried to write to it.
1092 E.g., `printf foo >&-' must fail.
1094 2004-11-11 Simon Josefsson <jas@extundo.com>
1096 * strtok_r.h, strtok_r.c: New file.
1098 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
1100 * getopt_.h (__getopt_argv_const): New macro, to be used so that
1101 we can stop lying to compilers about the constness of argv when we
1102 are compiled outside glibc.
1103 (getopt, getopt_long, getopt_long_only): Use it.
1104 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
1106 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1107 _getopt_long_only_r): Likewise.
1108 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
1109 _getopt_long_only_r): Likewise.
1111 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
1112 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
1113 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
1114 the other external symbols.
1115 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
1116 declaration, since the above renaming now works around collisions.
1118 2004-11-11 Jim Meyering <jim@meyering.net>
1120 * linebreak.c: Remove trailing blanks.
1121 * alloca_.h: Likewise.
1122 * acosl.c: Likewise.
1123 * euidaccess.c: Likewise.
1124 * allocsa.h: Likewise.
1126 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
1128 * mktime.c (SHR): New macro, which is a portable
1129 substitute for >> that should work even on Crays.
1130 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
1131 Problem reported by Mark D. Baushke in
1132 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
1133 * getdate.y (SHR): Likewise.
1135 * strftime.c (SHR): Likewise.
1137 * quotearg.c (struct quoting_options): Use unsigned int for
1138 quote_these_too, so that right shifts are well defined. All uses
1141 2004-11-10 Simon Josefsson <jas@extundo.com>
1143 * getaddrinfo.h, getaddrinfo.c: New files.
1145 2004-11-10 Jim Meyering <jim@meyering.net>
1147 Ensure that no close failure goes unreported.
1148 * closeout.c (close_stdout): Always close stdout. I.e., don't
1149 return early when it seems there's nothing to flush.
1150 Don't include __fpending.h.
1152 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
1154 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
1156 2004-11-05 Bruno Haible <bruno@clisp.org>
1158 * readlink.c: Include stddef.h, needed for size_t on Woe32.
1159 Reported by Mark D. Baushke <mdb@cvshome.org>.
1161 2004-11-04 Bruno Haible <bruno@clisp.org>
1163 2004-09-11 Bruno Haible <bruno@clisp.org>
1164 * allocsa.valgrind: New file.
1165 2004-02-06 Bruno Haible <bruno@clisp.org>
1166 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
1167 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
1168 Reported by Christopher Seip <chris.seip@hp.com>.
1170 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1172 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
1173 with errno == ERANGE if the buffer is too small.
1174 Problem reported by Mark D. Baushke.
1176 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
1178 * xreadlink.c (MAXSIZE): New macro.
1179 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
1180 size does not exceed MAXSIZE. Avoid cast.
1181 As suggested by Mark D. Baushke in
1182 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
1183 if readlink fails with buffer size just under MAXSIZE, try again
1186 2004-11-02 Derek R. Price <derek@ximbiot.com>
1187 and Paul Eggert <eggert@cs.ucla.edu>
1189 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
1190 (get_date): Overparenthesize to avoid GCC warning.
1192 2004-11-02 Bruno Haible <bruno@clisp.org>
1194 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
1195 function returns void.
1197 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
1199 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1200 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
1203 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1205 * getdate.y: Add support for TZ="foo" within a date string.
1206 Fix some bugs near time_t boundaries. Reject dates with
1207 out-of-range components, e.g., "Sept 31".
1208 Include <stdlib.h>, "setenv.h", "xalloc.h".
1209 (ISDIGIT_LOCALE): Remove; unused.
1210 Note that the TZ and time functions used here are not reentrant.
1211 (mktime_ok, get_tz): New functions.
1212 (TZBUFSIZE): New constant.
1213 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
1214 This requires that we sometimes generate our own TZ="XXX..." setting.
1216 2004-10-27 Derek R. Price <derek@ximbiot.com>
1218 * mktime.c (not_equal_tm): Remove redundant check.
1220 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
1222 * getdate.y: Use Bison 1.875 features, and some minor
1223 code cleanups. This change does not affect semantics.
1224 Don't include <stdlib.h>; no longer needed.
1225 Don't include unlocked-io.h; only the "#if TEST" code uses
1226 stdio, and performance isn't crucial there.
1227 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
1228 Bison 1.875 features as described below.
1229 All uses of "PC." replaced by "pc->".
1230 (YYSTYPE): Add a forward declaration.
1231 (yylex, yyerror): Use full prototypes in forward decls.
1232 Use "%pure-parser" rather than obsolescent "%pure_parser".
1233 Use %parse-param and %lex-param instead of obsolescent
1234 YYPARSE_PARAM and YYLEX_PARAM.
1235 (meridian_table, month_and_day_table, time_units_table,
1236 relative_time_table, time_zone_table, military_table,
1237 lookup_zone, lookup_word, get_date):
1238 Use NULL instead of 0 where appropriate.
1239 (to_hour): Avoid abort (), to avoid a dependency on
1241 (yyerror, yylex): Now accepts parser_control * arg.
1242 (main) [TEST]: Use '\0' rather than 0 for char.
1244 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
1246 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
1247 It's now the caller's responsibility to handle the case where
1248 !HAVE_GETPAGESIZE && !defined getpagesize.
1250 * mktime.c (leapyear): Arg is long int, not int.
1252 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
1254 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
1256 2004-10-12 Simon Josefsson <jas@extundo.com>
1258 * getpass.c (fflush_unlocked, flockfile, funlockfile)
1259 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
1262 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
1264 * vsnprintf.h: New file.
1265 * vsnprintf.c: New file.
1267 2004-10-07 Bruno Haible <bruno@clisp.org>
1269 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
1270 into the provided buffer.
1272 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
1274 * diacrit.c, diacrit.h: Add GPL notice.
1276 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
1277 * atanl.c (atanl): Keep the code as similar to glibc as possible.
1278 * logl.c (logl): Keep the code as similar to glibc as possible.
1279 This avoids a potential constant-folding bug.
1281 2004-10-05 Bruno Haible <bruno@clisp.org>
1283 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
1285 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1287 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
1288 * xmalloc.c (xmemdup): Likewise.
1289 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
1290 XFREE): Remove these long-obsolescent macros.
1291 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
1292 * xstrdup.c: Remove.
1294 * regex.c (re_comp): Cast gettext return value to char *,
1295 Problem reported by Martin Neitzel via Mark D. Baushke.
1297 2004-10-04 Simon Josefsson <jas@extundo.com>
1299 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
1300 '#ifdef USE_UNLOCKED_IO'.
1302 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1304 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
1305 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
1306 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
1307 regex.c, sha1.c, version-etc.c, yesno.c:
1308 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
1309 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
1310 the includer's responsibility.
1312 Sync from coreutils.
1314 * modechange.c (mode_compile): Don't decrement a pointer that
1315 points to the start of a string, as the C Standard says the
1316 resulting behavior is undefined.
1318 * backupfile.h (enum backuptype): Rename none -> no_backups,
1319 simple -> simple_backups, numbered_existing ->
1320 numbered_existing_backups, numbered -> numbered_backups
1321 to avoid shadowing problems. All uses changed.
1322 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
1323 * backupfile.c (check_extension, numbered_backup):
1324 Rename locals to avoid shadowing 'basename'.
1325 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
1328 * .cppi-disable: Add getopt_.h, getopt_int.h.
1329 * .cvsignore: Add getopt.h.
1331 2004-10-04 Simon Josefsson <jas@extundo.com>
1333 * memmem.h: New file.
1334 * memmem.c: New file, taken from glibc.
1336 2004-10-02 Jim Meyering <jim@meyering.net>
1338 * dirfd.h, getpagesize.h: Add copyright notice.
1340 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
1342 * snprintf.c: Remove comments as to why each header is needed.
1344 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
1346 * strsep.h: New file.
1347 * strsep.c: New file.
1349 2004-10-01 Simon Josefsson <jas@extundo.com>
1351 * snprintf.c (snprintf): Handle size==0.
1353 2004-10-01 Simon Josefsson <jas@extundo.com>
1354 Bruno Haible <bruno@clisp.org>
1356 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
1357 (snprintf): Declare 'args'.
1359 2004-09-30 Simon Josefsson <jas@extundo.com>
1361 * snprintf.h, snprintf.c: New files.
1363 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1365 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
1366 (hol_entry_help): Never translate an empty string.
1367 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
1368 * argp.h (OPTION_NO_TRANS): New option.
1370 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
1372 * xvasprintf.c: Include xalloc.h.
1373 (xvasprintf): Use xalloc_die, not xmalloc_die.
1375 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
1377 * dummy.c: Change copyright notice to FSF, and license to GPL.
1379 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
1381 * argp-pvh.c (argp_program_version_hook): Provide initial value.
1382 Problem reported by Bruno Haible in:
1383 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
1385 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
1387 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
1388 in case some system header has #define'd it. Problem reported by
1389 Soeren D. Schulze in
1390 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
1392 2004-09-08 Bruno Haible <bruno@clisp.org>
1394 * stdint_.h.in: New file, taken from GNU clisp.
1396 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
1398 * xvasprintf.h: New file.
1399 * xvasprintf.c: New file.
1400 * xasprintf.c: New file.
1402 2004-09-08 Bruno Haible <bruno@clisp.org>
1404 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
1406 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
1408 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
1410 Import from coreutils.
1411 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
1412 strings on unbounded length. alloca's performance benefits aren't
1413 that important here.
1415 (parse_with_separator): New function, with most of the internals
1416 of the old parse_user_spec. Allow user to omit both user and group,
1417 for compatibility with FreeBSD.
1418 Clone only the user name, not the entire spec.
1419 Do not set *uid, *gid unless entirely successful.
1420 Avoid memory leak in some failing cases.
1421 Fix regression for USER.GROUP reported by Dmitry V. Levin in
1422 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1423 (parse_user_spec): Rewrite to use parse_with_separator.
1425 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
1427 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
1428 its complicated substitute.
1429 * argp-help.c: Include <errno.h>, for program_invocation_short_name
1430 and program_invocation_name.
1431 (__argp_basename) [!_LIBC]: Remove; the only use was
1432 replaced by its body.
1433 (__argp_short_program_name): Change condition from
1434 !defined __argp_short_program_name to
1435 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
1436 to match argp-namefrob.h.
1437 (__argp_failure): Don't assume strerror_r returns char *.
1438 * argp-parse.c (N_): Define unconditionally.
1439 (argp_default_options): Fill out initializers with 0 to avoid
1442 2004-08-12 Simon Josefsson <jas@extundo.com>
1444 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
1445 * getopt_.h: Renamed from getopt.h.
1447 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
1449 Merge from coreutils.
1451 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
1452 wmemchr or wmemcpy. Problem reported by Robert Dahlem
1453 for Reliant Unix 5.43.
1455 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
1456 (union fooround): Use uintmax_t, not long int.
1457 The rest is a merge from libc:
1458 [defined _LIBC]: Include <shlib-compat.h>.
1459 (_obstack) [defined _LIBC]: Remove after 2.3.4.
1461 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
1463 * strverscmp.c: Convert to UTF-8.
1465 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
1467 * obstack.h (obstack_empty_p):
1468 Don't assume that chunk->contents is suitably aligned.
1469 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
1470 Likewise. Problem reported by Benno in
1471 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
1473 * chown.c (rpl_chown): Work even if the file is writeable but not
1474 readable. This could be improved further but it'd take some work.
1476 2004-08-08 Simon Josefsson <jas@extundo.com>
1478 * xgethostname.c: Don't include error.h (not used).
1481 * getpass.c: Include getpass.h first.
1483 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
1485 * xalloc-die.c: New files.
1486 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
1488 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
1489 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
1490 (_, N_, xalloc_die): Move to xalloc-die.c.
1491 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
1492 so that we needn't mess with xalloc_msg_memory_exhausted.
1494 * sha1.h: Renamed from sha.h.
1495 (SHA1_H): Renamed from _SHA_H.
1496 (sha1_ctx): Renamed from sha_ctx.
1497 (sha1_init_ctx): Renamed from sha_init_ctx.
1498 (sha1_process_block): Renamed from sha_process_block.
1499 (sha1_process_bytes): Renamed from sha_process_bytes.
1500 (sha1_finish_ctx): Renamed from sha_finish_ctx.
1501 (sha1_read_ctx): Renamed from sha_read_ctx.
1502 (sha1_stream): Renamed from sha_stream.
1503 (sha1_buffer): Renamed from sha_buffer.
1504 * sha1.c: Likewise; renamed from sha.c.
1505 Do not include <sys/types.h>.
1506 Include <stddef.h> rather than <stdlib.h>.
1508 2004-08-08 Bruno Haible <bruno@clisp.org>
1510 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
1511 FILESYSTEM_PREFIX_LEN.
1512 * progreloc.c: Likewise.
1513 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
1515 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
1518 * argp-help.c (make_hol, hol_append): Don't assume that
1519 SIZE_MAX is a valid preprocessor constant.
1520 (__argp_basename): Change from "#ifndef _LIBC"
1521 to "#ifndef __argp_short_program_name", so that
1522 we don't compile these functions for tar.
1524 More merges from coreutils.
1525 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
1526 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
1528 * addext.c: Remove; no longer needed.
1529 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
1530 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
1531 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
1532 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
1533 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
1534 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
1535 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
1536 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
1537 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
1538 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
1539 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
1540 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
1541 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
1542 Import changes from coreutils.
1544 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
1546 Merge from coreutils.
1548 * .gdb-history: Remove; this doesn't belong here.
1550 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
1551 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
1552 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
1554 * dirname.h: Include <stdbool.h>.
1555 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
1556 for consistency with POSIX terminology. All uses changed.
1557 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
1558 (strip_trailing_slashes): Use bool for booleans.
1559 * stripslash.c (strip_trailing_slashes): Likewise.
1561 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1562 sometimes returns a positive errno value even when it succeeds.
1563 (print_errno_message) [!LIBC]: Fall back on strerror if
1566 * path-concat.c (mempcpy): Don't define if a system header defines it.
1567 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
1568 (longest_relative_suffix): New function.
1569 (path_concat): Use it. Assume first argument is not NULL.
1570 Port to DOS. Omit redundant separators.
1571 Report an error instead of returning NULL.
1572 Use mempcpy instead of memcpy.
1573 (xpath_concat): Remove: not declared or used.
1575 * same.h: Include <stdbool.h>
1576 (same_name): Return bool, not int.
1577 * same.c (same_name): Likewise.
1578 (errno): Don't declare; we assume C89 or better now.
1580 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
1581 if not already defined.
1583 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
1584 * dup-safer.c (errno): Likewise.
1586 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
1588 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
1591 2004-08-03 Simon Josefsson <jas@extundo.com>
1593 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
1594 * progname.h: Don't include stdbool.h.
1596 2004-08-02 Simon Josefsson <jas@extundo.com>
1598 * getsubopt.h: New file, with comments from Bruno Haible.
1599 * getsubopt.c: New file, from glibc, but slightly modified based on
1600 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
1602 2004-08-01 Simon Josefsson <jas@extundo.com>
1604 * xgetdomainname.c: Include stdlib.h, for free().
1606 2004-07-16 Simon Josefsson <jas@extundo.com>
1608 * dummy.c: New file.
1610 2004-07-16 Bruno Haible <bruno@clisp.org>
1612 * backupfile.h: Add extern "C" for C++.
1613 * closeout.h: Likewise.
1614 * copy-file.h: Likewise.
1615 * findprog.h: Likewise.
1616 * full-write.h: Likewise.
1617 * pathname.h: Likewise.
1618 * progname.h: Likewise.
1619 * stpcpy.h: Likewise.
1620 * stpncpy.h: Likewise.
1621 * strcase.h: Likewise.
1622 * strstr.h: Likewise.
1623 * xalloc.h: Likewise.
1625 * mbswidth.h: Add extern "C" for C++.
1626 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
1628 2004-07-09 Simon Josefsson <jas@extundo.com>
1630 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
1631 failed without this.)
1633 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
1635 * fchown-stub.c: New file.
1637 2004-06-24 Jim Meyering <jim@meyering.net>
1639 * obstack.h (obstack_base): Cast to (void *), per documentation.
1641 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
1643 * argz.c, argz_.h: New files, which are autoupdated from libtool.
1645 2004-06-01 Jim Meyering <jim@meyering.net>
1647 * calloc.c: New file.
1649 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
1651 * getdate.y (yylex): Allow space between sign and number.
1652 Problem reported by Dan Jacobson.
1654 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
1655 and Jim Meyering <jim@meyering.net>
1657 Merge from coreutils CVS.
1659 * stat-macros.h: New file, with contents from file-type.h
1660 and coreutils' system.h.
1661 * file-type.c: Include "stat-macros.h".
1662 * file-type.h (file_type): Move all macro definitions to new file,
1665 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
1666 Wrap old code with this conditional.
1667 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
1668 function that does not dereference symlinks.
1669 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
1671 * xreadlink.c: Include xreadlink.h first, to catch .h file
1672 dependency problems.
1673 (xreadlink): Accept new arg SIZE, for efficiency.
1674 All decls and uses changed.
1675 * xreadlink.h: Include <stddef.h>, for size_t.
1677 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
1678 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
1680 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
1682 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
1684 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
1685 macros to be defined.
1686 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
1687 the allocator returns NULL because the requested size is zero.
1689 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
1691 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
1692 var. Add comment explaining why libc still defines it. This
1693 merges the following patch from glibc:
1694 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
1696 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
1698 * obstack.c (_obstack): Remove unused variable. It hasn't been
1699 present in glibc since revision 1.1 of this file.
1700 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
1701 obstack_alignment_mask, obstack_alloc, obstack_base,
1702 obstack_blank, obstack_blank_fast, obstack_chunk_size,
1703 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
1704 obstack_grow0, obstack_init, obstack_int_grow,
1705 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
1706 obstack_next_free, obstack_object_size, obstack_ptr_grow,
1707 obstack_ptr_grow_fast, obstack_room): Remove declarations of
1708 nonexistent functions.
1710 2004-05-17 Derek R. Price <derek@ximbiot.com>
1711 Paul Eggert <eggert@cs.ucla.edu>
1713 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
1715 2004-05-14 Bruno Haible <bruno@clisp.org>
1717 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
1718 that consists of a '.' followed by an empty digit string.
1719 Patch by Tor Lillqvist <tml@iki.fi>.
1721 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
1723 Port obstack to the AS/400, where pointers are 16 bytes wide and
1724 you cannot cast an integer to a valid pointer. This patch is
1725 currently waiting to be integrated into glibc; see
1726 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
1728 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
1729 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
1730 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
1731 (struct obstack): temp member is now a union of a pointer and
1732 an integer, instead of an integer. All integer uses changed.
1733 This does not affect the physical layout of struct obstack,
1734 except on hosts (like the AS/400) where the size or alignment of
1735 void * is greater than that of ptrdiff_t.
1736 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
1737 __STDC__)]: Store temporary in pointer member of union, not
1739 * obstack.c: Include <stddef.h>, for offsetof.
1740 (struct fooalign): Remove; it doesn't need a name.
1741 (union fooround): Change double to long double, and add void *.
1742 (DEFAULT_ALIGNMENT): Use offsetof to compute.
1743 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
1744 not a macro. Hence the values are always int; so remove all
1745 casts-to-int in uses.
1747 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
1748 Derek Price <derek@ximbiot.com>
1750 * alloca.c: Include <alloca.h>, to get our interface.
1751 * alloca_.h: Use __alloca on AIX, so that we don't have to
1752 include <alloca.h> first. Use C89 prototype for alloca; this
1753 requires including <stddef.h> for size_t. Use extern "C" if C++.
1754 Use #elif for simplicity, since we can assume C89 now.
1755 Don't try to source the system alloca.h since it will not be found
1756 and to prevent recursively including its replacement.
1757 * fnmatch.c: Include <alloca.h> instead of opencoding.
1758 * regex.c: Likewise.
1760 2004-05-16 Derek Price <derek@ximbiot.com>
1761 Paul Eggert <eggert@cs.ucla.edu>
1763 getline cleanup. This changes the getndelim2 API: both order of
1764 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
1767 * getline.c: Don't include stddef.h or stdio.h, since our
1768 interface does that.
1769 (getline): Always use getdelim, so that we don't have two
1770 copies of this code.
1771 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
1773 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
1774 (GETNDELIM2_MAXIMUM): New macro.
1775 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
1776 instead of the old practice of delim2==0. All callers changed.
1777 Return -1 on overflow, instead of returning junk.
1778 Do not set *linesize unless allocation succeeds.
1779 * getndelim2.h: Do not include stddef.h; no longer needed, now
1780 that we include sys/types.h.
1781 * getnline.h: Likewise.
1782 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
1783 (getndelim2): Reorder arguments.
1784 * getnline.c (getnline, getndelim):
1785 Don't discard the NMAX argument.
1786 (getnline): Invoke getndelim, to avoid code duplication.
1787 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
1788 of (size_t) -1 by callers of the getnline family.
1790 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
1792 * nanosleep.c (suspended): Change its type from int to
1793 sig_atomic_t volatile.
1794 (first_call): Make it private to rpl_nanosleep, and have it
1795 be zero initially as that's a bit faster.
1796 (my_usleep): Round up fractional times instead of truncating them,
1797 as this is the usual meaning for 'sleep'.
1799 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
1801 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
1802 (ENOSYS): Define if not defined.
1803 (settime): Fall back on stime if it exists and settimeofday fails.
1804 But don't bother with fallbacks if a method fails with errno == EPERM.
1806 2004-05-11 Jim Meyering <jim@meyering.net>
1808 Prior to this change, the save_cwd caller required read access to the
1809 current directory on most systems (ones with the fchdir function).
1811 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
1812 fails, try write-only, and finally, resort to using xgetcwd.
1814 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
1816 * obstack.c, obstack.h: Import changes from libc.
1818 2004-04-28 Bruno Haible <bruno@clisp.org>
1820 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
1821 implicitly appends .exe to executables.
1822 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
1823 accepts Windows pathnames.
1824 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1825 Cygwin like Windows, since it now accepts Windows pathnames.
1826 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
1827 Cygwin like Windows, since it now accepts Windows pathnames.
1828 Reported by Derek Robert Price <derek@ximbiot.com>.
1830 2004-04-20 Jim Meyering <jim@meyering.net>
1832 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
1834 2004-04-20 Jim Meyering <jim@meyering.net>
1835 Bruno Haible <bruno@clisp.org>
1837 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
1838 memory when realloc fails.
1840 2004-04-18 Jim Meyering <jim@meyering.net>
1842 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
1843 don't leak memory and do call END_UTMP_ENT.
1845 2004-04-11 Paul Eggert <eggert@twinsun.com>
1847 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
1848 (CHAR_BIT): Remove, since we assume C89.
1849 Include <stdint.h> if available, as per current Autoconf CVS advice.
1851 2004-03-30 Paul Eggert <eggert@twinsun.com>
1853 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
1854 not bool, to be more consistent with Unix conventions.
1855 Suggested by Bruno Haible.
1857 Merge from coreutils.
1859 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
1862 * getdate.h: Include stdbool.h, and timespec.h instead of
1863 the usual <time.h> dance.
1864 (get_date): Change signature to support fractional time stamps.
1865 All callers changed.
1866 * getdate.y: Include "getdate.h" first, as we can now
1867 assume C89 and don't need to worry about 'const'.
1868 Similarly, include "unlocked-io.h" near start, not in middle.
1870 (textint.value): Use long int rather than int.
1871 (textint.digits): Use size_t rather than int.
1872 (BILLION, LOG10_BILLION): New constants.
1873 (parser_control): New member rel_ns. Members day_ordinal,
1874 time_zone, month, day, hour, minutes, rel_year, rel_month,
1875 rel_day, rel_hour, rel_minutes, rel_seconds
1876 are now long int, not int. Member seconds is now struct timespec,
1877 not int. New member timespec_seen. Members dates_seen, days_seen,
1878 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
1880 (%union.intval): Now long int, not int.
1881 New member timespec.
1882 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
1883 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
1884 (spec): Now is a timespec or an item list.
1885 (timespec, items): New nonterminals.
1886 (time, rel, relunit, number, get_date):
1887 Add support for fractional seconds.
1888 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
1889 (gmtime, localtime, mktime): Remove decls; not needed with C89.
1890 (to_hour): First arg is now long int, not int.
1891 (to_year): Returns long int, not int.
1892 Don't treat year -70 like 70.
1893 (tm_diff): Returns long int, not int.
1894 (lookup_word): Use bool instead of int when appropriate.
1895 (yylex): Use size_t for count, not int.
1896 Detect overflow when parsing large integer constants.
1897 Add support for fractions.
1898 (get_date): Make pointers 'const' if possible.
1899 Use more-portable code to detect integer overflow.
1900 (main) [TEST]: Adjust to above changes. Test for localtime failure.
1901 Don't use ctime; it's not reliable if the year has >4 digits.
1903 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
1904 This is for compatibility with BSD.
1906 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
1907 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
1908 From coreutils' system.h.
1910 * userspec.c: Don't include "posixver.h".
1911 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
1912 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
1913 compatible extension. Simplify code by removing a boolean int
1914 that was always nonzero if a string was nonnull.
1916 2004-03-30 Jim Meyering <jim@meyering.net>
1918 Merge from coreutils.
1920 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
1922 * readtokens.c (readtoken): Don't leak 64 bytes when reading
1923 an empty input stream.
1925 * readtokens.c: Include <stdbool.h>.
1926 (readtoken): Use `size_t' rather than int/long.
1927 All callers adjusted.
1928 Use `bool' rather than `int' where appropriate.
1929 Use memset rather than an explicit loop.
1930 Use x2nrealloc rather than xrealloc.
1931 Allow the use of `\0' as a delimiter.
1932 (readtokens): Likewise.
1933 * readtokens.h (readtoken, readtokens): Update prototypes.
1935 2004-03-30 Bruno Haible <bruno@clisp.org>
1937 * getloadavg.c (getloadavg): Don't assume setlocale returns
1940 2004-03-29 Paul Eggert <eggert@twinsun.com>
1942 Merge changes to getloadavg.c from coreutils and Emacs.
1944 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
1945 Define to an expression, not to the empty string.
1946 Include cloexec.h and xalloc.h.
1947 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
1948 Use set_cloexec_flag rather than rolling our own.
1949 * cloexec.c, cloexec.h: New files.
1951 2004-03-18 Paul Eggert <eggert@twinsun.com>
1953 * getopt.h: Sync with libc CVS.
1955 2004-03-18 Paul Eggert <eggert@twinsun.com>
1956 Bruno Haible <bruno@clisp.org>
1958 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
1959 not on all platforms that have <wchar.h>.
1960 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
1962 2004-03-09 Paul Eggert <eggert@twinsun.com>
1964 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
1966 * getopt_int.h: New file, also synced from libc.
1968 2004-03-07 Paul Eggert <eggert@twinsun.com>
1970 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
1971 '#if' expressions. Unlike the code it replaces, it does not
1972 depend on (defined _SC_PAGESIZE). However, it does depend on
1973 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
1974 first reported by Jason Andrade in
1975 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
1977 2004-01-18 Simon Josefsson <jas@extundo.com>
1979 * strdup.h: New file.
1980 * strdup.c: Include it.
1981 * path-concat.c: Include strdup.h. Drop strdup declaration.
1982 * userspec.c: Include strdup.h. Drop strdup declaration.
1984 2004-02-06 Karl Berry <karl@gnu.org>
1986 * config.charset: update from gettext 0.14.1.
1988 2004-02-05 Paul Eggert <eggert@twinsun.com>
1990 Add comments and code, prompted by suggestions from Bruno Haible
1992 * quotearg.h (quotearg_alloc): New decl. Improve the comments
1993 describing the enum quoting_style values.
1994 * quotearg.c (quotearg_alloc): New function.
1995 (quotearg_buffer_restyled): Treat lone { and } as special.
1996 Treat = as special. Work around bug with older shells
1997 that "see" a '\' that is really the 2nd byte of a multibyte char.
1998 Quote empty string with shell_quoting_style.
2000 2004-02-03 Bruno Haible <bruno@clisp.org>
2002 * pipe.h: New file, from GNU gettext.
2003 * pipe.c: New file, from GNU gettext.
2005 2004-01-27 Bruno Haible <bruno@clisp.org>
2007 * execute.h: New file, from GNU gettext.
2008 * execute.c: New file, from GNU gettext.
2009 * w32spawn.h: New file, from GNU gettext.
2011 2004-01-23 Paul Eggert <eggert@twinsun.com>
2013 Exit-status fix from coreutils.
2015 Use exit_failure consistently in place of EXIT_FAILURE,
2016 so that program exit statuses are consistent on failure.
2018 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
2019 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
2020 * argmatch.h: Comment fix to match the above.
2021 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
2022 Now a macro referring to exit_failure, instead of a separate
2023 variable. Include "exitfail.h" to get it.
2024 * xstrtol.h: Include "exitfail.h".
2025 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
2027 * long-options.c (parse_long_options): Use prototype
2028 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
2031 2004-01-21 Jim Meyering <jim@meyering.net>
2033 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
2034 so as not to conflict with a different-sized __mktime_internal
2035 function in GNU libc.
2036 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
2037 Problem building statically-linked `ls' reported by Michael Brunnbauer.
2039 2004-01-18 Paul Eggert <eggert@twinsun.com>
2041 Merge from diffutils.
2043 * file-type.c (file_type): Add typed memory objects.
2044 * file-type.h (S_TYPEISTMO): New macro.
2046 * c-stack.h (c_stack_action): Remove argv argument.
2047 * c-stack.c (c_stack_action): Likewise. All uses changed.
2048 (die): Don't calculate message unless segv_action returns.
2049 (get_stack_location, min_address_from_argv, max_address_from_argv,
2050 volatile stack_base, volatile_stack_size): Remove.
2051 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
2052 that every segmentation violation is a stack overflow. (Ouch!)
2053 See Debian bug 136249 (still outstanding) for more info about why
2054 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
2056 2003-11-30 Bruno Haible <bruno@clisp.org>
2058 Safer stack allocation.
2059 * setenv.c: Include allocsa.h.
2060 (alloca): Remove fallback definition.
2061 (freea): Remove macro.
2062 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
2065 2003-10-17 Bruno Haible <bruno@clisp.org>
2067 * binary-io.h: Avoid warnings on Cygwin.
2069 2003-12-28 Bruno Haible <bruno@clisp.org>
2071 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
2072 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
2074 2003-11-28 Bruno Haible <bruno@clisp.org>
2076 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
2078 2003-11-27 Bruno Haible <bruno@clisp.org>
2080 * wait-process.c: On Windows, include windows.h. Needed on mingw.
2082 2003-11-17 Bruno Haible <bruno@clisp.org>
2084 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
2086 2003-11-24 Bruno Haible <bruno@clisp.org>
2088 * xallocsa.h: New file, from GNU gettext.
2089 * xallocsa.c: New file, from GNU gettext.
2091 2003-11-24 Bruno Haible <bruno@clisp.org>
2093 * allocsa.h: New file, from GNU gettext.
2094 * allocsa.c: New file, from GNU gettext.
2096 2003-11-24 Bruno Haible <bruno@clisp.org>
2098 * eealloc.h: New file.
2100 2004-01-15 Jim Meyering <jim@meyering.net>
2102 Merge from coreutils.
2104 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
2105 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
2106 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
2108 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
2109 optional configure-time default.
2111 * version-etc.c (version_etc_copyright): Update copyright date.
2113 * xreadlink.c (xreadlink): Correct outdated comment.
2115 2004-01-15 Paul Eggert <eggert@twinsun.com>
2117 Merge from coreutils.
2119 * posixver.c: Include posixver.h.
2121 * same.c: Include <stdbool.h>, <limits.h>.
2122 (_POSIX_NAME_MAX): Define if not defined.
2124 (same_name): If file names are silently truncated, report
2125 that the file names are the same if they are the same after
2126 the silent truncation.
2128 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
2129 conversion function.
2130 * xstrtod.c (xstrtod): Likewise. All callers changed to
2131 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
2134 2004-01-14 Paul Eggert <eggert@twinsun.com>
2136 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
2137 with like-named macro in fnmatch.c.
2138 (EXT): Use an internal constant instead.
2140 Merge fnmatch patches from glibc.
2141 * fnmatch.c (mbsinit): Remove define.
2142 Add libc_hidden_ver (__fnmatch, fnmatch).
2143 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
2144 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
2146 2003-12-14 Karl Berry <karl@gnu.org>
2148 * config.charset: update from gettext-runtime.
2150 2003-12-03 Paul Eggert <eggert@twinsun.com>
2152 * getgroups.c (getgroups): xmalloc takes one argument, not two.
2153 Bug reported by Alfred M. Szmidt.
2155 2003-11-29 Karl Berry <karl@gnu.org>
2157 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
2159 2003-11-23 Paul Eggert <eggert@twinsun.com>
2160 Bruno Haible <bruno@clisp.org>
2162 * printf-parse.h: Don't include sys/types.h.
2163 (ARG_NONE): New macro.
2164 (char_directive): Change type of *arg_index fields to size_t.
2165 * printf-parse.c: Don't include sys/types.h.
2166 (SSIZE_MAX): Remove macro.
2167 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
2168 Remove unnecessary overflow check.
2169 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
2172 2003-11-24 Paul Eggert <eggert@twinsun.com>
2174 * alloca.c: Remove dependency on xalloc module.
2175 (xalloc_die): Remove.
2176 (memory_full) [!defined emacs]: New macro.
2177 [!defined emacs]: Don't include xalloc.h.
2178 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
2179 address arithmetic overflows. Change datatypes a bit to avoid
2182 2003-11-22 Jim Meyering <jim@meyering.net>
2184 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
2186 2003-11-17 Bruno Haible <bruno@clisp.org>
2188 * vasnprintf.c (alloca): Remove fallback definition.
2189 (freea): Remove definition.
2190 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
2191 Reported by Paul Eggert.
2193 2003-11-17 Jim Meyering <jim@meyering.net>
2195 On systems without utime and without a utimes function capable of
2196 dealing with a NULL struct utimbuf* argument, this utime replacement
2197 could -- in unusual circumstances -- leak a file descriptor.
2198 * utime.c: Include <unistd.h> and <errno.h>.
2199 (utime_null): Be sure to close `fd' and to preserve errno.
2200 Reported by Geoff Collyer via Arnold Robbins.
2202 2003-11-16 Paul Eggert <eggert@twinsun.com>
2203 Bruno Haible <bruno@clisp.org>
2205 Protect against address arithmetic overflow.
2206 * printf-args.h: Include stddef.h.
2207 (arguments): Change type of field 'count' to size_t.
2208 * printf-args.c (printf_fetchargs): Use size_t instead of
2209 'unsigned int' where appropriate.
2210 * printf-parse.h: Include sys/types.h.
2211 (char_directive): Change type of *arg_index fields to ssize_t.
2212 (char_directives): Change type of fields 'count', max_*_length to
2214 * printf-parse.c: Include sys/types.h and xsize.h.
2215 (SSIZE_MAX): Define fallback value.
2216 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
2217 instead of 'int' where appropriate. Check a_allocated, d_allocated
2218 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
2219 * vasnprintf.c: Include xsize.h.
2220 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
2221 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
2222 overflow. Avoid wraparound when converting a width or precision from
2225 2003-11-16 Bruno Haible <bruno@clisp.org>
2227 Update from GNU gettext.
2228 * printf-parse.c: Generalize to it can be compiled for wide strings.
2229 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
2230 * vasnprintf.c: Generalize to it can be compiled for wide strings.
2231 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
2232 SNPRINTF): New macros.
2233 Don't include <alloca.h> if the file is used inside libintl.
2234 (local_wcslen): New function, for Solaris 2.5.1.
2235 (VASNPRINTF): Use it instead of wcslen.
2237 2003-11-16 Bruno Haible <bruno@clisp.org>
2239 * xsize.h (xmax): New function.
2240 (xsum, xsum3, xsum4): Declare as "pure" functions.
2242 2003-11-12 Paul Eggert <eggert@twinsun.com>
2244 * xalloc.h: Do not include <limits.h> or <stdint.h>.
2245 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
2246 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
2247 heuristic is just as accurate as far as we know, and it removes a
2248 dependency on size_max.m4 and ptrdiff_max.m4.
2250 2003-11-12 Paul Eggert <eggert@twinsun.com>
2252 * xstrtol.c (__xstrtol): Remove "break" immediately after
2253 "return", to pacify some unknown compiler. Problem reported
2256 2003-11-11 Bruno Haible <bruno@clisp.org>
2258 * xsize.h (SIZE_MAX): Remove fallback definition.
2259 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
2262 2003-11-10 Paul Eggert <eggert@twinsun.com>
2264 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
2265 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
2266 rejected some allocations of exactly SIZE_MAX - 2 bytes.
2268 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
2269 not (size_t) -1, since it's defined here.
2271 2003-11-06 Paul Eggert <eggert@twinsun.com>
2273 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
2274 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
2275 Reject sizes of exactly SIZE_MAX bytes.
2276 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
2277 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
2279 2003-11-05 Bruno Haible <bruno@clisp.org>
2281 * xsize.h: Include limits.h, to avoid a possible collision with
2282 SIZE_MAX defined in <limits.h> on Solaris.
2284 2003-11-04 Bruno Haible <bruno@clisp.org>
2286 * xsize.h: New file.
2287 * linebreak.c: Include xsize.h.
2288 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
2289 argument for overflow.
2290 Suggested by Paul Eggert.
2292 2003-10-31 Bruno Haible <bruno@clisp.org>
2294 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
2295 to avoid (extremely rare) race condition.
2296 Suggested by Paul Eggert.
2298 2003-11-03 Jim Meyering <jim@meyering.net>
2300 * userspec.c: Include "userspec.h".
2301 * userspec.h: New file.
2303 2003-10-31 Paul Eggert <eggert@twinsun.com>
2305 * mountlist.h (struct mount_entry.me_type_malloced): New member.
2306 * mountlist.c (SIZE_MAX): Define if not defined already.
2307 (read_filesystem_list): Set and use me_type_malloced.
2308 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
2309 whatever the type happens to be), for brevity and consistency.
2310 Check for size calculation overflow on Alphas running OSF/1.
2312 2003-10-31 Jim Meyering <jim@meyering.net>
2314 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
2316 * linebuffer.c: Include <string.h> for declaration of memset.
2318 2003-10-30 Paul Eggert <eggert@twinsun.com>
2319 Bruno Haible <bruno@clisp.org>
2321 * vasprintf.c: Include <limits.h>, <stdlib.h>.
2322 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
2324 2003-10-29 Paul Eggert <eggert@twinsun.com>
2326 * xalloc.h (xalloc_oversized): Now a macro, not a function,
2327 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
2329 * quotearg.c (quotearg_n_options): Use it.
2330 * group-member.c: Include <stdbool.h>.
2331 (free_group_info): Arg is now const *; don't free arg.
2332 (get_group_info): Now returns bool and accepts struct group_info *,
2333 rather than returning a malloc'ed struct group_info *.
2334 All uses changed. Check for overflow in internal size calculation.
2336 * getusershell.c (readname): Simplify the code by using x2nrealloc
2337 rather than xmalloc/xrealloc.
2338 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
2339 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
2340 conformance bug: the old code used a pointer after freeing the
2341 storage that it addressed.
2342 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
2343 rather than doing it by hand.
2344 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
2345 the buffer preserved. Use free and xmalloc instead.
2346 * quotearg.c (quotearg_n_options): Likewise.
2347 Use a simpler test for size overflow. Don't use xalloc_oversized
2348 because unsigned int might be wider than size_t (!); this suggests
2349 that we should switch from unsigned int to size_t for slot numbers.
2351 2003-10-27 Bruno Haible <bruno@clisp.org>
2353 * stdbool_.h: Better support for BeOS.
2355 2003-10-27 Paul Eggert <eggert@twinsun.com>
2357 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
2358 to allocate the returned structure. Do not allocate a subarray,
2359 as x2nrealloc will do that.
2360 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
2361 instead of xnrealloc.
2362 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
2364 2003-10-26 Paul Eggert <eggert@twinsun.com>
2366 * xalloc.h (xalloc_oversized): New static inline function, for
2367 callers that want to do their own size-overflow checking. Include
2368 <stdbool.h>, since xalloc_oversized returns bool.
2369 * xalloc.c (array_size_overflow): Remove. All callers changed
2370 to use xalloc_oversized.
2372 Add two functions x2realloc, x2nrealloc, for programs that grow
2373 arrays dynamically by doubling their sizes.
2374 * xalloc.h (x2realloc, x2nrealloc): New decls.
2375 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
2378 Port to C99 semantics for 'inline' of external functions.
2379 Bug reported by Bruno Haible.
2380 * xmalloc.c (xnmalloc_inline): New static inline function,
2381 with the old contents of xnmalloc.
2382 (xnmalloc, xmalloc): Use it.
2383 (xnrealloc_inline): New static inline function,
2384 with the old contents of xnrealloc.
2385 (xnrealloc, xrealloc): Use it.
2387 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
2389 2003-10-25 Paul Eggert <eggert@twinsun.com>
2391 Fix several address-calculation bugs in the hash modules,
2392 plus some minor code cleanup.
2394 * hash.h: Include <stdbool.h>, for bool.
2395 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
2396 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
2397 hash_get_n_entries, hash_get_max_bucket_length,
2398 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
2399 hash_rehash): Use size_t rather than unsigned.
2400 * hash.c (struct hash_table, hash_get_n_buckets,
2401 hash_get_n_buckets_used, hash_get_n_entries,
2402 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
2403 hash_get_entries, hash_do_for_each, hash_string, is_prime,
2404 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
2406 (SIZE_MAX): Define if not defined.
2407 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
2408 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
2410 Use const * when possible.
2411 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
2412 (check_tuning): Fix bug: if tuning parameters were very close to
2413 0 or 1, rounding errors could have caused subscript violations.
2414 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
2415 (hash_initialize): Add 'fail:' label
2416 to free table and return NULL, and use it to simplify code.
2417 Use calloc rather than clearing the storage ourself.
2418 (hash_initialize, hash_rehash): Check for arithmetic overflow in
2419 buffer size calculations.
2420 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
2421 Include <stddef.h>, for size_t.
2422 * hash-pjw.c (hash_pjw): Likewise.
2423 Switch to method described by Bruno Haible.
2424 Include <limits.h>, for CHAR_BIT.
2425 (SIZE_BITS): New macro.
2427 2003-10-21 Paul Eggert <eggert@twinsun.com>
2429 * getndelim2.c (getndelim2): When size calculation overflows,
2430 ceiling the allocation at NMAX bytes rather than silently
2431 discarding input bytes before NMAX is reached. This makes
2432 a difference only if NMAX exceeds SIZE_MAX / 2.
2434 * obstack.c: Merge from glibc.
2435 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
2436 Add libc_hidden_def (_obstack_newchunk).
2437 (_obstack_free) [! defined _LIBC]: Remove.
2438 [defined _LIBC]: Make a strong alias from obstack_free, rather than
2439 a clone of the function body.
2440 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
2441 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
2443 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
2444 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
2447 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
2448 (obstack_ptr_grow_fast, obstack_int_grow_fast):
2449 Don't use lvalue casts, as GCC plans to remove support for them
2450 in GCC 3.5. Reported by Joseph S. Myers. This bug
2451 was also present in the non-GCC version, indicating that this
2452 code had always been buggy and had never been widely used.
2453 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
2454 Use the fast variant of each macro, rather than copying the
2455 definiens of the fast variant; that way, we'll be more likely to
2456 catch future bugs in the fast variants.
2458 2003-10-20 Bruno Haible <bruno@clisp.org>
2460 * wait-process.h: New file, from GNU gettext.
2461 * wait-process.c: New file, from GNU gettext.
2463 2003-10-19 Jim Meyering <jim@meyering.net>
2465 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
2467 2003-10-16 Paul Eggert <eggert@twinsun.com>
2469 * getgroups.c: Include <errno.h>, <stdlib.h>.
2470 (getgroups): First arg is int, not size_t.
2471 Don't let 'free' mangle errno.
2473 2003-10-16 Jim Meyering <jim@meyering.net>
2475 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
2477 2003-10-15 Paul Eggert <eggert@twinsun.com>
2479 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
2481 (new_exclude, add_exclude_file): Initial size no longer needs to
2483 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
2484 our own address arithmetic overflow checking.
2486 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
2487 (fnmatch): Do not alloca more than 2000 wide characters;
2488 instead, use malloc for large buffers.
2489 Check for address arithmetic overflow, and return -1
2490 with errno set to ENOMEM in that case.
2491 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
2492 (NEW_PATTERN): Do not alloca more than 8000 bytes;
2493 instead, return -1. Check for address arithmetic overflow.
2495 2003-10-14 Paul Eggert <eggert@twinsun.com>
2497 Handle invalid suffixes and overflow independently, so that
2498 callers can treat them independently as needed. Fix some bugs in
2499 suffix handling, e.g., "100k@" was not diagnosed as an invalid
2500 suffix for a human-readable blocksize. The major caller-visible
2501 change is the addition of a new
2502 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
2503 that both overflow and suffix chars were found.
2505 * human.c (humblock): Don't check separately for invalid suffix
2506 char; that is xstrtoumax's job (now that its bug is fixed).
2507 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
2508 INTMAX_MAX]: New macros.
2509 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
2510 TYPE_MAXIMUM): New macros.
2511 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
2512 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
2513 if overflow occurs, as it's what __strtol does and it's more useful
2515 (__xstrtol): If __strtol reports some error other than ERANGE,
2516 reflect it to the caller as LONGINT_INVALID. If it reports
2517 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
2518 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
2519 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
2521 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
2522 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
2523 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
2524 [defined UINTMAX_MAX]: New macros.
2526 2003-10-14 Bruno Haible <bruno@clisp.org>
2528 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
2529 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
2530 Also use volatile where needed.
2532 2003-10-12 Paul Eggert <eggert@twinsun.com>
2534 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
2535 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
2536 and define in terms of the other primitives.
2537 * xmalloc.c: Include stdbool.h; do not include exit.h.
2538 (SIZE_MAX): Define if not already defined.
2539 (array_size_overflow): New function.
2540 (xalloc_die): Abort instead of exiting if 'error' returns.
2541 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
2542 (xmalloc, xrealloc): Use them.
2543 (xcalloc): Check for address arithmetic overflow.
2544 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
2545 a bit faster than strcpy.
2547 2003-10-08 Paul Eggert <eggert@twinsun.com>
2549 Merge getpass from libc, plus a few fixes.
2551 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
2552 Include <stdbool.h>.
2553 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
2554 __fsetlocking to empty.
2555 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
2556 do include <bits/libc-lock.h>.
2557 Do not include <fcntl.h>; not needed.
2558 [_LIBC]: Include <wchar.h>.
2559 (NOTCANCEL_MODE): New macro.
2560 (flockfile, funlockfile) [_LIBC]: New macros.
2561 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
2562 [!_LIBC]: New macros.
2563 (call_fclose): New function.
2564 (getpass): Use it. Save tty stream separately; this simplifies the
2565 code and makes it more reliable if stdin happens to equal stdout.
2566 Invoke __fsetlocking on tty.
2567 Handle thread cancellation if needed.
2568 Namespace cleanup (use __tcgetattr, __getline).
2569 Use bool for Booleans.
2570 [USE_IN_LIBIO]: Handle wide streams.
2571 [!_LIBC]: Unconditionally do the fseek, since we don't know what
2572 stream might go where.
2574 * unlocked-io.h: Include <stdio.h>, so that the caller
2575 doesn't have to include <stdio.h> before us.
2576 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2577 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2578 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2579 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2580 if not declared, so that we can use getpass.c code from libc without
2582 (flockfile, ftrylockfile, funlockfile): New macros.
2584 2003-10-06 Bruno Haible <bruno@clisp.org>
2586 * version-etc-2.h: Remove file.
2587 * version-etc-2.c: Remove file.
2589 2003-09-25 Jim Meyering <jim@meyering.net>
2590 Bruno Haible <bruno@clisp.org>
2592 This lets translators provide better translations for the
2593 "Written by ..." part of --version output.
2594 * version-etc.h: Include stdarg.h.
2595 (version_etc_copyright): Declare as readonly.
2596 (version_etc): Make this function variadic with a NULL-terminated list
2597 of author name strings.
2598 (version_etc_va): New declaration.
2599 * version-etc.c: Include stdarg.h, stdlib.h.
2600 (version_etc_copyright): Declare as readonly.
2601 (version_etc_va): New function. Provide a different translatable string
2602 for each possible number of authors < 10. Abbreviate when there are 10
2604 (version_etc): Make this function variadic. Call version_etc_va.
2605 Suggestion from Gary V. Vaughan.
2607 * long-options.h (parse_long_options): Change prototype: the authors
2608 string is moved to the end and becomes variadic.
2609 * long-options.c: Include stdarg.h.
2610 (parse_long_options): Make this function variadic, too.
2611 Call version_etc_va, not version_etc.
2613 2003-10-06 Bruno Haible <bruno@clisp.org>
2615 * fatal-signal.h: New file, from GNU gettext.
2616 * fatal-signal.c: New file, from GNU gettext.
2618 2003-10-04 Karl Berry <karl@gnu.org>
2620 * argp*: update from libc.
2622 2003-10-01 Larry Jones <lawrence.jones@eds.com>
2624 * getpass.c (getpass): Use a no-op fseek when switching from input to
2625 output mode on the same stream.
2627 2003-09-29 Paul Eggert <eggert@twinsun.com>
2629 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
2630 Fix arg typo in previous patch.
2632 2003-09-28 Jim Meyering <jim@meyering.net>
2634 * error.c: Correct cpp indentation.
2636 2003-09-27 Paul Eggert <eggert@twinsun.com>
2638 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
2639 Omit the special code that used __typeof__, since we worry that
2640 it could be more trouble than it's worth. See:
2641 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
2642 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
2646 2003-09-26 Jim Meyering <jim@meyering.net>
2648 * error.c (error_tail): Move some declarations
2649 into inner scope where the local variables are used.
2651 2003-09-26 Bruno Haible <bruno@clisp.org>
2653 * stpncpy.h (gnu_stpncpy): New declaration.
2654 (stpncpy): Define as alias for gnu_stpncpy.
2655 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
2657 2003-09-26 Paul Eggert <eggert@twinsun.com>
2659 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
2660 (error_tail): Do not loop, reallocating temporary buffer, since
2661 the output cannot contain more wide characters than the input
2662 contains bytes, the size must be big enough already. This avoids
2663 one potential size overflow calculation. Check for size overflow
2664 when calculating temporary buffer size. Free temporary buffer
2665 when done, if it was allocated with malloc; this plugs a memory
2666 leak. Remove casts from void * to pointers, that are no longer
2667 needed now that we're assuming C89 or better.
2669 Merge error changes from glibc.
2671 * error.c, error.h: Update copyright notice header to match glibc.
2672 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
2673 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
2674 Disable cancellation while printing error.
2675 * error.h: Prepend __ to parameter names.
2677 2003-09-25 Karl Berry <karl@gnu.org>
2679 * argp-fmtstream.c, argp-help.c: update from libc.
2681 2003-09-25 Bruno Haible <bruno@clisp.org>
2683 * version-etc-2.h: New file, from version-etc.h with modifications.
2684 * version-etc-2.c: New file, from version-etc.c with modifications.
2686 2003-09-25 Simon Josefsson <jas@extundo.com>
2688 * xgetdomainname.h: New file.
2689 * xgetdomainname.c: New file.
2691 2003-09-25 Simon Josefsson <jas@extundo.com>
2692 Bruno Haible <bruno@clisp.org>
2694 * getdomainname.h: New file.
2695 * getdomainname.c: New file.
2697 2003-09-24 Paul Eggert <eggert@twinsun.com>
2699 * linebuffer.c (freebuffer): Don't free the argument, just
2700 the buffer associated with the argument. Bug reported by
2703 2003-09-19 Karl Berry <karl@gnu.org>
2705 * argp.h: update from libc.
2707 2003-09-16 Paul Eggert <eggert@twinsun.com>
2709 * linebuffer.c (readlinebuffer): Return NULL immediately upon
2710 input error, instead of returning NULL the next time we are called
2711 (and therefore losing track of errno).
2713 2003-09-15 Paul Eggert <eggert@twinsun.com>
2715 * getndelim2.c (getndelim2): Don't trash errno when a read
2716 fails, so that the caller gets the proper errno.
2718 * readutmp.c (read_utmp): Likewise.
2719 Check for fstat error. Close stream and free storage
2722 2003-09-14 Bruno Haible <bruno@clisp.org>
2724 * fwriteerror.h: New file.
2725 * fwriteerror.c: New file.
2727 2003-09-14 Jim Meyering <jim@meyering.net>
2729 * getloadavg.c: Correct cpp indentation.
2730 * strdup.c: Likewise.
2731 * vasnprintf.c: Likewise.
2733 2003-09-12 Paul Eggert <eggert@twinsun.com>
2735 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
2736 * obstack.c [!defined _LIBC]: Likewise.
2737 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
2738 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
2739 * exitfail.c: Don't include stdlib.h; no longer needed.
2741 More changes to assume C89 or better.
2743 * error.c (error_tail): Assume vprintf.
2745 * argmatch.c (getenv): Remove decl.
2746 * progreloc.c (get_full_program_name): Define via prototype.
2747 * setenv.c (clearenv): Likewise.
2748 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
2750 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
2751 (malloc, memcpy): Remove decls.
2752 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
2753 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
2754 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2755 (memcpy): Remove macro.
2756 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
2757 (__P): Remove. All uses removed.
2758 (PTR): Remove. All uses changed to void *.
2759 (CHAR_BIT, NULL): Remove.
2760 (spaces, zeros, memset_space, memset_zero)
2761 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
2763 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
2764 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
2765 Define with prototype.
2766 Remove now-unnecessary prototype decl.
2767 (extra_args_spec): Assume ANSI C. All uses changed.
2768 (extra_args_spec_iso): Remove.
2769 (my_strftime, emacs_strftimeu): Define via prototype.
2770 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
2772 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
2773 * strtoimax.c: Include <stdlib.h> unconditionally.
2774 (strtoul, strtol): Remove decls.
2775 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
2777 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
2778 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
2779 (LOCALE_PARAM_PROTO): New macro.
2780 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
2781 (INTERNAL (strtol), strtol): Define with a prototype.
2782 (PARAMS): Remove. All uses removed.
2783 * tempname.c: Include <string.h> unconditionally.
2784 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
2785 * xgethostname.c (main): Define with a prototype.
2786 * xmalloc.c: Include "xalloc.h" first, to check interface.
2787 Include <stdlib.h> unconditionally.
2788 (calloc, malloc, realloc, free): Remove decls.
2789 * xstrtod.c: Include "xstrtod.h" first, to check interface.
2790 Include <stdlib.h> unconditionally. Sort include file names.
2792 (xstrtod): Define with a prototype.
2793 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
2794 (strtol, strtoul): Remove decls.
2796 2003-09-11 Paul Eggert <eggert@twinsun.com>
2798 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
2799 Include <stdlib.h>, <string.h> unconditionally.
2800 Remove now-unnecessary cast to char *.
2801 * strnlen.c: Include <string.h> unconditionally.
2802 * yesno.c (yesno): Define with a prototype.
2804 2003-09-10 Bruno Haible <bruno@clisp.org>
2806 * strcspn.c: Include <string.h> unconditionally.
2807 * strpbrk.c: Include <string.h> unconditionally.
2808 * strstr.c: Include <string.h> unconditionally.
2809 * unicodeio.c: Include <string.h> unconditionally.
2810 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
2811 * unsetenv.c: Likewise.
2812 * xreadlink.c: Include <stdlib.h> unconditionally.
2813 * yesno.c: Include <stdlib.h> unconditionally.
2814 (rpmatch): Add prototype.
2816 2003-09-10 Jim Meyering <jim@meyering.net>
2818 * error.c: Correct indentation of cpp directives.
2820 2003-09-09 Paul Eggert <eggert@twinsun.com>
2824 * acosl.c (main): Use a prototype.
2825 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
2828 * getloadavg.c (getloadavg, main): Define via prototypes.
2830 * getopt.h (struct option.name): Assume C89, and use 'const'.
2831 (getopt, etopt_long, getopt_long_only, _getopt_internal)
2832 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
2834 * getopt.c (const): Remove macro.
2835 Include <string.h> unconditionally.
2836 (my_index): Remove; all uses changed to strchr.
2837 (strlen): Remove decl.
2838 (exchange): Remove forward decl; no longer needed.
2839 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
2840 Define with prototype.
2841 * getopt1.c (const): Remove macro.
2842 (getopt_long, getopt_long_only, main): Define with prototype.
2844 * getugroups.c: Include <string.h> unconditionally.
2846 * getusershell.c: Include <stdlib.h> unconditionally.
2847 (getusershell, setusershell, endusershell, readname, main):
2848 Define with prototypes.
2850 * group-member.c: Include group-member.h first.
2851 Include <stdlib.h> unconditionally.
2853 * hard-locale.c: Include hard-locale.h first.
2854 Include <stdlib.h>, <string.h> unconditionally.
2856 * hash.c (free, malloc): Remove decls.
2857 Include <stdlib.h> unconditionally.
2859 * human.c: Include <stdlib.h>, <string.h> unconditionally.
2860 (getenv): Do not declare.
2862 * idcache.c: Include <string.h> unconditionally.
2864 * long-options.c: Include long-options.h first, to test interface.
2865 Include <stdlib.h> unconditionally.
2867 * makepath.c: Include makepath.h first, to test interface.
2868 Include <stdlib.h> and <string.h> unconditionally.
2870 * linebuffer.c: Include <stdlib.h>.
2871 (free): Remove decl.
2873 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
2874 rpl_malloc returns void *, not char *.
2875 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
2877 * md5.h: Include <limits.h> unconditionally.
2878 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
2879 (__P): Remove; all uses removed.
2880 * md5.c: Include "md5.h" first.
2881 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
2882 md5_buffer, md5_process_bytes, md5_process_block):
2883 Define with prototypes.
2884 * sha.h (__P): Remove all uses. (It wasn't defined??)
2885 * sha.c: Include "sha.h" first.
2886 Include <stdlib.h>, <string.h> unconditionally.
2888 * memchr.c (__ptr_t): Remove; all uses changed to void *.
2889 * memcmp.c (__ptr_t): Likewise.
2890 * memrchr.c (__ptr_t): Likewise.
2891 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
2892 Include <string.h> unconditionally.
2893 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
2894 * memchr.c: Include <stdlib.h> unconditionally.
2895 * memchr.c (LONG_MAX): Remove.
2896 * memrchr.c (LONG_MAX): Likewise.
2897 * memchr.c (__memchr): Define via a prototype.
2898 * memrchr.c (__memrchr): Likewise.
2899 * memcmp.c (__P): Remove, and remove all uses.
2900 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
2901 Remove forward decls; no longer needed.
2902 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
2903 Use types required by C89 in prototype.
2905 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
2906 * savedir.c: Likewise.
2907 * mkdir.c (free): Remove decl.
2908 * rmdir.c (rmdir): Define with a prototype.
2909 * savedir.c: Include savedir.h first, to test interface.
2911 * mktime.c (STDC_HEADERS): Remove.
2912 Include <stdlib.h>, <string.h> unconditionally.
2914 * modechange.c: Include <stdlib.h> unconditionally.
2915 (malloc): Remove decl.
2917 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
2918 (free): Remove decl.
2920 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
2921 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
2922 (This type really should be intptr_t, but that's a C99ism.)
2923 (_obstack_memcpy): Remove: all uses changed to memcpy.
2924 Include <string.h> unconditionally.
2925 (struct obstack): Assume __STDC__ for types of members
2926 chunkfun, freefun, extra_arg.
2927 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
2928 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
2929 obstack_begin, obstack_specify_allocation,
2930 obstack_specify_allocation_with_arg, obstack_chunkfun,
2931 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
2932 Remove unprototyped decls and the macros that use them.
2933 * obstack.c (POINTER): Remove. All uses changed to void *.
2934 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
2935 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
2936 (defined __STDC__ && __STDC__)]:
2937 Remove nonprototyped code.
2938 Include <stdlib.h> unconditionally.
2939 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
2940 _obstack_allocated_p, _obstack_free, obstack_free,
2941 _obstack_memory_used, print_and_abort):
2942 Define using prototypes.
2943 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
2944 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
2945 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
2946 obstack_next_free, obstack_object_size, obstack_room) [0]:
2947 Remove unused, unprototyped code.
2949 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
2951 * physmem.c (physmem_total, physmem_available, main): Define
2954 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
2955 (main): Define with a prototype.
2957 * posixver.c (getenv): Remove decl.
2959 * putenv.c (malloc): Returns void *, not char *.
2960 Include <string.h> unconditionally.
2961 (strchr, memcpy, NULL): Do not define.
2963 * readtokens.c: Include readtokens.h first, to test interface.
2964 Include <stdlib.h>, <string.h> unconditionally.
2965 (init_tokenbuffer): Define with a prototype.
2967 * regex.c (PARAMS): Remove. All uses removed.
2968 All uses of _RE_ARGS removed, too.
2969 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2971 (bzero): Assume memset exists.
2972 (memcmp, memcpy, NULL): Remove.
2973 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
2974 char, or assignments to local vars of type signed char.
2975 (init_syntax_once, PREFIX(extract_number_and_incr),
2976 PREFIX(print_partial_compiled_pattern),
2977 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
2978 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
2979 PREFIX(regex_grow_registers), PREFIX(regex_compile),
2980 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
2981 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
2982 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
2983 wcs_compile_range, byte_compile_range, truncate_wchar,
2984 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
2985 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
2986 count_mbs_length, wcs_re_match_2_internal,
2987 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
2988 PREFIX(alt_match_null_string_p),
2989 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
2990 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
2991 regfree, PREFIX(extract_number)): Define with prototype. Remove
2992 now-unnecessary declaration, if any.
2993 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
2995 Remove now-unnecessary casts among pointer types.
2996 * regex.h (_RE_ARGS): Remove. All uses removed.
2998 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
2999 (free): Remove decl.
3001 * rpmatch.c: Include <stdlib.h> unconditionally.
3003 * same.c: Include <stdlib.h>, <string.h> unconditionally.
3004 (free): Remove decl.
3006 * save-cwd.c: Include <stdlib.h> unconditionally.
3007 * xgetcwd.c: Likewise.
3009 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
3010 (free): Remove decl.
3012 * strchrnul.c (strchrnul): Define with a prototype.
3013 Fix bug: c_in was not converted to char before searching.
3015 The following changes are not K&R related:
3017 * group-member.h: Include <sys/types.h>, so that this file is
3019 * makepath.h: Likewise.
3021 * getusershell.c (readname, default_index, line_size, readname):
3022 Use size_t, not int, for sizes.
3023 (readname): If the size overflows, report an error instead of
3026 2003-09-09 Derek Robert Price <derek@ximbiot.com>
3028 * getndelim2.c: Assume stdlib.h per the C89 spec.
3030 2003-09-08 Paul Eggert <eggert@twinsun.com>
3032 Assume C89 or better; remove K&R cruft.
3033 A few of these changes were first proposed by Derek Robert Price
3034 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
3036 * addext.c: Include <string.h> unconditionally.
3037 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
3038 Don't declare getenv or malloc.
3040 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
3041 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
3043 (find_stack_direction, alloca): Use prototypes.
3045 * atexit.c (atexit): Define using a prototype.
3047 * basename.c, dirname.c, stripslash.c:
3048 Include <string.h> unconditionally.
3050 * bcopy.c: Include <stddef.h>.
3051 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
3053 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
3055 * error.h (error, error_at_line, error_print_progname)
3056 [! (defined (__STDC__) && __STDC__)]: Remove decls.
3057 * error.c: Include error.h first, to check interface.
3058 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3059 (VA_START): Remove; all uses changeed to va_start.
3060 (exit, strerror): Remove decls.
3061 (error_print_progname): Prototype uncondionally.
3062 Don't include <errno.h>; no longer needed.
3063 (private_strerror): Remove.
3064 (error_tail): Always define.
3065 (error, error_at_line): Assume C89 or better; always use prototypes.
3066 * fatal.c: Include "fatal.h" first, to test interface.
3067 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3068 (VA_START): Remove; all uses changed to va_start.
3069 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
3071 (exit): Remove decl.
3072 (fatal): Prototype unconditionally. Assume va_start works.
3073 Abort at end, to pacify gcc.
3075 * euidaccess.c (main): Define with a prototype.
3077 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
3079 * exitfail.c: Include <stdlib.h> unconditionally.
3081 * fnmatch_.h (__P): Remove. All uses changed to assume
3083 * fnmatch.c: Include fnmatch.h first, to test interface.
3084 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
3085 (getenv): Remove decl.
3086 (fnmatch): Define using a prototype.
3087 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
3088 (FCT): Define using a prototype.
3090 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
3092 * gethostname.c: Include <stddef.h>.
3093 (gethostname): Define with prototype. Length is size_t, not int.
3095 2003-09-08 Paul Eggert <eggert@twinsun.com>
3097 * getversion.c: Remove; was migrated to backupfile.c in 1997.
3098 getversion.c should have been removed then, but was accidentally
3101 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
3102 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
3104 2003-09-07 Paul Eggert <eggert@twinsun.com>
3106 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
3107 copy_tm_result. Bug reported by Simon Josefsson in
3108 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
3110 2003-09-06 Paul Eggert <eggert@twinsun.com>
3112 * time_r.c, time_r.h: New files.
3114 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
3116 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
3117 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
3119 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
3121 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
3122 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
3125 * timegm.c: Switch to glibc implementation, with the following changes:
3126 [defined HAVE_CONFIG_H]: Include <config.h>.
3127 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
3128 (__mktime_internal) [!defined _LIBC]: New decl.
3129 (__gmtime_r) [!defined _LIBC]: New macro and function.
3130 (timegm): Use a prototype, since gnulib assumes C89.
3131 Do not bother declaring tmp to be const, as it's not really usefu.
3132 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
3133 (timegm): Declare only if HAVE_DECL_TIMEGM.
3135 2003-09-03 Paul Eggert <eggert@twinsun.com>
3137 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
3138 Bug reported by Lute Kamstra in
3139 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
3141 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
3142 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
3143 course with correspondingly smaller numbers for tomorrow and
3144 yesterday. From Tadayoshi Funaba. Originally installed into
3145 sh-utils on 1999-08-07, but the patch got lost (I guess during the
3148 2003-08-31 Simon Josefsson <jas@extundo.com>
3150 * timegm.h: New file.
3151 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
3153 2003-08-31 Karl Berry <karl@gnu.org>
3155 * argp.h: update from libc.
3157 2003-08-28 Bruno Haible <bruno@clisp.org>
3159 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
3160 warning on QNX, which defines O_BINARY to 000000.
3162 2003-08-24 Bruno Haible <bruno@clisp.org>
3164 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
3165 MSVC7 <stdio.h> is included later.
3167 2003-08-20 Bruno Haible <bruno@clisp.org>
3169 * progname.h: New file, from GNU gettext.
3170 * progname.c: New file, from GNU gettext.
3171 * progreloc.c: New file, from GNU gettext.
3173 2003-08-19 Bruno Haible <bruno@clisp.org>
3175 * xstrdup.c: Assume <string.h> exists.
3177 2003-08-18 Jim Meyering <jim@meyering.net>
3179 * setenv.h: Indent nested cpp directive.
3180 * vasnprintf.c: Remove trailing blanks.
3182 2003-08-17 Simon Josefsson <jas@extundo.com>
3183 Bruno Haible <bruno@clisp.org>
3185 * xstrndup.h: New file.
3186 * xstrndup.c: New file.
3188 2003-08-17 Bruno Haible <bruno@clisp.org>
3190 * strndup.h: New file.
3192 2003-08-16 Paul Eggert <eggert@twinsun.com>
3194 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
3195 space, undoing this 2003-08-12 change:
3196 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
3198 2003-08-16 Jim Meyering <jim@meyering.net>
3200 Merge from coreutils.
3201 * xstrtoimax.c: #else #if -> #elif.
3202 * xstrtoumax.c: Likewise.
3204 2003-08-15 Paul Eggert <eggert@twinsun.com>
3206 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
3207 rather than tab, after '#' in shell-script copyright notices.
3208 Suggested by Bruno Haible.
3210 2003-08-15 Jim Meyering <jim@meyering.net>
3211 and Paul Eggert <eggert@twinsun.com>
3213 Merge from coreutils.
3214 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
3215 member but strut utmpx does not. Needed for AIX 4.3.3.
3216 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
3218 2003-08-15 Jim Meyering <jim@meyering.net>
3220 Merge from coreutils.
3221 * xgethostname.c: Include <stdlib.h>.
3222 (xghostname): Don't exit for anything other than memory-related
3223 failure; just return NULL.
3224 * userspec.c: Include "posixver.h".
3225 (parse_user_spec): Accept `.' as a separator only
3226 in pre-POSIX-200112 mode.
3227 * strtoimax.c: Use #elif rather than #else #if.
3228 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
3229 Remove function, now that we can rely on a working tzset function.
3230 [!_LIBC]: Ensure that the required autoconf test has been run.
3231 [!defined _NL_CURRENT && HAVE_STRFTIME]:
3232 Use underlying_strftime for %r.
3233 * sha.c: Merge in some clean-up and optimization changes from glibc.
3234 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
3235 Ensure that it is a multiple of 64.
3236 Rearrange loop exit tests so as to avoid performing an
3237 additional fread after encountering an error or EOF.
3238 * realloc.c: Update copyright date.
3240 2003-08-14 Jim Meyering <jim@meyering.net>
3242 Merge from coreutils.
3243 * obstack.h: Whitespace changes.
3244 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
3245 and xcalloc return values.
3246 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
3247 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
3248 hang on OSF/1 5.1 for DIR on both local and remote file systems.
3249 Reported by (and fix confirmed by) Nelson H. F. Beebe.
3250 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3252 Use mntctl's return value to drive the entry-processing loop, since
3253 we can't rely on the value of the vmt_length member in the last
3254 entry. On some systems doing so could result in exhausting
3255 virtual memory. Based in part on a patch from Mike Jetzer.
3257 2003-08-14 Jim Meyering <jim@meyering.net>
3258 and Paul Eggert <eggert@twinsun.com>
3260 Merges from coreutils, plus other fixes.
3261 * physmem.c: Merge in portability changes from gcc/libiberty
3262 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
3263 for credits and details. Thanks to Kaveh Ghazi for helping
3264 to keep these files in sync.
3265 (ARRAY_SIZE): Define it.
3266 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
3267 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
3268 (memcasecmp): Don't assume size_t fits in unsigned int.
3269 Remove casts and duplicate code.
3270 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
3271 (memcpy): Remove definition.
3272 Merge in some clean-up and optimization changes from glibc.
3273 [BLOCKSIZE]: Move definition to top of file.
3274 Ensure that it is a multiple of 64.
3275 Rearrange loop exit tests so as to avoid performing an
3276 additional fread after encountering an error or EOF.
3277 * md5.h (md5_uintptr): Define.
3278 * makepath.c (CLEANUP_CWD): Report an error if we failed to
3279 return to the initial working directory. Preserve errno
3281 * idcache.c: Include "xalloc.h".
3282 (xmalloc, xrealloc): Remove decls.
3283 (getuser): Remove casts no longer required in C89.
3284 * human.c: Include stdio.h, for sprintf.
3285 * group-member.c: Include "xalloc.h".
3286 (xmalloc, xrealloc): Remove decls.
3287 (get_group_info): Remove casts no longer required in C89.
3288 * getusershell.c (readname): Remove casts no longer required in C89.
3289 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
3290 * getline.c: Whitespace fix, from coreutils.
3292 2003-08-13 Paul Eggert <eggert@twinsun.com>
3294 * exclude.c: Include <ctype.h>
3295 (IN_CTYPE_DOMAIN): New macro.
3297 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
3300 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3301 Undo previous (whitespace-only) change.
3303 2003-08-12 Paul Eggert <eggert@twinsun.com>
3305 * argp-help.c, argp-parse.c, config.charset, getopt.h:
3306 Normalize leading white space and remove trailing white space.
3307 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
3308 notice, as per ../config/srclist-update.
3310 Merge from coreutils.
3311 * euidaccess.h: New file.
3312 * euidaccess.c: Include it.
3313 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
3314 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
3315 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
3317 2003-08-11 Bruno Haible <bruno@clisp.org>
3319 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
3320 (vasnprintf): Use it instead of wcslen.
3322 2003-08-11 Bruno Haible <bruno@clisp.org>
3324 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
3325 value to ensure that _Bool promotes to int. Use #define for _Bool when
3326 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
3328 2003-08-10 Karl Berry <karl@gnu.org>
3330 * regex.h: update from libc (whitespace fix).
3332 2003-08-09 Paul Eggert <eggert@twinsun.com>
3334 Merge some files from coreutils. These changes were
3335 originally made by Jim Meyering.
3336 * acl.c: Include <sys/types.h> before <sys/stat.h>;
3337 many older Unixes require this.
3338 * alloca.c (alloca): Remove cast to argument of free;
3339 no longer needed in C89.
3340 * alloca_.h, regex.h: Fix white space to match
3341 what GNU indent does.
3343 2003-08-05 Paul Eggert <eggert@twinsun.com>
3345 * bumpalloc.h: Remove.
3347 2003-08-04 Paul Eggert <eggert@twinsun.com>
3349 * getloadavg.c: Change copyright notice and spacing to conform to
3352 Merge from coreutils.
3353 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
3355 * getdate.y (date): Also accept dates like May-23-2003; suggestion
3356 from Karl Berry, implemented by Jim Meyering.
3357 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
3358 from Dmitry V. Levin.
3359 Remove anachronistic cast of xrealloc.
3360 * fnmatch_.h (__const): Remove. Use 'const'.
3361 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
3362 type. Otherwise, it wouldn't compile with at least /bin/cc on
3363 ymp-cray-unicos9.0.2.X.
3364 Combine two mostly-identical uses of alloca into one.
3365 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
3367 2003-08-04 Dave Love <d.love@dl.ac.uk>
3371 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
3372 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
3373 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
3374 obsolete NLIST_NAME_UNION.
3375 [__GNU__]: Undef BSD and FSCALE.
3376 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
3378 2003-08-03 Paul Eggert <eggert@twinsun.com>
3380 * stdbool_.h (_Bool): Make it signed char, instead of
3381 an enum type, so that it's guaranteed to promote to int. See:
3382 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
3384 2003-07-31 Paul Eggert <eggert@twinsun.com>
3386 * strerror.c: Include config.h, limits.h. Declare sprintf.
3387 (strerror): Don't assume that a printable int fits in 14 bytes.
3389 2003-07-24 Derek Robert Price <derek@ximbiot.com>
3390 Bruno Haible <bruno@clisp.org>
3392 * getline.h (getline, getdelim): Change return type to ssize_t.
3393 * getline.c (getline, getdelim): Likewise.
3394 Remove _GNU_SOURCE define; now it's defined in config.h through
3397 2003-07-22 Paul Eggert <eggert@twinsun.com>
3399 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
3400 over-parenthesization in macros.
3402 Sync with coreutils.
3404 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
3407 Use `exit_failure' for xalloc and xmemcoll instead of their own
3408 private exit-failure variables.
3409 * xalloc.h (xalloc_exit_failure): Remove.
3410 * xmalloc.c: Likewise. Include exitfail.h.
3411 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
3412 * xmemcoll.h (xmemcoll_exit_failure): Remove.
3413 * xmemcoll.c: Likewise. Include exitfail.h.
3414 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
3416 2003-07-18 Paul Eggert <eggert@twinsun.com>
3418 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
3419 * closeout.c: Likewise. Include "closeout.h" right after config.h,
3420 to test that it can stand by itself. Include "exitfail.h".
3421 Clients should set exit_failure instead.
3422 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
3424 2003-07-18 Andreas Schwab <schwab@suse.de>
3426 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
3428 2003-07-18 Bruno Haible <bruno@clisp.org>
3430 * getndelim2.h: New file.
3431 * getndelim2.c: Make into a module of its own. Include config.h,
3433 (getndelim2): Make non-static. Change return type to ssize_t.
3434 * getline.h: Change argument names.
3435 * getline.c: Include getndelim2.h instead of getndelim2.c.
3436 * getnline.c: Include getndelim2.h.
3438 2003-07-17 Bruno Haible <bruno@clisp.org>
3440 * Makefile.am: Remove file.
3441 * Makefile.in: Remove file.
3443 2003-07-17 Bruno Haible <bruno@clisp.org>
3445 * getnline.h: New file.
3446 * getnline.c: New file.
3447 * getndelim2.c: New file, extracted from getline.c.
3448 (getndelim2): Renamed from getdelim2, with added nmax argument.
3449 * getline.c: Include getndelim2.c.
3450 (getdelim2): Moved out to getndelim2.c.
3451 (getline, getdelim): Update.
3453 2003-07-15 <karl@gnu.org>
3455 * vasnprintf.c: update from gettext.
3457 2003-07-15 Jim Meyering <jim@meyering.net>
3459 * makepath.c (make_path): Enclose diagnostic in _(...).
3461 2003-07-14 Paul Eggert <eggert@twinsun.com>
3463 * asnprintf.c, asprintf.c, config.charset, gettext.h,
3464 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
3465 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
3466 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
3467 vasprintf.c, vasprintf.h: Regenerate. These files are now being
3468 updated automatically by ../config/srclist-update. This changes
3469 their license from LPGL to GPL.
3471 2003-07-14 Jim Meyering <jim@meyering.net>
3473 Don't emit diagnostics. Let callers do that.
3474 * save-cwd.c: Don't include "error.h".
3475 (save_cwd): Don't call error. Ensure that errno is valid
3476 when returning nonzero.
3478 * save-cwd.h (restore_cwd): Update prototype.
3479 * save-cwd.c (restore_cwd): Remove two parameters.
3480 Simplify. Don't call error upon failure. Let callers do that.
3481 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
3482 when auditing is enabled. But don't bother updating the #if.
3484 2003-07-14 Simon Josefsson <jas@extundo.com>
3486 * mempcpy.h: New file.
3487 * mempcpy.c: New file.
3489 2003-07-14 Paul Eggert <eggert@twinsun.com>
3491 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
3492 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
3493 unicodeio.c, unicodeio.h, unlocked-io.h:
3494 Switch from LGPL to GPL.
3496 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
3498 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
3499 it breaks C++ compilation.
3500 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
3502 2003-07-10 Jim Meyering <jim@meyering.net>
3504 * vasnprintf.c: Remove trailing blanks.
3505 Make cpp indentation consistent.
3507 2003-07-09 Paul Eggert <eggert@twinsun.com>
3509 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
3510 posixver.c, strftime.c, strnlen.c, strverscmp.c:
3511 Switch from LGPL to GPL.
3513 2003-07-07 Paul Eggert <eggert@twinsun.com>
3515 * mktime.c: Fix some boundary cases and remove need for floating point.
3517 Issue a compile-time diagnostic if time_t is floating point, or if
3518 two's complement arithmetic is not in effect, or if arithmetic
3519 right shift does not propagate the sign. These assumptions were
3520 all in the original code but they weren't checked.
3522 (TIME_T_MIDPOINT, verify): New macros.
3523 (__isleap): Remove; it has integer overflow problems.
3524 (leapyear): New function, without those problems.
3525 (ydhms_tm_diff): Remove; splitting into two parts.
3526 (ydhms_diff): New function, containing the arithmetic part of
3527 the old ydhms_tm_diff function. Issue a compile-time
3528 diagnostic if we are not using C99 integer division.
3529 Avoid casts when possible.
3530 (guess_time_tm): New function, containing the checking part of
3531 the old ydhms_tm_diff function. Return the new value, rather than
3532 the difference between it and the old. Accept a new argument T
3533 so that *T specifies the old value. Check for overflow in the result.
3535 (__mktime_internal): Use a time_t offset, not a long int offset.
3536 This undoes the 2003-06-04 change, which is no longer needed now
3537 that we have better overflow checking.
3538 (localtime_offset): Likewise.
3540 (__mktime_internal): Avoid harmful overflow on hosts where time_t
3541 and long are 64-bit but int is only 32-bit.
3542 (ydhms_diff): Use long int to store year1 and yday1.
3543 Issue a compile-time diagnostic if long int is not wide enough.
3545 (__mktime_internal): Use long int to store adjusted year and yday.
3546 Use plain C rather than preprocessor commands, if that doesn't
3548 Check for overflow (and try to repair) after each probe
3549 rather than checking only at the very end. This avoids some bugs
3550 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
3551 does not equal GMT offset at maximum time).
3552 Use integer to check for overflow rather than floating point; this
3553 is more portable to non-IEEE hosts, and is a tad faster.
3554 When we detect that we are oscillating between two values,
3555 don't check whether tm_isdst has the requested value, since
3556 we already know the answer. When tm_isdst has the wrong value,
3557 use a different heuristic to find the right one, based on the
3558 extreme values actually observed in practice in tz2003a,
3559 rather than the (overly optimistic) "previous 3 calendar quarters".
3561 (not_equal_tm, print_tm, check_result): Use "const T" rather than
3562 "T const" to accommodate glibc style.
3563 (check_result): Use less-confusing report format. "long" -> "long int.
3565 Don't loop if the iteration overflows time_t.
3566 Allow a negative step in the iteration.
3568 2003-07-01 Paul Eggert <eggert@twinsun.com>
3570 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3571 having it depend on HAVE_SYS_TYPES_H.
3573 2003-06-25 Bruno Haible <bruno@clisp.org>
3575 * readlink.c: New file.
3577 2003-06-20 Bruno Haible <bruno@clisp.org>
3579 Assume C89, so PARAMS isn't needed.
3580 * unicodeio.h (PARAMS): Remove.
3581 * unicodeio.c: Don't use PARAMS.
3583 2003-06-18 Jim Meyering <jim@meyering.net>
3585 Merge changes from coreutils.
3586 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
3587 Remove explicit declarations of xmalloc and realloc.
3589 (read_utmp): Remove anachronistic cast of xmalloc.
3591 2003-06-17 Paul Eggert <eggert@twinsun.com>
3593 Assume C89, so PARAMS isn't needed.
3594 * backupfile.h (PARAMS): Remove. All uses removed.
3595 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
3596 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
3597 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
3598 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
3599 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
3600 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
3601 xstrtol.h: Likewise.
3602 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
3603 same.h, strverscmp.h: Do not include config.h; no longer needed.
3604 Anyway, config.h should always be included before any other file.
3606 2003-06-11 Simon Josefsson <jas@extundo.com>
3608 * sysexit_.h: New file.
3610 2003-05-20 Derek Price <derek@ximbiot.com>
3612 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
3614 2003-06-10 Simon Josefsson <jas@extundo.com>
3616 * strchrnul.h: New file.
3617 * strchrnul.c: New file.
3619 2003-06-10 Simon Josefsson <jas@extundo.com>
3621 * argp.h: New file, from glibc.
3622 * argp-ba.c: New file, from glibc.
3623 * argp-eexst.c: New file, from glibc.
3624 * argp-fmtstream.c: New file, from glibc.
3625 * argp-fmtstream.h: New file, from glibc.
3626 * argp-fs-xinl.c: New file, from glibc.
3627 * argp-help.c: New file, from glibc.
3628 * argp-namefrob.h: New file, from glibc.
3629 * argp-parse.c: New file, from glibc.
3630 * argp-pv.c: New file, from glibc.
3631 * argp-pvh.c: New file, from glibc.
3632 * argp-xinl.c: New file, from glibc.
3634 2003-06-07 Jim Meyering <jim@meyering.net>
3636 * readtokens.h: Put `Free Software Foundation, Inc.'
3637 in place of my name in the copyright comment.
3638 Remove definition and uses of __P.
3641 * stat.c: Don't declare xmalloc explicitly.
3642 Instead, include "xalloc.h".
3643 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
3644 xrealloc, and xcalloc return values.
3645 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
3647 * xgetcwd.h: Remove definition/uses of PARAMS.
3649 2003-06-06 Jim Meyering <jim@meyering.net>
3651 * stdbool_.h: Renamed from stdbool.h.in.
3653 2003-06-06 Jim Meyering <jim@meyering.net>
3655 Merge from coreutils.
3656 * same.c: (same_name): Declare *_basename locals to be `const'.
3657 Consolidate declarations and initializations of *_base* locals.
3659 Merge from coreutils.
3660 This avoids a core dump on systems without GNU putenv,
3661 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
3662 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
3663 (unsetenv): New static function, from GNU libc.
3664 (rpl_putenv): Use it.
3666 * modechange.c: Remove trailing blanks.
3668 Merge from coreutils.
3669 * fsusage.c: Remove declaration of statfs.
3670 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
3672 * posixtm.c: Include <stdbool.h> unconditionally.
3674 2003-06-05 Paul Eggert <eggert@twinsun.com>
3676 * mktime.c (__mktime_internal): When resolving a tm_isdst
3677 mismatch, look in future quarters as well as past. This fixes a
3678 bug when processing fall-backwards gaps immediately after a long
3679 period of daylight-saving time.
3681 * mktime.c: Assume freestanding C89 or better.
3682 (HAVE_LIMITS_H): Remove. Assume it's 1.
3683 (__P): Remove; not used.
3684 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
3685 (mktime, not_equal_tm, print_tm, check_result,
3686 main): Use prototypes. Use const * where appropriate.
3687 (main): Fix typo in testing code that uncovered by above changes.
3688 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
3690 2003-06-04 Paul Eggert <eggert@twinsun.com>
3692 * mktime.c: Fix Debian bug 177940
3693 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
3694 (localtime_offset): Now long int, not time_t, because we want it
3695 to be guaranteed to be signed. All uses changed.
3696 (__mktime_internal): If overflow would occur when adding offset,
3699 Merge 'human' changes from coreutils. Rewrite to support
3700 locale-specific notations like thousands separators.
3701 * human.c: Simplify authorship notice.
3702 Include human.h immediately after config.h.
3703 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
3704 <limits.h>: Do not include, since human.h does.
3705 (SIZE_MAX, UINTMAX_MAX): New macros.
3706 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
3707 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
3708 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
3709 (power_letter): Renamed from suffixes.
3710 (generate_suffix_backwards): Remove.
3711 (adjust_value): Now takes int style (because of human.h changes)
3712 and long double value (for greater precision on some platforms).
3713 (group_number): New function.
3714 (human_readable): Use it. Use integer options, not enum.
3715 Put the options before the sizes in the arg list.
3716 Support all the new options.
3717 The old human_readable function has been removed;
3718 use inttostr.h instead.
3719 (human_readable, default_block_size, humblock):
3720 Use uintmax_t, not int, for block sizes.
3721 (human_readable_inexact, block_size_types): Remove.
3722 (block_size_opts): New constant.
3723 (human_options): Renamed from human_block_size, with new signature
3724 that allows block sizes up to UINTMAX_MAX. All callers changed.
3725 * human.h: Add copyright and authorship notice.
3726 Include <limits.h> and <stdbool.h> unconditionally.
3727 (PARAMS): Remove. All uses removed.
3728 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
3729 (enum human_inexact_style): Remove tag; now a nameless enum.
3730 (human_floor, human_ceiling, human_round_to_even): Now have
3731 values 2, 0, 1 rather than -1, 1, 0.
3732 (human_group_digits, human_suppress_point_zero, human_autoscale,
3733 human_base_1024, human_SI, human_B): New constants.
3734 (human_readable_inexact, human_block_size): Remove.
3735 (human_readable): Size args are now uintmax_t, not int.
3736 (human_options): New decl.
3738 * exclude.c: (new_exclude, add_exclude): Remove casts that are
3739 unnecessary now that we assume C89 or better. This change
3740 imported from coreutils.
3742 * mktime.c (__mktime_internal): Do not reject negative timestamps
3743 arbitrarily. This is the same patch as 2003-05-28, but it got lost
3744 in the 2003-05-30 sync from glibc.
3746 .h files should stand alone, but we shouldn't include <sys/types.h>
3747 if we can get away with just <stddef.h>.
3749 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
3750 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
3751 rather than <sys/types.h>, as we merely need size_t.
3752 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
3754 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
3755 Include <stdio.h>, to get FILE.
3756 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
3757 memcasecmp.h has included <stddef.h> and all we need is size_t.
3758 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
3759 our interface, instead of including <sys/types.h>
3761 2003-06-02 Paul Eggert <eggert@twinsun.com>
3764 Fix some minor time-related bugs with POSIX time arguments.
3765 Some valid time stamps were being rejected (notably -1, and
3766 time stamps before 1900 on 64-bit hosts). And some invalid
3767 time stamps were being accepted, e.g. September 31.
3769 * posixtm.h (posixtime): Return bool instead of time_t, so
3770 that we can return (time_t) -1 successfully.
3771 * posixtm.c: Likewise.
3772 [HAVE_STDBOOL_H]: Include <stdbool.h>.
3773 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
3774 (t): Remove static var.
3775 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
3776 of static var. All uses changed.
3777 (year): Do not reject years before 1900; they can occur with
3779 (posix_time_parse): Do not check for out-of-range components;
3780 that is now the caller's responsibility, since our checks were
3781 only approximations.
3782 (posixtime): Use mktime to check for out-of-range components,
3783 since it knows them exactly.
3784 If mktime returns (time_t) -1, check whether an error actually occurred
3785 by invoking localtime on -1.
3786 (main) [TEST_POSIXTIME]: Check for input data errors, and report
3787 posixtime failures better.
3788 Improve the test data (in comments only).
3790 2003-05-30 <karl@gnu.org>
3792 * mktime.c: update from libc.
3794 2003-05-30 Bruno Haible <bruno@clisp.org>
3796 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
3797 * localcharset.h: Likewise.
3798 * localcharset.c: Likewise.
3800 2003-05-28 Paul Eggert <eggert@twinsun.com>
3802 Assume the headers required for C89 freestanding compilers.
3803 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
3804 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
3805 without checking for HAVE_LIMITS_H.
3806 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
3807 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
3809 * fatal.c: Include <stdarg.h> without checking for __STDC__.
3810 * exclude.c: Include <stdbool.h> unconditionally.
3811 * tempname.c: Include <stddef.h> unconditionally.
3812 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
3813 * modechange.c, rpmatch.c (NULL): Don't define, since
3814 <stddef.h> does that.
3815 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
3816 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
3817 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
3818 * xstrtol.c: Likewise.
3819 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
3820 * savedir.c: Include <stddef.h> instead of defining NULL.
3822 * addext.c (addext): Use assignment rather than cast, to avoid
3823 warnings on some platforms.
3825 * mktime.c (__mktime_internal): Do not reject negative timestamps
3828 2003-05-10 Bruno Haible <bruno@clisp.org>
3830 * linebreak.c (iconv_string_length): Don't return -1 just because the
3831 string is longer than 4 KB.
3833 2003-05-12 Jim Meyering <jim@meyering.net>
3835 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
3836 the space-padded-by-default conversion specifiers, %e, %k, %l.
3838 2003-05-03 Bruno Haible <bruno@clisp.org>
3840 Upgrade to Unicode-4.0.
3841 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
3842 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
3843 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
3844 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
3845 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
3846 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
3847 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
3848 Change width of U+E0100..U+E01EF from 1 to 0.
3850 2003-04-25 Bruno Haible <bruno@clisp.org>
3852 * copy-file.c: Include <stddef.h>, for size_t.
3854 2003-04-25 Jim Meyering <jim@meyering.net>
3856 * copy-file.c (copy_file_preserving): Declare buf_size to be
3857 of type size_t, not int.
3859 2003-04-11 Jim Meyering <jim@meyering.net>
3861 Merge changes from Coreutils.
3863 2003-03-22 Jim Meyering <jim@meyering.net>
3865 * strftime.c (widen): Cast alloca return value to proper type.
3867 2003-01-19 Ulrich Drepper <drepper@redhat.com>
3870 * strftime.c (my_strftime): Handle very large width
3871 specifications for numeric values correctly. Improve checks for
3874 2003-01-19 Jim Meyering <jim@meyering.net>
3876 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
3877 (nl_get_alt_digit) [! defined my_strftime]: Define.
3878 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
3879 _nl_get_alt_digit and _nl_get_walt_digit.
3881 * strftime.c (my_strftime): Merge in locale-related changes from libc.
3882 These changes have no effect outside of _LIBC.
3884 2003-04-10 Bruno Haible <bruno@clisp.org>
3886 * findprog.h: New file, from GNU gettext.
3887 * findprog.c: New file, from GNU gettext.
3889 2003-04-05 Jim Meyering <jim@meyering.net>
3891 Merge changes from Coreutils.
3893 * exclude.h (PARAMS): Remove definition and uses.
3894 * exclude.c: Remove uses of `PARAMS'.
3896 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
3897 Add test-cases for DOS filenames. Declare program_name.
3898 (main): Set up program_name. Patch by Rich Dawe.
3900 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3902 Use mntctl's return value to drive the entry-processing loop, since
3903 we can't rely on the value of the vmt_length member in the last
3904 entry. On some systems doing so could result in exhausting
3905 virtual memory. Based in part on a patch from Mike Jetzer.
3907 2003-04-04 Bruno Haible <bruno@clisp.org>
3909 * linebreak.h: New file, from GNU gettext.
3910 * linebreak.c: New file, from GNU gettext with slight modifications.
3911 * lbrkprop.h: New file, from GNU gettext.
3913 2003-04-03 Bruno Haible <bruno@clisp.org>
3915 * utf8-ucs4.h: New file, from GNU gettext.
3916 * utf16-ucs4.h: New file, from GNU gettext.
3917 * ucs4-utf8.h: New file, from GNU gettext.
3918 * ucs4-utf16.h: New file, from GNU gettext.
3920 2003-04-02 Bruno Haible <bruno@clisp.org>
3922 * binary-io.h: New file, from GNU gettext.
3924 2003-04-01 Bruno Haible <bruno@clisp.org>
3926 * pathname.h: New file, from GNU gettext.
3927 * concatpath.c: New file, from GNU gettext.
3929 2003-03-30 Bruno Haible <bruno@clisp.org>
3931 * copy-file.c (copy_file_preserving): Don't set owner if the function
3932 chown() doesn't exist.
3934 2003-03-28 Bruno Haible <bruno@clisp.org>
3936 * copy-file.h: New file, from GNU gettext.
3937 * copy-file.c: New file, from GNU gettext.
3939 2003-03-18 Jim Meyering <jim@meyering.net>
3941 * quote.c (quote_n): Fix typo in comment.
3943 2003-03-14 Jim Meyering <jim@meyering.net>
3945 Merge changes from Coreutils.
3946 * obstack.h (obstack_object_size): Declare temporary, __o,
3947 to be const, in order to avoid warnings.
3948 (obstack_room): Likewise.
3949 (obstack_empty_p): Likewise.
3951 2003-03-13 Paul Eggert <eggert@twinsun.com>
3953 Merge changes from Bison.
3954 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
3955 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
3956 when compiling Bison 1.875's `bitset bset = obstack_alloc
3957 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
3958 * hash.c: Include <stdbool.h> unconditionally.
3960 2003-03-09 Paul Eggert <eggert@twinsun.com>
3962 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
3963 Reported by Bruce Becker; see:
3964 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
3966 2003-03-03 Paul Eggert <eggert@twinsun.com>
3967 Bruno Haible <bruno@clisp.org>
3969 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
3970 Reported by John Hughes, see
3971 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
3973 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
3975 * poll_.h: New file.
3978 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
3980 * mathl.h: New file.
3981 * acosl.c: New file.
3982 * asinl.c: New file.
3983 * atanl.c: New file.
3984 * ceill.c: New file.
3987 * floorl.c: New file.
3988 * frexpl.c: New file.
3989 * ldexpl.c: New file.
3991 * sincosl.c: New file.
3993 * sqrtl.c: New file.
3995 * trigl.c: New file.
3996 * trigl.h: New file.
3998 2003-02-17 Bruno Haible <bruno@clisp.org>
4000 * mkdtemp.h: New file, from GNU gettext.
4001 * mkdtemp.c: New file, from GNU gettext.
4003 2003-01-31 Bruno Haible <bruno@clisp.org>
4005 * rename.c: #undef rename before defining rpl_rename.
4006 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
4008 2003-01-30 Bruno Haible <bruno@clisp.org>
4010 * printf-args.h: New file, from GNU gettext.
4011 * printf-args.c: New file, from GNU gettext.
4012 * printf-parse.h: New file, from GNU gettext.
4013 * printf-parse.c: New file, from GNU gettext.
4014 * vasnprintf.h: New file, from GNU gettext.
4015 * vasnprintf.c: New file, from GNU gettext.
4016 * asnprintf.c: New file, from GNU gettext.
4017 * vasprintf.h: New file, from GNU gettext with modifications.
4018 * vasprintf.c: New file, from GNU gettext.
4019 * asprintf.c: New file, from GNU gettext.
4021 2003-01-29 Bruno Haible <bruno@clisp.org>
4023 * stpncpy.h: New file, from GNU gettext with modifications.
4024 * stpncpy.c: New file, from GNU gettext with modifications.
4026 2003-01-28 Bruno Haible <bruno@clisp.org>
4028 * c-ctype.h: New file, from GNU gettext, with changes suggested by
4030 * c-ctype.c: New file, from GNU gettext, with changes suggested by
4033 2003-01-27 Bruno Haible <bruno@clisp.org>
4035 * xsetenv.h: New file, from GNU gettext.
4036 * xsetenv.c: New file, from GNU gettext.
4038 2003-01-23 Bruno Haible <bruno@clisp.org>
4040 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
4042 2003-01-22 Bruno Haible <bruno@clisp.org>
4044 * exit.h: New file, from GNU gettext.
4046 2003-01-11 Bruno Haible <bruno@clisp.org>
4048 * stpcpy.h (stpcpy): Use ANSI C function declarations.
4049 * strcase.h (strcasecmp, strncasecmp): Likewise.
4051 2003-01-14 Jim Meyering <jim@meyering.net>
4053 * same.c (same_name): Tweak a comment.
4055 2003-01-11 Bruno Haible <bruno@clisp.org>
4057 * same.c (same_name): Reorder tests so as to avoid calling stat()
4058 when a string comparison is sufficient.
4060 2003-01-11 Bruno Haible <bruno@clisp.org>
4062 * readtokens.c (readtoken): Cast character to 'unsigned char', not
4065 2003-01-11 Bruno Haible <bruno@clisp.org>
4067 * hash-pjw.c: Add comment about low quality of this function.
4069 2003-01-12 Paul Eggert <eggert@twinsun.com>
4071 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
4072 to avoid collisions with libcurses and libreadline.
4074 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
4075 * getstr.h, getstr.c: Remove.
4076 * getline.c: Include "getline.h", to check interface.
4077 Move body of old getstr.c here: this defines MIN_CHUNK and
4078 declares getdelim2, which is renamed from getstr.
4079 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
4081 * linebuffer.c (readlinebuffer): Renamed from readline.
4083 * linebuffer.h: Likewise.
4084 (readline): Remove backward-compatibility macro.
4086 2003-01-12 Jim Meyering <jim@meyering.net>
4088 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
4090 2003-01-10 Bruno Haible <bruno@clisp.org>
4092 * alloca_.h: New file.
4093 * getdate.y: Unconditionally include alloca.h.
4094 * makepath.c: Likewise.
4095 * setenv.c: Likewise.
4096 * userspec.c: Likewise.
4098 2003-01-09 Bruno Haible <bruno@clisp.org>
4100 * stdbool.h.in: New file.
4102 2003-01-08 Bruno Haible <bruno@clisp.org>
4104 * safe-read.c: Include specification header first, to ensure its
4106 * full-write.c: Likewise.
4108 2003-01-08 Jim Meyering <jim@meyering.net>
4110 * full-write.c: Undefine and define-away `const' after inclusion
4111 of errno.h, not before. Suggestion from Bruno Haible.
4113 2003-01-07 Jim Meyering <jim@meyering.net>
4115 * full-write.c: Rework so that it may serve to define full_read, too.
4116 * full-read.c: Simply #define FULL_READ and include full-write.c.
4118 2003-01-06 Jim Meyering <jim@meyering.net>
4120 * version-etc.c: Update year in translatable copyright string.
4122 2002-12-25 Bruno Haible <bruno@clisp.org>
4124 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
4125 * xstrtol.h: Likewise.
4126 * xstrtoimax.c: Likewise.
4127 * xstrtoumax.c: Likewise.
4128 * human.h: Likewise.
4130 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
4131 on systems that have <inttypes.h> but not <stdint.h>.
4133 2002-12-31 Paul Eggert <eggert@twinsun.com>
4135 * memcoll.c (memcoll): Fall back on a simple algorithm using
4136 memcmp if strcoll doesn't work.
4138 2002-12-23 Bruno Haible <bruno@clisp.org>
4140 * localcharset.h: New file.
4141 * localcharset.c: Include it.
4142 * unicodeio.c: Likewise.
4144 2002-12-22 Bruno Haible <bruno@clisp.org>
4146 * utime.c (utime_null): No need to call ftruncate if the file was
4149 2002-12-23 Bruno Haible <bruno@clisp.org>
4151 * memcoll.c (STRCOLL): New macro.
4154 2002-12-22 Bruno Haible <bruno@clisp.org>
4156 * getstr.h (getstr): Define, to avoid clash with libcurses.
4157 * linebuffer.h (readline): Define, to avoid clash with libreadline.
4159 2002-12-22 Bruno Haible <bruno@clisp.org>
4161 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
4163 2002-12-23 Bruno Haible <bruno@clisp.org>
4165 * getline.h: Include <stddef.h>, for size_t.
4167 * unicodeio.h: Include <stddef.h>, for size_t.
4168 * unicodeio.c: Don't include <stddef.h>.
4170 2002-12-17 Bruno Haible <bruno@clisp.org>
4172 * canon-host.c (strdup): Remove unused declaration.
4174 * fsusage.c: Include full_read.h.
4175 (get_fs_usage): Use full_read instead of safe_read.
4177 * utime.c (utime_null): Use SAFE_READ_ERROR.
4179 2002-12-11 Bruno Haible <bruno@clisp.org>
4181 * setenv.h: Rewritten to cope with systems that have setenv() but not
4183 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
4186 2002-12-11 Bruno Haible <bruno@clisp.org>
4188 * setenv.c (alloca): Fall back to malloc.
4190 (setenv): Use freea() to free memory allocated with alloca().
4192 2002-11-13 Bruno Haible <bruno@clisp.org>
4194 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
4195 function declarations.
4196 * unsetenv.c (unsetenv): Likewise.
4198 2002-03-04 Bruno Haible <bruno@clisp.org>
4200 Portability to AIX 4.3.3.
4201 * unsetenv.c: New file, extracted from setenv.c.
4202 * setenv.c: Move the unsetenv() function to unsetenv.c.
4204 2001-12-20 Bruno Haible <bruno@clisp.org>
4206 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
4207 use malloc instead. For SunOS 4.
4209 2001-12-11 Bruno Haible <bruno@clisp.org>
4211 * setenv.c: Declare alloca.
4212 (compar_fn_t): New typedef.
4213 (KNOWN_VALUE, STORE_VALUE): Use it.
4215 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
4218 2002-12-10 Paul Eggert <eggert@twinsun.com>
4220 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
4221 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
4222 Choose values that are less likely to collide with system fnmatch
4224 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
4225 defined (e.g., a pure POSIX system).
4226 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
4227 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
4229 2002-12-06 Jim Meyering <jim@meyering.net>
4231 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
4233 Merge in changes from libc's misc/error.c, in preparation
4234 for the merge of gnulib's changes back into libc.
4236 * error.c (_): Define only if not already defined.
4237 Move definition to follow all #include directives.
4238 Include unlocked-io.h only if !_LIBC.
4239 [_LIBC]: Include <libio/libioP.h>.
4240 [USE_IN_LIBIO]: Include <libio/iolibio.h>
4241 (fflush): Tweak definition to use INTUSE.
4244 2002-12-05 Paul Eggert <eggert@twinsun.com>
4246 * alloca.c [defined emacs]: Include "lisp.h".
4247 (xalloc_die) [defined emacs]: New macro.
4248 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
4249 [! defined emacs]: Include <xalloc.h>.
4250 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
4251 (pointer): Typedef to POINTER_TYPE *.
4252 (malloc): Remove decl; we now always use xmalloc.
4253 (alloca): Use old-style definition, since Emacs needs this.
4254 Check for arithmetic overflow when computing combined size.
4256 2002-12-04 Paul Eggert <eggert@twinsun.com>
4258 Do not generate unlocked-io.h automatically, since it's easier to
4259 maintain it by hand.
4261 * unlocked-io.h: New file, from GNU diffutils,
4262 but with proper copyright notice and attribution.
4264 * Makefile.am: Add copyright notice.
4265 (libfetish_a_SOURCES): Add unlocked-io.h.
4266 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
4267 (DISTCLEANFILES, io_functions): Remove macros.
4268 (EXTRA_DIST): Remove gen_uio.
4269 (unlocked-io.h): Remove rule.
4271 2002-12-04 Jim Meyering <jim@meyering.net>
4273 Reflect the fact that stat.c and lstat.c are no longer generated.
4274 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
4275 (DISTCLEANFILES): Likewise.
4276 (EXTRA_DIST): Likewise.
4277 (all_local): Don't depend on stat.c or lstat.c.
4278 (stat.c, lstat.c): Remove rules.
4279 (EXTRA_DIST): Remove xstat.in.
4281 * xstat.in: Remove file. Contents moved into stat.c.
4282 * stat.c: New file. Contents mostly from xstat.in.
4283 * stat.c: Rework so that it may serve to define rpl_lstat, too.
4284 * lstat.c: New file. Simply #define LSTAT and include stat.c.
4286 * safe-read.c: Rework so that it may serve to define safe_write, too.
4287 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
4289 2002-12-03 Jim Meyering <jim@meyering.net>
4291 * safe-read.c, safe-write.c: Change variable names and comments, but
4292 not semantics, to minimize the differences between these two files.
4293 (safe_read): Change comment to mention SAFE_READ_ERROR.
4295 * safe-read.c (IS_EINTR): Define.
4296 (safe_read): Use IS_EINTR in place of in-function cpp directives.
4298 2002-12-02 Bruno Haible <bruno@clisp.org>
4300 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
4301 Define, taken from safe-read.c.
4302 (INT_MAX): Provide fallback.
4303 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
4304 * safe-write.h (SAFE_WRITE_ERROR): Define.
4306 * safe-read.c (EINTR): Remove definition.
4307 (safe_read): Don't use EINTR if it is absent.
4309 2002-12-02 Jim Meyering <jim@meyering.net>
4311 * safe-read.c (EINTR): Define.
4312 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4313 (INT_MAX): Provide fallback.
4314 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
4316 * safe-read.h (SAFE_READ_ERROR): Define.
4318 2002-12-01 Jim Meyering <jim@meyering.net>
4320 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
4321 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
4323 2002-11-27 Paul Eggert <eggert@twinsun.com>
4325 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4326 hash_rehash): Replace `if (limit <= value) abort ();' with
4327 `if (! (value < limit)) abort ();', for readability.
4329 2002-11-26 <karl@gnu.org>
4331 * strdup.c: copy from libc again, with jim's ok.
4332 * .cppi-disable: re-add strdup.c
4334 2002-11-25 <karl@gnu.org>
4336 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
4337 instead of "strtol.c".
4339 2002-11-25 Jim Meyering <jim@meyering.net>
4341 * mktime.c: Sync from libc, now that it has the latest fix.
4343 2002-11-24 <karl@gnu.org>
4345 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
4346 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
4348 2002-11-24 Jim Meyering <jim@meyering.net>
4350 Update from coreutils:
4352 * mktime.c: Merge in changes from libc.
4354 Avoid a link-time failure on some Linux systems.
4355 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
4356 (__mon_yday): Declare with the STATIC attribute.
4357 (__mktime_internal): Likewise.
4358 Based on a report from Greg Schafer.
4360 2002-11-23 Jim Meyering <jim@meyering.net>
4362 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
4363 Use `unsigned', not `int', as type of index.
4365 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
4367 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
4369 2002-11-22 Paul Eggert <eggert@twinsun.com>
4371 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
4372 hint that one should use `if (! x) abort ();' rather than `assert
4373 (x);', and anyway it's one less thing to worry about configuring.
4374 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4375 hash_rehash, hash_insert): Use abort rather than assert.
4377 2002-11-22 Paul Eggert <eggert@twinsun.com>
4379 * quotearg.h: Allow multiple inclusion by surrounding with
4380 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
4381 so that we can be included first.
4382 (PARAMS): Remove; we now assume C89 or later. All uses removed.
4383 * quotearg.c: Include quotearg.h immediately after config.h.
4384 No need to include stddef.h or sys/types.h any more.
4385 Surround local include files with "", not "<>".
4386 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
4387 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
4388 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
4389 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
4390 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
4391 (ISPRINT): Remove; no longer needed now that we assume C89.
4393 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
4396 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
4397 quotearg_char): Use SIZE_MAX rather than
4398 (size_t) -1 when we are talking about "infinity".
4400 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
4402 2002-11-22 Bruno Haible <bruno@clisp.org>
4404 * safe-read.h: Assume C89. Add comments.
4405 (safe_read): Change return type to size_t.
4406 * safe-read.c (safe_read): Change return type to size_t. Handle byte
4407 counts > SSIZE_MAX correctly.
4408 * safe-write.h: New file.
4409 * safe-write.c: New file.
4410 * full-read.h: New file.
4411 * full-read.c: New file.
4412 * full-write.h: Assume C89. Add comments.
4413 * full-write.c: Include safe-write.h.
4414 (full_write): Rewritten to use safe_write.
4415 Suggested by Jim Meyering and Paul Eggert.
4417 2002-11-21 Bruno Haible <bruno@clisp.org>
4419 Remove case insensitive option matching.
4420 * argmatch.h (argcasematch): Remove declaration.
4421 (ARGCASEMATCH): Remove macro.
4422 (__xargmatch_internal): Remove case_sensitive argument.
4423 (XARGMATCH): Update.
4424 (XARGCASEMATCH): Remove macro.
4425 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
4426 case_sensitive argument.
4427 (argcasematch): Remove function.
4428 (__xargmatch_internal): Remove case_sensitive argument.
4429 (main): Use XARGMATCH instead of XARGCASEMATCH.
4431 * xmalloc.c: Change compile-time error message. Add comment about
4432 required autoconf version.
4434 2002-11-21 Jim Meyering <jim@meyering.net>
4436 * strdup.c (strdup): Tweak comment and initial #if/#include.
4438 Merge in changes from the coreutils.
4440 2002-09-25 Paul Eggert <eggert@twinsun.com>
4441 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
4442 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
4443 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
4444 int. Work more efficiently if X is the same width as uintmax_t.
4445 Do not compare X to -1, to avoid bogus compiler warning.
4446 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
4447 Don't assume that f_frsize and f_bsize are the same type.
4449 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
4452 * makepath.c (make_path): Restore umask *before* creating the final
4454 (make_path): Minor reformatting.
4456 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
4457 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
4459 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
4460 ones. At least on GNU/Linux systems, `auto' means something else.
4463 2002-11-20 Paul Eggert <eggert@twinsun.com>
4465 Merge argmatch cleanups from Bison. Assume C89.
4467 * argmatch.c: Include config.h here, not in argmatch.h.
4468 Include stdlib.h, for EXIT_FAILURE.
4469 Always include <string.h>, since we assume C89.
4470 (EXIT_FAILURE): Remove pre-C89 bug workaround.
4471 * argmatch.h: Do not include <config.h> or <sys/types.h>.
4472 Include <stddef.h> instead, since it's all we need for size_t.
4473 (PARAMS): Remove. All uses removed.
4474 (ARRAY_CARDINALITY): Do not bother to #undef.
4475 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
4476 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4477 Remove unnecessary parentheses.
4478 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4479 Insert necessary parentheses.
4480 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
4481 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
4483 2002-11-19 Bruno Haible <bruno@clisp.org>
4485 * mbswidth.c: Include mbswidth.h right at the beginning.
4486 * mbswidth.h: Include <stddef.h>, for size_t.
4488 * mbswidth.h (PARAMS): Remove macro.
4489 (mbswidth, mbsnwidth): Use ANSI C function declarations.
4490 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
4492 * gcd.h (PARAMS): Remove macro.
4493 (gcd): Use ANSI C function declarations.
4494 * gcd.c (gcd): Likewise.
4496 2002-11-15 Bruno Haible <bruno@clisp.org>
4498 * strcspn.c: Include <stddef.h>.
4499 (strcspn): Use ANSI C function declaration. Change return type to
4501 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
4502 (strpbrk): Use NULL.
4503 * strpbrk.h (PARAMS): Remove macro.
4504 (strpbrk): Use ANSI C function declaration.
4505 * strstr.c: Don't include <sys/types.h>.
4506 * strstr.h (PARAMS): Remove macro.
4507 (strstr): Use ANSI C function declarations.
4509 2002-11-06 Bruno Haible <bruno@clisp.org>
4511 * gcd.h (gcd): Change argument type to 'unsigned long'.
4512 * gcd.c (gcd): Likewise.
4514 2002-11-05 Bruno Haible <bruno@clisp.org>
4516 * gcd.h: New file, from gettext-0.11.5.
4517 * gcd.c: New file, from gettext-0.11.5.
4519 2002-11-05 Bruno Haible <bruno@clisp.org>
4521 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4522 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4523 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4524 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4526 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4527 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4529 * closeout.c: Include gettext.h instead of <libintl.h>.
4530 * human.c: Include gettext.h instead of <libintl.h>.
4531 * quotearg.c: Include gettext.h instead of <libintl.h>.
4532 * rpmatch.c: Include gettext.h instead of <libintl.h>.
4533 * unicodeio.c: Include gettext.h instead of <libintl.h>.
4534 * userspec.c: Include gettext.h instead of <libintl.h>.
4535 * version-etc.c: Include gettext.h instead of <libintl.h>.
4536 * xmalloc.c: Include gettext.h instead of <libintl.h>.
4537 (textdomain): Remove definition.
4538 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
4540 * long-options.c: Remove include of <libintl.h> and definition of _.
4541 * same.c: Remove include of <libintl.h> and definition of _.
4543 2002-11-04 Bruno Haible <bruno@clisp.org>
4545 * stpcpy.h: New file, from GNU gettext-0.11.5.
4546 * strcase.h: New file, from GNU gettext-0.11.5.
4547 * strpbrk.h: New file, from GNU gettext-0.11.5.
4548 * strstr.h: New file, from GNU gettext-0.11.5.
4549 * xgetcwd.h: New file, from GNU gettext-0.11.5.
4551 2002-05-09 Bruno Haible <bruno@clisp.org>
4553 * config.charset: Update for newest glibc. Add canonical names
4554 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
4556 2002-05-09 Bruno Haible <bruno@clisp.org>
4558 * localcharset.c (get_charset_aliases): Add more Windows specific
4561 2002-05-08 Owen Taylor <otaylor@redhat.com>
4563 * config.charset: A few additions for Solaris.
4565 2001-12-05 Bruno Haible <bruno@clisp.org>
4567 * localcharset.c (locale_charset): Don't return an empty string.
4569 2001-10-23 Bruno Haible <haible@clisp.cons.org>
4571 * config.charset: msdos in uk_UA uses CP1125.
4573 2001-08-05 Bruno Haible <haible@clisp.cons.org>
4575 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
4576 * localcharset.c (locale_charset): Declare as extern "C".
4578 2002-02-15 Bruno Haible <bruno@clisp.org>
4580 * config.charset [msdosdjgpp]: For Russian, use CP866.
4582 2002-02-11 Bruno Haible <bruno@clisp.org>
4584 * config.charset: Add support for NetBSD.
4586 2002-09-25 <karl@gnu.org>
4588 * strdup.c: copy from libc/string (via ../config/srclist*).
4589 * getopt*: copy from libc/posix.
4590 * gettext.h: copy from gettext.
4591 * .cppi-disable: add strdup.c, gettext.h.
4593 2002-07-01 Jim Meyering <meyering@lucent.com>
4595 * c-stack.c: Include sys/time.h.
4596 From Volker Borchert.
4598 2002-06-11 Paul Eggert <eggert@twinsun.com>
4600 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
4601 New macro. Use it uniformly instead of
4602 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
4603 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
4604 reported by Vin Shelton.
4606 2002-06-22 Jim Meyering <meyering@lucent.com>
4608 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
4609 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
4611 2002-06-22 Paul Eggert <eggert@twinsun.com>
4613 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
4614 Do not assume SA_SIGINFO behavior.
4615 Bug reported by Jim Meyering on NetBSD 1.5.2.
4617 2002-06-22 Jim Meyering <meyering@lucent.com>
4619 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
4621 * exitfail.c, exitfail.h: Likewise.
4622 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
4624 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
4626 (EXTRA_DIST): Add fnmatch_loop.c.
4627 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
4629 * fnmatch_loop.c: New file, from diffutils-2.8.2.
4630 * fnmatch.c: Update from diffutils-2.8.2.
4631 * fnmatch_.h: New file. From diffutils-2.8.2.
4632 * fnmatch.h: Remove file.
4634 2002-06-18 Paul Eggert <eggert@twinsun.com>
4636 * file-type.h: Report an error if neither S_ISREG nor
4637 S_IFREG is defined, instead of using a test specific to glibc
4638 2.2. This should be safe, since POSIX requires S_ISREG and
4639 Unix Version 7 had S_IFREG. We don't need to check for
4640 <sys/types.h> since we don't use any symbols that it defines.
4642 2002-06-15 Jim Meyering <meyering@lucent.com>
4644 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
4645 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
4646 have been included before this file.
4648 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
4650 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
4651 so that each temporary file name is unique and valid in the first
4652 8 characters, for operation under DOS.
4654 2002-06-15 Jim Meyering <meyering@lucent.com>
4656 Work even with DJGPP 2.03, which lacks support for symlinks.
4658 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
4660 * lchown.c (S_ISLNK): Likewise.
4662 2002-06-14 Jim Meyering <meyering@lucent.com>
4664 * file-type.h: Use the version from diffutils-2.8.2.
4665 * file-type.c: Likewise.
4667 2002-05-27 Jim Meyering <meyering@lucent.com>
4669 Fix a problem seen only on nonconforming systems whereby ls.c's
4670 use of localtime, and then of gettimeofday would cause trouble:
4671 the localtime call used to initialize rpl_gettimeofday's save
4672 mechanism would clobber ls's current local time information so
4673 that in any long listing the first file would always be listed
4674 with date 1970-01-01. Analysis by Volker Borchert.
4676 * gettimeofday.c (localtime): Undefine.
4677 (rpl_localtime): New function.
4679 2002-05-22 Jim Meyering <meyering@lucent.com>
4681 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
4682 * file-type.h: New file.
4683 * file-type.c (file_type): New file/function. Extracted from diffutils.
4685 2002-04-29 Paul Eggert <eggert@twinsun.com>
4687 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
4689 2002-04-28 Paul Eggert <eggert@twinsun.com>
4691 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
4692 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
4693 of 127, since 64 is the largest conceivable number for ancient
4695 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
4697 2002-04-28 Jim Meyering <meyering@lucent.com>
4699 * sig2str.c (WTERMSIG): Remove definition (unused).
4701 2002-04-28 Paul Eggert <eggert@twinsun.com>
4703 * sig2str.h, sig2str.c: New files.
4704 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
4706 2002-04-24 Jim Meyering <meyering@lucent.com>
4708 * gettext.h: New file, from Gettext.
4709 * Makefile.am (INCLUDES): Remove -I../intl.
4710 (libfetish_a_SOURCES): Add gettext.h.
4712 2002-04-16 Jim Meyering <meyering@lucent.com>
4714 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
4715 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
4716 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
4718 2002-04-12 Jim Meyering <meyering@lucent.com>
4720 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
4722 2002-03-10 Jim Meyering <meyering@lucent.com>
4724 * makepath.c (make_path): Remove a comma from a diagnostic.
4725 Suggestion from Santiago Vila.
4727 2002-03-08 Jim Meyering <meyering@lucent.com>
4729 * rename.c: Mention that this wrapper is needed also on
4730 mips-dec-ultrix4.4 systems.
4732 2002-03-02 Jim Meyering <meyering@lucent.com>
4734 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
4735 not HAVE_CLOCK_SETTIME.
4737 2002-02-27 Paul Eggert <eggert@twinsun.com>
4739 * nanosleep.h: Rename to....
4740 * timespec.h: New name for nanosleep.h. All uses changed.
4742 * gettime.c: New file.
4743 * settime.c: New file.
4746 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
4747 timespec.h. Remove nanosleep.h.
4749 2002-02-25 Paul Eggert <eggert@twinsun.com>
4751 * acl.c, acl.h: New files.
4752 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
4754 2002-02-24 Jim Meyering <meyering@lucent.com>
4756 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
4757 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
4758 cause trouble. Reported by Nelson Beebe.
4760 2002-02-23 Paul Eggert <eggert@twinsun.com>
4762 * path-concat.c (xpath_concat): Reorder code to pacify
4763 compilers that don't know that xalloc_die never returns.
4765 2002-02-20 Jim Meyering <meyering@lucent.com>
4767 * getdate.c: Regenerate using bison-1.33.
4769 2002-02-15 Paul Eggert <eggert@twinsun.com>
4771 * posixver.c, posixver.h: New files.
4772 * Makefile.am (libfetish_a_SOURCES): Add them.
4774 2002-02-02 Paul Eggert <eggert@twinsun.com>
4775 Bruno Haible <bruno@clisp.org>
4777 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
4778 (fwrite_success_callback): New declaration.
4779 * unicodeio.c (unicode_to_mb): New function, extracted from
4780 print_unicode_char. Call failure callback instead of error.
4781 (fwrite_success_callback): New function.
4782 (exit_failure_callback): New function.
4783 (fallback_failure_callback): New function.
4784 (print_unicode_char): Call unicode_to_mb.
4786 2002-01-26 Jim Meyering <meyering@lucent.com>
4788 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
4790 2002-01-22 Jim Meyering <meyering@lucent.com>
4792 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
4793 Otherwise, some versions of automake would omit the rule that makes
4794 Makefile from Makefile.in.
4796 2001-01-21 Paul Eggert <eggert@twinsun.com>
4798 * xmemcoll.h, xmemcoll.c: New files.
4799 * Makefile.am (libfetish_a_SOURCES): Add them.
4800 * memcoll.c: Include errno.h, and declare errno if not defined.
4801 (memcoll): Set errno to zero if there is no error.
4803 * quotearg.c (quotearg_buffer_restyled):
4804 Fix bug with quoting buffers containing NUL when backslashing escapes.
4805 This bug was exposed by the other changes in this patch.
4806 (quotearg_n_options): New arg ARGSIZE.
4807 All callers changed.
4808 (quoting_options_from_style): New function.
4809 (quotearg_n_style): Use it.
4810 (quotearg_n_style_mem): New function.
4812 * quotearg.h (quotearg_n_style_mem): New function.
4814 2002-01-16 Jim Meyering <meyering@lucent.com>
4816 * getdate.y: Add three semicolons, each just before a closing brace.
4817 Bison (as of version 1.31) no longer papers over that mistake.
4819 2002-02-14 Paul Eggert <eggert@twinsun.com>
4821 * backupfile.c (ISDIGIT): Comment fix.
4822 * getdate.y (ISDIGIT): Likewise.
4823 * posixtm.c (ISDIGIT, year): Likewise.
4824 * strverscmp.c (ISDIGIT): Likewise.
4825 * userspec.c (ISDIGIT): Likewise.
4827 2002-01-05 Jim Meyering <meyering@lucent.com>
4829 * version-etc.c (version_etc_copyright): Update copyright year.
4831 2001-01-19 Paul Eggert <eggert@twinsun.com>
4833 * closeout.c (close_stdout_status): If ferror (stdout), do
4834 not silently exit merely because the output buffer happens to
4835 have nothing pending.
4837 2001-12-18 Paul Eggert <eggert@twinsun.com>
4839 See the big note in ../ChangeLog.
4840 * human.c (suffixes): Prefer K to k for 1024.
4841 (generate_suffix_backwards): New function.
4842 (human_readable_inexact): Use it.
4843 * xstrtol.c (__xstrtol): If there is no number but there
4844 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
4845 Accept 'K' as well as 'k'.
4847 2001-12-15 Jim Meyering <meyering@lucent.com>
4849 * regex.h (__restrict_arr): Update from libc.
4851 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
4852 as `remote' if the name starts with `//'. Suggested by Michael Stone.
4855 2001-12-10 Jim Meyering <meyering@lucent.com>
4857 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
4858 Instead, include "xalloc.h".
4859 (initbuffer): Don't cast xmalloc return value to char*.
4860 (readline): Reword comment.
4861 Don't cast xrealloc return value to char*
4864 2001-12-09 Jim Meyering <meyering@lucent.com>
4866 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
4867 `signed and unsigned type in conditional expression'.
4868 * posixtm.c (posix_time_parse): Likewise.
4870 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
4872 * readtokens.c (readtoken): Declare an index to be of type unsigned
4873 to avoid a pedantic warning.
4875 * getstr.c: Don't include assert.h.
4876 (getstr): Remove warning-evoking assertions.
4877 Return -1 if offset parameter is out of bounds.
4878 Change the type of a local from int to size_t.
4880 * strftime.c (my_strftime_localtime_r): Include this function
4881 definition in the `#if ! HAVE_TM_GMTOFF' block.
4883 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
4884 Include xalloc.h instead.
4886 2001-12-02 Jim Meyering <meyering@lucent.com>
4888 * tempname.c: Don't declare getenv, thus reverting the change of
4889 2001-11-18. It's no longer necessary, now that stdlib.h is always
4892 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
4893 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
4895 2001-11-30 Akim Demaille <akim@epita.fr>
4897 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
4898 before being defined.
4900 2001-11-27 Paul Eggert <eggert@twinsun.com>
4902 * quotearg.h (quotearg_n, quotearg_n_style):
4903 First arg is int, not unsigned.
4904 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
4905 (SIZE_MAX, UINT_MAX): New macros.
4906 (quotearg_n_options): Abort if N is negative.
4907 Avoid overflow check on hosts where size_t is 64 bits and int
4908 is 32 bits, as overflow is impossible there.
4909 Fix off-by-one typo that caused unnecessary reallocation.
4911 2001-11-27 Jim Meyering <meyering@lucent.com>
4913 * tempname.c: Merge with version from libc.
4914 * regex.c: Likewise.
4916 * tempname.c: Include stdlib.h unconditionally. On some old systems
4917 for which STDC_HEADERS is 0, it was not included, resulting in a
4918 warning about an integer-to-pointer conversion problem with getenv.
4919 Reported by Volker Borchert.
4921 2001-11-26 Jim Meyering <meyering@lucent.com>
4923 * gtod.h: Remove file.
4924 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
4925 * gettimeofday.c: Don't include gtod.h.
4926 (GTOD_init): Remove function.
4927 (rpl_gettimeofday): Do its job here instead, rather than aborting.
4928 Suggestion from Volker Borchert.
4930 2001-11-23 Jim Meyering <meyering@lucent.com>
4932 * hash.h (struct hash_table): Don't define here. Merely declare it.
4933 * hash.c (struct hash_table): Define it here instead.
4935 2001-11-22 Jim Meyering <meyering@lucent.com>
4937 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
4939 2001-11-18 Paul Eggert <eggert@twinsun.com>
4941 * tempname.c (TMP_MAX): Remove; no longer needed.
4942 (TEMPORARIES): New macro.
4943 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
4944 removes an artificial limitation (e.g. HP-UX 10.20, where
4947 2001-11-18 Jim Meyering <meyering@lucent.com>
4949 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
4952 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
4953 files will be created before anything else.
4955 2001-11-17 Jim Meyering <meyering@lucent.com>
4957 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
4958 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
4959 rather than group writable. Patch by Juan F. Codagnone.
4961 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
4962 Instead, include "xalloc.h".
4964 * mountlist.c: Include unlocked-io.h after all system headers.
4965 Remove explicit declarations of xmalloc, xrealloc,
4966 and xstrdup. Instead, include "xalloc.h".
4968 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
4969 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
4970 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
4972 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
4973 Reported by Padraig Brady.
4975 * mkstemp.c: #undef mkstemp.
4977 (rpl_mkstemp): Rename from mkstemp.
4980 2001-11-16 Jim Meyering <meyering@lucent.com>
4982 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
4983 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
4984 determine the amount of total physical memory, use pstat_getstatic.
4985 HPUX-11 doesn't define _SC_PHYS_PAGES.
4986 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
4987 If sysconf couldn't be used to determine the amount of available
4988 physical memory, use both pstat_getstatic and pstat_getdynamic.
4989 Based on a patch from Bob Proulx.
4991 2001-11-05 Jim Meyering <meyering@lucent.com>
4993 * xstat.in (slash_aware_lstat): Correct a misleading comment.
4995 2001-11-03 Jim Meyering <meyering@lucent.com>
4997 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
4998 in argmatch_to_argument call.
5000 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
5003 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
5004 e.g., a fault due to an attempt to free a NULL pointer.
5006 2001-11-01 Jim Meyering <meyering@lucent.com>
5008 * dirfd.c, dirfd.h: New files.
5009 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
5011 * hash.c (hash_print) [TESTING]: Clean up.
5013 2001-10-22 Paul Eggert <eggert@twinsun.com>
5015 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
5016 to avoid a warning if -Wall.
5018 2001-10-21 Paul Eggert <eggert@twinsun.com>
5020 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
5022 2001-10-21 Jim Meyering <meyering@lucent.com>
5024 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
5025 this code would end up calling gettext even in packages built
5027 * getopt.c (_): Likewise.
5028 * regex.c (_): Likewise.
5030 2001-10-20 Paul Eggert <eggert@twinsun.com>
5032 * error.c (strerror_r): Do not declare unless !_LIBC.
5033 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
5034 Use strerror_r that is only a macro, even if it is not a function.
5035 (strerror): Check for HAVE_DECL_STRERROR before declaring.
5036 (private_strerror): Use prototypes, not old-style function definition.
5037 (print_errno_message): New function.
5038 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
5040 (error_tail, error, error_at_line): Use it.
5042 2001-10-11 Jim Meyering <meyering@lucent.com>
5044 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
5045 and quote_n (1, ... to avoid clobbering a buffer.
5047 2001-10-05 Jim Meyering <meyering@lucent.com>
5049 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
5050 * hash-pjw.c: New file (factored out of fileutils' remove.c).
5051 * hash-pjw.h: New file.
5053 2001-09-30 Jim Meyering <meyering@lucent.com>
5055 * mountlist.c [MOUNTED_GETFSSTAT]:
5056 Include <sys/ucred.h>, for Apple Darwin.
5057 Include sys/mount.h and sys/fs_types.h only if available.
5059 (read_filesystem_list): Use FS_TYPE.
5061 2001-09-29 Paul Eggert <eggert@twinsun.com>
5063 * exclude.c (excluded_filename): 0 -> false, since it's
5066 2001-09-28 Paul Eggert <eggert@twinsun.com>
5068 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
5069 #defines strtoimax. Also treat the other strto* functions
5072 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
5073 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
5074 (strtoimax, strtoumax): Do not declare if already defined as a macro.
5076 2001-09-26 Jim Meyering <meyering@lucent.com>
5078 Most macros in unlocked-io.h had the wrong number of arguments.
5079 * gen-uio: New script.
5080 (USE_UNLOCKED_IO): Define to 1 if not already defined.
5081 * unlocked-io.hin: Remove file.
5082 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
5083 rather than trying to embed it here.
5084 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
5085 Reported by Padraig Brady.
5087 2001-09-25 Volker Borchert <bt@teknon.de>
5089 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
5091 2001-09-23 Jim Meyering <meyering@lucent.com>
5093 * mountlist.c: Remove useless parentheses in #if directives.
5094 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
5095 the deprecated MOUNTED symbol is no longer defined in mntent.h.
5097 2001-09-22 Jim Meyering <meyering@lucent.com>
5099 * localcharset.c: Update from latest gettext.
5100 * config.charset: Likewise.
5102 2001-09-20 Jim Meyering <meyering@lucent.com>
5104 * xstrtol.c (strtoimax): Guard declaration with
5105 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
5106 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
5107 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
5108 (strtoumax): Likewise, for completeness (it wasn't necessary).
5110 2001-09-06 Paul Eggert <eggert@twinsun.com>
5112 * strtoimax.c (HAVE_LONG_LONG):
5113 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
5114 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
5115 to work around bug in IBM C compiler.
5117 2001-09-16 Jim Meyering <meyering@lucent.com>
5119 * mkdir.c: New file.
5121 2001-09-04 Paul Eggert <eggert@twinsun.com>
5123 * xgetcwd.c: Revert some of the previous change; intead,
5124 fix the HAVE_GETCWD_NULL code to behave more like the
5125 !HAVE_GETCWD_NULL code used to.
5128 (xgetcwd): Do not return NULL when memory is exhausted; instead,
5131 2001-09-04 Paul Eggert <eggert@twinsun.com>
5133 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
5134 Use ssize_t, not int, to store result of readlink.
5135 Check for ssize_t overflow as well as size_t overflow,
5136 as POSIX says the result of readlink is implementation-defined
5137 when ssize_t overflows.
5138 Remove unnecessary cast to char*.
5139 Use free+malloc instead of realloc, as the storage doesn't need
5140 to be preserved and it's clearer and can be more efficient that way.
5141 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
5142 * xreadlink.h (xreadlink): Update prototype.
5144 2001-09-03 Paul Eggert <eggert@twinsun.com>
5146 * exclude.c (fnmatch_no_wildcards): Fix confusion between
5147 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
5148 spotted by Jim Meyering.
5150 2001-09-03 Jim Meyering <meyering@lucent.com>
5152 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
5154 2001-09-03 Paul Eggert <eggert@twinsun.com>
5156 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
5157 like the HAVE_GETCWD_NULL code.
5158 Include pathmax.h if not HAVE_GETCWD.
5159 Do not include xalloc.h.
5160 (INITIAL_BUFFER_SIZE): New symbol.
5161 Do not use xmalloc / xrealloc, since the caller is responsible for
5162 handling errors. Preserve errno around `free' during failure.
5163 Do not overrun buffer when using getwd.
5165 2001-09-03 Paul Eggert <eggert@twinsun.com>
5167 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
5168 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
5170 2001-09-02 Jim Meyering <meyering@lucent.com>
5172 * error.c: Update from GNU libc.
5174 2001-09-01 Jim Meyering <meyering@lucent.com>
5176 * xreadlink.c: New file.
5177 * xreadlink.h: New file.
5178 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
5180 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
5181 doesn't conflict with sparc Solaris 7's definition in
5182 /usr/include/sys/int_types.h.
5184 * exclude.c: Use `""', not `<>' to #include non-system header files.
5185 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
5186 and strncasecmp as r-values. Unixware didn't have declarations.
5188 2001-08-31 Jim Meyering <meyering@lucent.com>
5190 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
5191 Use an initial, malloc'd, buffer of length 128 rather than
5192 a statically allocated one of length 1024.
5194 2001-08-30 Paul Eggert <eggert@twinsun.com>
5196 * xgetcwd.c: Don't include pathmax.h.
5197 Include stdlib.h and unistd.h if available.
5199 (xmalloc, xstrdup, free): Remove decls.
5200 (xgetcwd): Don't assume sizes fit in unsigned.
5201 Check for overflow when computing sizes.
5202 Simplify reallocation code.
5204 2001-08-28 Paul Eggert <eggert@twinsun.com>
5206 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
5208 * strtoimax.c: Renamed from strtoxmax.c, removing the
5211 Also, make the following further changes to make this file's
5212 configuration more similar to that of strtol.c:
5213 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
5214 (strtoumax, uintmax_t, strtoull, strtol): Remove.
5215 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
5216 (strtoimax): Renamed from strtoumax. All uses of unsigned values
5217 changed to signed values.
5219 And make the following changes as well:
5220 Fix copyright notice, as 1999 was missing.
5221 (verify): New macro.
5222 (strtoimax): Check sizes at compile-time, not run-time.
5223 Prefer strtol to strtoll if both work.
5224 (main): Remove; it was not that useful and was a pain to maintain.
5226 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
5228 2001-08-30 Paul Eggert <eggert@twinsun.com>
5230 * savedir.c (savedir): Remove size parameter, as POSIX says that
5231 a directory's st_size can have an arbitrary value, so the old
5232 usage could waste an arbitrary amount of memory. All uses
5234 * savedir.h: Update prototype.
5236 2001-08-30 Paul Eggert <eggert@twinsun.com>
5238 * xstrtol.c (strtoimax): New decl.
5240 2001-08-28 Paul Eggert <eggert@twinsun.com>
5242 * xstrtol.h: Add copyright notice.
5243 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
5244 LONGINT_INVALID_SUFFIX_CHAR.
5246 2001-08-30 Paul Eggert <eggert@twinsun.com>
5248 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5251 2001-08-30 Paul Eggert <eggert@twinsun.com>
5253 * hash.c: Remove '2001' from copyright notice.
5255 2001-08-30 Paul Eggert <eggert@twinsun.com>
5257 * full-write.h: New file.
5258 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
5259 * full-write.c: Correct credits, as cccp.c no longer
5260 exists and anyway it was so heavily changed from the old cccp
5261 code as to be unrecognizable. Include full-write.h.
5262 (full_write) Return size_t, with short writes meaning failure.
5263 All callers changed. This fixes a bug with large buffers
5265 * utime.c: Include full-write.h.
5267 2001-08-30 Paul Eggert <eggert@twinsun.com>
5269 Merge 'exclude' changes from tar 1.13.22.
5270 This fixes one or two unlikely storage allocation overflow bugs,
5271 but doesn't change user-visible behavior otherwise.
5273 2001-08-30 Paul Eggert <eggert@twinsun.com>
5275 * exclude.c (bool): Declare, perhaps by including stdbool.h.
5276 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
5277 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
5278 Include if available.
5279 (<xalloc.h>): Include
5280 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
5281 (verify): New macro. Use it to verify that EXCLUDE macros do not
5282 collide with FNM macros.
5283 (struct patopts): New struct.
5284 (struct exclude): Use it, as exclude patterns now come with options.
5285 (new_exclude): Support above changes.
5286 (new_exclude, add_exclude_file):
5287 Initial size must now be a power of two to simplify overflow checking.
5288 (free_exclude, fnmatch_no_wildcards): New function.
5289 (excluded_filename): No longer requires options arg, as the options
5290 are determined by add_exclude. Now returns bool, not int.
5291 (excluded_filename, add_exclude):
5292 Add support for the fancy new exclusion options.
5293 (add_exclude, add_exclude_file): Now takes int options arg.
5294 Check for arithmetic overflow when computing sizes.
5295 (add_exclude_file): xrealloc might modify errno, so don't
5296 realloc until after errno might be used.
5298 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
5300 (free_exclude): New decl.
5301 (add_exclude, add_exclude_file): Now takes int options arg.
5302 (excluded_filename): No longer requires options arg, as the options
5303 are determined by add_exclude. Now returns bool, not int.
5305 2001-08-30 Paul Eggert <eggert@twinsun.com>
5307 * alloca.c (alloca): Arg is of type size_t, not unsigned.
5309 2001-08-27 Jim Meyering <meyering@lucent.com>
5311 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
5313 * version-etc.c (N_): Remove definition.
5314 Revert most of last change.
5315 Instead, simply don't mark the `Copyright...' string for translation.
5316 Based on advice from Paul Eggert.
5318 * strtoxmax.c: Tweak comment.
5320 2001-08-26 Jim Meyering <meyering@lucent.com>
5322 * version-etc.c (version_etc_copyright_fmt): Replace literal year
5323 of copyright with `%s' so translators don't get an untranslated
5325 (COPYRIGHT_YEAR): Define.
5326 (version_etc): Use fprintf rather than fputs.
5327 Suggestion from Ulrich Drepper.
5329 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5331 * strtoll.c: New file, from GNU libc.
5332 * xstrtoimax.c: New file.
5334 * xstrtol.h: Add xstrtoimax.
5335 * strtoumax.c: New file. Simply include "strtoumax.c".
5336 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
5338 * strtoumax.c: Factor to work both for unsigned and signed types, ...
5339 * strtoxmax.c: ... then renamed to this.
5341 2001-08-13 Paul Eggert <eggert@twinsun.com>
5343 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
5344 Port to Solaris 8, where 'sed' requires a space after the 'r'
5345 command, and where sh dislikes "$/". Clean up the spacing a bit.
5346 Redirect output to $tmp just once.
5348 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
5350 * addext.c (<errno.h>): Include.
5351 (errno): Declare if not defined.
5352 (addext): Work correctly when pathconf returns -1 and leaves
5353 errno alone because there is no limit. Also, work even if
5354 pathconf returns a value greater than SIZE_MAX.
5356 2001-08-12 Jim Meyering <meyering@lucent.com>
5358 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
5359 Simply `return getcwd (NULL, 0);'.
5360 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
5361 Use 1300 as initial value for length, not PATH_MAX.
5363 * pathmax.h: Clean up cpp syntax.
5365 2001-08-12 Jim Meyering <meyering@lucent.com>
5367 * gettimeofday.c: New file.
5369 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
5371 2001-08-04 Jim Meyering <meyering@lucent.com>
5373 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
5374 to get in sync with glibc.
5376 2001-08-03 Paul Eggert <eggert@twinsun.com>
5378 The following changes are from gettext 0.10.39 as maintained by
5381 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
5382 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
5383 with inverted sense. All uses changed.
5385 * mbswidth.c: Don't include <limits.h>.
5386 Include <stdlib.h> and <string.h> unconditionally.
5387 (iswcntrl, mbsinit, ISCNTRL): New macros.
5388 (mbsnwidth): Use K&R style function declarations.
5389 Don't bother checking for MB_LEN_MAX == 1, since the compiler
5390 can optimize it when MB_CUR_MAX == 1.
5391 The width of control characters is zero, not 1.
5393 2001-07-15 Jim Meyering <meyering@lucent.com>
5395 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
5396 (BUILT_SOURCES): Add unlocked-io.h.
5397 (io_functions): Define.
5398 (unlocked-io.h): New rule.
5399 (DISTCLEANFILES): Add unlocked-io.h.
5400 (all-local): Depend on unlocked-io.h, to ensure it is created.
5402 * unlocked-io.hin: New file
5404 * regex.c: Update from glibc.
5406 2001-07-05 Jim Meyering <meyering@lucent.com>
5408 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
5410 (libfetish_a_SOURCES): Put all .h files here instead.
5411 Remove a thus-exposed (better checks in automake) duplicate and
5412 two unnecessary .h files.
5414 2001-06-11 Jim Meyering <meyering@lucent.com>
5416 * regex.c: Update from GNU libc.
5418 2001-05-27 Jim Meyering <meyering@lucent.com>
5420 * readutmp.h (UT_TYPE): Define.
5422 2001-05-24 Jim Meyering <meyering@lucent.com>
5424 * argmatch.c: Include "quote.h".
5425 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
5426 quote function. Reported by Göran Uddeborg.
5428 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
5430 * dirname.c (dir_name): Compute append_dot using path, not newpath
5431 which is not yet declared.
5433 2001-05-11 Paul Eggert <eggert@twinsun.com>
5435 * Makefile.am (libfetish_a_SOURCES):
5436 Add strftime.c, since we now compile it on all hosts.
5438 * strftime.c (my_strftime):
5439 Define to nstrftime if emacs, but only if my_strftime is not defined.
5440 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
5441 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
5442 Add one more extra argument: a nanoseconds value.
5445 (my_strftime function): Add %N format.
5446 (emacs_strftimeu): Renamed from emacs_strftime,
5447 with extra ut argument.
5449 2001-05-11 Paul Eggert <eggert@twinsun.com>
5451 dirname code cleanup. base_name now behaves more compatibly
5452 with POSIX basename when given file names that have trailing
5453 slashes, and similarly for dir_name. Add new primitives
5454 base_len and dir_len. Put the directory-name-related decls
5457 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
5458 * backupfile.c (base_name): Likewise.
5459 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
5460 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
5461 * makepath.c (strip_trailing_slashes): Likewise.
5462 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
5464 * rename.c (strip_trailing_slashes): Likewise.
5465 * same.c (base_name): Likewise.
5466 * stripslash.c (ISSLASH): Likewise.
5468 * addext.c: Include <dirname.h> after size_t is defined.
5469 * backupfile.c: Likewise.
5471 * addext.c (addext): Use base_len to trim redundant
5472 trailing slashes instead of doing it ourselves.
5473 But do not trim the last slash if it is not redundant.
5475 * backupfile.c (find_backup_file_name,
5476 max_backup_version): Use base_len instead of rolling it ourselves.
5477 Handle the case of "" and (on DOS) "C:" correctly.
5479 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
5480 Include <string.h>, <dirname.h>.
5481 (base_name): Allow file names ending in slashes, other than names
5482 that are all slashes. In this case, return the basename followed
5483 by the slashes. This is more general, and can be used in places
5484 where the original base_name purposely had an assertion failure.
5485 (base_len): New function.
5487 * dirname.c: Include <string.h> instead of <stdlib.h>.
5488 Do not include <assert.h>; no longer needed.
5490 (memrchr): Remove decl.
5491 (dir_name_r): Remove.
5492 (dir_len): Renamed from dirlen. All callers changed.
5493 Rewrite in terms of base_name, for simplicity and consistency.
5494 (dir_name): Never return NULL. All callers changed.
5495 Do not include <stdlib.h> in test program; no longer needed.
5496 return 0; is fine for test program.
5498 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
5500 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
5502 * path-concat.c (path_concat): Use base_len to compute
5503 base length, not strlen; this means we cannot rely on memcpy
5506 * same.c (STREQ): Remove.
5507 (same_name): Handle the case where the basename ends in trailing '/'.
5509 * stripslash.c (strip_trailing_slashes): Return nonzero if
5510 a slash was stripped. Do not strip the last slash after a
5513 2001-04-08 Jim Meyering <meyering@lucent.com>
5515 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
5516 recomputed; that's necessary when the offset spans a DST transition.
5517 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
5519 2001-04-02 Jim Meyering <meyering@lucent.com>
5521 * regex.h, regex.c: Update from GNU libc.
5523 2001-03-19 Paul Eggert <eggert@twinsun.com>
5525 * version-etc.c (version_etc_copyright): Update to 2001.
5527 2001-03-16 Paul Eggert <eggert@twinsun.com>
5529 * tempname.c (uint64_t): Define to uintmax_t if
5530 not defined, and if UINT64_MAX is not defined.
5531 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5532 Reported by John David Anglin.
5534 2001-03-10 Bruno Haible <haible@clisp.cons.org>
5536 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5537 alias if codeset is empty.
5538 * config.charset (BeOS): Use wildcard syntax.
5540 2001-03-13 Jim Meyering <meyering@lucent.com>
5542 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5543 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5546 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5548 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5550 * unicodeio.c (print_unicode_char): Simplify accordingly.
5552 2001-03-06 Bruno Haible <haible@clisp.cons.org>
5554 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5555 support for DOS/DJGPP.
5557 2001-02-28 Paul Eggert <eggert@twinsun.com>
5559 * Makefile.am (libfetish_a_SOURCES):
5560 Add dup-safer.c, fopen-safer.c.
5561 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5563 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5565 2001-02-25 Paul Eggert <eggert@twinsun.com>
5567 The mkstemp replacement is taken from glibc 2.2.2, with some
5568 portability fixes for use outside glibc, as follows:
5570 * tempname.c (struct_stat64): New macro.
5571 (direxists, __gen_tempname): Use it.
5572 This avoids a portability problem with Solaris 8.
5574 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5575 (<stddef.h>, <stdint.h>, <string.h>):
5576 Include only if STDC_HEADERS || _LIBC.
5577 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5578 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5579 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5580 (__set_errno): Define this macro if <errno.h> doesn't.
5581 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
5582 Define these macros if <stdio.h> doesn't.
5583 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
5584 Define these macros if <sys/stat.h>
5585 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
5586 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
5587 __xstat64): Define if not _LIBC.
5588 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
5589 (__gen_tempname): Invoke gettimeofday only if
5590 HAVE_GETTIMEOFDAY || _LIBC;
5591 otherwise, fall back on plain "time".
5592 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
5594 * mkstemp.c (__GT_FILE): Define to zero if not defined.
5596 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
5598 2001-02-17 Jim Meyering <meyering@lucent.com>
5600 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
5601 around included file name.
5603 * strnlen.c (__strnlen): Merge in a change from GNU libc.
5605 * strftime.c: Update from GNU libc (the only changes were to comments).
5607 2001-02-13 Bruno Haible <haible@clisp.cons.org>
5609 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
5611 2001-02-17 Paul Eggert <eggert@twinsun.com>
5613 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
5614 Remove workaround macros for hosts that have mbrtowc but not
5615 mbstate_t, as we now insist on proper declarations for both
5616 before using mbrtowc.
5618 2001-02-17 Jim Meyering <meyering@lucent.com>
5620 * regex.c: Update from libc.
5622 2001-02-16 Paul Eggert <eggert@twinsun.com>
5624 * alloca.c (malloc): Undef before defining, since stdlib.h
5625 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
5626 Reported by Mark Hounschell via Paul Eggert.
5628 2001-01-30 Bruno Haible <haible@clisp.cons.org>
5630 * config.charset: Update for FreeBSD 4.2.
5632 2001-01-26 Jim Meyering <meyering@lucent.com>
5634 * quotearg.c: Include stddef.h.
5635 * quote.c: Include stddef.h.
5636 Reported by Axel Kittenberger.
5638 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
5639 line in double quotes so that it evokes a better diagnostic.
5640 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
5641 Reported by Axel Kittenberger.
5643 2001-01-15 Bruno Haible <haible@clisp.cons.org>
5645 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
5646 to avoid a warning. Add back 'const' to inptr.
5648 2001-01-16 Jim Meyering <meyering@lucent.com>
5650 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
5653 2001-01-14 Jim Meyering <meyering@lucent.com>
5655 * rename.c: New file. From Volker Borchert.
5656 Include stdlib.h, string.h or strings.h, and xalloc.h.
5657 Use strip_trailing_slashes rather than open-coding it.
5659 2001-01-03 Paul Eggert <eggert@twinsun.com>
5661 * strftime.c: Sync with glibc time/strftime.c 1.81.
5663 2001-01-03 Jim Meyering <meyering@lucent.com>
5665 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
5666 local `inptr' to avoid warning with some system declarations of iconv.
5668 2000-12-29 Paul Eggert <eggert@twinsun.com>
5670 * modechange.c: Do not assume that mode_t uses the
5671 traditional octal encoding. E.g. "chmod 1 FOO" should set
5672 the other-execute bit of FOO even if S_IXOTH != 1.
5674 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
5675 WOTH, XOTH, ALLM): New macros.
5676 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
5677 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
5679 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
5680 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
5682 No need to use uintmax_t; unsigned long is long enough.
5683 Don't bother to get suffix since we don't use it.
5685 2000-12-24 Jim Meyering <meyering@lucent.com>
5687 * hash.c (is_prime): Return explicit boolean values.
5688 (hash_get_first): Return NULL to appease Irix5.6's 89.
5689 Reported by Nelson Beebe.
5691 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5693 * localcharset.c (locale_charset): Add support for Win32.
5695 2000-12-18 Paul Eggert <eggert@twinsun.com>
5697 * physmem.h, physmem.c: New files.
5699 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
5700 (noinst_HEADERS): Add physmem.h.
5702 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
5703 't' for compatibility with Solaris 8 sort.
5705 2000-12-18 Bruno Haible <haible@clisp.cons.org>
5707 * config.charset: Add support for BeOS.
5709 2000-12-16 Jim Meyering <meyering@lucent.com>
5711 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
5712 SHELLS_FILE to a file name that's useful on djgpp systems.
5714 (ADDITIONAL_DEFAULT_SHELLS): Define.
5715 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
5716 Based mostly on a patch from Prashant TR.
5718 2000-12-16 Jim Meyering <meyering@lucent.com>
5720 This bug had a serious impact on chown: `chown N:M FILE' (for integer
5721 N and M) would have treated it like `chown N:N FILE'.
5723 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
5725 2000-10-31 Bruno Haible <haible@clisp.cons.org>
5727 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
5728 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
5729 to the list of canonical encodings. Rename EUC-CN to GB2312.
5731 2000-12-08 Andreas Schwab <schwab@suse.de>
5733 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
5734 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
5736 2000-12-07 Jim Meyering <meyering@lucent.com>
5738 * stripslash.c (ISSLASH): Define.
5739 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
5742 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
5743 (dir_name_r): Declare this function as static.
5744 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
5745 manifest itself on a name containing a mix of slashes and
5747 Make this function work with names starting with a DOS-style
5748 drive letter and colon prefix.
5749 (dir_name): Append `.' if necessary.
5750 Based mostly on patches from Prashant TR and Eli Zaretskii.
5752 * dirname.h (dir_name_r): Remove prototype.
5754 2000-12-05 Jim Meyering <meyering@lucent.com>
5756 * dirname.c (dir_name_r): Add `const' in a few local declarations.
5758 2000-12-04 Jim Meyering <meyering@lucent.com>
5760 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
5761 Also include memory.h, stdlib.h, unistd.h if appropriate.
5762 Reported by Andreas Jaeger (conflicting declaration of malloc).
5764 2000-12-02 Jim Meyering <meyering@lucent.com>
5766 * closeout.h: Make idempotent, to avoid some obscure warnings.
5768 2000-12-01 Paul Eggert <eggert@twinsun.com>
5770 * memrchr.c: Include <config.h> before any system include file.
5772 2000-11-29 Paul Eggert <eggert@twinsun.com>
5774 * dirname.c (dir_name_r): Fix typo: int -> size_t.
5776 2000-11-26 Jim Meyering <meyering@lucent.com>
5778 * memcoll.c: Include sys/types.h. From Werner Almesberger.
5780 2000-11-22 Paul Eggert <eggert@twinsun.com>
5782 * strftime.c (my_strftime): Do not invoke mbrlen with a
5783 size of (size_t) -1; it's not portable.
5785 2000-11-17 Akim Demaille <akim@epita.fr>
5787 * obstack.h: Formatting changes.
5788 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
5789 prevent type checking.
5790 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
5791 cast the value to (void *): assigning a `foo *' to a `void *'
5793 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
5795 2000-11-17 Jim Meyering <meyering@lucent.com>
5797 * strstr.c: Update from GNU libc.
5799 2000-11-16 Jim Meyering <meyering@lucent.com>
5801 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
5803 2000-11-11 Jim Meyering <meyering@lucent.com>
5805 * error.c: Add a couple #includes, merging from GNU libc version.
5807 2000-11-10 Jim Meyering <meyering@lucent.com>
5809 * obstack.h: Update from GNU libc.
5810 * obstack.c: Likewise.
5812 2000-11-06 Paul Eggert <eggert@twinsun.com>
5814 * getusershell.c (setusershell): Use rewind rather than
5815 fseek/fseeko, to avoid configuration hassles with fseeko.
5816 Don't bother opening SHELLS_FILE if shellstream is NULL;
5819 2000-11-05 Jim Meyering <meyering@lucent.com>
5821 * makepath.h (make_dir): Declare.
5822 * makepath.c (make_dir): Remove `static' attribute.
5825 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
5827 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
5828 last one in a bucket, advance to the next bucket.
5830 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
5832 * fnmatch.c: Do not comment out all the code if we are using
5833 the GNU C library, because in some cases we are replacing buggy
5834 code in the GNU C library itself.
5836 2000-10-30 Paul Eggert <eggert@twinsun.com>
5838 * error.h, getline.h, modechange.h:
5839 Remove "2000" from Copyright line, as the file hasn't been
5840 changed this year other than in the copyright notice.
5842 * xalloc.h: Add "2000" to Copyright line, as this file
5843 was changed this year.
5845 2000-10-30 Paul Eggert <eggert@twinsun.com>
5847 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
5848 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
5849 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
5851 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
5853 * regex.h (__restrict_arr): Move definition out of #ifndef block.
5854 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
5855 doesn't define __restrict_arr.
5857 2000-10-29 Jim Meyering <meyering@lucent.com>
5859 * xstat.in: Fix grammar in comment.
5861 2000-10-28 Jim Meyering <meyering@lucent.com>
5863 * memchr.c: Update from libc.
5864 Adjust for portability:
5865 [HAVE_STDLIB_H]: Include stdlib.h.
5866 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
5867 Undef __memchr, too.
5868 [!weak_alias]: Define __memchr to memchr.
5870 * regex.c: Update from libc.
5871 * regex.h: Likewise.
5872 * getopt1.c: Likewise.
5873 * memcmp.c: Likewise.
5875 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
5876 Avoid using fseek, when possible -- it's broken by design.
5877 Patch by Ulrich Drepper.
5879 2000-10-26 Jim Meyering <meyering@lucent.com>
5881 * strftime.c: Update from libc.
5883 2000-10-25 Jim Meyering <meyering@lucent.com>
5885 * obstack.c: Update from libc.
5887 2000-10-23 Jim Meyering <meyering@lucent.com>
5889 * hard-locale.c (hard_locale): Revert last change -- it was simply
5890 wrong. That set_locale call must not have any side effects.
5893 2000-10-22 Jim Meyering <meyering@lucent.com>
5895 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
5896 [CYCLIC]: Remove now-unused definition.
5898 * save-cwd.c (O_DIRECTORY): Define, if needed.
5899 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
5900 Suggestion from Ulrich Drepper.
5902 2000-10-21 Jim Meyering <meyering@lucent.com>
5904 * dirname.c (dir_name_r): New function, factored out of dir_name.
5905 (dir_name): Use dir_name_r.
5906 * dirname.h (dir_name_r): Declare it.
5908 2000-10-21 Jim Meyering <meyering@lucent.com>
5910 * dirname.c (memrchr): Declare if necessary.
5911 (dir_name): Remove the restriction that there be no
5912 trailing slashes. Now, this code skips past them, effectively
5914 [TEST_DIRNAME] (main): New unit tests.
5916 * memrchr.c: New file from GNU libc.
5917 Undef __memrchr, too.
5918 [!weak_alias]: Define __memrchr to memrchr.
5919 Guard weak_alias use with `#ifdef weak_alias'.
5921 2000-10-17 Jim Meyering <meyering@lucent.com>
5923 * quote.h (PARAMS): Define and use.
5924 Reported by Akim Demaille.
5926 * getopt.c: Update from libc.
5928 2000-10-16 Jim Meyering <meyering@lucent.com>
5930 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
5933 2000-09-25 Jim Meyering <meyering@lucent.com>
5935 * md5.h (rol): Define (from GnuPG).
5937 * sha.c: Give credit (GnuPG) where due.
5938 (M): Use rol rather than open-coding it.
5939 Add a FIXME comment.
5941 2000-09-21 Jim Meyering <meyering@lucent.com>
5943 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
5944 Reported by Michael Stone.
5946 2000-09-20 Jim Meyering <meyering@lucent.com>
5948 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
5949 (noinst_HEADERS): Add sha.h.
5950 Based on code from Scott G. Miller and from GnuPG.
5952 2000-09-15 Jim Meyering <meyering@lucent.com>
5954 * regex.c: Update from libc.
5956 2000-09-10 Jim Meyering <meyering@lucent.com>
5958 * getopt.c (_getopt_internal): Update from glibc.
5960 2000-09-09 Jim Meyering <meyering@lucent.com>
5962 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
5963 think it should be used as a general replacement for isascii.
5964 * fnmatch.c: Likewise.
5965 * mbswidth.c: Likewise
5966 * regex.c: Likewise.
5969 * userspec.c: Include sys/param.h and limits.h.
5971 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
5972 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
5973 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
5974 UID, GID. Check range.
5976 2000-09-06 Jim Meyering <meyering@lucent.com>
5978 * getopt.c (_getopt_internal): Update from glibc.
5980 2000-08-30 Jim Meyering <meyering@lucent.com>
5982 * strftime.c: Merge in changes from GNU libc.
5984 2000-08-26 Jim Meyering <meyering@lucent.com>
5986 * closeout.c: Include "__fpending.h".
5987 (close_stdout_status): Return right away if there's nothing to flush.
5989 * Makefile.am (noinst_HEADERS): Add __fpending.h.
5990 * __fpending.c: New file.
5991 * __fpending.h: New file.
5993 2000-08-07 Paul Eggert <eggert@twinsun.com>
5995 Standardize on "memory exhausted" instead of "Memory exhausted"
5996 or "virtual memory exhausted".
5997 * obstack.c (print_and_abort): Use "memory exhausted", not
5998 "virtual memory exhausted".
5999 * same.c (same_name): Invoke xalloc_die instead of printing
6001 * userspec.c (parse_user_spec): Likewise.
6002 * bumpalloc.h: comment fix
6003 * same.c, userspec.c: Include xalloc.h.
6005 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
6006 not char *const and pointing to a constant array.
6007 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
6008 (xrealloc): Comment fix.
6010 * userspec.c (parse_user_spec):
6011 Don't translate a message until just before returning,
6012 to avoid unnecessary translation.
6014 2000-08-07 Jim Meyering <meyering@lucent.com>
6016 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
6017 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
6018 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
6019 getgroups.c, gethostname.c, getopt.h, group-member.c,
6020 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
6021 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
6022 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
6023 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
6024 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
6025 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
6026 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
6027 yesno.c: Back out Copyright date changes for each file with no change
6028 this year. This eases coordination with other programs using the same
6029 source code modules. From Paul Eggert.
6031 2000-08-03 Greg McGary <greg@mcgary.org>
6033 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
6034 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
6035 (EXTEND_BUFFER): Use them.
6037 2000-08-01 Jim Meyering <meyering@lucent.com>
6039 * dirname.c (ISSLASH): Define.
6040 (BACKSLASH_IS_PATH_SEPARATOR): Define.
6041 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
6042 both `\' and `/' may be use as path separators.
6043 Based on a patch from Prashant TR.
6045 2000-07-31 Paul Eggert <eggert@twinsun.com>
6047 * quotearg.c (quotearg_n_options): Don't make the initial
6048 slot vector a constant, since it might get modified.
6050 2000-07-31 Jim Meyering <meyering@lucent.com>
6052 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
6053 * obstack.c (print_and_abort): Likewise.
6055 2000-07-30 Paul Eggert <eggert@twinsun.com>
6057 * quotearg.c (quotearg_n_options): Preallocate a slot 0
6058 buffer, so that the caller can always quote one small
6059 component of a "memory exhausted" message in slot 0.
6060 From a suggestion by Jim Meyering.
6062 2000-07-30 Jim Meyering <meyering@lucent.com>
6064 * makepath.c (make_path): Quote the other instance, too.
6066 * quotearg.c (N_STATIC_SLOTVECS): Define.
6067 (STATIC_BUF_SIZE): Define.
6068 (quotearg_n_options): Use only statically allocated storage when
6069 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
6070 than STATIC_BUF_SIZE.
6072 2000-07-29 Jim Meyering <meyering@lucent.com>
6074 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
6075 * dirname.c (dir_name): Likewise.
6077 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
6079 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
6080 (dir_name): Assert that there are no trailing slashes.
6082 2000-07-18 Bruno Haible <haible@clisp.cons.org>
6084 * mbswidth.h (mbswidth): Add a flags argument.
6085 (mbswidth): New declaration.
6086 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
6087 * mbswidth.c (mbswidth): Add a flags argument.
6088 (mbsnwidth): New function.
6090 2000-07-24 Jim Meyering <meyering@lucent.com>
6092 * mbswidth.c: Remove useless #else. From Bruno Haible.
6094 2000-07-23 Paul Eggert <eggert@twinsun.com>
6096 * mbswidth.c (_XOPEN_SOURCE):
6097 Don't define; this causes problems on Solaris 7.
6098 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
6100 2000-07-23 Paul Eggert <eggert@twinsun.com>
6103 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
6104 so that mbstate_t is always defined.
6106 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
6107 be 1 in at least one GCC installation, and this configuration
6108 error is likely to be common. Ignoring MB_LEN_MAX hurts
6109 performance on hosts that have mbrtowc but have only unibyte
6110 locales, but I assume these hosts are rare.
6112 2000-07-23 Paul Eggert <eggert@twinsun.com>
6114 * quotearg.c: Streamline by invoking multibyte code only if needed.
6115 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
6116 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
6117 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
6118 invoke multibyte primitives.
6120 2000-07-23 Jim Meyering <meyering@lucent.com>
6122 * basename.c (base_name): Add an assertion.
6124 2000-07-15 Bruno Haible <clisp.cons.org>
6126 * quotearg.c: When the system forces us to redefine mbstate_t,
6127 shadow its mbsinit function.
6129 2000-07-16 Bruno Haible <haible@clisp.cons.org>
6131 * mbswidth.h: New file.
6132 * mbswidth.c: New file.
6133 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
6134 (noinst_HEADERS): Add mbswidth.h.
6136 2000-07-17 Bruno Haible <haible@clisp.cons.org>
6138 * config.charset: Add support for FreeBSD. Improve support for HP-UX
6141 2000-07-15 Jim Meyering <meyering@lucent.com>
6143 * makepath.c: Include quote.h.
6144 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
6145 corresponding argument in a `quote (...)' call.
6146 Give better diagnostics.
6148 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
6149 (noinst_HEADERS): Add quote.h.
6151 * quote.c (quote, quote_n): New file. Two functions taken verbatim
6152 from tar's src/misc.c.
6153 * quote.h: New file. Prototypes for same.
6155 2000-07-10 Paul Eggert <eggert@twinsun.com>
6157 From a suggestion by Bruno Haible.
6158 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
6159 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
6160 to decide whether to define the BeOS workaround macro;
6161 this adjusts to the change to AC_MBSTATE_T.
6163 2000-07-13 Paul Eggert <eggert@twinsun.com>
6165 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
6167 * quotearg.c (quoting_style_args, quoting_style_vals,
6168 quotearg_buffer_restyled): Add support for
6169 clocale_quoting_style. Undo previous change to
6170 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
6171 and "{RIGHT QUOTATION MARK}" msgids.
6173 2000-07-05 Paul Eggert <eggert@twinsun.com>
6175 The old behavior of quoting `like this' doesn't look good with
6176 newer, ISO-style fonts. See:
6177 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
6179 Instead, quote "like this" by default. Let the translator
6180 tailor the locale-specific quoting behavior by providing
6181 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
6183 * quotearg.c (N_): New macro.
6184 (gettext_default): New function.
6185 (quotearg_buffer_restyled): Use
6186 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
6187 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
6189 2000-07-09 Jim Meyering <meyering@lucent.com>
6191 * Most files: Update copyright dates to include 2000.
6193 2000-07-08 Jim Meyering <meyering@lucent.com>
6195 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
6197 (xgethostname): Remove now-unnecessary #ifdef.
6198 Move declaration of `err' into loop where it's used.
6200 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6202 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
6203 by allocating a larger buffer. Test the gethostname return value for
6204 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
6205 returns an error and ENAMETOOLONG isn't defined.
6207 2000-07-05 Paul Eggert <eggert@twinsun.com>
6208 and Bruno Haible <haible@clisp.cons.org>
6210 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
6212 2000-07-05 Bruno Haible <haible@clisp.cons.org>
6214 * quotearg.c (struct quoting_options): Simplify quote_these_too
6217 2000-07-03 Jim Meyering <meyering@lucent.com>
6219 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
6220 Reported by Bruno Haible.
6222 2000-07-04 Jim Meyering <meyering@lucent.com>
6224 * quotearg.c: Make inclusion of <wchar.h> independent of whether
6225 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
6228 2000-07-03 Paul Eggert <eggert@twinsun.com>
6229 and Bruno Haible <haible@clisp.cons.org>
6231 * quotearg.c (mbrtowc):
6232 Assign to *pwc, and return 1 only if result is nonzero.
6233 (iswprint): Use ISPRINT when substituting our own mbrtowc.
6235 2000-07-03 Jim Meyering <meyering@lucent.com>
6237 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
6238 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
6241 2000-07-02 Jim Meyering <meyering@lucent.com>
6243 * quotearg.c (mbstate_t): Don't define here.
6245 2000-07-02 Jim Meyering <meyering@lucent.com>
6247 * nanosleep.c (SIGCONT): Define if not already defined.
6249 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6251 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
6252 per change in ../m4/ls-mntd-fs.m4.
6253 (read_filesystem_list): Ignore symbolic links.
6255 2000-06-29 Jim Meyering <meyering@lucent.com>
6257 * same.c: Include <string.h> or <strings.h>, as appropriate,
6258 for declaration of strcmp.
6260 * long-options.c: Include <stdlib.h>, for declaration of exit.
6262 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
6263 Avoid warning by casting result to `char *' to remove `const'.
6265 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6267 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
6269 2000-06-26 Paul Eggert <eggert@twinsun.com>
6271 savedir now sets errno on failure and invokes xmalloc to get memory.
6272 Fix a couple of other minor bugs while we're at it.
6274 * savedir.c (<unistd.h>): Do not include; there's no need.
6275 (NAMLEN): Remove macro.
6276 (malloc, realloc): Remove decls.
6278 ("xalloc.h"): Include.
6279 (NAME_SIZE_DEFAULT): New macro.
6280 (savedir): Use xmalloc / xrealloc to allocate memory.
6281 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
6282 Skip "" directory entries.
6283 Use strlen to calculate directory entry length, since the old method
6284 is rarely used these days and isn't worth supporting.
6285 Don't use a pointer after freeing it.
6286 Check for integer overflow when calculating allocation size.
6287 Use memcpy to copy entries, instead of stpcpy.
6288 Set errno properly when returning NULL.
6289 Check for readdir error.
6291 2000-06-26 Jim Meyering <meyering@lucent.com>
6293 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
6295 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6297 * getusershell.c (xmalloc, xrealloc): Remove functions.
6299 Don't include <stdlib.h>. Don't declare malloc, realloc.
6301 2000-06-23 Bruno Haible <haible@clisp.cons.org>
6303 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
6305 2000-06-24 Jim Meyering <meyering@lucent.com>
6307 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
6309 2000-06-21 Jim Meyering <meyering@lucent.com>
6311 * getpass.c: New file, from Bruno Haible. Required for BeOS.
6313 2000-06-19 Paul Eggert <eggert@twinsun.com>
6315 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
6316 (mbrtowc, mbstate_t): Define substitutes if
6317 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
6318 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
6319 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
6321 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6323 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
6324 than 1024, return a memory chunk of least possible size, instead
6325 of size PATH_MAX + 2. In the loop, increment the size proportionally.
6326 Use free/xmalloc instead of xrealloc to avoid copying for very long
6329 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6331 * canon-host.c (canon_host): Use malloc and memcpy to copy an
6332 address, not strdup. Include <stdlib.h> and don't declare free().
6334 2000-06-17 Bruno Haible <haible@clisp.cons.org>
6336 * path-concat.c (path_concat): Don't access dir[-1] if dir is
6339 2000-06-21 Jim Meyering <meyering@lucent.com>
6341 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
6342 (noinst_HEADERS): Add getstr.h.
6344 * getline.c (getstr): Move into a separate file.
6345 * getstr.c (getstr): New file, extracted from getline.c, with
6346 the following changes: new parameter, delim2; both delim[12]
6347 parameters have type `int', not `char'. The latter would lose
6348 with 8-bit delimiters.
6349 * getstr.h: New file.
6351 2000-06-19 Jim Meyering <meyering@lucent.com>
6353 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
6355 2000-06-18 Jim Meyering <meyering@lucent.com>
6357 * mkdir.c: Remove file, due mainly to copyright incompatibility.
6358 Besides, these days every porting target provides a mkdir function.
6360 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
6361 (this snippet comes from src/system.h).
6363 2000-06-15 Paul Eggert <eggert@twinsun.com>
6365 * human.c (adjust_value): New function.
6366 (human_readable_inexact): Apply rounding style even when
6367 printing approximate values.
6369 2000-06-14 Paul Eggert <eggert@twinsun.com>
6371 * human.c (human_readable_inexact): Allow an input block
6372 size that is not a multiple of the output block size, and vice versa.
6373 Reported by Piergiorgio Sartor.
6375 2000-06-14 Paul Eggert <eggert@twinsun.com>
6377 * getdate.y (get_date): Apply relative times after time
6378 zone indicator, not before. Reported by Todd A. Jacobs.
6380 2000-06-13 Jim Meyering <meyering@lucent.com>
6382 * Makefile.am (all-local): Depend on lstat.c and stat.c.
6384 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
6386 2000-06-12 Paul Eggert <eggert@twinsun.com>
6388 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
6390 2000-06-04 Paul Eggert <eggert@twinsun.com>
6392 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
6394 2000-06-04 Jim Meyering <meyering@lucent.com>
6396 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
6397 SunOS 4.1.4 for which gid_t is an unsigned type.
6399 2000-06-03 Jim Meyering <meyering@lucent.com>
6401 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
6403 2000-05-26 Bruno Haible <haible@clisp.cons.org>
6405 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
6406 newer, don't install charset.alias.
6407 * config.charset: Change the Linux/glibc rules so they become empty
6408 on glibc-2.1 or newer.
6410 2000-06-02 Jim Meyering <meyering@lucent.com>
6412 * mountlist.c: Back out last change. Instead, do this...
6413 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
6414 member using the same `ignore'-testing code.
6415 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
6419 2000-05-29 Jim Meyering <meyering@lucent.com>
6421 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
6422 with the `ignore' attribute. Based on a patch from Mark D. Roth.
6424 2000-05-22 Jim Meyering <meyering@lucent.com>
6426 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
6428 2000-05-18 Jim Meyering <meyering@lucent.com>
6430 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
6431 back, too, since it may have been modified by allocate_entry.
6432 (hash_delete): Rewrite to use neither the assignment operator
6433 nor the comma operator in an if-expression.
6435 2000-05-15 Paul Eggert <eggert@twinsun.com>
6438 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
6439 Remove; no longer needed.
6440 "quotearg.h": Add include.
6441 (file_name): Do not bother to explicitly initialize to NULL; it's less
6442 efficient on some hosts.
6443 (close_stdout_status): Remove test as to whether stdout was already
6444 closed; it breaks for the case "echo x | sort >&-".
6445 Quote file name colons.
6446 Do not assume that _("write error") lacks format strings.
6448 2000-05-15 Jim Meyering <meyering@lucent.com>
6450 * version-etc.c (version_etc_copyright): Update the copyright string
6451 used in all --version output.
6453 2000-05-14 Jim Meyering <meyering@lucent.com>
6455 * closeout.c (close_stdout_set_file_name): New function.
6456 (close_stdout_status): Use new file-scoped global.
6457 Return right away if fstat says the stdout file descriptor is invalid.
6458 * closeout.h (close_stdout_set_file_name): Declare.
6460 2000-05-10 Jim Meyering <meyering@lucent.com>
6462 * closeout.c [default_exit_status]: New file-scoped variable.
6463 (close_stdout_set_status): New function.
6464 * closeout.h (close_stdout_set_status): Declare.
6466 2000-05-08 Jim Meyering <meyering@lucent.com>
6468 * long-options.c: Don't include closeout.h.
6469 (parse_long_options): Don't call close_stdout for --version.
6471 2000-05-06 Jim Meyering <meyering@lucent.com>
6473 * strnlen.c: Undefine __strnlen and strnlen.
6474 [!weak_alias]: Define __strnlen to strnlen.
6476 * atexit.c: New file, from libiberty.
6478 2000-05-06 Jim Meyering <meyering@lucent.com>
6480 * closeout.c (close_stdout_status): Also check for errors on the
6483 2000-05-05 Bruno Haible <haible@clisp.cons.org>
6485 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
6486 instead of xmalloc, xrealloc, path_concat.
6487 (locale_charset): Treat empty environment variables as absent.
6488 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
6490 2000-05-04 Jim Meyering <meyering@lucent.com>
6492 * getopt.c: Update from glibc.
6493 * obstack.c: Likewise.
6494 * obstack.h: Likewise.
6495 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
6497 * regex.h: Likewise.
6498 * strndup.c: Likewise.
6499 * strnlen.c: New file, from glibc.
6501 2000-05-01 Jim Meyering <meyering@lucent.com>
6503 * full-write.c (full_write): Remove `FIXME' part of comment.
6505 2000-04-29 Jim Meyering <meyering@lucent.com>
6507 * path-concat.c: Declare strdup only if it's not defined.
6508 * canon-host.c: Likewise.
6510 2000-04-28 Jim Meyering <meyering@lucent.com>
6512 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
6513 redefinition warning on some systems (HPUX). Otherwise, regex.h is
6514 included first, then limits.h is included by locale.h by libintl.h.
6515 From John David Anglin.
6517 2000-04-25 Jim Meyering <meyering@lucent.com>
6519 * makepath.c (S_IRWXUGO): Define.
6520 (make_path): Always perform explicit chmod if MODE specifies any
6521 of the `special' permission bits. Prompted by a bug report against
6522 install from Mate Wierdl and Joost van Baal.
6524 2000-04-18 Jim Meyering <meyering@lucent.com>
6528 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
6529 getpagesize. For BeOS. Based on a patch from Bruno Haible.
6531 2000-04-17 Jim Meyering <meyering@lucent.com>
6533 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6534 the definition of it to rpl_strftime also defined-away the system's
6537 2000-04-15 Jim Meyering <meyering@lucent.com>
6539 Use `C' to denote so-called `contiguous' files, the same way
6541 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6542 (ftypelet): Use S_ISCTG.
6543 From Michael Deutschmann.
6545 2000-04-14 Jim Meyering <meyering@lucent.com>
6547 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6549 2000-04-08 Jim Meyering <meyering@lucent.com>
6551 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6552 names don't conflict. Reported by Eli Zaretskii.
6554 2000-03-28 Bruno Haible <haible@clisp.cons.org>
6556 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6557 bug. Deal with the different error behavior of Irix iconv.
6559 2000-04-07 Jim Meyering <meyering@lucent.com>
6561 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6562 to work around system header problems on AIX 3.2.5. From Bruno Haible.
6564 2000-04-05 Jim Meyering <meyering@lucent.com>
6566 Portability tweaks required for ultrix4.3.
6567 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6568 * readutmp.c: Include sys/types.h before sys/stat.h.
6569 * canon-host.c: Declare strdup.
6570 * path-concat.c: Likewise.
6571 From John David Anglin.
6573 2000-04-04 Jim Meyering <meyering@lucent.com>
6575 Be more DOS 8.3-friendly.
6576 * ref-add.sin: Renamed from ref-add.sed.in.
6577 * ref-del.sin: Renamed from ref-del.sed.in.
6578 * Makefile.am: Reflect renaming.
6579 Reported by Eli Zaretskii.
6581 Use a temporary file name that won't clash with `charset.alias'
6582 in the DOS 8.3 name space.
6583 * Makefile.am (charset_tmp): Define.
6584 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
6585 (uninstall-local): Likewise.
6586 Reported by Eli Zaretskii.
6588 2000-03-29 Paul Eggert <eggert@twinsun.com>
6590 * time/strftime.c (my_strftime): Make sure we call the system
6591 strftime, not ourselves, when invoking the underlying strftime.
6593 2000-03-24 Jim Meyering <meyering@lucent.com>
6595 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
6596 (charset_alias): Define.
6597 (install-exec-local): Factor out common code.
6598 (uninstall-local): Split lines longer than 80.
6599 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
6601 (.sed.in.sed): New rule. Don't redirect directly to $@.
6602 (CLEANFILES): Add ref-add.sed and ref-del.sed.
6604 2000-03-19 Bruno Haible <haible@clisp.cons.org>
6606 * config.charset: Output a line containing "Packages using this file".
6607 * ref-add.sed.in, ref-del.sed.in: New files.
6608 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
6609 ref-del.sed): New rules.
6611 2000-03-17 Jim Meyering <meyering@lucent.com>
6613 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
6614 Otherwise, include <strings.h>
6616 2000-03-17 Bruno Haible <haible@clisp.cons.org>
6618 * unicodeio.c (utf8_wctomb): New function.
6619 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
6620 format instead of in UCS-4 with platform dependent endianness.
6622 2000-03-07 Paul Eggert <eggert@twinsun.com>
6624 * savedir.c (savedir): Work even if directory size is
6625 negative; this can happen with some screwy NFS configurations.
6627 2000-03-06 Jim Meyering <meyering@lucent.com>
6629 * localcharset.c (get_charset_aliases): Don't try to free file_name
6630 if it's NULL (because we ran out of memory). From Bruno Haible.
6632 2000-03-05 Jim Meyering <meyering@lucent.com>
6634 * localcharset.c ("path-concat.h"): Include.
6635 (get_charset_aliases): Use path_concat instead of ANSI string
6638 * unicodeio.h (PARAMS): Define.
6639 Use it to guard prototype.
6641 2000-03-04 Jim Meyering <meyering@lucent.com>
6643 * Makefile.am (install-exec-local): Create $(libdir) before installing
6645 (uninstall-local): Uncomment this rule so `make distcheck' works
6648 * unicodeio.c (<errno.h>): Include it.
6649 (errno): Declare if not defined.
6651 * localcharset.c: Add Bruno's comment justifying use of volatile.
6653 * config.charset: New version, incorporating remarks from a linux
6654 i18n mailing list. From Bruno Haible.
6656 2000-03-02 Jim Meyering <meyering@lucent.com>
6658 * Makefile.am (EXTRA_DIST): Add config.charset.
6660 2000-03-01 Jim Meyering <meyering@lucent.com>
6662 * localcharset.c: Guard some #includes with `#if HAVE_...'.
6663 * unicodeio.c: Likewise.
6665 2000-02-02 Bruno Haible <haible@clisp.cons.org>
6667 * config.charset: New file.
6668 * localcharset.c: New file.
6669 * unicodeio.h, unicodeio.c: New files.
6670 * Makefile.am (DEFS): Add -DLIBDIR=...
6671 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
6672 (noinst_HEADERS): Add unicodeio.h.
6673 (all-local, install-exec-local, charset.alias): New targets.
6675 2000-02-28 Paul Eggert <eggert@twinsun.com>
6677 * quotearg.c (ALERT_CHAR): New macro.
6678 (quotearg_buffer_restyled): Use it.
6680 2000-02-27 Jim Meyering <meyering@lucent.com>
6682 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
6683 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
6685 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
6686 not `#if STDC_HEADERS'.
6687 Declare malloc if needed.
6689 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
6690 now that autoconf always defines the HAVE_DECL_ symbols.
6691 * human.c: Likewise.
6693 * strtoumax.c: Likewise.
6695 * backupfile.c: Arrange for cpp to fail if the configure-time
6696 declaration check was not run.
6698 * human.c: Likewise.
6700 * strtoumax.c: Likewise.
6702 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
6703 then first look up the entire `.'-containing string as a login name.
6705 2000-02-18 Paul Eggert <eggert@twinsun.com>
6707 * getdate.y: Handle two-digit years with leading zeros correctly.
6708 (textint): New typedef.
6709 (parser_control): Member year changed from int to textint.
6711 (YYSTYPE): Removed; replaced by %union with int and textint members.
6712 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
6713 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
6714 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
6715 (tSNUMBER, tUNUMBER): Now of type <textintval>.
6716 (date, number, to_year): Use width of number in digits, not its value,
6717 to determine whether it's a 2-digit year, or a 2-digit time.
6718 (yylex): Store number of digits of numeric tokens.
6719 Reported by John Kendall.
6721 (parser_control): Changed from struct parser_control to typedef (for
6722 consistency). All uses changed.
6724 (tID): Removed; not used.
6725 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
6727 2000-02-14 Paul Eggert <eggert@twinsun.com>
6729 * getpagesize.h (getpagesize): Port to VMS for Alpha;
6730 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
6732 2000-02-12 Jim Meyering <meyering@lucent.com>
6734 * userspec.c (ISDIGIT): Define it.
6735 (isdigit): Remove definition.
6736 (is_number): Use ISDIGIT, not isdigit.
6737 <libintl.h>: Include.
6739 (parse_user_spec): Mark translatable strings.
6741 2000-02-10 Jim Meyering <meyering@lucent.com>
6743 With these changes, nanosleep.[ch] are finally enough like the other
6744 lib/* replacement files to compile on a few more losing systems.
6746 * nanosleep.h: Don't include config.h.
6747 Remove prototype from declaration of nanosleep.
6748 (PARAMS): Remove now-unneeded definition.
6749 * nanosleep.c: #undef nanosleep.
6750 (rpl_nanosleep): Rename from nanosleep.
6752 2000-02-03 Jim Meyering <meyering@lucent.com>
6754 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
6755 rather than with `#if HAVE_UTMPNAME'.
6757 2000-02-01 Jim Meyering <meyering@lucent.com>
6759 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
6761 2000-01-31 Jim Meyering <meyering@lucent.com>
6763 * nanosleep.h (nanosleep): Guard declaration with
6764 `#if ! HAVE_DECL_NANOSLEEP'.
6765 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
6766 the declaration in that vendor's sys/timers.h.
6767 Reported by Christian Krackowizer.
6769 * quotearg.c (ISASCII): Add #undef and move definition to follow
6770 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
6771 (ISPRINT): Likewise.
6772 Reported by Tom Tromey.
6774 2000-01-30 Jim Meyering <meyering@lucent.com>
6776 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
6777 uses of ->ut_name. The latter doesn't work with new Linux header files
6778 where only utmpx.ut_user is declared.
6780 * readutmp.h (UT_USER): Define.
6782 2000-01-23 Jim Meyering <meyering@lucent.com>
6784 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
6787 2000-01-22 Jim Meyering <meyering@lucent.com>
6789 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
6790 [! HAVE_DECL_STRTOULL]: Declare strtoull.
6791 Required for some AIX systems. Reported by Christian Krackowizer.
6792 [TESTING] (main): New function.
6794 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
6795 * dirname.c (dir_name): Support for DOS-style file names with drive
6798 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
6800 * strverscmp.c (ISDIGIT): Define.
6801 (strverscmp): Use ISDIGIT, not isdigit.
6803 2000-01-17 Paul Eggert <eggert@twinsun.com>
6805 * nanosleep.c (nanosleep):
6806 Don't use SA_INTERRUPT to decide whether to call sigaction, as
6807 POSIX.1 doesn't require SA_INTERRUPT and some systems
6808 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
6809 it's been part of POSIX.1 since day 1 (in 1988).
6811 2000-01-17 Jim Meyering <meyering@lucent.com>
6813 * interlock: Remove unused file. Reported by François Pinard.
6815 2000-01-16 Paul Eggert <eggert@twinsun.com>
6817 * quotearg.c (quotearg_buffer_restyled): Do not quote
6818 alert, backslash, formfeed, and vertical tab unnecessarily in
6819 shell quoting style.
6822 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
6823 Free Software Foundation, Inc.
6824 Copying and distribution of this file, with or without modification,
6825 are permitted provided the copyright notice and this notice are preserved.