1 2005-10-01 Simon Josefsson <jas@extundo.com>
3 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
4 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
5 AI_* and EAI_* definitions. Protect function declarations.
7 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
10 so that the code works even with ancient cpp. Portability problem
11 with GCC 2.7.2.1 reported by Thomas M.Ott.
13 2005-09-27 Jim Meyering <jim@meyering.net>
15 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
17 * intprops.h (signed_type_or_expr__): Define.
18 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
21 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
23 * verify.h (verify_expr): Remove, replacing with:
24 (verify_true): New macro that returns true instead of void.
25 (verify_type__): Remove.
26 (verify): Use verify_true rather than verify_type__.
28 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
30 * utimens.c (ENOSYS): Define if not already defined.
31 (futimens): Support having a null PATH if the file descriptor
34 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
36 (__attribute): Define to empty unless GCC 3.1 or later.
37 This works around a core dump on OpenBSD 3.4, which has GCC
38 2.95.3, which dumps core when given __attribute__(()). It also
39 simplifies other tests, since we really don't want to bother with
40 worrying about which ancient version of GCC supported what.
41 Original problem reported by Yoann Vandoorselaere, with part of
42 the fix suggested by Derek Price.
44 2005-09-24 Jim Meyering <jim@meyering.net>
46 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
47 so we can once again use a positive bitfield width of 1 -- now we
48 don't have to explain why we were using a bitfield width of 2.
50 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
52 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
53 Problem reported by Eric Blake.
54 (getaddrinfo): Initialize se so that it's not garbage.
55 Redo internal storage allocation so that it doesn't make unportable
56 assumptions about alignment.
59 * utimens.c (futimens): Use futimesat if available.
60 Prefer it to futimes since it doesn't have the futimes bug.
62 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
63 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
64 Instead, declare a function that returns a pointer to an array,
65 and use verify_type__ to declare the size of the array.
66 Problem and germ of a solution reported by Bruno Haible.
67 (verify_type__): Use 2, not 1, for bitfield size, to avoid
68 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
70 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
74 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
76 * argmatch.h: Include verify.h
77 (ARGMATCH_VERIFY): Use verify rather than rolling our own.
78 (ARGMATCH_ASSERT): Remove; unused.
79 * canonicalize.c: Assume STDC_HEADERS.
80 * exclude.c: Include "strcase.h".
81 * regex_internal.h [!defined _LIBC]: Likewise.
82 * getusershell.c: Include stdio--.h rather than stdio.h
84 (getusershell): Call fopen, not fopen_safer.
85 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
86 Do not include unistd-safer.h.
87 (save_cwd): Don't call fd_safer; no longer needed
88 now that we include fcntl--.h.
90 * getdate.y (relative_time): New type.
91 (RELATIVE_TIME_0): New constant.
92 (parser_control): Use relative_time instead of doing it ourselves.
93 (%union): Add new relative_time rel member.
94 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
96 (relunit, relunit_snumber): Now of type rel.
97 (zone, rel, relunit, get_date): Adjust to above changes.
99 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
100 Do not include unistd-safer.h.
101 (getloadavg): Don't call fd_safer; no longer needed
102 now that we include fcntl--.h.
104 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
105 (make_dir_parents): Treat ENOSYS like EEXIST.
107 Improve quality of diagnostics on restore_cwd failure.
108 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
109 (make_dir_parents): Last arg is now int * (for errno), not bool *.
110 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
111 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
112 each time through the loop. Do not diagnose restore_cwd failure;
113 that is the caller's job (and perhaps the caller does not care).
115 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
116 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
117 If the file already exists but is not a directory, don't bother
118 to try to make its parents.
119 Close potential file descriptor leak if we can't chdir("/") (!).
120 Don't always return true if chdir($PWD) fails; return true only
121 if the requested action was done successfully (except for the
123 Don't log final directory unless we actually made it.
124 Refactor to avoid duplicate code to fix up permissions.
125 Don't attempt to fix up parent permissions if chdir($PWD) fails.
127 * strftime.c (my_strftime): Rewrite the previous change slightly,
128 to make it a bit faster and (I hope) clearer.
129 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
130 Fix bug in formats like %2N.
132 * verify.h: New file.
134 2005-09-22 Jim Meyering <jim@meyering.net>
138 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
140 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
141 the .tm_year member, since otherwise gcc-4.0 would now warn about
142 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
144 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
145 order to avoid an unsuppressible warning from gcc on 64-bit systems.
147 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
148 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
149 when run in a time zone for which daylight savings time is in effect
150 for the starting date.
152 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
153 stop us from restricting permissions of just-created absolute-named
155 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
156 to restore initial working directory.
157 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
158 to tell caller if/when we change the working directory and are
159 unable to return to the initial one.
160 * mkdir-p.h (make_dir_parents): Update prototype.
161 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
162 `return false'. This fixes a bug introduced on 2004-07-30.
164 * openat.c (fdopendir): Be sure to close the supplied
165 file descriptor before returning. This makes our replacement
166 implementation a little closer to Solaris's, where fdopendir
167 ties the file descriptor to the returned DIR* pointer.
168 * openat.c (unlinkat): New function.
169 * openat.h (unlinkat): Add prototype.
170 * openat-die.c (openat_save_fail): Rename from openat_save_die.
171 (openat_restore_fail): Rename from openat_restore_die.
172 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
174 Provide an alternative to exiting immediately upon save_cwd or
175 restore_cwd failure. Now, an application can arrange e.g.,
176 to perform a longjump in that case.
177 * openat.c: Include dirname.h.
178 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
179 (rpl_openat, fdopendir, fstatat): Call openat_save_die
180 and openat_restore_die rather than calling error directly.
181 Don't include "error.h" or "exitfail.h"; they're no longer needed.
183 * openat-die.c (openat_save_die, openat_restore_die): New file.
184 * openat.h (openat_save_die, openat_restore_die): Declare and define.
186 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
187 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
188 int utc, int nanoseconds);
190 date should not have to allocate a megabyte of virtual memory to
191 handle a format argument like +%1048575T. When implemented with
192 strftime, it must allocate such a buffer, use strftime to fill it
193 in, print it, then free it.
194 With fprintftime, it simply prints everything and exits.
195 With no need for memory allocation, that's one fewer way to fail.
196 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
197 optional field width, not before, so we accept %9:z, not %:9z.
198 (my_strftime): Be sure to use L_('x') for literals.
200 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
201 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
202 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
203 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
204 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
205 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
206 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
207 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
208 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
210 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
211 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
212 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
213 and don't include <sys/file.h>).
215 2005-09-22 Eric Blake <ebb9@byu.net> (tiny change)
219 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
220 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
221 [!LDAV_DONE]: Avoid unused variable warning.
223 2005-09-21 Bruno Haible <bruno@clisp.org>
225 * unicodeio.h (unicode_to_mb): New declaration.
227 2005-09-20 Derek Price <derek@ximbiot.com>
229 * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
231 2005-09-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
233 Use a consistent style for including <config.h>.
234 * __fpending.c, acl.c, argmatch.c,
235 argp-help.c, argp-parse.c,
236 argp-pvh.c, backupfile.c, basename.c, c-stack.c,
237 calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
238 creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
239 dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
240 fd-safer.c, file-type.c, fileblocks.c, filemode.c,
241 filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
242 fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
243 getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
244 getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
245 hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
246 inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
247 memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
248 modechange.c, mountlist.c, open-safer.c, physmem.c,
249 pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
250 progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
251 readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
252 safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
253 strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
254 strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
255 strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
256 userspec.c, utimecmp.c, version-etc-fsf.c,
257 version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
258 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
259 xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
260 Standardize inclusion of config.h.
261 * __fpending.h, dirfd.h, getdate.h, human.h,
262 inttostr.h: Removed inclusion of config.h from header files.
263 * inttostr.c: Adjusted in-tree users.
264 * timespec.h: Remove superfluous warning to include config.h.
265 * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
266 gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
267 nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
268 unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
270 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
272 * stat-time.h: New file.
273 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
274 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
276 (timespec_cmp): New function.
277 * utimecmp.c: Include stat-time.h.
278 (SYSCALL_RESOLUTION): Depend on whether various struct stat
279 members exist, not on the obsolescent ST_MTIM_NSEC.
280 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
282 2005-09-15 Derek Price <derek@ximbiot.com>
283 Paul Eggert <eggert@cs.ucla.edu>
285 * regcomp.c, regexec.c, regex_internal.c: Back out previous
286 changes, consolidating in...
287 * regex_internal.h: ...this file.
289 2005-09-15 Derek Price <derek@ximbiot.com>
291 * regex_internal.h: Blank `pure' for GNUC < 3.
292 * regex_internal.c: Ditto, using this...
293 (__GNUC_PREREQ): ...new macro.
294 * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
295 (__GNUC_PREREQ): ...this new macro.
297 * strstr.h: Include string.h. Define strstr as a macro here.
299 2005-09-13 Derek Price <derek@ximbiot.com>
301 * canon-host.c (canon_host_r): Set *cherror on memory allocation
303 Reported by Jim Meyering <jim@meyering.net>.
305 2005-09-13 Jim Meyering <jim@meyering.net>
307 * canon-host.c: Filter through gnu indent and reword comments slightly.
308 * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
310 2005-09-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
312 * lib/base64.c: Typo.
313 (base64_encode): Put b64str in initialized data section.
315 2005-09-12 Derek Price <derek@ximbiot.com>
317 Return usable errors from canon-host.
318 * canon-host.h: New file.
319 * canon-host.c (canon_host): Wrap...
320 (canon_host_r): ...this new function, which now relies exclusively on
322 (ch_strerror): New function.
323 (last_cherror): New global.
324 * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
325 (getaddrinfo): Add AI_CANONNAME functionality. Don't do arithmetic on
327 (freeaddrinfo): Free ai->ai_canonname when set.
329 2005-09-12 Derek Price <derek@ximbiot.com>
330 Paul Eggert <eggert@cs.ucla.edu>
332 * glob-libc.h: Renamed from glob_.h. The new version is
333 taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
334 protecting things that should be done only in gnulib contexts.
335 * glob_.h: New file, containing only the glob things needed for
337 (GLOB_PREFIX): Remove. All uses changed to look for __GLOB_GNULIB.
338 (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
339 (glob, globfree, glob_pattern_p): Now defined simply in terms of
340 rpl_glob, rpl_globfree, rpl_glob_pattern_p.
341 (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
342 and to respect the namespace rules better.
344 2005-09-12 Paul Eggert <eggert@cs.ucla.edu>
346 Merge glibc and coreutils changes into gnulib, plus a few
348 * md5.c: Use #error rather than a string.
349 (CYCLIC): New macro, from glibc source. Use it instead of rol.
350 * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
351 (__attribute__): Define to empty for non recent-GCC.
352 (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
353 (__md5_process_bytes, __md5_read_ctx, __md5_stream):
354 Renamed from their non-__ counterparts, with new macros replacing
355 them if not _LIBC. Add __THROW attribute.
357 (struct md5_ctx): Align buffer if using GCC.
358 * sha1.h (struct sha1_ctx): Likewise.
359 * sha1.c (SWAP): Renamed from the NOTSWAP. All uses changed.
360 The old name was backwards.
361 (NOTSWAP): Remove; not used.
362 (rol): New macro, moved here from md5.h.
363 (sha1_process_block): Remove a FIXME that doesn't make sense.
365 2005-09-12 Derek Price <derek@ximbiot.com>
367 * gai_strerror.c: Include config.h when available. Include
368 getaddrinfo.h before other headers to test interface.
369 Reported by Larry Jones <lawrence.jones@ugs.com>.
371 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
373 * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
374 definitions, since that's the preferred style in glibc.
375 Fix a minor spacing issue, and update copyright notice to match glibc's.
377 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
379 * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
381 2005-09-06 Simon Josefsson <jas@extundo.com>
383 * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
384 TCSETATTR. Reported by Derek Price <derek@ximbiot.com>.
386 2005-09-05 Paul Eggert <eggert@cs.ucla.edu>
388 Change bitset word type from unsigned int to unsigned long int,
389 as this has better performance on typical 64-bit hosts.
390 Port bitset code to hosts with unusual word sizes.
391 * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
392 (build_collating_symbol):
393 Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
394 argument is a bitset. This is merely a style issue, but it makes
395 it clearer that an entire array is expected.
396 (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
397 * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
398 Port to the case where bitset_word is not the same as unsigned int.
399 * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
400 (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
402 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
403 (build_trtable, group_nodes_into_DFAstates):
405 * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
406 Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
407 * regex_internal.h (bitset_set_all, bitset_not): Likewise.
408 * regexec.c (group_nodes_into_DFAstates): Likewise.
409 * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
410 * regcomp.c (optimize_subexps, lower_subexp):
411 Work even if bitset_word has holes in its bitwise representation.
412 * regex_internal.h (BITSET_WORD_BITS): Likewise.
413 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
415 * regex_internal.c (re_string_reconstruct):
416 Don't assume UCHAR_MAX == 255.
417 * regex_internal.h (bitset_set_all): Likewise.
418 * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
420 (BITSET_WORDS): Renamed from BITSET_UINTS. All uses changed.
421 (bitset_word): New type, replacing 'unsigned int' for bitset uses.
423 (BITSET_WORD_MAX): New macro.
424 (bitset_set, bitset_clear, bitset_contain, bitset_empty):
425 (bitset_set_all, bitset_copy): Now inline functions, not macros.
426 (bitset_empty, bitset_copy):
427 Prefer sizeof (bitset) to multiplying it out ourselves.
428 (bitset_not_merge): Remove; unused.
429 (bitset_contain): Return bool, not unsigned int with one bit on.
431 * regexec.c (build_trtable): Don't assume bitset has no stricter
432 alignment than re_node_set; do this by defining a new internal
433 type struct dests_alloc and using it to allocate memory.
435 2005-09-02 Paul Eggert <eggert@cs.ucla.edu>
437 Check for arithmetic overflow when calculating sizes, to prevent
438 some buffer-overflow issues. These patches are conservative, in the
439 sense that when I couldn't determine whether an overflow was possible,
440 I inserted a run-time check.
441 * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
442 (SIZE_MAX) [!defined SIZE_MAX]: New macro.
443 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
444 (re_xnrealloc, re_x2nrealloc): New inline functions.
445 * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
446 (build_equiv_class, build_charclass): Check for arithmetic overflow
447 in size expression calculations.
448 * lib/regex_internal.c (re_string_realloc_buffers):
449 (build_wcs_upper_buffer, re_node_set_add_intersect):
450 (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
451 (re_dfa_add_node, register_state): Likewise.
452 * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
453 (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
454 (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
455 (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
457 2005-09-01 Paul Eggert <eggert@cs.ucla.edu>
459 * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
460 to avoid a collision with bits/local_lim.h in glibc.
461 All uses changed. Problem reported by Dmitry V. Levin in
462 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
464 * regex_internal.c (build_wcs_upper_buffer): Fix portability
465 bugs in int versus size_t comparisons.
466 (re_string_context_at): Fix bug where the code assumed that
469 Use bool where appropriate.
470 * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
472 (calc_eclosure_iter): Likewise, for ROOT arg.
473 (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
474 (build_charclass_op): Likewise, for NON_MATCH arg.
475 * regex_internal.c (re_string_allocate, re_string_construct):
476 (re_string_construct_common): Likewise, for ICASE arg.
477 * regexec.c (re_search_2_stub, re_search_stub):
478 Likewise, for RET_LEN arg.
479 (check_matching): Likewise, for FL_LONGEST_MATCH arg.
480 (set_regs): Likewise, for FL_BACKTRACK arg.
481 * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
482 (duplicate_node_closure, calc_inveclosure, calc_eclosure):
483 (calc_eclosure_iter, parse_bracket_exp):
484 Use bool for internal variables that are booleans.
485 * regexec.c (re_search_internal, check_matching, proceed_next_node):
486 (set_regs, build_sifted_states, sift_states_bkref):
487 (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
488 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
489 (find_collation_sequence_value):
491 * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
492 (re_node_set_compare):
493 Return bool, not int. All callers changed.
494 * regexec.c (check_halt_node_context, check_dst_limits):
495 (build_trtable, check_node_accept): Likewise.
496 * regex_internal.h: Include stdbool.h.
498 Fix bugs uncovered when converting to bool.
499 * regcomp.c (calc_eclosure_iter): Check for storage allocation
500 failure instead of charging ahead blindly.
501 * regex_internal.c (register_state): Likewise.
502 * regexec.c (re_search_2_stub): Use simpler method than boolean
503 for freeing internal storage.
504 (group_nodes_into_DFA_states): Use unsigned int, not int, for
505 bitset pieces used as boolean, to avoid undefined behavior
506 on hosts that do int overflow checking.
508 2005-08-31 Derek Price <derek@ximbiot.com>
510 * getdelim.c (getdelim): Return EOF on EOF.
511 Reported by Larry Jones <lawrence.jones@ugs.com>.
513 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
515 * regex_internal.c (re_string_reconstruct): Don't assume buffer
516 lengths fit in regoff_t; this isn't true if regoff_t is the same
518 * regex.c (re_search_internal): 5th arg is LAST_START
519 (= START + RANGE) instead of RANGE. This avoids overflow
520 problems when regoff_t is the same width as size_t.
522 (re_search_2_stub): Check for overflow when adding the
523 sizes of the two strings.
524 (re_search_stub): Check for overflow when adding START
525 to RANGE; if it occurs, substitute the extreme value.
527 2005-08-31 Jim Meyering <jim@meyering.net>
529 * regcomp.c (search_duplicated_node): Make first pointer arg
531 * regex_internal.c (create_ci_newstate, create_cd_newstate):
532 (register_state): Likewise.
533 * regexec.c (search_cur_bkref_entry, check_dst_limits):
534 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
535 (group_nodes_into_DFAstates): Likewise.
537 2005-08-31 Paul Eggert <eggert@cs.ucla.edu>
539 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
540 old glibc regex code mishandles strings longer than 2**31 bytes.
541 This patch fixes this when the regex code is used in gnulib
542 (i.e., outside glibc).
544 This patch should not affect the use of the regex code inside
545 glibc. No doubt this problem also needs to be handled for glibc
546 as well, but the result will be an incompatible change to the
547 glibc ABI, and the old ABI will have to be supported too. That
548 can be the the subject for another patch.
550 * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
551 governing whether the rest of this patch is active. By default,
552 the macro is disabled and the patch has no effect.
553 (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
554 (__re_idx_t, __re_size_t, __re_long_size_t): New types.
555 (struct re_pattern_buffer, re_search, re_search_2, re_match):
556 (re_match_2, re_set_registers): Use the new types.
557 * regex_internal.h (Idx, re_hashval_t): New types.
558 (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
560 (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
561 (re_string_context_at, bin_tree_t, re_dfastate_t):
562 (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
563 (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
564 (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
565 (re_string_char_size_at, re_string_wchar_at):
566 (re_string_elem_size_at):
567 Use the new types and macros to port to 64-bit hosts.
568 Use unsigned types for internal values, so that the code
569 mostly works even for arrays larger than SSIZE_MAX.
570 * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
571 (search_duplicated_node, calc_eclosure_iter, fetch_number):
572 (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
573 (build_equiv_class, build_charclass, re_compile_fastmap_iter):
574 (free_dfa_content, create_initial_state, optimize_utf8, analyze):
575 (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
576 (calc_inveclosure, parse_dup_op, build_range_exp):
577 (build_collating_symbol, parse_bracket_exp, build_charclass_op):
578 (fetch_number, create_token_tree, mark_opt_subexp):
580 * regex_internal.c (re_string_construct_common, create_ci_newstate):
581 (create_cd_newstate, re_string_allocate, re_string_construct):
582 (re_string_realloc_buffers, build_wcs_upper_buffer):
583 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
584 (re_string_reconstruct, re_string_peek_byte_case):
585 (re_string_fetch_byte_case, re_string_context_at):
586 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
587 (re_node_set_init_copy, re_node_set_add_intersect):
588 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
589 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
590 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
591 (re_acquire_state, re_acquire_state_context, register_state):
593 * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
594 (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
595 (re_search_internal, re_search_2_stub, re_search_stub)
596 (re_copy_regs, check_matching, check_halt_state_context, update_regs):
597 (push_fail_stack, sift_states_iter_mb, build_sifted_states):
598 (update_cur_sifted_state, check_dst_limits):
599 (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
600 (check_subexp_limits, sift_states_bkref, merge_state_array):
601 (check_subexp_matching_top, get_subexp, get_subexp_sub):
602 (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
603 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
604 (expand_bkref_cache, check_node_accept_bytes):
605 (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
606 (re_search, re_match_2, re_search_2, prune_impossible_nodes):
607 (acquire_init_state_context, check_halt_node_context):
608 (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
609 (sift_states_backward, clean_state_log_if_needed):
610 (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
611 (find_recover_state, transit_state_sb, transit_state_mb):
612 (transit_state_bkref, build_trtable, match_ctx_clean):
614 * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
615 to work around an assumption that REG_MISSING is negative.
617 * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
618 (seek_collating_symbol_entry) [defined _LIBC]:
619 (lookup_collation_sequence_value) [defined _LIBC]:
620 (build_range_exp, build_collating_symbol) [defined _LIBC]:
621 Use prototypes rather than old-style function definitions.
622 * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
623 (transit_state_sb) [0]:
624 (find_collation_sequence_value) [defined _LIBC]: Likewise.
626 * regexec.c (re_search_internal): Simplify update of rm_so and
629 * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
630 (optimize_subexps, lower_subexp):
631 Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
632 since the signed shift might overflow. Use 1u<<31 instead.
633 * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
634 * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
637 * regcomp.c (optimize_subexps, lower_subexp):
638 Use CHAR_BIT rather than 8, for clarity.
639 * regexec.c (check_dst_limits_calc_pos_1):
640 (check_subexp_matching_top): Likewise.
641 * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
642 have to worry about portability issues when shifting it left.
643 Remove no-longer-needed test for table_size > 0.
644 * regcomp.c (parse_sub_exp): Do not shift more bits than there are
645 in a word, as the resulting behavior is undefined.
646 * regexec.c (check_dst_limits_calc_pos_1): Likewise;
647 in one case, a <= should have been an <, and in another case the
648 whole test was missing.
649 * regex_internal.h (BYTE_BITS): Remove. All uses changed to
650 the standard name CHAR_BIT.
651 * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
652 this is not true on one's complement and signed-magnitude hosts.
654 * regex_internal.h (re_sub_match_top_t): Remove unused member
656 (struct re_dfa_t): Remove unused member states_alloc.
657 * regcomp.c (init_dfa): Don't initialize unused members.
659 2005-08-31 Bruno Haible <bruno@clisp.org>
661 * strstr.c: Include <stddef.h>, for NULL.
662 * strcasestr.c: Likewise.
663 Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
665 2005-08-30 "Oskar Liljeblad" <oskar@osk.mine.nu>
667 * iconvme.h: Add prototype for iconv_alloc.
669 2005-08-29 Simon Josefsson <jas@extundo.com>
671 * iconvme.c: Fix errno.
673 2005-08-29 "Oskar Liljeblad" <oskar@osk.mine.nu>
675 * iconvme.c: Split iconv_string into iconv_alloc.
677 2005-08-27 Jim Meyering <jim@meyering.net>
679 * fopen-safer.c: Merge minor changes from coreutils.
680 * dup-safer.c: Likewise.
681 * fd-safer.c: Likewise.
683 Merge from coreutils.
684 * stdio--.h: New file.
685 * stdlib--.h: New file.
686 * mkstemp-safer.c: New file.
689 * pipe-safer.c: New file.
690 * creat-safer.c: New file.
691 * fcntl--.h (creat): Define to creat_safer.
692 * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
693 * unistd--.h (pipe): Define to pipe_safer.
694 * unistd-safer.h: Declare pipe_safer.
696 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
698 * regex_internal.h: Remove all references to
699 RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
701 (bitset_not, bitset_merge, bitset_not_merge):
702 (bitset_mask, re_string_allocate, re_string_construct):
703 (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
704 (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
705 (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
706 (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
707 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
708 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
709 (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
710 (re_acquire_state_context):
711 Remove unnecessary forward decls.
712 (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
713 Put __attribute at function definition,
714 now that the function decl has been removed.
715 * lib/regex_internal.c (re_string_peek_byte_case):
716 (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
719 2005-08-26 Simon Josefsson <jas@extundo.com>
721 * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
722 Haible <bruno@clisp.org>.
724 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
726 * regexec.c (set_regs): Don't alloca with an unbounded size.
728 alloca modernization/simplification for regex.
729 * regex.c: Remove portability cruft for alloca. This no longer
730 needs to be at the start of the file, and can be moved into
731 regex_internal.h and simplified.
732 * regex_internal.h: Include <alloca.h>.
733 (__libc_use_alloca) [!defined _LIBC]: New macro.
734 * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
735 now works outside glibc.
737 2005-08-24 Simon Josefsson <jas@extundo.com>
739 * getpass.c: Add WIN32 implementation. Conditionalize use of
740 termios.h, tcgetattr, tcsetattr and __fsetlocking. Remove some
743 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
745 Make regex safe for g++. This fixes one real bug (an "err"
746 that should have been "*err"). g++ problem reported by
748 * regex_internal.h (re_calloc): New macro, consistent with
749 re_malloc etc. All callers of calloc changed to use re_calloc.
750 * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
751 not int. All callers changed.
752 * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
753 just use an array of size MB_LEN_MAX.
754 * regexec.c (push_fail_stack): Use re_realloc, not realloc.
755 (find_recover_state): Change "err" to "*err"; this fixes what
756 appears to be a real bug.
757 (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
760 2005-08-25 Jim Meyering <jim@meyering.net>
762 * open-safer.c: Include <config.h>.
763 Otherwise, we'd lose LARGEFILE support in any file using
766 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
768 * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
769 * regex.h (regerror): Likewise.
771 * regex.c: Do not include <sys/types.h>, as POSIX no longer
772 requires this. (The code never needed it.)
774 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
775 All uses of recently-renamed identifiers changed to use the new,
776 POSIX-compliant names. The code will build and run just fine
777 without these changes, but it's better to eat our own dog food
778 and use the standard-conforming names.
780 * regex.h: Fix a multitude of POSIX name space violations.
781 These changes have an effect only for programs that define
782 _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
783 do not change anything for programs compiled in the normal way.
784 Also, there is no effect on the ABI.
786 (_REGEX_SOURCE): New macro.
787 Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
788 defined and _GNU_SOURCE is not; this fixes a name space violation.
790 Rename the following macros to obey POSIX requirements.
791 The old names are still visible as macros if _REGEX_SOURCE is defined.
792 (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
793 RE_BACKSLASH_ESCAPE_IN_LISTS.
794 (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
795 (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
796 (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
797 (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
798 (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
799 (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
800 (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
801 (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
802 (REG_INTERVALS): renamed from RE_INTERVALS.
803 (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
804 (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
805 (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
806 (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
807 (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
808 (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
809 (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
810 (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
811 RE_UNMATCHED_RIGHT_PAREN_ORD.
812 (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
813 (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
814 (REG_DEBUG): renamed from RE_DEBUG.
815 (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
816 (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit
817 unusual, since we can't clash with the POSIX REG_ICASE.
818 (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
819 (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
820 (REG_NO_SUB): renamed from RE_NO_SUB.
821 (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
822 (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
823 (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
824 (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
825 (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
826 (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
827 (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
828 (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
829 (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
830 (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
831 (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
832 (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
833 RE_SYNTAX_POSIX_MINIMAL_BASIC.
834 (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
835 (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
836 RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
837 (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it.
838 (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
839 (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
840 (REG_FIXED): Renamed from REGS_FIXED.
841 (REG_NREGS): Renamed from RE_NREGS.
843 (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
844 of other REG_* macros, since POSIX says the user is allowed to
845 #undef these macros selectively.
847 (reg_errcode_t): Update comment stating what other tables need
850 Rename the following enum values to obey POSIX requirements.
851 The old names are still visible as macros.
852 (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE
853 is not defined, since GNU is supposed to be a superset of POSIX as
854 much as possible, and since we want reg_errcode_t to be a signed
855 type for implementation consistency.
856 (_REG_NOERROR): Renamed from REG_NOERROR.
857 (_REG_NOMATCH): Renamed from REG_NOMATCH.
858 (_REG_BADPAT): Renamed from REG_BADPAT.
859 (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
860 (_REG_ECTYPE): Renamed from REG_ECTYPE.
861 (_REG_EESCAPE): Renamed from REG_EESCAPE.
862 (_REG_ESUBREG): Renamed from REG_ESUBREG.
863 (_REG_EBRACK): Renamed from REG_EBRACK.
864 (_REG_EPAREN): Renamed from REG_EPAREN.
865 (_REG_EBRACE): Renamed from REG_EBRACE.
866 (_REG_BADBR): Renamed from REG_BADBR.
867 (_REG_ERANGE): Renamed from REG_ERANGE.
868 (_REG_ESPACE): Renamed from REG_ESPACE.
869 (_REG_BADRPT): Renamed from REG_BADRPT.
870 (_REG_EEND): Renamed from REG_EEND.
871 (_REG_ESIZE): Renamed from REG_ESIZE.
872 (_REG_ERPAREN): Renamed from REG_ERPAREN.
873 (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
874 (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
875 (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
876 (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
878 (_REG_RE_NAME, _REG_RM_NAME): New macros.
879 (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses
880 changed. But support the old name if the new one is not defined
881 and if _REGEX_SOURCE.
883 Change the following member names in struct re_pattern_buffer.
884 The old names are still supported if !_REGEX_SOURCE.
885 The new names are always supported, regardless of _REGEX_SOURCE.
886 (re_buffer): Renamed from buffer.
887 (re_allocated): Renamed from allocated.
888 (re_used): Renamed from used.
889 (re_syntax): Renamed from syntax.
890 (re_fastmap): Renamed from fastmap.
891 (re_translate): Renamed from translate.
892 (re_can_be_null): Renamed from can_be_null.
893 (re_regs_allocated): Renamed from regs_allocated.
894 (re_fastmap_accurate): Renamed from fastmap_accurate.
895 (re_no_sub): Renamed from no_sub.
896 (re_not_bol): Renamed from not_bol.
897 (re_not_eol): Renamed from not_eol.
898 (re_newline_anchor): Renamed from newline_anchor.
900 Change the following member names in struct re_registers.
901 The old names are still supported if !_REGEX_SOURCE.
902 The new names are always supported, regardless of _REGEX_SOURCE.
903 (rm_num_regs): Renamed from num_regs.
904 (rm_start): Renamed from start.
905 (rm_end): Renamed from end.
907 (re_set_syntax, re_compile_pattern, re_compile_fastmap):
908 (re_search, re_search_2, re_match, re_match_2, re_set_registers):
909 Prepend __ to parameter names.
911 Undo yesterday's changes.
913 2005-08-24 Jim Meyering <jim@meyering.net>
916 * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
918 2005-08-21 Bruno Haible <bruno@clisp.org>
920 * lock.h: Add multiple inclusion guard.
921 * tls.h: Add multiple inclusion guard.
923 2005-08-23 Paul Eggert <eggert@cs.ucla.edu>
925 * regex.h (REG_NOSYS)
926 [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
927 Define, since POSIX requires it as of 2001.
928 (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
929 New private symbol, used to keep the enum signed in all cases.
930 * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
931 in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
933 * regex_internal.c (re_string_skip_chars, register_state):
935 Remove forward decls; no longer needed now that we use prototypes.
936 * regexec.c (acquire_init_state_context, check_halt_node_context):
937 (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
938 (clean_state_log_if_needed): Likewise.
940 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
942 Fix problems reported by Sam Steingold in
943 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
944 * regexec.c (sift_states_bkref): Fix portability bug: the code
945 assumed that reg_errcode_t is a signed type, which is not
946 necessarily true if _XOPEN_SOURCE is not defined.
947 * regex_internal.c (calc_state_hash): Put 'inline' before type, since
948 some compilers warn about it otherwise.
950 2005-08-20 Jim Meyering <jim@meyering.net>
952 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
953 of unused local, dfa.
955 2005-08-20 Paul Eggert <eggert@cs.ucla.edu>
957 * regcomp.c (create_initial_state): Remove duplicate decl.
958 (init_word_char, create_initial_state, duplicate_node_closure):
959 (fetch_token, peek_token_bracket, build_range_exp):
960 (build_collating_symbol): Remove forward decls; no longer needed
961 now that we use prototypes.
964 (re_compile_pattern, re_set_syntax, re_compile_fastmap):
965 (re_compile_fastmap_iter, regcomp, regerror, regfree):
966 (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
967 (create_initial_state, optimize_utf8, analyze, postorder, preorder):
968 (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
969 (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
970 (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
971 (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
972 (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
973 (build_range_exp, build_collating_symbol, parse_bracket_exp):
974 (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
975 (build_charclass, build_charclass_op, fetch_number, create_tree):
976 (create_token_tree, mark_opt_subexp, duplicate_tree):
977 Use prototypes rather than old-style definitions.
980 (re_string_allocate, re_string_construct, re_string_realloc_buffers):
981 (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
982 (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
983 (re_string_reconstruct, re_string_peek_byte_case):
984 (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
985 (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
986 (re_node_set_init_copy, re_node_set_add_intersect):
987 (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
988 (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
989 (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
990 (re_acquire_state, re_acquire_state_context, register_state):
991 (create_ci_newstate, create_cd_newstate, free_state):
993 * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
994 (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
995 (re_search_internal, prune_impossible_nodes):
996 (acquire_init_state_context, check_matching, static):
997 (check_halt_node_context, check_halt_state_context, proceed_next_node):
998 (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
999 (update_regs, sift_states_backward, build_sifted_states):
1000 (clean_state_log_if_needed, merge_state_array):
1001 (update_cur_sifted_state, add_epsilon_src_nodes):
1002 (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
1003 (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
1004 (sift_states_iter_mb, transit_state, merge_state_with_log, static):
1005 (find_recover_state, check_subexp_matching_top, transit_state_mb):
1006 (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
1007 (check_arrival, check_arrival_add_next_nodes):
1008 (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
1009 (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
1010 (check_node_accept_bytes, check_node_accept, extend_buffers):
1011 (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
1012 (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
1017 (re_string_allocate, re_string_construct, re_string_reconstruct):
1018 (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
1019 (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
1020 (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
1021 (re_string_context_at, re_string_peek_byte_case):
1022 (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
1023 is defined, since we now use prototypes always.
1025 * regex.h (_RE_ARGS): Remove. No longer needed, since we assume
1026 C89 or better. All uses removed.
1028 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1030 * regex_internal.c (re_acquire_state, re_acquire_state_context)
1031 [defined lint]: Suppress bogus uninitialized-variable warnings.
1033 * regcomp.c (duplicate_node): Return new index, not an error code,
1034 and let the caller return REG_ESPACE if out of space. This
1035 removes an uninitialied-variable warning with GCC 4.0.1, and also
1036 avoids taking the address of a local variable. All callers
1039 2005-08-19 Jim Meyering <jim@meyering.net>
1041 * regexec.c (proceed_next_node): Redo local variables to
1042 avoid GCC shadowing warnings.
1044 2005-08-19 Paul Eggert <eggert@cs.ucla.edu>
1046 * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
1047 (re_node_set_insert_last, re_dfa_add_node):
1048 Rename local variables to avoid GCC shadowing warnings.
1050 2005-08-18 Bruno Haible <bruno@clisp.org>
1052 * strstr.c (strstr): Fix return value in multibyte case.
1053 * strcasestr.c (strcasestr): Likewise.
1055 2005-08-17 Jim Meyering <jim@meyering.net>
1057 Make the %s format (seconds since the epoch) work for a negative
1058 number and when used with a zero-padded field width, e.g. %015s.
1060 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1061 label so that it precedes the code to set `digits'. Otherwise,
1062 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
1063 print `00-22'. Now, it prints `-0022', as it should.
1065 2005-08-17 Paul Eggert <eggert@cs.ucla.edu>
1067 * regex.h: Remove useless space-before-tab. From coreutils.
1069 2005-08-17 Bruno Haible <bruno@clisp.org>
1071 * strcasestr.h: New file.
1072 * strcasestr.c: New file.
1074 2005-08-17 Bruno Haible <bruno@clisp.org>
1076 * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
1077 * strstr.c: Completely rewritten, with multibyte locale support.
1079 2005-08-17 Bruno Haible <bruno@clisp.org>
1081 * strcasecmp.c: Use mbuiter.h.
1083 2005-08-17 Bruno Haible <bruno@clisp.org>
1085 * mbuiter.h: New file.
1087 2005-08-16 Bruno Haible <bruno@clisp.org>
1089 * strcasecmp.c (struct mbiter_multi): Remove at_end field.
1091 (mbi_avail, mbi_advance): Let the iteration end before the terminating
1092 NUL byte, not after it.
1094 2005-08-16 Bruno Haible <bruno@clisp.org>
1096 * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
1097 the valid ones. Makes the comparison operations transitive:
1098 cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
1099 * strcasecmp.c (strcasecmp): Use mb_casecmp.
1101 2005-08-16 Bruno Haible <bruno@clisp.org>
1103 * strcase.h (strcasecmp): Add note in comments.
1104 * strncasecmp.c: Use code from strcasecmp.c.
1105 * strcasecmp.c: Use mbchar module. Define private mbiter variant.
1106 (strcasecmp): Work correctly in multibyte locales.
1108 2005-08-16 Bruno Haible <bruno@clisp.org>
1110 * strnlen1.h: New file.
1111 * strnlen1.c: New file.
1113 2005-08-16 Bruno Haible <bruno@clisp.org>
1115 * mbfile.h: New file.
1117 2005-08-16 Bruno Haible <bruno@clisp.org>
1119 * mbiter.h: New file.
1121 2005-08-16 Bruno Haible <bruno@clisp.org>
1123 * mbchar.h: New file.
1124 * mbchar.c: New file.
1126 2005-08-16 Bruno Haible <bruno@clisp.org>
1128 * tls.h: New file, from GNU gettext.
1129 * tls.c: New file, from GNU gettext.
1131 2005-08-15 Bruno Haible <bruno@clisp.org>
1133 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
1136 2005-08-14 Jim Meyering <jim@meyering.net>
1138 Sync from coreutils.
1140 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
1141 Use the hash-table-based cycle-detection code not just when
1142 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
1143 Reported by James Youngman in
1144 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
1145 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
1146 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
1147 This lets us compile with -DFTS_DEBUG, once again.
1148 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
1149 * fts.c (fd_safer): Remove decl.
1150 Include fcntl--.h rather than unistd-safer.h
1151 (fts_safe_changedir): Don't call fd_safer; no longer needed
1152 now that we include fcntl--.h.
1154 2005-08-11 Simon Josefsson <jas@extundo.com>
1156 * readline.h, readline.c: New file.
1158 2005-08-11 Bruno Haible <bruno@clisp.org>
1160 * strnlen.h (strnlen): Change parameter name to match comment.
1162 2005-08-10 Simon Josefsson <jas@extundo.com>
1164 * strndup.c: Use strnlen.h.
1166 * strnlen.h: New file.
1168 2005-08-02 Simon Josefsson <jas@extundo.com>
1170 * getline.h, getline.c: Rewrite.
1172 * getdelim.h, getdelim.c: New files, ported from glibc.
1174 2005-07-31 Bruno Haible <bruno@clisp.org>
1176 * lock.h (gl_lock_initializer): New macro.
1177 (gl_lock_define_initialized): Use it.
1178 (gl_rwlock_initializer): New macro.
1179 (gl_rwlock_define_initialized): Use it.
1180 (gl_recursive_lock_initializer): New macro.
1181 (gl_recursive_lock_define_initialized): Use it.
1183 2005-07-26 Bruno Haible <bruno@clisp.org>
1185 * lock.h: Update from GNU gettext.
1186 * lock.c: Update from GNU gettext.
1188 2005-07-18 Bruno Haible <bruno@clisp.org>
1190 * lock.h (gl_once_t): New type.
1191 (gl_once_define, gl_once): New macros.
1192 * lock.c (fresh_once): New variable.
1193 (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
1196 2005-07-18 Simon Josefsson <jas@extundo.com>
1198 * check-version.c (check_version): Accept identical versions too.
1200 2005-07-18 Bruno Haible <bruno@clisp.org>
1202 * lock.h: New file, from GNU gettext.
1203 * lock.c: New file, from GNU gettext.
1205 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
1207 * quotearg.c: Add translator comment suggested by Bruno Haible,
1208 with a minor change.
1210 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
1212 * version-etc-fsf.c (version_etc_copyright): Parameterize the
1213 copyright symbol and the year.
1214 * version-etc.c (COPYRIGHT_YEAR): New constant.
1215 (version_etc_va): Use parameterized copyright notice.
1216 Reword to conform to the current GNU coding standards.
1218 2005-07-11 Simon Josefsson <jas@extundo.com>
1220 * size_max.h: New file.
1222 2005-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
1224 * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
1227 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
1228 and Paul Eggert <eggert@cs.ucla.edu>
1230 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
1231 in wint_t, not wchar_t. Remove now-unnecessary cast.
1233 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
1235 * regex.c, regex.h: Sync from libc.
1236 * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
1237 New files, synced from libc, except that regex_internal.h
1238 currently has a small porting fix.
1240 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
1242 Remove the dependency of the strftime module on the tzset module.
1243 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
1244 Copy the input structure, to work around some of the bug with
1245 Solaris 2.5.1 and Solaris 2.6. If you still care about these old
1246 Solaris releases, you should also use the tzset module, but we won't
1247 require it as a dependency any more since we don't want LGPLed code
1248 to depend on GPLed code.
1250 2005-07-02 Jim Meyering <jim@meyering.net>
1252 * backupfile.c (backup_args): Change a `0' to NULL.
1254 2005-07-01 Jim Meyering <jim@meyering.net>
1256 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
1257 * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
1258 * save-cwd.c, tempname.c:
1259 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
1260 and don't include <sys/file.h>).
1262 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
1264 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
1265 declares only 'struct timespec;' (!).
1267 2005-06-29 Jim Meyering <jim@meyering.net>
1269 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
1270 type name. Use the variable name instead.
1271 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
1273 2005-06-28 Simon Josefsson <jas@extundo.com>
1275 * check-version.h, check-version.c: New files.
1277 2005-06-28 Simon Josefsson <jas@extundo.com>
1279 * base64.c (base64_encode): Indent. Rename 'b64' to avoid
1280 collision with global variable. Better indentation. Don't
1281 increment buffer pointer beyond buffer end. Based on comments
1282 from Paul Eggert <eggert@cs.ucla.edu>.
1286 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
1288 * canon-host.c (canon-host): Append trailing "," to 0 in
1289 initializer of struct addrinfo, as an indication that we don't
1290 care how many members the structure has.
1292 2005-06-24 Derek Price <derek@ximbiot.com>
1293 and Bruno Haible <bruno@clisp.org>
1295 Remove stat module & update lstat.
1296 * stat.c: Remove this file...
1297 (slash_aware_lstat): ...moving this content and its support...
1298 * lstat.c (rpl_lstat): ...into here.
1299 * lstat.h: New file.
1301 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
1303 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
1304 (ranged_convert): Don't save conversion in a temporary struct.
1305 This causes a warning with GCC 4.0.0, and anyway in the typical
1306 case it's not worth the extra 100 bytes or so of code.
1307 (ranged_convert, __mktime_internal): When calling a function via a
1308 pointer P, use P () rather than (*P) (), as we now assume C89 or
1311 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
1313 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
1314 "who -r" failed to give output. Problem reported by Tim Waugh.
1316 * xmalloc.c (HAVE_GNU_CALLOC): New constant.
1317 (xcalloc): Use it to avoid needless tests.
1318 Problem reported by Jim Meyering.
1320 2005-06-16 Jim Meyering <jim@meyering.net>
1322 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
1323 when either N or S is zero.
1325 2005-06-16 Sergey Poznyakoff <gray@Mirddin.farlep.net>
1327 * argp.h (__option_is_short): Check upper limit of
1328 __key. Isprint() requires its argument to have the value
1329 of an unsigned char or EOF.
1331 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
1333 * fnmatch.c (fnmatch): If there is an encoding error in a
1334 multibyte string or pattern, fall back on unibyte matching.
1335 Problem reported by James Youngman.
1337 2005-06-08 Bruno Haible <bruno@clisp.org>
1339 * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
1342 2005-06-08 Bruno Haible <bruno@clisp.org>
1344 * csharpcomp.h: New file, from GNU gettext.
1345 * csharpcomp.c: New file, from GNU gettext.
1346 * csharpcomp.sh.in: New file, from GNU gettext.
1348 2005-06-07 Derek Price <derek@ximbiot.com>
1351 * glob_.h: Indent nested #ifdef.
1353 2005-06-02 Paul Eggert <eggert@cs.ucla.edu>
1355 Sync from coreutils.
1356 Use "file name" when talking about file names, instead of "filename"
1357 or "path", as per the GNU coding standards.
1358 * mkdir-p.c: Renamed from makepath.c.
1359 (make_dir_parents): Renamed from make_path. All callers changed.
1360 * mkdir-p.h: Likewise. All includers changed.
1361 * filenamecat.c: Renamed from path-concat.c.
1362 (file_name_concat): Renamed from path_concat. All callers changed.
1363 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
1364 * filenamecat.h: Likewise. All includers changed.
1365 * acl.c: Don't use "path" or "filename" to mean "file name"
1366 in comments or local variable names.
1367 * basename.c: Likewise.
1368 * canonicalize.c, canonicalize.h: Likewise.
1369 * dirname.c, dirname.h: Likewise.
1370 * euidaccess.c: Likewise.
1371 * exclude.c: Likewise
1372 * fnmatch_.h, fnmatch_loop.c: Likewise.
1373 * fsusage.c, fsuage.h: Likewise.
1374 * fts.c, fts_.h: Likewise.
1375 * getcwd.c: Likewise.
1376 * getloadavg.c: Likewise.
1377 * mkstemp.c: Likewise.
1378 * mountlist.c, mountlist.h: Likewise.
1379 * openat.c, openat.h: Likewise.
1380 * readlink-stub.c: Likewise.
1381 * readutmp.c, readutmp.h: Likewise.
1382 * rename.c: Likewise.
1383 * rmdir.c: Likewise.
1385 * savedir.c: Likewise.
1386 * stripslash.c: Likewise.
1387 * tempname.c: Likewise.
1388 * xreadlink.c: Likewise.
1389 * exclude.c (excluded_file_name): Renamed from excluded_filename.
1391 * exclude.h: Likewise.
1393 * euidaccess.c (getuid, getgid, getuid, getegid)
1394 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1395 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
1396 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1397 * pathmax.h: Include <limits.h> unconditionally, since other
1398 files have been getting away with it for years (MORE/BSD 4.3
1400 * userspec.c (getpwnam, getgrnam, getgrgid)
1401 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
1403 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
1404 Define to 256, not 255, as per modern POSIX.
1406 2005-06-01 Bruno Haible <bruno@clisp.org>
1408 * csharpexec.h: New file, from GNU gettext.
1409 * csharpexec.c: New file, from GNU gettext.
1410 * csharpexec.sh.in: New file, from GNU gettext.
1412 2005-05-31 Derek Price <derek@ximbiot.com>
1413 Paul Eggert <eggert@cs.ucla.edu>
1416 * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
1418 2005-05-29 Derek Price <derek@ximbiot.com>
1419 Paul Eggert <eggert@cs.ucla.edu>
1421 * glob_.h, glob.c: New files.
1423 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
1425 * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
1427 * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
1428 the configuration hassle isn't worth it.
1429 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
1430 (LONGEST_MODIFIER, PRIuMAX): Remove.
1432 2005-05-27 Bruno Haible <bruno@clisp.org>
1434 * getlogin_r.h: Remove second include of <stddef.h>.
1436 2005-05-25 Bruno Haible <bruno@clisp.org>
1437 Derek Price <derek@ximbiot.com>
1439 * getlogin_r.h: Simplify API documentation.
1441 2005-05-25 Derek Price <derek@ximbiot.com>
1442 Paul Eggert <eggert@cs.ucla.edu>
1444 * getlogin_r.c, getlogin_r.h: New files.
1446 2005-05-22 Bruno Haible <bruno@clisp.org>
1448 * minmax.h: Include <limits.h> only when it defines MIN, MAX.
1449 Also include <sys/param.h> if it defines MIN, MAX.
1450 Based on a patch by Derek Price <derek@ximbiot.com>.
1452 2005-05-22 Bruno Haible <bruno@clisp.org>
1454 * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
1455 (INT64_MIN): Fix definition.
1456 Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1458 * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
1459 NEED_SIGNED_INT_TYPES.
1461 * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
1462 HAVE_SYSTEM_INTTYPES.
1464 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
1466 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
1467 so that unistd-safer.h (GPL'ed code) need not be included.
1469 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
1472 * fts.c: Don't include "cycle-check.h" or "hash.h".
1473 (setup_dir, free_dir): New functions.
1474 (enter_dir, leave_dir): Define trivial
1475 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
1476 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
1477 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
1478 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
1479 Move to fts-cycle.c.
1480 (fts_open): Use setup_dir.
1481 (fts_close): Use free_dir.
1482 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
1483 This adds a label and some gotos, but the alternatives were messier.
1484 Check for memory allocation failure when entering a dir.
1485 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
1486 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
1487 (FTS): New member fts_cycle, that is a union that contains the
1488 old active_dir_ht and cycle_state. All uses changed to mention
1489 fts_cycle.ht and fts_cycle.state.
1490 * fts-cycle.c: New file, containing GPL'ed code migrated out of
1491 fts.c, with the following changes:
1492 (setup_dir, free_dir): New functions.
1493 (enter_dir): Now returns bool. Return true if successful, false
1494 if memory exhausted. All callers changed.
1495 Do not bother partly cleaning up on
1496 memory allocation failure; that is free_dir's job.
1497 However, free ad if hash_insert fails, to avoid memory leak.
1498 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
1499 fts->fts_options to see which union member to use.
1501 2005-05-20 Jim Meyering <jim@meyering.net>
1503 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
1504 Now a macro, to pacify GCC.
1506 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
1508 * chown.c (rpl_chown): Return -1 on failure.
1510 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
1512 * canonicalize.c: Include canonicalize.h first, to test interface.
1513 Include <stddef.h> unconditionally, since we assume C89 now.
1514 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
1515 * fts.c: Include fts_.h first, to check interface.
1516 Do not include intprops.h; no longer needed.
1517 Include cycle-check.h and hash.h, since fts_.h no longer does.
1518 Remove unnecessary casts of closedir to void.
1519 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
1520 decide whether to decrement nlinks.
1521 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
1522 (FTS): Use struct hash_table * instead of Hash_table, so that
1523 we no longer need to include hash.h here.
1525 2005-05-17 Jim Meyering <jim@meyering.net>
1527 * fts.c, fts_.h: New files, from coreutils.
1529 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
1531 Sync from coreutils.
1532 * unlinkdir.c, unlinkdir.h: New files.
1533 * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
1534 regex.h, unlocked-io.h, xtime.h:
1535 White space changes only.
1536 * makepath.c (make_path): Port to hosts where leading "//" is special.
1537 * yesno.c: Include getline.h, not ctype.h.
1538 (yesno): Don't remove leading white space; POSIX doesn't allow it.
1539 Use getline to remove arbitrary restriction on response length.
1541 2005-05-13 Bruno Haible <bruno@clisp.org>
1543 * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
1544 int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
1545 UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
1546 INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
1547 INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
1548 Add support for 64-bit integers in the MSVC compiler.
1550 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
1552 * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
1553 Change the initial comment to refer to GPL, not LGPL.
1554 gnulib-tool will change it to LGPL as needed.
1556 * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
1557 argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
1558 argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
1559 argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
1560 argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
1561 backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
1562 byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
1563 c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
1564 canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
1565 classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
1566 concatpath.c, config.charset, copy-file.c, copy-file.h,
1567 cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
1568 dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
1569 eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
1570 execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
1571 fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
1572 file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
1573 findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
1574 fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
1575 full-read.c, full-read.h, full-write.c, full-write.h,
1576 fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
1577 getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
1578 getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
1579 gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
1580 getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
1581 getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
1582 getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
1583 gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
1584 group-member.c, group-member.h, hard-locale.c, hard-locale.h,
1585 hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
1586 iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
1587 inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
1588 javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
1589 lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
1590 linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
1591 logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
1592 makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
1593 md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
1594 memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
1595 memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
1596 mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
1597 mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
1598 openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
1599 path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
1600 physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
1601 posixver.c, printf-args.c, printf-args.h, printf-parse.c,
1602 printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
1603 quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
1604 readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
1605 readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
1606 regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
1607 safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
1608 save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
1609 settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
1610 sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
1611 stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
1612 stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
1613 strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
1614 strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
1615 strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
1616 strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
1617 strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
1618 strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
1619 timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
1620 ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
1621 unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
1622 utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
1623 vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
1624 version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
1625 w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
1626 xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
1627 xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
1628 xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
1629 xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
1630 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
1631 xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
1632 Update FSF postal mail address.
1634 2005-05-10 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1636 * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
1637 specified in ai_socktype. Fix invalid ai_protocol
1638 check. ai_protocol is usually set to 0 or depending on
1639 ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP. Checking for
1640 SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid. Set
1641 ai_socktype / ai_protocol in the returned addrinfo structure.
1643 2005-05-09 Yoann Vandoorselaere <yoann.v@prelude-ids.com>
1644 Bruno Haible <bruno@clisp.org>
1646 * inet_ntop.h: New file.
1647 * inet_ntop.c: New file, from glibc with modifications.
1649 2005-05-08 Jim Meyering <jim@meyering.net>
1651 * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
1653 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
1655 Merge from coreutils. Among other things,
1656 add bulletproofing for cases where stdin, stdout, or stderr are closed.
1657 * fd-safer.c: New file.
1658 * fcntl-safer.h, open-safer.c: Remove.
1659 * chdir-long.c: Fix comment "fetish" -> "coreutils".
1660 * dup-safer.c: Include unistd-safer.h first.
1661 Don't include errno.h.
1662 (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
1663 * file-type.h: Don't assume invoker included sys/stat.h first.
1664 * file-type.c: Rely on file-type.h change.
1665 * getloadavg.c: Include unistd-safer.h.
1666 (getloadavg): Use safer open.
1667 * getusershell.c: Include "stdio-safer.h".
1668 (getusershell): Use safer fopen.
1669 * long-options.c (long_options): Use NULL rather than 0.
1670 * modechange.h (mode_free): Remove; all callers changed to invoke
1672 * modechange.c: Likewise.
1673 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
1674 (MODE_DONE): New constant.
1675 (struct mode_change): Remove 'next' member.
1676 (make_node_op_equals): New function; like the old one of the
1677 same name, except it allocates an array.
1678 (mode_compile, mode_create_from_ref): Use it.
1679 (mode_compile): Allocate result as an array, not a linked list.
1680 Parse octal string ourself, so that we catch mistakes like "+0".
1681 (mode_adjust): Arg is an array, not a linked list.
1682 * modechange.c: Include stat-macros.h, xalloc.h.
1683 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
1684 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
1685 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
1686 Remove. This is now stat-macros.h's job.
1687 (talloc): Remove. All callers replaced by xalloc, so that
1688 our invokers don't have to worry about reporting memory failures.
1689 (make_node_op_equals): Remove.
1690 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
1692 (struct mode_change): Moved here from modechange.h.
1693 (mode_append_entry): Remove.
1694 (mode_compile): Remove MASKED_OPS arg, since it encouraged
1695 apps to have incorrect behavior. Use simpler algorithm for head
1696 and tail. Don't futz with umask; that's now the job of mode_adjust.
1697 Detect more invalid usages rather than having somewhat-random behavior.
1698 Don't insert an "a=" action, as that leads to incorrect behavior.
1699 (mode_compile, mode_create_from_ref): Return NULL on error instead
1700 of an enum, since now there's only one way to have an error. All
1702 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
1703 at the correct time. Simplify calculation of "+u" and its ilk.
1704 Don't mishandle "+X".
1705 (mode_free): Remove "register" and localize decls.
1706 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
1707 (struct mode_change): Move to modechange.c; callers don't
1708 need to see this stuff.
1709 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
1710 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
1711 (mode_change, mode_adjust): Reflect the new signatures noted above.
1712 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
1713 that might redefine system include files.
1714 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
1715 (my_usleep): Use NULL rather than (void *) 0.
1716 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
1717 Use siginterrupt to specify that system calls should be interrupted.
1718 (rpl_nanosleep): Move initialization of suspended closer to call of
1720 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
1721 * readutmp.c: Likewise. Include signal.h, stdbool.h.
1722 (desirable_utmp_entry): New function.
1723 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
1724 using x2nrealloc, to simplify logic.
1725 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
1726 size calculation. Do not assume utmp file is a regular file.
1727 * readutmp.h (UT_PID): Moved here from ../src/who.c.
1728 (READ_UTMP_CHECK_PIDS): New constant.
1729 * save-cwd.c: Include unistd-safer.h.
1730 (save_cwd): Use fd_safer.
1731 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
1732 [!_LIBC] Include "stat-macros.h" instead.
1733 * unistd-safer.h (fd_safer): New decl.
1735 2005-05-01 Oskar Liljeblad <oskar@osk.mine.nu>
1737 * byteswap_.h: New file.
1739 2005-04-25 Albert Chin <china@thewrittenword.com>
1741 * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
1744 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
1746 * getdate.y (zone): Allow relunit_snumber after tZONE, so
1747 that "UTC +1 second" continues to work. Problem reported
1749 (relunit_snumber): New rule.
1752 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
1754 * getdate.y (universal_time_zone_table): New constant.
1755 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
1756 universal_time_zone_table.
1757 (lookup_zone): Prefer universal_time_zone_table to
1758 local_time_zone_table, so that "GMT" time stamps are allowed in
1759 London during the summer. Problem reported by Ian Abbott.
1761 2005-04-12 Jim Meyering <jim@meyering.net>
1763 * human.c (humblock): Set *options even when returning due to
1764 xstrtoumax conversion failure. Thanks to a used-uninitialized
1767 2005-04-09 Jim Meyering <jim@meyering.net>
1769 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
1770 -Wuninitialized: initialize tm0.tm_year.
1772 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
1774 * getdate.y (parser_control): rels_seen is now a boolean, not a
1775 count, since there's no maximum. All uses changed.
1776 Add member dsts_seen.
1777 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
1779 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
1780 Use pc_rels_seen to decide whther a date is absolute.
1782 * getdate.y (number): Don't overwrite year.
1783 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
1786 2005-04-02 Simon Josefsson <jas@extundo.com>
1788 * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
1789 patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
1791 2005-03-27 Jim Meyering <jim@meyering.net>
1793 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
1795 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
1797 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
1798 "one's complement" -> "ones' complement" in comment, as per Knuth.
1799 "value of type" -> "type or expression" in comment.
1800 * mktime.c, strftime.c: Propagate intprops.h comment nits.
1802 2005-03-26 Jim Meyering <jim@meyering.net>
1805 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
1806 Correct typos: s/or/of/.
1808 2005-03-23 Jim Meyering <jim@meyering.net>
1810 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
1812 2005-03-21 Jim Meyering <jim@meyering.net>
1814 Changes imported from coreutils.
1816 * cycle-check.c: Don't include xalloc.h.
1818 * path-concat.c: Don't include assert.h.
1819 (path_concat): Remove assertion that would have triggered
1820 for ABASE starting with more than one slash.
1821 Reported by Andreas Schwab.
1823 * path-concat.c (path_concat): Set *BASE_IN_RESULT
1824 properly when ABASE is an absolute file name.
1825 Correct the description of this function.
1827 Add an assertion and a test driver.
1828 This fixes a bug introduced on 2004-07-02.
1829 Andreas Schwab reported the resulting failure of cp --parents:
1830 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
1832 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
1834 * strftime.c (my_strftime): If the underlying strftime returns 0
1835 (which shouldn't happen), generate nothing instead of returning 0
1836 immediately, so that nstrftime (NULL, ...) doesn't return 0.
1838 2005-03-16 Bruno Haible <bruno@clisp.org>
1840 * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
1842 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
1844 * strftime.c (my_strftime): Prepend space to format so that we can
1845 reliably distinguish strftime failure from empty output on POSIX
1848 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
1850 * iconvme.c (SIZE_MAX): New macro, if not already defined.
1851 (iconv_string): Don't guess a size-zero buffer, as that might cause
1852 buffer overrun. Instead, avoid multiplying by MB_LEN_MAX if the
1853 result would be 'too large', where 'too large' is (heuristically)
1854 the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
1855 overflow concerns. This will prevent some unwanted malloc failures
1856 when the inputs are very large.
1858 2005-03-15 Bruno Haible <bruno@clisp.org>
1860 * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
1863 * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
1866 * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
1868 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
1870 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
1871 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
1873 * strtol.c: Likewise.
1875 2005-03-14 Simon Josefsson <jas@extundo.com>
1877 * timegm.h: Use proper prototype CPP guards, reported by Dave Love
1880 2005-03-14 Jim Meyering <jim@meyering.net>
1882 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
1883 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
1884 to be nonzero so that we (and caller) can detect the difference
1885 between a valid zero-length expansion and an error return, even
1886 when the underlying strftime fails before writing anything into
1889 2005-03-10 Jim Meyering <jim@meyering.net>
1891 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
1892 so that this module works on systems without fchdir.
1894 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
1896 Factor int-properties macros into a single file, except for
1897 glibc-related files.
1898 * intprops.h: New file.
1899 * getloadavg.c: Include it instead of limits.h.
1900 (INT_STRLEN_BOUND): Remove.
1901 * human.c: Include intprops.h.
1902 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
1903 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
1904 * inttostr.h: Include intprops.h instead of limits.h.
1905 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
1906 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
1907 for consistency with intprops.h.
1908 (time_t_is_integer, twos_complement_arithmetic): Use them.
1909 * sig2str.h: Include <signal.h>, intprops.h.
1910 (INT_STRLEN_BOUND): Remove.
1911 * strftime.c (TYPE_SIGNED): Remove.
1912 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
1913 * strtol.c: Adjust comments to match intprops.h.
1914 * userspec.c: Include intprops.h.
1915 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
1916 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
1917 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
1918 instead of rolling our own expressions.
1919 * xstrtol.c: Include xstrtol.h first, to test interface.
1921 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
1923 (my_strftime): Do not mishandle years close to INT_MAX, by doing
1924 the right thing even if adding 1900 would overflow. Similarly
1925 for tm_mon + 1 and tm_yday + 1.
1926 Make %Y always equivalent to %C%y, and similarly for %G and %g.
1927 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
1928 (DO_SIGNED_NUMBER): New macro.
1929 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
1931 2005-03-07 Bruno Haible <bruno@clisp.org>
1933 * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
1935 2005-03-03 Derek R. Price <derek@ximbiot.com>
1936 Bruno Haible <bruno@clisp.org>
1938 * pagealign_alloc.h: New file.
1939 * pagealign_alloc.c: New file.
1941 2005-01-28 Bruno Haible <bruno@clisp.org>
1943 * stpncpy.h (stpncpy): Define as a macro without arguments, so that
1946 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
1948 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
1949 The workaround isn't strictly needed for POSIX conformance, and
1950 it's too much of a pain to configure and maintain. We'll ask
1951 people to fix their kernels instead.
1952 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
1953 (NANOSLEEP_BUG_WORKAROUND): Remove.
1954 (xnanosleep): Remove the workaround.
1956 2005-02-12 Bruno Haible <bruno@clisp.org>
1958 * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
1960 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
1962 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
1963 * timespec.h (gettime): Return void, since it always
1964 succeeds now. All uses changed.
1965 * gettime.c (gettime) Likewise.
1966 [HAVE_NANOTIME]: Prefer nanotime.
1967 Assume gettimeofday succeeds, as POSIX requires.
1968 Assime time () succeeds, since other code already does.
1969 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
1970 (timespec_subtract): Remove.
1971 (NANOSLEEP_BUG_WORKAROUND): New constant.
1972 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
1973 things considerably. Use it only on GNU/Linux hosts, since the
1974 workaround shouldn't be needed elsewhere.
1976 2005-02-24 Bruno Haible <bruno@clisp.org>
1978 * gettext.h: Update from GNU gettext 0.14.2.
1980 2005-02-24 Bruno Haible <bruno@clisp.org>
1982 * localcharset.c: Update from GNU gettext 0.14.2.
1983 * config.charset: Update from GNU gettext 0.14.2.
1985 2005-02-22 Simon Josefsson <jas@extundo.com>
1987 * iconvme.h, iconvme.c: New files, from libc.
1989 2005-02-20 Neil Conway <neilc@samurai.com>
1991 * xgethostname.c (xgethostname): Check for ENOMEM, which is
1992 returned by OSX/Darwin if the specified buffer is not large
1993 enough for the hostname.
1995 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
1997 * memrchr.h: New file.
1998 * chdir-long.c: Include it.
1999 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
2000 Don't bother including stddef.h.
2002 2005-02-03 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2004 * argp-help.c (__argp_help): Create a fake struct argp_state and
2005 pass it to _help, otherwise the latter coredumps trying to
2006 dereference state.root_argp.
2008 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
2010 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2012 Include <sys/types.h>, for dev_t.
2013 (ME_DUMMY, ME_REMOTE): Move from here....
2014 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2015 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
2017 Include mountlist.h first, to test the interface.
2019 2005-01-29 Bruno Haible <bruno@clisp.org>
2021 * progname.c (program_name): Initialize.
2022 Needed when linking statically on MacOS X.
2024 2005-01-28 Bruno Haible <bruno@clisp.org>
2026 * javacomp.sh.in: New file, from GNU gettext.
2027 * javacomp.h: New file, from GNU gettext.
2028 * javacomp.c: New file, from GNU gettext.
2030 2005-01-26 Bruno Haible <bruno@clisp.org>
2032 * javaexec.sh.in: New file, from GNU gettext.
2033 * javaexec.h: New file, from GNU gettext.
2034 * javaexec.c: New file, from GNU gettext.
2036 2005-01-26 Simon Josefsson <jas@extundo.com>
2038 * gai_strerror.c: Use GPL in header.
2040 2005-01-24 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2042 * argp-help.c (hol_entry_help): Avoid using non-constant
2043 initializers for struct pentry_state.
2044 (__argp_error): Check return value of __asprintf
2045 (__argp_failure): Translate error message
2047 * argp-parse.c: Removed braces around the expansion of N_()
2049 2005-01-21 Jim Meyering <jim@meyering.net>
2051 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2052 same value as for Solaris 9.
2054 * chdir-long.c (chdir_long): Rewrite to remove limitation on
2055 component length. This included changing the parameter to be
2056 of type `char *' rather than `char const *'.
2057 * chdir-long.h (chdir_long): Update prototype.
2059 * openat.c (fdopendir, fstatat): New functions.
2060 * openat.h: Include headers required for use of DIR and struct stat.
2061 [AT_SYMLINK_NOFOLLOW]: Define.
2062 (fdopendir, fstatat): Add prototypes.
2064 2005-01-21 Bruno Haible <bruno@clisp.org>
2066 * classpath.h: New file, from GNU gettext.
2067 * classpath.c: New file, from GNU gettext.
2069 2005-01-20 Simon Josefsson <jas@extundo.com>
2071 * version-etc-fsf.c: New file, with version_etc_copyright.
2072 * version-etc.c: Remove version_etc_copyright.
2073 * version-etc.h (version_etc_copyright): Use [] instead of * in
2074 prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
2076 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
2078 * save-cwd.c (save_cwd): Remove code to support the case
2079 where fchdir is missing or flaky.
2081 2005-01-20 Simon Josefsson <jas@extundo.com>
2083 * base64.h (isbase64): Add.
2085 * base64.c (isb64): Rename to isbase64, use to_uchar instead of
2086 using a unsigned prototype, don't inline.
2087 (base64_decode): Use it.
2089 2005-01-19 Bruno Haible <bruno@clisp.org>
2091 * sh-quote.h: New file, from GNU gettext.
2092 * sh-quote.c: New file, from GNU gettext.
2094 2005-01-18 Paul Eggert <eggert@cs.ucla.edu>
2096 Merge changes from coreutils, as described below in several
2097 changelogs dated today.
2099 * save-cwd.c: Include "save-cwd.h" before other include files.
2100 (O_DIRECTORY): Remove; not needed here, since "." must be
2101 a directory. All uses removed.
2102 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
2103 universal on Suns, and we also need to test for IRIX.
2104 Revamp code to use 'if' rather than '#if'.
2105 Avoid unnecessary comparison of cwd->desc to 0.
2107 * utimens.c (futimens): Robustify the previous patch, by checking
2108 for known valid error numbers rather than observed invalid ones.
2110 2005-01-18 Jim Meyering <jim@meyering.net>
2112 * version-etc.c (version_etc_copyright): Update copyright date.
2114 * utimens.c (futimens): Account for the fact that futimes
2115 can also fail with errno == ENOSYS or errno == ENOENT.
2116 Patch from Dmitry V. Levin.
2118 Change the name of the robust chdir function from chdir to chdir_long.
2119 * save-cwd.c: Include chdir-long.h rather than chdir.h.
2120 (restore_cwd): Use chdir_long, not chdir.
2121 * chdir-long.c: Renamed from chdir.c.
2122 * chdir-long.h: Renamed from chdir.h.
2123 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
2126 2005-01-18 Bob Proulx <bob@proulx.com>
2128 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
2129 offsetof() macro construct to avoid compile failure with native HP-UX
2130 11.0 ANSI C compiler.
2132 2005-01-06 Bruno Haible <bruno@clisp.org>
2134 * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
2135 because stpncpy.m4 takes care of it.
2137 2004-01-24 Bruno Haible <bruno@clisp.org>
2139 * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
2141 2003-10-09 Bruno Haible <bruno@clisp.org>
2143 * progreloc.c: Include xalloc.h instead of xmalloc.h.
2145 2005-01-06 Bruno Haible <bruno@clisp.org>
2147 * fwriteerror.h (fwriteerror): Change specification to include fclose.
2148 * fwriteerror.c: Include <stdbool.h>.
2149 (fwriteerror): At the end, close the file stream. Record whether
2150 stdout was already closed.
2152 2004-05-27 Bruno Haible <bruno@clisp.org>
2154 * execute.c (environ): Declare if needed.
2155 * pipe.c (environ): Likewise.
2156 Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
2158 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
2160 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
2161 definitions to be after all include files, to avoid collisions.
2162 Problem reported by Bob Proulx.
2164 2004-12-28 Paul Eggert <eggert@cs.ucla.edu>
2166 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
2167 not needed. This removes a dependency on the gettext module.
2168 [defined _LIBC]: Do not include <libintl.h>; not needed.
2170 2004-12-24 Paul Eggert <eggert@cs.ucla.edu>
2172 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
2175 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
2177 * argp-parse.c: Include <stddef.h>.
2178 (alignof, alignto): New macros.
2179 (parser_init): Don't assume that void * is aligned sufficiently
2182 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
2183 need to extend the stack.
2184 (YYINITDEPTH): New macro, so that the initial stack isn't overly
2187 2004-12-22 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2189 * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
2191 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
2193 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
2194 Remove now-obsolete comment about AIX.
2195 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
2196 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
2197 (YYMAXDEPTH): New macro.
2199 2004-12-18 Bruno Haible <bruno@clisp.org>
2201 * fatal-signal.c (fatal_signals): Make non-const.
2202 (init_fatal_signals): New function.
2203 (uninstall_handlers, install_handlers): Ignore signals that were set to
2205 (at_fatal_signal): Call init_fatal_signals.
2206 (init_fatal_signal_set): Likewise. Ignore signals that were set to
2208 Reported by Paul Eggert.
2210 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2212 * getdate.y (textint): New member "negative".
2213 (time_zone_hhmm): New function.
2214 Expect 14 shift-reduce conflicts, not 13.
2215 (o_colon_minutes): New rule.
2216 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
2217 (yylex): Set the "negative" member of signed numbers.
2219 2004-12-04 Paul Eggert <eggert@cs.ucla.edu>
2221 Changes imported from coreutils.
2222 * hard-locale.c: Assume <locale.h> exists.
2224 (GLIBC_VERSION): New macro.
2225 (hard_locale): Assume setlocale exists.
2226 Rewrite to avoid #ifdef.
2227 Use strdup rather than malloc + strcpy.
2228 * human.c: Assume <locale.h> exists.
2229 (human_readable): Assume localeconv exists.
2231 2004-12-01 Jakub Jelinek <jakub@redhat.com>
2233 * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
2234 convert T2, not T. (Imported from libc.)
2236 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
2238 * getcwd.c (is_ENAMETOOLONG): New macro.
2239 (__getcwd.c): Don't restore errno; glibc doesn't.
2240 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
2241 first, falling back to our code only if its results look suspicious.
2242 Ensure that the resulting buffer is only as large as necessary.
2244 * readutmp.c: Include readutmp.h first.
2245 Include <errno.h>, since readutmp.h no longer does that.
2246 * readutmp.h: Don't include <errno.h>,
2247 <sys/param.h>, <time.h>; not needed to establish interface.
2248 (errno): Remove decl.
2249 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
2250 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
2251 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
2253 2004-11-28 Simon Josefsson <jas@extundo.com>
2255 * base64.h, base64.c: New file.
2257 2004-11-27 Paul Eggert <eggert@cs.ucla.edu>
2259 * getcwd.h: New file, which I forgot to check in on 2004-11-25.
2261 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
2263 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
2264 HP's ANSI C compiler.
2265 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
2266 Declaring int functions causes warnings on some modern systems and
2267 shouldn't be needed to compile on ancient ones.
2268 * same.c (MIN) [defined MIN]: Don't define, since it's already
2271 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
2272 with the following changes.
2273 (__set_errno): Parenthesize properly.
2274 Include <stdbool.h>.
2275 (MIN, MAX, MATCHING_INO): New macros.
2276 (__getcwd): Define with prototype, not K&R form.
2277 Use heuristics to allocate default buffer on stack if possible.
2278 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
2279 behavior, and to avoid the PATH_MAX limit when computing
2281 Use MATCHING_INO to compare inode number to file.
2282 Check for arithmetic overflow in size calculations.
2283 Fix bug in reallocation of dot array that caused getcwd to fail
2284 on directories nested deeper than 75.
2285 Be more careful about saving errno on error.
2286 Do not use realloc; use only free+malloc, as this is a bit
2287 more flexible and avoids a needless copy operation.
2288 Do not inspect st_dev and st_ino for symbolic links; POSIX
2289 doesn't specify the latter.
2290 Check for closedir errors.
2291 Avoid needless casts.
2292 Use "#ifdef weak_alias" around weak_alias, to be like other
2294 The following changes to getcwd.c have effect only when used in
2295 gnulib; they have no effect inside glibc proper.
2296 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
2297 as alloca isn't used.
2298 (alloca, __alloca): Likewise.
2299 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
2300 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
2301 unconditionally, as gnulib assumes C89 or better.
2302 Do not include <sys/param.h>.
2303 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
2304 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
2306 (NULL) [!defined NULL]: Remove; we assume C89 or better.
2307 Include <dirent.h> in a way that is compatible with modern Autoconf.
2308 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
2309 New macros, if not already defined.
2310 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
2311 Use "_LIBC", not "defined _LIBC", for consistency.
2312 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
2314 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
2315 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
2316 * xgetcwd.c: David MacKenzie's old code was removed, so give
2317 credit only to Jim Meyering and adjust the copyright dates.
2318 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
2319 <stdlib.h>, <unistd.h>, "pathmax.h".
2320 Instead, include "xgetcwd.h" (first) and "getcwd.h".
2321 (INITIAL_BUFFER_SIZE): Remove.
2322 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
2324 2004-11-23 Jim Meyering <jim@meyering.net>
2326 * getopt_.h: Remove trailing blanks.
2328 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
2330 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
2331 (futimens): New function, which uses futimes if available.
2332 (futimens, utimens): Support timespec==NULL, with same semantics
2333 as utime and utimens.
2334 * utimens.h (futimens): New decl.
2336 2004-11-23 Jim Meyering <jim@meyering.net>
2338 * __fpending.c: Add comment.
2340 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2342 * getopt_.h: Re-addition of __getopt_argv_const caused
2343 redefinition warnings. To avoid them, include the defines
2344 in `#if !defined __need_getopt ... #endif'. The only place
2345 where __getopt_argv_const is used is in definitions
2346 of getopt_long and getopt_long_only below, which are as well
2347 protected by `#ifndef __need_getopt'.
2348 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
2349 __need_getopt after including <stdio.h> and <unistd.h> These
2350 headers might have defined it.
2352 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
2354 * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
2356 (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
2357 optopt): Use them instead of invoking ## directly; otherwise, the
2358 symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
2360 2004-11-19 Bruno Haible <bruno@clisp.org>
2362 * strtok_r.c: Move comments from here...
2363 * strtok_r.h: ... to here.
2365 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
2367 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
2368 might fail. Problem reported by Yoann Vandoorselaere.
2369 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
2370 that mishandle size_t overflow.
2372 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
2374 * canon-host.c: Include "strdup.h".
2375 (canon_host): Use getaddrinfo if available, so that IPv6 works.
2376 Use strdup instead of malloc/strcpy to duplicate strings.
2378 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
2379 (human_space_before_unit): New constant.
2380 * human.c (human_readable): Support it.
2382 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
2383 (xgetcwd): Set errno correctly when failing.
2384 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
2385 the failure is actually due to a PATH_MAX problem.
2387 Further getopt changes to make it more likely that glibc will
2388 buy the changes back.
2389 * getopt.c (POSIXLY_CORRECT): New constant.
2390 (getopt): Use it, so to preserve glibc semantic
2391 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
2392 when compiling for libc.
2393 * getopt_.h (__getopt_argv_const): Bring it back.
2394 (getopt_long, getopt_long_only): Use it.
2396 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
2397 New arg POSIXLY_CORRECT. All callers changed.
2398 (getopt): Argv is now char * const *, as per standard.
2399 (_getopt_internal_r, _getopt_internal): Argv is now char **,
2400 not char *__getopt_argv_const *.
2401 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2402 _getopt_long_only_r): Likewise.
2403 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
2404 * getopt_int.h (_getopt_internal, _getopt_internal_r,
2405 _getopt_long_r, _getopt_long_only_r): Likewise.
2406 * getopt_.h (__getopt_argv_const): Remove.
2407 (getopt): Argv is now char * const *, as per standard.
2409 * getdate.y (tORDINAL): New token.
2410 (day, relunit): Allow it for relative times.
2411 (relative_time_table): Use tORDINAL for ordinals.
2413 2004-11-15 Jim Meyering <jim@meyering.net>
2415 * closeout.c: Include "__fpending.h" once again.
2416 Include <stdbool.h>.
2417 (close_stdout): Don't fail just because stdout was closed initially,
2418 since some programs don't write to stdout in the normal course of
2419 operation (other than --version and --help), and we don't want this
2420 function to make e.g. `touch file >&-' fail.
2421 But do fail if it was closed and someone has tried to write to it.
2422 E.g., `printf foo >&-' must fail.
2424 2004-11-11 Simon Josefsson <jas@extundo.com>
2426 * strtok_r.h, strtok_r.c: New file.
2428 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
2430 * getopt_.h (__getopt_argv_const): New macro, to be used so that
2431 we can stop lying to compilers about the constness of argv when we
2432 are compiled outside glibc.
2433 (getopt, getopt_long, getopt_long_only): Use it.
2434 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
2436 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
2437 _getopt_long_only_r): Likewise.
2438 * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
2439 _getopt_long_only_r): Likewise.
2441 * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
2442 Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
2443 Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
2444 the other external symbols.
2445 (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
2446 declaration, since the above renaming now works around collisions.
2448 2004-11-11 Jim Meyering <jim@meyering.net>
2450 * linebreak.c: Remove trailing blanks.
2451 * alloca_.h: Likewise.
2452 * acosl.c: Likewise.
2453 * euidaccess.c: Likewise.
2454 * allocsa.h: Likewise.
2456 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
2458 * mktime.c (SHR): New macro, which is a portable
2459 substitute for >> that should work even on Crays.
2460 (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
2461 Problem reported by Mark D. Baushke in
2462 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
2463 * getdate.y (SHR): Likewise.
2465 * strftime.c (SHR): Likewise.
2467 * quotearg.c (struct quoting_options): Use unsigned int for
2468 quote_these_too, so that right shifts are well defined. All uses
2471 2004-11-10 Simon Josefsson <jas@extundo.com>
2473 * getaddrinfo.h, getaddrinfo.c: New files.
2475 2004-11-10 Jim Meyering <jim@meyering.net>
2477 Ensure that no close failure goes unreported.
2478 * closeout.c (close_stdout): Always close stdout. I.e., don't
2479 return early when it seems there's nothing to flush.
2480 Don't include __fpending.h.
2482 2004-11-09 Paul Eggert <eggert@cs.ucla.edu>
2484 * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
2486 2004-11-05 Bruno Haible <bruno@clisp.org>
2488 * readlink.c: Include stddef.h, needed for size_t on Woe32.
2489 Reported by Mark D. Baushke <mdb@cvshome.org>.
2491 2004-11-04 Bruno Haible <bruno@clisp.org>
2493 2004-09-11 Bruno Haible <bruno@clisp.org>
2494 * allocsa.valgrind: New file.
2495 2004-02-06 Bruno Haible <bruno@clisp.org>
2496 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
2497 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
2498 Reported by Christopher Seip <chris.seip@hp.com>.
2500 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
2502 * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
2503 with errno == ERANGE if the buffer is too small.
2504 Problem reported by Mark D. Baushke.
2506 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
2508 * xreadlink.c (MAXSIZE): New macro.
2509 (xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
2510 size does not exceed MAXSIZE. Avoid cast.
2511 As suggested by Mark D. Baushke in
2512 <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
2513 if readlink fails with buffer size just under MAXSIZE, try again
2516 2004-11-02 Derek R. Price <derek@ximbiot.com>
2517 and Paul Eggert <eggert@cs.ucla.edu>
2519 * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
2520 (get_date): Overparenthesize to avoid GCC warning.
2522 2004-11-02 Bruno Haible <bruno@clisp.org>
2524 * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
2525 function returns void.
2527 2004-11-01 Paul Eggert <eggert@cs.ucla.edu>
2529 * getpass.c (fflush_unlocked, flockfile, funlockfile)
2530 (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
2533 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
2535 * getdate.y: Add support for TZ="foo" within a date string.
2536 Fix some bugs near time_t boundaries. Reject dates with
2537 out-of-range components, e.g., "Sept 31".
2538 Include <stdlib.h>, "setenv.h", "xalloc.h".
2539 (ISDIGIT_LOCALE): Remove; unused.
2540 Note that the TZ and time functions used here are not reentrant.
2541 (mktime_ok, get_tz): New functions.
2542 (TZBUFSIZE): New constant.
2543 (get_date): Parse leading TZ="foo". Reject out-of-range components;.
2544 This requires that we sometimes generate our own TZ="XXX..." setting.
2546 2004-10-27 Derek R. Price <derek@ximbiot.com>
2548 * mktime.c (not_equal_tm): Remove redundant check.
2550 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
2552 * getdate.y: Use Bison 1.875 features, and some minor
2553 code cleanups. This change does not affect semantics.
2554 Don't include <stdlib.h>; no longer needed.
2555 Don't include unlocked-io.h; only the "#if TEST" code uses
2556 stdio, and performance isn't crucial there.
2557 (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
2558 Bison 1.875 features as described below.
2559 All uses of "PC." replaced by "pc->".
2560 (YYSTYPE): Add a forward declaration.
2561 (yylex, yyerror): Use full prototypes in forward decls.
2562 Use "%pure-parser" rather than obsolescent "%pure_parser".
2563 Use %parse-param and %lex-param instead of obsolescent
2564 YYPARSE_PARAM and YYLEX_PARAM.
2565 (meridian_table, month_and_day_table, time_units_table,
2566 relative_time_table, time_zone_table, military_table,
2567 lookup_zone, lookup_word, get_date):
2568 Use NULL instead of 0 where appropriate.
2569 (to_hour): Avoid abort (), to avoid a dependency on
2571 (yyerror, yylex): Now accepts parser_control * arg.
2572 (main) [TEST]: Use '\0' rather than 0 for char.
2574 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
2576 * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
2577 It's now the caller's responsibility to handle the case where
2578 !HAVE_GETPAGESIZE && !defined getpagesize.
2580 * mktime.c (leapyear): Arg is long int, not int.
2582 2004-10-18 Paul Eggert <eggert@cs.ucla.edu>
2584 * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
2586 2004-10-12 Simon Josefsson <jas@extundo.com>
2588 * getpass.c (fflush_unlocked, flockfile, funlockfile)
2589 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
2592 2004-10-11 Yoann Vandoorselaere <yoann@prelude-ids.org>
2594 * vsnprintf.h: New file.
2595 * vsnprintf.c: New file.
2597 2004-10-07 Bruno Haible <bruno@clisp.org>
2599 * snprintf.c (snprintf): Avoid a memory allocation if the result fits
2600 into the provided buffer.
2602 2004-10-06 Paul Eggert <eggert@cs.ucla.edu>
2604 * diacrit.c, diacrit.h: Add GPL notice.
2606 * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
2607 * atanl.c (atanl): Keep the code as similar to glibc as possible.
2608 * logl.c (logl): Keep the code as similar to glibc as possible.
2609 This avoids a potential constant-folding bug.
2611 2004-10-05 Bruno Haible <bruno@clisp.org>
2613 * strsep.h: Don't declare strsep() if HAVE_STRSEP.
2615 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2617 * xalloc.h (xmemdup): Renamed from xclone. All uses changed.
2618 * xmalloc.c (xmemdup): Likewise.
2619 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
2620 XFREE): Remove these long-obsolescent macros.
2621 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
2622 * xstrdup.c: Remove.
2624 * regex.c (re_comp): Cast gettext return value to char *,
2625 Problem reported by Martin Neitzel via Mark D. Baushke.
2627 2004-10-04 Simon Josefsson <jas@extundo.com>
2629 * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
2630 '#ifdef USE_UNLOCKED_IO'.
2632 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2634 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
2635 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
2636 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
2637 regex.c, sha1.c, version-etc.c, yesno.c:
2638 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
2639 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
2640 the includer's responsibility.
2642 Sync from coreutils.
2644 * modechange.c (mode_compile): Don't decrement a pointer that
2645 points to the start of a string, as the C Standard says the
2646 resulting behavior is undefined.
2648 * backupfile.h (enum backuptype): Rename none -> no_backups,
2649 simple -> simple_backups, numbered_existing ->
2650 numbered_existing_backups, numbered -> numbered_backups
2651 to avoid shadowing problems. All uses changed.
2652 * argmatch.c (enum backuptype) [defined TEST]: Likewise.
2653 * backupfile.c (check_extension, numbered_backup):
2654 Rename locals to avoid shadowing 'basename'.
2655 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
2658 * .cppi-disable: Add getopt_.h, getopt_int.h.
2659 * .cvsignore: Add getopt.h.
2661 2004-10-04 Simon Josefsson <jas@extundo.com>
2663 * memmem.h: New file.
2664 * memmem.c: New file, taken from glibc.
2666 2004-10-02 Jim Meyering <jim@meyering.net>
2668 * dirfd.h, getpagesize.h: Add copyright notice.
2670 2004-10-01 Paul Eggert <eggert@cs.ucla.edu>
2672 * snprintf.c: Remove comments as to why each header is needed.
2674 2004-10-01 Yoann Vandoorselaere <yoann@prelude-ids.org>
2676 * strsep.h: New file.
2677 * strsep.c: New file.
2679 2004-10-01 Simon Josefsson <jas@extundo.com>
2681 * snprintf.c (snprintf): Handle size==0.
2683 2004-10-01 Simon Josefsson <jas@extundo.com>
2684 Bruno Haible <bruno@clisp.org>
2686 * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
2687 (snprintf): Declare 'args'.
2689 2004-09-30 Simon Josefsson <jas@extundo.com>
2691 * snprintf.h, snprintf.c: New files.
2693 2004-09-30 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2695 * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
2696 (hol_entry_help): Never translate an empty string.
2697 Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
2698 * argp.h (OPTION_NO_TRANS): New option.
2700 2004-09-29 Oskar Liljeblad <oskar@osk.mine.nu>
2702 * xvasprintf.c: Include xalloc.h.
2703 (xvasprintf): Use xalloc_die, not xmalloc_die.
2705 2004-09-28 Paul Eggert <eggert@cs.ucla.edu>
2707 * dummy.c: Change copyright notice to FSF, and license to GPL.
2709 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
2711 * argp-pvh.c (argp_program_version_hook): Provide initial value.
2712 Problem reported by Bruno Haible in:
2713 http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
2715 2004-09-11 Paul Eggert <eggert@cs.ucla.edu>
2717 * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
2718 in case some system header has #define'd it. Problem reported by
2719 Soeren D. Schulze in
2720 <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
2722 2004-09-08 Bruno Haible <bruno@clisp.org>
2724 * stdint_.h.in: New file, taken from GNU clisp.
2726 2004-09-08 Oskar Liljeblad <oskar@osk.mine.nu>
2728 * xvasprintf.h: New file.
2729 * xvasprintf.c: New file.
2730 * xasprintf.c: New file.
2732 2004-09-08 Bruno Haible <bruno@clisp.org>
2734 * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
2736 * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
2738 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
2740 Import from coreutils.
2741 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
2742 strings on unbounded length. alloca's performance benefits aren't
2743 that important here.
2745 (parse_with_separator): New function, with most of the internals
2746 of the old parse_user_spec. Allow user to omit both user and group,
2747 for compatibility with FreeBSD.
2748 Clone only the user name, not the entire spec.
2749 Do not set *uid, *gid unless entirely successful.
2750 Avoid memory leak in some failing cases.
2751 Fix regression for USER.GROUP reported by Dmitry V. Levin in
2752 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
2753 (parse_user_spec): Rewrite to use parse_with_separator.
2755 2004-08-12 Paul Eggert <eggert@cs.ucla.edu>
2757 * argp-help.c, argp-parse.c: Use "gettext.h" instead of
2758 its complicated substitute.
2759 * argp-help.c: Include <errno.h>, for program_invocation_short_name
2760 and program_invocation_name.
2761 (__argp_basename) [!_LIBC]: Remove; the only use was
2762 replaced by its body.
2763 (__argp_short_program_name): Change condition from
2764 !defined __argp_short_program_name to
2765 ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
2766 to match argp-namefrob.h.
2767 (__argp_failure): Don't assume strerror_r returns char *.
2768 * argp-parse.c (N_): Define unconditionally.
2769 (argp_default_options): Fill out initializers with 0 to avoid
2772 2004-08-12 Simon Josefsson <jas@extundo.com>
2774 * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
2775 * getopt_.h: Renamed from getopt.h.
2777 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
2779 Merge from coreutils.
2781 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
2782 wmemchr or wmemcpy. Problem reported by Robert Dahlem
2783 for Reliant Unix 5.43.
2785 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
2786 (union fooround): Use uintmax_t, not long int.
2787 The rest is a merge from libc:
2788 [defined _LIBC]: Include <shlib-compat.h>.
2789 (_obstack) [defined _LIBC]: Remove after 2.3.4.
2791 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
2793 * strverscmp.c: Convert to UTF-8.
2795 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
2797 * obstack.h (obstack_empty_p):
2798 Don't assume that chunk->contents is suitably aligned.
2799 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
2800 Likewise. Problem reported by Benno in
2801 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
2803 * chown.c (rpl_chown): Work even if the file is writeable but not
2804 readable. This could be improved further but it'd take some work.
2806 2004-08-08 Simon Josefsson <jas@extundo.com>
2808 * xgethostname.c: Don't include error.h (not used).
2811 * getpass.c: Include getpass.h first.
2813 2004-08-08 Paul Eggert <eggert@cs.ucla.edu>
2815 * xalloc-die.c: New files.
2816 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
2818 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
2819 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
2820 (_, N_, xalloc_die): Move to xalloc-die.c.
2821 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
2822 so that we needn't mess with xalloc_msg_memory_exhausted.
2824 * sha1.h: Renamed from sha.h.
2825 (SHA1_H): Renamed from _SHA_H.
2826 (sha1_ctx): Renamed from sha_ctx.
2827 (sha1_init_ctx): Renamed from sha_init_ctx.
2828 (sha1_process_block): Renamed from sha_process_block.
2829 (sha1_process_bytes): Renamed from sha_process_bytes.
2830 (sha1_finish_ctx): Renamed from sha_finish_ctx.
2831 (sha1_read_ctx): Renamed from sha_read_ctx.
2832 (sha1_stream): Renamed from sha_stream.
2833 (sha1_buffer): Renamed from sha_buffer.
2834 * sha1.c: Likewise; renamed from sha.c.
2835 Do not include <sys/types.h>.
2836 Include <stddef.h> rather than <stdlib.h>.
2838 2004-08-08 Bruno Haible <bruno@clisp.org>
2840 * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
2841 FILESYSTEM_PREFIX_LEN.
2842 * progreloc.c: Likewise.
2843 * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
2845 2004-08-06 Paul Eggert <eggert@cs.ucla.edu>
2848 * argp-help.c (make_hol, hol_append): Don't assume that
2849 SIZE_MAX is a valid preprocessor constant.
2850 (__argp_basename): Change from "#ifndef _LIBC"
2851 to "#ifndef __argp_short_program_name", so that
2852 we don't compile these functions for tar.
2854 More merges from coreutils.
2855 * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
2856 utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
2858 * addext.c: Remove; no longer needed.
2859 * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
2860 euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
2861 fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
2862 fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
2863 getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
2864 hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
2865 md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
2866 modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
2867 putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
2868 readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
2869 sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
2870 version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
2871 xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
2872 Import changes from coreutils.
2874 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
2876 Merge from coreutils.
2878 * .gdb-history: Remove; this doesn't belong here.
2880 * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
2881 cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
2882 fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
2884 * dirname.h: Include <stdbool.h>.
2885 (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
2886 for consistency with POSIX terminology. All uses changed.
2887 (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
2888 (strip_trailing_slashes): Use bool for booleans.
2889 * stripslash.c (strip_trailing_slashes): Likewise.
2891 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
2892 sometimes returns a positive errno value even when it succeeds.
2893 (print_errno_message) [!LIBC]: Fall back on strerror if
2896 * path-concat.c (mempcpy): Don't define if a system header defines it.
2897 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
2898 (longest_relative_suffix): New function.
2899 (path_concat): Use it. Assume first argument is not NULL.
2900 Port to DOS. Omit redundant separators.
2901 Report an error instead of returning NULL.
2902 Use mempcpy instead of memcpy.
2903 (xpath_concat): Remove: not declared or used.
2905 * same.h: Include <stdbool.h>
2906 (same_name): Return bool, not int.
2907 * same.c (same_name): Likewise.
2908 (errno): Don't declare; we assume C89 or better now.
2910 * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
2911 if not already defined.
2913 * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
2914 * dup-safer.c (errno): Likewise.
2916 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
2918 * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
2921 2004-08-03 Simon Josefsson <jas@extundo.com>
2923 * strdup.h: Only use HAVE_DECL_STRDUP if defined.
2924 * progname.h: Don't include stdbool.h.
2926 2004-08-02 Simon Josefsson <jas@extundo.com>
2928 * getsubopt.h: New file, with comments from Bruno Haible.
2929 * getsubopt.c: New file, from glibc, but slightly modified based on
2930 suggestions from Paul Eggert <eggert@cs.ucla.edu>.
2932 2004-08-01 Simon Josefsson <jas@extundo.com>
2934 * xgetdomainname.c: Include stdlib.h, for free().
2936 2004-07-16 Simon Josefsson <jas@extundo.com>
2938 * dummy.c: New file.
2940 2004-07-16 Bruno Haible <bruno@clisp.org>
2942 * backupfile.h: Add extern "C" for C++.
2943 * closeout.h: Likewise.
2944 * copy-file.h: Likewise.
2945 * findprog.h: Likewise.
2946 * full-write.h: Likewise.
2947 * pathname.h: Likewise.
2948 * progname.h: Likewise.
2949 * stpcpy.h: Likewise.
2950 * stpncpy.h: Likewise.
2951 * strcase.h: Likewise.
2952 * strstr.h: Likewise.
2953 * xalloc.h: Likewise.
2955 * mbswidth.h: Add extern "C" for C++.
2956 Reported by Albert Chin-A-Young <china@thewrittenword.com>.
2958 2004-07-09 Simon Josefsson <jas@extundo.com>
2960 * getndelim2.c: Include stddef.h, for ptrdiff_t. (FreeBSD 4.9
2961 failed without this.)
2963 2004-07-09 Paul Eggert <eggert@cs.ucla.edu>
2965 * fchown-stub.c: New file.
2967 2004-06-24 Jim Meyering <jim@meyering.net>
2969 * obstack.h (obstack_base): Cast to (void *), per documentation.
2971 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
2973 * argz.c, argz_.h: New files, which are autoupdated from libtool.
2975 2004-06-01 Jim Meyering <jim@meyering.net>
2977 * calloc.c: New file.
2979 2004-06-06 Paul Eggert <eggert@cs.ucla.edu>
2981 * getdate.y (yylex): Allow space between sign and number.
2982 Problem reported by Dan Jacobson.
2984 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
2985 and Jim Meyering <jim@meyering.net>
2987 Merge from coreutils CVS.
2989 * stat-macros.h: New file, with contents from file-type.h
2990 and coreutils' system.h.
2991 * file-type.c: Include "stat-macros.h".
2992 * file-type.h (file_type): Move all macro definitions to new file,
2995 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
2996 Wrap old code with this conditional.
2997 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
2998 function that does not dereference symlinks.
2999 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
3001 * xreadlink.c: Include xreadlink.h first, to catch .h file
3002 dependency problems.
3003 (xreadlink): Accept new arg SIZE, for efficiency.
3004 All decls and uses changed.
3005 * xreadlink.h: Include <stddef.h>, for size_t.
3007 * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
3008 gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
3010 * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
3012 2004-05-30 Paul Eggert <eggert@cs.ucla.edu>
3014 * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
3015 macros to be defined.
3016 (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
3017 the allocator returns NULL because the requested size is zero.
3019 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3021 * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
3022 var. Add comment explaining why libc still defines it. This
3023 merges the following patch from glibc:
3024 http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
3026 2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
3028 * obstack.c (_obstack): Remove unused variable. It hasn't been
3029 present in glibc since revision 1.1 of this file.
3030 * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
3031 obstack_alignment_mask, obstack_alloc, obstack_base,
3032 obstack_blank, obstack_blank_fast, obstack_chunk_size,
3033 obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
3034 obstack_grow0, obstack_init, obstack_int_grow,
3035 obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
3036 obstack_next_free, obstack_object_size, obstack_ptr_grow,
3037 obstack_ptr_grow_fast, obstack_room): Remove declarations of
3038 nonexistent functions.
3040 2004-05-17 Derek R. Price <derek@ximbiot.com>
3041 Paul Eggert <eggert@cs.ucla.edu>
3043 * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
3045 2004-05-14 Bruno Haible <bruno@clisp.org>
3047 * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
3048 that consists of a '.' followed by an empty digit string.
3049 Patch by Tor Lillqvist <tml@iki.fi>.
3051 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
3053 Port obstack to the AS/400, where pointers are 16 bytes wide and
3054 you cannot cast an integer to a valid pointer. This patch is
3055 currently waiting to be integrated into glibc; see
3056 <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
3058 * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
3059 All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
3060 (__BPTR_ALIGN, __PTR_ALIGN): New macros.
3061 (struct obstack): temp member is now a union of a pointer and
3062 an integer, instead of an integer. All integer uses changed.
3063 This does not affect the physical layout of struct obstack,
3064 except on hosts (like the AS/400) where the size or alignment of
3065 void * is greater than that of ptrdiff_t.
3066 (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
3067 __STDC__)]: Store temporary in pointer member of union, not
3069 * obstack.c: Include <stddef.h>, for offsetof.
3070 (struct fooalign): Remove; it doesn't need a name.
3071 (union fooround): Change double to long double, and add void *.
3072 (DEFAULT_ALIGNMENT): Use offsetof to compute.
3073 (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
3074 not a macro. Hence the values are always int; so remove all
3075 casts-to-int in uses.
3077 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
3078 Derek Price <derek@ximbiot.com>
3080 * alloca.c: Include <alloca.h>, to get our interface.
3081 * alloca_.h: Use __alloca on AIX, so that we don't have to
3082 include <alloca.h> first. Use C89 prototype for alloca; this
3083 requires including <stddef.h> for size_t. Use extern "C" if C++.
3084 Use #elif for simplicity, since we can assume C89 now.
3085 Don't try to source the system alloca.h since it will not be found
3086 and to prevent recursively including its replacement.
3087 * fnmatch.c: Include <alloca.h> instead of opencoding.
3088 * regex.c: Likewise.
3090 2004-05-16 Derek Price <derek@ximbiot.com>
3091 Paul Eggert <eggert@cs.ucla.edu>
3093 getline cleanup. This changes the getndelim2 API: both order of
3094 arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
3097 * getline.c: Don't include stddef.h or stdio.h, since our
3098 interface does that.
3099 (getline): Always use getdelim, so that we don't have two
3100 copies of this code.
3101 * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
3103 (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
3104 (GETNDELIM2_MAXIMUM): New macro.
3105 (getndelim2): Reorder arguments. delim==EOF now means no delimiter,
3106 instead of the old practice of delim2==0. All callers changed.
3107 Return -1 on overflow, instead of returning junk.
3108 Do not set *linesize unless allocation succeeds.
3109 * getndelim2.h: Do not include stddef.h; no longer needed, now
3110 that we include sys/types.h.
3111 * getnline.h: Likewise.
3112 * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
3113 (getndelim2): Reorder arguments.
3114 * getnline.c (getnline, getndelim):
3115 Don't discard the NMAX argument.
3116 (getnline): Invoke getndelim, to avoid code duplication.
3117 * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
3118 of (size_t) -1 by callers of the getnline family.
3120 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3122 * nanosleep.c (suspended): Change its type from int to
3123 sig_atomic_t volatile.
3124 (first_call): Make it private to rpl_nanosleep, and have it
3125 be zero initially as that's a bit faster.
3126 (my_usleep): Round up fractional times instead of truncating them,
3127 as this is the usual meaning for 'sleep'.
3129 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3131 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3132 (ENOSYS): Define if not defined.
3133 (settime): Fall back on stime if it exists and settimeofday fails.
3134 But don't bother with fallbacks if a method fails with errno == EPERM.
3136 2004-05-11 Jim Meyering <jim@meyering.net>
3138 Prior to this change, the save_cwd caller required read access to the
3139 current directory on most systems (ones with the fchdir function).
3141 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
3142 fails, try write-only, and finally, resort to using xgetcwd.
3144 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
3146 * obstack.c, obstack.h: Import changes from libc.
3148 2004-04-28 Bruno Haible <bruno@clisp.org>
3150 * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
3151 implicitly appends .exe to executables.
3152 * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
3153 accepts Windows pathnames.
3154 * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3155 Cygwin like Windows, since it now accepts Windows pathnames.
3156 * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
3157 Cygwin like Windows, since it now accepts Windows pathnames.
3158 Reported by Derek Robert Price <derek@ximbiot.com>.
3160 2004-04-20 Jim Meyering <jim@meyering.net>
3162 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
3164 2004-04-20 Jim Meyering <jim@meyering.net>
3165 Bruno Haible <bruno@clisp.org>
3167 * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
3168 memory when realloc fails.
3170 2004-04-18 Jim Meyering <jim@meyering.net>
3172 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
3173 don't leak memory and do call END_UTMP_ENT.
3175 2004-04-11 Paul Eggert <eggert@twinsun.com>
3177 * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
3178 (CHAR_BIT): Remove, since we assume C89.
3179 Include <stdint.h> if available, as per current Autoconf CVS advice.
3181 2004-03-30 Paul Eggert <eggert@twinsun.com>
3183 * cloexec.h, cloexec.c (set_cloexec_flag): Return int
3184 not bool, to be more consistent with Unix conventions.
3185 Suggested by Bruno Haible.
3187 Merge from coreutils.
3189 * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
3192 * getdate.h: Include stdbool.h, and timespec.h instead of
3193 the usual <time.h> dance.
3194 (get_date): Change signature to support fractional time stamps.
3195 All callers changed.
3196 * getdate.y: Include "getdate.h" first, as we can now
3197 assume C89 and don't need to worry about 'const'.
3198 Similarly, include "unlocked-io.h" near start, not in middle.
3200 (textint.value): Use long int rather than int.
3201 (textint.digits): Use size_t rather than int.
3202 (BILLION, LOG10_BILLION): New constants.
3203 (parser_control): New member rel_ns. Members day_ordinal,
3204 time_zone, month, day, hour, minutes, rel_year, rel_month,
3205 rel_day, rel_hour, rel_minutes, rel_seconds
3206 are now long int, not int. Member seconds is now struct timespec,
3207 not int. New member timespec_seen. Members dates_seen, days_seen,
3208 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
3210 (%union.intval): Now long int, not int.
3211 New member timespec.
3212 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
3213 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
3214 (spec): Now is a timespec or an item list.
3215 (timespec, items): New nonterminals.
3216 (time, rel, relunit, number, get_date):
3217 Add support for fractional seconds.
3218 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
3219 (gmtime, localtime, mktime): Remove decls; not needed with C89.
3220 (to_hour): First arg is now long int, not int.
3221 (to_year): Returns long int, not int.
3222 Don't treat year -70 like 70.
3223 (tm_diff): Returns long int, not int.
3224 (lookup_word): Use bool instead of int when appropriate.
3225 (yylex): Use size_t for count, not int.
3226 Detect overflow when parsing large integer constants.
3227 Add support for fractions.
3228 (get_date): Make pointers 'const' if possible.
3229 Use more-portable code to detect integer overflow.
3230 (main) [TEST]: Adjust to above changes. Test for localtime failure.
3231 Don't use ctime; it's not reliable if the year has >4 digits.
3233 * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
3234 This is for compatibility with BSD.
3236 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
3237 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
3238 From coreutils' system.h.
3240 * userspec.c: Don't include "posixver.h".
3241 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
3242 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
3243 compatible extension. Simplify code by removing a boolean int
3244 that was always nonzero if a string was nonnull.
3246 2004-03-30 Jim Meyering <jim@meyering.net>
3248 Merge from coreutils.
3250 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
3252 * readtokens.c (readtoken): Don't leak 64 bytes when reading
3253 an empty input stream.
3255 * readtokens.c: Include <stdbool.h>.
3256 (readtoken): Use `size_t' rather than int/long.
3257 All callers adjusted.
3258 Use `bool' rather than `int' where appropriate.
3259 Use memset rather than an explicit loop.
3260 Use x2nrealloc rather than xrealloc.
3261 Allow the use of `\0' as a delimiter.
3262 (readtokens): Likewise.
3263 * readtokens.h (readtoken, readtokens): Update prototypes.
3265 2004-03-30 Bruno Haible <bruno@clisp.org>
3267 * getloadavg.c (getloadavg): Don't assume setlocale returns
3270 2004-03-29 Paul Eggert <eggert@twinsun.com>
3272 Merge changes to getloadavg.c from coreutils and Emacs.
3274 * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
3275 Define to an expression, not to the empty string.
3276 Include cloexec.h and xalloc.h.
3277 (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
3278 Use set_cloexec_flag rather than rolling our own.
3279 * cloexec.c, cloexec.h: New files.
3281 2004-03-18 Paul Eggert <eggert@twinsun.com>
3283 * getopt.h: Sync with libc CVS.
3285 2004-03-18 Paul Eggert <eggert@twinsun.com>
3286 Bruno Haible <bruno@clisp.org>
3288 * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
3289 not on all platforms that have <wchar.h>.
3290 * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
3292 2004-03-09 Paul Eggert <eggert@twinsun.com>
3294 * argp-parse.c, getopt.c, getopt.h, getopt1.c:
3296 * getopt_int.h: New file, also synced from libc.
3298 2004-03-07 Paul Eggert <eggert@twinsun.com>
3300 * c-stack.c (SIGACTION_WORKS): New macro. Use it instead of long
3301 '#if' expressions. Unlike the code it replaces, it does not
3302 depend on (defined _SC_PAGESIZE). However, it does depend on
3303 HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
3304 first reported by Jason Andrade in
3305 <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
3307 2004-01-18 Simon Josefsson <jas@extundo.com>
3309 * strdup.h: New file.
3310 * strdup.c: Include it.
3311 * path-concat.c: Include strdup.h. Drop strdup declaration.
3312 * userspec.c: Include strdup.h. Drop strdup declaration.
3314 2004-02-06 Karl Berry <karl@gnu.org>
3316 * config.charset: update from gettext 0.14.1.
3318 2004-02-05 Paul Eggert <eggert@twinsun.com>
3320 Add comments and code, prompted by suggestions from Bruno Haible
3322 * quotearg.h (quotearg_alloc): New decl. Improve the comments
3323 describing the enum quoting_style values.
3324 * quotearg.c (quotearg_alloc): New function.
3325 (quotearg_buffer_restyled): Treat lone { and } as special.
3326 Treat = as special. Work around bug with older shells
3327 that "see" a '\' that is really the 2nd byte of a multibyte char.
3328 Quote empty string with shell_quoting_style.
3330 2004-02-03 Bruno Haible <bruno@clisp.org>
3332 * pipe.h: New file, from GNU gettext.
3333 * pipe.c: New file, from GNU gettext.
3335 2004-01-27 Bruno Haible <bruno@clisp.org>
3337 * execute.h: New file, from GNU gettext.
3338 * execute.c: New file, from GNU gettext.
3339 * w32spawn.h: New file, from GNU gettext.
3341 2004-01-23 Paul Eggert <eggert@twinsun.com>
3343 Exit-status fix from coreutils.
3345 Use exit_failure consistently in place of EXIT_FAILURE,
3346 so that program exit statuses are consistent on failure.
3348 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
3349 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
3350 * argmatch.h: Comment fix to match the above.
3351 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
3352 Now a macro referring to exit_failure, instead of a separate
3353 variable. Include "exitfail.h" to get it.
3354 * xstrtol.h: Include "exitfail.h".
3355 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
3357 * long-options.c (parse_long_options): Use prototype
3358 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
3361 2004-01-21 Jim Meyering <jim@meyering.net>
3363 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
3364 so as not to conflict with a different-sized __mktime_internal
3365 function in GNU libc.
3366 * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
3367 Problem building statically-linked `ls' reported by Michael Brunnbauer.
3369 2004-01-18 Paul Eggert <eggert@twinsun.com>
3371 Merge from diffutils.
3373 * file-type.c (file_type): Add typed memory objects.
3374 * file-type.h (S_TYPEISTMO): New macro.
3376 * c-stack.h (c_stack_action): Remove argv argument.
3377 * c-stack.c (c_stack_action): Likewise. All uses changed.
3378 (die): Don't calculate message unless segv_action returns.
3379 (get_stack_location, min_address_from_argv, max_address_from_argv,
3380 volatile stack_base, volatile_stack_size): Remove.
3381 (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
3382 that every segmentation violation is a stack overflow. (Ouch!)
3383 See Debian bug 136249 (still outstanding) for more info about why
3384 HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
3386 2003-11-30 Bruno Haible <bruno@clisp.org>
3388 Safer stack allocation.
3389 * setenv.c: Include allocsa.h.
3390 (alloca): Remove fallback definition.
3391 (freea): Remove macro.
3392 (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
3395 2003-10-17 Bruno Haible <bruno@clisp.org>
3397 * binary-io.h: Avoid warnings on Cygwin.
3399 2003-12-28 Bruno Haible <bruno@clisp.org>
3401 * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
3402 * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
3404 2003-11-28 Bruno Haible <bruno@clisp.org>
3406 * wait-process.c (cleanup_slaves): Use ANSI C declaration.
3408 2003-11-27 Bruno Haible <bruno@clisp.org>
3410 * wait-process.c: On Windows, include windows.h. Needed on mingw.
3412 2003-11-17 Bruno Haible <bruno@clisp.org>
3414 * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
3416 2003-11-24 Bruno Haible <bruno@clisp.org>
3418 * xallocsa.h: New file, from GNU gettext.
3419 * xallocsa.c: New file, from GNU gettext.
3421 2003-11-24 Bruno Haible <bruno@clisp.org>
3423 * allocsa.h: New file, from GNU gettext.
3424 * allocsa.c: New file, from GNU gettext.
3426 2003-11-24 Bruno Haible <bruno@clisp.org>
3428 * eealloc.h: New file.
3430 2004-01-15 Jim Meyering <jim@meyering.net>
3432 Merge from coreutils.
3434 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
3435 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
3436 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
3438 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
3439 optional configure-time default.
3441 * version-etc.c (version_etc_copyright): Update copyright date.
3443 * xreadlink.c (xreadlink): Correct outdated comment.
3445 2004-01-15 Paul Eggert <eggert@twinsun.com>
3447 Merge from coreutils.
3449 * posixver.c: Include posixver.h.
3451 * same.c: Include <stdbool.h>, <limits.h>.
3452 (_POSIX_NAME_MAX): Define if not defined.
3454 (same_name): If file names are silently truncated, report
3455 that the file names are the same if they are the same after
3456 the silent truncation.
3458 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
3459 conversion function.
3460 * xstrtod.c (xstrtod): Likewise. All callers changed to
3461 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
3464 2004-01-14 Paul Eggert <eggert@twinsun.com>
3466 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
3467 with like-named macro in fnmatch.c.
3468 (EXT): Use an internal constant instead.
3470 Merge fnmatch patches from glibc.
3471 * fnmatch.c (mbsinit): Remove define.
3472 Add libc_hidden_ver (__fnmatch, fnmatch).
3473 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
3474 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
3476 2003-12-14 Karl Berry <karl@gnu.org>
3478 * config.charset: update from gettext-runtime.
3480 2003-12-03 Paul Eggert <eggert@twinsun.com>
3482 * getgroups.c (getgroups): xmalloc takes one argument, not two.
3483 Bug reported by Alfred M. Szmidt.
3485 2003-11-29 Karl Berry <karl@gnu.org>
3487 * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
3489 2003-11-23 Paul Eggert <eggert@twinsun.com>
3490 Bruno Haible <bruno@clisp.org>
3492 * printf-parse.h: Don't include sys/types.h.
3493 (ARG_NONE): New macro.
3494 (char_directive): Change type of *arg_index fields to size_t.
3495 * printf-parse.c: Don't include sys/types.h.
3496 (SSIZE_MAX): Remove macro.
3497 (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
3498 Remove unnecessary overflow check.
3499 * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
3502 2003-11-24 Paul Eggert <eggert@twinsun.com>
3504 * alloca.c: Remove dependency on xalloc module.
3505 (xalloc_die): Remove.
3506 (memory_full) [!defined emacs]: New macro.
3507 [!defined emacs]: Don't include xalloc.h.
3508 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
3509 address arithmetic overflows. Change datatypes a bit to avoid
3512 2003-11-22 Jim Meyering <jim@meyering.net>
3514 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
3516 2003-11-17 Bruno Haible <bruno@clisp.org>
3518 * vasnprintf.c (alloca): Remove fallback definition.
3519 (freea): Remove definition.
3520 (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
3521 Reported by Paul Eggert.
3523 2003-11-17 Jim Meyering <jim@meyering.net>
3525 On systems without utime and without a utimes function capable of
3526 dealing with a NULL struct utimbuf* argument, this utime replacement
3527 could -- in unusual circumstances -- leak a file descriptor.
3528 * utime.c: Include <unistd.h> and <errno.h>.
3529 (utime_null): Be sure to close `fd' and to preserve errno.
3530 Reported by Geoff Collyer via Arnold Robbins.
3532 2003-11-16 Paul Eggert <eggert@twinsun.com>
3533 Bruno Haible <bruno@clisp.org>
3535 Protect against address arithmetic overflow.
3536 * printf-args.h: Include stddef.h.
3537 (arguments): Change type of field 'count' to size_t.
3538 * printf-args.c (printf_fetchargs): Use size_t instead of
3539 'unsigned int' where appropriate.
3540 * printf-parse.h: Include sys/types.h.
3541 (char_directive): Change type of *arg_index fields to ssize_t.
3542 (char_directives): Change type of fields 'count', max_*_length to
3544 * printf-parse.c: Include sys/types.h and xsize.h.
3545 (SSIZE_MAX): Define fallback value.
3546 (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
3547 instead of 'int' where appropriate. Check a_allocated, d_allocated
3548 against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
3549 * vasnprintf.c: Include xsize.h.
3550 (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
3551 Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
3552 overflow. Avoid wraparound when converting a width or precision from
3555 2003-11-16 Bruno Haible <bruno@clisp.org>
3557 Update from GNU gettext.
3558 * printf-parse.c: Generalize to it can be compiled for wide strings.
3559 (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
3560 * vasnprintf.c: Generalize to it can be compiled for wide strings.
3561 (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
3562 SNPRINTF): New macros.
3563 Don't include <alloca.h> if the file is used inside libintl.
3564 (local_wcslen): New function, for Solaris 2.5.1.
3565 (VASNPRINTF): Use it instead of wcslen.
3567 2003-11-16 Bruno Haible <bruno@clisp.org>
3569 * xsize.h (xmax): New function.
3570 (xsum, xsum3, xsum4): Declare as "pure" functions.
3572 2003-11-12 Paul Eggert <eggert@twinsun.com>
3574 * xalloc.h: Do not include <limits.h> or <stdint.h>.
3575 (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
3576 the heuristic, rather than PTRDIFF_MAX and SIZE_MAX. This
3577 heuristic is just as accurate as far as we know, and it removes a
3578 dependency on size_max.m4 and ptrdiff_max.m4.
3580 2003-11-12 Paul Eggert <eggert@twinsun.com>
3582 * xstrtol.c (__xstrtol): Remove "break" immediately after
3583 "return", to pacify some unknown compiler. Problem reported
3586 2003-11-11 Bruno Haible <bruno@clisp.org>
3588 * xsize.h (SIZE_MAX): Remove fallback definition.
3589 * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
3592 2003-11-10 Paul Eggert <eggert@twinsun.com>
3594 * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
3595 PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
3596 rejected some allocations of exactly SIZE_MAX - 2 bytes.
3598 [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
3599 not (size_t) -1, since it's defined here.
3601 2003-11-06 Paul Eggert <eggert@twinsun.com>
3603 * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
3604 (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
3605 Reject sizes of exactly SIZE_MAX bytes.
3606 * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
3607 is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
3609 2003-11-05 Bruno Haible <bruno@clisp.org>
3611 * xsize.h: Include limits.h, to avoid a possible collision with
3612 SIZE_MAX defined in <limits.h> on Solaris.
3614 2003-11-04 Bruno Haible <bruno@clisp.org>
3616 * xsize.h: New file.
3617 * linebreak.c: Include xsize.h.
3618 (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
3619 argument for overflow.
3620 Suggested by Paul Eggert.
3622 2003-10-31 Bruno Haible <bruno@clisp.org>
3624 * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
3625 to avoid (extremely rare) race condition.
3626 Suggested by Paul Eggert.
3628 2003-11-03 Jim Meyering <jim@meyering.net>
3630 * userspec.c: Include "userspec.h".
3631 * userspec.h: New file.
3633 2003-10-31 Paul Eggert <eggert@twinsun.com>
3635 * mountlist.h (struct mount_entry.me_type_malloced): New member.
3636 * mountlist.c (SIZE_MAX): Define if not defined already.
3637 (read_filesystem_list): Set and use me_type_malloced.
3638 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
3639 whatever the type happens to be), for brevity and consistency.
3640 Check for size calculation overflow on Alphas running OSF/1.
3642 2003-10-31 Jim Meyering <jim@meyering.net>
3644 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
3646 * linebuffer.c: Include <string.h> for declaration of memset.
3648 2003-10-30 Paul Eggert <eggert@twinsun.com>
3649 Bruno Haible <bruno@clisp.org>
3651 * vasprintf.c: Include <limits.h>, <stdlib.h>.
3652 (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
3654 2003-10-29 Paul Eggert <eggert@twinsun.com>
3656 * xalloc.h (xalloc_oversized): Now a macro, not a function,
3657 so that it works even if SIZE_MAX < N. Do not include <stdbool.h>;
3659 * quotearg.c (quotearg_n_options): Use it.
3660 * group-member.c: Include <stdbool.h>.
3661 (free_group_info): Arg is now const *; don't free arg.
3662 (get_group_info): Now returns bool and accepts struct group_info *,
3663 rather than returning a malloc'ed struct group_info *.
3664 All uses changed. Check for overflow in internal size calculation.
3666 * getusershell.c (readname): Simplify the code by using x2nrealloc
3667 rather than xmalloc/xrealloc.
3668 * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
3669 using x2realloc rather than xmalloc/xrealloc. Also, fix a C
3670 conformance bug: the old code used a pointer after freeing the
3671 storage that it addressed.
3672 * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
3673 rather than doing it by hand.
3674 * getgroups.c (getgroups): Don't use xrealloc, since we don't need
3675 the buffer preserved. Use free and xmalloc instead.
3676 * quotearg.c (quotearg_n_options): Likewise.
3677 Use a simpler test for size overflow. Don't use xalloc_oversized
3678 because unsigned int might be wider than size_t (!); this suggests
3679 that we should switch from unsigned int to size_t for slot numbers.
3681 2003-10-27 Bruno Haible <bruno@clisp.org>
3683 * stdbool_.h: Better support for BeOS.
3685 2003-10-27 Paul Eggert <eggert@twinsun.com>
3687 * exclude.c (new_exclude): Use xzalloc rather than xmalloc
3688 to allocate the returned structure. Do not allocate a subarray,
3689 as x2nrealloc will do that.
3690 (add_exclude): Use x2nrealloc to reallocate ex->exclude,
3691 instead of xnrealloc.
3692 (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
3694 2003-10-26 Paul Eggert <eggert@twinsun.com>
3696 * xalloc.h (xalloc_oversized): New static inline function, for
3697 callers that want to do their own size-overflow checking. Include
3698 <stdbool.h>, since xalloc_oversized returns bool.
3699 * xalloc.c (array_size_overflow): Remove. All callers changed
3700 to use xalloc_oversized.
3702 Add two functions x2realloc, x2nrealloc, for programs that grow
3703 arrays dynamically by doubling their sizes.
3704 * xalloc.h (x2realloc, x2nrealloc): New decls.
3705 * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
3708 Port to C99 semantics for 'inline' of external functions.
3709 Bug reported by Bruno Haible.
3710 * xmalloc.c (xnmalloc_inline): New static inline function,
3711 with the old contents of xnmalloc.
3712 (xnmalloc, xmalloc): Use it.
3713 (xnrealloc_inline): New static inline function,
3714 with the old contents of xnrealloc.
3715 (xnrealloc, xrealloc): Use it.
3717 * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
3719 2003-10-25 Paul Eggert <eggert@twinsun.com>
3721 Fix several address-calculation bugs in the hash modules,
3722 plus some minor code cleanup.
3724 * hash.h: Include <stdbool.h>, for bool.
3725 * hash.c: Don't include <stdbool.h>, since hash.h does it now.
3726 * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
3727 hash_get_n_entries, hash_get_max_bucket_length,
3728 hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
3729 hash_rehash): Use size_t rather than unsigned.
3730 * hash.c (struct hash_table, hash_get_n_buckets,
3731 hash_get_n_buckets_used, hash_get_n_entries,
3732 hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
3733 hash_get_entries, hash_do_for_each, hash_string, is_prime,
3734 next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
3736 (SIZE_MAX): Define if not defined.
3737 (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
3738 hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
3740 Use const * when possible.
3741 (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
3742 (check_tuning): Fix bug: if tuning parameters were very close to
3743 0 or 1, rounding errors could have caused subscript violations.
3744 (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
3745 (hash_initialize): Add 'fail:' label
3746 to free table and return NULL, and use it to simplify code.
3747 Use calloc rather than clearing the storage ourself.
3748 (hash_initialize, hash_rehash): Check for arithmetic overflow in
3749 buffer size calculations.
3750 * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
3751 Include <stddef.h>, for size_t.
3752 * hash-pjw.c (hash_pjw): Likewise.
3753 Switch to method described by Bruno Haible.
3754 Include <limits.h>, for CHAR_BIT.
3755 (SIZE_BITS): New macro.
3757 2003-10-21 Paul Eggert <eggert@twinsun.com>
3759 * getndelim2.c (getndelim2): When size calculation overflows,
3760 ceiling the allocation at NMAX bytes rather than silently
3761 discarding input bytes before NMAX is reached. This makes
3762 a difference only if NMAX exceeds SIZE_MAX / 2.
3764 * obstack.c: Merge from glibc.
3765 [defined _LIBC]: Include <obstack.h>, not "obstack.h".
3766 Add libc_hidden_def (_obstack_newchunk).
3767 (_obstack_free) [! defined _LIBC]: Remove.
3768 [defined _LIBC]: Make a strong alias from obstack_free, rather than
3769 a clone of the function body.
3770 (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
3771 [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
3773 * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
3774 (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
3777 * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
3778 (obstack_ptr_grow_fast, obstack_int_grow_fast):
3779 Don't use lvalue casts, as GCC plans to remove support for them
3780 in GCC 3.5. Reported by Joseph S. Myers. This bug
3781 was also present in the non-GCC version, indicating that this
3782 code had always been buggy and had never been widely used.
3783 (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
3784 Use the fast variant of each macro, rather than copying the
3785 definiens of the fast variant; that way, we'll be more likely to
3786 catch future bugs in the fast variants.
3788 2003-10-20 Bruno Haible <bruno@clisp.org>
3790 * wait-process.h: New file, from GNU gettext.
3791 * wait-process.c: New file, from GNU gettext.
3793 2003-10-19 Jim Meyering <jim@meyering.net>
3795 * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
3797 2003-10-16 Paul Eggert <eggert@twinsun.com>
3799 * getgroups.c: Include <errno.h>, <stdlib.h>.
3800 (getgroups): First arg is int, not size_t.
3801 Don't let 'free' mangle errno.
3803 2003-10-16 Jim Meyering <jim@meyering.net>
3805 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
3807 2003-10-15 Paul Eggert <eggert@twinsun.com>
3809 * exclude.c: Do not include <inttypes.h> or <stdint.h>.
3811 (new_exclude, add_exclude_file): Initial size no longer needs to
3813 (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
3814 our own address arithmetic overflow checking.
3816 * fnmatch.c (SIZE_MAX): Define if standard headers don't.
3817 (fnmatch): Do not alloca more than 2000 wide characters;
3818 instead, use malloc for large buffers.
3819 Check for address arithmetic overflow, and return -1
3820 with errno set to ENOMEM in that case.
3821 * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
3822 (NEW_PATTERN): Do not alloca more than 8000 bytes;
3823 instead, return -1. Check for address arithmetic overflow.
3825 2003-10-14 Paul Eggert <eggert@twinsun.com>
3827 Handle invalid suffixes and overflow independently, so that
3828 callers can treat them independently as needed. Fix some bugs in
3829 suffix handling, e.g., "100k@" was not diagnosed as an invalid
3830 suffix for a human-readable blocksize. The major caller-visible
3831 change is the addition of a new
3832 LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
3833 that both overflow and suffix chars were found.
3835 * human.c (humblock): Don't check separately for invalid suffix
3836 char; that is xstrtoumax's job (now that its bug is fixed).
3837 * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
3838 INTMAX_MAX]: New macros.
3839 * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
3840 TYPE_MAXIMUM): New macros.
3841 (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
3842 (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
3843 if overflow occurs, as it's what __strtol does and it's more useful
3845 (__xstrtol): If __strtol reports some error other than ERANGE,
3846 reflect it to the caller as LONGINT_INVALID. If it reports
3847 ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
3848 | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
3849 * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
3851 (_STRTOL_ERROR): Handle it. Abort when given unknown error codes.
3852 * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
3853 * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
3854 [defined UINTMAX_MAX]: New macros.
3856 2003-10-14 Bruno Haible <bruno@clisp.org>
3858 * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
3859 * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
3860 Also use volatile where needed.
3862 2003-10-12 Paul Eggert <eggert@twinsun.com>
3864 * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
3865 (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
3866 and define in terms of the other primitives.
3867 * xmalloc.c: Include stdbool.h; do not include exit.h.
3868 (SIZE_MAX): Define if not already defined.
3869 (array_size_overflow): New function.
3870 (xalloc_die): Abort instead of exiting if 'error' returns.
3871 (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
3872 (xmalloc, xrealloc): Use them.
3873 (xcalloc): Check for address arithmetic overflow.
3874 * xstrdup.c (xstrdup): Use xclone, since memcpy should be
3875 a bit faster than strcpy.
3877 2003-10-08 Paul Eggert <eggert@twinsun.com>
3879 Merge getpass from libc, plus a few fixes.
3881 * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
3882 Include <stdbool.h>.
3883 Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
3884 __fsetlocking to empty.
3885 [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
3886 do include <bits/libc-lock.h>.
3887 Do not include <fcntl.h>; not needed.
3888 [_LIBC]: Include <wchar.h>.
3889 (NOTCANCEL_MODE): New macro.
3890 (flockfile, funlockfile) [_LIBC]: New macros.
3891 (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
3892 [!_LIBC]: New macros.
3893 (call_fclose): New function.
3894 (getpass): Use it. Save tty stream separately; this simplifies the
3895 code and makes it more reliable if stdin happens to equal stdout.
3896 Invoke __fsetlocking on tty.
3897 Handle thread cancellation if needed.
3898 Namespace cleanup (use __tcgetattr, __getline).
3899 Use bool for Booleans.
3900 [USE_IN_LIBIO]: Handle wide streams.
3901 [!_LIBC]: Unconditionally do the fseek, since we don't know what
3902 stream might go where.
3904 * unlocked-io.h: Include <stdio.h>, so that the caller
3905 doesn't have to include <stdio.h> before us.
3906 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
3907 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
3908 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
3909 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
3910 if not declared, so that we can use getpass.c code from libc without
3912 (flockfile, ftrylockfile, funlockfile): New macros.
3914 2003-10-06 Bruno Haible <bruno@clisp.org>
3916 * version-etc-2.h: Remove file.
3917 * version-etc-2.c: Remove file.
3919 2003-09-25 Jim Meyering <jim@meyering.net>
3920 Bruno Haible <bruno@clisp.org>
3922 This lets translators provide better translations for the
3923 "Written by ..." part of --version output.
3924 * version-etc.h: Include stdarg.h.
3925 (version_etc_copyright): Declare as readonly.
3926 (version_etc): Make this function variadic with a NULL-terminated list
3927 of author name strings.
3928 (version_etc_va): New declaration.
3929 * version-etc.c: Include stdarg.h, stdlib.h.
3930 (version_etc_copyright): Declare as readonly.
3931 (version_etc_va): New function. Provide a different translatable string
3932 for each possible number of authors < 10. Abbreviate when there are 10
3934 (version_etc): Make this function variadic. Call version_etc_va.
3935 Suggestion from Gary V. Vaughan.
3937 * long-options.h (parse_long_options): Change prototype: the authors
3938 string is moved to the end and becomes variadic.
3939 * long-options.c: Include stdarg.h.
3940 (parse_long_options): Make this function variadic, too.
3941 Call version_etc_va, not version_etc.
3943 2003-10-06 Bruno Haible <bruno@clisp.org>
3945 * fatal-signal.h: New file, from GNU gettext.
3946 * fatal-signal.c: New file, from GNU gettext.
3948 2003-10-04 Karl Berry <karl@gnu.org>
3950 * argp*: update from libc.
3952 2003-10-01 Larry Jones <lawrence.jones@eds.com>
3954 * getpass.c (getpass): Use a no-op fseek when switching from input to
3955 output mode on the same stream.
3957 2003-09-29 Paul Eggert <eggert@twinsun.com>
3959 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
3960 Fix arg typo in previous patch.
3962 2003-09-28 Jim Meyering <jim@meyering.net>
3964 * error.c: Correct cpp indentation.
3966 2003-09-27 Paul Eggert <eggert@twinsun.com>
3968 * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
3969 Omit the special code that used __typeof__, since we worry that
3970 it could be more trouble than it's worth. See:
3971 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
3972 http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
3976 2003-09-26 Jim Meyering <jim@meyering.net>
3978 * error.c (error_tail): Move some declarations
3979 into inner scope where the local variables are used.
3981 2003-09-26 Bruno Haible <bruno@clisp.org>
3983 * stpncpy.h (gnu_stpncpy): New declaration.
3984 (stpncpy): Define as alias for gnu_stpncpy.
3985 * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
3987 2003-09-26 Paul Eggert <eggert@twinsun.com>
3989 * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
3990 (error_tail): Do not loop, reallocating temporary buffer, since
3991 the output cannot contain more wide characters than the input
3992 contains bytes, the size must be big enough already. This avoids
3993 one potential size overflow calculation. Check for size overflow
3994 when calculating temporary buffer size. Free temporary buffer
3995 when done, if it was allocated with malloc; this plugs a memory
3996 leak. Remove casts from void * to pointers, that are no longer
3997 needed now that we're assuming C89 or better.
3999 Merge error changes from glibc.
4001 * error.c, error.h: Update copyright notice header to match glibc.
4002 * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
4003 (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
4004 Disable cancellation while printing error.
4005 * error.h: Prepend __ to parameter names.
4007 2003-09-25 Karl Berry <karl@gnu.org>
4009 * argp-fmtstream.c, argp-help.c: update from libc.
4011 2003-09-25 Bruno Haible <bruno@clisp.org>
4013 * version-etc-2.h: New file, from version-etc.h with modifications.
4014 * version-etc-2.c: New file, from version-etc.c with modifications.
4016 2003-09-25 Simon Josefsson <jas@extundo.com>
4018 * xgetdomainname.h: New file.
4019 * xgetdomainname.c: New file.
4021 2003-09-25 Simon Josefsson <jas@extundo.com>
4022 Bruno Haible <bruno@clisp.org>
4024 * getdomainname.h: New file.
4025 * getdomainname.c: New file.
4027 2003-09-24 Paul Eggert <eggert@twinsun.com>
4029 * linebuffer.c (freebuffer): Don't free the argument, just
4030 the buffer associated with the argument. Bug reported by
4033 2003-09-19 Karl Berry <karl@gnu.org>
4035 * argp.h: update from libc.
4037 2003-09-16 Paul Eggert <eggert@twinsun.com>
4039 * linebuffer.c (readlinebuffer): Return NULL immediately upon
4040 input error, instead of returning NULL the next time we are called
4041 (and therefore losing track of errno).
4043 2003-09-15 Paul Eggert <eggert@twinsun.com>
4045 * getndelim2.c (getndelim2): Don't trash errno when a read
4046 fails, so that the caller gets the proper errno.
4048 * readutmp.c (read_utmp): Likewise.
4049 Check for fstat error. Close stream and free storage
4052 2003-09-14 Bruno Haible <bruno@clisp.org>
4054 * fwriteerror.h: New file.
4055 * fwriteerror.c: New file.
4057 2003-09-14 Jim Meyering <jim@meyering.net>
4059 * getloadavg.c: Correct cpp indentation.
4060 * strdup.c: Likewise.
4061 * vasnprintf.c: Likewise.
4063 2003-09-12 Paul Eggert <eggert@twinsun.com>
4065 * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
4066 * obstack.c [!defined _LIBC]: Likewise.
4067 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4068 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4069 * exitfail.c: Don't include stdlib.h; no longer needed.
4071 More changes to assume C89 or better.
4073 * error.c (error_tail): Assume vprintf.
4075 * argmatch.c (getenv): Remove decl.
4076 * progreloc.c (get_full_program_name): Define via prototype.
4077 * setenv.c (clearenv): Likewise.
4078 * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
4080 * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
4081 (malloc, memcpy): Remove decls.
4082 * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
4083 (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
4084 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4085 (memcpy): Remove macro.
4086 (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
4087 (__P): Remove. All uses removed.
4088 (PTR): Remove. All uses changed to void *.
4089 (CHAR_BIT, NULL): Remove.
4090 (spaces, zeros, memset_space, memset_zero)
4091 [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
4093 (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
4094 (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
4095 Define with prototype.
4096 Remove now-unnecessary prototype decl.
4097 (extra_args_spec): Assume ANSI C. All uses changed.
4098 (extra_args_spec_iso): Remove.
4099 (my_strftime, emacs_strftimeu): Define via prototype.
4100 * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
4102 (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
4103 * strtoimax.c: Include <stdlib.h> unconditionally.
4104 (strtoul, strtol): Remove decls.
4105 * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
4107 Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
4108 (LOCALE_PARAM_DECL): Remove. All uses changed to LOCALE_PARAM_PROTO.
4109 (LOCALE_PARAM_PROTO): New macro.
4110 (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
4111 (INTERNAL (strtol), strtol): Define with a prototype.
4112 (PARAMS): Remove. All uses removed.
4113 * tempname.c: Include <string.h> unconditionally.
4114 * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
4115 * xgethostname.c (main): Define with a prototype.
4116 * xmalloc.c: Include "xalloc.h" first, to check interface.
4117 Include <stdlib.h> unconditionally.
4118 (calloc, malloc, realloc, free): Remove decls.
4119 * xstrtod.c: Include "xstrtod.h" first, to check interface.
4120 Include <stdlib.h> unconditionally. Sort include file names.
4122 (xstrtod): Define with a prototype.
4123 * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
4124 (strtol, strtoul): Remove decls.
4126 2003-09-11 Paul Eggert <eggert@twinsun.com>
4128 * strndup.c: Don't include <stdio.h>, <sys/types.h>.
4129 Include <stdlib.h>, <string.h> unconditionally.
4130 Remove now-unnecessary cast to char *.
4131 * strnlen.c: Include <string.h> unconditionally.
4132 * yesno.c (yesno): Define with a prototype.
4134 2003-09-10 Bruno Haible <bruno@clisp.org>
4136 * strcspn.c: Include <string.h> unconditionally.
4137 * strpbrk.c: Include <string.h> unconditionally.
4138 * strstr.c: Include <string.h> unconditionally.
4139 * unicodeio.c: Include <string.h> unconditionally.
4140 * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
4141 * unsetenv.c: Likewise.
4142 * xreadlink.c: Include <stdlib.h> unconditionally.
4143 * yesno.c: Include <stdlib.h> unconditionally.
4144 (rpmatch): Add prototype.
4146 2003-09-10 Jim Meyering <jim@meyering.net>
4148 * error.c: Correct indentation of cpp directives.
4150 2003-09-09 Paul Eggert <eggert@twinsun.com>
4154 * acosl.c (main): Use a prototype.
4155 * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
4158 * getloadavg.c (getloadavg, main): Define via prototypes.
4160 * getopt.h (struct option.name): Assume C89, and use 'const'.
4161 (getopt, etopt_long, getopt_long_only, _getopt_internal)
4162 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
4164 * getopt.c (const): Remove macro.
4165 Include <string.h> unconditionally.
4166 (my_index): Remove; all uses changed to strchr.
4167 (strlen): Remove decl.
4168 (exchange): Remove forward decl; no longer needed.
4169 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
4170 Define with prototype.
4171 * getopt1.c (const): Remove macro.
4172 (getopt_long, getopt_long_only, main): Define with prototype.
4174 * getugroups.c: Include <string.h> unconditionally.
4176 * getusershell.c: Include <stdlib.h> unconditionally.
4177 (getusershell, setusershell, endusershell, readname, main):
4178 Define with prototypes.
4180 * group-member.c: Include group-member.h first.
4181 Include <stdlib.h> unconditionally.
4183 * hard-locale.c: Include hard-locale.h first.
4184 Include <stdlib.h>, <string.h> unconditionally.
4186 * hash.c (free, malloc): Remove decls.
4187 Include <stdlib.h> unconditionally.
4189 * human.c: Include <stdlib.h>, <string.h> unconditionally.
4190 (getenv): Do not declare.
4192 * idcache.c: Include <string.h> unconditionally.
4194 * long-options.c: Include long-options.h first, to test interface.
4195 Include <stdlib.h> unconditionally.
4197 * makepath.c: Include makepath.h first, to test interface.
4198 Include <stdlib.h> and <string.h> unconditionally.
4200 * linebuffer.c: Include <stdlib.h>.
4201 (free): Remove decl.
4203 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
4204 rpl_malloc returns void *, not char *.
4205 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
4207 * md5.h: Include <limits.h> unconditionally.
4208 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
4209 (__P): Remove; all uses removed.
4210 * md5.c: Include "md5.h" first.
4211 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
4212 md5_buffer, md5_process_bytes, md5_process_block):
4213 Define with prototypes.
4214 * sha.h (__P): Remove all uses. (It wasn't defined??)
4215 * sha.c: Include "sha.h" first.
4216 Include <stdlib.h>, <string.h> unconditionally.
4218 * memchr.c (__ptr_t): Remove; all uses changed to void *.
4219 * memcmp.c (__ptr_t): Likewise.
4220 * memrchr.c (__ptr_t): Likewise.
4221 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
4222 Include <string.h> unconditionally.
4223 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
4224 * memchr.c: Include <stdlib.h> unconditionally.
4225 * memchr.c (LONG_MAX): Remove.
4226 * memrchr.c (LONG_MAX): Likewise.
4227 * memchr.c (__memchr): Define via a prototype.
4228 * memrchr.c (__memrchr): Likewise.
4229 * memcmp.c (__P): Remove, and remove all uses.
4230 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
4231 Remove forward decls; no longer needed.
4232 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
4233 Use types required by C89 in prototype.
4235 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
4236 * savedir.c: Likewise.
4237 * mkdir.c (free): Remove decl.
4238 * rmdir.c (rmdir): Define with a prototype.
4239 * savedir.c: Include savedir.h first, to test interface.
4241 * mktime.c (STDC_HEADERS): Remove.
4242 Include <stdlib.h>, <string.h> unconditionally.
4244 * modechange.c: Include <stdlib.h> unconditionally.
4245 (malloc): Remove decl.
4247 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
4248 (free): Remove decl.
4250 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
4251 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
4252 (This type really should be intptr_t, but that's a C99ism.)
4253 (_obstack_memcpy): Remove: all uses changed to memcpy.
4254 Include <string.h> unconditionally.
4255 (struct obstack): Assume __STDC__ for types of members
4256 chunkfun, freefun, extra_arg.
4257 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
4258 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
4259 obstack_begin, obstack_specify_allocation,
4260 obstack_specify_allocation_with_arg, obstack_chunkfun,
4261 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
4262 Remove unprototyped decls and the macros that use them.
4263 * obstack.c (POINTER): Remove. All uses changed to void *.
4264 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
4265 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
4266 (defined __STDC__ && __STDC__)]:
4267 Remove nonprototyped code.
4268 Include <stdlib.h> unconditionally.
4269 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
4270 _obstack_allocated_p, _obstack_free, obstack_free,
4271 _obstack_memory_used, print_and_abort):
4272 Define using prototypes.
4273 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
4274 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
4275 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
4276 obstack_next_free, obstack_object_size, obstack_room) [0]:
4277 Remove unused, unprototyped code.
4279 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
4281 * physmem.c (physmem_total, physmem_available, main): Define
4284 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
4285 (main): Define with a prototype.
4287 * posixver.c (getenv): Remove decl.
4289 * putenv.c (malloc): Returns void *, not char *.
4290 Include <string.h> unconditionally.
4291 (strchr, memcpy, NULL): Do not define.
4293 * readtokens.c: Include readtokens.h first, to test interface.
4294 Include <stdlib.h>, <string.h> unconditionally.
4295 (init_tokenbuffer): Define with a prototype.
4297 * regex.c (PARAMS): Remove. All uses removed.
4298 All uses of _RE_ARGS removed, too.
4299 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4301 (bzero): Assume memset exists.
4302 (memcmp, memcpy, NULL): Remove.
4303 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
4304 char, or assignments to local vars of type signed char.
4305 (init_syntax_once, PREFIX(extract_number_and_incr),
4306 PREFIX(print_partial_compiled_pattern),
4307 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
4308 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
4309 PREFIX(regex_grow_registers), PREFIX(regex_compile),
4310 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
4311 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
4312 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
4313 wcs_compile_range, byte_compile_range, truncate_wchar,
4314 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
4315 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
4316 count_mbs_length, wcs_re_match_2_internal,
4317 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
4318 PREFIX(alt_match_null_string_p),
4319 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
4320 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
4321 regfree, PREFIX(extract_number)): Define with prototype. Remove
4322 now-unnecessary declaration, if any.
4323 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
4325 Remove now-unnecessary casts among pointer types.
4326 * regex.h (_RE_ARGS): Remove. All uses removed.
4328 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
4329 (free): Remove decl.
4331 * rpmatch.c: Include <stdlib.h> unconditionally.
4333 * same.c: Include <stdlib.h>, <string.h> unconditionally.
4334 (free): Remove decl.
4336 * save-cwd.c: Include <stdlib.h> unconditionally.
4337 * xgetcwd.c: Likewise.
4339 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
4340 (free): Remove decl.
4342 * strchrnul.c (strchrnul): Define with a prototype.
4343 Fix bug: c_in was not converted to char before searching.
4345 The following changes are not K&R related:
4347 * group-member.h: Include <sys/types.h>, so that this file is
4349 * makepath.h: Likewise.
4351 * getusershell.c (readname, default_index, line_size, readname):
4352 Use size_t, not int, for sizes.
4353 (readname): If the size overflows, report an error instead of
4356 2003-09-09 Derek Robert Price <derek@ximbiot.com>
4358 * getndelim2.c: Assume stdlib.h per the C89 spec.
4360 2003-09-08 Paul Eggert <eggert@twinsun.com>
4362 Assume C89 or better; remove K&R cruft.
4363 A few of these changes were first proposed by Derek Robert Price
4364 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
4366 * addext.c: Include <string.h> unconditionally.
4367 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
4368 Don't declare getenv or malloc.
4370 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
4371 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
4373 (find_stack_direction, alloca): Use prototypes.
4375 * atexit.c (atexit): Define using a prototype.
4377 * basename.c, dirname.c, stripslash.c:
4378 Include <string.h> unconditionally.
4380 * bcopy.c: Include <stddef.h>.
4381 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
4383 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
4385 * error.h (error, error_at_line, error_print_progname)
4386 [! (defined (__STDC__) && __STDC__)]: Remove decls.
4387 * error.c: Include error.h first, to check interface.
4388 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4389 (VA_START): Remove; all uses changeed to va_start.
4390 (exit, strerror): Remove decls.
4391 (error_print_progname): Prototype uncondionally.
4392 Don't include <errno.h>; no longer needed.
4393 (private_strerror): Remove.
4394 (error_tail): Always define.
4395 (error, error_at_line): Assume C89 or better; always use prototypes.
4396 * fatal.c: Include "fatal.h" first, to test interface.
4397 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4398 (VA_START): Remove; all uses changed to va_start.
4399 [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
4401 (exit): Remove decl.
4402 (fatal): Prototype unconditionally. Assume va_start works.
4403 Abort at end, to pacify gcc.
4405 * euidaccess.c (main): Define with a prototype.
4407 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
4409 * exitfail.c: Include <stdlib.h> unconditionally.
4411 * fnmatch_.h (__P): Remove. All uses changed to assume
4413 * fnmatch.c: Include fnmatch.h first, to test interface.
4414 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
4415 (getenv): Remove decl.
4416 (fnmatch): Define using a prototype.
4417 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
4418 (FCT): Define using a prototype.
4420 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
4422 * gethostname.c: Include <stddef.h>.
4423 (gethostname): Define with prototype. Length is size_t, not int.
4425 2003-09-08 Paul Eggert <eggert@twinsun.com>
4427 * getversion.c: Remove; was migrated to backupfile.c in 1997.
4428 getversion.c should have been removed then, but was accidentally
4431 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
4432 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
4434 2003-09-07 Paul Eggert <eggert@twinsun.com>
4436 * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
4437 copy_tm_result. Bug reported by Simon Josefsson in
4438 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
4440 2003-09-06 Paul Eggert <eggert@twinsun.com>
4442 * time_r.c, time_r.h: New files.
4444 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
4446 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
4447 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
4449 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
4451 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
4452 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
4455 * timegm.c: Switch to glibc implementation, with the following changes:
4456 [defined HAVE_CONFIG_H]: Include <config.h>.
4457 [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
4458 (__mktime_internal) [!defined _LIBC]: New decl.
4459 (__gmtime_r) [!defined _LIBC]: New macro and function.
4460 (timegm): Use a prototype, since gnulib assumes C89.
4461 Do not bother declaring tmp to be const, as it's not really usefu.
4462 * timegm.h: Hoist "#include <time.h>" out of #ifdef.
4463 (timegm): Declare only if HAVE_DECL_TIMEGM.
4465 2003-09-03 Paul Eggert <eggert@twinsun.com>
4467 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
4468 Bug reported by Lute Kamstra in
4469 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
4471 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
4472 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
4473 course with correspondingly smaller numbers for tomorrow and
4474 yesterday. From Tadayoshi Funaba. Originally installed into
4475 sh-utils on 1999-08-07, but the patch got lost (I guess during the
4478 2003-08-31 Simon Josefsson <jas@extundo.com>
4480 * timegm.h: New file.
4481 * timegm.c: New file. Based on wget-1.8.2/src/http.c:mktime_from_utc.
4483 2003-08-31 Karl Berry <karl@gnu.org>
4485 * argp.h: update from libc.
4487 2003-08-28 Bruno Haible <bruno@clisp.org>
4489 * binary-io.h: Undefine O_BINARY before defining it. This avoids a
4490 warning on QNX, which defines O_BINARY to 000000.
4492 2003-08-24 Bruno Haible <bruno@clisp.org>
4494 * binary-io.h: Include <stdio.h>, to avoid a compilation error when
4495 MSVC7 <stdio.h> is included later.
4497 2003-08-20 Bruno Haible <bruno@clisp.org>
4499 * progname.h: New file, from GNU gettext.
4500 * progname.c: New file, from GNU gettext.
4501 * progreloc.c: New file, from GNU gettext.
4503 2003-08-19 Bruno Haible <bruno@clisp.org>
4505 * xstrdup.c: Assume <string.h> exists.
4507 2003-08-18 Jim Meyering <jim@meyering.net>
4509 * setenv.h: Indent nested cpp directive.
4510 * vasnprintf.c: Remove trailing blanks.
4512 2003-08-17 Simon Josefsson <jas@extundo.com>
4513 Bruno Haible <bruno@clisp.org>
4515 * xstrndup.h: New file.
4516 * xstrndup.c: New file.
4518 2003-08-17 Bruno Haible <bruno@clisp.org>
4520 * strndup.h: New file.
4522 2003-08-16 Paul Eggert <eggert@twinsun.com>
4524 * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
4525 space, undoing this 2003-08-12 change:
4526 <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
4528 2003-08-16 Jim Meyering <jim@meyering.net>
4530 Merge from coreutils.
4531 * xstrtoimax.c: #else #if -> #elif.
4532 * xstrtoumax.c: Likewise.
4534 2003-08-15 Paul Eggert <eggert@twinsun.com>
4536 * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
4537 rather than tab, after '#' in shell-script copyright notices.
4538 Suggested by Bruno Haible.
4540 2003-08-15 Jim Meyering <jim@meyering.net>
4541 and Paul Eggert <eggert@twinsun.com>
4543 Merge from coreutils.
4544 * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
4545 member but strut utmpx does not. Needed for AIX 4.3.3.
4546 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
4548 2003-08-15 Jim Meyering <jim@meyering.net>
4550 Merge from coreutils.
4551 * xgethostname.c: Include <stdlib.h>.
4552 (xghostname): Don't exit for anything other than memory-related
4553 failure; just return NULL.
4554 * userspec.c: Include "posixver.h".
4555 (parse_user_spec): Accept `.' as a separator only
4556 in pre-POSIX-200112 mode.
4557 * strtoimax.c: Use #elif rather than #else #if.
4558 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
4559 Remove function, now that we can rely on a working tzset function.
4560 [!_LIBC]: Ensure that the required autoconf test has been run.
4561 [!defined _NL_CURRENT && HAVE_STRFTIME]:
4562 Use underlying_strftime for %r.
4563 * sha.c: Merge in some clean-up and optimization changes from glibc.
4564 * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
4565 Ensure that it is a multiple of 64.
4566 Rearrange loop exit tests so as to avoid performing an
4567 additional fread after encountering an error or EOF.
4568 * realloc.c: Update copyright date.
4570 2003-08-14 Jim Meyering <jim@meyering.net>
4572 Merge from coreutils.
4573 * obstack.h: Whitespace changes.
4574 * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
4575 and xcalloc return values.
4576 (read_filesystem_list) [MOUNTED_GETFSSTAT]:
4577 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
4578 hang on OSF/1 5.1 for DIR on both local and remote file systems.
4579 Reported by (and fix confirmed by) Nelson H. F. Beebe.
4580 (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4582 Use mntctl's return value to drive the entry-processing loop, since
4583 we can't rely on the value of the vmt_length member in the last
4584 entry. On some systems doing so could result in exhausting
4585 virtual memory. Based in part on a patch from Mike Jetzer.
4587 2003-08-14 Jim Meyering <jim@meyering.net>
4588 and Paul Eggert <eggert@twinsun.com>
4590 Merges from coreutils, plus other fixes.
4591 * physmem.c: Merge in portability changes from gcc/libiberty
4592 to support AIX, IRIX, Tru64, and Windows. See the ChangeLog there
4593 for credits and details. Thanks to Kaveh Ghazi for helping
4594 to keep these files in sync.
4595 (ARRAY_SIZE): Define it.
4596 (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
4597 * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
4598 (memcasecmp): Don't assume size_t fits in unsigned int.
4599 Remove casts and duplicate code.
4600 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
4601 (memcpy): Remove definition.
4602 Merge in some clean-up and optimization changes from glibc.
4603 [BLOCKSIZE]: Move definition to top of file.
4604 Ensure that it is a multiple of 64.
4605 Rearrange loop exit tests so as to avoid performing an
4606 additional fread after encountering an error or EOF.
4607 * md5.h (md5_uintptr): Define.
4608 * makepath.c (CLEANUP_CWD): Report an error if we failed to
4609 return to the initial working directory. Preserve errno
4611 * idcache.c: Include "xalloc.h".
4612 (xmalloc, xrealloc): Remove decls.
4613 (getuser): Remove casts no longer required in C89.
4614 * human.c: Include stdio.h, for sprintf.
4615 * group-member.c: Include "xalloc.h".
4616 (xmalloc, xrealloc): Remove decls.
4617 (get_group_info): Remove casts no longer required in C89.
4618 * getusershell.c (readname): Remove casts no longer required in C89.
4619 * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
4620 * getline.c: Whitespace fix, from coreutils.
4622 2003-08-13 Paul Eggert <eggert@twinsun.com>
4624 * exclude.c: Include <ctype.h>
4625 (IN_CTYPE_DOMAIN): New macro.
4627 (add_exclude_file): If LINE_END is a space, ignore trailing spaces
4630 * argp-help.c, argp-parse.c, config.charset, getopt.h:
4631 Undo previous (whitespace-only) change.
4633 2003-08-12 Paul Eggert <eggert@twinsun.com>
4635 * argp-help.c, argp-parse.c, config.charset, getopt.h:
4636 Normalize leading white space and remove trailing white space.
4637 * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
4638 notice, as per ../config/srclist-update.
4640 Merge from coreutils.
4641 * euidaccess.h: New file.
4642 * euidaccess.c: Include it.
4643 * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
4644 vasnprintf.h, vasprintf.h. Remove strdup.c, gettext.h.
4645 * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
4647 2003-08-11 Bruno Haible <bruno@clisp.org>
4649 * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
4650 (vasnprintf): Use it instead of wcslen.
4652 2003-08-11 Bruno Haible <bruno@clisp.org>
4654 * stdbool_.h (_Bool): Undo last change; instead use a negative enum
4655 value to ensure that _Bool promotes to int. Use #define for _Bool when
4656 using the Solaris C compiler. Adds comments suggested by Paul Eggert.
4658 2003-08-10 Karl Berry <karl@gnu.org>
4660 * regex.h: update from libc (whitespace fix).
4662 2003-08-09 Paul Eggert <eggert@twinsun.com>
4664 Merge some files from coreutils. These changes were
4665 originally made by Jim Meyering.
4666 * acl.c: Include <sys/types.h> before <sys/stat.h>;
4667 many older Unixes require this.
4668 * alloca.c (alloca): Remove cast to argument of free;
4669 no longer needed in C89.
4670 * alloca_.h, regex.h: Fix white space to match
4671 what GNU indent does.
4673 2003-08-05 Paul Eggert <eggert@twinsun.com>
4675 * bumpalloc.h: Remove.
4677 2003-08-04 Paul Eggert <eggert@twinsun.com>
4679 * getloadavg.c: Change copyright notice and spacing to conform to
4682 Merge from coreutils.
4683 * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
4685 * getdate.y (date): Also accept dates like May-23-2003; suggestion
4686 from Karl Berry, implemented by Jim Meyering.
4687 * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
4688 from Dmitry V. Levin.
4689 Remove anachronistic cast of xrealloc.
4690 * fnmatch_.h (__const): Remove. Use 'const'.
4691 * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
4692 type. Otherwise, it wouldn't compile with at least /bin/cc on
4693 ymp-cray-unicos9.0.2.X.
4694 Combine two mostly-identical uses of alloca into one.
4695 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
4697 2003-08-04 Dave Love <d.love@dl.ac.uk>
4701 * getloadavg.c: Check `__unix' as well as `unix'. Use #ifdef, not
4702 #if. Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE. Check
4703 F_SETFD, not FD_SETFD. Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
4704 obsolete NLIST_NAME_UNION.
4705 [__GNU__]: Undef BSD and FSCALE.
4706 [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
4708 2003-08-03 Paul Eggert <eggert@twinsun.com>
4710 * stdbool_.h (_Bool): Make it signed char, instead of
4711 an enum type, so that it's guaranteed to promote to int. See:
4712 <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
4714 2003-07-31 Paul Eggert <eggert@twinsun.com>
4716 * strerror.c: Include config.h, limits.h. Declare sprintf.
4717 (strerror): Don't assume that a printable int fits in 14 bytes.
4719 2003-07-24 Derek Robert Price <derek@ximbiot.com>
4720 Bruno Haible <bruno@clisp.org>
4722 * getline.h (getline, getdelim): Change return type to ssize_t.
4723 * getline.c (getline, getdelim): Likewise.
4724 Remove _GNU_SOURCE define; now it's defined in config.h through
4727 2003-07-22 Paul Eggert <eggert@twinsun.com>
4729 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
4730 over-parenthesization in macros.
4732 Sync with coreutils.
4734 * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
4737 Use `exit_failure' for xalloc and xmemcoll instead of their own
4738 private exit-failure variables.
4739 * xalloc.h (xalloc_exit_failure): Remove.
4740 * xmalloc.c: Likewise. Include exitfail.h.
4741 (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
4742 * xmemcoll.h (xmemcoll_exit_failure): Remove.
4743 * xmemcoll.c: Likewise. Include exitfail.h.
4744 (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
4746 2003-07-18 Paul Eggert <eggert@twinsun.com>
4748 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
4749 * closeout.c: Likewise. Include "closeout.h" right after config.h,
4750 to test that it can stand by itself. Include "exitfail.h".
4751 Clients should set exit_failure instead.
4752 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
4754 2003-07-18 Andreas Schwab <schwab@suse.de>
4756 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
4758 2003-07-18 Bruno Haible <bruno@clisp.org>
4760 * getndelim2.h: New file.
4761 * getndelim2.c: Make into a module of its own. Include config.h,
4763 (getndelim2): Make non-static. Change return type to ssize_t.
4764 * getline.h: Change argument names.
4765 * getline.c: Include getndelim2.h instead of getndelim2.c.
4766 * getnline.c: Include getndelim2.h.
4768 2003-07-17 Bruno Haible <bruno@clisp.org>
4770 * Makefile.am: Remove file.
4771 * Makefile.in: Remove file.
4773 2003-07-17 Bruno Haible <bruno@clisp.org>
4775 * getnline.h: New file.
4776 * getnline.c: New file.
4777 * getndelim2.c: New file, extracted from getline.c.
4778 (getndelim2): Renamed from getdelim2, with added nmax argument.
4779 * getline.c: Include getndelim2.c.
4780 (getdelim2): Moved out to getndelim2.c.
4781 (getline, getdelim): Update.
4783 2003-07-15 <karl@gnu.org>
4785 * vasnprintf.c: update from gettext.
4787 2003-07-15 Jim Meyering <jim@meyering.net>
4789 * makepath.c (make_path): Enclose diagnostic in _(...).
4791 2003-07-14 Paul Eggert <eggert@twinsun.com>
4793 * asnprintf.c, asprintf.c, config.charset, gettext.h,
4794 localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
4795 printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
4796 ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
4797 vasprintf.c, vasprintf.h: Regenerate. These files are now being
4798 updated automatically by ../config/srclist-update. This changes
4799 their license from LPGL to GPL.
4801 2003-07-14 Jim Meyering <jim@meyering.net>
4803 Don't emit diagnostics. Let callers do that.
4804 * save-cwd.c: Don't include "error.h".
4805 (save_cwd): Don't call error. Ensure that errno is valid
4806 when returning nonzero.
4808 * save-cwd.h (restore_cwd): Update prototype.
4809 * save-cwd.c (restore_cwd): Remove two parameters.
4810 Simplify. Don't call error upon failure. Let callers do that.
4811 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
4812 when auditing is enabled. But don't bother updating the #if.
4814 2003-07-14 Simon Josefsson <jas@extundo.com>
4816 * mempcpy.h: New file.
4817 * mempcpy.c: New file.
4819 2003-07-14 Paul Eggert <eggert@twinsun.com>
4821 * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
4822 sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
4823 unicodeio.c, unicodeio.h, unlocked-io.h:
4824 Switch from LGPL to GPL.
4826 2003-07-11 Alexandre Duret-Lutz <adl@gnu.org>
4828 * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
4829 it breaks C++ compilation.
4830 [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
4832 2003-07-10 Jim Meyering <jim@meyering.net>
4834 * vasnprintf.c: Remove trailing blanks.
4835 Make cpp indentation consistent.
4837 2003-07-09 Paul Eggert <eggert@twinsun.com>
4839 * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
4840 posixver.c, strftime.c, strnlen.c, strverscmp.c:
4841 Switch from LGPL to GPL.
4843 2003-07-07 Paul Eggert <eggert@twinsun.com>
4845 * mktime.c: Fix some boundary cases and remove need for floating point.
4847 Issue a compile-time diagnostic if time_t is floating point, or if
4848 two's complement arithmetic is not in effect, or if arithmetic
4849 right shift does not propagate the sign. These assumptions were
4850 all in the original code but they weren't checked.
4852 (TIME_T_MIDPOINT, verify): New macros.
4853 (__isleap): Remove; it has integer overflow problems.
4854 (leapyear): New function, without those problems.
4855 (ydhms_tm_diff): Remove; splitting into two parts.
4856 (ydhms_diff): New function, containing the arithmetic part of
4857 the old ydhms_tm_diff function. Issue a compile-time
4858 diagnostic if we are not using C99 integer division.
4859 Avoid casts when possible.
4860 (guess_time_tm): New function, containing the checking part of
4861 the old ydhms_tm_diff function. Return the new value, rather than
4862 the difference between it and the old. Accept a new argument T
4863 so that *T specifies the old value. Check for overflow in the result.
4865 (__mktime_internal): Use a time_t offset, not a long int offset.
4866 This undoes the 2003-06-04 change, which is no longer needed now
4867 that we have better overflow checking.
4868 (localtime_offset): Likewise.
4870 (__mktime_internal): Avoid harmful overflow on hosts where time_t
4871 and long are 64-bit but int is only 32-bit.
4872 (ydhms_diff): Use long int to store year1 and yday1.
4873 Issue a compile-time diagnostic if long int is not wide enough.
4875 (__mktime_internal): Use long int to store adjusted year and yday.
4876 Use plain C rather than preprocessor commands, if that doesn't
4878 Check for overflow (and try to repair) after each probe
4879 rather than checking only at the very end. This avoids some bugs
4880 (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
4881 does not equal GMT offset at maximum time).
4882 Use integer to check for overflow rather than floating point; this
4883 is more portable to non-IEEE hosts, and is a tad faster.
4884 When we detect that we are oscillating between two values,
4885 don't check whether tm_isdst has the requested value, since
4886 we already know the answer. When tm_isdst has the wrong value,
4887 use a different heuristic to find the right one, based on the
4888 extreme values actually observed in practice in tz2003a,
4889 rather than the (overly optimistic) "previous 3 calendar quarters".
4891 (not_equal_tm, print_tm, check_result): Use "const T" rather than
4892 "T const" to accommodate glibc style.
4893 (check_result): Use less-confusing report format. "long" -> "long int.
4895 Don't loop if the iteration overflows time_t.
4896 Allow a negative step in the iteration.
4898 2003-07-01 Paul Eggert <eggert@twinsun.com>
4900 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
4901 having it depend on HAVE_SYS_TYPES_H.
4903 2003-06-25 Bruno Haible <bruno@clisp.org>
4905 * readlink.c: New file.
4907 2003-06-20 Bruno Haible <bruno@clisp.org>
4909 Assume C89, so PARAMS isn't needed.
4910 * unicodeio.h (PARAMS): Remove.
4911 * unicodeio.c: Don't use PARAMS.
4913 2003-06-18 Jim Meyering <jim@meyering.net>
4915 Merge changes from coreutils.
4916 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
4917 Remove explicit declarations of xmalloc and realloc.
4919 (read_utmp): Remove anachronistic cast of xmalloc.
4921 2003-06-17 Paul Eggert <eggert@twinsun.com>
4923 Assume C89, so PARAMS isn't needed.
4924 * backupfile.h (PARAMS): Remove. All uses removed.
4925 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
4926 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
4927 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
4928 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
4929 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
4930 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
4931 xstrtol.h: Likewise.
4932 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
4933 same.h, strverscmp.h: Do not include config.h; no longer needed.
4934 Anyway, config.h should always be included before any other file.
4936 2003-06-11 Simon Josefsson <jas@extundo.com>
4938 * sysexit_.h: New file.
4940 2003-05-20 Derek Price <derek@ximbiot.com>
4942 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
4944 2003-06-10 Simon Josefsson <jas@extundo.com>
4946 * strchrnul.h: New file.
4947 * strchrnul.c: New file.
4949 2003-06-10 Simon Josefsson <jas@extundo.com>
4951 * argp.h: New file, from glibc.
4952 * argp-ba.c: New file, from glibc.
4953 * argp-eexst.c: New file, from glibc.
4954 * argp-fmtstream.c: New file, from glibc.
4955 * argp-fmtstream.h: New file, from glibc.
4956 * argp-fs-xinl.c: New file, from glibc.
4957 * argp-help.c: New file, from glibc.
4958 * argp-namefrob.h: New file, from glibc.
4959 * argp-parse.c: New file, from glibc.
4960 * argp-pv.c: New file, from glibc.
4961 * argp-pvh.c: New file, from glibc.
4962 * argp-xinl.c: New file, from glibc.
4964 2003-06-07 Jim Meyering <jim@meyering.net>
4966 * readtokens.h: Put `Free Software Foundation, Inc.'
4967 in place of my name in the copyright comment.
4968 Remove definition and uses of __P.
4971 * stat.c: Don't declare xmalloc explicitly.
4972 Instead, include "xalloc.h".
4973 * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
4974 xrealloc, and xcalloc return values.
4975 * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
4977 * xgetcwd.h: Remove definition/uses of PARAMS.
4979 2003-06-06 Jim Meyering <jim@meyering.net>
4981 * stdbool_.h: Renamed from stdbool.h.in.
4983 2003-06-06 Jim Meyering <jim@meyering.net>
4985 Merge from coreutils.
4986 * same.c: (same_name): Declare *_basename locals to be `const'.
4987 Consolidate declarations and initializations of *_base* locals.
4989 Merge from coreutils.
4990 This avoids a core dump on systems without GNU putenv,
4991 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
4992 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
4993 (unsetenv): New static function, from GNU libc.
4994 (rpl_putenv): Use it.
4996 * modechange.c: Remove trailing blanks.
4998 Merge from coreutils.
4999 * fsusage.c: Remove declaration of statfs.
5000 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5002 * posixtm.c: Include <stdbool.h> unconditionally.
5004 2003-06-05 Paul Eggert <eggert@twinsun.com>
5006 * mktime.c (__mktime_internal): When resolving a tm_isdst
5007 mismatch, look in future quarters as well as past. This fixes a
5008 bug when processing fall-backwards gaps immediately after a long
5009 period of daylight-saving time.
5011 * mktime.c: Assume freestanding C89 or better.
5012 (HAVE_LIMITS_H): Remove. Assume it's 1.
5013 (__P): Remove; not used.
5014 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5015 (mktime, not_equal_tm, print_tm, check_result,
5016 main): Use prototypes. Use const * where appropriate.
5017 (main): Fix typo in testing code that uncovered by above changes.
5018 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5020 2003-06-04 Paul Eggert <eggert@twinsun.com>
5022 * mktime.c: Fix Debian bug 177940
5023 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
5024 (localtime_offset): Now long int, not time_t, because we want it
5025 to be guaranteed to be signed. All uses changed.
5026 (__mktime_internal): If overflow would occur when adding offset,
5029 Merge 'human' changes from coreutils. Rewrite to support
5030 locale-specific notations like thousands separators.
5031 * human.c: Simplify authorship notice.
5032 Include human.h immediately after config.h.
5033 <sys/types.h>, <stdio.h>: Do not include; no longer needed.
5034 <limits.h>: Do not include, since human.h does.
5035 (SIZE_MAX, UINTMAX_MAX): New macros.
5036 <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
5037 <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
5038 (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
5039 (power_letter): Renamed from suffixes.
5040 (generate_suffix_backwards): Remove.
5041 (adjust_value): Now takes int style (because of human.h changes)
5042 and long double value (for greater precision on some platforms).
5043 (group_number): New function.
5044 (human_readable): Use it. Use integer options, not enum.
5045 Put the options before the sizes in the arg list.
5046 Support all the new options.
5047 The old human_readable function has been removed;
5048 use inttostr.h instead.
5049 (human_readable, default_block_size, humblock):
5050 Use uintmax_t, not int, for block sizes.
5051 (human_readable_inexact, block_size_types): Remove.
5052 (block_size_opts): New constant.
5053 (human_options): Renamed from human_block_size, with new signature
5054 that allows block sizes up to UINTMAX_MAX. All callers changed.
5055 * human.h: Add copyright and authorship notice.
5056 Include <limits.h> and <stdbool.h> unconditionally.
5057 (PARAMS): Remove. All uses removed.
5058 (LONGEST_HUMAN_READABLE): Add support for thousands separator.
5059 (enum human_inexact_style): Remove tag; now a nameless enum.
5060 (human_floor, human_ceiling, human_round_to_even): Now have
5061 values 2, 0, 1 rather than -1, 1, 0.
5062 (human_group_digits, human_suppress_point_zero, human_autoscale,
5063 human_base_1024, human_SI, human_B): New constants.
5064 (human_readable_inexact, human_block_size): Remove.
5065 (human_readable): Size args are now uintmax_t, not int.
5066 (human_options): New decl.
5068 * exclude.c: (new_exclude, add_exclude): Remove casts that are
5069 unnecessary now that we assume C89 or better. This change
5070 imported from coreutils.
5072 * mktime.c (__mktime_internal): Do not reject negative timestamps
5073 arbitrarily. This is the same patch as 2003-05-28, but it got lost
5074 in the 2003-05-30 sync from glibc.
5076 .h files should stand alone, but we shouldn't include <sys/types.h>
5077 if we can get away with just <stddef.h>.
5079 * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
5080 malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
5081 rather than <sys/types.h>, as we merely need size_t.
5082 * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
5084 * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
5085 Include <stdio.h>, to get FILE.
5086 * memcasecmp.c: Don't include <sys/types.h>, as we can assume
5087 memcasecmp.h has included <stddef.h> and all we need is size_t.
5088 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5089 our interface, instead of including <sys/types.h>
5091 2003-06-02 Paul Eggert <eggert@twinsun.com>
5094 Fix some minor time-related bugs with POSIX time arguments.
5095 Some valid time stamps were being rejected (notably -1, and
5096 time stamps before 1900 on 64-bit hosts). And some invalid
5097 time stamps were being accepted, e.g. September 31.
5099 * posixtm.h (posixtime): Return bool instead of time_t, so
5100 that we can return (time_t) -1 successfully.
5101 * posixtm.c: Likewise.
5102 [HAVE_STDBOOL_H]: Include <stdbool.h>.
5103 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
5104 (t): Remove static var.
5105 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
5106 of static var. All uses changed.
5107 (year): Do not reject years before 1900; they can occur with
5109 (posix_time_parse): Do not check for out-of-range components;
5110 that is now the caller's responsibility, since our checks were
5111 only approximations.
5112 (posixtime): Use mktime to check for out-of-range components,
5113 since it knows them exactly.
5114 If mktime returns (time_t) -1, check whether an error actually occurred
5115 by invoking localtime on -1.
5116 (main) [TEST_POSIXTIME]: Check for input data errors, and report
5117 posixtime failures better.
5118 Improve the test data (in comments only).
5120 2003-05-30 <karl@gnu.org>
5122 * mktime.c: update from libc.
5124 2003-05-30 Bruno Haible <bruno@clisp.org>
5126 * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
5127 * localcharset.h: Likewise.
5128 * localcharset.c: Likewise.
5130 2003-05-28 Paul Eggert <eggert@twinsun.com>
5132 Assume the headers required for C89 freestanding compilers.
5133 * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
5134 rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
5135 without checking for HAVE_LIMITS_H.
5136 * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
5137 xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
5139 * fatal.c: Include <stdarg.h> without checking for __STDC__.
5140 * exclude.c: Include <stdbool.h> unconditionally.
5141 * tempname.c: Include <stddef.h> unconditionally.
5142 * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
5143 * modechange.c, rpmatch.c (NULL): Don't define, since
5144 <stddef.h> does that.
5145 * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
5146 * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
5147 * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
5148 * xstrtol.c: Likewise.
5149 * safe-read.c: Remove TYPE_SIGNED; no longer needed.
5150 * savedir.c: Include <stddef.h> instead of defining NULL.
5152 * addext.c (addext): Use assignment rather than cast, to avoid
5153 warnings on some platforms.
5155 * mktime.c (__mktime_internal): Do not reject negative timestamps
5158 2003-05-10 Bruno Haible <bruno@clisp.org>
5160 * linebreak.c (iconv_string_length): Don't return -1 just because the
5161 string is longer than 4 KB.
5163 2003-05-12 Jim Meyering <jim@meyering.net>
5165 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
5166 the space-padded-by-default conversion specifiers, %e, %k, %l.
5168 2003-05-03 Bruno Haible <bruno@clisp.org>
5170 Upgrade to Unicode-4.0.
5171 * linebreak.c (nonspacing_table_data): Change width of U+00AD,
5172 U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
5173 U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
5174 U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
5175 from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
5176 (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
5177 of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
5178 Change width of U+E0100..U+E01EF from 1 to 0.
5180 2003-04-25 Bruno Haible <bruno@clisp.org>
5182 * copy-file.c: Include <stddef.h>, for size_t.
5184 2003-04-25 Jim Meyering <jim@meyering.net>
5186 * copy-file.c (copy_file_preserving): Declare buf_size to be
5187 of type size_t, not int.
5189 2003-04-11 Jim Meyering <jim@meyering.net>
5191 Merge changes from Coreutils.
5193 2003-03-22 Jim Meyering <jim@meyering.net>
5195 * strftime.c (widen): Cast alloca return value to proper type.
5197 2003-01-19 Ulrich Drepper <drepper@redhat.com>
5200 * strftime.c (my_strftime): Handle very large width
5201 specifications for numeric values correctly. Improve checks for
5204 2003-01-19 Jim Meyering <jim@meyering.net>
5206 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
5207 (nl_get_alt_digit) [! defined my_strftime]: Define.
5208 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
5209 _nl_get_alt_digit and _nl_get_walt_digit.
5211 * strftime.c (my_strftime): Merge in locale-related changes from libc.
5212 These changes have no effect outside of _LIBC.
5214 2003-04-10 Bruno Haible <bruno@clisp.org>
5216 * findprog.h: New file, from GNU gettext.
5217 * findprog.c: New file, from GNU gettext.
5219 2003-04-05 Jim Meyering <jim@meyering.net>
5221 Merge changes from Coreutils.
5223 * exclude.h (PARAMS): Remove definition and uses.
5224 * exclude.c: Remove uses of `PARAMS'.
5226 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
5227 Add test-cases for DOS filenames. Declare program_name.
5228 (main): Set up program_name. Patch by Rich Dawe.
5230 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5232 Use mntctl's return value to drive the entry-processing loop, since
5233 we can't rely on the value of the vmt_length member in the last
5234 entry. On some systems doing so could result in exhausting
5235 virtual memory. Based in part on a patch from Mike Jetzer.
5237 2003-04-04 Bruno Haible <bruno@clisp.org>
5239 * linebreak.h: New file, from GNU gettext.
5240 * linebreak.c: New file, from GNU gettext with slight modifications.
5241 * lbrkprop.h: New file, from GNU gettext.
5243 2003-04-03 Bruno Haible <bruno@clisp.org>
5245 * utf8-ucs4.h: New file, from GNU gettext.
5246 * utf16-ucs4.h: New file, from GNU gettext.
5247 * ucs4-utf8.h: New file, from GNU gettext.
5248 * ucs4-utf16.h: New file, from GNU gettext.
5250 2003-04-02 Bruno Haible <bruno@clisp.org>
5252 * binary-io.h: New file, from GNU gettext.
5254 2003-04-01 Bruno Haible <bruno@clisp.org>
5256 * pathname.h: New file, from GNU gettext.
5257 * concatpath.c: New file, from GNU gettext.
5259 2003-03-30 Bruno Haible <bruno@clisp.org>
5261 * copy-file.c (copy_file_preserving): Don't set owner if the function
5262 chown() doesn't exist.
5264 2003-03-28 Bruno Haible <bruno@clisp.org>
5266 * copy-file.h: New file, from GNU gettext.
5267 * copy-file.c: New file, from GNU gettext.
5269 2003-03-18 Jim Meyering <jim@meyering.net>
5271 * quote.c (quote_n): Fix typo in comment.
5273 2003-03-14 Jim Meyering <jim@meyering.net>
5275 Merge changes from Coreutils.
5276 * obstack.h (obstack_object_size): Declare temporary, __o,
5277 to be const, in order to avoid warnings.
5278 (obstack_room): Likewise.
5279 (obstack_empty_p): Likewise.
5281 2003-03-13 Paul Eggert <eggert@twinsun.com>
5283 Merge changes from Bison.
5284 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
5285 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5286 when compiling Bison 1.875's `bitset bset = obstack_alloc
5287 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
5288 * hash.c: Include <stdbool.h> unconditionally.
5290 2003-03-09 Paul Eggert <eggert@twinsun.com>
5292 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
5293 Reported by Bruce Becker; see:
5294 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
5296 2003-03-03 Paul Eggert <eggert@twinsun.com>
5297 Bruno Haible <bruno@clisp.org>
5299 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
5300 Reported by John Hughes, see
5301 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
5303 2003-02-19 Paolo Bonzino <bonzini@gnu.org>
5305 * poll_.h: New file.
5308 2003-02-18 Paolo Bonzino <bonzini@gnu.org>
5310 * mathl.h: New file.
5311 * acosl.c: New file.
5312 * asinl.c: New file.
5313 * atanl.c: New file.
5314 * ceill.c: New file.
5317 * floorl.c: New file.
5318 * frexpl.c: New file.
5319 * ldexpl.c: New file.
5321 * sincosl.c: New file.
5323 * sqrtl.c: New file.
5325 * trigl.c: New file.
5326 * trigl.h: New file.
5328 2003-02-17 Bruno Haible <bruno@clisp.org>
5330 * mkdtemp.h: New file, from GNU gettext.
5331 * mkdtemp.c: New file, from GNU gettext.
5333 2003-01-31 Bruno Haible <bruno@clisp.org>
5335 * rename.c: #undef rename before defining rpl_rename.
5336 * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
5338 2003-01-30 Bruno Haible <bruno@clisp.org>
5340 * printf-args.h: New file, from GNU gettext.
5341 * printf-args.c: New file, from GNU gettext.
5342 * printf-parse.h: New file, from GNU gettext.
5343 * printf-parse.c: New file, from GNU gettext.
5344 * vasnprintf.h: New file, from GNU gettext.
5345 * vasnprintf.c: New file, from GNU gettext.
5346 * asnprintf.c: New file, from GNU gettext.
5347 * vasprintf.h: New file, from GNU gettext with modifications.
5348 * vasprintf.c: New file, from GNU gettext.
5349 * asprintf.c: New file, from GNU gettext.
5351 2003-01-29 Bruno Haible <bruno@clisp.org>
5353 * stpncpy.h: New file, from GNU gettext with modifications.
5354 * stpncpy.c: New file, from GNU gettext with modifications.
5356 2003-01-28 Bruno Haible <bruno@clisp.org>
5358 * c-ctype.h: New file, from GNU gettext, with changes suggested by
5360 * c-ctype.c: New file, from GNU gettext, with changes suggested by
5363 2003-01-27 Bruno Haible <bruno@clisp.org>
5365 * xsetenv.h: New file, from GNU gettext.
5366 * xsetenv.c: New file, from GNU gettext.
5368 2003-01-23 Bruno Haible <bruno@clisp.org>
5370 * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
5372 2003-01-22 Bruno Haible <bruno@clisp.org>
5374 * exit.h: New file, from GNU gettext.
5376 2003-01-11 Bruno Haible <bruno@clisp.org>
5378 * stpcpy.h (stpcpy): Use ANSI C function declarations.
5379 * strcase.h (strcasecmp, strncasecmp): Likewise.
5381 2003-01-14 Jim Meyering <jim@meyering.net>
5383 * same.c (same_name): Tweak a comment.
5385 2003-01-11 Bruno Haible <bruno@clisp.org>
5387 * same.c (same_name): Reorder tests so as to avoid calling stat()
5388 when a string comparison is sufficient.
5390 2003-01-11 Bruno Haible <bruno@clisp.org>
5392 * readtokens.c (readtoken): Cast character to 'unsigned char', not
5395 2003-01-11 Bruno Haible <bruno@clisp.org>
5397 * hash-pjw.c: Add comment about low quality of this function.
5399 2003-01-12 Paul Eggert <eggert@twinsun.com>
5401 Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
5402 to avoid collisions with libcurses and libreadline.
5404 * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
5405 * getstr.h, getstr.c: Remove.
5406 * getline.c: Include "getline.h", to check interface.
5407 Move body of old getstr.c here: this defines MIN_CHUNK and
5408 declares getdelim2, which is renamed from getstr.
5409 (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
5411 * linebuffer.c (readlinebuffer): Renamed from readline.
5413 * linebuffer.h: Likewise.
5414 (readline): Remove backward-compatibility macro.
5416 2003-01-12 Jim Meyering <jim@meyering.net>
5418 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
5420 2003-01-10 Bruno Haible <bruno@clisp.org>
5422 * alloca_.h: New file.
5423 * getdate.y: Unconditionally include alloca.h.
5424 * makepath.c: Likewise.
5425 * setenv.c: Likewise.
5426 * userspec.c: Likewise.
5428 2003-01-09 Bruno Haible <bruno@clisp.org>
5430 * stdbool.h.in: New file.
5432 2003-01-08 Bruno Haible <bruno@clisp.org>
5434 * safe-read.c: Include specification header first, to ensure its
5436 * full-write.c: Likewise.
5438 2003-01-08 Jim Meyering <jim@meyering.net>
5440 * full-write.c: Undefine and define-away `const' after inclusion
5441 of errno.h, not before. Suggestion from Bruno Haible.
5443 2003-01-07 Jim Meyering <jim@meyering.net>
5445 * full-write.c: Rework so that it may serve to define full_read, too.
5446 * full-read.c: Simply #define FULL_READ and include full-write.c.
5448 2003-01-06 Jim Meyering <jim@meyering.net>
5450 * version-etc.c: Update year in translatable copyright string.
5452 2002-12-25 Bruno Haible <bruno@clisp.org>
5454 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
5455 * xstrtol.h: Likewise.
5456 * xstrtoimax.c: Likewise.
5457 * xstrtoumax.c: Likewise.
5458 * human.h: Likewise.
5460 * tempname.c: Include <inttypes.h> too. Avoids a compilation error
5461 on systems that have <inttypes.h> but not <stdint.h>.
5463 2002-12-31 Paul Eggert <eggert@twinsun.com>
5465 * memcoll.c (memcoll): Fall back on a simple algorithm using
5466 memcmp if strcoll doesn't work.
5468 2002-12-23 Bruno Haible <bruno@clisp.org>
5470 * localcharset.h: New file.
5471 * localcharset.c: Include it.
5472 * unicodeio.c: Likewise.
5474 2002-12-22 Bruno Haible <bruno@clisp.org>
5476 * utime.c (utime_null): No need to call ftruncate if the file was
5479 2002-12-23 Bruno Haible <bruno@clisp.org>
5481 * memcoll.c (STRCOLL): New macro.
5484 2002-12-22 Bruno Haible <bruno@clisp.org>
5486 * getstr.h (getstr): Define, to avoid clash with libcurses.
5487 * linebuffer.h (readline): Define, to avoid clash with libreadline.
5489 2002-12-22 Bruno Haible <bruno@clisp.org>
5491 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
5493 2002-12-23 Bruno Haible <bruno@clisp.org>
5495 * getline.h: Include <stddef.h>, for size_t.
5497 * unicodeio.h: Include <stddef.h>, for size_t.
5498 * unicodeio.c: Don't include <stddef.h>.
5500 2002-12-17 Bruno Haible <bruno@clisp.org>
5502 * canon-host.c (strdup): Remove unused declaration.
5504 * fsusage.c: Include full_read.h.
5505 (get_fs_usage): Use full_read instead of safe_read.
5507 * utime.c (utime_null): Use SAFE_READ_ERROR.
5509 2002-12-11 Bruno Haible <bruno@clisp.org>
5511 * setenv.h: Rewritten to cope with systems that have setenv() but not
5513 * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
5516 2002-12-11 Bruno Haible <bruno@clisp.org>
5518 * setenv.c (alloca): Fall back to malloc.
5520 (setenv): Use freea() to free memory allocated with alloca().
5522 2002-11-13 Bruno Haible <bruno@clisp.org>
5524 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
5525 function declarations.
5526 * unsetenv.c (unsetenv): Likewise.
5528 2002-03-04 Bruno Haible <bruno@clisp.org>
5530 Portability to AIX 4.3.3.
5531 * unsetenv.c: New file, extracted from setenv.c.
5532 * setenv.c: Move the unsetenv() function to unsetenv.c.
5534 2001-12-20 Bruno Haible <bruno@clisp.org>
5536 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
5537 use malloc instead. For SunOS 4.
5539 2001-12-11 Bruno Haible <bruno@clisp.org>
5541 * setenv.c: Declare alloca.
5542 (compar_fn_t): New typedef.
5543 (KNOWN_VALUE, STORE_VALUE): Use it.
5545 * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
5548 2002-12-10 Paul Eggert <eggert@twinsun.com>
5550 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
5551 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
5552 Choose values that are less likely to collide with system fnmatch
5554 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
5555 defined (e.g., a pure POSIX system).
5556 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
5557 instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
5559 2002-12-06 Jim Meyering <jim@meyering.net>
5561 * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
5563 Merge in changes from libc's misc/error.c, in preparation
5564 for the merge of gnulib's changes back into libc.
5566 * error.c (_): Define only if not already defined.
5567 Move definition to follow all #include directives.
5568 Include unlocked-io.h only if !_LIBC.
5569 [_LIBC]: Include <libio/libioP.h>.
5570 [USE_IN_LIBIO]: Include <libio/iolibio.h>
5571 (fflush): Tweak definition to use INTUSE.
5574 2002-12-05 Paul Eggert <eggert@twinsun.com>
5576 * alloca.c [defined emacs]: Include "lisp.h".
5577 (xalloc_die) [defined emacs]: New macro.
5578 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
5579 [! defined emacs]: Include <xalloc.h>.
5580 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
5581 (pointer): Typedef to POINTER_TYPE *.
5582 (malloc): Remove decl; we now always use xmalloc.
5583 (alloca): Use old-style definition, since Emacs needs this.
5584 Check for arithmetic overflow when computing combined size.
5586 2002-12-04 Paul Eggert <eggert@twinsun.com>
5588 Do not generate unlocked-io.h automatically, since it's easier to
5589 maintain it by hand.
5591 * unlocked-io.h: New file, from GNU diffutils,
5592 but with proper copyright notice and attribution.
5594 * Makefile.am: Add copyright notice.
5595 (libfetish_a_SOURCES): Add unlocked-io.h.
5596 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
5597 (DISTCLEANFILES, io_functions): Remove macros.
5598 (EXTRA_DIST): Remove gen_uio.
5599 (unlocked-io.h): Remove rule.
5601 2002-12-04 Jim Meyering <jim@meyering.net>
5603 Reflect the fact that stat.c and lstat.c are no longer generated.
5604 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
5605 (DISTCLEANFILES): Likewise.
5606 (EXTRA_DIST): Likewise.
5607 (all_local): Don't depend on stat.c or lstat.c.
5608 (stat.c, lstat.c): Remove rules.
5609 (EXTRA_DIST): Remove xstat.in.
5611 * xstat.in: Remove file. Contents moved into stat.c.
5612 * stat.c: New file. Contents mostly from xstat.in.
5613 * stat.c: Rework so that it may serve to define rpl_lstat, too.
5614 * lstat.c: New file. Simply #define LSTAT and include stat.c.
5616 * safe-read.c: Rework so that it may serve to define safe_write, too.
5617 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
5619 2002-12-03 Jim Meyering <jim@meyering.net>
5621 * safe-read.c, safe-write.c: Change variable names and comments, but
5622 not semantics, to minimize the differences between these two files.
5623 (safe_read): Change comment to mention SAFE_READ_ERROR.
5625 * safe-read.c (IS_EINTR): Define.
5626 (safe_read): Use IS_EINTR in place of in-function cpp directives.
5628 2002-12-02 Bruno Haible <bruno@clisp.org>
5630 * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
5631 Define, taken from safe-read.c.
5632 (INT_MAX): Provide fallback.
5633 (safe_write): Rewrite to iterate IFF the write fails with EINTR.
5634 * safe-write.h (SAFE_WRITE_ERROR): Define.
5636 * safe-read.c (EINTR): Remove definition.
5637 (safe_read): Don't use EINTR if it is absent.
5639 2002-12-02 Jim Meyering <jim@meyering.net>
5641 * safe-read.c (EINTR): Define.
5642 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
5643 (INT_MAX): Provide fallback.
5644 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
5646 * safe-read.h (SAFE_READ_ERROR): Define.
5648 2002-12-01 Jim Meyering <jim@meyering.net>
5650 * safe-read.c: (safe_read): Also exit the loop when read returns zero.
5651 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
5653 2002-11-27 Paul Eggert <eggert@twinsun.com>
5655 * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
5656 hash_rehash): Replace `if (limit <= value) abort ();' with
5657 `if (! (value < limit)) abort ();', for readability.
5659 2002-11-26 <karl@gnu.org>
5661 * strdup.c: copy from libc again, with jim's ok.
5662 * .cppi-disable: re-add strdup.c
5664 2002-11-25 <karl@gnu.org>
5666 * strtoll.c: copy from libc, meaning we now #include <strtol.c>
5667 instead of "strtol.c".
5669 2002-11-25 Jim Meyering <jim@meyering.net>
5671 * mktime.c: Sync from libc, now that it has the latest fix.
5673 2002-11-24 <karl@gnu.org>
5675 * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
5676 regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
5678 2002-11-24 Jim Meyering <jim@meyering.net>
5680 Update from coreutils:
5682 * mktime.c: Merge in changes from libc.
5684 Avoid a link-time failure on some Linux systems.
5685 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
5686 (__mon_yday): Declare with the STATIC attribute.
5687 (__mktime_internal): Likewise.
5688 Based on a report from Greg Schafer.
5690 2002-11-23 Jim Meyering <jim@meyering.net>
5692 * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
5693 Use `unsigned', not `int', as type of index.
5695 * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
5697 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
5699 2002-11-22 Paul Eggert <eggert@twinsun.com>
5701 * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
5702 hint that one should use `if (! x) abort ();' rather than `assert
5703 (x);', and anyway it's one less thing to worry about configuring.
5704 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
5705 hash_rehash, hash_insert): Use abort rather than assert.
5707 2002-11-22 Paul Eggert <eggert@twinsun.com>
5709 * quotearg.h: Allow multiple inclusion by surrounding with
5710 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
5711 so that we can be included first.
5712 (PARAMS): Remove; we now assume C89 or later. All uses removed.
5713 * quotearg.c: Include quotearg.h immediately after config.h.
5714 No need to include stddef.h or sys/types.h any more.
5715 Surround local include files with "", not "<>".
5716 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
5717 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
5718 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
5719 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
5720 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
5721 (ISPRINT): Remove; no longer needed now that we assume C89.
5723 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
5726 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
5727 quotearg_char): Use SIZE_MAX rather than
5728 (size_t) -1 when we are talking about "infinity".
5730 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
5732 2002-11-22 Bruno Haible <bruno@clisp.org>
5734 * safe-read.h: Assume C89. Add comments.
5735 (safe_read): Change return type to size_t.
5736 * safe-read.c (safe_read): Change return type to size_t. Handle byte
5737 counts > SSIZE_MAX correctly.
5738 * safe-write.h: New file.
5739 * safe-write.c: New file.
5740 * full-read.h: New file.
5741 * full-read.c: New file.
5742 * full-write.h: Assume C89. Add comments.
5743 * full-write.c: Include safe-write.h.
5744 (full_write): Rewritten to use safe_write.
5745 Suggested by Jim Meyering and Paul Eggert.
5747 2002-11-21 Bruno Haible <bruno@clisp.org>
5749 Remove case insensitive option matching.
5750 * argmatch.h (argcasematch): Remove declaration.
5751 (ARGCASEMATCH): Remove macro.
5752 (__xargmatch_internal): Remove case_sensitive argument.
5753 (XARGMATCH): Update.
5754 (XARGCASEMATCH): Remove macro.
5755 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
5756 case_sensitive argument.
5757 (argcasematch): Remove function.
5758 (__xargmatch_internal): Remove case_sensitive argument.
5759 (main): Use XARGMATCH instead of XARGCASEMATCH.
5761 * xmalloc.c: Change compile-time error message. Add comment about
5762 required autoconf version.
5764 2002-11-21 Jim Meyering <jim@meyering.net>
5766 * strdup.c (strdup): Tweak comment and initial #if/#include.
5768 Merge in changes from the coreutils.
5770 2002-09-25 Paul Eggert <eggert@twinsun.com>
5771 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
5772 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
5773 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
5774 int. Work more efficiently if X is the same width as uintmax_t.
5775 Do not compare X to -1, to avoid bogus compiler warning.
5776 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
5777 Don't assume that f_frsize and f_bsize are the same type.
5779 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
5782 * makepath.c (make_path): Restore umask *before* creating the final
5784 (make_path): Minor reformatting.
5786 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
5787 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
5789 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
5790 ones. At least on GNU/Linux systems, `auto' means something else.
5793 2002-11-20 Paul Eggert <eggert@twinsun.com>
5795 Merge argmatch cleanups from Bison. Assume C89.
5797 * argmatch.c: Include config.h here, not in argmatch.h.
5798 Include stdlib.h, for EXIT_FAILURE.
5799 Always include <string.h>, since we assume C89.
5800 (EXIT_FAILURE): Remove pre-C89 bug workaround.
5801 * argmatch.h: Do not include <config.h> or <sys/types.h>.
5802 Include <stddef.h> instead, since it's all we need for size_t.
5803 (PARAMS): Remove. All uses removed.
5804 (ARRAY_CARDINALITY): Do not bother to #undef.
5805 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
5806 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
5807 Remove unnecessary parentheses.
5808 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
5809 Insert necessary parentheses.
5810 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
5811 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
5813 2002-11-19 Bruno Haible <bruno@clisp.org>
5815 * mbswidth.c: Include mbswidth.h right at the beginning.
5816 * mbswidth.h: Include <stddef.h>, for size_t.
5818 * mbswidth.h (PARAMS): Remove macro.
5819 (mbswidth, mbsnwidth): Use ANSI C function declarations.
5820 * mbswidth.c (mbswidth, mbsnwidth): Likewise.
5822 * gcd.h (PARAMS): Remove macro.
5823 (gcd): Use ANSI C function declarations.
5824 * gcd.c (gcd): Likewise.
5826 2002-11-15 Bruno Haible <bruno@clisp.org>
5828 * strcspn.c: Include <stddef.h>.
5829 (strcspn): Use ANSI C function declaration. Change return type to
5831 * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
5832 (strpbrk): Use NULL.
5833 * strpbrk.h (PARAMS): Remove macro.
5834 (strpbrk): Use ANSI C function declaration.
5835 * strstr.c: Don't include <sys/types.h>.
5836 * strstr.h (PARAMS): Remove macro.
5837 (strstr): Use ANSI C function declarations.
5839 2002-11-06 Bruno Haible <bruno@clisp.org>
5841 * gcd.h (gcd): Change argument type to 'unsigned long'.
5842 * gcd.c (gcd): Likewise.
5844 2002-11-05 Bruno Haible <bruno@clisp.org>
5846 * gcd.h: New file, from gettext-0.11.5.
5847 * gcd.c: New file, from gettext-0.11.5.
5849 2002-11-05 Bruno Haible <bruno@clisp.org>
5851 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5852 * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5853 * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5854 * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
5856 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
5857 * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
5859 * closeout.c: Include gettext.h instead of <libintl.h>.
5860 * human.c: Include gettext.h instead of <libintl.h>.
5861 * quotearg.c: Include gettext.h instead of <libintl.h>.
5862 * rpmatch.c: Include gettext.h instead of <libintl.h>.
5863 * unicodeio.c: Include gettext.h instead of <libintl.h>.
5864 * userspec.c: Include gettext.h instead of <libintl.h>.
5865 * version-etc.c: Include gettext.h instead of <libintl.h>.
5866 * xmalloc.c: Include gettext.h instead of <libintl.h>.
5867 (textdomain): Remove definition.
5868 * xmemcoll.c: Include gettext.h instead of <libintl.h>.
5870 * long-options.c: Remove include of <libintl.h> and definition of _.
5871 * same.c: Remove include of <libintl.h> and definition of _.
5873 2002-11-04 Bruno Haible <bruno@clisp.org>
5875 * stpcpy.h: New file, from GNU gettext-0.11.5.
5876 * strcase.h: New file, from GNU gettext-0.11.5.
5877 * strpbrk.h: New file, from GNU gettext-0.11.5.
5878 * strstr.h: New file, from GNU gettext-0.11.5.
5879 * xgetcwd.h: New file, from GNU gettext-0.11.5.
5881 2002-05-09 Bruno Haible <bruno@clisp.org>
5883 * config.charset: Update for newest glibc. Add canonical names
5884 ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
5886 2002-05-09 Bruno Haible <bruno@clisp.org>
5888 * localcharset.c (get_charset_aliases): Add more Windows specific
5891 2002-05-08 Owen Taylor <otaylor@redhat.com>
5893 * config.charset: A few additions for Solaris.
5895 2001-12-05 Bruno Haible <bruno@clisp.org>
5897 * localcharset.c (locale_charset): Don't return an empty string.
5899 2001-10-23 Bruno Haible <haible@clisp.cons.org>
5901 * config.charset: msdos in uk_UA uses CP1125.
5903 2001-08-05 Bruno Haible <haible@clisp.cons.org>
5905 Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
5906 * localcharset.c (locale_charset): Declare as extern "C".
5908 2002-02-15 Bruno Haible <bruno@clisp.org>
5910 * config.charset [msdosdjgpp]: For Russian, use CP866.
5912 2002-02-11 Bruno Haible <bruno@clisp.org>
5914 * config.charset: Add support for NetBSD.
5916 2002-09-25 <karl@gnu.org>
5918 * strdup.c: copy from libc/string (via ../config/srclist*).
5919 * getopt*: copy from libc/posix.
5920 * gettext.h: copy from gettext.
5921 * .cppi-disable: add strdup.c, gettext.h.
5923 2002-07-01 Jim Meyering <meyering@lucent.com>
5925 * c-stack.c: Include sys/time.h.
5926 From Volker Borchert.
5928 2002-06-11 Paul Eggert <eggert@twinsun.com>
5930 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
5931 New macro. Use it uniformly instead of
5932 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
5933 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
5934 reported by Vin Shelton.
5936 2002-06-22 Jim Meyering <meyering@lucent.com>
5938 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
5939 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
5941 2002-06-22 Paul Eggert <eggert@twinsun.com>
5943 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
5944 Do not assume SA_SIGINFO behavior.
5945 Bug reported by Jim Meyering on NetBSD 1.5.2.
5947 2002-06-22 Jim Meyering <meyering@lucent.com>
5949 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
5951 * exitfail.c, exitfail.h: Likewise.
5952 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
5954 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
5956 (EXTRA_DIST): Add fnmatch_loop.c.
5957 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
5959 * fnmatch_loop.c: New file, from diffutils-2.8.2.
5960 * fnmatch.c: Update from diffutils-2.8.2.
5961 * fnmatch_.h: New file. From diffutils-2.8.2.
5962 * fnmatch.h: Remove file.
5964 2002-06-18 Paul Eggert <eggert@twinsun.com>
5966 * file-type.h: Report an error if neither S_ISREG nor
5967 S_IFREG is defined, instead of using a test specific to glibc
5968 2.2. This should be safe, since POSIX requires S_ISREG and
5969 Unix Version 7 had S_IFREG. We don't need to check for
5970 <sys/types.h> since we don't use any symbols that it defines.
5972 2002-06-15 Jim Meyering <meyering@lucent.com>
5974 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
5975 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
5976 have been included before this file.
5978 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
5980 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
5981 so that each temporary file name is unique and valid in the first
5982 8 characters, for operation under DOS.
5984 2002-06-15 Jim Meyering <meyering@lucent.com>
5986 Work even with DJGPP 2.03, which lacks support for symlinks.
5988 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
5990 * lchown.c (S_ISLNK): Likewise.
5992 2002-06-14 Jim Meyering <meyering@lucent.com>
5994 * file-type.h: Use the version from diffutils-2.8.2.
5995 * file-type.c: Likewise.
5997 2002-05-27 Jim Meyering <meyering@lucent.com>
5999 Fix a problem seen only on nonconforming systems whereby ls.c's
6000 use of localtime, and then of gettimeofday would cause trouble:
6001 the localtime call used to initialize rpl_gettimeofday's save
6002 mechanism would clobber ls's current local time information so
6003 that in any long listing the first file would always be listed
6004 with date 1970-01-01. Analysis by Volker Borchert.
6006 * gettimeofday.c (localtime): Undefine.
6007 (rpl_localtime): New function.
6009 2002-05-22 Jim Meyering <meyering@lucent.com>
6011 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6012 * file-type.h: New file.
6013 * file-type.c (file_type): New file/function. Extracted from diffutils.
6015 2002-04-29 Paul Eggert <eggert@twinsun.com>
6017 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6019 2002-04-28 Paul Eggert <eggert@twinsun.com>
6021 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6022 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
6023 of 127, since 64 is the largest conceivable number for ancient
6025 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6027 2002-04-28 Jim Meyering <meyering@lucent.com>
6029 * sig2str.c (WTERMSIG): Remove definition (unused).
6031 2002-04-28 Paul Eggert <eggert@twinsun.com>
6033 * sig2str.h, sig2str.c: New files.
6034 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6036 2002-04-24 Jim Meyering <meyering@lucent.com>
6038 * gettext.h: New file, from Gettext.
6039 * Makefile.am (INCLUDES): Remove -I../intl.
6040 (libfetish_a_SOURCES): Add gettext.h.
6042 2002-04-16 Jim Meyering <meyering@lucent.com>
6044 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6045 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6046 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6048 2002-04-12 Jim Meyering <meyering@lucent.com>
6050 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6052 2002-03-10 Jim Meyering <meyering@lucent.com>
6054 * makepath.c (make_path): Remove a comma from a diagnostic.
6055 Suggestion from Santiago Vila.
6057 2002-03-08 Jim Meyering <meyering@lucent.com>
6059 * rename.c: Mention that this wrapper is needed also on
6060 mips-dec-ultrix4.4 systems.
6062 2002-03-02 Jim Meyering <meyering@lucent.com>
6064 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6065 not HAVE_CLOCK_SETTIME.
6067 2002-02-27 Paul Eggert <eggert@twinsun.com>
6069 * nanosleep.h: Rename to....
6070 * timespec.h: New name for nanosleep.h. All uses changed.
6072 * gettime.c: New file.
6073 * settime.c: New file.
6076 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6077 timespec.h. Remove nanosleep.h.
6079 2002-02-25 Paul Eggert <eggert@twinsun.com>
6081 * acl.c, acl.h: New files.
6082 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6084 2002-02-24 Jim Meyering <meyering@lucent.com>
6086 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6087 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6088 cause trouble. Reported by Nelson Beebe.
6090 2002-02-23 Paul Eggert <eggert@twinsun.com>
6092 * path-concat.c (xpath_concat): Reorder code to pacify
6093 compilers that don't know that xalloc_die never returns.
6095 2002-02-20 Jim Meyering <meyering@lucent.com>
6097 * getdate.c: Regenerate using bison-1.33.
6099 2002-02-15 Paul Eggert <eggert@twinsun.com>
6101 * posixver.c, posixver.h: New files.
6102 * Makefile.am (libfetish_a_SOURCES): Add them.
6104 2002-02-02 Paul Eggert <eggert@twinsun.com>
6105 Bruno Haible <bruno@clisp.org>
6107 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6108 (fwrite_success_callback): New declaration.
6109 * unicodeio.c (unicode_to_mb): New function, extracted from
6110 print_unicode_char. Call failure callback instead of error.
6111 (fwrite_success_callback): New function.
6112 (exit_failure_callback): New function.
6113 (fallback_failure_callback): New function.
6114 (print_unicode_char): Call unicode_to_mb.
6116 2002-01-26 Jim Meyering <meyering@lucent.com>
6118 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6120 2002-01-22 Jim Meyering <meyering@lucent.com>
6122 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6123 Otherwise, some versions of automake would omit the rule that makes
6124 Makefile from Makefile.in.
6126 2001-01-21 Paul Eggert <eggert@twinsun.com>
6128 * xmemcoll.h, xmemcoll.c: New files.
6129 * Makefile.am (libfetish_a_SOURCES): Add them.
6130 * memcoll.c: Include errno.h, and declare errno if not defined.
6131 (memcoll): Set errno to zero if there is no error.
6133 * quotearg.c (quotearg_buffer_restyled):
6134 Fix bug with quoting buffers containing NUL when backslashing escapes.
6135 This bug was exposed by the other changes in this patch.
6136 (quotearg_n_options): New arg ARGSIZE.
6137 All callers changed.
6138 (quoting_options_from_style): New function.
6139 (quotearg_n_style): Use it.
6140 (quotearg_n_style_mem): New function.
6142 * quotearg.h (quotearg_n_style_mem): New function.
6144 2002-01-16 Jim Meyering <meyering@lucent.com>
6146 * getdate.y: Add three semicolons, each just before a closing brace.
6147 Bison (as of version 1.31) no longer papers over that mistake.
6149 2002-02-14 Paul Eggert <eggert@twinsun.com>
6151 * backupfile.c (ISDIGIT): Comment fix.
6152 * getdate.y (ISDIGIT): Likewise.
6153 * posixtm.c (ISDIGIT, year): Likewise.
6154 * strverscmp.c (ISDIGIT): Likewise.
6155 * userspec.c (ISDIGIT): Likewise.
6157 2002-01-05 Jim Meyering <meyering@lucent.com>
6159 * version-etc.c (version_etc_copyright): Update copyright year.
6161 2001-01-19 Paul Eggert <eggert@twinsun.com>
6163 * closeout.c (close_stdout_status): If ferror (stdout), do
6164 not silently exit merely because the output buffer happens to
6165 have nothing pending.
6167 2001-12-18 Paul Eggert <eggert@twinsun.com>
6169 See the big note in ../ChangeLog.
6170 * human.c (suffixes): Prefer K to k for 1024.
6171 (generate_suffix_backwards): New function.
6172 (human_readable_inexact): Use it.
6173 * xstrtol.c (__xstrtol): If there is no number but there
6174 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
6175 Accept 'K' as well as 'k'.
6177 2001-12-15 Jim Meyering <meyering@lucent.com>
6179 * regex.h (__restrict_arr): Update from libc.
6181 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
6182 as `remote' if the name starts with `//'. Suggested by Michael Stone.
6185 2001-12-10 Jim Meyering <meyering@lucent.com>
6187 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
6188 Instead, include "xalloc.h".
6189 (initbuffer): Don't cast xmalloc return value to char*.
6190 (readline): Reword comment.
6191 Don't cast xrealloc return value to char*
6194 2001-12-09 Jim Meyering <meyering@lucent.com>
6196 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
6197 `signed and unsigned type in conditional expression'.
6198 * posixtm.c (posix_time_parse): Likewise.
6200 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
6202 * readtokens.c (readtoken): Declare an index to be of type unsigned
6203 to avoid a pedantic warning.
6205 * getstr.c: Don't include assert.h.
6206 (getstr): Remove warning-evoking assertions.
6207 Return -1 if offset parameter is out of bounds.
6208 Change the type of a local from int to size_t.
6210 * strftime.c (my_strftime_localtime_r): Include this function
6211 definition in the `#if ! HAVE_TM_GMTOFF' block.
6213 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
6214 Include xalloc.h instead.
6216 2001-12-02 Jim Meyering <meyering@lucent.com>
6218 * tempname.c: Don't declare getenv, thus reverting the change of
6219 2001-11-18. It's no longer necessary, now that stdlib.h is always
6222 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
6223 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
6225 2001-11-30 Akim Demaille <akim@epita.fr>
6227 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
6228 before being defined.
6230 2001-11-27 Paul Eggert <eggert@twinsun.com>
6232 * quotearg.h (quotearg_n, quotearg_n_style):
6233 First arg is int, not unsigned.
6234 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
6235 (SIZE_MAX, UINT_MAX): New macros.
6236 (quotearg_n_options): Abort if N is negative.
6237 Avoid overflow check on hosts where size_t is 64 bits and int
6238 is 32 bits, as overflow is impossible there.
6239 Fix off-by-one typo that caused unnecessary reallocation.
6241 2001-11-27 Jim Meyering <meyering@lucent.com>
6243 * tempname.c: Merge with version from libc.
6244 * regex.c: Likewise.
6246 * tempname.c: Include stdlib.h unconditionally. On some old systems
6247 for which STDC_HEADERS is 0, it was not included, resulting in a
6248 warning about an integer-to-pointer conversion problem with getenv.
6249 Reported by Volker Borchert.
6251 2001-11-26 Jim Meyering <meyering@lucent.com>
6253 * gtod.h: Remove file.
6254 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
6255 * gettimeofday.c: Don't include gtod.h.
6256 (GTOD_init): Remove function.
6257 (rpl_gettimeofday): Do its job here instead, rather than aborting.
6258 Suggestion from Volker Borchert.
6260 2001-11-23 Jim Meyering <meyering@lucent.com>
6262 * hash.h (struct hash_table): Don't define here. Merely declare it.
6263 * hash.c (struct hash_table): Define it here instead.
6265 2001-11-22 Jim Meyering <meyering@lucent.com>
6267 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
6269 2001-11-18 Paul Eggert <eggert@twinsun.com>
6271 * tempname.c (TMP_MAX): Remove; no longer needed.
6272 (TEMPORARIES): New macro.
6273 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
6274 removes an artificial limitation (e.g. HP-UX 10.20, where
6277 2001-11-18 Jim Meyering <meyering@lucent.com>
6279 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
6282 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
6283 files will be created before anything else.
6285 2001-11-17 Jim Meyering <meyering@lucent.com>
6287 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
6288 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
6289 rather than group writable. Patch by Juan F. Codagnone.
6291 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
6292 Instead, include "xalloc.h".
6294 * mountlist.c: Include unlocked-io.h after all system headers.
6295 Remove explicit declarations of xmalloc, xrealloc,
6296 and xstrdup. Instead, include "xalloc.h".
6298 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
6299 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
6300 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
6302 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
6303 Reported by Padraig Brady.
6305 * mkstemp.c: #undef mkstemp.
6307 (rpl_mkstemp): Rename from mkstemp.
6310 2001-11-16 Jim Meyering <meyering@lucent.com>
6312 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
6313 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
6314 determine the amount of total physical memory, use pstat_getstatic.
6315 HPUX-11 doesn't define _SC_PHYS_PAGES.
6316 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
6317 If sysconf couldn't be used to determine the amount of available
6318 physical memory, use both pstat_getstatic and pstat_getdynamic.
6319 Based on a patch from Bob Proulx.
6321 2001-11-05 Jim Meyering <meyering@lucent.com>
6323 * xstat.in (slash_aware_lstat): Correct a misleading comment.
6325 2001-11-03 Jim Meyering <meyering@lucent.com>
6327 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
6328 in argmatch_to_argument call.
6330 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
6333 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
6334 e.g., a fault due to an attempt to free a NULL pointer.
6336 2001-11-01 Jim Meyering <meyering@lucent.com>
6338 * dirfd.c, dirfd.h: New files.
6339 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
6341 * hash.c (hash_print) [TESTING]: Clean up.
6343 2001-10-22 Paul Eggert <eggert@twinsun.com>
6345 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
6346 to avoid a warning if -Wall.
6348 2001-10-21 Paul Eggert <eggert@twinsun.com>
6350 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
6352 2001-10-21 Jim Meyering <meyering@lucent.com>
6354 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
6355 this code would end up calling gettext even in packages built
6357 * getopt.c (_): Likewise.
6358 * regex.c (_): Likewise.
6360 2001-10-20 Paul Eggert <eggert@twinsun.com>
6362 * error.c (strerror_r): Do not declare unless !_LIBC.
6363 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
6364 Use strerror_r that is only a macro, even if it is not a function.
6365 (strerror): Check for HAVE_DECL_STRERROR before declaring.
6366 (private_strerror): Use prototypes, not old-style function definition.
6367 (print_errno_message): New function.
6368 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
6370 (error_tail, error, error_at_line): Use it.
6372 2001-10-11 Jim Meyering <meyering@lucent.com>
6374 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
6375 and quote_n (1, ... to avoid clobbering a buffer.
6377 2001-10-05 Jim Meyering <meyering@lucent.com>
6379 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
6380 * hash-pjw.c: New file (factored out of fileutils' remove.c).
6381 * hash-pjw.h: New file.
6383 2001-09-30 Jim Meyering <meyering@lucent.com>
6385 * mountlist.c [MOUNTED_GETFSSTAT]:
6386 Include <sys/ucred.h>, for Apple Darwin.
6387 Include sys/mount.h and sys/fs_types.h only if available.
6389 (read_filesystem_list): Use FS_TYPE.
6391 2001-09-29 Paul Eggert <eggert@twinsun.com>
6393 * exclude.c (excluded_filename): 0 -> false, since it's
6396 2001-09-28 Paul Eggert <eggert@twinsun.com>
6398 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
6399 #defines strtoimax. Also treat the other strto* functions
6402 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
6403 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
6404 (strtoimax, strtoumax): Do not declare if already defined as a macro.
6406 2001-09-26 Jim Meyering <meyering@lucent.com>
6408 Most macros in unlocked-io.h had the wrong number of arguments.
6409 * gen-uio: New script.
6410 (USE_UNLOCKED_IO): Define to 1 if not already defined.
6411 * unlocked-io.hin: Remove file.
6412 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
6413 rather than trying to embed it here.
6414 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
6415 Reported by Padraig Brady.
6417 2001-09-25 Volker Borchert <bt@teknon.de>
6419 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
6421 2001-09-23 Jim Meyering <meyering@lucent.com>
6423 * mountlist.c: Remove useless parentheses in #if directives.
6424 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
6425 the deprecated MOUNTED symbol is no longer defined in mntent.h.
6427 2001-09-22 Jim Meyering <meyering@lucent.com>
6429 * localcharset.c: Update from latest gettext.
6430 * config.charset: Likewise.
6432 2001-09-20 Jim Meyering <meyering@lucent.com>
6434 * xstrtol.c (strtoimax): Guard declaration with
6435 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
6436 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
6437 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
6438 (strtoumax): Likewise, for completeness (it wasn't necessary).
6440 2001-09-06 Paul Eggert <eggert@twinsun.com>
6442 * strtoimax.c (HAVE_LONG_LONG):
6443 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
6444 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
6445 to work around bug in IBM C compiler.
6447 2001-09-16 Jim Meyering <meyering@lucent.com>
6449 * mkdir.c: New file.
6451 2001-09-04 Paul Eggert <eggert@twinsun.com>
6453 * xgetcwd.c: Revert some of the previous change; intead,
6454 fix the HAVE_GETCWD_NULL code to behave more like the
6455 !HAVE_GETCWD_NULL code used to.
6458 (xgetcwd): Do not return NULL when memory is exhausted; instead,
6461 2001-09-04 Paul Eggert <eggert@twinsun.com>
6463 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
6464 Use ssize_t, not int, to store result of readlink.
6465 Check for ssize_t overflow as well as size_t overflow,
6466 as POSIX says the result of readlink is implementation-defined
6467 when ssize_t overflows.
6468 Remove unnecessary cast to char*.
6469 Use free+malloc instead of realloc, as the storage doesn't need
6470 to be preserved and it's clearer and can be more efficient that way.
6471 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
6472 * xreadlink.h (xreadlink): Update prototype.
6474 2001-09-03 Paul Eggert <eggert@twinsun.com>
6476 * exclude.c (fnmatch_no_wildcards): Fix confusion between
6477 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
6478 spotted by Jim Meyering.
6480 2001-09-03 Jim Meyering <meyering@lucent.com>
6482 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
6484 2001-09-03 Paul Eggert <eggert@twinsun.com>
6486 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
6487 like the HAVE_GETCWD_NULL code.
6488 Include pathmax.h if not HAVE_GETCWD.
6489 Do not include xalloc.h.
6490 (INITIAL_BUFFER_SIZE): New symbol.
6491 Do not use xmalloc / xrealloc, since the caller is responsible for
6492 handling errors. Preserve errno around `free' during failure.
6493 Do not overrun buffer when using getwd.
6495 2001-09-03 Paul Eggert <eggert@twinsun.com>
6497 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
6498 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
6500 2001-09-02 Jim Meyering <meyering@lucent.com>
6502 * error.c: Update from GNU libc.
6504 2001-09-01 Jim Meyering <meyering@lucent.com>
6506 * xreadlink.c: New file.
6507 * xreadlink.h: New file.
6508 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
6510 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
6511 doesn't conflict with sparc Solaris 7's definition in
6512 /usr/include/sys/int_types.h.
6514 * exclude.c: Use `""', not `<>' to #include non-system header files.
6515 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
6516 and strncasecmp as r-values. Unixware didn't have declarations.
6518 2001-08-31 Jim Meyering <meyering@lucent.com>
6520 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
6521 Use an initial, malloc'd, buffer of length 128 rather than
6522 a statically allocated one of length 1024.
6524 2001-08-30 Paul Eggert <eggert@twinsun.com>
6526 * xgetcwd.c: Don't include pathmax.h.
6527 Include stdlib.h and unistd.h if available.
6529 (xmalloc, xstrdup, free): Remove decls.
6530 (xgetcwd): Don't assume sizes fit in unsigned.
6531 Check for overflow when computing sizes.
6532 Simplify reallocation code.
6534 2001-08-28 Paul Eggert <eggert@twinsun.com>
6536 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
6538 * strtoimax.c: Renamed from strtoxmax.c, removing the
6541 Also, make the following further changes to make this file's
6542 configuration more similar to that of strtol.c:
6543 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
6544 (strtoumax, uintmax_t, strtoull, strtol): Remove.
6545 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
6546 (strtoimax): Renamed from strtoumax. All uses of unsigned values
6547 changed to signed values.
6549 And make the following changes as well:
6550 Fix copyright notice, as 1999 was missing.
6551 (verify): New macro.
6552 (strtoimax): Check sizes at compile-time, not run-time.
6553 Prefer strtol to strtoll if both work.
6554 (main): Remove; it was not that useful and was a pain to maintain.
6556 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
6558 2001-08-30 Paul Eggert <eggert@twinsun.com>
6560 * savedir.c (savedir): Remove size parameter, as POSIX says that
6561 a directory's st_size can have an arbitrary value, so the old
6562 usage could waste an arbitrary amount of memory. All uses
6564 * savedir.h: Update prototype.
6566 2001-08-30 Paul Eggert <eggert@twinsun.com>
6568 * xstrtol.c (strtoimax): New decl.
6570 2001-08-28 Paul Eggert <eggert@twinsun.com>
6572 * xstrtol.h: Add copyright notice.
6573 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
6574 LONGINT_INVALID_SUFFIX_CHAR.
6576 2001-08-30 Paul Eggert <eggert@twinsun.com>
6578 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
6581 2001-08-30 Paul Eggert <eggert@twinsun.com>
6583 * hash.c: Remove '2001' from copyright notice.
6585 2001-08-30 Paul Eggert <eggert@twinsun.com>
6587 * full-write.h: New file.
6588 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
6589 * full-write.c: Correct credits, as cccp.c no longer
6590 exists and anyway it was so heavily changed from the old cccp
6591 code as to be unrecognizable. Include full-write.h.
6592 (full_write) Return size_t, with short writes meaning failure.
6593 All callers changed. This fixes a bug with large buffers
6595 * utime.c: Include full-write.h.
6597 2001-08-30 Paul Eggert <eggert@twinsun.com>
6599 Merge 'exclude' changes from tar 1.13.22.
6600 This fixes one or two unlikely storage allocation overflow bugs,
6601 but doesn't change user-visible behavior otherwise.
6603 2001-08-30 Paul Eggert <eggert@twinsun.com>
6605 * exclude.c (bool): Declare, perhaps by including stdbool.h.
6606 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
6607 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
6608 Include if available.
6609 (<xalloc.h>): Include
6610 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
6611 (verify): New macro. Use it to verify that EXCLUDE macros do not
6612 collide with FNM macros.
6613 (struct patopts): New struct.
6614 (struct exclude): Use it, as exclude patterns now come with options.
6615 (new_exclude): Support above changes.
6616 (new_exclude, add_exclude_file):
6617 Initial size must now be a power of two to simplify overflow checking.
6618 (free_exclude, fnmatch_no_wildcards): New function.
6619 (excluded_filename): No longer requires options arg, as the options
6620 are determined by add_exclude. Now returns bool, not int.
6621 (excluded_filename, add_exclude):
6622 Add support for the fancy new exclusion options.
6623 (add_exclude, add_exclude_file): Now takes int options arg.
6624 Check for arithmetic overflow when computing sizes.
6625 (add_exclude_file): xrealloc might modify errno, so don't
6626 realloc until after errno might be used.
6628 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
6630 (free_exclude): New decl.
6631 (add_exclude, add_exclude_file): Now takes int options arg.
6632 (excluded_filename): No longer requires options arg, as the options
6633 are determined by add_exclude. Now returns bool, not int.
6635 2001-08-30 Paul Eggert <eggert@twinsun.com>
6637 * alloca.c (alloca): Arg is of type size_t, not unsigned.
6639 2001-08-27 Jim Meyering <meyering@lucent.com>
6641 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
6643 * version-etc.c (N_): Remove definition.
6644 Revert most of last change.
6645 Instead, simply don't mark the `Copyright...' string for translation.
6646 Based on advice from Paul Eggert.
6648 * strtoxmax.c: Tweak comment.
6650 2001-08-26 Jim Meyering <meyering@lucent.com>
6652 * version-etc.c (version_etc_copyright_fmt): Replace literal year
6653 of copyright with `%s' so translators don't get an untranslated
6655 (COPYRIGHT_YEAR): Define.
6656 (version_etc): Use fprintf rather than fputs.
6657 Suggestion from Ulrich Drepper.
6659 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
6661 * strtoll.c: New file, from GNU libc.
6662 * xstrtoimax.c: New file.
6664 * xstrtol.h: Add xstrtoimax.
6665 * strtoumax.c: New file. Simply include "strtoumax.c".
6666 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
6668 * strtoumax.c: Factor to work both for unsigned and signed types, ...
6669 * strtoxmax.c: ... then renamed to this.
6671 2001-08-13 Paul Eggert <eggert@twinsun.com>
6673 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
6674 Port to Solaris 8, where 'sed' requires a space after the 'r'
6675 command, and where sh dislikes "$/". Clean up the spacing a bit.
6676 Redirect output to $tmp just once.
6678 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
6680 * addext.c (<errno.h>): Include.
6681 (errno): Declare if not defined.
6682 (addext): Work correctly when pathconf returns -1 and leaves
6683 errno alone because there is no limit. Also, work even if
6684 pathconf returns a value greater than SIZE_MAX.
6686 2001-08-12 Jim Meyering <meyering@lucent.com>
6688 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
6689 Simply `return getcwd (NULL, 0);'.
6690 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
6691 Use 1300 as initial value for length, not PATH_MAX.
6693 * pathmax.h: Clean up cpp syntax.
6695 2001-08-12 Jim Meyering <meyering@lucent.com>
6697 * gettimeofday.c: New file.
6699 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
6701 2001-08-04 Jim Meyering <meyering@lucent.com>
6703 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
6704 to get in sync with glibc.
6706 2001-08-03 Paul Eggert <eggert@twinsun.com>
6708 The following changes are from gettext 0.10.39 as maintained by
6711 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
6712 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
6713 with inverted sense. All uses changed.
6715 * mbswidth.c: Don't include <limits.h>.
6716 Include <stdlib.h> and <string.h> unconditionally.
6717 (iswcntrl, mbsinit, ISCNTRL): New macros.
6718 (mbsnwidth): Use K&R style function declarations.
6719 Don't bother checking for MB_LEN_MAX == 1, since the compiler
6720 can optimize it when MB_CUR_MAX == 1.
6721 The width of control characters is zero, not 1.
6723 2001-07-15 Jim Meyering <meyering@lucent.com>
6725 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
6726 (BUILT_SOURCES): Add unlocked-io.h.
6727 (io_functions): Define.
6728 (unlocked-io.h): New rule.
6729 (DISTCLEANFILES): Add unlocked-io.h.
6730 (all-local): Depend on unlocked-io.h, to ensure it is created.
6732 * unlocked-io.hin: New file
6734 * regex.c: Update from glibc.
6736 2001-07-05 Jim Meyering <meyering@lucent.com>
6738 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
6740 (libfetish_a_SOURCES): Put all .h files here instead.
6741 Remove a thus-exposed (better checks in automake) duplicate and
6742 two unnecessary .h files.
6744 2001-06-11 Jim Meyering <meyering@lucent.com>
6746 * regex.c: Update from GNU libc.
6748 2001-05-27 Jim Meyering <meyering@lucent.com>
6750 * readutmp.h (UT_TYPE): Define.
6752 2001-05-24 Jim Meyering <meyering@lucent.com>
6754 * argmatch.c: Include "quote.h".
6755 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
6756 quote function. Reported by Göran Uddeborg.
6758 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
6760 * dirname.c (dir_name): Compute append_dot using path, not newpath
6761 which is not yet declared.
6763 2001-05-11 Paul Eggert <eggert@twinsun.com>
6765 * Makefile.am (libfetish_a_SOURCES):
6766 Add strftime.c, since we now compile it on all hosts.
6768 * strftime.c (my_strftime):
6769 Define to nstrftime if emacs, but only if my_strftime is not defined.
6770 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
6771 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
6772 Add one more extra argument: a nanoseconds value.
6775 (my_strftime function): Add %N format.
6776 (emacs_strftimeu): Renamed from emacs_strftime,
6777 with extra ut argument.
6779 2001-05-11 Paul Eggert <eggert@twinsun.com>
6781 dirname code cleanup. base_name now behaves more compatibly
6782 with POSIX basename when given file names that have trailing
6783 slashes, and similarly for dir_name. Add new primitives
6784 base_len and dir_len. Put the directory-name-related decls
6787 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
6788 * backupfile.c (base_name): Likewise.
6789 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
6790 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
6791 * makepath.c (strip_trailing_slashes): Likewise.
6792 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
6794 * rename.c (strip_trailing_slashes): Likewise.
6795 * same.c (base_name): Likewise.
6796 * stripslash.c (ISSLASH): Likewise.
6798 * addext.c: Include <dirname.h> after size_t is defined.
6799 * backupfile.c: Likewise.
6801 * addext.c (addext): Use base_len to trim redundant
6802 trailing slashes instead of doing it ourselves.
6803 But do not trim the last slash if it is not redundant.
6805 * backupfile.c (find_backup_file_name,
6806 max_backup_version): Use base_len instead of rolling it ourselves.
6807 Handle the case of "" and (on DOS) "C:" correctly.
6809 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
6810 Include <string.h>, <dirname.h>.
6811 (base_name): Allow file names ending in slashes, other than names
6812 that are all slashes. In this case, return the basename followed
6813 by the slashes. This is more general, and can be used in places
6814 where the original base_name purposely had an assertion failure.
6815 (base_len): New function.
6817 * dirname.c: Include <string.h> instead of <stdlib.h>.
6818 Do not include <assert.h>; no longer needed.
6820 (memrchr): Remove decl.
6821 (dir_name_r): Remove.
6822 (dir_len): Renamed from dirlen. All callers changed.
6823 Rewrite in terms of base_name, for simplicity and consistency.
6824 (dir_name): Never return NULL. All callers changed.
6825 Do not include <stdlib.h> in test program; no longer needed.
6826 return 0; is fine for test program.
6828 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
6830 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
6832 * path-concat.c (path_concat): Use base_len to compute
6833 base length, not strlen; this means we cannot rely on memcpy
6836 * same.c (STREQ): Remove.
6837 (same_name): Handle the case where the basename ends in trailing '/'.
6839 * stripslash.c (strip_trailing_slashes): Return nonzero if
6840 a slash was stripped. Do not strip the last slash after a
6843 2001-04-08 Jim Meyering <meyering@lucent.com>
6845 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
6846 recomputed; that's necessary when the offset spans a DST transition.
6847 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
6849 2001-04-02 Jim Meyering <meyering@lucent.com>
6851 * regex.h, regex.c: Update from GNU libc.
6853 2001-03-19 Paul Eggert <eggert@twinsun.com>
6855 * version-etc.c (version_etc_copyright): Update to 2001.
6857 2001-03-16 Paul Eggert <eggert@twinsun.com>
6859 * tempname.c (uint64_t): Define to uintmax_t if
6860 not defined, and if UINT64_MAX is not defined.
6861 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
6862 Reported by John David Anglin.
6864 2001-03-10 Bruno Haible <haible@clisp.cons.org>
6866 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
6867 alias if codeset is empty.
6868 * config.charset (BeOS): Use wildcard syntax.
6870 2001-03-13 Jim Meyering <meyering@lucent.com>
6872 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
6873 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
6876 2001-03-06 Bruno Haible <haible@clisp.cons.org>
6878 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
6880 * unicodeio.c (print_unicode_char): Simplify accordingly.
6882 2001-03-06 Bruno Haible <haible@clisp.cons.org>
6884 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
6885 support for DOS/DJGPP.
6887 2001-02-28 Paul Eggert <eggert@twinsun.com>
6889 * Makefile.am (libfetish_a_SOURCES):
6890 Add dup-safer.c, fopen-safer.c.
6891 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
6893 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
6895 2001-02-25 Paul Eggert <eggert@twinsun.com>
6897 The mkstemp replacement is taken from glibc 2.2.2, with some
6898 portability fixes for use outside glibc, as follows:
6900 * tempname.c (struct_stat64): New macro.
6901 (direxists, __gen_tempname): Use it.
6902 This avoids a portability problem with Solaris 8.
6904 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
6905 (<stddef.h>, <stdint.h>, <string.h>):
6906 Include only if STDC_HEADERS || _LIBC.
6907 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
6908 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
6909 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
6910 (__set_errno): Define this macro if <errno.h> doesn't.
6911 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
6912 Define these macros if <stdio.h> doesn't.
6913 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
6914 Define these macros if <sys/stat.h>
6915 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
6916 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
6917 __xstat64): Define if not _LIBC.
6918 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
6919 (__gen_tempname): Invoke gettimeofday only if
6920 HAVE_GETTIMEOFDAY || _LIBC;
6921 otherwise, fall back on plain "time".
6922 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
6924 * mkstemp.c (__GT_FILE): Define to zero if not defined.
6926 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
6928 2001-02-17 Jim Meyering <meyering@lucent.com>
6930 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
6931 around included file name.
6933 * strnlen.c (__strnlen): Merge in a change from GNU libc.
6935 * strftime.c: Update from GNU libc (the only changes were to comments).
6937 2001-02-13 Bruno Haible <haible@clisp.cons.org>
6939 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
6941 2001-02-17 Paul Eggert <eggert@twinsun.com>
6943 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
6944 Remove workaround macros for hosts that have mbrtowc but not
6945 mbstate_t, as we now insist on proper declarations for both
6946 before using mbrtowc.
6948 2001-02-17 Jim Meyering <meyering@lucent.com>
6950 * regex.c: Update from libc.
6952 2001-02-16 Paul Eggert <eggert@twinsun.com>
6954 * alloca.c (malloc): Undef before defining, since stdlib.h
6955 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
6956 Reported by Mark Hounschell via Paul Eggert.
6958 2001-01-30 Bruno Haible <haible@clisp.cons.org>
6960 * config.charset: Update for FreeBSD 4.2.
6962 2001-01-26 Jim Meyering <meyering@lucent.com>
6964 * quotearg.c: Include stddef.h.
6965 * quote.c: Include stddef.h.
6966 Reported by Axel Kittenberger.
6968 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
6969 line in double quotes so that it evokes a better diagnostic.
6970 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
6971 Reported by Axel Kittenberger.
6973 2001-01-15 Bruno Haible <haible@clisp.cons.org>
6975 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
6976 to avoid a warning. Add back 'const' to inptr.
6978 2001-01-16 Jim Meyering <meyering@lucent.com>
6980 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
6983 2001-01-14 Jim Meyering <meyering@lucent.com>
6985 * rename.c: New file. From Volker Borchert.
6986 Include stdlib.h, string.h or strings.h, and xalloc.h.
6987 Use strip_trailing_slashes rather than open-coding it.
6989 2001-01-03 Paul Eggert <eggert@twinsun.com>
6991 * strftime.c: Sync with glibc time/strftime.c 1.81.
6993 2001-01-03 Jim Meyering <meyering@lucent.com>
6995 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
6996 local `inptr' to avoid warning with some system declarations of iconv.
6998 2000-12-29 Paul Eggert <eggert@twinsun.com>
7000 * modechange.c: Do not assume that mode_t uses the
7001 traditional octal encoding. E.g. "chmod 1 FOO" should set
7002 the other-execute bit of FOO even if S_IXOTH != 1.
7004 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7005 WOTH, XOTH, ALLM): New macros.
7006 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7007 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7009 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7010 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7012 No need to use uintmax_t; unsigned long is long enough.
7013 Don't bother to get suffix since we don't use it.
7015 2000-12-24 Jim Meyering <meyering@lucent.com>
7017 * hash.c (is_prime): Return explicit boolean values.
7018 (hash_get_first): Return NULL to appease Irix5.6's 89.
7019 Reported by Nelson Beebe.
7021 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7023 * localcharset.c (locale_charset): Add support for Win32.
7025 2000-12-18 Paul Eggert <eggert@twinsun.com>
7027 * physmem.h, physmem.c: New files.
7029 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7030 (noinst_HEADERS): Add physmem.h.
7032 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7033 't' for compatibility with Solaris 8 sort.
7035 2000-12-18 Bruno Haible <haible@clisp.cons.org>
7037 * config.charset: Add support for BeOS.
7039 2000-12-16 Jim Meyering <meyering@lucent.com>
7041 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7042 SHELLS_FILE to a file name that's useful on djgpp systems.
7044 (ADDITIONAL_DEFAULT_SHELLS): Define.
7045 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7046 Based mostly on a patch from Prashant TR.
7048 2000-12-16 Jim Meyering <meyering@lucent.com>
7050 This bug had a serious impact on chown: `chown N:M FILE' (for integer
7051 N and M) would have treated it like `chown N:N FILE'.
7053 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7055 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7057 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7058 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7059 to the list of canonical encodings. Rename EUC-CN to GB2312.
7061 2000-12-08 Andreas Schwab <schwab@suse.de>
7063 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7064 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7066 2000-12-07 Jim Meyering <meyering@lucent.com>
7068 * stripslash.c (ISSLASH): Define.
7069 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7072 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7073 (dir_name_r): Declare this function as static.
7074 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7075 manifest itself on a name containing a mix of slashes and
7077 Make this function work with names starting with a DOS-style
7078 drive letter and colon prefix.
7079 (dir_name): Append `.' if necessary.
7080 Based mostly on patches from Prashant TR and Eli Zaretskii.
7082 * dirname.h (dir_name_r): Remove prototype.
7084 2000-12-05 Jim Meyering <meyering@lucent.com>
7086 * dirname.c (dir_name_r): Add `const' in a few local declarations.
7088 2000-12-04 Jim Meyering <meyering@lucent.com>
7090 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7091 Also include memory.h, stdlib.h, unistd.h if appropriate.
7092 Reported by Andreas Jaeger (conflicting declaration of malloc).
7094 2000-12-02 Jim Meyering <meyering@lucent.com>
7096 * closeout.h: Make idempotent, to avoid some obscure warnings.
7098 2000-12-01 Paul Eggert <eggert@twinsun.com>
7100 * memrchr.c: Include <config.h> before any system include file.
7102 2000-11-29 Paul Eggert <eggert@twinsun.com>
7104 * dirname.c (dir_name_r): Fix typo: int -> size_t.
7106 2000-11-26 Jim Meyering <meyering@lucent.com>
7108 * memcoll.c: Include sys/types.h. From Werner Almesberger.
7110 2000-11-22 Paul Eggert <eggert@twinsun.com>
7112 * strftime.c (my_strftime): Do not invoke mbrlen with a
7113 size of (size_t) -1; it's not portable.
7115 2000-11-17 Akim Demaille <akim@epita.fr>
7117 * obstack.h: Formatting changes.
7118 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7119 prevent type checking.
7120 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7121 cast the value to (void *): assigning a `foo *' to a `void *'
7123 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7125 2000-11-17 Jim Meyering <meyering@lucent.com>
7127 * strstr.c: Update from GNU libc.
7129 2000-11-16 Jim Meyering <meyering@lucent.com>
7131 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7133 2000-11-11 Jim Meyering <meyering@lucent.com>
7135 * error.c: Add a couple #includes, merging from GNU libc version.
7137 2000-11-10 Jim Meyering <meyering@lucent.com>
7139 * obstack.h: Update from GNU libc.
7140 * obstack.c: Likewise.
7142 2000-11-06 Paul Eggert <eggert@twinsun.com>
7144 * getusershell.c (setusershell): Use rewind rather than
7145 fseek/fseeko, to avoid configuration hassles with fseeko.
7146 Don't bother opening SHELLS_FILE if shellstream is NULL;
7149 2000-11-05 Jim Meyering <meyering@lucent.com>
7151 * makepath.h (make_dir): Declare.
7152 * makepath.c (make_dir): Remove `static' attribute.
7155 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
7157 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
7158 last one in a bucket, advance to the next bucket.
7160 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
7162 * fnmatch.c: Do not comment out all the code if we are using
7163 the GNU C library, because in some cases we are replacing buggy
7164 code in the GNU C library itself.
7166 2000-10-30 Paul Eggert <eggert@twinsun.com>
7168 * error.h, getline.h, modechange.h:
7169 Remove "2000" from Copyright line, as the file hasn't been
7170 changed this year other than in the copyright notice.
7172 * xalloc.h: Add "2000" to Copyright line, as this file
7173 was changed this year.
7175 2000-10-30 Paul Eggert <eggert@twinsun.com>
7177 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
7178 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
7179 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
7181 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
7183 * regex.h (__restrict_arr): Move definition out of #ifndef block.
7184 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
7185 doesn't define __restrict_arr.
7187 2000-10-29 Jim Meyering <meyering@lucent.com>
7189 * xstat.in: Fix grammar in comment.
7191 2000-10-28 Jim Meyering <meyering@lucent.com>
7193 * memchr.c: Update from libc.
7194 Adjust for portability:
7195 [HAVE_STDLIB_H]: Include stdlib.h.
7196 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
7197 Undef __memchr, too.
7198 [!weak_alias]: Define __memchr to memchr.
7200 * regex.c: Update from libc.
7201 * regex.h: Likewise.
7202 * getopt1.c: Likewise.
7203 * memcmp.c: Likewise.
7205 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
7206 Avoid using fseek, when possible -- it's broken by design.
7207 Patch by Ulrich Drepper.
7209 2000-10-26 Jim Meyering <meyering@lucent.com>
7211 * strftime.c: Update from libc.
7213 2000-10-25 Jim Meyering <meyering@lucent.com>
7215 * obstack.c: Update from libc.
7217 2000-10-23 Jim Meyering <meyering@lucent.com>
7219 * hard-locale.c (hard_locale): Revert last change -- it was simply
7220 wrong. That set_locale call must not have any side effects.
7223 2000-10-22 Jim Meyering <meyering@lucent.com>
7225 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
7226 [CYCLIC]: Remove now-unused definition.
7228 * save-cwd.c (O_DIRECTORY): Define, if needed.
7229 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
7230 Suggestion from Ulrich Drepper.
7232 2000-10-21 Jim Meyering <meyering@lucent.com>
7234 * dirname.c (dir_name_r): New function, factored out of dir_name.
7235 (dir_name): Use dir_name_r.
7236 * dirname.h (dir_name_r): Declare it.
7238 2000-10-21 Jim Meyering <meyering@lucent.com>
7240 * dirname.c (memrchr): Declare if necessary.
7241 (dir_name): Remove the restriction that there be no
7242 trailing slashes. Now, this code skips past them, effectively
7244 [TEST_DIRNAME] (main): New unit tests.
7246 * memrchr.c: New file from GNU libc.
7247 Undef __memrchr, too.
7248 [!weak_alias]: Define __memrchr to memrchr.
7249 Guard weak_alias use with `#ifdef weak_alias'.
7251 2000-10-17 Jim Meyering <meyering@lucent.com>
7253 * quote.h (PARAMS): Define and use.
7254 Reported by Akim Demaille.
7256 * getopt.c: Update from libc.
7258 2000-10-16 Jim Meyering <meyering@lucent.com>
7260 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
7263 2000-09-25 Jim Meyering <meyering@lucent.com>
7265 * md5.h (rol): Define (from GnuPG).
7267 * sha.c: Give credit (GnuPG) where due.
7268 (M): Use rol rather than open-coding it.
7269 Add a FIXME comment.
7271 2000-09-21 Jim Meyering <meyering@lucent.com>
7273 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
7274 Reported by Michael Stone.
7276 2000-09-20 Jim Meyering <meyering@lucent.com>
7278 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
7279 (noinst_HEADERS): Add sha.h.
7280 Based on code from Scott G. Miller and from GnuPG.
7282 2000-09-15 Jim Meyering <meyering@lucent.com>
7284 * regex.c: Update from libc.
7286 2000-09-10 Jim Meyering <meyering@lucent.com>
7288 * getopt.c (_getopt_internal): Update from glibc.
7290 2000-09-09 Jim Meyering <meyering@lucent.com>
7292 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
7293 think it should be used as a general replacement for isascii.
7294 * fnmatch.c: Likewise.
7295 * mbswidth.c: Likewise
7296 * regex.c: Likewise.
7299 * userspec.c: Include sys/param.h and limits.h.
7301 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7302 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
7303 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
7304 UID, GID. Check range.
7306 2000-09-06 Jim Meyering <meyering@lucent.com>
7308 * getopt.c (_getopt_internal): Update from glibc.
7310 2000-08-30 Jim Meyering <meyering@lucent.com>
7312 * strftime.c: Merge in changes from GNU libc.
7314 2000-08-26 Jim Meyering <meyering@lucent.com>
7316 * closeout.c: Include "__fpending.h".
7317 (close_stdout_status): Return right away if there's nothing to flush.
7319 * Makefile.am (noinst_HEADERS): Add __fpending.h.
7320 * __fpending.c: New file.
7321 * __fpending.h: New file.
7323 2000-08-07 Paul Eggert <eggert@twinsun.com>
7325 Standardize on "memory exhausted" instead of "Memory exhausted"
7326 or "virtual memory exhausted".
7327 * obstack.c (print_and_abort): Use "memory exhausted", not
7328 "virtual memory exhausted".
7329 * same.c (same_name): Invoke xalloc_die instead of printing
7331 * userspec.c (parse_user_spec): Likewise.
7332 * bumpalloc.h: comment fix
7333 * same.c, userspec.c: Include xalloc.h.
7335 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
7336 not char *const and pointing to a constant array.
7337 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
7338 (xrealloc): Comment fix.
7340 * userspec.c (parse_user_spec):
7341 Don't translate a message until just before returning,
7342 to avoid unnecessary translation.
7344 2000-08-07 Jim Meyering <meyering@lucent.com>
7346 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
7347 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
7348 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
7349 getgroups.c, gethostname.c, getopt.h, group-member.c,
7350 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
7351 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
7352 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
7353 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
7354 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
7355 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
7356 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
7357 yesno.c: Back out Copyright date changes for each file with no change
7358 this year. This eases coordination with other programs using the same
7359 source code modules. From Paul Eggert.
7361 2000-08-03 Greg McGary <greg@mcgary.org>
7363 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
7364 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
7365 (EXTEND_BUFFER): Use them.
7367 2000-08-01 Jim Meyering <meyering@lucent.com>
7369 * dirname.c (ISSLASH): Define.
7370 (BACKSLASH_IS_PATH_SEPARATOR): Define.
7371 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
7372 both `\' and `/' may be use as path separators.
7373 Based on a patch from Prashant TR.
7375 2000-07-31 Paul Eggert <eggert@twinsun.com>
7377 * quotearg.c (quotearg_n_options): Don't make the initial
7378 slot vector a constant, since it might get modified.
7380 2000-07-31 Jim Meyering <meyering@lucent.com>
7382 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
7383 * obstack.c (print_and_abort): Likewise.
7385 2000-07-30 Paul Eggert <eggert@twinsun.com>
7387 * quotearg.c (quotearg_n_options): Preallocate a slot 0
7388 buffer, so that the caller can always quote one small
7389 component of a "memory exhausted" message in slot 0.
7390 From a suggestion by Jim Meyering.
7392 2000-07-30 Jim Meyering <meyering@lucent.com>
7394 * makepath.c (make_path): Quote the other instance, too.
7396 * quotearg.c (N_STATIC_SLOTVECS): Define.
7397 (STATIC_BUF_SIZE): Define.
7398 (quotearg_n_options): Use only statically allocated storage when
7399 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
7400 than STATIC_BUF_SIZE.
7402 2000-07-29 Jim Meyering <meyering@lucent.com>
7404 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
7405 * dirname.c (dir_name): Likewise.
7407 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
7409 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
7410 (dir_name): Assert that there are no trailing slashes.
7412 2000-07-18 Bruno Haible <haible@clisp.cons.org>
7414 * mbswidth.h (mbswidth): Add a flags argument.
7415 (mbswidth): New declaration.
7416 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
7417 * mbswidth.c (mbswidth): Add a flags argument.
7418 (mbsnwidth): New function.
7420 2000-07-24 Jim Meyering <meyering@lucent.com>
7422 * mbswidth.c: Remove useless #else. From Bruno Haible.
7424 2000-07-23 Paul Eggert <eggert@twinsun.com>
7426 * mbswidth.c (_XOPEN_SOURCE):
7427 Don't define; this causes problems on Solaris 7.
7428 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
7430 2000-07-23 Paul Eggert <eggert@twinsun.com>
7433 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
7434 so that mbstate_t is always defined.
7436 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
7437 be 1 in at least one GCC installation, and this configuration
7438 error is likely to be common. Ignoring MB_LEN_MAX hurts
7439 performance on hosts that have mbrtowc but have only unibyte
7440 locales, but I assume these hosts are rare.
7442 2000-07-23 Paul Eggert <eggert@twinsun.com>
7444 * quotearg.c: Streamline by invoking multibyte code only if needed.
7445 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
7446 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
7447 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
7448 invoke multibyte primitives.
7450 2000-07-23 Jim Meyering <meyering@lucent.com>
7452 * basename.c (base_name): Add an assertion.
7454 2000-07-15 Bruno Haible <clisp.cons.org>
7456 * quotearg.c: When the system forces us to redefine mbstate_t,
7457 shadow its mbsinit function.
7459 2000-07-16 Bruno Haible <haible@clisp.cons.org>
7461 * mbswidth.h: New file.
7462 * mbswidth.c: New file.
7463 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
7464 (noinst_HEADERS): Add mbswidth.h.
7466 2000-07-17 Bruno Haible <haible@clisp.cons.org>
7468 * config.charset: Add support for FreeBSD. Improve support for HP-UX
7471 2000-07-15 Jim Meyering <meyering@lucent.com>
7473 * makepath.c: Include quote.h.
7474 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
7475 corresponding argument in a `quote (...)' call.
7476 Give better diagnostics.
7478 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
7479 (noinst_HEADERS): Add quote.h.
7481 * quote.c (quote, quote_n): New file. Two functions taken verbatim
7482 from tar's src/misc.c.
7483 * quote.h: New file. Prototypes for same.
7485 2000-07-10 Paul Eggert <eggert@twinsun.com>
7487 From a suggestion by Bruno Haible.
7488 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
7489 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
7490 to decide whether to define the BeOS workaround macro;
7491 this adjusts to the change to AC_MBSTATE_T.
7493 2000-07-13 Paul Eggert <eggert@twinsun.com>
7495 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
7497 * quotearg.c (quoting_style_args, quoting_style_vals,
7498 quotearg_buffer_restyled): Add support for
7499 clocale_quoting_style. Undo previous change to
7500 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
7501 and "{RIGHT QUOTATION MARK}" msgids.
7503 2000-07-05 Paul Eggert <eggert@twinsun.com>
7505 The old behavior of quoting `like this' doesn't look good with
7506 newer, ISO-style fonts. See:
7507 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
7509 Instead, quote "like this" by default. Let the translator
7510 tailor the locale-specific quoting behavior by providing
7511 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
7513 * quotearg.c (N_): New macro.
7514 (gettext_default): New function.
7515 (quotearg_buffer_restyled): Use
7516 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
7517 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
7519 2000-07-09 Jim Meyering <meyering@lucent.com>
7521 * Most files: Update copyright dates to include 2000.
7523 2000-07-08 Jim Meyering <meyering@lucent.com>
7525 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
7527 (xgethostname): Remove now-unnecessary #ifdef.
7528 Move declaration of `err' into loop where it's used.
7530 2000-07-05 Bruno Haible <haible@clisp.cons.org>
7532 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
7533 by allocating a larger buffer. Test the gethostname return value for
7534 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
7535 returns an error and ENAMETOOLONG isn't defined.
7537 2000-07-05 Paul Eggert <eggert@twinsun.com>
7538 and Bruno Haible <haible@clisp.cons.org>
7540 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
7542 2000-07-05 Bruno Haible <haible@clisp.cons.org>
7544 * quotearg.c (struct quoting_options): Simplify quote_these_too
7547 2000-07-03 Jim Meyering <meyering@lucent.com>
7549 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
7550 Reported by Bruno Haible.
7552 2000-07-04 Jim Meyering <meyering@lucent.com>
7554 * quotearg.c: Make inclusion of <wchar.h> independent of whether
7555 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
7558 2000-07-03 Paul Eggert <eggert@twinsun.com>
7559 and Bruno Haible <haible@clisp.cons.org>
7561 * quotearg.c (mbrtowc):
7562 Assign to *pwc, and return 1 only if result is nonzero.
7563 (iswprint): Use ISPRINT when substituting our own mbrtowc.
7565 2000-07-03 Jim Meyering <meyering@lucent.com>
7567 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
7568 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
7571 2000-07-02 Jim Meyering <meyering@lucent.com>
7573 * quotearg.c (mbstate_t): Don't define here.
7575 2000-07-02 Jim Meyering <meyering@lucent.com>
7577 * nanosleep.c (SIGCONT): Define if not already defined.
7579 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7581 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
7582 per change in ../m4/ls-mntd-fs.m4.
7583 (read_filesystem_list): Ignore symbolic links.
7585 2000-06-29 Jim Meyering <meyering@lucent.com>
7587 * same.c: Include <string.h> or <strings.h>, as appropriate,
7588 for declaration of strcmp.
7590 * long-options.c: Include <stdlib.h>, for declaration of exit.
7592 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
7593 Avoid warning by casting result to `char *' to remove `const'.
7595 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7597 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
7599 2000-06-26 Paul Eggert <eggert@twinsun.com>
7601 savedir now sets errno on failure and invokes xmalloc to get memory.
7602 Fix a couple of other minor bugs while we're at it.
7604 * savedir.c (<unistd.h>): Do not include; there's no need.
7605 (NAMLEN): Remove macro.
7606 (malloc, realloc): Remove decls.
7608 ("xalloc.h"): Include.
7609 (NAME_SIZE_DEFAULT): New macro.
7610 (savedir): Use xmalloc / xrealloc to allocate memory.
7611 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
7612 Skip "" directory entries.
7613 Use strlen to calculate directory entry length, since the old method
7614 is rarely used these days and isn't worth supporting.
7615 Don't use a pointer after freeing it.
7616 Check for integer overflow when calculating allocation size.
7617 Use memcpy to copy entries, instead of stpcpy.
7618 Set errno properly when returning NULL.
7619 Check for readdir error.
7621 2000-06-26 Jim Meyering <meyering@lucent.com>
7623 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
7625 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7627 * getusershell.c (xmalloc, xrealloc): Remove functions.
7629 Don't include <stdlib.h>. Don't declare malloc, realloc.
7631 2000-06-23 Bruno Haible <haible@clisp.cons.org>
7633 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
7635 2000-06-24 Jim Meyering <meyering@lucent.com>
7637 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
7639 2000-06-21 Jim Meyering <meyering@lucent.com>
7641 * getpass.c: New file, from Bruno Haible. Required for BeOS.
7643 2000-06-19 Paul Eggert <eggert@twinsun.com>
7645 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
7646 (mbrtowc, mbstate_t): Define substitutes if
7647 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
7648 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
7649 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
7651 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7653 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
7654 than 1024, return a memory chunk of least possible size, instead
7655 of size PATH_MAX + 2. In the loop, increment the size proportionally.
7656 Use free/xmalloc instead of xrealloc to avoid copying for very long
7659 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7661 * canon-host.c (canon_host): Use malloc and memcpy to copy an
7662 address, not strdup. Include <stdlib.h> and don't declare free().
7664 2000-06-17 Bruno Haible <haible@clisp.cons.org>
7666 * path-concat.c (path_concat): Don't access dir[-1] if dir is
7669 2000-06-21 Jim Meyering <meyering@lucent.com>
7671 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
7672 (noinst_HEADERS): Add getstr.h.
7674 * getline.c (getstr): Move into a separate file.
7675 * getstr.c (getstr): New file, extracted from getline.c, with
7676 the following changes: new parameter, delim2; both delim[12]
7677 parameters have type `int', not `char'. The latter would lose
7678 with 8-bit delimiters.
7679 * getstr.h: New file.
7681 2000-06-19 Jim Meyering <meyering@lucent.com>
7683 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
7685 2000-06-18 Jim Meyering <meyering@lucent.com>
7687 * mkdir.c: Remove file, due mainly to copyright incompatibility.
7688 Besides, these days every porting target provides a mkdir function.
7690 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
7691 (this snippet comes from src/system.h).
7693 2000-06-15 Paul Eggert <eggert@twinsun.com>
7695 * human.c (adjust_value): New function.
7696 (human_readable_inexact): Apply rounding style even when
7697 printing approximate values.
7699 2000-06-14 Paul Eggert <eggert@twinsun.com>
7701 * human.c (human_readable_inexact): Allow an input block
7702 size that is not a multiple of the output block size, and vice versa.
7703 Reported by Piergiorgio Sartor.
7705 2000-06-14 Paul Eggert <eggert@twinsun.com>
7707 * getdate.y (get_date): Apply relative times after time
7708 zone indicator, not before. Reported by Todd A. Jacobs.
7710 2000-06-13 Jim Meyering <meyering@lucent.com>
7712 * Makefile.am (all-local): Depend on lstat.c and stat.c.
7714 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
7716 2000-06-12 Paul Eggert <eggert@twinsun.com>
7718 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
7720 2000-06-04 Paul Eggert <eggert@twinsun.com>
7722 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
7724 2000-06-04 Jim Meyering <meyering@lucent.com>
7726 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
7727 SunOS 4.1.4 for which gid_t is an unsigned type.
7729 2000-06-03 Jim Meyering <meyering@lucent.com>
7731 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
7733 2000-05-26 Bruno Haible <haible@clisp.cons.org>
7735 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
7736 newer, don't install charset.alias.
7737 * config.charset: Change the Linux/glibc rules so they become empty
7738 on glibc-2.1 or newer.
7740 2000-06-02 Jim Meyering <meyering@lucent.com>
7742 * mountlist.c: Back out last change. Instead, do this...
7743 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
7744 member using the same `ignore'-testing code.
7745 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
7749 2000-05-29 Jim Meyering <meyering@lucent.com>
7751 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
7752 with the `ignore' attribute. Based on a patch from Mark D. Roth.
7754 2000-05-22 Jim Meyering <meyering@lucent.com>
7756 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
7758 2000-05-18 Jim Meyering <meyering@lucent.com>
7760 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
7761 back, too, since it may have been modified by allocate_entry.
7762 (hash_delete): Rewrite to use neither the assignment operator
7763 nor the comma operator in an if-expression.
7765 2000-05-15 Paul Eggert <eggert@twinsun.com>
7768 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
7769 Remove; no longer needed.
7770 "quotearg.h": Add include.
7771 (file_name): Do not bother to explicitly initialize to NULL; it's less
7772 efficient on some hosts.
7773 (close_stdout_status): Remove test as to whether stdout was already
7774 closed; it breaks for the case "echo x | sort >&-".
7775 Quote file name colons.
7776 Do not assume that _("write error") lacks format strings.
7778 2000-05-15 Jim Meyering <meyering@lucent.com>
7780 * version-etc.c (version_etc_copyright): Update the copyright string
7781 used in all --version output.
7783 2000-05-14 Jim Meyering <meyering@lucent.com>
7785 * closeout.c (close_stdout_set_file_name): New function.
7786 (close_stdout_status): Use new file-scoped global.
7787 Return right away if fstat says the stdout file descriptor is invalid.
7788 * closeout.h (close_stdout_set_file_name): Declare.
7790 2000-05-10 Jim Meyering <meyering@lucent.com>
7792 * closeout.c [default_exit_status]: New file-scoped variable.
7793 (close_stdout_set_status): New function.
7794 * closeout.h (close_stdout_set_status): Declare.
7796 2000-05-08 Jim Meyering <meyering@lucent.com>
7798 * long-options.c: Don't include closeout.h.
7799 (parse_long_options): Don't call close_stdout for --version.
7801 2000-05-06 Jim Meyering <meyering@lucent.com>
7803 * strnlen.c: Undefine __strnlen and strnlen.
7804 [!weak_alias]: Define __strnlen to strnlen.
7806 * atexit.c: New file, from libiberty.
7808 2000-05-06 Jim Meyering <meyering@lucent.com>
7810 * closeout.c (close_stdout_status): Also check for errors on the
7813 2000-05-05 Bruno Haible <haible@clisp.cons.org>
7815 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
7816 instead of xmalloc, xrealloc, path_concat.
7817 (locale_charset): Treat empty environment variables as absent.
7818 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
7820 2000-05-04 Jim Meyering <meyering@lucent.com>
7822 * getopt.c: Update from glibc.
7823 * obstack.c: Likewise.
7824 * obstack.h: Likewise.
7825 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
7827 * regex.h: Likewise.
7828 * strndup.c: Likewise.
7829 * strnlen.c: New file, from glibc.
7831 2000-05-01 Jim Meyering <meyering@lucent.com>
7833 * full-write.c (full_write): Remove `FIXME' part of comment.
7835 2000-04-29 Jim Meyering <meyering@lucent.com>
7837 * path-concat.c: Declare strdup only if it's not defined.
7838 * canon-host.c: Likewise.
7840 2000-04-28 Jim Meyering <meyering@lucent.com>
7842 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
7843 redefinition warning on some systems (HPUX). Otherwise, regex.h is
7844 included first, then limits.h is included by locale.h by libintl.h.
7845 From John David Anglin.
7847 2000-04-25 Jim Meyering <meyering@lucent.com>
7849 * makepath.c (S_IRWXUGO): Define.
7850 (make_path): Always perform explicit chmod if MODE specifies any
7851 of the `special' permission bits. Prompted by a bug report against
7852 install from Mate Wierdl and Joost van Baal.
7854 2000-04-18 Jim Meyering <meyering@lucent.com>
7858 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
7859 getpagesize. For BeOS. Based on a patch from Bruno Haible.
7861 2000-04-17 Jim Meyering <meyering@lucent.com>
7863 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
7864 the definition of it to rpl_strftime also defined-away the system's
7867 2000-04-15 Jim Meyering <meyering@lucent.com>
7869 Use `C' to denote so-called `contiguous' files, the same way
7871 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
7872 (ftypelet): Use S_ISCTG.
7873 From Michael Deutschmann.
7875 2000-04-14 Jim Meyering <meyering@lucent.com>
7877 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
7879 2000-04-08 Jim Meyering <meyering@lucent.com>
7881 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
7882 names don't conflict. Reported by Eli Zaretskii.
7884 2000-03-28 Bruno Haible <haible@clisp.cons.org>
7886 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
7887 bug. Deal with the different error behavior of Irix iconv.
7889 2000-04-07 Jim Meyering <meyering@lucent.com>
7891 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
7892 to work around system header problems on AIX 3.2.5. From Bruno Haible.
7894 2000-04-05 Jim Meyering <meyering@lucent.com>
7896 Portability tweaks required for ultrix4.3.
7897 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
7898 * readutmp.c: Include sys/types.h before sys/stat.h.
7899 * canon-host.c: Declare strdup.
7900 * path-concat.c: Likewise.
7901 From John David Anglin.
7903 2000-04-04 Jim Meyering <meyering@lucent.com>
7905 Be more DOS 8.3-friendly.
7906 * ref-add.sin: Renamed from ref-add.sed.in.
7907 * ref-del.sin: Renamed from ref-del.sed.in.
7908 * Makefile.am: Reflect renaming.
7909 Reported by Eli Zaretskii.
7911 Use a temporary file name that won't clash with `charset.alias'
7912 in the DOS 8.3 name space.
7913 * Makefile.am (charset_tmp): Define.
7914 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
7915 (uninstall-local): Likewise.
7916 Reported by Eli Zaretskii.
7918 2000-03-29 Paul Eggert <eggert@twinsun.com>
7920 * time/strftime.c (my_strftime): Make sure we call the system
7921 strftime, not ourselves, when invoking the underlying strftime.
7923 2000-03-24 Jim Meyering <meyering@lucent.com>
7925 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
7926 (charset_alias): Define.
7927 (install-exec-local): Factor out common code.
7928 (uninstall-local): Split lines longer than 80.
7929 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
7931 (.sed.in.sed): New rule. Don't redirect directly to $@.
7932 (CLEANFILES): Add ref-add.sed and ref-del.sed.
7934 2000-03-19 Bruno Haible <haible@clisp.cons.org>
7936 * config.charset: Output a line containing "Packages using this file".
7937 * ref-add.sed.in, ref-del.sed.in: New files.
7938 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
7939 ref-del.sed): New rules.
7941 2000-03-17 Jim Meyering <meyering@lucent.com>
7943 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
7944 Otherwise, include <strings.h>
7946 2000-03-17 Bruno Haible <haible@clisp.cons.org>
7948 * unicodeio.c (utf8_wctomb): New function.
7949 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
7950 format instead of in UCS-4 with platform dependent endianness.
7952 2000-03-07 Paul Eggert <eggert@twinsun.com>
7954 * savedir.c (savedir): Work even if directory size is
7955 negative; this can happen with some screwy NFS configurations.
7957 2000-03-06 Jim Meyering <meyering@lucent.com>
7959 * localcharset.c (get_charset_aliases): Don't try to free file_name
7960 if it's NULL (because we ran out of memory). From Bruno Haible.
7962 2000-03-05 Jim Meyering <meyering@lucent.com>
7964 * localcharset.c ("path-concat.h"): Include.
7965 (get_charset_aliases): Use path_concat instead of ANSI string
7968 * unicodeio.h (PARAMS): Define.
7969 Use it to guard prototype.
7971 2000-03-04 Jim Meyering <meyering@lucent.com>
7973 * Makefile.am (install-exec-local): Create $(libdir) before installing
7975 (uninstall-local): Uncomment this rule so `make distcheck' works
7978 * unicodeio.c (<errno.h>): Include it.
7979 (errno): Declare if not defined.
7981 * localcharset.c: Add Bruno's comment justifying use of volatile.
7983 * config.charset: New version, incorporating remarks from a linux
7984 i18n mailing list. From Bruno Haible.
7986 2000-03-02 Jim Meyering <meyering@lucent.com>
7988 * Makefile.am (EXTRA_DIST): Add config.charset.
7990 2000-03-01 Jim Meyering <meyering@lucent.com>
7992 * localcharset.c: Guard some #includes with `#if HAVE_...'.
7993 * unicodeio.c: Likewise.
7995 2000-02-02 Bruno Haible <haible@clisp.cons.org>
7997 * config.charset: New file.
7998 * localcharset.c: New file.
7999 * unicodeio.h, unicodeio.c: New files.
8000 * Makefile.am (DEFS): Add -DLIBDIR=...
8001 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8002 (noinst_HEADERS): Add unicodeio.h.
8003 (all-local, install-exec-local, charset.alias): New targets.
8005 2000-02-28 Paul Eggert <eggert@twinsun.com>
8007 * quotearg.c (ALERT_CHAR): New macro.
8008 (quotearg_buffer_restyled): Use it.
8010 2000-02-27 Jim Meyering <meyering@lucent.com>
8012 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8013 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8015 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8016 not `#if STDC_HEADERS'.
8017 Declare malloc if needed.
8019 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8020 now that autoconf always defines the HAVE_DECL_ symbols.
8021 * human.c: Likewise.
8023 * strtoumax.c: Likewise.
8025 * backupfile.c: Arrange for cpp to fail if the configure-time
8026 declaration check was not run.
8028 * human.c: Likewise.
8030 * strtoumax.c: Likewise.
8032 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8033 then first look up the entire `.'-containing string as a login name.
8035 2000-02-18 Paul Eggert <eggert@twinsun.com>
8037 * getdate.y: Handle two-digit years with leading zeros correctly.
8038 (textint): New typedef.
8039 (parser_control): Member year changed from int to textint.
8041 (YYSTYPE): Removed; replaced by %union with int and textint members.
8042 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8043 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8044 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8045 (tSNUMBER, tUNUMBER): Now of type <textintval>.
8046 (date, number, to_year): Use width of number in digits, not its value,
8047 to determine whether it's a 2-digit year, or a 2-digit time.
8048 (yylex): Store number of digits of numeric tokens.
8049 Reported by John Kendall.
8051 (parser_control): Changed from struct parser_control to typedef (for
8052 consistency). All uses changed.
8054 (tID): Removed; not used.
8055 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8057 2000-02-14 Paul Eggert <eggert@twinsun.com>
8059 * getpagesize.h (getpagesize): Port to VMS for Alpha;
8060 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8062 2000-02-12 Jim Meyering <meyering@lucent.com>
8064 * userspec.c (ISDIGIT): Define it.
8065 (isdigit): Remove definition.
8066 (is_number): Use ISDIGIT, not isdigit.
8067 <libintl.h>: Include.
8069 (parse_user_spec): Mark translatable strings.
8071 2000-02-10 Jim Meyering <meyering@lucent.com>
8073 With these changes, nanosleep.[ch] are finally enough like the other
8074 lib/* replacement files to compile on a few more losing systems.
8076 * nanosleep.h: Don't include config.h.
8077 Remove prototype from declaration of nanosleep.
8078 (PARAMS): Remove now-unneeded definition.
8079 * nanosleep.c: #undef nanosleep.
8080 (rpl_nanosleep): Rename from nanosleep.
8082 2000-02-03 Jim Meyering <meyering@lucent.com>
8084 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8085 rather than with `#if HAVE_UTMPNAME'.
8087 2000-02-01 Jim Meyering <meyering@lucent.com>
8089 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
8091 2000-01-31 Jim Meyering <meyering@lucent.com>
8093 * nanosleep.h (nanosleep): Guard declaration with
8094 `#if ! HAVE_DECL_NANOSLEEP'.
8095 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8096 the declaration in that vendor's sys/timers.h.
8097 Reported by Christian Krackowizer.
8099 * quotearg.c (ISASCII): Add #undef and move definition to follow
8100 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8101 (ISPRINT): Likewise.
8102 Reported by Tom Tromey.
8104 2000-01-30 Jim Meyering <meyering@lucent.com>
8106 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8107 uses of ->ut_name. The latter doesn't work with new Linux header files
8108 where only utmpx.ut_user is declared.
8110 * readutmp.h (UT_USER): Define.
8112 2000-01-23 Jim Meyering <meyering@lucent.com>
8114 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8117 2000-01-22 Jim Meyering <meyering@lucent.com>
8119 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8120 [! HAVE_DECL_STRTOULL]: Declare strtoull.
8121 Required for some AIX systems. Reported by Christian Krackowizer.
8122 [TESTING] (main): New function.
8124 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
8125 * dirname.c (dir_name): Support for DOS-style file names with drive
8128 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8130 * strverscmp.c (ISDIGIT): Define.
8131 (strverscmp): Use ISDIGIT, not isdigit.
8133 2000-01-17 Paul Eggert <eggert@twinsun.com>
8135 * nanosleep.c (nanosleep):
8136 Don't use SA_INTERRUPT to decide whether to call sigaction, as
8137 POSIX.1 doesn't require SA_INTERRUPT and some systems
8138 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
8139 it's been part of POSIX.1 since day 1 (in 1988).
8141 2000-01-17 Jim Meyering <meyering@lucent.com>
8143 * interlock: Remove unused file. Reported by François Pinard.
8145 2000-01-16 Paul Eggert <eggert@twinsun.com>
8147 * quotearg.c (quotearg_buffer_restyled): Do not quote
8148 alert, backslash, formfeed, and vertical tab unnecessarily in
8149 shell quoting style.
8152 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
8153 Free Software Foundation, Inc.
8154 Copying and distribution of this file, with or without modification,
8155 are permitted provided the copyright notice and this notice are preserved.