1 2003-07-18 Andreas Schwab <schwab@suse.de>
3 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
5 2003-07-18 Bruno Haible <bruno@clisp.org>
7 * getndelim2.h: New file.
8 * getndelim2.c: Make into a module of its own. Include config.h,
10 (getndelim2): Make non-static. Change return type to ssize_t.
11 * getline.h: Change argument names.
12 * getline.c: Include getndelim2.h instead of getndelim2.c.
13 * getnline.c: Include getndelim2.h.
15 2003-07-17 Bruno Haible <bruno@clisp.org>
17 * Makefile.am: Remove file.
18 * Makefile.in: Remove file.
20 2003-07-17 Bruno Haible <bruno@clisp.org>
22 * getnline.h: New file.
23 * getnline.c: New file.
24 * getndelim2.c: New file, extracted from getline.c.
25 (getndelim2): Renamed from getdelim2, with added nmax argument.
26 * getline.c: Include getndelim2.c.
27 (getdelim2): Moved out to getndelim2.c.
28 (getline, getdelim): Update.
30 2003-07-15 <karl@gnu.org>
32 * vasnprintf.c: update from gettext.
34 2003-07-15 Jim Meyering <jim@meyering.net>
36 * makepath.c (make_path): Enclose diagnostic in _(...).
38 2003-07-14 Paul Eggert <eggert@twinsun.com>
40 * asnprintf.c, asprintf.c, config.charset, gettext.h,
41 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
42 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
43 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
44 vasprintf.c, vasprintf.h: Regenerate. These files are now being
45 updated automatically by ../config/srclist-update. This changes
46 their license from LPGL to GPL.
48 2003-07-14 Jim Meyering <jim@meyering.net>
50 Don't emit diagnostics. Let callers do that.
51 * save-cwd.c: Don't include "error.h".
52 (save_cwd): Don't call error. Ensure that errno is valid
53 when returning nonzero.
55 * save-cwd.h (restore_cwd): Update prototype.
56 * save-cwd.c (restore_cwd): Remove two parameters.
57 Simplify. Don't call error upon failure. Let callers do that.
58 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS4
59 when auditing is enabled. But don't bother updating the #if.
61 2003-07-14 Simon Josefsson <jas@extundo.com>
63 * mempcpy.h: New file.
64 * mempcpy.c: New file.
66 2003-07-14 Paul Eggert <eggert@twinsun.com>
68 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
69 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
70 unicodeio.c, unicodeio.h, unlocked-io.h:
71 Switch from LGPL to GPL.
73 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
75 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
76 it breaks C++ compilation.
77 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
79 2003-07-10 Jim Meyering <jim@meyering.net>
81 * vasnprintf.c: Remove trailing blanks.
82 Make cpp indentation consistent.
84 2003-07-09 Paul Eggert <eggert@twinsun.com>
86 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
87 posixver.c, strftime.c, strnlen.c, strverscmp.c:
88 Switch from LGPL to GPL.
90 2003-07-07 Paul Eggert <eggert@twinsun.com>
92 * mktime.c: Fix some boundary cases and remove need for floating point.
94 Issue a compile-time diagnostic if time_t is floating point, or if
95 two's complement arithmetic is not in effect, or if arithmetic
96 right shift does not propagate the sign. These assumptions were
97 all in the original code but they weren't checked.
99 (TIME_T_MIDPOINT, verify): New macros.
100 (__isleap): Remove; it has integer overflow problems.
101 (leapyear): New function, without those problems.
102 (ydhms_tm_diff): Remove; splitting into two parts.
103 (ydhms_diff): New function, containing the arithmetic part of
104 the old ydhms_tm_diff function. Issue a compile-time
105 diagnostic if we are not using C99 integer division.
106 Avoid casts when possible.
107 (guess_time_tm): New function, containing the checking part of
108 the old ydhms_tm_diff function. Return the new value, rather than
109 the difference between it and the old. Accept a new argument T
110 so that *T specifies the old value. Check for overflow in the result.
112 (__mktime_internal): Use a time_t offset, not a long int offset.
113 This undoes the 2003-06-04 change, which is no longer needed now
114 that we have better overflow checking.
115 (localtime_offset): Likewise.
117 (__mktime_internal): Avoid harmful overflow on hosts where time_t
118 and long are 64-bit but int is only 32-bit.
119 (ydhms_diff): Use long int to store year1 and yday1.
120 Issue a compile-time diagnostic if long int is not wide enough.
122 (__mktime_internal): Use long int to store adjusted year and yday.
123 Use plain C rather than preprocessor commands, if that doesn't
125 Check for overflow (and try to repair) after each probe
126 rather than checking only at the very end. This avoids some bugs
127 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
128 does not equal GMT offset at maximum time).
129 Use integer to check for overflow rather than floating point; this
130 is more portable to non-IEEE hosts, and is a tad faster.
131 When we detect that we are oscillating between two values,
132 don't check whether tm_isdst has the requested value, since
133 we already know the answer. When tm_isdst has the wrong value,
134 use a different heuristic to find the right one, based on the
135 extreme values actually observed in practice in tz2003a,
136 rather than the (overly optimistic) "previous 3 calendar quarters".
138 (not_equal_tm, print_tm, check_result): Use "const T" rather than
139 "T const" to accommodate glibc style.
140 (check_result): Use less-confusing report format. "long" -> "long int.
142 Don't loop if the iteration overflows time_t.
143 Allow a negative step in the iteration.
145 2003-07-01 Paul Eggert <eggert@twinsun.com>
147 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
148 having it depend on HAVE_SYS_TYPES_H.
150 2003-06-25 Bruno Haible <bruno@clisp.org>
152 * readlink.c: New file.
154 2003-06-20 Bruno Haible <bruno@clisp.org>
156 Assume C89, so PARAMS isn't needed.
157 * unicodeio.h (PARAMS): Remove.
158 * unicodeio.c: Don't use PARAMS.
160 2003-06-18 Jim Meyering <jim@meyering.net>
162 Merge changes from coreutils.
163 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
164 Remove explicit declarations of xmalloc and realloc.
166 (read_utmp): Remove anachronistic cast of xmalloc.
168 2003-06-17 Paul Eggert <eggert@twinsun.com>
170 Assume C89, so PARAMS isn't needed.
171 * backupfile.h (PARAMS): Remove. All uses removed.
172 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
173 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
174 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
175 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
176 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
177 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
179 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
180 same.h, strverscmp.h: Do not include config.h; no longer needed.
181 Anyway, config.h should always be included before any other file.
183 2003-06-11 Simon Josefsson <jas@extundo.com>
185 * sysexit_.h: New file.
187 2003-05-20 Derek Price <derek@ximbiot.com>
189 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
191 2003-06-10 Simon Josefsson <jas@extundo.com>
193 * strchrnul.h: New file.
194 * strchrnul.c: New file.
196 2003-06-10 Simon Josefsson <jas@extundo.com>
198 * argp.h: New file, from glibc.
199 * argp-ba.c: New file, from glibc.
200 * argp-eexst.c: New file, from glibc.
201 * argp-fmtstream.c: New file, from glibc.
202 * argp-fmtstream.h: New file, from glibc.
203 * argp-fs-xinl.c: New file, from glibc.
204 * argp-help.c: New file, from glibc.
205 * argp-namefrob.h: New file, from glibc.
206 * argp-parse.c: New file, from glibc.
207 * argp-pv.c: New file, from glibc.
208 * argp-pvh.c: New file, from glibc.
209 * argp-xinl.c: New file, from glibc.
211 2003-06-07 Jim Meyering <jim@meyering.net>
213 * readtokens.h: Put `Free Software Foundation, Inc.'
214 in place of my name in the copyright comment.
215 Remove definition and uses of __P.
218 * stat.c: Don't declare xmalloc explicitly.
219 Instead, include "xalloc.h".
220 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
221 xrealloc, and xcalloc return values.
222 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
224 * xgetcwd.h: Remove definition/uses of PARAMS.
226 2003-06-06 Jim Meyering <jim@meyering.net>
228 * stdbool_.h: Renamed from stdbool.h.in.
230 2003-06-06 Jim Meyering <jim@meyering.net>
232 Merge from coreutils.
233 * same.c: (same_name): Declare *_basename locals to be `const'.
234 Consolidate declarations and initializations of *_base* locals.
236 Merge from coreutils.
237 This avoids a core dump on systems without GNU putenv,
238 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
239 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
240 (unsetenv): New static function, from GNU libc.
241 (rpl_putenv): Use it.
243 * modechange.c: Remove trailing blanks.
245 Merge from coreutils.
246 * fsusage.c: Remove declaration of statfs.
247 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
249 * posixtm.c: Include <stdbool.h> unconditionally.
251 2003-06-05 Paul Eggert <eggert@twinsun.com>
253 * mktime.c (__mktime_internal): When resolving a tm_isdst
254 mismatch, look in future quarters as well as past. This fixes a
255 bug when processing fall-backwards gaps immediately after a long
256 period of daylight-saving time.
258 * mktime.c: Assume freestanding C89 or better.
259 (HAVE_LIMITS_H): Remove. Assume it's 1.
260 (__P): Remove; not used.
261 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
262 (mktime, not_equal_tm, print_tm, check_result,
263 main): Use prototypes. Use const * where appropriate.
264 (main): Fix typo in testing code that uncovered by above changes.
265 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
267 2003-06-04 Paul Eggert <eggert@twinsun.com>
269 * mktime.c: Fix Debian bug 177940
270 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
271 (localtime_offset): Now long int, not time_t, because we want it
272 to be guaranteed to be signed. All uses changed.
273 (__mktime_internal): If overflow would occur when adding offset,
276 Merge 'human' changes from coreutils. Rewrite to support
277 locale-specific notations like thousands separators.
278 * human.c: Simplify authorship notice.
279 Include human.h immediately after config.h.
280 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
281 <limits.h>: Do not include, since human.h does.
282 (SIZE_MAX, UINTMAX_MAX): New macros.
283 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
284 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
285 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
286 (power_letter): Renamed from suffixes.
287 (generate_suffix_backwards): Remove.
288 (adjust_value): Now takes int style (because of human.h changes)
289 and long double value (for greater precision on some platforms).
290 (group_number): New function.
291 (human_readable): Use it. Use integer options, not enum.
292 Put the options before the sizes in the arg list.
293 Support all the new options.
294 The old human_readable function has been removed;
295 use inttostr.h instead.
296 (human_readable, default_block_size, humblock):
297 Use uintmax_t, not int, for block sizes.
298 (human_readable_inexact, block_size_types): Remove.
299 (block_size_opts): New constant.
300 (human_options): Renamed from human_block_size, with new signature
301 that allows block sizes up to UINTMAX_MAX. All callers changed.
302 * human.h: Add copyright and authorship notice.
303 Include <limits.h> and <stdbool.h> unconditionally.
304 (PARAMS): Remove. All uses removed.
305 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
306 (enum human_inexact_style): Remove tag; now a nameless enum.
307 (human_floor, human_ceiling, human_round_to_even): Now have
308 values 2, 0, 1 rather than -1, 1, 0.
309 (human_group_digits, human_suppress_point_zero, human_autoscale,
310 human_base_1024, human_SI, human_B): New constants.
311 (human_readable_inexact, human_block_size): Remove.
312 (human_readable): Size args are now uintmax_t, not int.
313 (human_options): New decl.
315 * exclude.c: (new_exclude, add_exclude): Remove casts that are
316 unnecessary now that we assume C89 or better. This change
317 imported from coreutils.
319 * mktime.c (__mktime_internal): Do not reject negative timestamps
320 arbitrarily. This is the same patch as 2003-05-28, but it got lost
321 in the 2003-05-30 sync from glibc.
323 .h files should stand alone, but we shouldn't include <sys/types.h>
324 if we can get away with just <stddef.h>.
326 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
327 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
328 rather than <sys/types.h>, as we merely need size_t.
329 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
331 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
332 Include <stdio.h>, to get FILE.
333 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
334 memcasecmp.h has included <stddef.h> and all we need is size_t.
335 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
336 our interface, instead of including <sys/types.h>
338 2003-06-02 Paul Eggert <eggert@twinsun.com>
341 Fix some minor time-related bugs with POSIX time arguments.
342 Some valid time stamps were being rejected (notably -1, and
343 time stamps before 1900 on 64-bit hosts). And some invalid
344 time stamps were being accepted, e.g. September 31.
346 * posixtm.h (posixtime): Return bool instead of time_t, so
347 that we can return (time_t) -1 successfully.
348 * posixtm.c: Likewise.
349 [HAVE_STDBOOL_H]: Include <stdbool.h>.
350 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
351 (t): Remove static var.
352 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
353 of static var. All uses changed.
354 (year): Do not reject years before 1900; they can occur with
356 (posix_time_parse): Do not check for out-of-range components;
357 that is now the caller's responsibility, since our checks were
359 (posixtime): Use mktime to check for out-of-range components,
360 since it knows them exactly.
361 If mktime returns (time_t) -1, check whether an error actually occurred
362 by invoking localtime on -1.
363 (main) [TEST_POSIXTIME]: Check for input data errors, and report
364 posixtime failures better.
365 Improve the test data (in comments only).
367 2003-05-30 <karl@gnu.org>
369 * mktime.c: update from libc.
371 2003-05-30 Bruno Haible <bruno@clisp.org>
373 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
374 * localcharset.h: Likewise.
375 * localcharset.c: Likewise.
377 2003-05-28 Paul Eggert <eggert@twinsun.com>
379 Assume the headers required for C89 freestanding compilers.
380 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
381 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
382 without checking for HAVE_LIMITS_H.
383 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
384 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
386 * fatal.c: Include <stdarg.h> without checking for __STDC__.
387 * exclude.c: Include <stdbool.h> unconditionally.
388 * tempname.c: Include <stddef.h> unconditionally.
389 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
390 * modechange.c, rpmatch.c (NULL): Don't define, since
391 <stddef.h> does that.
392 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
393 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
394 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
395 * xstrtol.c: Likewise.
396 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
397 * savedir.c: Include <stddef.h> instead of defining NULL.
399 * addext.c (addext): Use assignment rather than cast, to avoid
400 warnings on some platforms.
402 * mktime.c (__mktime_internal): Do not reject negative timestamps
405 2003-05-10 Bruno Haible <bruno@clisp.org>
407 * linebreak.c (iconv_string_length): Don't return -1 just because the
408 string is longer than 4 KB.
410 2003-05-12 Jim Meyering <jim@meyering.net>
412 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
413 the space-padded-by-default conversion specifiers, %e, %k, %l.
415 2003-05-03 Bruno Haible <bruno@clisp.org>
417 Upgrade to Unicode-4.0.
418 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
419 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
420 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
421 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
422 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
423 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
424 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
425 Change width of U+E0100..U+E01EF from 1 to 0.
427 2003-04-25 Bruno Haible <bruno@clisp.org>
429 * copy-file.c: Include <stddef.h>, for size_t.
431 2003-04-25 Jim Meyering <jim@meyering.net>
433 * copy-file.c (copy_file_preserving): Declare buf_size to be
434 of type size_t, not int.
436 2003-04-11 Jim Meyering <jim@meyering.net>
438 Merge changes from Coreutils.
440 2003-03-22 Jim Meyering <jim@meyering.net>
442 * strftime.c (widen): Cast alloca return value to proper type.
444 2003-01-19 Ulrich Drepper <drepper@redhat.com>
447 * strftime.c (my_strftime): Handle very large width
448 specifications for numeric values correctly. Improve checks for
451 2003-01-19 Jim Meyering <jim@meyering.net>
453 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
454 (nl_get_alt_digit) [! defined my_strftime]: Define.
455 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
456 _nl_get_alt_digit and _nl_get_walt_digit.
458 * strftime.c (my_strftime): Merge in locale-related changes from libc.
459 These changes have no effect outside of _LIBC.
461 2003-04-10 Bruno Haible <bruno@clisp.org>
463 * findprog.h: New file, from GNU gettext.
464 * findprog.c: New file, from GNU gettext.
466 2003-04-05 Jim Meyering <jim@meyering.net>
468 Merge changes from Coreutils.
470 * exclude.h (PARAMS): Remove definition and uses.
471 * exclude.c: Remove uses of `PARAMS'.
473 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
474 Add test-cases for DOS filenames. Declare program_name.
475 (main): Set up program_name. Patch by Rich Dawe.
477 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
479 Use mntctl's return value to drive the entry-processing loop, since
480 we can't rely on the value of the vmt_length member in the last
481 entry. On some systems doing so could result in exhausting
482 virtual memory. Based in part on a patch from Mike Jetzer.
484 2003-04-04 Bruno Haible <bruno@clisp.org>
486 * linebreak.h: New file, from GNU gettext.
487 * linebreak.c: New file, from GNU gettext with slight modifications.
488 * lbrkprop.h: New file, from GNU gettext.
490 2003-04-03 Bruno Haible <bruno@clisp.org>
492 * utf8-ucs4.h: New file, from GNU gettext.
493 * utf16-ucs4.h: New file, from GNU gettext.
494 * ucs4-utf8.h: New file, from GNU gettext.
495 * ucs4-utf16.h: New file, from GNU gettext.
497 2003-04-02 Bruno Haible <bruno@clisp.org>
499 * binary-io.h: New file, from GNU gettext.
501 2003-04-01 Bruno Haible <bruno@clisp.org>
503 * pathname.h: New file, from GNU gettext.
504 * concatpath.c: New file, from GNU gettext.
506 2003-03-30 Bruno Haible <bruno@clisp.org>
508 * copy-file.c (copy_file_preserving): Don't set owner if the function
509 chown() doesn't exist.
511 2003-03-28 Bruno Haible <bruno@clisp.org>
513 * copy-file.h: New file, from GNU gettext.
514 * copy-file.c: New file, from GNU gettext.
516 2003-03-18 Jim Meyering <jim@meyering.net>
518 * quote.c (quote_n): Fix typo in comment.
520 2003-03-14 Jim Meyering <jim@meyering.net>
522 Merge changes from Coreutils.
523 * obstack.h (obstack_object_size): Declare temporary, __o,
524 to be const, in order to avoid warnings.
525 (obstack_room): Likewise.
526 (obstack_empty_p): Likewise.
528 2003-03-13 Paul Eggert <eggert@twinsun.com>
530 Merge changes from Bison.
531 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
532 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
533 when compiling Bison 1.875's `bitset bset = obstack_alloc
534 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
535 * hash.c: Include <stdbool.h> unconditionally.
537 2003-03-09 Paul Eggert <eggert@twinsun.com>
539 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
540 Reported by Bruce Becker; see:
541 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
543 2003-03-03 Paul Eggert <eggert@twinsun.com>
544 Bruno Haible <bruno@clisp.org>
546 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
547 Reported by John Hughes, see
548 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
550 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
555 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
564 * floorl.c: New file.
565 * frexpl.c: New file.
566 * ldexpl.c: New file.
568 * sincosl.c: New file.
575 2003-02-17 Bruno Haible <bruno@clisp.org>
577 * mkdtemp.h: New file, from GNU gettext.
578 * mkdtemp.c: New file, from GNU gettext.
580 2003-01-31 Bruno Haible <bruno@clisp.org>
582 * rename.c: #undef rename before defining rpl_rename.
583 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
585 2003-01-30 Bruno Haible <bruno@clisp.org>
587 * printf-args.h: New file, from GNU gettext.
588 * printf-args.c: New file, from GNU gettext.
589 * printf-parse.h: New file, from GNU gettext.
590 * printf-parse.c: New file, from GNU gettext.
591 * vasnprintf.h: New file, from GNU gettext.
592 * vasnprintf.c: New file, from GNU gettext.
593 * asnprintf.c: New file, from GNU gettext.
594 * vasprintf.h: New file, from GNU gettext with modifications.
595 * vasprintf.c: New file, from GNU gettext.
596 * asprintf.c: New file, from GNU gettext.
598 2003-01-29 Bruno Haible <bruno@clisp.org>
600 * stpncpy.h: New file, from GNU gettext with modifications.
601 * stpncpy.c: New file, from GNU gettext with modifications.
603 2003-01-28 Bruno Haible <bruno@clisp.org>
605 * c-ctype.h: New file, from GNU gettext, with changes suggested by
607 * c-ctype.c: New file, from GNU gettext, with changes suggested by
610 2003-01-27 Bruno Haible <bruno@clisp.org>
612 * xsetenv.h: New file, from GNU gettext.
613 * xsetenv.c: New file, from GNU gettext.
615 2003-01-23 Bruno Haible <bruno@clisp.org>
617 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
619 2003-01-22 Bruno Haible <bruno@clisp.org>
621 * exit.h: New file, from GNU gettext.
623 2003-01-11 Bruno Haible <bruno@clisp.org>
625 * stpcpy.h (stpcpy): Use ANSI C function declarations.
626 * strcase.h (strcasecmp, strncasecmp): Likewise.
628 2003-01-14 Jim Meyering <jim@meyering.net>
630 * same.c (same_name): Tweak a comment.
632 2003-01-11 Bruno Haible <bruno@clisp.org>
634 * same.c (same_name): Reorder tests so as to avoid calling stat()
635 when a string comparison is sufficient.
637 2003-01-11 Bruno Haible <bruno@clisp.org>
639 * readtokens.c (readtoken): Cast character to 'unsigned char', not
642 2003-01-11 Bruno Haible <bruno@clisp.org>
644 * hash-pjw.c: Add comment about low quality of this function.
646 2003-01-12 Paul Eggert <eggert@twinsun.com>
648 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
649 to avoid collisions with libcurses and libreadline.
651 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
652 * getstr.h, getstr.c: Remove.
653 * getline.c: Include "getline.h", to check interface.
654 Move body of old getstr.c here: this defines MIN_CHUNK and
655 declares getdelim2, which is renamed from getstr.
656 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
658 * linebuffer.c (readlinebuffer): Renamed from readline.
660 * linebuffer.h: Likewise.
661 (readline): Remove backward-compatibility macro.
663 2003-01-12 Jim Meyering <jim@meyering.net>
665 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
667 2003-01-10 Bruno Haible <bruno@clisp.org>
669 * alloca_.h: New file.
670 * getdate.y: Unconditionally include alloca.h.
671 * makepath.c: Likewise.
672 * setenv.c: Likewise.
673 * userspec.c: Likewise.
675 2003-01-09 Bruno Haible <bruno@clisp.org>
677 * stdbool.h.in: New file.
679 2003-01-08 Bruno Haible <bruno@clisp.org>
681 * safe-read.c: Include specification header first, to ensure its
683 * full-write.c: Likewise.
685 2003-01-08 Jim Meyering <jim@meyering.net>
687 * full-write.c: Undefine and define-away `const' after inclusion
688 of errno.h, not before. Suggestion from Bruno Haible.
690 2003-01-07 Jim Meyering <jim@meyering.net>
692 * full-write.c: Rework so that it may serve to define full_read, too.
693 * full-read.c: Simply #define FULL_READ and include full-write.c.
695 2003-01-06 Jim Meyering <jim@meyering.net>
697 * version-etc.c: Update year in translatable copyright string.
699 2002-12-25 Bruno Haible <bruno@clisp.org>
701 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
702 * xstrtol.h: Likewise.
703 * xstrtoimax.c: Likewise.
704 * xstrtoumax.c: Likewise.
707 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
708 on systems that have <inttypes.h> but not <stdint.h>.
710 2002-12-31 Paul Eggert <eggert@twinsun.com>
712 * memcoll.c (memcoll): Fall back on a simple algorithm using
713 memcmp if strcoll doesn't work.
715 2002-12-23 Bruno Haible <bruno@clisp.org>
717 * localcharset.h: New file.
718 * localcharset.c: Include it.
719 * unicodeio.c: Likewise.
721 2002-12-22 Bruno Haible <bruno@clisp.org>
723 * utime.c (utime_null): No need to call ftruncate if the file was
726 2002-12-23 Bruno Haible <bruno@clisp.org>
728 * memcoll.c (STRCOLL): New macro.
731 2002-12-22 Bruno Haible <bruno@clisp.org>
733 * getstr.h (getstr): Define, to avoid clash with libcurses.
734 * linebuffer.h (readline): Define, to avoid clash with libreadline.
736 2002-12-22 Bruno Haible <bruno@clisp.org>
738 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
740 2002-12-23 Bruno Haible <bruno@clisp.org>
742 * getline.h: Include <stddef.h>, for size_t.
744 * unicodeio.h: Include <stddef.h>, for size_t.
745 * unicodeio.c: Don't include <stddef.h>.
747 2002-12-17 Bruno Haible <bruno@clisp.org>
749 * canon-host.c (strdup): Remove unused declaration.
751 * fsusage.c: Include full_read.h.
752 (get_fs_usage): Use full_read instead of safe_read.
754 * utime.c (utime_null): Use SAFE_READ_ERROR.
756 2002-12-11 Bruno Haible <bruno@clisp.org>
758 * setenv.h: Rewritten to cope with systems that have setenv() but not
760 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
763 2002-12-11 Bruno Haible <bruno@clisp.org>
765 * setenv.c (alloca): Fall back to malloc.
767 (setenv): Use freea() to free memory allocated with alloca().
769 2002-11-13 Bruno Haible <bruno@clisp.org>
771 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
772 function declarations.
773 * unsetenv.c (unsetenv): Likewise.
775 2002-03-04 Bruno Haible <bruno@clisp.org>
777 Portability to AIX 4.3.3.
778 * unsetenv.c: New file, extracted from setenv.c.
779 * setenv.c: Move the unsetenv() function to unsetenv.c.
781 2001-12-20 Bruno Haible <bruno@clisp.org>
783 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
784 use malloc instead. For SunOS4.
786 2001-12-11 Bruno Haible <bruno@clisp.org>
788 * setenv.c: Declare alloca.
789 (compar_fn_t): New typedef.
790 (KNOWN_VALUE, STORE_VALUE): Use it.
792 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
795 2002-12-10 Paul Eggert <eggert@twinsun.com>
797 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
798 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
799 Choose values that are less likely to collide with system fnmatch
801 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
802 defined (e.g., a pure POSIX system).
803 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
804 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
806 2002-12-06 Jim Meyering <jim@meyering.net>
808 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
810 Merge in changes from libc's misc/error.c, in preparation
811 for the merge of gnulib's changes back into libc.
813 * error.c (_): Define only if not already defined.
814 Move definition to follow all #include directives.
815 Include unlocked-io.h only if !_LIBC.
816 [_LIBC]: Include <libio/libioP.h>.
817 [USE_IN_LIBIO]: Include <libio/iolibio.h>
818 (fflush): Tweak definition to use INTUSE.
821 2002-12-05 Paul Eggert <eggert@twinsun.com>
823 * alloca.c [defined emacs]: Include "lisp.h".
824 (xalloc_die) [defined emacs]: New macro.
825 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
826 [! defined emacs]: Include <xalloc.h>.
827 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
828 (pointer): Typedef to POINTER_TYPE *.
829 (malloc): Remove decl; we now always use xmalloc.
830 (alloca): Use old-style definition, since Emacs needs this.
831 Check for arithmetic overflow when computing combined size.
833 2002-12-04 Paul Eggert <eggert@twinsun.com>
835 Do not generate unlocked-io.h automatically, since it's easier to
838 * unlocked-io.h: New file, from GNU diffutils,
839 but with proper copyright notice and attribution.
841 * Makefile.am: Add copyright notice.
842 (libfetish_a_SOURCES): Add unlocked-io.h.
843 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
844 (DISTCLEANFILES, io_functions): Remove macros.
845 (EXTRA_DIST): Remove gen_uio.
846 (unlocked-io.h): Remove rule.
848 2002-12-04 Jim Meyering <jim@meyering.net>
850 Reflect the fact that stat.c and lstat.c are no longer generated.
851 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
852 (DISTCLEANFILES): Likewise.
853 (EXTRA_DIST): Likewise.
854 (all_local): Don't depend on stat.c or lstat.c.
855 (stat.c, lstat.c): Remove rules.
856 (EXTRA_DIST): Remove xstat.in.
858 * xstat.in: Remove file. Contents moved into stat.c.
859 * stat.c: New file. Contents mostly from xstat.in.
860 * stat.c: Rework so that it may serve to define rpl_lstat, too.
861 * lstat.c: New file. Simply #define LSTAT and include stat.c.
863 * safe-read.c: Rework so that it may serve to define safe_write, too.
864 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
866 2002-12-03 Jim Meyering <jim@meyering.net>
868 * safe-read.c, safe-write.c: Change variable names and comments, but
869 not semantics, to minimize the differences between these two files.
870 (safe_read): Change comment to mention SAFE_READ_ERROR.
872 * safe-read.c (IS_EINTR): Define.
873 (safe_read): Use IS_EINTR in place of in-function cpp directives.
875 2002-12-02 Bruno Haible <bruno@clisp.org>
877 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
878 Define, taken from safe-read.c.
879 (INT_MAX): Provide fallback.
880 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
881 * safe-write.h (SAFE_WRITE_ERROR): Define.
883 * safe-read.c (EINTR): Remove definition.
884 (safe_read): Don't use EINTR if it is absent.
886 2002-12-02 Jim Meyering <jim@meyering.net>
888 * safe-read.c (EINTR): Define.
889 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
890 (INT_MAX): Provide fallback.
891 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
893 * safe-read.h (SAFE_READ_ERROR): Define.
895 2002-12-01 Jim Meyering <jim@meyering.net>
897 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
898 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
900 2002-11-27 Paul Eggert <eggert@twinsun.com>
902 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
903 hash_rehash): Replace `if (limit <= value) abort ();' with
904 `if (! (value < limit)) abort ();', for readability.
906 2002-11-26 <karl@gnu.org>
908 * strdup.c: copy from libc again, with jim's ok.
909 * .cppi-disable: re-add strdup.c
911 2002-11-25 <karl@gnu.org>
913 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
914 instead of "strtol.c".
916 2002-11-25 Jim Meyering <jim@meyering.net>
918 * mktime.c: Sync from libc, now that it has the latest fix.
920 2002-11-24 <karl@gnu.org>
922 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
923 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
925 2002-11-24 Jim Meyering <jim@meyering.net>
927 Update from coreutils:
929 * mktime.c: Merge in changes from libc.
931 Avoid a link-time failure on some Linux systems.
932 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
933 (__mon_yday): Declare with the STATIC attribute.
934 (__mktime_internal): Likewise.
935 Based on a report from Greg Schafer.
937 2002-11-23 Jim Meyering <jim@meyering.net>
939 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
940 Use `unsigned', not `int', as type of index.
942 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
944 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
946 2002-11-22 Paul Eggert <eggert@twinsun.com>
948 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
949 hint that one should use `if (! x) abort ();' rather than `assert
950 (x);', and anyway it's one less thing to worry about configuring.
951 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
952 hash_rehash, hash_insert): Use abort rather than assert.
954 2002-11-22 Paul Eggert <eggert@twinsun.com>
956 * quotearg.h: Allow multiple inclusion by surrounding with
957 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
958 so that we can be included first.
959 (PARAMS): Remove; we now assume C89 or later. All uses removed.
960 * quotearg.c: Include quotearg.h immediately after config.h.
961 No need to include stddef.h or sys/types.h any more.
962 Surround local include files with "", not "<>".
963 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
964 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
965 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
966 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
967 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
968 (ISPRINT): Remove; no longer needed now that we assume C89.
970 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
973 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
974 quotearg_char): Use SIZE_MAX rather than
975 (size_t) -1 when we are talking about "infinity".
977 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
979 2002-11-22 Bruno Haible <bruno@clisp.org>
981 * safe-read.h: Assume C89. Add comments.
982 (safe_read): Change return type to size_t.
983 * safe-read.c (safe_read): Change return type to size_t. Handle byte
984 counts > SSIZE_MAX correctly.
985 * safe-write.h: New file.
986 * safe-write.c: New file.
987 * full-read.h: New file.
988 * full-read.c: New file.
989 * full-write.h: Assume C89. Add comments.
990 * full-write.c: Include safe-write.h.
991 (full_write): Rewritten to use safe_write.
992 Suggested by Jim Meyering and Paul Eggert.
994 2002-11-21 Bruno Haible <bruno@clisp.org>
996 Remove case insensitive option matching.
997 * argmatch.h (argcasematch): Remove declaration.
998 (ARGCASEMATCH): Remove macro.
999 (__xargmatch_internal): Remove case_sensitive argument.
1000 (XARGMATCH): Update.
1001 (XARGCASEMATCH): Remove macro.
1002 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
1003 case_sensitive argument.
1004 (argcasematch): Remove function.
1005 (__xargmatch_internal): Remove case_sensitive argument.
1006 (main): Use XARGMATCH instead of XARGCASEMATCH.
1008 * xmalloc.c: Change compile-time error message. Add comment about
1009 required autoconf version.
1011 2002-11-21 Jim Meyering <jim@meyering.net>
1013 * strdup.c (strdup): Tweak comment and initial #if/#include.
1015 Merge in changes from the coreutils.
1017 2002-09-25 Paul Eggert <eggert@twinsun.com>
1018 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
1019 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
1020 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
1021 int. Work more efficiently if X is the same width as uintmax_t.
1022 Do not compare X to -1, to avoid bogus compiler warning.
1023 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
1024 Don't assume that f_frsize and f_bsize are the same type.
1026 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
1029 * makepath.c (make_path): Restore umask *before* creating the final
1031 (make_path): Minor reformatting.
1033 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
1034 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
1036 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
1037 ones. At least on GNU/Linux systems, `auto' means something else.
1040 2002-11-20 Paul Eggert <eggert@twinsun.com>
1042 Merge argmatch cleanups from Bison. Assume C89.
1044 * argmatch.c: Include config.h here, not in argmatch.h.
1045 Include stdlib.h, for EXIT_FAILURE.
1046 Always include <string.h>, since we assume C89.
1047 (EXIT_FAILURE): Remove pre-C89 bug workaround.
1048 * argmatch.h: Do not include <config.h> or <sys/types.h>.
1049 Include <stddef.h> instead, since it's all we need for size_t.
1050 (PARAMS): Remove. All uses removed.
1051 (ARRAY_CARDINALITY): Do not bother to #undef.
1052 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
1053 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
1054 Remove unnecessary parentheses.
1055 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
1056 Insert necessary parentheses.
1057 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
1058 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
1060 2002-11-19 Bruno Haible <bruno@clisp.org>
1062 * mbswidth.c: Include mbswidth.h right at the beginning.
1063 * mbswidth.h: Include <stddef.h>, for size_t.
1065 * mbswidth.h (PARAMS): Remove macro.
1066 (mbswidth, mbsnwidth): Use ANSI C function declarations.
1067 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
1069 * gcd.h (PARAMS): Remove macro.
1070 (gcd): Use ANSI C function declarations.
1071 * gcd.c (gcd): Likewise.
1073 2002-11-15 Bruno Haible <bruno@clisp.org>
1075 * strcspn.c: Include <stddef.h>.
1076 (strcspn): Use ANSI C function declaration. Change return type to
1078 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
1079 (strpbrk): Use NULL.
1080 * strpbrk.h (PARAMS): Remove macro.
1081 (strpbrk): Use ANSI C function declaration.
1082 * strstr.c: Don't include <sys/types.h>.
1083 * strstr.h (PARAMS): Remove macro.
1084 (strstr): Use ANSI C function declarations.
1086 2002-11-06 Bruno Haible <bruno@clisp.org>
1088 * gcd.h (gcd): Change argument type to 'unsigned long'.
1089 * gcd.c (gcd): Likewise.
1091 2002-11-05 Bruno Haible <bruno@clisp.org>
1093 * gcd.h: New file, from gettext-0.11.5.
1094 * gcd.c: New file, from gettext-0.11.5.
1096 2002-11-05 Bruno Haible <bruno@clisp.org>
1098 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1099 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1100 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1101 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
1103 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
1104 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
1106 * closeout.c: Include gettext.h instead of <libintl.h>.
1107 * human.c: Include gettext.h instead of <libintl.h>.
1108 * quotearg.c: Include gettext.h instead of <libintl.h>.
1109 * rpmatch.c: Include gettext.h instead of <libintl.h>.
1110 * unicodeio.c: Include gettext.h instead of <libintl.h>.
1111 * userspec.c: Include gettext.h instead of <libintl.h>.
1112 * version-etc.c: Include gettext.h instead of <libintl.h>.
1113 * xmalloc.c: Include gettext.h instead of <libintl.h>.
1114 (textdomain): Remove definition.
1115 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
1117 * long-options.c: Remove include of <libintl.h> and definition of _.
1118 * same.c: Remove include of <libintl.h> and definition of _.
1120 2002-11-04 Bruno Haible <bruno@clisp.org>
1122 * stpcpy.h: New file, from GNU gettext-0.11.5.
1123 * strcase.h: New file, from GNU gettext-0.11.5.
1124 * strpbrk.h: New file, from GNU gettext-0.11.5.
1125 * strstr.h: New file, from GNU gettext-0.11.5.
1126 * xgetcwd.h: New file, from GNU gettext-0.11.5.
1128 2002-05-09 Bruno Haible <bruno@clisp.org>
1130 * config.charset: Update for newest glibc. Add canonical names
1131 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
1133 2002-05-09 Bruno Haible <bruno@clisp.org>
1135 * localcharset.c (get_charset_aliases): Add more Windows specific
1138 2002-05-08 Owen Taylor <otaylor@redhat.com>
1140 * config.charset: A few additions for Solaris.
1142 2001-12-05 Bruno Haible <bruno@clisp.org>
1144 * localcharset.c (locale_charset): Don't return an empty string.
1146 2001-10-23 Bruno Haible <haible@clisp.cons.org>
1148 * config.charset: msdos in uk_UA uses CP1125.
1150 2001-08-05 Bruno Haible <haible@clisp.cons.org>
1152 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
1153 * localcharset.c (locale_charset): Declare as extern "C".
1155 2002-02-15 Bruno Haible <bruno@clisp.org>
1157 * config.charset [msdosdjgpp]: For Russian, use CP866.
1159 2002-02-11 Bruno Haible <bruno@clisp.org>
1161 * config.charset: Add support for NetBSD.
1163 2002-09-25 <karl@gnu.org>
1165 * strdup.c: copy from libc/string (via ../config/srclist*).
1166 * getopt*: copy from libc/posix.
1167 * gettext.h: copy from gettext.
1168 * .cppi-disable: add strdup.c, gettext.h.
1170 2002-07-01 Jim Meyering <meyering@lucent.com>
1172 * c-stack.c: Include sys/time.h.
1173 From Volker Borchert.
1175 2002-06-11 Paul Eggert <eggert@twinsun.com>
1177 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
1178 New macro. Use it uniformly instead of
1179 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
1180 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
1181 reported by Vin Shelton.
1183 2002-06-22 Jim Meyering <meyering@lucent.com>
1185 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
1186 redefinition due to Solaris5.6's definition in /usr/include/sys/euc.h.
1188 2002-06-22 Paul Eggert <eggert@twinsun.com>
1190 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
1191 Do not assume SA_SIGINFO behavior.
1192 Bug reported by Jim Meyering on NetBSD 1.5.2.
1194 2002-06-22 Jim Meyering <meyering@lucent.com>
1196 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
1198 * exitfail.c, exitfail.h: Likewise.
1199 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
1201 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
1203 (EXTRA_DIST): Add fnmatch_loop.c.
1204 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
1206 * fnmatch_loop.c: New file, from diffutils-2.8.2.
1207 * fnmatch.c: Update from diffutils-2.8.2.
1208 * fnmatch_.h: New file. From diffutils-2.8.2.
1209 * fnmatch.h: Remove file.
1211 2002-06-18 Paul Eggert <eggert@twinsun.com>
1213 * file-type.h: Report an error if neither S_ISREG nor
1214 S_IFREG is defined, instead of using a test specific to glibc
1215 2.2. This should be safe, since POSIX requires S_ISREG and
1216 Unix Version 7 had S_IFREG. We don't need to check for
1217 <sys/types.h> since we don't use any symbols that it defines.
1219 2002-06-15 Jim Meyering <meyering@lucent.com>
1221 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
1222 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
1223 have been included before this file.
1225 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
1227 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
1228 so that each temporary file name is unique and valid in the first
1229 8 characters, for operation under DOS.
1231 2002-06-15 Jim Meyering <meyering@lucent.com>
1233 Work even with DJGPP 2.03, which lacks support for symlinks.
1235 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
1237 * lchown.c (S_ISLNK): Likewise.
1239 2002-06-14 Jim Meyering <meyering@lucent.com>
1241 * file-type.h: Use the version from diffutils-2.8.2.
1242 * file-type.c: Likewise.
1244 2002-05-27 Jim Meyering <meyering@lucent.com>
1246 Fix a problem seen only on nonconforming systems whereby ls.c's
1247 use of localtime, and then of gettimeofday would cause trouble:
1248 the localtime call used to initialize rpl_gettimeofday's save
1249 mechanism would clobber ls's current local time information so
1250 that in any long listing the first file would always be listed
1251 with date 1970-01-01. Analysis by Volker Borchert.
1253 * gettimeofday.c (localtime): Undefine.
1254 (rpl_localtime): New function.
1256 2002-05-22 Jim Meyering <meyering@lucent.com>
1258 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
1259 * file-type.h: New file.
1260 * file-type.c (file_type): New file/function. Extracted from diffutils.
1262 2002-04-29 Paul Eggert <eggert@twinsun.com>
1264 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
1266 2002-04-28 Paul Eggert <eggert@twinsun.com>
1268 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
1269 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
1270 of 127, since 64 is the largest conceivable number for ancient
1272 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
1274 2002-04-28 Jim Meyering <meyering@lucent.com>
1276 * sig2str.c (WTERMSIG): Remove definition (unused).
1278 2002-04-28 Paul Eggert <eggert@twinsun.com>
1280 * sig2str.h, sig2str.c: New files.
1281 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
1283 2002-04-24 Jim Meyering <meyering@lucent.com>
1285 * gettext.h: New file, from Gettext.
1286 * Makefile.am (INCLUDES): Remove -I../intl.
1287 (libfetish_a_SOURCES): Add gettext.h.
1289 2002-04-16 Jim Meyering <meyering@lucent.com>
1291 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
1292 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
1293 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
1295 2002-04-12 Jim Meyering <meyering@lucent.com>
1297 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
1299 2002-03-10 Jim Meyering <meyering@lucent.com>
1301 * makepath.c (make_path): Remove a comma from a diagnostic.
1302 Suggestion from Santiago Vila.
1304 2002-03-08 Jim Meyering <meyering@lucent.com>
1306 * rename.c: Mention that this wrapper is needed also on
1307 mips-dec-ultrix4.4 systems.
1309 2002-03-02 Jim Meyering <meyering@lucent.com>
1311 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
1312 not HAVE_CLOCK_SETTIME.
1314 2002-02-27 Paul Eggert <eggert@twinsun.com>
1316 * nanosleep.h: Rename to....
1317 * timespec.h: New name for nanosleep.h. All uses changed.
1319 * gettime.c: New file.
1320 * settime.c: New file.
1323 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
1324 timespec.h. Remove nanosleep.h.
1326 2002-02-25 Paul Eggert <eggert@twinsun.com>
1328 * acl.c, acl.h: New files.
1329 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
1331 2002-02-24 Jim Meyering <meyering@lucent.com>
1333 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
1334 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
1335 cause trouble. Reported by Nelson Beebe.
1337 2002-02-23 Paul Eggert <eggert@twinsun.com>
1339 * path-concat.c (xpath_concat): Reorder code to pacify
1340 compilers that don't know that xalloc_die never returns.
1342 2002-02-20 Jim Meyering <meyering@lucent.com>
1344 * getdate.c: Regenerate using bison-1.33.
1346 2002-02-15 Paul Eggert <eggert@twinsun.com>
1348 * posixver.c, posixver.h: New files.
1349 * Makefile.am (libfetish_a_SOURCES): Add them.
1351 2002-02-02 Paul Eggert <eggert@twinsun.com>
1352 Bruno Haible <bruno@clisp.org>
1354 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
1355 (fwrite_success_callback): New declaration.
1356 * unicodeio.c (unicode_to_mb): New function, extracted from
1357 print_unicode_char. Call failure callback instead of error.
1358 (fwrite_success_callback): New function.
1359 (exit_failure_callback): New function.
1360 (fallback_failure_callback): New function.
1361 (print_unicode_char): Call unicode_to_mb.
1363 2002-01-26 Jim Meyering <meyering@lucent.com>
1365 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
1367 2002-01-22 Jim Meyering <meyering@lucent.com>
1369 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
1370 Otherwise, some versions of automake would omit the rule that makes
1371 Makefile from Makefile.in.
1373 2001-01-21 Paul Eggert <eggert@twinsun.com>
1375 * xmemcoll.h, xmemcoll.c: New files.
1376 * Makefile.am (libfetish_a_SOURCES): Add them.
1377 * memcoll.c: Include errno.h, and declare errno if not defined.
1378 (memcoll): Set errno to zero if there is no error.
1380 * quotearg.c (quotearg_buffer_restyled):
1381 Fix bug with quoting buffers containing NUL when backslashing escapes.
1382 This bug was exposed by the other changes in this patch.
1383 (quotearg_n_options): New arg ARGSIZE.
1384 All callers changed.
1385 (quoting_options_from_style): New function.
1386 (quotearg_n_style): Use it.
1387 (quotearg_n_style_mem): New function.
1389 * quotearg.h (quotearg_n_style_mem): New function.
1391 2002-01-16 Jim Meyering <meyering@lucent.com>
1393 * getdate.y: Add three semicolons, each just before a closing brace.
1394 Bison (as of version 1.31) no longer papers over that mistake.
1396 2002-02-14 Paul Eggert <eggert@twinsun.com>
1398 * backupfile.c (ISDIGIT): Comment fix.
1399 * getdate.y (ISDIGIT): Likewise.
1400 * posixtm.c (ISDIGIT, year): Likewise.
1401 * strverscmp.c (ISDIGIT): Likewise.
1402 * userspec.c (ISDIGIT): Likewise.
1404 2002-01-05 Jim Meyering <meyering@lucent.com>
1406 * version-etc.c (version_etc_copyright): Update copyright year.
1408 2001-01-19 Paul Eggert <eggert@twinsun.com>
1410 * closeout.c (close_stdout_status): If ferror (stdout), do
1411 not silently exit merely because the output buffer happens to
1412 have nothing pending.
1414 2001-12-18 Paul Eggert <eggert@twinsun.com>
1416 See the big note in ../ChangeLog.
1417 * human.c (suffixes): Prefer K to k for 1024.
1418 (generate_suffix_backwards): New function.
1419 (human_readable_inexact): Use it.
1420 * xstrtol.c (__xstrtol): If there is no number but there
1421 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
1422 Accept 'K' as well as 'k'.
1424 2001-12-15 Jim Meyering <meyering@lucent.com>
1426 * regex.h (__restrict_arr): Update from libc.
1428 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
1429 as `remote' if the name starts with `//'. Suggested by Michael Stone.
1432 2001-12-10 Jim Meyering <meyering@lucent.com>
1434 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
1435 Instead, include "xalloc.h".
1436 (initbuffer): Don't cast xmalloc return value to char*.
1437 (readline): Reword comment.
1438 Don't cast xrealloc return value to char*
1441 2001-12-09 Jim Meyering <meyering@lucent.com>
1443 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
1444 `signed and unsigned type in conditional expression'.
1445 * posixtm.c (posix_time_parse): Likewise.
1447 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
1449 * readtokens.c (readtoken): Declare an index to be of type unsigned
1450 to avoid a pedantic warning.
1452 * getstr.c: Don't include assert.h.
1453 (getstr): Remove warning-evoking assertions.
1454 Return -1 if offset parameter is out of bounds.
1455 Change the type of a local from int to size_t.
1457 * strftime.c (my_strftime_localtime_r): Include this function
1458 definition in the `#if ! HAVE_TM_GMTOFF' block.
1460 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
1461 Include xalloc.h instead.
1463 2001-12-02 Jim Meyering <meyering@lucent.com>
1465 * tempname.c: Don't declare getenv, thus reverting the change of
1466 2001-11-18. It's no longer necessary, now that stdlib.h is always
1469 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
1470 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
1472 2001-11-30 Akim Demaille <akim@epita.fr>
1474 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
1475 before being defined.
1477 2001-11-27 Paul Eggert <eggert@twinsun.com>
1479 * quotearg.h (quotearg_n, quotearg_n_style):
1480 First arg is int, not unsigned.
1481 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
1482 (SIZE_MAX, UINT_MAX): New macros.
1483 (quotearg_n_options): Abort if N is negative.
1484 Avoid overflow check on hosts where size_t is 64 bits and int
1485 is 32 bits, as overflow is impossible there.
1486 Fix off-by-one typo that caused unnecessary reallocation.
1488 2001-11-27 Jim Meyering <meyering@lucent.com>
1490 * tempname.c: Merge with version from libc.
1491 * regex.c: Likewise.
1493 * tempname.c: Include stdlib.h unconditionally. On some old systems
1494 for which STDC_HEADERS is 0, it was not included, resulting in a
1495 warning about an integer-to-pointer conversion problem with getenv.
1496 Reported by Volker Borchert.
1498 2001-11-26 Jim Meyering <meyering@lucent.com>
1500 * gtod.h: Remove file.
1501 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
1502 * gettimeofday.c: Don't include gtod.h.
1503 (GTOD_init): Remove function.
1504 (rpl_gettimeofday): Do its job here instead, rather than aborting.
1505 Suggestion from Volker Borchert.
1507 2001-11-23 Jim Meyering <meyering@lucent.com>
1509 * hash.h (struct hash_table): Don't define here. Merely declare it.
1510 * hash.c (struct hash_table): Define it here instead.
1512 2001-11-22 Jim Meyering <meyering@lucent.com>
1514 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
1516 2001-11-18 Paul Eggert <eggert@twinsun.com>
1518 * tempname.c (TMP_MAX): Remove; no longer needed.
1519 (TEMPORARIES): New macro.
1520 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
1521 removes an artificial limitation (e.g. HP-UX 10.20, where
1524 2001-11-18 Jim Meyering <meyering@lucent.com>
1526 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
1529 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
1530 files will be created before anything else.
1532 2001-11-17 Jim Meyering <meyering@lucent.com>
1534 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
1535 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
1536 rather than group writable. Patch by Juan F. Codagnone.
1538 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
1539 Instead, include "xalloc.h".
1541 * mountlist.c: Include unlocked-io.h after all system headers.
1542 Remove explicit declarations of xmalloc, xrealloc,
1543 and xstrdup. Instead, include "xalloc.h".
1545 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
1546 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
1547 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
1549 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
1550 Reported by Padraig Brady.
1552 * mkstemp.c: #undef mkstemp.
1554 (rpl_mkstemp): Rename from mkstemp.
1557 2001-11-16 Jim Meyering <meyering@lucent.com>
1559 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
1560 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
1561 determine the amount of total physical memory, use pstat_getstatic.
1562 HPUX-11 doesn't define _SC_PHYS_PAGES.
1563 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
1564 If sysconf couldn't be used to determine the amount of available
1565 physical memory, use both pstat_getstatic and pstat_getdynamic.
1566 Based on a patch from Bob Proulx.
1568 2001-11-05 Jim Meyering <meyering@lucent.com>
1570 * xstat.in (slash_aware_lstat): Correct a misleading comment.
1572 2001-11-03 Jim Meyering <meyering@lucent.com>
1574 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
1575 in argmatch_to_argument call.
1577 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
1580 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
1581 e.g., a fault due to an attempt to free a NULL pointer.
1583 2001-11-01 Jim Meyering <meyering@lucent.com>
1585 * dirfd.c, dirfd.h: New files.
1586 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
1588 * hash.c (hash_print) [TESTING]: Clean up.
1590 2001-10-22 Paul Eggert <eggert@twinsun.com>
1592 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
1593 to avoid a warning if -Wall.
1595 2001-10-21 Paul Eggert <eggert@twinsun.com>
1597 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
1599 2001-10-21 Jim Meyering <meyering@lucent.com>
1601 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
1602 this code would end up calling gettext even in packages built
1604 * getopt.c (_): Likewise.
1605 * regex.c (_): Likewise.
1607 2001-10-20 Paul Eggert <eggert@twinsun.com>
1609 * error.c (strerror_r): Do not declare unless !_LIBC.
1610 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
1611 Use strerror_r that is only a macro, even if it is not a function.
1612 (strerror): Check for HAVE_DECL_STRERROR before declaring.
1613 (private_strerror): Use prototypes, not old-style function definition.
1614 (print_errno_message): New function.
1615 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
1617 (error_tail, error, error_at_line): Use it.
1619 2001-10-11 Jim Meyering <meyering@lucent.com>
1621 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
1622 and quote_n (1, ... to avoid clobbering a buffer.
1624 2001-10-05 Jim Meyering <meyering@lucent.com>
1626 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
1627 * hash-pjw.c: New file (factored out of fileutils' remove.c).
1628 * hash-pjw.h: New file.
1630 2001-09-30 Jim Meyering <meyering@lucent.com>
1632 * mountlist.c [MOUNTED_GETFSSTAT]:
1633 Include <sys/ucred.h>, for Apple Darwin.
1634 Include sys/mount.h and sys/fs_types.h only if available.
1636 (read_filesystem_list): Use FS_TYPE.
1638 2001-09-29 Paul Eggert <eggert@twinsun.com>
1640 * exclude.c (excluded_filename): 0 -> false, since it's
1643 2001-09-28 Paul Eggert <eggert@twinsun.com>
1645 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
1646 #defines strtoimax. Also treat the other strto* functions
1649 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
1650 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
1651 (strtoimax, strtoumax): Do not declare if already defined as a macro.
1653 2001-09-26 Jim Meyering <meyering@lucent.com>
1655 Most macros in unlocked-io.h had the wrong number of arguments.
1656 * gen-uio: New script.
1657 (USE_UNLOCKED_IO): Define to 1 if not already defined.
1658 * unlocked-io.hin: Remove file.
1659 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
1660 rather than trying to embed it here.
1661 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
1662 Reported by Padraig Brady.
1664 2001-09-25 Volker Borchert <bt@teknon.de>
1666 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
1668 2001-09-23 Jim Meyering <meyering@lucent.com>
1670 * mountlist.c: Remove useless parentheses in #if directives.
1671 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
1672 the deprecated MOUNTED symbol is no longer defined in mntent.h.
1674 2001-09-22 Jim Meyering <meyering@lucent.com>
1676 * localcharset.c: Update from latest gettext.
1677 * config.charset: Likewise.
1679 2001-09-20 Jim Meyering <meyering@lucent.com>
1681 * xstrtol.c (strtoimax): Guard declaration with
1682 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
1683 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
1684 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
1685 (strtoumax): Likewise, for completeness (it wasn't necessary).
1687 2001-09-06 Paul Eggert <eggert@twinsun.com>
1689 * strtoimax.c (HAVE_LONG_LONG):
1690 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
1691 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
1692 to work around bug in IBM C compiler.
1694 2001-09-16 Jim Meyering <meyering@lucent.com>
1696 * mkdir.c: New file.
1698 2001-09-04 Paul Eggert <eggert@twinsun.com>
1700 * xgetcwd.c: Revert some of the previous change; intead,
1701 fix the HAVE_GETCWD_NULL code to behave more like the
1702 !HAVE_GETCWD_NULL code used to.
1705 (xgetcwd): Do not return NULL when memory is exhausted; instead,
1708 2001-09-04 Paul Eggert <eggert@twinsun.com>
1710 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
1711 Use ssize_t, not int, to store result of readlink.
1712 Check for ssize_t overflow as well as size_t overflow,
1713 as POSIX says the result of readlink is implementation-defined
1714 when ssize_t overflows.
1715 Remove unnecessary cast to char*.
1716 Use free+malloc instead of realloc, as the storage doesn't need
1717 to be preserved and it's clearer and can be more efficient that way.
1718 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
1719 * xreadlink.h (xreadlink): Update prototype.
1721 2001-09-03 Paul Eggert <eggert@twinsun.com>
1723 * exclude.c (fnmatch_no_wildcards): Fix confusion between
1724 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
1725 spotted by Jim Meyering.
1727 2001-09-03 Jim Meyering <meyering@lucent.com>
1729 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
1731 2001-09-03 Paul Eggert <eggert@twinsun.com>
1733 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
1734 like the HAVE_GETCWD_NULL code.
1735 Include pathmax.h if not HAVE_GETCWD.
1736 Do not include xalloc.h.
1737 (INITIAL_BUFFER_SIZE): New symbol.
1738 Do not use xmalloc / xrealloc, since the caller is responsible for
1739 handling errors. Preserve errno around `free' during failure.
1740 Do not overrun buffer when using getwd.
1742 2001-09-03 Paul Eggert <eggert@twinsun.com>
1744 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
1745 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
1747 2001-09-02 Jim Meyering <meyering@lucent.com>
1749 * error.c: Update from GNU libc.
1751 2001-09-01 Jim Meyering <meyering@lucent.com>
1753 * xreadlink.c: New file.
1754 * xreadlink.h: New file.
1755 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
1757 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
1758 doesn't conflict with sparc-sun-solaris2.7's definition in
1759 /usr/include/sys/int_types.h.
1761 * exclude.c: Use `""', not `<>' to #include non-system header files.
1762 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
1763 and strncasecmp as r-values. Unixware didn't have declarations.
1765 2001-08-31 Jim Meyering <meyering@lucent.com>
1767 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
1768 Use an initial, malloc'd, buffer of length 128 rather than
1769 a statically allocated one of length 1024.
1771 2001-08-30 Paul Eggert <eggert@twinsun.com>
1773 * xgetcwd.c: Don't include pathmax.h.
1774 Include stdlib.h and unistd.h if available.
1776 (xmalloc, xstrdup, free): Remove decls.
1777 (xgetcwd): Don't assume sizes fit in unsigned.
1778 Check for overflow when computing sizes.
1779 Simplify reallocation code.
1781 2001-08-28 Paul Eggert <eggert@twinsun.com>
1783 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
1785 * strtoimax.c: Renamed from strtoxmax.c, removing the
1788 Also, make the following further changes to make this file's
1789 configuration more similar to that of strtol.c:
1790 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
1791 (strtoumax, uintmax_t, strtoull, strtol): Remove.
1792 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
1793 (strtoimax): Renamed from strtoumax. All uses of unsigned values
1794 changed to signed values.
1796 And make the following changes as well:
1797 Fix copyright notice, as 1999 was missing.
1798 (verify): New macro.
1799 (strtoimax): Check sizes at compile-time, not run-time.
1800 Prefer strtol to strtoll if both work.
1801 (main): Remove; it was not that useful and was a pain to maintain.
1803 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
1805 2001-08-30 Paul Eggert <eggert@twinsun.com>
1807 * savedir.c (savedir): Remove size parameter, as POSIX says that
1808 a directory's st_size can have an arbitrary value, so the old
1809 usage could waste an arbitrary amount of memory. All uses
1811 * savedir.h: Update prototype.
1813 2001-08-30 Paul Eggert <eggert@twinsun.com>
1815 * xstrtol.c (strtoimax): New decl.
1817 2001-08-28 Paul Eggert <eggert@twinsun.com>
1819 * xstrtol.h: Add copyright notice.
1820 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
1821 LONGINT_INVALID_SUFFIX_CHAR.
1823 2001-08-30 Paul Eggert <eggert@twinsun.com>
1825 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
1828 2001-08-30 Paul Eggert <eggert@twinsun.com>
1830 * hash.c: Remove '2001' from copyright notice.
1832 2001-08-30 Paul Eggert <eggert@twinsun.com>
1834 * full-write.h: New file.
1835 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
1836 * full-write.c: Correct credits, as cccp.c no longer
1837 exists and anyway it was so heavily changed from the old cccp
1838 code as to be unrecognizable. Include full-write.h.
1839 (full_write) Return size_t, with short writes meaning failure.
1840 All callers changed. This fixes a bug with large buffers
1842 * utime.c: Include full-write.h.
1844 2001-08-30 Paul Eggert <eggert@twinsun.com>
1846 Merge 'exclude' changes from tar 1.13.22.
1847 This fixes one or two unlikely storage allocation overflow bugs,
1848 but doesn't change user-visible behavior otherwise.
1850 2001-08-30 Paul Eggert <eggert@twinsun.com>
1852 * exclude.c (bool): Declare, perhaps by including stdbool.h.
1853 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
1854 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
1855 Include if available.
1856 (<xalloc.h>): Include
1857 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
1858 (verify): New macro. Use it to verify that EXCLUDE macros do not
1859 collide with FNM macros.
1860 (struct patopts): New struct.
1861 (struct exclude): Use it, as exclude patterns now come with options.
1862 (new_exclude): Support above changes.
1863 (new_exclude, add_exclude_file):
1864 Initial size must now be a power of two to simplify overflow checking.
1865 (free_exclude, fnmatch_no_wildcards): New function.
1866 (excluded_filename): No longer requires options arg, as the options
1867 are determined by add_exclude. Now returns bool, not int.
1868 (excluded_filename, add_exclude):
1869 Add support for the fancy new exclusion options.
1870 (add_exclude, add_exclude_file): Now takes int options arg.
1871 Check for arithmetic overflow when computing sizes.
1872 (add_exclude_file): xrealloc might modify errno, so don't
1873 realloc until after errno might be used.
1875 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
1877 (free_exclude): New decl.
1878 (add_exclude, add_exclude_file): Now takes int options arg.
1879 (excluded_filename): No longer requires options arg, as the options
1880 are determined by add_exclude. Now returns bool, not int.
1882 2001-08-30 Paul Eggert <eggert@twinsun.com>
1884 * alloca.c (alloca): Arg is of type size_t, not unsigned.
1886 2001-08-27 Jim Meyering <meyering@lucent.com>
1888 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
1890 * version-etc.c (N_): Remove definition.
1891 Revert most of last change.
1892 Instead, simply don't mark the `Copyright...' string for translation.
1893 Based on advice from Paul Eggert.
1895 * strtoxmax.c: Tweak comment.
1897 2001-08-26 Jim Meyering <meyering@lucent.com>
1899 * version-etc.c (version_etc_copyright_fmt): Replace literal year
1900 of copyright with `%s' so translators don't get an untranslated
1902 (COPYRIGHT_YEAR): Define.
1903 (version_etc): Use fprintf rather than fputs.
1904 Suggestion from Ulrich Drepper.
1906 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
1908 * strtoll.c: New file, from GNU libc.
1909 * xstrtoimax.c: New file.
1911 * xstrtol.h: Add xstrtoimax.
1912 * strtoumax.c: New file. Simply include "strtoumax.c".
1913 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
1915 * strtoumax.c: Factor to work both for unsigned and signed types, ...
1916 * strtoxmax.c: ... then renamed to this.
1918 2001-08-13 Paul Eggert <eggert@twinsun.com>
1920 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
1921 Port to Solaris 8, where 'sed' requires a space after the 'r'
1922 command, and where sh dislikes "$/". Clean up the spacing a bit.
1923 Redirect output to $tmp just once.
1925 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
1927 * addext.c (<errno.h>): Include.
1928 (errno): Declare if not defined.
1929 (addext): Work correctly when pathconf returns -1 and leaves
1930 errno alone because there is no limit. Also, work even if
1931 pathconf returns a value greater than SIZE_MAX.
1933 2001-08-12 Jim Meyering <meyering@lucent.com>
1935 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
1936 Simply `return getcwd (NULL, 0);'.
1937 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
1938 Use 1300 as initial value for length, not PATH_MAX.
1940 * pathmax.h: Clean up cpp syntax.
1942 2001-08-12 Jim Meyering <meyering@lucent.com>
1944 * gettimeofday.c: New file.
1946 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
1948 2001-08-04 Jim Meyering <meyering@lucent.com>
1950 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
1951 to get in sync with glibc.
1953 2001-08-03 Paul Eggert <eggert@twinsun.com>
1955 The following changes are from gettext 0.10.39 as maintained by
1958 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
1959 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
1960 with inverted sense. All uses changed.
1962 * mbswidth.c: Don't include <limits.h>.
1963 Include <stdlib.h> and <string.h> unconditionally.
1964 (iswcntrl, mbsinit, ISCNTRL): New macros.
1965 (mbsnwidth): Use K&R style function declarations.
1966 Don't bother checking for MB_LEN_MAX == 1, since the compiler
1967 can optimize it when MB_CUR_MAX == 1.
1968 The width of control characters is zero, not 1.
1970 2001-07-15 Jim Meyering <meyering@lucent.com>
1972 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
1973 (BUILT_SOURCES): Add unlocked-io.h.
1974 (io_functions): Define.
1975 (unlocked-io.h): New rule.
1976 (DISTCLEANFILES): Add unlocked-io.h.
1977 (all-local): Depend on unlocked-io.h, to ensure it is created.
1979 * unlocked-io.hin: New file
1981 * regex.c: Update from glibc.
1983 2001-07-05 Jim Meyering <meyering@lucent.com>
1985 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
1987 (libfetish_a_SOURCES): Put all .h files here instead.
1988 Remove a thus-exposed (better checks in automake) duplicate and
1989 two unnecessary .h files.
1991 2001-06-11 Jim Meyering <meyering@lucent.com>
1993 * regex.c: Update from GNU libc.
1995 2001-05-27 Jim Meyering <meyering@lucent.com>
1997 * readutmp.h (UT_TYPE): Define.
1999 2001-05-24 Jim Meyering <meyering@lucent.com>
2001 * argmatch.c: Include "quote.h".
2002 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
2003 quote function. Reported by Göran Uddeborg.
2005 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
2007 * dirname.c (dir_name): Compute append_dot using path, not newpath
2008 which is not yet declared.
2010 2001-05-11 Paul Eggert <eggert@twinsun.com>
2012 * Makefile.am (libfetish_a_SOURCES):
2013 Add strftime.c, since we now compile it on all hosts.
2015 * strftime.c (my_strftime):
2016 Define to nstrftime if emacs, but only if my_strftime is not defined.
2017 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
2018 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
2019 Add one more extra argument: a nanoseconds value.
2022 (my_strftime function): Add %N format.
2023 (emacs_strftimeu): Renamed from emacs_strftime,
2024 with extra ut argument.
2026 2001-05-11 Paul Eggert <eggert@twinsun.com>
2028 dirname code cleanup. base_name now behaves more compatibly
2029 with POSIX basename when given file names that have trailing
2030 slashes, and similarly for dir_name. Add new primitives
2031 base_len and dir_len. Put the directory-name-related decls
2034 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
2035 * backupfile.c (base_name): Likewise.
2036 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
2037 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
2038 * makepath.c (strip_trailing_slashes): Likewise.
2039 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
2041 * rename.c (strip_trailing_slashes): Likewise.
2042 * same.c (base_name): Likewise.
2043 * stripslash.c (ISSLASH): Likewise.
2045 * addext.c: Include <dirname.h> after size_t is defined.
2046 * backupfile.c: Likewise.
2048 * addext.c (addext): Use base_len to trim redundant
2049 trailing slashes instead of doing it ourselves.
2050 But do not trim the last slash if it is not redundant.
2052 * backupfile.c (find_backup_file_name,
2053 max_backup_version): Use base_len instead of rolling it ourselves.
2054 Handle the case of "" and (on DOS) "C:" correctly.
2056 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
2057 Include <string.h>, <dirname.h>.
2058 (base_name): Allow file names ending in slashes, other than names
2059 that are all slashes. In this case, return the basename followed
2060 by the slashes. This is more general, and can be used in places
2061 where the original base_name purposely had an assertion failure.
2062 (base_len): New function.
2064 * dirname.c: Include <string.h> instead of <stdlib.h>.
2065 Do not include <assert.h>; no longer needed.
2067 (memrchr): Remove decl.
2068 (dir_name_r): Remove.
2069 (dir_len): Renamed from dirlen. All callers changed.
2070 Rewrite in terms of base_name, for simplicity and consistency.
2071 (dir_name): Never return NULL. All callers changed.
2072 Do not include <stdlib.h> in test program; no longer needed.
2073 return 0; is fine for test program.
2075 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
2077 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
2079 * path-concat.c (path_concat): Use base_len to compute
2080 base length, not strlen; this means we cannot rely on memcpy
2083 * same.c (STREQ): Remove.
2084 (same_name): Handle the case where the basename ends in trailing '/'.
2086 * stripslash.c (strip_trailing_slashes): Return nonzero if
2087 a slash was stripped. Do not strip the last slash after a
2090 2001-04-08 Jim Meyering <meyering@lucent.com>
2092 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
2093 recomputed; that's necessary when the offset spans a DST transition.
2094 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
2096 2001-04-02 Jim Meyering <meyering@lucent.com>
2098 * regex.h, regex.c: Update from GNU libc.
2100 2001-03-19 Paul Eggert <eggert@twinsun.com>
2102 * version-etc.c (version_etc_copyright): Update to 2001.
2104 2001-03-16 Paul Eggert <eggert@twinsun.com>
2106 * tempname.c (uint64_t): Define to uintmax_t if
2107 not defined, and if UINT64_MAX is not defined.
2108 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
2109 Reported by John David Anglin.
2111 2001-03-10 Bruno Haible <haible@clisp.cons.org>
2113 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
2114 alias if codeset is empty.
2115 * config.charset (BeOS): Use wildcard syntax.
2117 2001-03-13 Jim Meyering <meyering@lucent.com>
2119 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
2120 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
2123 2001-03-06 Bruno Haible <haible@clisp.cons.org>
2125 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
2127 * unicodeio.c (print_unicode_char): Simplify accordingly.
2129 2001-03-06 Bruno Haible <haible@clisp.cons.org>
2131 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
2132 support for DOS/DJGPP.
2134 2001-02-28 Paul Eggert <eggert@twinsun.com>
2136 * Makefile.am (libfetish_a_SOURCES):
2137 Add dup-safer.c, fopen-safer.c.
2138 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
2140 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
2142 2001-02-25 Paul Eggert <eggert@twinsun.com>
2144 The mkstemp replacement is taken from glibc 2.2.2, with some
2145 portability fixes for use outside glibc, as follows:
2147 * tempname.c (struct_stat64): New macro.
2148 (direxists, __gen_tempname): Use it.
2149 This avoids a portability problem with Solaris 8.
2151 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
2152 (<stddef.h>, <stdint.h>, <string.h>):
2153 Include only if STDC_HEADERS || _LIBC.
2154 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
2155 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
2156 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
2157 (__set_errno): Define this macro if <errno.h> doesn't.
2158 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
2159 Define these macros if <stdio.h> doesn't.
2160 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
2161 Define these macros if <sys/stat.h>
2162 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
2163 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
2164 __xstat64): Define if not _LIBC.
2165 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
2166 (__gen_tempname): Invoke gettimeofday only if
2167 HAVE_GETTIMEOFDAY || _LIBC;
2168 otherwise, fall back on plain "time".
2169 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
2171 * mkstemp.c (__GT_FILE): Define to zero if not defined.
2173 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
2175 2001-02-17 Jim Meyering <meyering@lucent.com>
2177 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
2178 around included file name.
2180 * strnlen.c (__strnlen): Merge in a change from GNU libc.
2182 * strftime.c: Update from GNU libc (the only changes were to comments).
2184 2001-02-13 Bruno Haible <haible@clisp.cons.org>
2186 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
2188 2001-02-17 Paul Eggert <eggert@twinsun.com>
2190 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
2191 Remove workaround macros for hosts that have mbrtowc but not
2192 mbstate_t, as we now insist on proper declarations for both
2193 before using mbrtowc.
2195 2001-02-17 Jim Meyering <meyering@lucent.com>
2197 * regex.c: Update from libc.
2199 2001-02-16 Paul Eggert <eggert@twinsun.com>
2201 * alloca.c (malloc): Undef before defining, since stdlib.h
2202 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
2203 Reported by Mark Hounschell via Paul Eggert.
2205 2001-01-30 Bruno Haible <haible@clisp.cons.org>
2207 * config.charset: Update for FreeBSD 4.2.
2209 2001-01-26 Jim Meyering <meyering@lucent.com>
2211 * quotearg.c: Include stddef.h.
2212 * quote.c: Include stddef.h.
2213 Reported by Axel Kittenberger.
2215 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
2216 line in double quotes so that it evokes a better diagnostic.
2217 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
2218 Reported by Axel Kittenberger.
2220 2001-01-15 Bruno Haible <haible@clisp.cons.org>
2222 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
2223 to avoid a warning. Add back 'const' to inptr.
2225 2001-01-16 Jim Meyering <meyering@lucent.com>
2227 * basename.c: Include <stdio.h>, needed by assert on SunOS4.
2230 2001-01-14 Jim Meyering <meyering@lucent.com>
2232 * rename.c: New file. From Volker Borchert.
2233 Include stdlib.h, string.h or strings.h, and xalloc.h.
2234 Use strip_trailing_slashes rather than open-coding it.
2236 2001-01-03 Paul Eggert <eggert@twinsun.com>
2238 * strftime.c: Sync with glibc time/strftime.c 1.81.
2240 2001-01-03 Jim Meyering <meyering@lucent.com>
2242 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
2243 local `inptr' to avoid warning with some system declarations of iconv.
2245 2000-12-29 Paul Eggert <eggert@twinsun.com>
2247 * modechange.c: Do not assume that mode_t uses the
2248 traditional octal encoding. E.g. "chmod 1 FOO" should set
2249 the other-execute bit of FOO even if S_IXOTH != 1.
2251 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
2252 WOTH, XOTH, ALLM): New macros.
2253 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
2254 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
2256 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
2257 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
2259 No need to use uintmax_t; unsigned long is long enough.
2260 Don't bother to get suffix since we don't use it.
2262 2000-12-24 Jim Meyering <meyering@lucent.com>
2264 * hash.c (is_prime): Return explicit boolean values.
2265 (hash_get_first): Return NULL to appease Irix5.6's 89.
2266 Reported by Nelson Beebe.
2268 2000-10-31 Bruno Haible <haible@clisp.cons.org>
2270 * localcharset.c (locale_charset): Add support for Win32.
2272 2000-12-18 Paul Eggert <eggert@twinsun.com>
2274 * physmem.h, physmem.c: New files.
2276 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
2277 (noinst_HEADERS): Add physmem.h.
2279 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
2280 't' for compatibility with Solaris 8 sort.
2282 2000-12-18 Bruno Haible <haible@clisp.cons.org>
2284 * config.charset: Add support for BeOS.
2286 2000-12-16 Jim Meyering <meyering@lucent.com>
2288 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
2289 SHELLS_FILE to a file name that's useful on djgpp systems.
2291 (ADDITIONAL_DEFAULT_SHELLS): Define.
2292 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
2293 Based mostly on a patch from Prashant TR.
2295 2000-12-16 Jim Meyering <meyering@lucent.com>
2297 This bug had a serious impact on chown: `chown N:M FILE' (for integer
2298 N and M) would have treated it like `chown N:N FILE'.
2300 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
2302 2000-10-31 Bruno Haible <haible@clisp.cons.org>
2304 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
2305 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
2306 to the list of canonical encodings. Rename EUC-CN to GB2312.
2308 2000-12-08 Andreas Schwab <schwab@suse.de>
2310 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
2311 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
2313 2000-12-07 Jim Meyering <meyering@lucent.com>
2315 * stripslash.c (ISSLASH): Define.
2316 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
2319 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
2320 (dir_name_r): Declare this function as static.
2321 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
2322 manifest itself on a name containing a mix of slashes and
2324 Make this function work with names starting with a DOS-style
2325 drive letter and colon prefix.
2326 (dir_name): Append `.' if necessary.
2327 Based mostly on patches from Prashant TR and Eli Zaretskii.
2329 * dirname.h (dir_name_r): Remove prototype.
2331 2000-12-05 Jim Meyering <meyering@lucent.com>
2333 * dirname.c (dir_name_r): Add `const' in a few local declarations.
2335 2000-12-04 Jim Meyering <meyering@lucent.com>
2337 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
2338 Also include memory.h, stdlib.h, unistd.h if appropriate.
2339 Reported by Andreas Jaeger (conflicting declaration of malloc).
2341 2000-12-02 Jim Meyering <meyering@lucent.com>
2343 * closeout.h: Make idempotent, to avoid some obscure warnings.
2345 2000-12-01 Paul Eggert <eggert@twinsun.com>
2347 * memrchr.c: Include <config.h> before any system include file.
2349 2000-11-29 Paul Eggert <eggert@twinsun.com>
2351 * dirname.c (dir_name_r): Fix typo: int -> size_t.
2353 2000-11-26 Jim Meyering <meyering@lucent.com>
2355 * memcoll.c: Include sys/types.h. From Werner Almesberger.
2357 2000-11-22 Paul Eggert <eggert@twinsun.com>
2359 * strftime.c (my_strftime): Do not invoke mbrlen with a
2360 size of (size_t) -1; it's not portable.
2362 2000-11-17 Akim Demaille <akim@epita.fr>
2364 * obstack.h: Formatting changes.
2365 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
2366 prevent type checking.
2367 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
2368 cast the value to (void *): assigning a `foo *' to a `void *'
2370 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
2372 2000-11-17 Jim Meyering <meyering@lucent.com>
2374 * strstr.c: Update from GNU libc.
2376 2000-11-16 Jim Meyering <meyering@lucent.com>
2378 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
2380 2000-11-11 Jim Meyering <meyering@lucent.com>
2382 * error.c: Add a couple #includes, merging from GNU libc version.
2384 2000-11-10 Jim Meyering <meyering@lucent.com>
2386 * obstack.h: Update from GNU libc.
2387 * obstack.c: Likewise.
2389 2000-11-06 Paul Eggert <eggert@twinsun.com>
2391 * getusershell.c (setusershell): Use rewind rather than
2392 fseek/fseeko, to avoid configuration hassles with fseeko.
2393 Don't bother opening SHELLS_FILE if shellstream is NULL;
2396 2000-11-05 Jim Meyering <meyering@lucent.com>
2398 * makepath.h (make_dir): Declare.
2399 * makepath.c (make_dir): Remove `static' attribute.
2402 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
2404 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
2405 last one in a bucket, advance to the next bucket.
2407 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
2409 * fnmatch.c: Do not comment out all the code if we are using
2410 the GNU C library, because in some cases we are replacing buggy
2411 code in the GNU C library itself.
2413 2000-10-30 Paul Eggert <eggert@twinsun.com>
2415 * error.h, getline.h, modechange.h:
2416 Remove "2000" from Copyright line, as the file hasn't been
2417 changed this year other than in the copyright notice.
2419 * xalloc.h: Add "2000" to Copyright line, as this file
2420 was changed this year.
2422 2000-10-30 Paul Eggert <eggert@twinsun.com>
2424 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
2425 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
2426 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
2428 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
2430 * regex.h (__restrict_arr): Move definition out of #ifndef block.
2431 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
2432 doesn't define __restrict_arr.
2434 2000-10-29 Jim Meyering <meyering@lucent.com>
2436 * xstat.in: Fix grammar in comment.
2438 2000-10-28 Jim Meyering <meyering@lucent.com>
2440 * memchr.c: Update from libc.
2441 Adjust for portability:
2442 [HAVE_STDLIB_H]: Include stdlib.h.
2443 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
2444 Undef __memchr, too.
2445 [!weak_alias]: Define __memchr to memchr.
2447 * regex.c: Update from libc.
2448 * regex.h: Likewise.
2449 * getopt1.c: Likewise.
2450 * memcmp.c: Likewise.
2452 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
2453 Avoid using fseek, when possible -- it's broken by design.
2454 Patch by Ulrich Drepper.
2456 2000-10-26 Jim Meyering <meyering@lucent.com>
2458 * strftime.c: Update from libc.
2460 2000-10-25 Jim Meyering <meyering@lucent.com>
2462 * obstack.c: Update from libc.
2464 2000-10-23 Jim Meyering <meyering@lucent.com>
2466 * hard-locale.c (hard_locale): Revert last change -- it was simply
2467 wrong. That set_locale call must not have any side effects.
2470 2000-10-22 Jim Meyering <meyering@lucent.com>
2472 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
2473 [CYCLIC]: Remove now-unused definition.
2475 * save-cwd.c (O_DIRECTORY): Define, if needed.
2476 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
2477 Suggestion from Ulrich Drepper.
2479 2000-10-21 Jim Meyering <meyering@lucent.com>
2481 * dirname.c (dir_name_r): New function, factored out of dir_name.
2482 (dir_name): Use dir_name_r.
2483 * dirname.h (dir_name_r): Declare it.
2485 2000-10-21 Jim Meyering <meyering@lucent.com>
2487 * dirname.c (memrchr): Declare if necessary.
2488 (dir_name): Remove the restriction that there be no
2489 trailing slashes. Now, this code skips past them, effectively
2491 [TEST_DIRNAME] (main): New unit tests.
2493 * memrchr.c: New file from GNU libc.
2494 Undef __memrchr, too.
2495 [!weak_alias]: Define __memrchr to memrchr.
2496 Guard weak_alias use with `#ifdef weak_alias'.
2498 2000-10-17 Jim Meyering <meyering@lucent.com>
2500 * quote.h (PARAMS): Define and use.
2501 Reported by Akim Demaille.
2503 * getopt.c: Update from libc.
2505 2000-10-16 Jim Meyering <meyering@lucent.com>
2507 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
2510 2000-09-25 Jim Meyering <meyering@lucent.com>
2512 * md5.h (rol): Define (from GnuPG).
2514 * sha.c: Give credit (GnuPG) where due.
2515 (M): Use rol rather than open-coding it.
2516 Add a FIXME comment.
2518 2000-09-21 Jim Meyering <meyering@lucent.com>
2520 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
2521 Reported by Michael Stone.
2523 2000-09-20 Jim Meyering <meyering@lucent.com>
2525 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
2526 (noinst_HEADERS): Add sha.h.
2527 Based on code from Scott G. Miller and from GnuPG.
2529 2000-09-15 Jim Meyering <meyering@lucent.com>
2531 * regex.c: Update from libc.
2533 2000-09-10 Jim Meyering <meyering@lucent.com>
2535 * getopt.c (_getopt_internal): Update from glibc.
2537 2000-09-09 Jim Meyering <meyering@lucent.com>
2539 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
2540 think it should be used as a general replacement for isascii.
2541 * fnmatch.c: Likewise.
2542 * mbswidth.c: Likewise
2543 * regex.c: Likewise.
2546 * userspec.c: Include sys/param.h and limits.h.
2548 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
2549 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
2550 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
2551 UID, GID. Check range.
2553 2000-09-06 Jim Meyering <meyering@lucent.com>
2555 * getopt.c (_getopt_internal): Update from glibc.
2557 2000-08-30 Jim Meyering <meyering@lucent.com>
2559 * strftime.c: Merge in changes from GNU libc.
2561 2000-08-26 Jim Meyering <meyering@lucent.com>
2563 * closeout.c: Include "__fpending.h".
2564 (close_stdout_status): Return right away if there's nothing to flush.
2566 * Makefile.am (noinst_HEADERS): Add __fpending.h.
2567 * __fpending.c: New file.
2568 * __fpending.h: New file.
2570 2000-08-07 Paul Eggert <eggert@twinsun.com>
2572 Standardize on "memory exhausted" instead of "Memory exhausted"
2573 or "virtual memory exhausted".
2574 * obstack.c (print_and_abort): Use "memory exhausted", not
2575 "virtual memory exhausted".
2576 * same.c (same_name): Invoke xalloc_die instead of printing
2578 * userspec.c (parse_user_spec): Likewise.
2579 * bumpalloc.h: comment fix
2580 * same.c, userspec.c: Include xalloc.h.
2582 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
2583 not char *const and pointing to a constant array.
2584 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
2585 (xrealloc): Comment fix.
2587 * userspec.c (parse_user_spec):
2588 Don't translate a message until just before returning,
2589 to avoid unnecessary translation.
2591 2000-08-07 Jim Meyering <meyering@lucent.com>
2593 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
2594 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
2595 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
2596 getgroups.c, gethostname.c, getopt.h, group-member.c,
2597 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
2598 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
2599 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
2600 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
2601 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
2602 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
2603 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
2604 yesno.c: Back out Copyright date changes for each file with no change
2605 this year. This eases coordination with other programs using the same
2606 source code modules. From Paul Eggert.
2608 2000-08-03 Greg McGary <greg@mcgary.org>
2610 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
2611 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
2612 (EXTEND_BUFFER): Use them.
2614 2000-08-01 Jim Meyering <meyering@lucent.com>
2616 * dirname.c (ISSLASH): Define.
2617 (BACKSLASH_IS_PATH_SEPARATOR): Define.
2618 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
2619 both `\' and `/' may be use as path separators.
2620 Based on a patch from Prashant TR.
2622 2000-07-31 Paul Eggert <eggert@twinsun.com>
2624 * quotearg.c (quotearg_n_options): Don't make the initial
2625 slot vector a constant, since it might get modified.
2627 2000-07-31 Jim Meyering <meyering@lucent.com>
2629 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
2630 * obstack.c (print_and_abort): Likewise.
2632 2000-07-30 Paul Eggert <eggert@twinsun.com>
2634 * quotearg.c (quotearg_n_options): Preallocate a slot 0
2635 buffer, so that the caller can always quote one small
2636 component of a "memory exhausted" message in slot 0.
2637 From a suggestion by Jim Meyering.
2639 2000-07-30 Jim Meyering <meyering@lucent.com>
2641 * makepath.c (make_path): Quote the other instance, too.
2643 * quotearg.c (N_STATIC_SLOTVECS): Define.
2644 (STATIC_BUF_SIZE): Define.
2645 (quotearg_n_options): Use only statically allocated storage when
2646 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
2647 than STATIC_BUF_SIZE.
2649 2000-07-29 Jim Meyering <meyering@lucent.com>
2651 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
2652 * dirname.c (dir_name): Likewise.
2654 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
2656 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
2657 (dir_name): Assert that there are no trailing slashes.
2659 2000-07-18 Bruno Haible <haible@clisp.cons.org>
2661 * mbswidth.h (mbswidth): Add a flags argument.
2662 (mbswidth): New declaration.
2663 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
2664 * mbswidth.c (mbswidth): Add a flags argument.
2665 (mbsnwidth): New function.
2667 2000-07-24 Jim Meyering <meyering@lucent.com>
2669 * mbswidth.c: Remove useless #else. From Bruno Haible.
2671 2000-07-23 Paul Eggert <eggert@twinsun.com>
2673 * mbswidth.c (_XOPEN_SOURCE):
2674 Don't define; this causes problems on Solaris 7.
2675 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
2677 2000-07-23 Paul Eggert <eggert@twinsun.com>
2680 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
2681 so that mbstate_t is always defined.
2683 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
2684 be 1 in at least one GCC installation, and this configuration
2685 error is likely to be common. Ignoring MB_LEN_MAX hurts
2686 performance on hosts that have mbrtowc but have only unibyte
2687 locales, but I assume these hosts are rare.
2689 2000-07-23 Paul Eggert <eggert@twinsun.com>
2691 * quotearg.c: Streamline by invoking multibyte code only if needed.
2692 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
2693 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
2694 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
2695 invoke multibyte primitives.
2697 2000-07-23 Jim Meyering <meyering@lucent.com>
2699 * basename.c (base_name): Add an assertion.
2701 2000-07-15 Bruno Haible <clisp.cons.org>
2703 * quotearg.c: When the system forces us to redefine mbstate_t,
2704 shadow its mbsinit function.
2706 2000-07-16 Bruno Haible <haible@clisp.cons.org>
2708 * mbswidth.h: New file.
2709 * mbswidth.c: New file.
2710 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
2711 (noinst_HEADERS): Add mbswidth.h.
2713 2000-07-17 Bruno Haible <haible@clisp.cons.org>
2715 * config.charset: Add support for FreeBSD. Improve support for HP-UX
2718 2000-07-15 Jim Meyering <meyering@lucent.com>
2720 * makepath.c: Include quote.h.
2721 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
2722 corresponding argument in a `quote (...)' call.
2723 Give better diagnostics.
2725 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
2726 (noinst_HEADERS): Add quote.h.
2728 * quote.c (quote, quote_n): New file. Two functions taken verbatim
2729 from tar's src/misc.c.
2730 * quote.h: New file. Prototypes for same.
2732 2000-07-10 Paul Eggert <eggert@twinsun.com>
2734 From a suggestion by Bruno Haible.
2735 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
2736 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
2737 to decide whether to define the BeOS workaround macro;
2738 this adjusts to the change to AC_MBSTATE_T.
2740 2000-07-13 Paul Eggert <eggert@twinsun.com>
2742 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
2744 * quotearg.c (quoting_style_args, quoting_style_vals,
2745 quotearg_buffer_restyled): Add support for
2746 clocale_quoting_style. Undo previous change to
2747 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
2748 and "{RIGHT QUOTATION MARK}" msgids.
2750 2000-07-05 Paul Eggert <eggert@twinsun.com>
2752 The old behavior of quoting `like this' doesn't look good with
2753 newer, ISO-style fonts. See:
2754 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
2756 Instead, quote "like this" by default. Let the translator
2757 tailor the locale-specific quoting behavior by providing
2758 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
2760 * quotearg.c (N_): New macro.
2761 (gettext_default): New function.
2762 (quotearg_buffer_restyled): Use
2763 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
2764 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
2766 2000-07-09 Jim Meyering <meyering@lucent.com>
2768 * Most files: Update copyright dates to include 2000.
2770 2000-07-08 Jim Meyering <meyering@lucent.com>
2772 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
2774 (xgethostname): Remove now-unnecessary #ifdef.
2775 Move declaration of `err' into loop where it's used.
2777 2000-07-05 Bruno Haible <haible@clisp.cons.org>
2779 * xgethostname.c (xgethostname): Protect against the SunOS5.5 bug
2780 by allocating a larger buffer. Test the gethostname return value for
2781 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
2782 returns an error and ENAMETOOLONG isn't defined.
2784 2000-07-05 Paul Eggert <eggert@twinsun.com>
2785 and Bruno Haible <haible@clisp.cons.org>
2787 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
2789 2000-07-05 Bruno Haible <haible@clisp.cons.org>
2791 * quotearg.c (struct quoting_options): Simplify quote_these_too
2794 2000-07-03 Jim Meyering <meyering@lucent.com>
2796 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
2797 Reported by Bruno Haible.
2799 2000-07-04 Jim Meyering <meyering@lucent.com>
2801 * quotearg.c: Make inclusion of <wchar.h> independent of whether
2802 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
2805 2000-07-03 Paul Eggert <eggert@twinsun.com>
2806 and Bruno Haible <haible@clisp.cons.org>
2808 * quotearg.c (mbrtowc):
2809 Assign to *pwc, and return 1 only if result is nonzero.
2810 (iswprint): Use ISPRINT when substituting our own mbrtowc.
2812 2000-07-03 Jim Meyering <meyering@lucent.com>
2814 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
2815 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
2818 2000-07-02 Jim Meyering <meyering@lucent.com>
2820 * quotearg.c (mbstate_t): Don't define here.
2822 2000-07-02 Jim Meyering <meyering@lucent.com>
2824 * nanosleep.c (SIGCONT): Define if not already defined.
2826 2000-06-17 Bruno Haible <haible@clisp.cons.org>
2828 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
2829 per change in ../m4/ls-mntd-fs.m4.
2830 (read_filesystem_list): Ignore symbolic links.
2832 2000-06-29 Jim Meyering <meyering@lucent.com>
2834 * same.c: Include <string.h> or <strings.h>, as appropriate,
2835 for declaration of strcmp.
2837 * long-options.c: Include <stdlib.h>, for declaration of exit.
2839 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
2840 Avoid warning by casting result to `char *' to remove `const'.
2842 2000-06-17 Bruno Haible <haible@clisp.cons.org>
2844 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
2846 2000-06-26 Paul Eggert <eggert@twinsun.com>
2848 savedir now sets errno on failure and invokes xmalloc to get memory.
2849 Fix a couple of other minor bugs while we're at it.
2851 * savedir.c (<unistd.h>): Do not include; there's no need.
2852 (NAMLEN): Remove macro.
2853 (malloc, realloc): Remove decls.
2855 ("xalloc.h"): Include.
2856 (NAME_SIZE_DEFAULT): New macro.
2857 (savedir): Use xmalloc / xrealloc to allocate memory.
2858 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
2859 Skip "" directory entries.
2860 Use strlen to calculate directory entry length, since the old method
2861 is rarely used these days and isn't worth supporting.
2862 Don't use a pointer after freeing it.
2863 Check for integer overflow when calculating allocation size.
2864 Use memcpy to copy entries, instead of stpcpy.
2865 Set errno properly when returning NULL.
2866 Check for readdir error.
2868 2000-06-26 Jim Meyering <meyering@lucent.com>
2870 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
2872 2000-06-17 Bruno Haible <haible@clisp.cons.org>
2874 * getusershell.c (xmalloc, xrealloc): Remove functions.
2876 Don't include <stdlib.h>. Don't declare malloc, realloc.
2878 2000-06-23 Bruno Haible <haible@clisp.cons.org>
2880 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
2882 2000-06-24 Jim Meyering <meyering@lucent.com>
2884 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
2886 2000-06-21 Jim Meyering <meyering@lucent.com>
2888 * getpass.c: New file, from Bruno Haible. Required for BeOS.
2890 2000-06-19 Paul Eggert <eggert@twinsun.com>
2892 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
2893 (mbrtowc, mbstate_t): Define substitutes if
2894 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
2895 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
2896 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
2898 2000-06-17 Bruno Haible <haible@clisp.cons.org>
2900 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
2901 than 1024, return a memory chunk of least possible size, instead
2902 of size PATH_MAX + 2. In the loop, increment the size proportionally.
2903 Use free/xmalloc instead of xrealloc to avoid copying for very long
2906 2000-06-17 Bruno Haible <haible@clisp.cons.org>
2908 * canon-host.c (canon_host): Use malloc and memcpy to copy an
2909 address, not strdup. Include <stdlib.h> and don't declare free().
2911 2000-06-17 Bruno Haible <haible@clisp.cons.org>
2913 * path-concat.c (path_concat): Don't access dir[-1] if dir is
2916 2000-06-21 Jim Meyering <meyering@lucent.com>
2918 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
2919 (noinst_HEADERS): Add getstr.h.
2921 * getline.c (getstr): Move into a separate file.
2922 * getstr.c (getstr): New file, extracted from getline.c, with
2923 the following changes: new parameter, delim2; both delim[12]
2924 parameters have type `int', not `char'. The latter would lose
2925 with 8-bit delimiters.
2926 * getstr.h: New file.
2928 2000-06-19 Jim Meyering <meyering@lucent.com>
2930 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
2932 2000-06-18 Jim Meyering <meyering@lucent.com>
2934 * mkdir.c: Remove file, due mainly to copyright incompatibility.
2935 Besides, these days every porting target provides a mkdir function.
2937 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
2938 (this snippet comes from src/system.h).
2940 2000-06-15 Paul Eggert <eggert@twinsun.com>
2942 * human.c (adjust_value): New function.
2943 (human_readable_inexact): Apply rounding style even when
2944 printing approximate values.
2946 2000-06-14 Paul Eggert <eggert@twinsun.com>
2948 * human.c (human_readable_inexact): Allow an input block
2949 size that is not a multiple of the output block size, and vice versa.
2950 Reported by Piergiorgio Sartor.
2952 2000-06-14 Paul Eggert <eggert@twinsun.com>
2954 * getdate.y (get_date): Apply relative times after time
2955 zone indicator, not before. Reported by Todd A. Jacobs.
2957 2000-06-13 Jim Meyering <meyering@lucent.com>
2959 * Makefile.am (all-local): Depend on lstat.c and stat.c.
2961 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
2963 2000-06-12 Paul Eggert <eggert@twinsun.com>
2965 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
2967 2000-06-04 Paul Eggert <eggert@twinsun.com>
2969 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
2971 2000-06-04 Jim Meyering <meyering@lucent.com>
2973 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
2974 SunOS4.1.4 for which gid_t is an unsigned type.
2976 2000-06-03 Jim Meyering <meyering@lucent.com>
2978 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
2980 2000-05-26 Bruno Haible <haible@clisp.cons.org>
2982 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
2983 newer, don't install charset.alias.
2984 * config.charset: Change the Linux/glibc rules so they become empty
2985 on glibc-2.1 or newer.
2987 2000-06-02 Jim Meyering <meyering@lucent.com>
2989 * mountlist.c: Back out last change. Instead, do this...
2990 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
2991 member using the same `ignore'-testing code.
2992 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
2996 2000-05-29 Jim Meyering <meyering@lucent.com>
2998 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
2999 with the `ignore' attribute. Based on a patch from Mark D. Roth.
3001 2000-05-22 Jim Meyering <meyering@lucent.com>
3003 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
3005 2000-05-18 Jim Meyering <meyering@lucent.com>
3007 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
3008 back, too, since it may have been modified by allocate_entry.
3009 (hash_delete): Rewrite to use neither the assignment operator
3010 nor the comma operator in an if-expression.
3012 2000-05-15 Paul Eggert <eggert@twinsun.com>
3015 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
3016 Remove; no longer needed.
3017 "quotearg.h": Add include.
3018 (file_name): Do not bother to explicitly initialize to NULL; it's less
3019 efficient on some hosts.
3020 (close_stdout_status): Remove test as to whether stdout was already
3021 closed; it breaks for the case "echo x | sort >&-".
3022 Quote file name colons.
3023 Do not assume that _("write error") lacks format strings.
3025 2000-05-15 Jim Meyering <meyering@lucent.com>
3027 * version-etc.c (version_etc_copyright): Update the copyright string
3028 used in all --version output.
3030 2000-05-14 Jim Meyering <meyering@lucent.com>
3032 * closeout.c (close_stdout_set_file_name): New function.
3033 (close_stdout_status): Use new file-scoped global.
3034 Return right away if fstat says the stdout file descriptor is invalid.
3035 * closeout.h (close_stdout_set_file_name): Declare.
3037 2000-05-10 Jim Meyering <meyering@lucent.com>
3039 * closeout.c [default_exit_status]: New file-scoped variable.
3040 (close_stdout_set_status): New function.
3041 * closeout.h (close_stdout_set_status): Declare.
3043 2000-05-08 Jim Meyering <meyering@lucent.com>
3045 * long-options.c: Don't include closeout.h.
3046 (parse_long_options): Don't call close_stdout for --version.
3048 2000-05-06 Jim Meyering <meyering@lucent.com>
3050 * strnlen.c: Undefine __strnlen and strnlen.
3051 [!weak_alias]: Define __strnlen to strnlen.
3053 * atexit.c: New file, from libiberty.
3055 2000-05-06 Jim Meyering <meyering@lucent.com>
3057 * closeout.c (close_stdout_status): Also check for errors on the
3060 2000-05-05 Bruno Haible <haible@clisp.cons.org>
3062 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
3063 instead of xmalloc, xrealloc, path_concat.
3064 (locale_charset): Treat empty environment variables as absent.
3065 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
3067 2000-05-04 Jim Meyering <meyering@lucent.com>
3069 * getopt.c: Update from glibc.
3070 * obstack.c: Likewise.
3071 * obstack.h: Likewise.
3072 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
3074 * regex.h: Likewise.
3075 * strndup.c: Likewise.
3076 * strnlen.c: New file, from glibc.
3078 2000-05-01 Jim Meyering <meyering@lucent.com>
3080 * full-write.c (full_write): Remove `FIXME' part of comment.
3082 2000-04-29 Jim Meyering <meyering@lucent.com>
3084 * path-concat.c: Declare strdup only if it's not defined.
3085 * canon-host.c: Likewise.
3087 2000-04-28 Jim Meyering <meyering@lucent.com>
3089 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
3090 redefinition warning on some systems (HPUX). Otherwise, regex.h is
3091 included first, then limits.h is included by locale.h by libintl.h.
3092 From John David Anglin.
3094 2000-04-25 Jim Meyering <meyering@lucent.com>
3096 * makepath.c (S_IRWXUGO): Define.
3097 (make_path): Always perform explicit chmod if MODE specifies any
3098 of the `special' permission bits. Prompted by a bug report against
3099 install from Mate Wierdl and Joost van Baal.
3101 2000-04-18 Jim Meyering <meyering@lucent.com>
3105 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
3106 getpagesize. For BeOS. Based on a patch from Bruno Haible.
3108 2000-04-17 Jim Meyering <meyering@lucent.com>
3110 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
3111 the definition of it to rpl_strftime also defined-away the system's
3114 2000-04-15 Jim Meyering <meyering@lucent.com>
3116 Use `C' to denote so-called `contiguous' files, the same way
3118 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
3119 (ftypelet): Use S_ISCTG.
3120 From Michael Deutschmann.
3122 2000-04-14 Jim Meyering <meyering@lucent.com>
3124 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
3126 2000-04-08 Jim Meyering <meyering@lucent.com>
3128 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
3129 names don't conflict. Reported by Eli Zaretskii.
3131 2000-03-28 Bruno Haible <haible@clisp.cons.org>
3133 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
3134 bug. Deal with the different error behavior of Irix iconv.
3136 2000-04-07 Jim Meyering <meyering@lucent.com>
3138 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
3139 to work around system header problems on AIX 3.2.5. From Bruno Haible.
3141 2000-04-05 Jim Meyering <meyering@lucent.com>
3143 Portability tweaks required for ultrix4.3.
3144 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
3145 * readutmp.c: Include sys/types.h before sys/stat.h.
3146 * canon-host.c: Declare strdup.
3147 * path-concat.c: Likewise.
3148 From John David Anglin.
3150 2000-04-04 Jim Meyering <meyering@lucent.com>
3152 Be more DOS 8.3-friendly.
3153 * ref-add.sin: Renamed from ref-add.sed.in.
3154 * ref-del.sin: Renamed from ref-del.sed.in.
3155 * Makefile.am: Reflect renaming.
3156 Reported by Eli Zaretskii.
3158 Use a temporary file name that won't clash with `charset.alias'
3159 in the DOS 8.3 name space.
3160 * Makefile.am (charset_tmp): Define.
3161 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
3162 (uninstall-local): Likewise.
3163 Reported by Eli Zaretskii.
3165 2000-03-29 Paul Eggert <eggert@twinsun.com>
3167 * time/strftime.c (my_strftime): Make sure we call the system
3168 strftime, not ourselves, when invoking the underlying strftime.
3170 2000-03-24 Jim Meyering <meyering@lucent.com>
3172 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
3173 (charset_alias): Define.
3174 (install-exec-local): Factor out common code.
3175 (uninstall-local): Split lines longer than 80.
3176 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
3178 (.sed.in.sed): New rule. Don't redirect directly to $@.
3179 (CLEANFILES): Add ref-add.sed and ref-del.sed.
3181 2000-03-19 Bruno Haible <haible@clisp.cons.org>
3183 * config.charset: Output a line containing "Packages using this file".
3184 * ref-add.sed.in, ref-del.sed.in: New files.
3185 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
3186 ref-del.sed): New rules.
3188 2000-03-17 Jim Meyering <meyering@lucent.com>
3190 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
3191 Otherwise, include <strings.h>
3193 2000-03-17 Bruno Haible <haible@clisp.cons.org>
3195 * unicodeio.c (utf8_wctomb): New function.
3196 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
3197 format instead of in UCS-4 with platform dependent endianness.
3199 2000-03-07 Paul Eggert <eggert@twinsun.com>
3201 * savedir.c (savedir): Work even if directory size is
3202 negative; this can happen with some screwy NFS configurations.
3204 2000-03-06 Jim Meyering <meyering@lucent.com>
3206 * localcharset.c (get_charset_aliases): Don't try to free file_name
3207 if it's NULL (because we ran out of memory). From Bruno Haible.
3209 2000-03-05 Jim Meyering <meyering@lucent.com>
3211 * localcharset.c ("path-concat.h"): Include.
3212 (get_charset_aliases): Use path_concat instead of ANSI string
3215 * unicodeio.h (PARAMS): Define.
3216 Use it to guard prototype.
3218 2000-03-04 Jim Meyering <meyering@lucent.com>
3220 * Makefile.am (install-exec-local): Create $(libdir) before installing
3222 (uninstall-local): Uncomment this rule so `make distcheck' works
3225 * unicodeio.c (<errno.h>): Include it.
3226 (errno): Declare if not defined.
3228 * localcharset.c: Add Bruno's comment justifying use of volatile.
3230 * config.charset: New version, incorporating remarks from a linux
3231 i18n mailing list. From Bruno Haible.
3233 2000-03-02 Jim Meyering <meyering@lucent.com>
3235 * Makefile.am (EXTRA_DIST): Add config.charset.
3237 2000-03-01 Jim Meyering <meyering@lucent.com>
3239 * localcharset.c: Guard some #includes with `#if HAVE_...'.
3240 * unicodeio.c: Likewise.
3242 2000-02-02 Bruno Haible <haible@clisp.cons.org>
3244 * config.charset: New file.
3245 * localcharset.c: New file.
3246 * unicodeio.h, unicodeio.c: New files.
3247 * Makefile.am (DEFS): Add -DLIBDIR=...
3248 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
3249 (noinst_HEADERS): Add unicodeio.h.
3250 (all-local, install-exec-local, charset.alias): New targets.
3252 2000-02-28 Paul Eggert <eggert@twinsun.com>
3254 * quotearg.c (ALERT_CHAR): New macro.
3255 (quotearg_buffer_restyled): Use it.
3257 2000-02-27 Jim Meyering <meyering@lucent.com>
3259 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
3260 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
3262 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
3263 not `#if STDC_HEADERS'.
3264 Declare malloc if needed.
3266 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
3267 now that autoconf always defines the HAVE_DECL_ symbols.
3268 * human.c: Likewise.
3270 * strtoumax.c: Likewise.
3272 * backupfile.c: Arrange for cpp to fail if the configure-time
3273 declaration check was not run.
3275 * human.c: Likewise.
3277 * strtoumax.c: Likewise.
3279 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
3280 then first look up the entire `.'-containing string as a login name.
3282 2000-02-18 Paul Eggert <eggert@twinsun.com>
3284 * getdate.y: Handle two-digit years with leading zeros correctly.
3285 (textint): New typedef.
3286 (parser_control): Member year changed from int to textint.
3288 (YYSTYPE): Removed; replaced by %union with int and textint members.
3289 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
3290 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
3291 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
3292 (tSNUMBER, tUNUMBER): Now of type <textintval>.
3293 (date, number, to_year): Use width of number in digits, not its value,
3294 to determine whether it's a 2-digit year, or a 2-digit time.
3295 (yylex): Store number of digits of numeric tokens.
3296 Reported by John Kendall.
3298 (parser_control): Changed from struct parser_control to typedef (for
3299 consistency). All uses changed.
3301 (tID): Removed; not used.
3302 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
3304 2000-02-14 Paul Eggert <eggert@twinsun.com>
3306 * getpagesize.h (getpagesize): Port to VMS for Alpha;
3307 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
3309 2000-02-12 Jim Meyering <meyering@lucent.com>
3311 * userspec.c (ISDIGIT): Define it.
3312 (isdigit): Remove definition.
3313 (is_number): Use ISDIGIT, not isdigit.
3314 <libintl.h>: Include.
3316 (parse_user_spec): Mark translatable strings.
3318 2000-02-10 Jim Meyering <meyering@lucent.com>
3320 With these changes, nanosleep.[ch] are finally enough like the other
3321 lib/* replacement files to compile on a few more losing systems.
3323 * nanosleep.h: Don't include config.h.
3324 Remove prototype from declaration of nanosleep.
3325 (PARAMS): Remove now-unneeded definition.
3326 * nanosleep.c: #undef nanosleep.
3327 (rpl_nanosleep): Rename from nanosleep.
3329 2000-02-03 Jim Meyering <meyering@lucent.com>
3331 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
3332 rather than with `#if HAVE_UTMPNAME'.
3334 2000-02-01 Jim Meyering <meyering@lucent.com>
3336 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
3338 2000-01-31 Jim Meyering <meyering@lucent.com>
3340 * nanosleep.h (nanosleep): Guard declaration with
3341 `#if ! HAVE_DECL_NANOSLEEP'.
3342 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
3343 the declaration in that vendor's sys/timers.h.
3344 Reported by Christian Krackowizer.
3346 * quotearg.c (ISASCII): Add #undef and move definition to follow
3347 inclusion of wctype.h to work around solaris2.6 namespace pollution.
3348 (ISPRINT): Likewise.
3349 Reported by Tom Tromey.
3351 2000-01-30 Jim Meyering <meyering@lucent.com>
3353 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
3354 uses of ->ut_name. The latter doesn't work with new Linux header files
3355 where only utmpx.ut_user is declared.
3357 * readutmp.h (UT_USER): Define.
3359 2000-01-23 Jim Meyering <meyering@lucent.com>
3361 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
3364 2000-01-22 Jim Meyering <meyering@lucent.com>
3366 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
3367 [! HAVE_DECL_STRTOULL]: Declare strtoull.
3368 Required for some AIX systems. Reported by Christian Krackowizer.
3369 [TESTING] (main): New function.
3371 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
3372 * dirname.c (dir_name): Support for DOS-style file names with drive
3375 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
3377 * strverscmp.c (ISDIGIT): Define.
3378 (strverscmp): Use ISDIGIT, not isdigit.
3380 2000-01-17 Paul Eggert <eggert@twinsun.com>
3382 * nanosleep.c (nanosleep):
3383 Don't use SA_INTERRUPT to decide whether to call sigaction, as
3384 POSIX.1 doesn't require SA_INTERRUPT and some systems
3385 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
3386 it's been part of POSIX.1 since day 1 (in 1988).
3388 2000-01-17 Jim Meyering <meyering@lucent.com>
3390 * interlock: Remove unused file. Reported by François Pinard.
3392 2000-01-16 Paul Eggert <eggert@twinsun.com>
3394 * quotearg.c (quotearg_buffer_restyled): Do not quote
3395 alert, backslash, formfeed, and vertical tab unnecessarily in
3396 shell quoting style.
3399 version-control: never