7034ebdfbfe27af350b88d30a17806a306ccaa4d
[pspp] / lib / ChangeLog
1 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * regcomp.c (create_initial_state): Remove duplicate decl.
4         (init_word_char, create_initial_state, duplicate_node_closure):
5         (fetch_token, peek_token_bracket, build_range_exp):
6         (build_collating_symbol): Remove forward decls; no longer needed
7         now that we use prototypes.
8
9         * regcomp.c:
10         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
11         (re_compile_fastmap_iter, regcomp, regerror, regfree):
12         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
13         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
14         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
15         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
16         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
17         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
18         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
19         (build_range_exp, build_collating_symbol, parse_bracket_exp):
20         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
21         (build_charclass, build_charclass_op, fetch_number, create_tree):
22         (create_token_tree, mark_opt_subexp, duplicate_tree):
23         Use prototypes rather than old-style definitions.
24
25         * regex_internal.c:
26         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
27         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
28         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
29         (re_string_reconstruct, re_string_peek_byte_case):
30         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
31         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
32         (re_node_set_init_copy, re_node_set_add_intersect):
33         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
34         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
35         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
36         (re_acquire_state, re_acquire_state_context, register_state):
37         (create_ci_newstate, create_cd_newstate, free_state):
38         Likewise.
39         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
40         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
41         (re_search_internal, prune_impossible_nodes):
42         (acquire_init_state_context, check_matching, static):
43         (check_halt_node_context, check_halt_state_context, proceed_next_node):
44         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
45         (update_regs, sift_states_backward, build_sifted_states):
46         (clean_state_log_if_needed, merge_state_array):
47         (update_cur_sifted_state, add_epsilon_src_nodes):
48         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
49         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
50         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
51         (find_recover_state, check_subexp_matching_top, transit_state_mb):
52         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
53         (check_arrival, check_arrival_add_next_nodes):
54         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
55         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
56         (check_node_accept_bytes, check_node_accept, extend_buffers):
57         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
58         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
59         (sift_ctx_init):
60         Likewise.
61
62         * regex_internal.h:
63         (re_string_allocate, re_string_construct, re_string_reconstruct):
64         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
65         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
66         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
67         (re_string_context_at, re_string_peek_byte_case):
68         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
69         is defined, since we now use prototypes always.
70
71         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
72         C89 or better.  All uses removed.
73
74 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
75
76         * regex_internal.c (re_acquire_state, re_acquire_state_context)
77         [defined lint]: Suppress bogus uninitialized-variable warnings.
78
79         * regcomp.c (duplicate_node): Return new index, not an error code,
80         and let the caller return REG_ESPACE if out of space.  This
81         removes an uninitialied-variable warning with GCC 4.0.1, and also
82         avoids taking the address of a local variable.  All callers
83         changed.
84
85 2005-08-19  Jim Meyering  <jim@meyering.net>
86
87         * regexec.c (proceed_next_node): Redo local variables to
88         avoid GCC shadowing warnings.
89
90 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
91
92         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
93         (re_node_set_insert_last, re_dfa_add_node):
94         Rename local variables to avoid GCC shadowing warnings.
95
96 2005-08-18  Bruno Haible  <bruno@clisp.org>
97
98         * strstr.c (strstr): Fix return value in multibyte case.
99         * strcasestr.c (strcasestr): Likewise.
100
101 2005-08-17  Jim Meyering  <jim@meyering.net>
102
103         Make the %s format (seconds since the epoch) work for a negative
104         number and when used with a zero-padded field width, e.g. %015s.
105
106         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
107         label so that it precedes the code to set `digits'.  Otherwise,
108         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
109         print `00-22'.  Now, it prints `-0022', as it should.
110
111 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
112
113         * regex.h: Remove useless space-before-tab.  From coreutils.
114
115 2005-08-17  Bruno Haible  <bruno@clisp.org>
116
117         * strcasestr.h: New file.
118         * strcasestr.c: New file.
119
120 2005-08-17  Bruno Haible  <bruno@clisp.org>
121
122         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
123         * strstr.c: Completely rewritten, with multibyte locale support.
124
125 2005-08-17  Bruno Haible  <bruno@clisp.org>
126
127         * strcasecmp.c: Use mbuiter.h.
128
129 2005-08-17  Bruno Haible  <bruno@clisp.org>
130
131         * mbuiter.h: New file.
132
133 2005-08-16  Bruno Haible  <bruno@clisp.org>
134
135         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
136         (mbi_init): Update.
137         (mbi_avail, mbi_advance): Let the iteration end before the terminating
138         NUL byte, not after it.
139
140 2005-08-16  Bruno Haible  <bruno@clisp.org>
141
142         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
143         the valid ones. Makes the comparison operations transitive:
144         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
145         * strcasecmp.c (strcasecmp): Use mb_casecmp.
146
147 2005-08-16  Bruno Haible  <bruno@clisp.org>
148
149         * strcase.h (strcasecmp): Add note in comments.
150         * strncasecmp.c: Use code from strcasecmp.c.
151         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
152         (strcasecmp): Work correctly in multibyte locales.
153
154 2005-08-16  Bruno Haible  <bruno@clisp.org>
155
156         * strnlen1.h: New file.
157         * strnlen1.c: New file.
158
159 2005-08-16  Bruno Haible  <bruno@clisp.org>
160
161         * mbfile.h: New file.
162
163 2005-08-16  Bruno Haible  <bruno@clisp.org>
164
165         * mbiter.h: New file.
166
167 2005-08-16  Bruno Haible  <bruno@clisp.org>
168
169         * mbchar.h: New file.
170         * mbchar.c: New file.
171
172 2005-08-16  Bruno Haible  <bruno@clisp.org>
173
174         * tls.h: New file, from GNU gettext.
175         * tls.c: New file, from GNU gettext.
176
177 2005-08-15  Bruno Haible  <bruno@clisp.org>
178
179         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
180         is defined.
181
182 2005-08-14  Jim Meyering  <jim@meyering.net>
183
184         Sync from coreutils.
185
186         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
187         Use the hash-table-based cycle-detection code not just when
188         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
189         Reported by James Youngman in
190         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
191         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
192         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
193         This lets us compile with -DFTS_DEBUG, once again.
194         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
195         * fts.c (fd_safer): Remove decl.
196         Include fcntl--.h rather than unistd-safer.h
197         (fts_safe_changedir): Don't call fd_safer; no longer needed
198         now that we include fcntl--.h.
199
200 2005-08-11  Simon Josefsson  <jas@extundo.com>
201
202         * readline.h, readline.c: New file.
203
204 2005-08-11  Bruno Haible  <bruno@clisp.org>
205
206         * strnlen.h (strnlen): Change parameter name to match comment.
207
208 2005-08-10  Simon Josefsson  <jas@extundo.com>
209
210         * strndup.c: Use strnlen.h.
211
212         * strnlen.h: New file.
213
214 2005-08-02  Simon Josefsson  <jas@extundo.com>
215
216         * getline.h, getline.c: Rewrite.
217
218         * getdelim.h, getdelim.c: New files, ported from glibc.
219
220 2005-07-31  Bruno Haible  <bruno@clisp.org>
221
222         * lock.h (gl_lock_initializer): New macro.
223         (gl_lock_define_initialized): Use it.
224         (gl_rwlock_initializer): New macro.
225         (gl_rwlock_define_initialized): Use it.
226         (gl_recursive_lock_initializer): New macro.
227         (gl_recursive_lock_define_initialized): Use it.
228
229 2005-07-26  Bruno Haible  <bruno@clisp.org>
230
231         * lock.h: Update from GNU gettext.
232         * lock.c: Update from GNU gettext.
233
234 2005-07-18  Bruno Haible  <bruno@clisp.org>
235
236         * lock.h (gl_once_t): New type.
237         (gl_once_define, gl_once): New macros.
238         * lock.c (fresh_once): New variable.
239         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
240         functions.
241
242 2005-07-18  Simon Josefsson  <jas@extundo.com>
243
244         * check-version.c (check_version): Accept identical versions too.
245
246 2005-07-18  Bruno Haible  <bruno@clisp.org>
247
248         * lock.h: New file, from GNU gettext.
249         * lock.c: New file, from GNU gettext.
250
251 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
252
253         * quotearg.c: Add translator comment suggested by Bruno Haible,
254         with a minor change.
255
256 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
257
258         * version-etc-fsf.c (version_etc_copyright): Parameterize the
259         copyright symbol and the year.
260         * version-etc.c (COPYRIGHT_YEAR): New constant.
261         (version_etc_va): Use parameterized copyright notice.
262         Reword to conform to the current GNU coding standards.
263
264 2005-07-11  Simon Josefsson  <jas@extundo.com>
265
266         * size_max.h: New file.
267
268 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
269
270         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
271         block of defines.
272
273 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
274        and  Paul Eggert  <eggert@cs.ucla.edu>
275
276         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
277         in wint_t, not wchar_t.  Remove now-unnecessary cast.
278
279 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
280
281         * regex.c, regex.h: Sync from libc.
282         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
283         New files, synced from libc, except that regex_internal.h
284         currently has a small porting fix.
285
286 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
287
288         Remove the dependency of the strftime module on the tzset module.
289         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
290         Copy the input structure, to work around some of the bug with
291         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
292         Solaris releases, you should also use the tzset module, but we won't
293         require it as a dependency any more since we don't want LGPLed code
294         to depend on GPLed code.
295
296 2005-07-02  Jim Meyering  <jim@meyering.net>
297
298         * backupfile.c (backup_args): Change a `0' to NULL.
299
300 2005-07-01  Jim Meyering  <jim@meyering.net>
301
302         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
303         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
304         * save-cwd.c, tempname.c:
305         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
306         and don't include <sys/file.h>).
307
308 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
309
310         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
311         declares only 'struct timespec;' (!).
312
313 2005-06-29  Jim Meyering  <jim@meyering.net>
314
315         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
316         type name.  Use the variable name instead.
317         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
318
319 2005-06-28  Simon Josefsson  <jas@extundo.com>
320
321         * check-version.h, check-version.c: New files.
322
323 2005-06-28  Simon Josefsson  <jas@extundo.com>
324
325         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
326         collision with global variable.  Better indentation.  Don't
327         increment buffer pointer beyond buffer end.  Based on comments
328         from Paul Eggert <eggert@cs.ucla.edu>.
329
330         * base64.h: Indent.
331
332 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
333
334         * canon-host.c (canon-host): Append trailing "," to 0 in
335         initializer of struct addrinfo, as an indication that we don't
336         care how many members the structure has.
337
338 2005-06-24  Derek Price  <derek@ximbiot.com>
339         and Bruno Haible  <bruno@clisp.org>
340
341         Remove stat module & update lstat.
342         * stat.c: Remove this file...
343         (slash_aware_lstat): ...moving this content and its support...
344         * lstat.c (rpl_lstat): ...into here.
345         * lstat.h: New file.
346
347 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
348
349         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
350         (ranged_convert): Don't save conversion in a temporary struct.
351         This causes a warning with GCC 4.0.0, and anyway in the typical
352         case it's not worth the extra 100 bytes or so of code.
353         (ranged_convert, __mktime_internal): When calling a function via a
354         pointer P, use P () rather than (*P) (), as we now assume C89 or
355         better.
356
357 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
358
359         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
360         "who -r" failed to give output.  Problem reported by Tim Waugh.
361
362         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
363         (xcalloc): Use it to avoid needless tests.
364         Problem reported by Jim Meyering.
365
366 2005-06-16  Jim Meyering  <jim@meyering.net>
367
368         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
369         when either N or S is zero.
370
371 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
372
373         * argp.h (__option_is_short): Check upper limit of
374         __key. Isprint() requires its argument to have the value
375         of an unsigned char or EOF.
376
377 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
378
379         * fnmatch.c (fnmatch): If there is an encoding error in a
380         multibyte string or pattern, fall back on unibyte matching.
381         Problem reported by James Youngman.
382
383 2005-06-08  Bruno Haible  <bruno@clisp.org>
384
385         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
386         warning on mingw.
387
388 2005-06-08  Bruno Haible  <bruno@clisp.org>
389
390         * csharpcomp.h: New file, from GNU gettext.
391         * csharpcomp.c: New file, from GNU gettext.
392         * csharpcomp.sh.in: New file, from GNU gettext.
393
394 2005-06-07  Derek Price  <derek@ximbiot.com>
395
396         Sync from CVS.
397         * glob_.h: Indent nested #ifdef.
398
399 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
400
401         Sync from coreutils.
402         Use "file name" when talking about file names, instead of "filename"
403         or "path", as per the GNU coding standards.
404         * mkdir-p.c: Renamed from makepath.c.
405         (make_dir_parents): Renamed from make_path.  All callers changed.
406         * mkdir-p.h: Likewise.  All includers changed.
407         * filenamecat.c: Renamed from path-concat.c.
408         (file_name_concat): Renamed from path_concat.  All callers changed.
409         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
410         * filenamecat.h: Likewise.  All includers changed.
411         * acl.c: Don't use "path" or "filename" to mean "file name"
412         in comments or local variable names.
413         * basename.c: Likewise.
414         * canonicalize.c, canonicalize.h: Likewise.
415         * dirname.c, dirname.h: Likewise.
416         * euidaccess.c: Likewise.
417         * exclude.c: Likewise
418         * fnmatch_.h, fnmatch_loop.c: Likewise.
419         * fsusage.c, fsuage.h: Likewise.
420         * fts.c, fts_.h: Likewise.
421         * getcwd.c: Likewise.
422         * getloadavg.c: Likewise.
423         * mkstemp.c: Likewise.
424         * mountlist.c, mountlist.h: Likewise.
425         * openat.c, openat.h: Likewise.
426         * readlink-stub.c: Likewise.
427         * readutmp.c, readutmp.h: Likewise.
428         * rename.c: Likewise.
429         * rmdir.c: Likewise.
430         * same.c: Likewise.
431         * savedir.c: Likewise.
432         * stripslash.c: Likewise.
433         * tempname.c: Likewise.
434         * xreadlink.c: Likewise.
435         * exclude.c (excluded_file_name): Renamed from excluded_filename.
436         All uses changed.
437         * exclude.h: Likewise.
438
439         * euidaccess.c (getuid, getgid, getuid, getegid)
440         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
441         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
442         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
443         * pathmax.h: Include <limits.h> unconditionally, since other
444         files have been getting away with it for years (MORE/BSD 4.3
445         is extinct now).
446         * userspec.c (getpwnam, getgrnam, getgrgid)
447         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
448
449         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
450         Define to 256, not 255, as per modern POSIX.
451
452 2005-06-01  Bruno Haible  <bruno@clisp.org>
453
454         * csharpexec.h: New file, from GNU gettext.
455         * csharpexec.c: New file, from GNU gettext.
456         * csharpexec.sh.in: New file, from GNU gettext.
457
458 2005-05-31  Derek Price  <derek@ximbiot.com>
459             Paul Eggert  <eggert@cs.ucla.edu>
460
461         Sync from cvs.
462         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
463
464 2005-05-29  Derek Price  <derek@ximbiot.com>
465             Paul Eggert  <eggert@cs.ucla.edu>
466
467         * glob_.h, glob.c: New files.
468
469 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
470
471         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
472
473         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
474         the configuration hassle isn't worth it.
475         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
476         (LONGEST_MODIFIER, PRIuMAX): Remove.
477
478 2005-05-27  Bruno Haible  <bruno@clisp.org>
479
480         * getlogin_r.h: Remove second include of <stddef.h>.
481
482 2005-05-25  Bruno Haible  <bruno@clisp.org>
483             Derek Price  <derek@ximbiot.com>
484
485         * getlogin_r.h: Simplify API documentation.
486
487 2005-05-25  Derek Price  <derek@ximbiot.com>
488             Paul Eggert  <eggert@cs.ucla.edu>
489
490         * getlogin_r.c, getlogin_r.h: New files.
491
492 2005-05-22  Bruno Haible  <bruno@clisp.org>
493
494         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
495         Also include <sys/param.h> if it defines MIN, MAX.
496         Based on a patch by Derek Price <derek@ximbiot.com>.
497
498 2005-05-22  Bruno Haible  <bruno@clisp.org>
499
500         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
501         (INT64_MIN): Fix definition.
502         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
503
504         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
505         NEED_SIGNED_INT_TYPES.
506
507         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
508         HAVE_SYSTEM_INTTYPES.
509
510 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
511
512         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
513         so that unistd-safer.h (GPL'ed code) need not be included.
514
515 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
516
517         New fts module.
518         * fts.c: Don't include "cycle-check.h" or "hash.h".
519         (setup_dir, free_dir): New functions.
520         (enter_dir, leave_dir): Define trivial
521         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
522         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
523         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
524         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
525         Move to fts-cycle.c.
526         (fts_open): Use setup_dir.
527         (fts_close): Use free_dir.
528         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
529         This adds a label and some gotos, but the alternatives were messier.
530         Check for memory allocation failure when entering a dir.
531         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
532         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
533         (FTS): New member fts_cycle, that is a union that contains the
534         old active_dir_ht and cycle_state.  All uses changed to mention
535         fts_cycle.ht and fts_cycle.state.
536         * fts-cycle.c: New file, containing GPL'ed code migrated out of
537         fts.c, with the following changes:
538         (setup_dir, free_dir): New functions.
539         (enter_dir): Now returns bool.  Return true if successful, false
540         if memory exhausted.  All callers changed.
541         Do not bother partly cleaning up on
542         memory allocation failure; that is free_dir's job.
543         However, free ad if hash_insert fails, to avoid memory leak.
544         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
545         fts->fts_options to see which union member to use.
546
547 2005-05-20  Jim Meyering  <jim@meyering.net>
548
549         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
550         Now a macro, to pacify GCC.
551
552 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
553
554         * chown.c (rpl_chown): Return -1 on failure.
555
556 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
557
558         * canonicalize.c: Include canonicalize.h first, to test interface.
559         Include <stddef.h> unconditionally, since we assume C89 now.
560         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
561         * fts.c: Include fts_.h first, to check interface.
562         Do not include intprops.h; no longer needed.
563         Include cycle-check.h and hash.h, since fts_.h no longer does.
564         Remove unnecessary casts of closedir to void.
565         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
566         decide whether to decrement nlinks.
567         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
568         (FTS): Use struct hash_table * instead of Hash_table, so that
569         we no longer need to include hash.h here.
570
571 2005-05-17  Jim Meyering  <jim@meyering.net>
572
573         * fts.c, fts_.h: New files, from coreutils.
574
575 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
576
577         Sync from coreutils.
578         * unlinkdir.c, unlinkdir.h: New files.
579         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
580         regex.h, unlocked-io.h, xtime.h:
581         White space changes only.
582         * makepath.c (make_path): Port to hosts where leading "//" is special.
583         * yesno.c: Include getline.h, not ctype.h.
584         (yesno): Don't remove leading white space; POSIX doesn't allow it.
585         Use getline to remove arbitrary restriction on response length.
586
587 2005-05-13  Bruno Haible  <bruno@clisp.org>
588
589         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
590         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
591         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
592         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
593         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
594         Add support for 64-bit integers in the MSVC compiler.
595
596 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
597
598         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
599         Change the initial comment to refer to GPL, not LGPL.
600         gnulib-tool will change it to LGPL as needed.
601
602         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
603         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
604         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
605         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
606         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
607         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
608         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
609         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
610         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
611         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
612         concatpath.c, config.charset, copy-file.c, copy-file.h,
613         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
614         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
615         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
616         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
617         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
618         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
619         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
620         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
621         full-read.c, full-read.h, full-write.c, full-write.h,
622         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
623         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
624         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
625         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
626         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
627         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
628         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
629         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
630         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
631         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
632         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
633         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
634         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
635         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
636         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
637         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
638         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
639         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
640         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
641         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
642         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
643         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
644         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
645         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
646         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
647         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
648         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
649         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
650         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
651         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
652         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
653         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
654         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
655         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
656         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
657         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
658         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
659         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
660         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
661         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
662         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
663         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
664         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
665         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
666         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
667         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
668         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
669         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
670         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
671         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
672         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
673         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
674         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
675         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
676         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
677         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
678         Update FSF postal mail address.
679
680 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
681
682         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
683         specified in ai_socktype. Fix invalid ai_protocol
684         check. ai_protocol is usually set to 0 or depending on
685         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
686         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
687         ai_socktype / ai_protocol in the returned addrinfo structure.
688
689 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
690             Bruno Haible  <bruno@clisp.org>
691
692         * inet_ntop.h: New file.
693         * inet_ntop.c: New file, from glibc with modifications.
694
695 2005-05-08  Jim Meyering  <jim@meyering.net>
696
697         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
698
699 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
700
701         Merge from coreutils.  Among other things,
702         add bulletproofing for cases where stdin, stdout, or stderr are closed.
703         * fd-safer.c: New file.
704         * fcntl-safer.h, open-safer.c: Remove.
705         * chdir-long.c: Fix comment "fetish" -> "coreutils".
706         * dup-safer.c: Include unistd-safer.h first.
707         Don't include errno.h.
708         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
709         * file-type.h: Don't assume invoker included sys/stat.h first.
710         * file-type.c: Rely on file-type.h change.
711         * getloadavg.c: Include unistd-safer.h.
712         (getloadavg): Use safer open.
713         * getusershell.c: Include "stdio-safer.h".
714         (getusershell): Use safer fopen.
715         * long-options.c (long_options): Use NULL rather than 0.
716         * modechange.h (mode_free): Remove; all callers changed to invoke
717         'free'.
718         * modechange.c: Likewise.
719         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
720         (MODE_DONE): New constant.
721         (struct mode_change): Remove 'next' member.
722         (make_node_op_equals): New function; like the old one of the
723         same name, except it allocates an array.
724         (mode_compile, mode_create_from_ref): Use it.
725         (mode_compile): Allocate result as an array, not a linked list.
726         Parse octal string ourself, so that we catch mistakes like "+0".
727         (mode_adjust): Arg is an array, not a linked list.
728         * modechange.c: Include stat-macros.h, xalloc.h.
729         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
730         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
731         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
732         Remove.  This is now stat-macros.h's job.
733         (talloc): Remove.  All callers replaced by xalloc, so that
734         our invokers don't have to worry about reporting memory failures.
735         (make_node_op_equals): Remove.
736         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
737         New constants.
738         (struct mode_change): Moved here from modechange.h.
739         (mode_append_entry): Remove.
740         (mode_compile): Remove MASKED_OPS arg, since it encouraged
741         apps to have incorrect behavior.  Use simpler algorithm for head
742         and tail.  Don't futz with umask; that's now the job of mode_adjust.
743         Detect more invalid usages rather than having somewhat-random behavior.
744         Don't insert an "a=" action, as that leads to incorrect behavior.
745         (mode_compile, mode_create_from_ref): Return NULL on error instead
746         of an enum, since now there's only one way to have an error.  All
747         callers changed.
748         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
749         at the correct time.  Simplify calculation of "+u" and its ilk.
750         Don't mishandle "+X".
751         (mode_free): Remove "register" and localize decls.
752         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
753         (struct mode_change): Move to modechange.c; callers don't
754         need to see this stuff.
755         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
756         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
757         (mode_change, mode_adjust): Reflect the new signatures noted above.
758         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
759         that might redefine system include files.
760         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
761         (my_usleep): Use NULL rather than (void *) 0.
762         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
763         Use siginterrupt to specify that system calls should be interrupted.
764         (rpl_nanosleep): Move initialization of suspended closer to call of
765         my_usleep.
766         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
767         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
768         (desirable_utmp_entry): New function.
769         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
770         using x2nrealloc, to simplify logic.
771         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
772         size calculation.  Do not assume utmp file is a regular file.
773         * readutmp.h (UT_PID): Moved here from ../src/who.c.
774         (READ_UTMP_CHECK_PIDS): New constant.
775         * save-cwd.c: Include unistd-safer.h.
776         (save_cwd): Use fd_safer.
777         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
778         [!_LIBC] Include "stat-macros.h" instead.
779         * unistd-safer.h (fd_safer): New decl.
780
781 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
782
783         * byteswap_.h: New file.
784
785 2005-04-25  Albert Chin  <china@thewrittenword.com>
786
787         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
788         Toolkit C bug.
789
790 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
791
792         * getdate.y (zone): Allow relunit_snumber after tZONE, so
793         that "UTC +1 second" continues to work.  Problem reported
794         by Dmitry V. Levin.
795         (relunit_snumber): New rule.
796         (relunit): Use it.
797
798 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
799
800         * getdate.y (universal_time_zone_table): New constant.
801         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
802         universal_time_zone_table.
803         (lookup_zone): Prefer universal_time_zone_table to
804         local_time_zone_table, so that "GMT" time stamps are allowed in
805         London during the summer.  Problem reported by Ian Abbott.
806
807 2005-04-12  Jim Meyering  <jim@meyering.net>
808
809         * human.c (humblock): Set *options even when returning due to
810         xstrtoumax conversion failure.  Thanks to a used-uninitialized
811         warning from gcc-4.
812
813 2005-04-09  Jim Meyering  <jim@meyering.net>
814
815         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
816         -Wuninitialized: initialize tm0.tm_year.
817
818 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
819
820         * getdate.y (parser_control): rels_seen is now a boolean, not a
821         count, since there's no maximum.  All uses changed.
822         Add member dsts_seen.
823         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
824         not being INT_MAX.
825         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
826         Use pc_rels_seen to decide whther a date is absolute.
827
828         * getdate.y (number): Don't overwrite year.
829         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
830         check.
831
832 2005-04-02  Simon Josefsson  <jas@extundo.com>
833
834         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
835         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
836
837 2005-03-27  Jim Meyering  <jim@meyering.net>
838
839         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
840
841 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
842
843         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
844         "one's complement" -> "ones' complement" in comment, as per Knuth.
845         "value of type" -> "type or expression" in comment.
846         * mktime.c, strftime.c: Propagate intprops.h comment nits.
847
848 2005-03-26  Jim Meyering  <jim@meyering.net>
849
850         Comment nits.
851         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
852         Correct typos: s/or/of/.
853
854 2005-03-23  Jim Meyering  <jim@meyering.net>
855
856         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
857
858 2005-03-21  Jim Meyering  <jim@meyering.net>
859
860         Changes imported from coreutils.
861
862         * cycle-check.c: Don't include xalloc.h.
863
864         * path-concat.c: Don't include assert.h.
865         (path_concat): Remove assertion that would have triggered
866         for ABASE starting with more than one slash.
867         Reported by Andreas Schwab.
868
869         * path-concat.c (path_concat): Set *BASE_IN_RESULT
870         properly when ABASE is an absolute file name.
871         Correct the description of this function.
872         Include <assert.h>.
873         Add an assertion and a test driver.
874         This fixes a bug introduced on 2004-07-02.
875         Andreas Schwab reported the resulting failure of cp --parents:
876         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
877
878 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
879
880         * strftime.c (my_strftime): If the underlying strftime returns 0
881         (which shouldn't happen), generate nothing instead of returning 0
882         immediately, so that nstrftime (NULL, ...) doesn't return 0.
883
884 2005-03-16  Bruno Haible  <bruno@clisp.org>
885
886         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
887
888 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
889
890         * strftime.c (my_strftime): Prepend space to format so that we can
891         reliably distinguish strftime failure from empty output on POSIX
892         hosts.
893
894 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
895
896         * iconvme.c (SIZE_MAX): New macro, if not already defined.
897         (iconv_string): Don't guess a size-zero buffer, as that might cause
898         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
899         result would be 'too large', where 'too large' is (heuristically)
900         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
901         overflow concerns.  This will prevent some unwanted malloc failures
902         when the inputs are very large.
903
904 2005-03-15  Bruno Haible  <bruno@clisp.org>
905
906         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
907         'negate'.
908
909         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
910         variable.
911
912         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
913
914 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
915
916         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
917         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
918         intprops.h.
919         * strtol.c: Likewise.
920
921 2005-03-14  Simon Josefsson  <jas@extundo.com>
922
923         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
924         <fx@gnu.org>.
925
926 2005-03-14  Jim Meyering  <jim@meyering.net>
927
928         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
929         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
930         to be nonzero so that we (and caller) can detect the difference
931         between a valid zero-length expansion and an error return, even
932         when the underlying strftime fails before writing anything into
933         that location.
934
935 2005-03-10  Jim Meyering  <jim@meyering.net>
936
937         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
938         so that this module works on systems without fchdir.
939
940 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
941
942         Factor int-properties macros into a single file, except for
943         glibc-related files.
944         * intprops.h: New file.
945         * getloadavg.c: Include it instead of limits.h.
946         (INT_STRLEN_BOUND): Remove.
947         * human.c: Include intprops.h.
948         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
949         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
950         * inttostr.h: Include intprops.h instead of limits.h.
951         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
952         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
953         for consistency with intprops.h.
954         (time_t_is_integer, twos_complement_arithmetic): Use them.
955         * sig2str.h: Include <signal.h>, intprops.h.
956         (INT_STRLEN_BOUND): Remove.
957         * strftime.c (TYPE_SIGNED): Remove.
958         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
959         * strtol.c: Adjust comments to match intprops.h.
960         * userspec.c: Include intprops.h.
961         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
962         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
963         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
964         instead of rolling our own expressions.
965         * xstrtol.c: Include xstrtol.h first, to test interface.
966
967         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
968         instead of int.
969         (my_strftime): Do not mishandle years close to INT_MAX, by doing
970         the right thing even if adding 1900 would overflow.  Similarly
971         for tm_mon + 1 and tm_yday + 1.
972         Make %Y always equivalent to %C%y, and similarly for %G and %g.
973         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
974         (DO_SIGNED_NUMBER): New macro.
975         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
976
977 2005-03-07  Bruno Haible  <bruno@clisp.org>
978
979         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
980
981 2005-03-03  Derek R. Price  <derek@ximbiot.com>
982             Bruno Haible  <bruno@clisp.org>
983
984         * pagealign_alloc.h: New file.
985         * pagealign_alloc.c: New file.
986
987 2005-01-28  Bruno Haible  <bruno@clisp.org>
988
989         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
990         stpncpy.c uses it.
991
992 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
993
994         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
995         The workaround isn't strictly needed for POSIX conformance, and
996         it's too much of a pain to configure and maintain.  We'll ask
997         people to fix their kernels instead.
998         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
999         (NANOSLEEP_BUG_WORKAROUND): Remove.
1000         (xnanosleep): Remove the workaround.
1001
1002 2005-02-12  Bruno Haible  <bruno@clisp.org>
1003
1004         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
1005
1006 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
1007
1008         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
1009         * timespec.h (gettime): Return void, since it always
1010         succeeds now.  All uses changed.
1011         * gettime.c (gettime) Likewise.
1012         [HAVE_NANOTIME]: Prefer nanotime.
1013         Assume gettimeofday succeeds, as POSIX requires.
1014         Assime time () succeeds, since other code already does.
1015         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
1016         (timespec_subtract): Remove.
1017         (NANOSLEEP_BUG_WORKAROUND): New constant.
1018         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
1019         things considerably.  Use it only on GNU/Linux hosts, since the
1020         workaround shouldn't be needed elsewhere.
1021
1022 2005-02-24  Bruno Haible  <bruno@clisp.org>
1023
1024         * gettext.h: Update from GNU gettext 0.14.2.
1025
1026 2005-02-24  Bruno Haible  <bruno@clisp.org>
1027
1028         * localcharset.c: Update from GNU gettext 0.14.2.
1029         * config.charset: Update from GNU gettext 0.14.2.
1030
1031 2005-02-22  Simon Josefsson  <jas@extundo.com>
1032
1033         * iconvme.h, iconvme.c: New files, from libc.
1034
1035 2005-02-20  Neil Conway  <neilc@samurai.com>
1036
1037         * xgethostname.c (xgethostname): Check for ENOMEM, which is
1038         returned by OSX/Darwin if the specified buffer is not large
1039         enough for the hostname.
1040
1041 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
1042
1043         * memrchr.h: New file.
1044         * chdir-long.c: Include it.
1045         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
1046         Don't bother including stddef.h.
1047
1048 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1049
1050         * argp-help.c (__argp_help): Create a fake struct argp_state and
1051         pass it to _help, otherwise the latter coredumps trying to
1052         dereference state.root_argp.
1053
1054 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
1055
1056         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
1057         inclusion.
1058         Include <sys/types.h>, for dev_t.
1059         (ME_DUMMY, ME_REMOTE): Move from here....
1060         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
1061         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
1062         Dmitry V. Levin.
1063         Include mountlist.h first, to test the interface.
1064
1065 2005-01-29  Bruno Haible  <bruno@clisp.org>
1066
1067         * progname.c (program_name): Initialize.
1068         Needed when linking statically on MacOS X.
1069
1070 2005-01-28  Bruno Haible  <bruno@clisp.org>
1071
1072         * javacomp.sh.in: New file, from GNU gettext.
1073         * javacomp.h: New file, from GNU gettext.
1074         * javacomp.c: New file, from GNU gettext.
1075
1076 2005-01-26  Bruno Haible  <bruno@clisp.org>
1077
1078         * javaexec.sh.in: New file, from GNU gettext.
1079         * javaexec.h: New file, from GNU gettext.
1080         * javaexec.c: New file, from GNU gettext.
1081
1082 2005-01-26  Simon Josefsson  <jas@extundo.com>
1083
1084         * gai_strerror.c: Use GPL in header.
1085
1086 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1087
1088         * argp-help.c (hol_entry_help): Avoid using non-constant
1089         initializers for struct pentry_state.
1090         (__argp_error): Check return value of __asprintf
1091         (__argp_failure): Translate error message
1092
1093         * argp-parse.c: Removed braces around the expansion of N_()
1094
1095 2005-01-21  Jim Meyering  <jim@meyering.net>
1096
1097         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
1098         same value as for Solaris 9.
1099
1100         * chdir-long.c (chdir_long): Rewrite to remove limitation on
1101         component length.  This included changing the parameter to be
1102         of type `char *' rather than `char const *'.
1103         * chdir-long.h (chdir_long): Update prototype.
1104
1105         * openat.c (fdopendir, fstatat): New functions.
1106         * openat.h: Include headers required for use of DIR and struct stat.
1107         [AT_SYMLINK_NOFOLLOW]: Define.
1108         (fdopendir, fstatat): Add prototypes.
1109
1110 2005-01-21  Bruno Haible  <bruno@clisp.org>
1111
1112         * classpath.h: New file, from GNU gettext.
1113         * classpath.c: New file, from GNU gettext.
1114
1115 2005-01-20  Simon Josefsson  <jas@extundo.com>
1116
1117         * version-etc-fsf.c: New file, with version_etc_copyright.
1118         * version-etc.c: Remove version_etc_copyright.
1119         * version-etc.h (version_etc_copyright): Use [] instead of * in
1120         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
1121
1122 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
1123
1124         * save-cwd.c (save_cwd): Remove code to support the case
1125         where fchdir is missing or flaky.
1126
1127 2005-01-20  Simon Josefsson  <jas@extundo.com>
1128
1129         * base64.h (isbase64): Add.
1130
1131         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
1132         using a unsigned prototype, don't inline.
1133         (base64_decode): Use it.
1134
1135 2005-01-19  Bruno Haible  <bruno@clisp.org>
1136
1137         * sh-quote.h: New file, from GNU gettext.
1138         * sh-quote.c: New file, from GNU gettext.
1139
1140 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
1141
1142         Merge changes from coreutils, as described below in several
1143         changelogs dated today.
1144
1145         * save-cwd.c: Include "save-cwd.h" before other include files.
1146         (O_DIRECTORY): Remove; not needed here, since "." must be
1147         a directory.  All uses removed.
1148         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
1149         universal on Suns, and we also need to test for IRIX.
1150         Revamp code to use 'if' rather than '#if'.
1151         Avoid unnecessary comparison of cwd->desc to 0.
1152
1153         * utimens.c (futimens): Robustify the previous patch, by checking
1154         for known valid error numbers rather than observed invalid ones.
1155
1156 2005-01-18  Jim Meyering  <jim@meyering.net>
1157
1158         * version-etc.c (version_etc_copyright): Update copyright date.
1159
1160         * utimens.c (futimens): Account for the fact that futimes
1161         can also fail with errno == ENOSYS or errno == ENOENT.
1162         Patch from Dmitry V. Levin.
1163
1164         Change the name of the robust chdir function from chdir to chdir_long.
1165         * save-cwd.c: Include chdir-long.h rather than chdir.h.
1166         (restore_cwd): Use chdir_long, not chdir.
1167         * chdir-long.c: Renamed from chdir.c.
1168         * chdir-long.h: Renamed from chdir.h.
1169         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
1170         Hurd.
1171
1172 2005-01-18  Bob Proulx  <bob@proulx.com>
1173
1174         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
1175         offsetof() macro construct to avoid compile failure with native HP-UX
1176         11.0 ANSI C compiler.
1177
1178 2005-01-06  Bruno Haible  <bruno@clisp.org>
1179
1180         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
1181         because stpncpy.m4 takes care of it.
1182
1183 2004-01-24  Bruno Haible  <bruno@clisp.org>
1184
1185         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
1186
1187 2003-10-09  Bruno Haible  <bruno@clisp.org>
1188
1189         * progreloc.c: Include xalloc.h instead of xmalloc.h.
1190
1191 2005-01-06  Bruno Haible  <bruno@clisp.org>
1192
1193         * fwriteerror.h (fwriteerror): Change specification to include fclose.
1194         * fwriteerror.c: Include <stdbool.h>.
1195         (fwriteerror): At the end, close the file stream. Record whether
1196         stdout was already closed.
1197
1198 2004-05-27  Bruno Haible  <bruno@clisp.org>
1199
1200         * execute.c (environ): Declare if needed.
1201         * pipe.c (environ): Likewise.
1202         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
1203
1204 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1205
1206         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
1207         definitions to be after all include files, to avoid collisions.
1208         Problem reported by Bob Proulx.
1209
1210 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
1211
1212         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
1213         not needed.  This removes a dependency on the gettext module.
1214         [defined _LIBC]: Do not include <libintl.h>; not needed.
1215
1216 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
1217
1218         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
1219         HAVE_DECL_STRTOLD.
1220
1221 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
1222
1223         * argp-parse.c: Include <stddef.h>.
1224         (alignof, alignto): New macros.
1225         (parser_init): Don't assume that void * is aligned sufficiently
1226         for struct option.
1227
1228         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
1229         need to extend the stack.
1230         (YYINITDEPTH): New macro, so that the initial stack isn't overly
1231         large.
1232
1233 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1234
1235         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
1236
1237 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
1238
1239         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
1240         Remove now-obsolete comment about AIX.
1241         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
1242         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
1243         (YYMAXDEPTH): New macro.
1244
1245 2004-12-18  Bruno Haible  <bruno@clisp.org>
1246
1247         * fatal-signal.c (fatal_signals): Make non-const.
1248         (init_fatal_signals): New function.
1249         (uninstall_handlers, install_handlers): Ignore signals that were set to
1250         SIG_IGN.
1251         (at_fatal_signal): Call init_fatal_signals.
1252         (init_fatal_signal_set): Likewise. Ignore signals that were set to
1253         SIG_IGN.
1254         Reported by Paul Eggert.
1255
1256 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
1257
1258         * getdate.y (textint): New member "negative".
1259         (time_zone_hhmm): New function.
1260         Expect 14 shift-reduce conflicts, not 13.
1261         (o_colon_minutes): New rule.
1262         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
1263         (yylex): Set the "negative" member of signed numbers.
1264
1265 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
1266
1267         Changes imported from coreutils.
1268         * hard-locale.c: Assume <locale.h> exists.
1269         Include "strdup.h".
1270         (GLIBC_VERSION): New macro.
1271         (hard_locale): Assume setlocale exists.
1272         Rewrite to avoid #ifdef.
1273         Use strdup rather than malloc + strcpy.
1274         * human.c: Assume <locale.h> exists.
1275         (human_readable): Assume localeconv exists.
1276
1277 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
1278
1279         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
1280         convert T2, not T.  (Imported from libc.)
1281
1282 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
1283
1284         * getcwd.c (is_ENAMETOOLONG): New macro.
1285         (__getcwd.c): Don't restore errno; glibc doesn't.
1286         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
1287         first, falling back to our code only if its results look suspicious.
1288         Ensure that the resulting buffer is only as large as necessary.
1289
1290         * readutmp.c: Include readutmp.h first.
1291         Include <errno.h>, since readutmp.h no longer does that.
1292         * readutmp.h: Don't include <errno.h>,
1293         <sys/param.h>, <time.h>; not needed to establish interface.
1294         (errno): Remove decl.
1295         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
1296         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
1297         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
1298
1299 2004-11-28  Simon Josefsson  <jas@extundo.com>
1300
1301         * base64.h, base64.c: New file.
1302
1303 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
1304
1305         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
1306
1307 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
1308
1309         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
1310         HP's ANSI C compiler.
1311         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
1312         Declaring int functions causes warnings on some modern systems and
1313         shouldn't be needed to compile on ancient ones.
1314         * same.c (MIN) [defined MIN]: Don't define, since it's already
1315         defined.
1316
1317         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
1318         with the following changes.
1319         (__set_errno): Parenthesize properly.
1320         Include <stdbool.h>.
1321         (MIN, MAX, MATCHING_INO): New macros.
1322         (__getcwd): Define with prototype, not K&R form.
1323         Use heuristics to allocate default buffer on stack if possible.
1324         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
1325         behavior, and to avoid the PATH_MAX limit when computing
1326         ../../../../...
1327         Use MATCHING_INO to compare inode number to file.
1328         Check for arithmetic overflow in size calculations.
1329         Fix bug in reallocation of dot array that caused getcwd to fail
1330         on directories nested deeper than 75.
1331         Be more careful about saving errno on error.
1332         Do not use realloc; use only free+malloc, as this is a bit
1333         more flexible and avoids a needless copy operation.
1334         Do not inspect st_dev and st_ino for symbolic links; POSIX
1335         doesn't specify the latter.
1336         Check for closedir errors.
1337         Avoid needless casts.
1338         Use "#ifdef weak_alias" around weak_alias, to be like other
1339         glibc code.
1340         The following changes to getcwd.c have effect only when used in
1341         gnulib; they have no effect inside glibc proper.
1342         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
1343         as alloca isn't used.
1344         (alloca, __alloca): Likewise.
1345         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
1346         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
1347         unconditionally, as gnulib assumes C89 or better.
1348         Do not include <sys/param.h>.
1349         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
1350         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
1351         better.
1352         (NULL) [!defined NULL]: Remove; we assume C89 or better.
1353         Include <dirent.h> in a way that is compatible with modern Autoconf.
1354         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
1355         New macros, if not already defined.
1356         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
1357         Use "_LIBC", not "defined _LIBC", for consistency.
1358         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
1359         a mempcpy module.
1360         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
1361         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
1362         * xgetcwd.c: David MacKenzie's old code was removed, so give
1363         credit only to Jim Meyering and adjust the copyright dates.
1364         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
1365         <stdlib.h>, <unistd.h>, "pathmax.h".
1366         Instead, include "xgetcwd.h" (first) and "getcwd.h".
1367         (INITIAL_BUFFER_SIZE): Remove.
1368         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
1369
1370 2004-11-23  Jim Meyering  <jim@meyering.net>
1371
1372         * getopt_.h: Remove trailing blanks.
1373
1374 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
1375
1376         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
1377         (futimens): New function, which uses futimes if available.
1378         (futimens, utimens): Support timespec==NULL, with same semantics
1379         as utime and utimens.
1380         * utimens.h (futimens): New decl.
1381
1382 2004-11-23  Jim Meyering  <jim@meyering.net>
1383
1384         * __fpending.c: Add comment.
1385
1386 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1387
1388         * getopt_.h: Re-addition of __getopt_argv_const caused
1389         redefinition warnings. To avoid them, include the defines
1390         in `#if !defined __need_getopt ... #endif'. The only place
1391         where __getopt_argv_const is used is in definitions
1392         of getopt_long and getopt_long_only below, which are as well
1393         protected by `#ifndef __need_getopt'.
1394         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
1395         __need_getopt after including <stdio.h> and <unistd.h> These
1396         headers might have defined it.
1397
1398 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
1399
1400         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
1401         New macros.
1402         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
1403         optopt): Use them instead of invoking ## directly; otherwise, the
1404         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
1405
1406 2004-11-19  Bruno Haible  <bruno@clisp.org>
1407
1408         * strtok_r.c: Move comments from here...
1409         * strtok_r.h: ... to here.
1410
1411 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
1412
1413         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
1414         might fail.  Problem reported by Yoann Vandoorselaere.
1415         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
1416         that mishandle size_t overflow.
1417
1418 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
1419
1420         * canon-host.c: Include "strdup.h".
1421         (canon_host): Use getaddrinfo if available, so that IPv6 works.
1422         Use strdup instead of malloc/strcpy to duplicate strings.
1423
1424         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
1425         (human_space_before_unit): New constant.
1426         * human.c (human_readable): Support it.
1427
1428         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
1429         (xgetcwd): Set errno correctly when failing.
1430         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
1431         the failure is actually due to a PATH_MAX problem.
1432
1433         Further getopt changes to make it more likely that glibc will
1434         buy the changes back.
1435         * getopt.c (POSIXLY_CORRECT): New constant.
1436         (getopt): Use it, so to preserve glibc semantic
1437         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
1438         when compiling for libc.
1439         * getopt_.h (__getopt_argv_const): Bring it back.
1440         (getopt_long, getopt_long_only): Use it.
1441
1442         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
1443         New arg POSIXLY_CORRECT.  All callers changed.
1444         (getopt): Argv is now char * const *, as per standard.
1445         (_getopt_internal_r, _getopt_internal): Argv is now char **,
1446         not char *__getopt_argv_const *.
1447         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1448         _getopt_long_only_r): Likewise.
1449         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
1450         * getopt_int.h (_getopt_internal, _getopt_internal_r,
1451         _getopt_long_r, _getopt_long_only_r): Likewise.
1452         * getopt_.h (__getopt_argv_const): Remove.
1453         (getopt): Argv is now char * const *, as per standard.
1454
1455         * getdate.y (tORDINAL): New token.
1456         (day, relunit): Allow it for relative times.
1457         (relative_time_table): Use tORDINAL for ordinals.
1458
1459 2004-11-15  Jim Meyering  <jim@meyering.net>
1460
1461         * closeout.c: Include "__fpending.h" once again.
1462         Include <stdbool.h>.
1463         (close_stdout): Don't fail just because stdout was closed initially,
1464         since some programs don't write to stdout in the normal course of
1465         operation (other than --version and --help), and we don't want this
1466         function to make e.g. `touch file >&-' fail.
1467         But do fail if it was closed and someone has tried to write to it.
1468         E.g., `printf foo >&-' must fail.
1469
1470 2004-11-11  Simon Josefsson  <jas@extundo.com>
1471
1472         * strtok_r.h, strtok_r.c: New file.
1473
1474 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
1475
1476         * getopt_.h (__getopt_argv_const): New macro, to be used so that
1477         we can stop lying to compilers about the constness of argv when we
1478         are compiled outside glibc.
1479         (getopt, getopt_long, getopt_long_only): Use it.
1480         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
1481         getopt): Likewise.
1482         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
1483         _getopt_long_only_r): Likewise.
1484         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
1485         _getopt_long_only_r): Likewise.
1486
1487         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
1488         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
1489         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
1490         the other external symbols.
1491         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
1492         declaration, since the above renaming now works around collisions.
1493
1494 2004-11-11  Jim Meyering  <jim@meyering.net>
1495
1496         * linebreak.c: Remove trailing blanks.
1497         * alloca_.h: Likewise.
1498         * acosl.c: Likewise.
1499         * euidaccess.c: Likewise.
1500         * allocsa.h: Likewise.
1501
1502 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
1503
1504         * mktime.c (SHR): New macro, which is a portable
1505         substitute for >> that should work even on Crays.
1506         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
1507         Problem reported by Mark D. Baushke in
1508         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
1509         * getdate.y (SHR): Likewise.
1510         (tm_diff): Use it.
1511         * strftime.c (SHR): Likewise.
1512         (tm_diff): Use it.
1513         * quotearg.c (struct quoting_options): Use unsigned int for
1514         quote_these_too, so that right shifts are well defined.  All uses
1515         changed.
1516
1517 2004-11-10  Simon Josefsson  <jas@extundo.com>
1518
1519         * getaddrinfo.h, getaddrinfo.c: New files.
1520
1521 2004-11-10  Jim Meyering  <jim@meyering.net>
1522
1523         Ensure that no close failure goes unreported.
1524         * closeout.c (close_stdout): Always close stdout.  I.e., don't
1525         return early when it seems there's nothing to flush.
1526         Don't include __fpending.h.
1527
1528 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
1529
1530         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
1531
1532 2004-11-05  Bruno Haible  <bruno@clisp.org>
1533
1534         * readlink.c: Include stddef.h, needed for size_t on Woe32.
1535         Reported by Mark D. Baushke <mdb@cvshome.org>.
1536
1537 2004-11-04  Bruno Haible  <bruno@clisp.org>
1538
1539         2004-09-11  Bruno Haible  <bruno@clisp.org>
1540                 * allocsa.valgrind: New file.
1541         2004-02-06  Bruno Haible  <bruno@clisp.org>
1542                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
1543                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
1544                 Reported by Christopher Seip <chris.seip@hp.com>.
1545
1546 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
1547
1548         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
1549         with errno == ERANGE if the buffer is too small.
1550         Problem reported by Mark D. Baushke.
1551
1552 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
1553
1554         * xreadlink.c (MAXSIZE): New macro.
1555         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
1556         size does not exceed MAXSIZE.  Avoid cast.
1557         As suggested by Mark D. Baushke in
1558         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
1559         if readlink fails with buffer size just under MAXSIZE, try again
1560         with MAXSIZE.
1561
1562 2004-11-02  Derek R. Price  <derek@ximbiot.com>
1563         and  Paul Eggert  <eggert@cs.ucla.edu>
1564
1565         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
1566         (get_date): Overparenthesize to avoid GCC warning.
1567
1568 2004-11-02  Bruno Haible  <bruno@clisp.org>
1569
1570         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
1571         function returns void.
1572
1573 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
1574
1575         * getpass.c (fflush_unlocked, flockfile, funlockfile)
1576         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
1577         already declared.
1578
1579 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
1580
1581         * getdate.y: Add support for TZ="foo" within a date string.
1582         Fix some bugs near time_t boundaries.  Reject dates with
1583         out-of-range components, e.g., "Sept 31".
1584         Include <stdlib.h>, "setenv.h", "xalloc.h".
1585         (ISDIGIT_LOCALE): Remove; unused.
1586         Note that the TZ and time functions used here are not reentrant.
1587         (mktime_ok, get_tz): New functions.
1588         (TZBUFSIZE): New constant.
1589         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
1590         This requires that we sometimes generate our own TZ="XXX..." setting.
1591
1592 2004-10-27  Derek R. Price  <derek@ximbiot.com>
1593
1594         * mktime.c (not_equal_tm): Remove redundant check.
1595
1596 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
1597
1598         * getdate.y: Use Bison 1.875 features, and some minor
1599         code cleanups.  This change does not affect semantics.
1600         Don't include <stdlib.h>; no longer needed.
1601         Don't include unlocked-io.h; only the "#if TEST" code uses
1602         stdio, and performance isn't crucial there.
1603         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
1604         Bison 1.875 features as described below.
1605         All uses of "PC." replaced by "pc->".
1606         (YYSTYPE): Add a forward declaration.
1607         (yylex, yyerror): Use full prototypes in forward decls.
1608         Use "%pure-parser" rather than obsolescent "%pure_parser".
1609         Use %parse-param and %lex-param instead of obsolescent
1610         YYPARSE_PARAM and YYLEX_PARAM.
1611         (meridian_table, month_and_day_table, time_units_table,
1612         relative_time_table, time_zone_table, military_table,
1613         lookup_zone, lookup_word, get_date):
1614         Use NULL instead of 0 where appropriate.
1615         (to_hour): Avoid abort (), to avoid a dependency on
1616         stdlib.h.
1617         (yyerror, yylex): Now accepts parser_control * arg.
1618         (main) [TEST]: Use '\0' rather than 0 for char.
1619
1620 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
1621
1622         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
1623         It's now the caller's responsibility to handle the case where
1624         !HAVE_GETPAGESIZE && !defined getpagesize.
1625
1626         * mktime.c (leapyear): Arg is long int, not int.
1627
1628 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
1629
1630         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
1631
1632 2004-10-12  Simon Josefsson  <jas@extundo.com>
1633
1634         * getpass.c (fflush_unlocked, flockfile, funlockfile)
1635         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
1636         to real functions.
1637
1638 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
1639
1640         * vsnprintf.h: New file.
1641         * vsnprintf.c: New file.
1642
1643 2004-10-07  Bruno Haible  <bruno@clisp.org>
1644
1645         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
1646         into the provided buffer.
1647
1648 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
1649
1650         * diacrit.c, diacrit.h: Add GPL notice.
1651
1652         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
1653         * atanl.c (atanl): Keep the code as similar to glibc as possible.
1654         * logl.c (logl): Keep the code as similar to glibc as possible.
1655         This avoids a potential constant-folding bug.
1656
1657 2004-10-05  Bruno Haible  <bruno@clisp.org>
1658
1659         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
1660
1661 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
1662
1663         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
1664         * xmalloc.c (xmemdup): Likewise.
1665         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
1666         XFREE): Remove these long-obsolescent macros.
1667         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
1668         * xstrdup.c: Remove.
1669
1670         * regex.c (re_comp): Cast gettext return value to char *,
1671         Problem reported by Martin Neitzel via Mark D. Baushke.
1672
1673 2004-10-04  Simon Josefsson  <jas@extundo.com>
1674
1675         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
1676         '#ifdef USE_UNLOCKED_IO'.
1677
1678 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
1679
1680         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
1681         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
1682         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
1683         regex.c, sha1.c, version-etc.c, yesno.c:
1684         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
1685         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
1686         the includer's responsibility.
1687
1688         Sync from coreutils.
1689
1690         * modechange.c (mode_compile): Don't decrement a pointer that
1691         points to the start of a string, as the C Standard says the
1692         resulting behavior is undefined.
1693
1694         * backupfile.h (enum backuptype): Rename none -> no_backups,
1695         simple -> simple_backups, numbered_existing ->
1696         numbered_existing_backups, numbered -> numbered_backups
1697         to avoid shadowing problems.  All uses changed.
1698         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
1699         * backupfile.c (check_extension, numbered_backup):
1700         Rename locals to avoid shadowing 'basename'.
1701         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
1702         once.
1703
1704         * .cppi-disable: Add getopt_.h, getopt_int.h.
1705         * .cvsignore: Add getopt.h.
1706
1707 2004-10-04  Simon Josefsson  <jas@extundo.com>
1708
1709         * memmem.h: New file.
1710         * memmem.c: New file, taken from glibc.
1711
1712 2004-10-02  Jim Meyering  <jim@meyering.net>
1713
1714         * dirfd.h, getpagesize.h: Add copyright notice.
1715
1716 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
1717
1718         * snprintf.c: Remove comments as to why each header is needed.
1719
1720 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
1721
1722         * strsep.h: New file.
1723         * strsep.c: New file.
1724
1725 2004-10-01  Simon Josefsson  <jas@extundo.com>
1726
1727         * snprintf.c (snprintf): Handle size==0.
1728
1729 2004-10-01  Simon Josefsson  <jas@extundo.com>
1730             Bruno Haible  <bruno@clisp.org>
1731
1732         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
1733         (snprintf): Declare 'args'.
1734
1735 2004-09-30  Simon Josefsson  <jas@extundo.com>
1736
1737         * snprintf.h, snprintf.c: New files.
1738
1739 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1740
1741         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
1742         (hol_entry_help): Never translate an empty string.
1743         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
1744         * argp.h (OPTION_NO_TRANS): New option.
1745
1746 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
1747
1748         * xvasprintf.c: Include xalloc.h.
1749         (xvasprintf): Use xalloc_die, not xmalloc_die.
1750
1751 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
1752
1753         * dummy.c: Change copyright notice to FSF, and license to GPL.
1754
1755 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
1756
1757         * argp-pvh.c (argp_program_version_hook): Provide initial value.
1758         Problem reported by Bruno Haible in:
1759         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
1760
1761 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
1762
1763         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
1764         in case some system header has #define'd it.  Problem reported by
1765         Soeren D. Schulze in
1766         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
1767
1768 2004-09-08  Bruno Haible  <bruno@clisp.org>
1769
1770         * stdint_.h.in: New file, taken from GNU clisp.
1771
1772 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
1773
1774         * xvasprintf.h: New file.
1775         * xvasprintf.c: New file.
1776         * xasprintf.c: New file.
1777
1778 2004-09-08  Bruno Haible  <bruno@clisp.org>
1779
1780         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
1781         is > INT_MAX.
1782         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
1783
1784 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
1785
1786         Import from coreutils.
1787         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
1788         strings on unbounded length.  alloca's performance benefits aren't
1789         that important here.
1790         (V_STRDUP): Remove.
1791         (parse_with_separator): New function, with most of the internals
1792         of the old parse_user_spec.  Allow user to omit both user and group,
1793         for compatibility with FreeBSD.
1794         Clone only the user name, not the entire spec.
1795         Do not set *uid, *gid unless entirely successful.
1796         Avoid memory leak in some failing cases.
1797         Fix regression for USER.GROUP reported by Dmitry V. Levin in
1798         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
1799         (parse_user_spec): Rewrite to use parse_with_separator.
1800
1801 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
1802
1803         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
1804         its complicated substitute.
1805         * argp-help.c: Include <errno.h>, for program_invocation_short_name
1806         and program_invocation_name.
1807         (__argp_basename) [!_LIBC]: Remove; the only use was
1808         replaced by its body.
1809         (__argp_short_program_name): Change condition from
1810         !defined __argp_short_program_name to
1811         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
1812         to match argp-namefrob.h.
1813         (__argp_failure): Don't assume strerror_r returns char *.
1814         * argp-parse.c (N_): Define unconditionally.
1815         (argp_default_options): Fill out initializers with 0 to avoid
1816         gcc warnings.
1817
1818 2004-08-12  Simon Josefsson  <jas@extundo.com>
1819
1820         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
1821         * getopt_.h: Renamed from getopt.h.
1822
1823 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
1824
1825         Merge from coreutils.
1826
1827         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
1828         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
1829         for Reliant Unix 5.43.
1830
1831         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
1832         (union fooround): Use uintmax_t, not long int.
1833         The rest is a merge from libc:
1834         [defined _LIBC]: Include <shlib-compat.h>.
1835         (_obstack) [defined _LIBC]: Remove after 2.3.4.
1836
1837         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
1838
1839         * strverscmp.c: Convert to UTF-8.
1840
1841 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
1842
1843         * obstack.h (obstack_empty_p):
1844         Don't assume that chunk->contents is suitably aligned.
1845         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
1846         Likewise. Problem reported by Benno in
1847         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
1848
1849         * chown.c (rpl_chown): Work even if the file is writeable but not
1850         readable.  This could be improved further but it'd take some work.
1851
1852 2004-08-08  Simon Josefsson  <jas@extundo.com>
1853
1854         * xgethostname.c: Don't include error.h (not used).
1855
1856         * getpass.h: Add.
1857         * getpass.c: Include getpass.h first.
1858
1859 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
1860
1861         * xalloc-die.c: New files.
1862         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
1863         All uses removed.
1864         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
1865         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
1866         (_, N_, xalloc_die): Move to xalloc-die.c.
1867         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
1868         so that we needn't mess with xalloc_msg_memory_exhausted.
1869
1870         * sha1.h: Renamed from sha.h.
1871         (SHA1_H): Renamed from _SHA_H.
1872         (sha1_ctx): Renamed from sha_ctx.
1873         (sha1_init_ctx): Renamed from sha_init_ctx.
1874         (sha1_process_block): Renamed from sha_process_block.
1875         (sha1_process_bytes): Renamed from sha_process_bytes.
1876         (sha1_finish_ctx): Renamed from sha_finish_ctx.
1877         (sha1_read_ctx): Renamed from sha_read_ctx.
1878         (sha1_stream): Renamed from sha_stream.
1879         (sha1_buffer): Renamed from sha_buffer.
1880         * sha1.c: Likewise; renamed from sha.c.
1881         Do not include <sys/types.h>.
1882         Include <stddef.h> rather than <stdlib.h>.
1883
1884 2004-08-08  Bruno Haible  <bruno@clisp.org>
1885
1886         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
1887         FILESYSTEM_PREFIX_LEN.
1888         * progreloc.c: Likewise.
1889         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
1890
1891 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
1892
1893         Merge from tar.
1894         * argp-help.c (make_hol, hol_append): Don't assume that
1895         SIZE_MAX is a valid preprocessor constant.
1896         (__argp_basename): Change from "#ifndef _LIBC"
1897         to "#ifndef __argp_short_program_name", so that
1898         we don't compile these functions for tar.
1899
1900         More merges from coreutils.
1901         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
1902         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
1903         yesno.h: New files.
1904         * addext.c: Remove; no longer needed.
1905         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
1906         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
1907         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
1908         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
1909         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
1910         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
1911         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
1912         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
1913         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
1914         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
1915         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
1916         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
1917         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
1918         Import changes from coreutils.
1919
1920 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
1921
1922         Merge from coreutils.
1923
1924         * .gdb-history: Remove; this doesn't belong here.
1925
1926         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
1927         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
1928         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
1929
1930         * dirname.h: Include <stdbool.h>.
1931         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
1932         for consistency with POSIX terminology.  All uses changed.
1933         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
1934         (strip_trailing_slashes): Use bool for booleans.
1935         * stripslash.c (strip_trailing_slashes): Likewise.
1936
1937         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
1938         sometimes returns a positive errno value even when it succeeds.
1939         (print_errno_message) [!LIBC]: Fall back on strerror if
1940         __strerror_r fails.
1941
1942         * path-concat.c (mempcpy): Don't define if a system header defines it.
1943         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
1944         (longest_relative_suffix): New function.
1945         (path_concat): Use it.  Assume first argument is not NULL.
1946         Port to DOS.  Omit redundant separators.
1947         Report an error instead of returning NULL.
1948         Use mempcpy instead of memcpy.
1949         (xpath_concat): Remove: not declared or used.
1950
1951         * same.h: Include <stdbool.h>
1952         (same_name): Return bool, not int.
1953         * same.c (same_name): Likewise.
1954         (errno): Don't declare; we assume C89 or better now.
1955
1956         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
1957         if not already defined.
1958
1959         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
1960         * dup-safer.c (errno): Likewise.
1961
1962 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
1963
1964         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
1965         working.
1966
1967 2004-08-03  Simon Josefsson  <jas@extundo.com>
1968
1969         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
1970         * progname.h: Don't include stdbool.h.
1971
1972 2004-08-02  Simon Josefsson  <jas@extundo.com>
1973
1974         * getsubopt.h: New file, with comments from Bruno Haible.
1975         * getsubopt.c: New file, from glibc, but slightly modified based on
1976         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
1977
1978 2004-08-01  Simon Josefsson  <jas@extundo.com>
1979
1980         * xgetdomainname.c: Include stdlib.h, for free().
1981
1982 2004-07-16  Simon Josefsson  <jas@extundo.com>
1983
1984         * dummy.c: New file.
1985
1986 2004-07-16  Bruno Haible  <bruno@clisp.org>
1987
1988         * backupfile.h: Add extern "C" for C++.
1989         * closeout.h: Likewise.
1990         * copy-file.h: Likewise.
1991         * findprog.h: Likewise.
1992         * full-write.h: Likewise.
1993         * pathname.h: Likewise.
1994         * progname.h: Likewise.
1995         * stpcpy.h: Likewise.
1996         * stpncpy.h: Likewise.
1997         * strcase.h: Likewise.
1998         * strstr.h: Likewise.
1999         * xalloc.h: Likewise.
2000
2001         * mbswidth.h: Add extern "C" for C++.
2002         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
2003
2004 2004-07-09  Simon Josefsson  <jas@extundo.com>
2005
2006         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
2007         failed without this.)
2008
2009 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
2010
2011         * fchown-stub.c: New file.
2012
2013 2004-06-24  Jim Meyering  <jim@meyering.net>
2014
2015         * obstack.h (obstack_base): Cast to (void *), per documentation.
2016
2017 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
2018
2019         * argz.c, argz_.h: New files, which are autoupdated from libtool.
2020
2021 2004-06-01  Jim Meyering  <jim@meyering.net>
2022
2023         * calloc.c: New file.
2024
2025 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
2026
2027         * getdate.y (yylex): Allow space between sign and number.
2028         Problem reported by Dan Jacobson.
2029
2030 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
2031         and  Jim Meyering  <jim@meyering.net>
2032
2033         Merge from coreutils CVS.
2034
2035         * stat-macros.h: New file, with contents from file-type.h
2036         and coreutils' system.h.
2037         * file-type.c: Include "stat-macros.h".
2038         * file-type.h (file_type): Move all macro definitions to new file,
2039         stat-macros.h.
2040
2041         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
2042         Wrap old code with this conditional.
2043         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
2044         function that does not dereference symlinks.
2045         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
2046
2047         * xreadlink.c: Include xreadlink.h first, to catch .h file
2048         dependency problems.
2049         (xreadlink): Accept new arg SIZE, for efficiency.
2050         All decls and uses changed.
2051         * xreadlink.h: Include <stddef.h>, for size_t.
2052
2053         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
2054         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
2055
2056         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
2057
2058 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
2059
2060         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
2061         macros to be defined.
2062         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
2063         the allocator returns NULL because the requested size is zero.
2064
2065 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
2066
2067         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
2068         var.  Add comment explaining why libc still defines it.  This
2069         merges the following patch from glibc:
2070         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
2071
2072 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
2073
2074         * obstack.c (_obstack): Remove unused variable.  It hasn't been
2075         present in glibc since revision 1.1 of this file.
2076         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
2077         obstack_alignment_mask, obstack_alloc, obstack_base,
2078         obstack_blank, obstack_blank_fast, obstack_chunk_size,
2079         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
2080         obstack_grow0, obstack_init, obstack_int_grow,
2081         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
2082         obstack_next_free, obstack_object_size, obstack_ptr_grow,
2083         obstack_ptr_grow_fast, obstack_room): Remove declarations of
2084         nonexistent functions.
2085
2086 2004-05-17  Derek R. Price  <derek@ximbiot.com>
2087             Paul Eggert  <eggert@cs.ucla.edu>
2088
2089         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
2090
2091 2004-05-14  Bruno Haible  <bruno@clisp.org>
2092
2093         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
2094         that consists of a '.' followed by an empty digit string.
2095         Patch by Tor Lillqvist <tml@iki.fi>.
2096
2097 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
2098
2099         Port obstack to the AS/400, where pointers are 16 bytes wide and
2100         you cannot cast an integer to a valid pointer.  This patch is
2101         currently waiting to be integrated into glibc; see
2102         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
2103
2104         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
2105         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
2106         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
2107         (struct obstack): temp member is now a union of a pointer and
2108         an integer, instead of an integer.  All integer uses changed.
2109         This does not affect the physical layout of struct obstack,
2110         except on hosts (like the AS/400) where the size or alignment of
2111         void * is greater than that of ptrdiff_t.
2112         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
2113         __STDC__)]: Store temporary in pointer member of union, not
2114         integer member.
2115         * obstack.c: Include <stddef.h>, for offsetof.
2116         (struct fooalign): Remove; it doesn't need a name.
2117         (union fooround): Change double to long double, and add void *.
2118         (DEFAULT_ALIGNMENT): Use offsetof to compute.
2119         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
2120         not a macro.  Hence the values are always int; so remove all
2121         casts-to-int in uses.
2122
2123 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
2124             Derek Price  <derek@ximbiot.com>
2125
2126         * alloca.c: Include <alloca.h>, to get our interface.
2127         * alloca_.h: Use __alloca on AIX, so that we don't have to
2128         include <alloca.h> first.  Use C89 prototype for alloca; this
2129         requires including <stddef.h> for size_t.  Use extern "C" if C++.
2130         Use #elif for simplicity, since we can assume C89 now.
2131         Don't try to source the system alloca.h since it will not be found
2132         and to prevent recursively including its replacement.
2133         * fnmatch.c: Include <alloca.h> instead of opencoding.
2134         * regex.c: Likewise.
2135
2136 2004-05-16  Derek Price  <derek@ximbiot.com>
2137             Paul Eggert  <eggert@cs.ucla.edu>
2138
2139         getline cleanup.  This changes the getndelim2 API: both order of
2140         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
2141         no delimiter).
2142
2143         * getline.c: Don't include stddef.h or stdio.h, since our
2144         interface does that.
2145         (getline): Always use getdelim, so that we don't have two
2146         copies of this code.
2147         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
2148         if available.
2149         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
2150         (GETNDELIM2_MAXIMUM): New macro.
2151         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
2152         instead of the old practice of delim2==0.  All callers changed.
2153         Return -1 on overflow, instead of returning junk.
2154         Do not set *linesize unless allocation succeeds.
2155         * getndelim2.h: Do not include stddef.h; no longer needed, now
2156         that we include sys/types.h.
2157         * getnline.h: Likewise.
2158         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
2159         (getndelim2): Reorder arguments.
2160         * getnline.c (getnline, getndelim):
2161         Don't discard the NMAX argument.
2162         (getnline): Invoke getndelim, to avoid code duplication.
2163         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
2164         of (size_t) -1 by callers of the getnline family.
2165
2166 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
2167
2168         * nanosleep.c (suspended): Change its type from int to
2169         sig_atomic_t volatile.
2170         (first_call): Make it private to rpl_nanosleep, and have it
2171         be zero initially as that's a bit faster.
2172         (my_usleep): Round up fractional times instead of truncating them,
2173         as this is the usual meaning for 'sleep'.
2174
2175         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
2176         doesn't work.
2177         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
2178         (ENOSYS): Define if not defined.
2179         (settime): Fall back on stime if it exists and settimeofday fails.
2180         But don't bother with fallbacks if a method fails with errno == EPERM.
2181
2182 2004-05-11  Jim Meyering  <jim@meyering.net>
2183
2184         Prior to this change, the save_cwd caller required read access to the
2185         current directory on most systems (ones with the fchdir function).
2186
2187         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
2188         fails, try write-only, and finally, resort to using xgetcwd.
2189
2190 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
2191
2192         * obstack.c, obstack.h: Import changes from libc.
2193
2194 2004-04-28  Bruno Haible  <bruno@clisp.org>
2195
2196         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
2197         implicitly appends .exe to executables.
2198         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
2199         accepts Windows pathnames.
2200         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
2201         Cygwin like Windows, since it now accepts Windows pathnames.
2202         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
2203         Cygwin like Windows, since it now accepts Windows pathnames.
2204         Reported by Derek Robert Price <derek@ximbiot.com>.
2205
2206 2004-04-20  Jim Meyering  <jim@meyering.net>
2207
2208         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
2209
2210 2004-04-20  Jim Meyering  <jim@meyering.net>
2211             Bruno Haible  <bruno@clisp.org>
2212
2213         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
2214         memory when realloc fails.
2215
2216 2004-04-18  Jim Meyering  <jim@meyering.net>
2217
2218         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
2219         don't leak memory and do call END_UTMP_ENT.
2220
2221 2004-04-11  Paul Eggert  <eggert@twinsun.com>
2222
2223         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
2224         (CHAR_BIT): Remove, since we assume C89.
2225         Include <stdint.h> if available, as per current Autoconf CVS advice.
2226
2227 2004-03-30  Paul Eggert  <eggert@twinsun.com>
2228
2229         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
2230         not bool, to be more consistent with Unix conventions.
2231         Suggested by Bruno Haible.
2232
2233         Merge from coreutils.
2234
2235         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
2236         New files.
2237
2238         * getdate.h: Include stdbool.h, and timespec.h instead of
2239         the usual <time.h> dance.
2240         (get_date): Change signature to support fractional time stamps.
2241         All callers changed.
2242         * getdate.y: Include "getdate.h" first, as we can now
2243         assume C89 and don't need to worry about 'const'.
2244         Similarly, include "unlocked-io.h" near start, not in middle.
2245         Include <limits.h>.
2246         (textint.value): Use long int rather than int.
2247         (textint.digits): Use size_t rather than int.
2248         (BILLION, LOG10_BILLION): New constants.
2249         (parser_control): New member rel_ns.  Members day_ordinal,
2250         time_zone, month, day, hour, minutes, rel_year, rel_month,
2251         rel_day, rel_hour, rel_minutes, rel_seconds
2252         are now long int, not int.  Member seconds is now struct timespec,
2253         not int.  New member timespec_seen.  Members dates_seen, days_seen,
2254         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
2255         not int.
2256         (%union.intval): Now long int, not int.
2257         New member timespec.
2258         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
2259         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
2260         (spec): Now is a timespec or an item list.
2261         (timespec, items): New nonterminals.
2262         (time, rel, relunit, number, get_date):
2263         Add support for fractional seconds.
2264         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
2265         (gmtime, localtime, mktime): Remove decls; not needed with C89.
2266         (to_hour): First arg is now long int, not int.
2267         (to_year): Returns long int, not int.
2268         Don't treat year -70 like 70.
2269         (tm_diff): Returns long int, not int.
2270         (lookup_word): Use bool instead of int when appropriate.
2271         (yylex): Use size_t for count, not int.
2272         Detect overflow when parsing large integer constants.
2273         Add support for fractions.
2274         (get_date): Make pointers 'const' if possible.
2275         Use more-portable code to detect integer overflow.
2276         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
2277         Don't use ctime; it's not reliable if the year has >4 digits.
2278
2279         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
2280         This is for compatibility with BSD.
2281
2282         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
2283         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
2284         From coreutils' system.h.
2285
2286         * userspec.c: Don't include "posixver.h".
2287         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
2288         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
2289         compatible extension.  Simplify code by removing a boolean int
2290         that was always nonzero if a string was nonnull.
2291
2292 2004-03-30  Jim Meyering  <jim@meyering.net>
2293
2294         Merge from coreutils.
2295
2296         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
2297
2298         * readtokens.c (readtoken): Don't leak 64 bytes when reading
2299         an empty input stream.
2300
2301         * readtokens.c: Include <stdbool.h>.
2302         (readtoken): Use `size_t' rather than int/long.
2303         All callers adjusted.
2304         Use `bool' rather than `int' where appropriate.
2305         Use memset rather than an explicit loop.
2306         Use x2nrealloc rather than xrealloc.
2307         Allow the use of `\0' as a delimiter.
2308         (readtokens): Likewise.
2309         * readtokens.h (readtoken, readtokens): Update prototypes.
2310
2311 2004-03-30  Bruno Haible  <bruno@clisp.org>
2312
2313         * getloadavg.c (getloadavg): Don't assume setlocale returns
2314         nonnull.
2315
2316 2004-03-29  Paul Eggert  <eggert@twinsun.com>
2317
2318         Merge changes to getloadavg.c from coreutils and Emacs.
2319
2320         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
2321         Define to an expression, not to the empty string.
2322         Include cloexec.h and xalloc.h.
2323         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
2324         Use set_cloexec_flag rather than rolling our own.
2325         * cloexec.c, cloexec.h: New files.
2326
2327 2004-03-18  Paul Eggert  <eggert@twinsun.com>
2328
2329         * getopt.h: Sync with libc CVS.
2330
2331 2004-03-18  Paul Eggert  <eggert@twinsun.com>
2332             Bruno Haible  <bruno@clisp.org>
2333
2334         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
2335         not on all platforms that have <wchar.h>.
2336         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
2337
2338 2004-03-09  Paul Eggert  <eggert@twinsun.com>
2339
2340         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
2341         Sync with libc CVS.
2342         * getopt_int.h: New file, also synced from libc.
2343
2344 2004-03-07  Paul Eggert  <eggert@twinsun.com>
2345
2346         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
2347         '#if' expressions.  Unlike the code it replaces, it does not
2348         depend on (defined _SC_PAGESIZE).  However, it does depend on
2349         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
2350         first reported by Jason Andrade in
2351         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
2352
2353 2004-01-18  Simon Josefsson  <jas@extundo.com>
2354
2355         * strdup.h: New file.
2356         * strdup.c: Include it.
2357         * path-concat.c: Include strdup.h. Drop strdup declaration.
2358         * userspec.c: Include strdup.h. Drop strdup declaration.
2359
2360 2004-02-06  Karl Berry  <karl@gnu.org>
2361
2362         * config.charset: update from gettext 0.14.1.
2363
2364 2004-02-05  Paul Eggert  <eggert@twinsun.com>
2365
2366         Add comments and code, prompted by suggestions from Bruno Haible
2367         for sh-quote.
2368         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
2369         describing the enum quoting_style values.
2370         * quotearg.c (quotearg_alloc): New function.
2371         (quotearg_buffer_restyled): Treat lone { and } as special.
2372         Treat = as special.  Work around bug with older shells
2373         that "see" a '\' that is really the 2nd byte of a multibyte char.
2374         Quote empty string with shell_quoting_style.
2375
2376 2004-02-03  Bruno Haible  <bruno@clisp.org>
2377
2378         * pipe.h: New file, from GNU gettext.
2379         * pipe.c: New file, from GNU gettext.
2380
2381 2004-01-27  Bruno Haible  <bruno@clisp.org>
2382
2383         * execute.h: New file, from GNU gettext.
2384         * execute.c: New file, from GNU gettext.
2385         * w32spawn.h: New file, from GNU gettext.
2386
2387 2004-01-23  Paul Eggert  <eggert@twinsun.com>
2388
2389         Exit-status fix from coreutils.
2390
2391         Use exit_failure consistently in place of EXIT_FAILURE,
2392         so that program exit statuses are consistent on failure.
2393
2394         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
2395         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
2396         * argmatch.h: Comment fix to match the above.
2397         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
2398         Now a macro referring to exit_failure, instead of a separate
2399         variable.  Include "exitfail.h" to get it.
2400         * xstrtol.h: Include "exitfail.h".
2401         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
2402
2403         * long-options.c (parse_long_options): Use prototype
2404         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
2405         for clarity.
2406
2407 2004-01-21  Jim Meyering  <jim@meyering.net>
2408
2409         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
2410         so as not to conflict with a different-sized __mktime_internal
2411         function in GNU libc.
2412         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
2413         Problem building statically-linked `ls' reported by Michael Brunnbauer.
2414
2415 2004-01-18  Paul Eggert  <eggert@twinsun.com>
2416
2417         Merge from diffutils.
2418
2419         * file-type.c (file_type): Add typed memory objects.
2420         * file-type.h (S_TYPEISTMO): New macro.
2421
2422         * c-stack.h (c_stack_action): Remove argv argument.
2423         * c-stack.c (c_stack_action): Likewise.  All uses changed.
2424         (die): Don't calculate message unless segv_action returns.
2425         (get_stack_location, min_address_from_argv, max_address_from_argv,
2426         volatile stack_base, volatile_stack_size): Remove.
2427         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
2428         that every segmentation violation is a stack overflow.  (Ouch!)
2429         See Debian bug 136249 (still outstanding) for more info about why
2430         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
2431
2432 2003-11-30  Bruno Haible  <bruno@clisp.org>
2433
2434         Safer stack allocation.
2435         * setenv.c: Include allocsa.h.
2436         (alloca): Remove fallback definition.
2437         (freea): Remove macro.
2438         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
2439         instead of freea.
2440
2441 2003-10-17  Bruno Haible  <bruno@clisp.org>
2442
2443         * binary-io.h: Avoid warnings on Cygwin.
2444
2445 2003-12-28  Bruno Haible  <bruno@clisp.org>
2446
2447         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
2448         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
2449
2450 2003-11-28  Bruno Haible  <bruno@clisp.org>
2451
2452         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
2453
2454 2003-11-27  Bruno Haible  <bruno@clisp.org>
2455
2456         * wait-process.c: On Windows, include windows.h. Needed on mingw.
2457
2458 2003-11-17  Bruno Haible  <bruno@clisp.org>
2459
2460         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
2461
2462 2003-11-24  Bruno Haible  <bruno@clisp.org>
2463
2464         * xallocsa.h: New file, from GNU gettext.
2465         * xallocsa.c: New file, from GNU gettext.
2466
2467 2003-11-24  Bruno Haible  <bruno@clisp.org>
2468
2469         * allocsa.h: New file, from GNU gettext.
2470         * allocsa.c: New file, from GNU gettext.
2471
2472 2003-11-24  Bruno Haible  <bruno@clisp.org>
2473
2474         * eealloc.h: New file.
2475
2476 2004-01-15  Jim Meyering  <jim@meyering.net>
2477
2478         Merge from coreutils.
2479
2480         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
2481         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
2482         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
2483
2484         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
2485         optional configure-time default.
2486
2487         * version-etc.c (version_etc_copyright): Update copyright date.
2488
2489         * xreadlink.c (xreadlink): Correct outdated comment.
2490
2491 2004-01-15  Paul Eggert  <eggert@twinsun.com>
2492
2493         Merge from coreutils.
2494
2495         * posixver.c: Include posixver.h.
2496
2497         * same.c: Include <stdbool.h>, <limits.h>.
2498         (_POSIX_NAME_MAX): Define if not defined.
2499         (MIN): New macro.
2500         (same_name): If file names are silently truncated, report
2501         that the file names are the same if they are the same after
2502         the silent truncation.
2503
2504         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
2505         conversion function.
2506         * xstrtod.c (xstrtod): Likewise.  All callers changed to
2507         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
2508         longer needed.
2509
2510 2004-01-14  Paul Eggert  <eggert@twinsun.com>
2511
2512         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
2513         with like-named macro in fnmatch.c.
2514         (EXT): Use an internal constant instead.
2515
2516         Merge fnmatch patches from glibc.
2517         * fnmatch.c (mbsinit): Remove define.
2518         Add libc_hidden_ver (__fnmatch, fnmatch).
2519         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
2520         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
2521
2522 2003-12-14  Karl Berry  <karl@gnu.org>
2523
2524         * config.charset: update from gettext-runtime.
2525
2526 2003-12-03  Paul Eggert  <eggert@twinsun.com>
2527
2528         * getgroups.c (getgroups): xmalloc takes one argument, not two.
2529         Bug reported by Alfred M. Szmidt.
2530
2531 2003-11-29  Karl Berry  <karl@gnu.org>
2532
2533         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
2534
2535 2003-11-23  Paul Eggert  <eggert@twinsun.com>
2536             Bruno Haible  <bruno@clisp.org>
2537
2538         * printf-parse.h: Don't include sys/types.h.
2539         (ARG_NONE): New macro.
2540         (char_directive): Change type of *arg_index fields to size_t.
2541         * printf-parse.c: Don't include sys/types.h.
2542         (SSIZE_MAX): Remove macro.
2543         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
2544         Remove unnecessary overflow check.
2545         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
2546         fields.
2547
2548 2003-11-24  Paul Eggert  <eggert@twinsun.com>
2549
2550         * alloca.c: Remove dependency on xalloc module.
2551         (xalloc_die): Remove.
2552         (memory_full) [!defined emacs]: New macro.
2553         [!defined emacs]: Don't include xalloc.h.
2554         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
2555         address arithmetic overflows.  Change datatypes a bit to avoid
2556         unnecessary casts.
2557
2558 2003-11-22  Jim Meyering  <jim@meyering.net>
2559
2560         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
2561
2562 2003-11-17  Bruno Haible  <bruno@clisp.org>
2563
2564         * vasnprintf.c (alloca): Remove fallback definition.
2565         (freea): Remove definition.
2566         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
2567         Reported by Paul Eggert.
2568
2569 2003-11-17  Jim Meyering  <jim@meyering.net>
2570
2571         On systems without utime and without a utimes function capable of
2572         dealing with a NULL struct utimbuf* argument, this utime replacement
2573         could -- in unusual circumstances -- leak a file descriptor.
2574         * utime.c: Include <unistd.h> and <errno.h>.
2575         (utime_null): Be sure to close `fd' and to preserve errno.
2576         Reported by Geoff Collyer via Arnold Robbins.
2577
2578 2003-11-16  Paul Eggert  <eggert@twinsun.com>
2579             Bruno Haible  <bruno@clisp.org>
2580
2581         Protect against address arithmetic overflow.
2582         * printf-args.h: Include stddef.h.
2583         (arguments): Change type of field 'count' to size_t.
2584         * printf-args.c (printf_fetchargs): Use size_t instead of
2585         'unsigned int' where appropriate.
2586         * printf-parse.h: Include sys/types.h.
2587         (char_directive): Change type of *arg_index fields to ssize_t.
2588         (char_directives): Change type of fields 'count', max_*_length to
2589         size_t.
2590         * printf-parse.c: Include sys/types.h and xsize.h.
2591         (SSIZE_MAX): Define fallback value.
2592         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
2593         instead of 'int' where appropriate. Check a_allocated, d_allocated
2594         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
2595         * vasnprintf.c: Include xsize.h.
2596         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
2597         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
2598         overflow. Avoid wraparound when converting a width or precision from
2599         decimal to binary.
2600
2601 2003-11-16  Bruno Haible  <bruno@clisp.org>
2602
2603         Update from GNU gettext.
2604         * printf-parse.c: Generalize to it can be compiled for wide strings.
2605         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
2606         * vasnprintf.c: Generalize to it can be compiled for wide strings.
2607         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
2608         SNPRINTF): New macros.
2609         Don't include <alloca.h> if the file is used inside libintl.
2610         (local_wcslen): New function, for Solaris 2.5.1.
2611         (VASNPRINTF): Use it instead of wcslen.
2612
2613 2003-11-16  Bruno Haible  <bruno@clisp.org>
2614
2615         * xsize.h (xmax): New function.
2616         (xsum, xsum3, xsum4): Declare as "pure" functions.
2617
2618 2003-11-12  Paul Eggert  <eggert@twinsun.com>
2619
2620         * xalloc.h: Do not include <limits.h> or <stdint.h>.
2621         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
2622         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
2623         heuristic is just as accurate as far as we know, and it removes a
2624         dependency on size_max.m4 and ptrdiff_max.m4.
2625
2626 2003-11-12  Paul Eggert  <eggert@twinsun.com>
2627
2628         * xstrtol.c (__xstrtol): Remove "break" immediately after
2629         "return", to pacify some unknown compiler.  Problem reported
2630         by Joerg Schilling.
2631
2632 2003-11-11  Bruno Haible  <bruno@clisp.org>
2633
2634         * xsize.h (SIZE_MAX): Remove fallback definition.
2635         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
2636         defined.
2637
2638 2003-11-10  Paul Eggert  <eggert@twinsun.com>
2639
2640         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
2641         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
2642         rejected some allocations of exactly SIZE_MAX - 2 bytes.
2643         From Bruno Haible.
2644         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
2645         not (size_t) -1, since it's defined here.
2646
2647 2003-11-06  Paul Eggert  <eggert@twinsun.com>
2648
2649         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
2650         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
2651         Reject sizes of exactly SIZE_MAX bytes.
2652         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
2653         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
2654
2655 2003-11-05  Bruno Haible  <bruno@clisp.org>
2656
2657         * xsize.h: Include limits.h, to avoid a possible collision with
2658         SIZE_MAX defined in <limits.h> on Solaris.
2659
2660 2003-11-04  Bruno Haible  <bruno@clisp.org>
2661
2662         * xsize.h: New file.
2663         * linebreak.c: Include xsize.h.
2664         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
2665         argument for overflow.
2666         Suggested by Paul Eggert.
2667
2668 2003-10-31  Bruno Haible  <bruno@clisp.org>
2669
2670         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
2671         to avoid (extremely rare) race condition.
2672         Suggested by Paul Eggert.
2673
2674 2003-11-03  Jim Meyering  <jim@meyering.net>
2675
2676         * userspec.c: Include "userspec.h".
2677         * userspec.h: New file.
2678
2679 2003-10-31  Paul Eggert  <eggert@twinsun.com>
2680
2681         * mountlist.h (struct mount_entry.me_type_malloced): New member.
2682         * mountlist.c (SIZE_MAX): Define if not defined already.
2683         (read_filesystem_list): Set and use me_type_malloced.
2684         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
2685         whatever the type happens to be), for brevity and consistency.
2686         Check for size calculation overflow on Alphas running OSF/1.
2687
2688 2003-10-31  Jim Meyering  <jim@meyering.net>
2689
2690         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
2691
2692         * linebuffer.c: Include <string.h> for declaration of memset.
2693
2694 2003-10-30  Paul Eggert  <eggert@twinsun.com>
2695             Bruno Haible  <bruno@clisp.org>
2696
2697         * vasprintf.c: Include <limits.h>, <stdlib.h>.
2698         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
2699
2700 2003-10-29  Paul Eggert  <eggert@twinsun.com>
2701
2702         * xalloc.h (xalloc_oversized): Now a macro, not a function,
2703         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
2704         no longer needed.
2705         * quotearg.c (quotearg_n_options): Use it.
2706         * group-member.c: Include <stdbool.h>.
2707         (free_group_info): Arg is now const *; don't free arg.
2708         (get_group_info): Now returns bool and accepts struct group_info *,
2709         rather than returning a malloc'ed struct group_info *.
2710         All uses changed.  Check for overflow in internal size calculation.
2711
2712         * getusershell.c (readname): Simplify the code by using x2nrealloc
2713         rather than xmalloc/xrealloc.
2714         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
2715         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
2716         conformance bug: the old code used a pointer after freeing the
2717         storage that it addressed.
2718         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
2719         rather than doing it by hand.
2720         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
2721         the buffer preserved.  Use free and xmalloc instead.
2722         * quotearg.c (quotearg_n_options): Likewise.
2723         Use a simpler test for size overflow.  Don't use xalloc_oversized
2724         because unsigned int might be wider than size_t (!); this suggests
2725         that we should switch from unsigned int to size_t for slot numbers.
2726
2727 2003-10-27  Bruno Haible  <bruno@clisp.org>
2728
2729         * stdbool_.h: Better support for BeOS.
2730
2731 2003-10-27  Paul Eggert  <eggert@twinsun.com>
2732
2733         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
2734         to allocate the returned structure.  Do not allocate a subarray,
2735         as x2nrealloc will do that.
2736         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
2737         instead of xnrealloc.
2738         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
2739
2740 2003-10-26  Paul Eggert  <eggert@twinsun.com>
2741
2742         * xalloc.h (xalloc_oversized): New static inline function, for
2743         callers that want to do their own size-overflow checking.  Include
2744         <stdbool.h>, since xalloc_oversized returns bool.
2745         * xalloc.c (array_size_overflow): Remove.  All callers changed
2746         to use xalloc_oversized.
2747
2748         Add two functions x2realloc, x2nrealloc, for programs that grow
2749         arrays dynamically by doubling their sizes.
2750         * xalloc.h (x2realloc, x2nrealloc): New decls.
2751         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
2752         New functions.
2753
2754         Port to C99 semantics for 'inline' of external functions.
2755         Bug reported by Bruno Haible.
2756         * xmalloc.c (xnmalloc_inline): New static inline function,
2757         with the old contents of xnmalloc.
2758         (xnmalloc, xmalloc): Use it.
2759         (xnrealloc_inline): New static inline function,
2760         with the old contents of xnrealloc.
2761         (xnrealloc, xrealloc): Use it.
2762
2763         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
2764
2765 2003-10-25  Paul Eggert  <eggert@twinsun.com>
2766
2767         Fix several address-calculation bugs in the hash modules,
2768         plus some minor code cleanup.
2769
2770         * hash.h: Include <stdbool.h>, for bool.
2771         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
2772         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
2773         hash_get_n_entries, hash_get_max_bucket_length,
2774         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
2775         hash_rehash): Use size_t rather than unsigned.
2776         * hash.c (struct hash_table, hash_get_n_buckets,
2777         hash_get_n_buckets_used, hash_get_n_entries,
2778         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
2779         hash_get_entries, hash_do_for_each, hash_string, is_prime,
2780         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
2781         Likewise.
2782         (SIZE_MAX): Define if not defined.
2783         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
2784         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
2785         hash_print):
2786         Use const * when possible.
2787         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
2788         (check_tuning): Fix bug: if tuning parameters were very close to
2789         0 or 1, rounding errors could have caused subscript violations.
2790         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
2791         (hash_initialize): Add 'fail:' label
2792         to free table and return NULL, and use it to simplify code.
2793         Use calloc rather than clearing the storage ourself.
2794         (hash_initialize, hash_rehash): Check for arithmetic overflow in
2795         buffer size calculations.
2796         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
2797         Include <stddef.h>, for size_t.
2798         * hash-pjw.c (hash_pjw): Likewise.
2799         Switch to method described by Bruno Haible.
2800         Include <limits.h>, for CHAR_BIT.
2801         (SIZE_BITS): New macro.
2802
2803 2003-10-21  Paul Eggert  <eggert@twinsun.com>
2804
2805         * getndelim2.c (getndelim2): When size calculation overflows,
2806         ceiling the allocation at NMAX bytes rather than silently
2807         discarding input bytes before NMAX is reached.  This makes
2808         a difference only if NMAX exceeds SIZE_MAX / 2.
2809
2810         * obstack.c: Merge from glibc.
2811         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
2812         Add libc_hidden_def (_obstack_newchunk).
2813         (_obstack_free) [! defined _LIBC]: Remove.
2814         [defined _LIBC]: Make a strong alias from obstack_free, rather than
2815         a clone of the function body.
2816         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
2817         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
2818
2819         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
2820         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
2821         arg to memcpy.
2822
2823         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
2824         (obstack_ptr_grow_fast, obstack_int_grow_fast):
2825         Don't use lvalue casts, as GCC plans to remove support for them
2826         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
2827         was also present in the non-GCC version, indicating that this
2828         code had always been buggy and had never been widely used.
2829         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
2830         Use the fast variant of each macro, rather than copying the
2831         definiens of the fast variant; that way, we'll be more likely to
2832         catch future bugs in the fast variants.
2833
2834 2003-10-20  Bruno Haible  <bruno@clisp.org>
2835
2836         * wait-process.h: New file, from GNU gettext.
2837         * wait-process.c: New file, from GNU gettext.
2838
2839 2003-10-19  Jim Meyering  <jim@meyering.net>
2840
2841         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
2842
2843 2003-10-16  Paul Eggert  <eggert@twinsun.com>
2844
2845         * getgroups.c: Include <errno.h>, <stdlib.h>.
2846         (getgroups): First arg is int, not size_t.
2847         Don't let 'free' mangle errno.
2848
2849 2003-10-16  Jim Meyering  <jim@meyering.net>
2850
2851         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
2852
2853 2003-10-15  Paul Eggert  <eggert@twinsun.com>
2854
2855         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
2856         (SIZE_MAX): Remove.
2857         (new_exclude, add_exclude_file): Initial size no longer needs to
2858         be a power of 2.
2859         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
2860         our own address arithmetic overflow checking.
2861
2862         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
2863         (fnmatch): Do not alloca more than 2000 wide characters;
2864         instead, use malloc for large buffers.
2865         Check for address arithmetic overflow, and return -1
2866         with errno set to ENOMEM in that case.
2867         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
2868         (NEW_PATTERN): Do not alloca more than 8000 bytes;
2869         instead, return -1.  Check for address arithmetic overflow.
2870
2871 2003-10-14  Paul Eggert  <eggert@twinsun.com>
2872
2873         Handle invalid suffixes and overflow independently, so that
2874         callers can treat them independently as needed.  Fix some bugs in
2875         suffix handling, e.g., "100k@" was not diagnosed as an invalid
2876         suffix for a human-readable blocksize.  The major caller-visible
2877         change is the addition of a new
2878         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
2879         that both overflow and suffix chars were found.
2880
2881         * human.c (humblock): Don't check separately for invalid suffix
2882         char; that is xstrtoumax's job (now that its bug is fixed).
2883         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
2884         INTMAX_MAX]: New macros.
2885         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
2886         TYPE_MAXIMUM): New macros.
2887         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
2888         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
2889         if overflow occurs, as it's what __strtol does and it's more useful
2890         in practice.
2891         (__xstrtol): If __strtol reports some error other than ERANGE,
2892         reflect it to the caller as LONGINT_INVALID.  If it reports
2893         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
2894         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
2895         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
2896         value.
2897         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
2898         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
2899         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
2900         [defined UINTMAX_MAX]: New macros.
2901
2902 2003-10-14  Bruno Haible  <bruno@clisp.org>
2903
2904         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
2905         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
2906         Also use volatile where needed.
2907
2908 2003-10-12  Paul Eggert  <eggert@twinsun.com>
2909
2910         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
2911         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
2912         and define in terms of the other primitives.
2913         * xmalloc.c: Include stdbool.h; do not include exit.h.
2914         (SIZE_MAX): Define if not already defined.
2915         (array_size_overflow): New function.
2916         (xalloc_die): Abort instead of exiting if 'error' returns.
2917         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
2918         (xmalloc, xrealloc): Use them.
2919         (xcalloc): Check for address arithmetic overflow.
2920         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
2921         a bit faster than strcpy.
2922
2923 2003-10-08  Paul Eggert  <eggert@twinsun.com>
2924
2925         Merge getpass from libc, plus a few fixes.
2926
2927         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
2928         Include <stdbool.h>.
2929         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
2930         __fsetlocking to empty.
2931         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
2932         do include <bits/libc-lock.h>.
2933         Do not include <fcntl.h>; not needed.
2934         [_LIBC]: Include <wchar.h>.
2935         (NOTCANCEL_MODE): New macro.
2936         (flockfile, funlockfile) [_LIBC]: New macros.
2937         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
2938         [!_LIBC]: New macros.
2939         (call_fclose): New function.
2940         (getpass): Use it.  Save tty stream separately; this simplifies the
2941         code and makes it more reliable if stdin happens to equal stdout.
2942         Invoke __fsetlocking on tty.
2943         Handle thread cancellation if needed.
2944         Namespace cleanup (use __tcgetattr, __getline).
2945         Use bool for Booleans.
2946         [USE_IN_LIBIO]: Handle wide streams.
2947         [!_LIBC]: Unconditionally do the fseek, since we don't know what
2948         stream might go where.
2949
2950         * unlocked-io.h: Include <stdio.h>, so that the caller
2951         doesn't have to include <stdio.h> before us.
2952         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
2953         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2954         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
2955         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
2956         if not declared, so that we can use getpass.c code from libc without
2957         rewriting it.
2958         (flockfile, ftrylockfile, funlockfile): New macros.
2959
2960 2003-10-06  Bruno Haible  <bruno@clisp.org>
2961
2962         * version-etc-2.h: Remove file.
2963         * version-etc-2.c: Remove file.
2964
2965 2003-09-25  Jim Meyering  <jim@meyering.net>
2966             Bruno Haible  <bruno@clisp.org>
2967
2968         This lets translators provide better translations for the
2969         "Written by ..." part of --version output.
2970         * version-etc.h: Include stdarg.h.
2971         (version_etc_copyright): Declare as readonly.
2972         (version_etc): Make this function variadic with a NULL-terminated list
2973         of author name strings.
2974         (version_etc_va): New declaration.
2975         * version-etc.c: Include stdarg.h, stdlib.h.
2976         (version_etc_copyright): Declare as readonly.
2977         (version_etc_va): New function. Provide a different translatable string
2978         for each possible number of authors < 10. Abbreviate when there are 10
2979         authors or more.
2980         (version_etc): Make this function variadic. Call version_etc_va.
2981         Suggestion from Gary V. Vaughan.
2982
2983         * long-options.h (parse_long_options): Change prototype: the authors
2984         string is moved to the end and becomes variadic.
2985         * long-options.c: Include stdarg.h.
2986         (parse_long_options): Make this function variadic, too.
2987         Call version_etc_va, not version_etc.
2988
2989 2003-10-06  Bruno Haible  <bruno@clisp.org>
2990
2991         * fatal-signal.h: New file, from GNU gettext.
2992         * fatal-signal.c: New file, from GNU gettext.
2993
2994 2003-10-04  Karl Berry  <karl@gnu.org>
2995
2996         * argp*: update from libc.
2997
2998 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
2999
3000         * getpass.c (getpass): Use a no-op fseek when switching from input to
3001         output mode on the same stream.
3002
3003 2003-09-29  Paul Eggert  <eggert@twinsun.com>
3004
3005         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
3006         Fix arg typo in previous patch.
3007
3008 2003-09-28  Jim Meyering  <jim@meyering.net>
3009
3010         * error.c: Correct cpp indentation.
3011
3012 2003-09-27  Paul Eggert  <eggert@twinsun.com>
3013
3014         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
3015         Omit the special code that used __typeof__, since we worry that
3016         it could be more trouble than it's worth.  See:
3017         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
3018         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
3019
3020         * free.c: New file.
3021
3022 2003-09-26  Jim Meyering  <jim@meyering.net>
3023
3024         * error.c (error_tail): Move some declarations
3025         into inner scope where the local variables are used.
3026
3027 2003-09-26  Bruno Haible  <bruno@clisp.org>
3028
3029         * stpncpy.h (gnu_stpncpy): New declaration.
3030         (stpncpy): Define as alias for gnu_stpncpy.
3031         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
3032
3033 2003-09-26  Paul Eggert  <eggert@twinsun.com>
3034
3035         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
3036         (error_tail): Do not loop, reallocating temporary buffer, since
3037         the output cannot contain more wide characters than the input
3038         contains bytes, the size must be big enough already.  This avoids
3039         one potential size overflow calculation.  Check for size overflow
3040         when calculating temporary buffer size.  Free temporary buffer
3041         when done, if it was allocated with malloc; this plugs a memory
3042         leak.  Remove casts from void * to pointers, that are no longer
3043         needed now that we're assuming C89 or better.
3044
3045         Merge error changes from glibc.
3046
3047         * error.c, error.h: Update copyright notice header to match glibc.
3048         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
3049         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
3050         Disable cancellation while printing error.
3051         * error.h: Prepend __ to parameter names.
3052
3053 2003-09-25  Karl Berry  <karl@gnu.org>
3054
3055         * argp-fmtstream.c, argp-help.c: update from libc.
3056
3057 2003-09-25  Bruno Haible  <bruno@clisp.org>
3058
3059         * version-etc-2.h: New file, from version-etc.h with modifications.
3060         * version-etc-2.c: New file, from version-etc.c with modifications.
3061
3062 2003-09-25  Simon Josefsson  <jas@extundo.com>
3063
3064         * xgetdomainname.h: New file.
3065         * xgetdomainname.c: New file.
3066
3067 2003-09-25  Simon Josefsson  <jas@extundo.com>
3068             Bruno Haible  <bruno@clisp.org>
3069
3070         * getdomainname.h: New file.
3071         * getdomainname.c: New file.
3072
3073 2003-09-24  Paul Eggert  <eggert@twinsun.com>
3074
3075         * linebuffer.c (freebuffer): Don't free the argument, just
3076         the buffer associated with the argument.  Bug reported by
3077         Simon Josefsson.
3078
3079 2003-09-19  Karl Berry  <karl@gnu.org>
3080
3081         * argp.h: update from libc.
3082
3083 2003-09-16  Paul Eggert  <eggert@twinsun.com>
3084
3085         * linebuffer.c (readlinebuffer): Return NULL immediately upon
3086         input error, instead of returning NULL the next time we are called
3087         (and therefore losing track of errno).
3088
3089 2003-09-15  Paul Eggert  <eggert@twinsun.com>
3090
3091         * getndelim2.c (getndelim2): Don't trash errno when a read
3092         fails, so that the caller gets the proper errno.
3093
3094         * readutmp.c (read_utmp): Likewise.
3095         Check for fstat error.  Close stream and free storage
3096         when failing.
3097
3098 2003-09-14  Bruno Haible  <bruno@clisp.org>
3099
3100         * fwriteerror.h: New file.
3101         * fwriteerror.c: New file.
3102
3103 2003-09-14  Jim Meyering  <jim@meyering.net>
3104
3105         * getloadavg.c: Correct cpp indentation.
3106         * strdup.c: Likewise.
3107         * vasnprintf.c: Likewise.
3108
3109 2003-09-12  Paul Eggert  <eggert@twinsun.com>
3110
3111         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
3112         * obstack.c [!defined _LIBC]: Likewise.
3113         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
3114         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
3115         * exitfail.c: Don't include stdlib.h; no longer needed.
3116
3117         More changes to assume C89 or better.
3118
3119         * error.c (error_tail): Assume vprintf.
3120
3121         * argmatch.c (getenv): Remove decl.
3122         * progreloc.c (get_full_program_name): Define via prototype.
3123         * setenv.c (clearenv): Likewise.
3124         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
3125         needed.
3126         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
3127         (malloc, memcpy): Remove decls.
3128         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
3129         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
3130         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
3131         (memcpy): Remove macro.
3132         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
3133         (__P): Remove.  All uses removed.
3134         (PTR): Remove.  All uses changed to void *.
3135         (CHAR_BIT, NULL): Remove.
3136         (spaces, zeros, memset_space, memset_zero)
3137         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
3138         Remove.
3139         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
3140         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
3141         Define with prototype.
3142         Remove now-unnecessary prototype decl.
3143         (extra_args_spec): Assume ANSI C.  All uses changed.
3144         (extra_args_spec_iso): Remove.
3145         (my_strftime, emacs_strftimeu): Define via prototype.
3146         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
3147         unconditionally.
3148         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
3149         * strtoimax.c: Include <stdlib.h> unconditionally.
3150         (strtoul, strtol): Remove decls.
3151         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
3152         LONG_MAX): Remove.
3153         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
3154         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
3155         (LOCALE_PARAM_PROTO): New macro.
3156         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
3157         (INTERNAL (strtol), strtol): Define with a prototype.
3158         (PARAMS): Remove.  All uses removed.
3159         * tempname.c: Include <string.h> unconditionally.
3160         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
3161         * xgethostname.c (main): Define with a prototype.
3162         * xmalloc.c: Include "xalloc.h" first, to check interface.
3163         Include <stdlib.h> unconditionally.
3164         (calloc, malloc, realloc, free): Remove decls.
3165         * xstrtod.c: Include "xstrtod.h" first, to check interface.
3166         Include <stdlib.h> unconditionally.  Sort include file names.
3167         (strtod): Remove.
3168         (xstrtod): Define with a prototype.
3169         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
3170         (strtol, strtoul): Remove decls.
3171
3172 2003-09-11  Paul Eggert  <eggert@twinsun.com>
3173
3174         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
3175         Include <stdlib.h>, <string.h> unconditionally.
3176         Remove now-unnecessary cast to char *.
3177         * strnlen.c: Include <string.h> unconditionally.
3178         * yesno.c (yesno): Define with a prototype.
3179
3180 2003-09-10  Bruno Haible  <bruno@clisp.org>
3181
3182         * strcspn.c: Include <string.h> unconditionally.
3183         * strpbrk.c: Include <string.h> unconditionally.
3184         * strstr.c: Include <string.h> unconditionally.
3185         * unicodeio.c: Include <string.h> unconditionally.
3186         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
3187         * unsetenv.c: Likewise.
3188         * xreadlink.c: Include <stdlib.h> unconditionally.
3189         * yesno.c: Include <stdlib.h> unconditionally.
3190         (rpmatch): Add prototype.
3191
3192 2003-09-10  Jim Meyering  <jim@meyering.net>
3193
3194         * error.c: Correct indentation of cpp directives.
3195
3196 2003-09-09  Paul Eggert  <eggert@twinsun.com>
3197
3198         More K&R removal.
3199
3200         * acosl.c (main): Use a prototype.
3201         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
3202         tanl.c: Likewise.
3203
3204         * getloadavg.c (getloadavg, main): Define via prototypes.
3205
3206         * getopt.h (struct option.name): Assume C89, and use 'const'.
3207         (getopt, etopt_long, getopt_long_only, _getopt_internal)
3208         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
3209         with a prototype.
3210         * getopt.c (const): Remove macro.
3211         Include <string.h> unconditionally.
3212         (my_index): Remove; all uses changed to strchr.
3213         (strlen): Remove decl.
3214         (exchange): Remove forward decl; no longer needed.
3215         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
3216         Define with prototype.
3217         * getopt1.c (const): Remove macro.
3218         (getopt_long, getopt_long_only, main): Define with prototype.
3219
3220         * getugroups.c: Include <string.h> unconditionally.
3221
3222         * getusershell.c: Include <stdlib.h> unconditionally.
3223         (getusershell, setusershell, endusershell, readname, main):
3224         Define with prototypes.
3225
3226         * group-member.c: Include group-member.h first.
3227         Include <stdlib.h> unconditionally.
3228
3229         * hard-locale.c: Include hard-locale.h first.
3230         Include <stdlib.h>, <string.h> unconditionally.
3231
3232         * hash.c (free, malloc): Remove decls.
3233         Include <stdlib.h> unconditionally.
3234
3235         * human.c: Include <stdlib.h>, <string.h> unconditionally.
3236         (getenv): Do not declare.
3237
3238         * idcache.c: Include <string.h> unconditionally.
3239
3240         * long-options.c: Include long-options.h first, to test interface.
3241         Include <stdlib.h> unconditionally.
3242
3243         * makepath.c: Include makepath.h first, to test interface.
3244         Include <stdlib.h> and <string.h> unconditionally.
3245
3246         * linebuffer.c: Include <stdlib.h>.
3247         (free): Remove decl.
3248
3249         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
3250         rpl_malloc returns void *, not char *.
3251         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
3252
3253         * md5.h: Include <limits.h> unconditionally.
3254         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
3255         (__P): Remove; all uses removed.
3256         * md5.c: Include "md5.h" first.
3257         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
3258         md5_buffer, md5_process_bytes, md5_process_block):
3259         Define with prototypes.
3260         * sha.h (__P): Remove all uses.  (It wasn't defined??)
3261         * sha.c: Include "sha.h" first.
3262         Include <stdlib.h>, <string.h> unconditionally.
3263
3264         * memchr.c (__ptr_t): Remove; all uses changed to void *.
3265         * memcmp.c (__ptr_t): Likewise.
3266         * memrchr.c (__ptr_t): Likewise.
3267         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
3268         Include <string.h> unconditionally.
3269         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
3270         * memchr.c: Include <stdlib.h> unconditionally.
3271         * memchr.c (LONG_MAX): Remove.
3272         * memrchr.c (LONG_MAX): Likewise.
3273         * memchr.c (__memchr): Define via a prototype.
3274         * memrchr.c (__memrchr): Likewise.
3275         * memcmp.c (__P): Remove, and remove all uses.
3276         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
3277         Remove forward decls; no longer needed.
3278         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
3279         Use types required by C89 in prototype.
3280
3281         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
3282         * savedir.c: Likewise.
3283         * mkdir.c (free): Remove decl.
3284         * rmdir.c (rmdir): Define with a prototype.
3285         * savedir.c: Include savedir.h first, to test interface.
3286
3287         * mktime.c (STDC_HEADERS): Remove.
3288         Include <stdlib.h>, <string.h> unconditionally.
3289
3290         * modechange.c: Include <stdlib.h> unconditionally.
3291         (malloc): Remove decl.
3292
3293         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
3294         (free): Remove decl.
3295
3296         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
3297         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
3298         (This type really should be intptr_t, but that's a C99ism.)
3299         (_obstack_memcpy): Remove: all uses changed to memcpy.
3300         Include <string.h> unconditionally.
3301         (struct obstack): Assume __STDC__ for types of members
3302         chunkfun, freefun, extra_arg.
3303         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
3304         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
3305         obstack_begin, obstack_specify_allocation,
3306         obstack_specify_allocation_with_arg, obstack_chunkfun,
3307         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
3308         Remove unprototyped decls and the macros that use them.
3309         * obstack.c (POINTER): Remove.  All uses changed to void *.
3310         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
3311         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
3312         (defined __STDC__ && __STDC__)]:
3313         Remove nonprototyped code.
3314         Include <stdlib.h> unconditionally.
3315         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
3316         _obstack_allocated_p, _obstack_free, obstack_free,
3317         _obstack_memory_used, print_and_abort):
3318         Define using prototypes.
3319         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
3320         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
3321         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
3322         obstack_next_free, obstack_object_size, obstack_room) [0]:
3323         Remove unused, unprototyped code.
3324
3325         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
3326
3327         * physmem.c (physmem_total, physmem_available, main): Define
3328         with prototypes.
3329
3330         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
3331         (main): Define with a prototype.
3332
3333         * posixver.c (getenv): Remove decl.
3334
3335         * putenv.c (malloc): Returns void *, not char *.
3336         Include <string.h> unconditionally.
3337         (strchr, memcpy, NULL): Do not define.
3338
3339         * readtokens.c: Include readtokens.h first, to test interface.
3340         Include <stdlib.h>, <string.h> unconditionally.
3341         (init_tokenbuffer): Define with a prototype.
3342
3343         * regex.c (PARAMS): Remove.  All uses removed.
3344         All uses of _RE_ARGS removed, too.
3345         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3346         unconditionally.
3347         (bzero): Assume memset exists.
3348         (memcmp, memcpy, NULL): Remove.
3349         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
3350         char, or assignments to local vars of type signed char.
3351         (init_syntax_once, PREFIX(extract_number_and_incr),
3352         PREFIX(print_partial_compiled_pattern),
3353         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
3354         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
3355         PREFIX(regex_grow_registers), PREFIX(regex_compile),
3356         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
3357         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
3358         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
3359         wcs_compile_range, byte_compile_range, truncate_wchar,
3360         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
3361         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
3362         count_mbs_length, wcs_re_match_2_internal,
3363         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
3364         PREFIX(alt_match_null_string_p),
3365         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
3366         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
3367         regfree, PREFIX(extract_number)): Define with prototype.  Remove
3368         now-unnecessary declaration, if any.
3369         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
3370         regcomp, regexec):
3371         Remove now-unnecessary casts among pointer types.
3372         * regex.h (_RE_ARGS): Remove.  All uses removed.
3373
3374         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
3375         (free): Remove decl.
3376
3377         * rpmatch.c: Include <stdlib.h> unconditionally.
3378
3379         * same.c: Include <stdlib.h>, <string.h> unconditionally.
3380         (free): Remove decl.
3381
3382         * save-cwd.c: Include <stdlib.h> unconditionally.
3383         * xgetcwd.c: Likewise.
3384
3385         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
3386         (free): Remove decl.
3387
3388         * strchrnul.c (strchrnul): Define with a prototype.
3389         Fix bug: c_in was not converted to char before searching.
3390
3391         The following changes are not K&R related:
3392
3393         * group-member.h: Include <sys/types.h>, so that this file is
3394         self-contained.
3395         * makepath.h: Likewise.
3396
3397         * getusershell.c (readname, default_index, line_size, readname):
3398         Use size_t, not int, for sizes.
3399         (readname): If the size overflows, report an error instead of
3400         looping forever.
3401
3402 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
3403
3404         * getndelim2.c: Assume stdlib.h per the C89 spec.
3405
3406 2003-09-08  Paul Eggert  <eggert@twinsun.com>
3407
3408         Assume C89 or better; remove K&R cruft.
3409         A few of these changes were first proposed by Derek Robert Price
3410         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
3411
3412         * addext.c: Include <string.h> unconditionally.
3413         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
3414         Don't declare getenv or malloc.
3415
3416         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
3417         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
3418         (NULL): Remove.
3419         (find_stack_direction, alloca): Use prototypes.
3420
3421         * atexit.c (atexit): Define using a prototype.
3422
3423         * basename.c, dirname.c, stripslash.c:
3424         Include <string.h> unconditionally.
3425
3426         * bcopy.c: Include <stddef.h>.
3427         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
3428
3429         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
3430
3431         * error.h (error, error_at_line, error_print_progname)
3432         [! (defined (__STDC__) && __STDC__)]: Remove decls.
3433         * error.c: Include error.h first, to check interface.
3434         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3435         (VA_START): Remove; all uses changeed to va_start.
3436         (exit, strerror): Remove decls.
3437         (error_print_progname): Prototype uncondionally.
3438         Don't include <errno.h>; no longer needed.
3439         (private_strerror): Remove.
3440         (error_tail): Always define.
3441         (error, error_at_line): Assume C89 or better; always use prototypes.
3442         * fatal.c: Include "fatal.h" first, to test interface.
3443         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
3444         (VA_START): Remove; all uses changed to va_start.
3445         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
3446         this case.
3447         (exit): Remove decl.
3448         (fatal): Prototype unconditionally.  Assume va_start works.
3449         Abort at end, to pacify gcc.
3450
3451         * euidaccess.c (main): Define with a prototype.
3452
3453         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
3454
3455         * exitfail.c: Include <stdlib.h> unconditionally.
3456
3457         * fnmatch_.h (__P): Remove.  All uses changed to assume
3458         prototypes.
3459         * fnmatch.c: Include fnmatch.h first, to test interface.
3460         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
3461         (getenv): Remove decl.
3462         (fnmatch): Define using a prototype.
3463         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
3464         (FCT): Define using a prototype.
3465
3466         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
3467
3468         * gethostname.c: Include <stddef.h>.
3469         (gethostname): Define with prototype.  Length is size_t, not int.
3470
3471 2003-09-08  Paul Eggert  <eggert@twinsun.com>
3472
3473         * getversion.c: Remove; was migrated to backupfile.c in 1997.
3474         getversion.c should have been removed then, but was accidentally
3475         preserved.
3476
3477         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
3478         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
3479
3480 2003-09-07  Paul Eggert  <eggert@twinsun.com>
3481
3482         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
3483         copy_tm_result.  Bug reported by Simon Josefsson in
3484         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
3485
3486 2003-09-06  Paul Eggert  <eggert@twinsun.com>
3487
3488         * time_r.c, time_r.h: New files.
3489
3490         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
3491         __localtime_r.
3492         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
3493         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
3494
3495         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
3496         __gmtime_r.
3497         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
3498         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
3499         Include <time_r.h>.
3500
3501         * timegm.c: Switch to glibc implementation, with the following changes:
3502         [defined HAVE_CONFIG_H]: Include <config.h>.
3503         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
3504         (__mktime_internal) [!defined _LIBC]: New decl.
3505         (__gmtime_r) [!defined _LIBC]: New macro and function.
3506         (timegm): Use a prototype, since gnulib assumes C89.
3507         Do not bother declaring tmp to be const, as it's not really usefu.
3508         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
3509         (timegm): Declare only if HAVE_DECL_TIMEGM.
3510
3511 2003-09-03  Paul Eggert  <eggert@twinsun.com>
3512
3513         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
3514         Bug reported by Lute Kamstra in
3515         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
3516
3517         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
3518         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
3519         course with correspondingly smaller numbers for tomorrow and
3520         yesterday.  From Tadayoshi Funaba.  Originally installed into
3521         sh-utils on 1999-08-07, but the patch got lost (I guess during the
3522         coreutils merge?).
3523
3524 2003-08-31  Simon Josefsson  <jas@extundo.com>
3525
3526         * timegm.h: New file.
3527         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
3528
3529 2003-08-31  Karl Berry  <karl@gnu.org>
3530
3531         * argp.h: update from libc.
3532
3533 2003-08-28  Bruno Haible  <bruno@clisp.org>
3534
3535         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
3536         warning on QNX, which defines O_BINARY to 000000.
3537
3538 2003-08-24  Bruno Haible  <bruno@clisp.org>
3539
3540         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
3541         MSVC7 <stdio.h> is included later.
3542
3543 2003-08-20  Bruno Haible  <bruno@clisp.org>
3544
3545         * progname.h: New file, from GNU gettext.
3546         * progname.c: New file, from GNU gettext.
3547         * progreloc.c: New file, from GNU gettext.
3548
3549 2003-08-19  Bruno Haible  <bruno@clisp.org>
3550
3551         * xstrdup.c: Assume <string.h> exists.
3552
3553 2003-08-18  Jim Meyering  <jim@meyering.net>
3554
3555         * setenv.h: Indent nested cpp directive.
3556         * vasnprintf.c: Remove trailing blanks.
3557
3558 2003-08-17  Simon Josefsson  <jas@extundo.com>
3559             Bruno Haible  <bruno@clisp.org>
3560
3561         * xstrndup.h: New file.
3562         * xstrndup.c: New file.
3563
3564 2003-08-17  Bruno Haible  <bruno@clisp.org>
3565
3566         * strndup.h: New file.
3567
3568 2003-08-16  Paul Eggert  <eggert@twinsun.com>
3569
3570         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
3571         space, undoing this 2003-08-12 change:
3572         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
3573
3574 2003-08-16  Jim Meyering  <jim@meyering.net>
3575
3576         Merge from coreutils.
3577         * xstrtoimax.c: #else #if -> #elif.
3578         * xstrtoumax.c: Likewise.
3579
3580 2003-08-15  Paul Eggert  <eggert@twinsun.com>
3581
3582         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
3583         rather than tab, after '#' in shell-script copyright notices.
3584         Suggested by Bruno Haible.
3585
3586 2003-08-15  Jim Meyering  <jim@meyering.net>
3587         and Paul Eggert  <eggert@twinsun.com>
3588
3589         Merge from coreutils.
3590         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
3591         member but strut utmpx does not.  Needed for AIX 4.3.3.
3592         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
3593
3594 2003-08-15  Jim Meyering  <jim@meyering.net>
3595
3596         Merge from coreutils.
3597         * xgethostname.c: Include <stdlib.h>.
3598         (xghostname): Don't exit for anything other than memory-related
3599         failure; just return NULL.
3600         * userspec.c: Include "posixver.h".
3601         (parse_user_spec): Accept `.' as a separator only
3602         in pre-POSIX-200112 mode.
3603         * strtoimax.c: Use #elif rather than #else #if.
3604         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
3605         Remove function, now that we can rely on a working tzset function.
3606         [!_LIBC]: Ensure that the required autoconf test has been run.
3607         [!defined _NL_CURRENT && HAVE_STRFTIME]:
3608         Use underlying_strftime for %r.
3609         * sha.c: Merge in some clean-up and optimization changes from glibc.
3610         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
3611         Ensure that it is a multiple of 64.
3612         Rearrange loop exit tests so as to avoid performing an
3613         additional fread after encountering an error or EOF.
3614         * realloc.c: Update copyright date.
3615
3616 2003-08-14  Jim Meyering  <jim@meyering.net>
3617
3618         Merge from coreutils.
3619         * obstack.h: Whitespace changes.
3620         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
3621         and xcalloc return values.
3622         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
3623         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
3624         hang on OSF/1 5.1 for DIR on both local and remote file systems.
3625         Reported by (and fix confirmed by) Nelson H. F. Beebe.
3626         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
3627         error from mntctl.
3628         Use mntctl's return value to drive the entry-processing loop, since
3629         we can't rely on the value of the vmt_length member in the last
3630         entry.  On some systems doing so could result in exhausting
3631         virtual memory.  Based in part on a patch from Mike Jetzer.
3632
3633 2003-08-14  Jim Meyering  <jim@meyering.net>
3634         and Paul Eggert  <eggert@twinsun.com>
3635
3636         Merges from coreutils, plus other fixes.
3637         * physmem.c: Merge in portability changes from gcc/libiberty
3638         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
3639         for credits and details.  Thanks to Kaveh Ghazi for helping
3640         to keep these files in sync.
3641         (ARRAY_SIZE): Define it.
3642         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
3643         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
3644         (memcasecmp): Don't assume size_t fits in unsigned int.
3645         Remove casts and duplicate code.
3646         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
3647         (memcpy): Remove definition.
3648         Merge in some clean-up and optimization changes from glibc.
3649         [BLOCKSIZE]: Move definition to top of file.
3650         Ensure that it is a multiple of 64.
3651         Rearrange loop exit tests so as to avoid performing an
3652         additional fread after encountering an error or EOF.
3653         * md5.h (md5_uintptr): Define.
3654         * makepath.c (CLEANUP_CWD): Report an error if we failed to
3655         return to the initial working directory.  Preserve errno
3656         for caller.
3657         * idcache.c: Include "xalloc.h".
3658         (xmalloc, xrealloc): Remove decls.
3659         (getuser): Remove casts no longer required in C89.
3660         * human.c: Include stdio.h, for sprintf.
3661         * group-member.c: Include "xalloc.h".
3662         (xmalloc, xrealloc): Remove decls.
3663         (get_group_info): Remove casts no longer required in C89.
3664         * getusershell.c (readname): Remove casts no longer required in C89.
3665         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
3666         * getline.c: Whitespace fix, from coreutils.
3667
3668 2003-08-13  Paul Eggert  <eggert@twinsun.com>
3669
3670         * exclude.c: Include <ctype.h>
3671         (IN_CTYPE_DOMAIN): New macro.
3672         (is_space): New fn.
3673         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
3674         and empty lines.
3675
3676         * argp-help.c, argp-parse.c, config.charset, getopt.h:
3677         Undo previous (whitespace-only) change.
3678
3679 2003-08-12  Paul Eggert  <eggert@twinsun.com>
3680
3681         * argp-help.c, argp-parse.c, config.charset, getopt.h:
3682         Normalize leading white space and remove trailing white space.
3683         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
3684         notice, as per ../config/srclist-update.
3685
3686         Merge from coreutils.
3687         * euidaccess.h: New file.
3688         * euidaccess.c: Include it.
3689         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
3690         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
3691         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
3692
3693 2003-08-11  Bruno Haible  <bruno@clisp.org>
3694
3695         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
3696         (vasnprintf): Use it instead of wcslen.
3697
3698 2003-08-11  Bruno Haible  <bruno@clisp.org>
3699
3700         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
3701         value to ensure that _Bool promotes to int. Use #define for _Bool when
3702         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
3703
3704 2003-08-10  Karl Berry  <karl@gnu.org>
3705
3706         * regex.h: update from libc (whitespace fix).
3707
3708 2003-08-09  Paul Eggert  <eggert@twinsun.com>
3709
3710         Merge some files from coreutils.  These changes were
3711         originally made by Jim Meyering.
3712         * acl.c: Include <sys/types.h> before <sys/stat.h>;
3713         many older Unixes require this.
3714         * alloca.c (alloca): Remove cast to argument of free;
3715         no longer needed in C89.
3716         * alloca_.h, regex.h: Fix white space to match
3717         what GNU indent does.
3718
3719 2003-08-05  Paul Eggert  <eggert@twinsun.com>
3720
3721         * bumpalloc.h: Remove.
3722
3723 2003-08-04  Paul Eggert  <eggert@twinsun.com>
3724
3725         * getloadavg.c: Change copyright notice and spacing to conform to
3726         GNU coding style.
3727
3728         Merge from coreutils.
3729         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
3730         From glibc.
3731         * getdate.y (date): Also accept dates like May-23-2003; suggestion
3732         from Karl Berry, implemented by Jim Meyering.
3733         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
3734         from Dmitry V. Levin.
3735         Remove anachronistic cast of xrealloc.
3736         * fnmatch_.h (__const): Remove.  Use 'const'.
3737         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
3738         type. Otherwise, it wouldn't compile with at least /bin/cc on
3739         ymp-cray-unicos9.0.2.X.
3740         Combine two mostly-identical uses of alloca into one.
3741         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
3742
3743 2003-08-04  Dave Love <d.love@dl.ac.uk>
3744
3745         [From Emacs.]
3746
3747         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
3748         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
3749         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
3750         obsolete NLIST_NAME_UNION.
3751         [__GNU__]: Undef BSD and FSCALE.
3752         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
3753
3754 2003-08-03  Paul Eggert  <eggert@twinsun.com>
3755
3756         * stdbool_.h (_Bool): Make it signed char, instead of
3757         an enum type, so that it's guaranteed to promote to int.  See:
3758         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
3759
3760 2003-07-31  Paul Eggert  <eggert@twinsun.com>
3761
3762         * strerror.c: Include config.h, limits.h.  Declare sprintf.
3763         (strerror): Don't assume that a printable int fits in 14 bytes.
3764
3765 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
3766             Bruno Haible  <bruno@clisp.org>
3767
3768         * getline.h (getline, getdelim): Change return type to ssize_t.
3769         * getline.c (getline, getdelim): Likewise.
3770         Remove _GNU_SOURCE define; now it's defined in config.h through
3771         m4/getline.m4.
3772
3773 2003-07-22  Paul Eggert  <eggert@twinsun.com>
3774
3775         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
3776         over-parenthesization in macros.
3777
3778         Sync with coreutils.
3779
3780         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
3781         required by C99.
3782
3783         Use `exit_failure' for xalloc and xmemcoll instead of their own
3784         private exit-failure variables.
3785         * xalloc.h (xalloc_exit_failure): Remove.
3786         * xmalloc.c: Likewise.  Include exitfail.h.
3787         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
3788         * xmemcoll.h (xmemcoll_exit_failure): Remove.
3789         * xmemcoll.c: Likewise.  Include exitfail.h.
3790         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
3791
3792 2003-07-18  Paul Eggert  <eggert@twinsun.com>
3793
3794         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
3795         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
3796         to test that it can stand by itself.  Include "exitfail.h".
3797         Clients should set exit_failure instead.
3798         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
3799
3800 2003-07-18  Andreas Schwab  <schwab@suse.de>
3801
3802         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
3803
3804 2003-07-18  Bruno Haible  <bruno@clisp.org>
3805
3806         * getndelim2.h: New file.
3807         * getndelim2.c: Make into a module of its own. Include config.h,
3808         getndelim2.h.
3809         (getndelim2): Make non-static. Change return type to ssize_t.
3810         * getline.h: Change argument names.
3811         * getline.c: Include getndelim2.h instead of getndelim2.c.
3812         * getnline.c: Include getndelim2.h.
3813
3814 2003-07-17  Bruno Haible  <bruno@clisp.org>
3815
3816         * Makefile.am: Remove file.
3817         * Makefile.in: Remove file.
3818
3819 2003-07-17  Bruno Haible  <bruno@clisp.org>
3820
3821         * getnline.h: New file.
3822         * getnline.c: New file.
3823         * getndelim2.c: New file, extracted from getline.c.
3824         (getndelim2): Renamed from getdelim2, with added nmax argument.
3825         * getline.c: Include getndelim2.c.
3826         (getdelim2): Moved out to getndelim2.c.
3827         (getline, getdelim): Update.
3828
3829 2003-07-15    <karl@gnu.org>
3830
3831         * vasnprintf.c: update from gettext.
3832
3833 2003-07-15  Jim Meyering  <jim@meyering.net>
3834
3835         * makepath.c (make_path): Enclose diagnostic in _(...).
3836
3837 2003-07-14  Paul Eggert  <eggert@twinsun.com>
3838
3839         * asnprintf.c, asprintf.c, config.charset, gettext.h,
3840         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
3841         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
3842         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
3843         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
3844         updated automatically by ../config/srclist-update.  This changes
3845         their license from LPGL to GPL.
3846
3847 2003-07-14  Jim Meyering  <jim@meyering.net>
3848
3849         Don't emit diagnostics.  Let callers do that.
3850         * save-cwd.c: Don't include "error.h".
3851         (save_cwd): Don't call error.  Ensure that errno is valid
3852         when returning nonzero.
3853
3854         * save-cwd.h (restore_cwd): Update prototype.
3855         * save-cwd.c (restore_cwd): Remove two parameters.
3856         Simplify.  Don't call error upon failure.  Let callers do that.
3857         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
3858         when auditing is enabled.  But don't bother updating the #if.
3859
3860 2003-07-14  Simon Josefsson  <jas@extundo.com>
3861
3862         * mempcpy.h: New file.
3863         * mempcpy.c: New file.
3864
3865 2003-07-14  Paul Eggert  <eggert@twinsun.com>
3866
3867         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
3868         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
3869         unicodeio.c, unicodeio.h, unlocked-io.h:
3870         Switch from LGPL to GPL.
3871
3872 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
3873
3874         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
3875         it breaks C++ compilation.
3876         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
3877
3878 2003-07-10  Jim Meyering  <jim@meyering.net>
3879
3880         * vasnprintf.c: Remove trailing blanks.
3881         Make cpp indentation consistent.
3882
3883 2003-07-09  Paul Eggert  <eggert@twinsun.com>
3884
3885         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
3886         posixver.c, strftime.c, strnlen.c, strverscmp.c:
3887         Switch from LGPL to GPL.
3888
3889 2003-07-07  Paul Eggert  <eggert@twinsun.com>
3890
3891         * mktime.c: Fix some boundary cases and remove need for floating point.
3892
3893         Issue a compile-time diagnostic if time_t is floating point, or if
3894         two's complement arithmetic is not in effect, or if arithmetic
3895         right shift does not propagate the sign.  These assumptions were
3896         all in the original code but they weren't checked.
3897
3898         (TIME_T_MIDPOINT, verify): New macros.
3899         (__isleap): Remove; it has integer overflow problems.
3900         (leapyear): New function, without those problems.
3901         (ydhms_tm_diff): Remove; splitting into two parts.
3902         (ydhms_diff): New function, containing the arithmetic part of
3903         the old ydhms_tm_diff function.  Issue a compile-time
3904         diagnostic if we are not using C99 integer division.
3905         Avoid casts when possible.
3906         (guess_time_tm): New function, containing the checking part of
3907         the old ydhms_tm_diff function.  Return the new value, rather than
3908         the difference between it and the old.  Accept a new argument T
3909         so that *T specifies the old value.  Check for overflow in the result.
3910
3911         (__mktime_internal): Use a time_t offset, not a long int offset.
3912         This undoes the 2003-06-04 change, which is no longer needed now
3913         that we have better overflow checking.
3914         (localtime_offset): Likewise.
3915
3916         (__mktime_internal): Avoid harmful overflow on hosts where time_t
3917         and long are 64-bit but int is only 32-bit.
3918         (ydhms_diff): Use long int to store year1 and yday1.
3919         Issue a compile-time diagnostic if long int is not wide enough.
3920
3921         (__mktime_internal): Use long int to store adjusted year and yday.
3922         Use plain C rather than preprocessor commands, if that doesn't
3923         affect efficiency.
3924         Check for overflow (and try to repair) after each probe
3925         rather than checking only at the very end.  This avoids some bugs
3926         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
3927         does not equal GMT offset at maximum time).
3928         Use integer to check for overflow rather than floating point; this
3929         is more portable to non-IEEE hosts, and is a tad faster.
3930         When we detect that we are oscillating between two values,
3931         don't check whether tm_isdst has the requested value, since
3932         we already know the answer.  When tm_isdst has the wrong value,
3933         use a different heuristic to find the right one, based on the
3934         extreme values actually observed in practice in tz2003a,
3935         rather than the (overly optimistic) "previous 3 calendar quarters".
3936
3937         (not_equal_tm, print_tm, check_result): Use "const T" rather than
3938         "T const" to accommodate glibc style.
3939         (check_result): Use less-confusing report format.  "long" -> "long int.
3940         (main): Likewise.
3941         Don't loop if the iteration overflows time_t.
3942         Allow a negative step in the iteration.
3943
3944 2003-07-01  Paul Eggert  <eggert@twinsun.com>
3945
3946         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
3947         having it depend on HAVE_SYS_TYPES_H.
3948
3949 2003-06-25  Bruno Haible  <bruno@clisp.org>
3950
3951         * readlink.c: New file.
3952
3953 2003-06-20  Bruno Haible  <bruno@clisp.org>
3954
3955         Assume C89, so PARAMS isn't needed.
3956         * unicodeio.h (PARAMS): Remove.
3957         * unicodeio.c: Don't use PARAMS.
3958
3959 2003-06-18  Jim Meyering  <jim@meyering.net>
3960
3961         Merge changes from coreutils.
3962         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
3963         Remove explicit declarations of xmalloc and realloc.
3964         Include xalloc.h.
3965         (read_utmp): Remove anachronistic cast of xmalloc.
3966
3967 2003-06-17  Paul Eggert  <eggert@twinsun.com>
3968
3969         Assume C89, so PARAMS isn't needed.
3970         * backupfile.h (PARAMS): Remove.  All uses removed.
3971         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
3972         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
3973         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
3974         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
3975         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
3976         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
3977         xstrtol.h: Likewise.
3978         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
3979         same.h, strverscmp.h: Do not include config.h; no longer needed.
3980         Anyway, config.h should always be included before any other file.
3981
3982 2003-06-11  Simon Josefsson  <jas@extundo.com>
3983
3984         * sysexit_.h: New file.
3985
3986 2003-05-20  Derek Price  <derek@ximbiot.com>
3987
3988         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
3989
3990 2003-06-10  Simon Josefsson  <jas@extundo.com>
3991
3992         * strchrnul.h: New file.
3993         * strchrnul.c: New file.
3994
3995 2003-06-10  Simon Josefsson <jas@extundo.com>
3996
3997         * argp.h: New file, from glibc.
3998         * argp-ba.c: New file, from glibc.
3999         * argp-eexst.c: New file, from glibc.
4000         * argp-fmtstream.c: New file, from glibc.
4001         * argp-fmtstream.h: New file, from glibc.
4002         * argp-fs-xinl.c: New file, from glibc.
4003         * argp-help.c: New file, from glibc.
4004         * argp-namefrob.h: New file, from glibc.
4005         * argp-parse.c: New file, from glibc.
4006         * argp-pv.c: New file, from glibc.
4007         * argp-pvh.c: New file, from glibc.
4008         * argp-xinl.c: New file, from glibc.
4009
4010 2003-06-07  Jim Meyering  <jim@meyering.net>
4011
4012         * readtokens.h: Put `Free Software Foundation, Inc.'
4013         in place of my name in the copyright comment.
4014         Remove definition and uses of __P.
4015
4016         From coreutils.
4017         * stat.c: Don't declare xmalloc explicitly.
4018         Instead, include "xalloc.h".
4019         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
4020         xrealloc, and xcalloc return values.
4021         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
4022         Improve comment.
4023         * xgetcwd.h: Remove definition/uses of PARAMS.
4024
4025 2003-06-06  Jim Meyering  <jim@meyering.net>
4026
4027         * stdbool_.h: Renamed from stdbool.h.in.
4028
4029 2003-06-06  Jim Meyering  <jim@meyering.net>
4030
4031         Merge from coreutils.
4032         * same.c: (same_name): Declare *_basename locals to be `const'.
4033         Consolidate declarations and initializations of *_base* locals.
4034
4035         Merge from coreutils.
4036         This avoids a core dump on systems without GNU putenv,
4037         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
4038         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
4039         (unsetenv): New static function, from GNU libc.
4040         (rpl_putenv): Use it.
4041
4042         * modechange.c: Remove trailing blanks.
4043
4044         Merge from coreutils.
4045         * fsusage.c: Remove declaration of statfs.
4046         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
4047
4048         * posixtm.c: Include <stdbool.h> unconditionally.
4049
4050 2003-06-05  Paul Eggert  <eggert@twinsun.com>
4051
4052         * mktime.c (__mktime_internal): When resolving a tm_isdst
4053         mismatch, look in future quarters as well as past.  This fixes a
4054         bug when processing fall-backwards gaps immediately after a long
4055         period of daylight-saving time.
4056
4057         * mktime.c: Assume freestanding C89 or better.
4058         (HAVE_LIMITS_H): Remove.  Assume it's 1.
4059         (__P): Remove; not used.
4060         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
4061         (mktime, not_equal_tm, print_tm, check_result,
4062         main): Use prototypes.  Use const * where appropriate.
4063         (main): Fix typo in testing code that uncovered by above changes.
4064         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
4065
4066 2003-06-04  Paul Eggert  <eggert@twinsun.com>
4067
4068         * mktime.c: Fix Debian bug 177940
4069         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
4070         (localtime_offset): Now long int, not time_t, because we want it
4071         to be guaranteed to be signed.  All uses changed.
4072         (__mktime_internal): If overflow would occur when adding offset,
4073         don't add it.
4074
4075         Merge 'human' changes from coreutils.  Rewrite to support
4076         locale-specific notations like thousands separators.
4077         * human.c: Simplify authorship notice.
4078         Include human.h immediately after config.h.
4079         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
4080         <limits.h>: Do not include, since human.h does.
4081         (SIZE_MAX, UINTMAX_MAX): New macros.
4082         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
4083         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
4084         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
4085         (power_letter): Renamed from suffixes.
4086         (generate_suffix_backwards): Remove.
4087         (adjust_value): Now takes int style (because of human.h changes)
4088         and long double value (for greater precision on some platforms).
4089         (group_number): New function.
4090         (human_readable): Use it.  Use integer options, not enum.
4091         Put the options before the sizes in the arg list.
4092         Support all the new options.
4093         The old human_readable function has been removed;
4094         use inttostr.h instead.
4095         (human_readable, default_block_size, humblock):
4096         Use uintmax_t, not int, for block sizes.
4097         (human_readable_inexact, block_size_types): Remove.
4098         (block_size_opts): New constant.
4099         (human_options): Renamed from human_block_size, with new signature
4100         that allows block sizes up to UINTMAX_MAX.  All callers changed.
4101         * human.h: Add copyright and authorship notice.
4102         Include <limits.h> and <stdbool.h> unconditionally.
4103         (PARAMS): Remove.  All uses removed.
4104         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
4105         (enum human_inexact_style): Remove tag; now a nameless enum.
4106         (human_floor, human_ceiling, human_round_to_even): Now have
4107         values 2, 0, 1 rather than -1, 1, 0.
4108         (human_group_digits, human_suppress_point_zero, human_autoscale,
4109         human_base_1024, human_SI, human_B): New constants.
4110         (human_readable_inexact, human_block_size): Remove.
4111         (human_readable): Size args are now uintmax_t, not int.
4112         (human_options): New decl.
4113
4114         * exclude.c: (new_exclude, add_exclude): Remove casts that are
4115         unnecessary now that we assume C89 or better.  This change
4116         imported from coreutils.
4117
4118         * mktime.c (__mktime_internal): Do not reject negative timestamps
4119         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
4120         in the 2003-05-30 sync from glibc.
4121
4122         .h files should stand alone, but we shouldn't include <sys/types.h>
4123         if we can get away with just <stddef.h>.
4124
4125         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
4126         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
4127         rather than <sys/types.h>, as we merely need size_t.
4128         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
4129         to get size_t.
4130         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
4131         Include <stdio.h>, to get FILE.
4132         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
4133         memcasecmp.h has included <stddef.h> and all we need is size_t.
4134         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
4135         our interface, instead of including <sys/types.h>
4136
4137 2003-06-02  Paul Eggert  <eggert@twinsun.com>
4138
4139         [from coreutils]
4140         Fix some minor time-related bugs with POSIX time arguments.
4141         Some valid time stamps were being rejected (notably -1, and
4142         time stamps before 1900 on 64-bit hosts).  And some invalid
4143         time stamps were being accepted, e.g. September 31.
4144
4145         * posixtm.h (posixtime): Return bool instead of time_t, so
4146         that we can return (time_t) -1 successfully.
4147         * posixtm.c: Likewise.
4148         [HAVE_STDBOOL_H]: Include <stdbool.h>.
4149         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
4150         (t): Remove static var.
4151         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
4152         of static var.  All uses changed.
4153         (year): Do not reject years before 1900; they can occur with
4154         64-bit time_t.
4155         (posix_time_parse): Do not check for out-of-range components;
4156         that is now the caller's responsibility, since our checks were
4157         only approximations.
4158         (posixtime): Use mktime to check for out-of-range components,
4159         since it knows them exactly.
4160         If mktime returns (time_t) -1, check whether an error actually occurred
4161         by invoking localtime on -1.
4162         (main) [TEST_POSIXTIME]: Check for input data errors, and report
4163         posixtime failures better.
4164         Improve the test data (in comments only).
4165
4166 2003-05-30    <karl@gnu.org>
4167
4168         * mktime.c: update from libc.
4169
4170 2003-05-30  Bruno Haible  <bruno@clisp.org>
4171
4172         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
4173         * localcharset.h: Likewise.
4174         * localcharset.c: Likewise.
4175
4176 2003-05-28  Paul Eggert  <eggert@twinsun.com>
4177
4178         Assume the headers required for C89 freestanding compilers.
4179         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
4180         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
4181         without checking for HAVE_LIMITS_H.
4182         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
4183         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
4184         to do that.
4185         * fatal.c: Include <stdarg.h> without checking for __STDC__.
4186         * exclude.c: Include <stdbool.h> unconditionally.
4187         * tempname.c: Include <stddef.h> unconditionally.
4188         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
4189         * modechange.c, rpmatch.c (NULL): Don't define, since
4190         <stddef.h> does that.
4191         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
4192         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
4193         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
4194         * xstrtol.c: Likewise.
4195         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
4196         * savedir.c: Include <stddef.h> instead of defining NULL.
4197
4198         * addext.c (addext): Use assignment rather than cast, to avoid
4199         warnings on some platforms.
4200
4201         * mktime.c (__mktime_internal): Do not reject negative timestamps
4202         arbitrarily.
4203
4204 2003-05-10  Bruno Haible  <bruno@clisp.org>
4205
4206         * linebreak.c (iconv_string_length): Don't return -1 just because the
4207         string is longer than 4 KB.
4208
4209 2003-05-12  Jim Meyering  <jim@meyering.net>
4210
4211         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
4212         the space-padded-by-default conversion specifiers, %e, %k, %l.
4213
4214 2003-05-03  Bruno Haible  <bruno@clisp.org>
4215
4216         Upgrade to Unicode-4.0.
4217         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
4218         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
4219         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
4220         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
4221         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
4222         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
4223         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
4224         Change width of U+E0100..U+E01EF from 1 to 0.
4225
4226 2003-04-25  Bruno Haible  <bruno@clisp.org>
4227
4228         * copy-file.c: Include <stddef.h>, for size_t.
4229
4230 2003-04-25  Jim Meyering  <jim@meyering.net>
4231
4232         * copy-file.c (copy_file_preserving): Declare buf_size to be
4233         of type size_t, not int.
4234
4235 2003-04-11  Jim Meyering  <jim@meyering.net>
4236
4237         Merge changes from Coreutils.
4238
4239         2003-03-22  Jim Meyering  <jim@meyering.net>
4240
4241         * strftime.c (widen): Cast alloca return value to proper type.
4242
4243         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
4244
4245         From GNU libc.
4246         * strftime.c (my_strftime): Handle very large width
4247         specifications for numeric values correctly.  Improve checks for
4248         overflow.
4249
4250         2003-01-19  Jim Meyering  <jim@meyering.net>
4251
4252         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
4253         (nl_get_alt_digit) [! defined my_strftime]: Define.
4254         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
4255         _nl_get_alt_digit and _nl_get_walt_digit.
4256
4257         * strftime.c (my_strftime): Merge in locale-related changes from libc.
4258         These changes have no effect outside of _LIBC.
4259
4260 2003-04-10  Bruno Haible  <bruno@clisp.org>
4261
4262         * findprog.h: New file, from GNU gettext.
4263         * findprog.c: New file, from GNU gettext.
4264
4265 2003-04-05  Jim Meyering  <jim@meyering.net>
4266
4267         Merge changes from Coreutils.
4268
4269         * exclude.h (PARAMS): Remove definition and uses.
4270         * exclude.c: Remove uses of `PARAMS'.
4271
4272         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
4273         Add test-cases for DOS filenames. Declare program_name.
4274         (main): Set up program_name.  Patch by Rich Dawe.
4275
4276         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
4277         error from mntctl.
4278         Use mntctl's return value to drive the entry-processing loop, since
4279         we can't rely on the value of the vmt_length member in the last
4280         entry.  On some systems doing so could result in exhausting
4281         virtual memory.  Based in part on a patch from Mike Jetzer.
4282
4283 2003-04-04  Bruno Haible  <bruno@clisp.org>
4284
4285         * linebreak.h: New file, from GNU gettext.
4286         * linebreak.c: New file, from GNU gettext with slight modifications.
4287         * lbrkprop.h: New file, from GNU gettext.
4288
4289 2003-04-03  Bruno Haible  <bruno@clisp.org>
4290
4291         * utf8-ucs4.h: New file, from GNU gettext.
4292         * utf16-ucs4.h: New file, from GNU gettext.
4293         * ucs4-utf8.h: New file, from GNU gettext.
4294         * ucs4-utf16.h: New file, from GNU gettext.
4295
4296 2003-04-02  Bruno Haible  <bruno@clisp.org>
4297
4298         * binary-io.h: New file, from GNU gettext.
4299
4300 2003-04-01  Bruno Haible  <bruno@clisp.org>
4301
4302         * pathname.h: New file, from GNU gettext.
4303         * concatpath.c: New file, from GNU gettext.
4304
4305 2003-03-30  Bruno Haible  <bruno@clisp.org>
4306
4307         * copy-file.c (copy_file_preserving): Don't set owner if the function
4308         chown() doesn't exist.
4309
4310 2003-03-28  Bruno Haible  <bruno@clisp.org>
4311
4312         * copy-file.h: New file, from GNU gettext.
4313         * copy-file.c: New file, from GNU gettext.
4314
4315 2003-03-18  Jim Meyering  <jim@meyering.net>
4316
4317         * quote.c (quote_n): Fix typo in comment.
4318
4319 2003-03-14  Jim Meyering  <jim@meyering.net>
4320
4321         Merge changes from Coreutils.
4322         * obstack.h (obstack_object_size): Declare temporary, __o,
4323         to be const, in order to avoid warnings.
4324         (obstack_room): Likewise.
4325         (obstack_empty_p): Likewise.
4326
4327 2003-03-13  Paul Eggert  <eggert@twinsun.com>
4328
4329         Merge changes from Bison.
4330         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
4331         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
4332         when compiling Bison 1.875's `bitset bset = obstack_alloc
4333         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
4334         * hash.c: Include <stdbool.h> unconditionally.
4335
4336 2003-03-09  Paul Eggert  <eggert@twinsun.com>
4337
4338         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
4339         Reported by Bruce Becker; see:
4340         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
4341
4342 2003-03-03  Paul Eggert  <eggert@twinsun.com>
4343             Bruno Haible  <bruno@clisp.org>
4344
4345         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
4346         Reported by John Hughes, see
4347         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
4348
4349 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
4350
4351         * poll_.h: New file.
4352         * poll.c: New file.
4353
4354 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
4355
4356         * mathl.h: New file.
4357         * acosl.c: New file.
4358         * asinl.c: New file.
4359         * atanl.c: New file.
4360         * ceill.c: New file.
4361         * cosl.c: New file.
4362         * expl.c: New file.
4363         * floorl.c: New file.
4364         * frexpl.c: New file.
4365         * ldexpl.c: New file.
4366         * logl.c: New file.
4367         * sincosl.c: New file.
4368         * sinl.c: New file.
4369         * sqrtl.c: New file.
4370         * tanl.c: New file.
4371         * trigl.c: New file.
4372         * trigl.h: New file.
4373
4374 2003-02-17  Bruno Haible  <bruno@clisp.org>
4375
4376         * mkdtemp.h: New file, from GNU gettext.
4377         * mkdtemp.c: New file, from GNU gettext.
4378
4379 2003-01-31  Bruno Haible  <bruno@clisp.org>
4380
4381         * rename.c: #undef rename before defining rpl_rename.
4382         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
4383
4384 2003-01-30  Bruno Haible  <bruno@clisp.org>
4385
4386         * printf-args.h: New file, from GNU gettext.
4387         * printf-args.c: New file, from GNU gettext.
4388         * printf-parse.h: New file, from GNU gettext.
4389         * printf-parse.c: New file, from GNU gettext.
4390         * vasnprintf.h: New file, from GNU gettext.
4391         * vasnprintf.c: New file, from GNU gettext.
4392         * asnprintf.c: New file, from GNU gettext.
4393         * vasprintf.h: New file, from GNU gettext with modifications.
4394         * vasprintf.c: New file, from GNU gettext.
4395         * asprintf.c: New file, from GNU gettext.
4396
4397 2003-01-29  Bruno Haible  <bruno@clisp.org>
4398
4399         * stpncpy.h: New file, from GNU gettext with modifications.
4400         * stpncpy.c: New file, from GNU gettext with modifications.
4401
4402 2003-01-28  Bruno Haible  <bruno@clisp.org>
4403
4404         * c-ctype.h: New file, from GNU gettext, with changes suggested by
4405         Paul Eggert.
4406         * c-ctype.c: New file, from GNU gettext, with changes suggested by
4407         Paul Eggert.
4408
4409 2003-01-27  Bruno Haible  <bruno@clisp.org>
4410
4411         * xsetenv.h: New file, from GNU gettext.
4412         * xsetenv.c: New file, from GNU gettext.
4413
4414 2003-01-23  Bruno Haible  <bruno@clisp.org>
4415
4416         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
4417
4418 2003-01-22  Bruno Haible  <bruno@clisp.org>
4419
4420         * exit.h: New file, from GNU gettext.
4421
4422 2003-01-11  Bruno Haible  <bruno@clisp.org>
4423
4424         * stpcpy.h (stpcpy): Use ANSI C function declarations.
4425         * strcase.h (strcasecmp, strncasecmp): Likewise.
4426
4427 2003-01-14  Jim Meyering  <jim@meyering.net>
4428
4429         * same.c (same_name): Tweak a comment.
4430
4431 2003-01-11  Bruno Haible  <bruno@clisp.org>
4432
4433         * same.c (same_name): Reorder tests so as to avoid calling stat()
4434         when a string comparison is sufficient.
4435
4436 2003-01-11  Bruno Haible  <bruno@clisp.org>
4437
4438         * readtokens.c (readtoken): Cast character to 'unsigned char', not
4439         'unsigned int'.
4440
4441 2003-01-11  Bruno Haible  <bruno@clisp.org>
4442
4443         * hash-pjw.c: Add comment about low quality of this function.
4444
4445 2003-01-12  Paul Eggert  <eggert@twinsun.com>
4446
4447         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
4448         to avoid collisions with libcurses and libreadline.
4449
4450         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
4451         * getstr.h, getstr.c: Remove.
4452         * getline.c: Include "getline.h", to check interface.
4453         Move body of old getstr.c here: this defines MIN_CHUNK and
4454         declares getdelim2, which is renamed from getstr.
4455         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
4456
4457         * linebuffer.c (readlinebuffer): Renamed from readline.
4458         All uses changed.
4459         * linebuffer.h: Likewise.
4460         (readline): Remove backward-compatibility macro.
4461
4462 2003-01-12  Jim Meyering  <jim@meyering.net>
4463
4464         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
4465
4466 2003-01-10  Bruno Haible  <bruno@clisp.org>
4467
4468         * alloca_.h: New file.
4469         * getdate.y: Unconditionally include alloca.h.
4470         * makepath.c: Likewise.
4471         * setenv.c: Likewise.
4472         * userspec.c: Likewise.
4473
4474 2003-01-09  Bruno Haible  <bruno@clisp.org>
4475
4476         * stdbool.h.in: New file.
4477
4478 2003-01-08  Bruno Haible  <bruno@clisp.org>
4479
4480         * safe-read.c: Include specification header first, to ensure its
4481         selfcontainedness.
4482         * full-write.c: Likewise.
4483
4484 2003-01-08  Jim Meyering  <jim@meyering.net>
4485
4486         * full-write.c: Undefine and define-away `const' after inclusion
4487         of errno.h, not before.  Suggestion from Bruno Haible.
4488
4489 2003-01-07  Jim Meyering  <jim@meyering.net>
4490
4491         * full-write.c: Rework so that it may serve to define full_read, too.
4492         * full-read.c: Simply #define FULL_READ and include full-write.c.
4493
4494 2003-01-06  Jim Meyering  <jim@meyering.net>
4495
4496         * version-etc.c: Update year in translatable copyright string.
4497
4498 2002-12-25  Bruno Haible  <bruno@clisp.org>
4499
4500         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
4501         * xstrtol.h: Likewise.
4502         * xstrtoimax.c: Likewise.
4503         * xstrtoumax.c: Likewise.
4504         * human.h: Likewise.
4505
4506         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
4507         on systems that have <inttypes.h> but not <stdint.h>.
4508
4509 2002-12-31  Paul Eggert  <eggert@twinsun.com>
4510
4511         * memcoll.c (memcoll): Fall back on a simple algorithm using
4512         memcmp if strcoll doesn't work.
4513
4514 2002-12-23  Bruno Haible  <bruno@clisp.org>
4515
4516         * localcharset.h: New file.
4517         * localcharset.c: Include it.
4518         * unicodeio.c: Likewise.
4519
4520 2002-12-22  Bruno Haible  <bruno@clisp.org>
4521
4522         * utime.c (utime_null): No need to call ftruncate if the file was
4523         nonempty.
4524
4525 2002-12-23  Bruno Haible  <bruno@clisp.org>
4526
4527         * memcoll.c (STRCOLL): New macro.
4528         (memcoll): Use it.
4529
4530 2002-12-22  Bruno Haible  <bruno@clisp.org>
4531
4532         * getstr.h (getstr): Define, to avoid clash with libcurses.
4533         * linebuffer.h (readline): Define, to avoid clash with libreadline.
4534
4535 2002-12-22  Bruno Haible  <bruno@clisp.org>
4536
4537         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
4538
4539 2002-12-23  Bruno Haible  <bruno@clisp.org>
4540
4541         * getline.h: Include <stddef.h>, for size_t.
4542
4543         * unicodeio.h: Include <stddef.h>, for size_t.
4544         * unicodeio.c: Don't include <stddef.h>.
4545
4546 2002-12-17  Bruno Haible  <bruno@clisp.org>
4547
4548         * canon-host.c (strdup): Remove unused declaration.
4549
4550         * fsusage.c: Include full_read.h.
4551         (get_fs_usage): Use full_read instead of safe_read.
4552
4553         * utime.c (utime_null): Use SAFE_READ_ERROR.
4554
4555 2002-12-11  Bruno Haible  <bruno@clisp.org>
4556
4557         * setenv.h: Rewritten to cope with systems that have setenv() but not
4558         unsetenv().
4559         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
4560         modifications:
4561
4562         2002-12-11  Bruno Haible  <bruno@clisp.org>
4563
4564                 * setenv.c (alloca): Fall back to malloc.
4565                 (freea): New macro.
4566                 (setenv): Use freea() to free memory allocated with alloca().
4567
4568         2002-11-13  Bruno Haible  <bruno@clisp.org>
4569
4570                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
4571                 function declarations.
4572                 * unsetenv.c (unsetenv): Likewise.
4573
4574         2002-03-04  Bruno Haible  <bruno@clisp.org>
4575
4576                 Portability to AIX 4.3.3.
4577                 * unsetenv.c: New file, extracted from setenv.c.
4578                 * setenv.c: Move the unsetenv() function to unsetenv.c.
4579
4580         2001-12-20  Bruno Haible  <bruno@clisp.org>
4581
4582                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
4583                 use malloc instead. For SunOS 4.
4584
4585         2001-12-11  Bruno Haible  <bruno@clisp.org>
4586
4587                 * setenv.c: Declare alloca.
4588                 (compar_fn_t): New typedef.
4589                 (KNOWN_VALUE, STORE_VALUE): Use it.
4590
4591         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
4592         setenv.h.
4593
4594 2002-12-10  Paul Eggert  <eggert@twinsun.com>
4595
4596         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
4597         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
4598         Choose values that are less likely to collide with system fnmatch
4599         options.
4600         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
4601         defined (e.g., a pure POSIX system).
4602         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
4603         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
4604
4605 2002-12-06  Jim Meyering  <jim@meyering.net>
4606
4607         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
4608
4609         Merge in changes from libc's misc/error.c, in preparation
4610         for the merge of gnulib's changes back into libc.
4611
4612         * error.c (_): Define only if not already defined.
4613         Move definition to follow all #include directives.
4614         Include unlocked-io.h only if !_LIBC.
4615         [_LIBC]: Include <libio/libioP.h>.
4616         [USE_IN_LIBIO]: Include <libio/iolibio.h>
4617         (fflush): Tweak definition to use INTUSE.
4618         (putc): Define.
4619
4620 2002-12-05  Paul Eggert  <eggert@twinsun.com>
4621
4622         * alloca.c [defined emacs]: Include "lisp.h".
4623         (xalloc_die) [defined emacs]: New macro.
4624         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
4625         [! defined emacs]: Include <xalloc.h>.
4626         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
4627         (pointer): Typedef to POINTER_TYPE *.
4628         (malloc): Remove decl; we now always use xmalloc.
4629         (alloca): Use old-style definition, since Emacs needs this.
4630         Check for arithmetic overflow when computing combined size.
4631
4632 2002-12-04  Paul Eggert  <eggert@twinsun.com>
4633
4634         Do not generate unlocked-io.h automatically, since it's easier to
4635         maintain it by hand.
4636
4637         * unlocked-io.h: New file, from GNU diffutils,
4638         but with proper copyright notice and attribution.
4639         * gen-uio: Remove.
4640         * Makefile.am: Add copyright notice.
4641         (libfetish_a_SOURCES): Add unlocked-io.h.
4642         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
4643         (DISTCLEANFILES, io_functions): Remove macros.
4644         (EXTRA_DIST): Remove gen_uio.
4645         (unlocked-io.h): Remove rule.
4646
4647 2002-12-04  Jim Meyering  <jim@meyering.net>
4648
4649         Reflect the fact that stat.c and lstat.c are no longer generated.
4650         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
4651         (DISTCLEANFILES): Likewise.
4652         (EXTRA_DIST): Likewise.
4653         (all_local): Don't depend on stat.c or lstat.c.
4654         (stat.c, lstat.c): Remove rules.
4655         (EXTRA_DIST): Remove xstat.in.
4656
4657         * xstat.in: Remove file.  Contents moved into stat.c.
4658         * stat.c: New file.  Contents mostly from xstat.in.
4659         * stat.c: Rework so that it may serve to define rpl_lstat, too.
4660         * lstat.c: New file. Simply #define LSTAT and include stat.c.
4661
4662         * safe-read.c: Rework so that it may serve to define safe_write, too.
4663         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
4664
4665 2002-12-03  Jim Meyering  <jim@meyering.net>
4666
4667         * safe-read.c, safe-write.c: Change variable names and comments, but
4668         not semantics, to minimize the differences between these two files.
4669         (safe_read): Change comment to mention SAFE_READ_ERROR.
4670
4671         * safe-read.c (IS_EINTR): Define.
4672         (safe_read): Use IS_EINTR in place of in-function cpp directives.
4673
4674 2002-12-02  Bruno Haible  <bruno@clisp.org>
4675
4676         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
4677         Define, taken from safe-read.c.
4678         (INT_MAX): Provide fallback.
4679         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
4680         * safe-write.h (SAFE_WRITE_ERROR): Define.
4681
4682         * safe-read.c (EINTR): Remove definition.
4683         (safe_read): Don't use EINTR if it is absent.
4684
4685 2002-12-02  Jim Meyering  <jim@meyering.net>
4686
4687         * safe-read.c (EINTR): Define.
4688         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
4689         (INT_MAX): Provide fallback.
4690         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
4691
4692         * safe-read.h (SAFE_READ_ERROR): Define.
4693
4694 2002-12-01  Jim Meyering  <jim@meyering.net>
4695
4696         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
4697         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
4698
4699 2002-11-27  Paul Eggert  <eggert@twinsun.com>
4700
4701         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4702         hash_rehash): Replace `if (limit <= value) abort ();' with
4703         `if (! (value < limit)) abort ();', for readability.
4704
4705 2002-11-26    <karl@gnu.org>
4706
4707         * strdup.c: copy from libc again, with jim's ok.
4708         * .cppi-disable: re-add strdup.c
4709
4710 2002-11-25    <karl@gnu.org>
4711
4712         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
4713         instead of "strtol.c".
4714
4715 2002-11-25  Jim Meyering  <jim@meyering.net>
4716
4717         * mktime.c: Sync from libc, now that it has the latest fix.
4718
4719 2002-11-24    <karl@gnu.org>
4720
4721         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
4722         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
4723
4724 2002-11-24  Jim Meyering  <jim@meyering.net>
4725
4726         Update from coreutils:
4727
4728         * mktime.c: Merge in changes from libc.
4729
4730         Avoid a link-time failure on some Linux systems.
4731         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
4732         (__mon_yday): Declare with the STATIC attribute.
4733         (__mktime_internal): Likewise.
4734         Based on a report from Greg Schafer.
4735
4736 2002-11-23  Jim Meyering  <jim@meyering.net>
4737
4738         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
4739         Use `unsigned', not `int', as type of index.
4740
4741         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
4742
4743         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
4744
4745 2002-11-22  Paul Eggert  <eggert@twinsun.com>
4746
4747         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
4748         hint that one should use `if (! x) abort ();' rather than `assert
4749         (x);', and anyway it's one less thing to worry about configuring.
4750         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
4751         hash_rehash, hash_insert): Use abort rather than assert.
4752
4753 2002-11-22  Paul Eggert  <eggert@twinsun.com>
4754
4755         * quotearg.h: Allow multiple inclusion by surrounding with
4756         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
4757         so that we can be included first.
4758         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
4759         * quotearg.c: Include quotearg.h immediately after config.h.
4760         No need to include stddef.h or sys/types.h any more.
4761         Surround local include files with "", not "<>".
4762         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
4763         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
4764         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
4765         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
4766         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
4767         (ISPRINT): Remove; no longer needed now that we assume C89.
4768
4769         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
4770         Preserve errno.
4771
4772         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
4773         quotearg_char): Use SIZE_MAX rather than
4774         (size_t) -1 when we are talking about "infinity".
4775
4776         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
4777
4778 2002-11-22  Bruno Haible  <bruno@clisp.org>
4779
4780         * safe-read.h: Assume C89. Add comments.
4781         (safe_read): Change return type to size_t.
4782         * safe-read.c (safe_read): Change return type to size_t. Handle byte
4783         counts > SSIZE_MAX correctly.
4784         * safe-write.h: New file.
4785         * safe-write.c: New file.
4786         * full-read.h: New file.
4787         * full-read.c: New file.
4788         * full-write.h: Assume C89. Add comments.
4789         * full-write.c: Include safe-write.h.
4790         (full_write): Rewritten to use safe_write.
4791         Suggested by Jim Meyering and Paul Eggert.
4792
4793 2002-11-21  Bruno Haible  <bruno@clisp.org>
4794
4795         Remove case insensitive option matching.
4796         * argmatch.h (argcasematch): Remove declaration.
4797         (ARGCASEMATCH): Remove macro.
4798         (__xargmatch_internal): Remove case_sensitive argument.
4799         (XARGMATCH): Update.
4800         (XARGCASEMATCH): Remove macro.
4801         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
4802         case_sensitive argument.
4803         (argcasematch): Remove function.
4804         (__xargmatch_internal): Remove case_sensitive argument.
4805         (main): Use XARGMATCH instead of XARGCASEMATCH.
4806
4807         * xmalloc.c: Change compile-time error message. Add comment about
4808         required autoconf version.
4809
4810 2002-11-21  Jim Meyering  <jim@meyering.net>
4811
4812         * strdup.c (strdup): Tweak comment and initial #if/#include.
4813
4814         Merge in changes from the coreutils.
4815
4816         2002-09-25  Paul Eggert  <eggert@twinsun.com>
4817         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
4818         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
4819         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
4820         int.  Work more efficiently if X is the same width as uintmax_t.
4821         Do not compare X to -1, to avoid bogus compiler warning.
4822         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
4823         Don't assume that f_frsize and f_bsize are the same type.
4824
4825         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
4826         on FreeBSD.
4827
4828         * makepath.c (make_path): Restore umask *before* creating the final
4829         component.
4830         (make_path): Minor reformatting.
4831
4832         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
4833         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
4834
4835         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
4836         ones.  At least on GNU/Linux systems, `auto' means something else.
4837         From Michael Stone.
4838
4839 2002-11-20  Paul Eggert  <eggert@twinsun.com>
4840
4841         Merge argmatch cleanups from Bison.  Assume C89.
4842
4843         * argmatch.c: Include config.h here, not in argmatch.h.
4844         Include stdlib.h, for EXIT_FAILURE.
4845         Always include <string.h>, since we assume C89.
4846         (EXIT_FAILURE): Remove pre-C89 bug workaround.
4847         * argmatch.h: Do not include <config.h> or <sys/types.h>.
4848         Include <stddef.h> instead, since it's all we need for size_t.
4849         (PARAMS): Remove.  All uses removed.
4850         (ARRAY_CARDINALITY): Do not bother to #undef.
4851         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
4852         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4853         Remove unnecessary parentheses.
4854         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
4855         Insert necessary parentheses.
4856         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
4857         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
4858
4859 2002-11-19  Bruno Haible  <bruno@clisp.org>
4860
4861         * mbswidth.c: Include mbswidth.h right at the beginning.
4862         * mbswidth.h: Include <stddef.h>, for size_t.
4863
4864         * mbswidth.h (PARAMS): Remove macro.
4865         (mbswidth, mbsnwidth): Use ANSI C function declarations.
4866         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
4867
4868         * gcd.h (PARAMS): Remove macro.
4869         (gcd): Use ANSI C function declarations.
4870         * gcd.c (gcd): Likewise.
4871
4872 2002-11-15  Bruno Haible  <bruno@clisp.org>
4873
4874         * strcspn.c: Include <stddef.h>.
4875         (strcspn): Use ANSI C function declaration. Change return type to
4876         size_t. Use NULL.
4877         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
4878         (strpbrk): Use NULL.
4879         * strpbrk.h (PARAMS): Remove macro.
4880         (strpbrk): Use ANSI C function declaration.
4881         * strstr.c: Don't include <sys/types.h>.
4882         * strstr.h (PARAMS): Remove macro.
4883         (strstr): Use ANSI C function declarations.
4884
4885 2002-11-06  Bruno Haible  <bruno@clisp.org>
4886
4887         * gcd.h (gcd): Change argument type to 'unsigned long'.
4888         * gcd.c (gcd): Likewise.
4889
4890 2002-11-05  Bruno Haible  <bruno@clisp.org>
4891
4892         * gcd.h: New file, from gettext-0.11.5.
4893         * gcd.c: New file, from gettext-0.11.5.
4894
4895 2002-11-05  Bruno Haible  <bruno@clisp.org>
4896
4897         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4898         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4899         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4900         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
4901
4902         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4903         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
4904
4905         * closeout.c: Include gettext.h instead of <libintl.h>.
4906         * human.c: Include gettext.h instead of <libintl.h>.
4907         * quotearg.c: Include gettext.h instead of <libintl.h>.
4908         * rpmatch.c: Include gettext.h instead of <libintl.h>.
4909         * unicodeio.c: Include gettext.h instead of <libintl.h>.
4910         * userspec.c: Include gettext.h instead of <libintl.h>.
4911         * version-etc.c: Include gettext.h instead of <libintl.h>.
4912         * xmalloc.c: Include gettext.h instead of <libintl.h>.
4913         (textdomain): Remove definition.
4914         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
4915
4916         * long-options.c: Remove include of <libintl.h> and definition of _.
4917         * same.c: Remove include of <libintl.h> and definition of _.
4918
4919 2002-11-04  Bruno Haible  <bruno@clisp.org>
4920
4921         * stpcpy.h: New file, from GNU gettext-0.11.5.
4922         * strcase.h: New file, from GNU gettext-0.11.5.
4923         * strpbrk.h: New file, from GNU gettext-0.11.5.
4924         * strstr.h: New file, from GNU gettext-0.11.5.
4925         * xgetcwd.h: New file, from GNU gettext-0.11.5.
4926
4927 2002-05-09  Bruno Haible  <bruno@clisp.org>
4928
4929         * config.charset: Update for newest glibc. Add canonical names
4930         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
4931
4932 2002-05-09  Bruno Haible  <bruno@clisp.org>
4933
4934         * localcharset.c (get_charset_aliases): Add more Windows specific
4935         aliases.
4936
4937 2002-05-08  Owen Taylor  <otaylor@redhat.com>
4938
4939         * config.charset: A few additions for Solaris.
4940
4941 2001-12-05  Bruno Haible  <bruno@clisp.org>
4942
4943         * localcharset.c (locale_charset): Don't return an empty string.
4944
4945 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
4946
4947         * config.charset: msdos in uk_UA uses CP1125.
4948
4949 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
4950
4951         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
4952         * localcharset.c (locale_charset): Declare as extern "C".
4953
4954 2002-02-15  Bruno Haible  <bruno@clisp.org>
4955
4956         * config.charset [msdosdjgpp]: For Russian, use CP866.
4957
4958 2002-02-11  Bruno Haible  <bruno@clisp.org>
4959
4960         * config.charset: Add support for NetBSD.
4961
4962 2002-09-25    <karl@gnu.org>
4963
4964         * strdup.c: copy from libc/string (via ../config/srclist*).
4965         * getopt*: copy from libc/posix.
4966         * gettext.h: copy from gettext.
4967         * .cppi-disable: add strdup.c, gettext.h.
4968
4969 2002-07-01  Jim Meyering  <meyering@lucent.com>
4970
4971         * c-stack.c: Include sys/time.h.
4972         From Volker Borchert.
4973
4974 2002-06-11  Paul Eggert  <eggert@twinsun.com>
4975
4976         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
4977         New macro.  Use it uniformly instead of
4978         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
4979         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
4980         reported by Vin Shelton.
4981
4982 2002-06-22  Jim Meyering  <meyering@lucent.com>
4983
4984         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
4985         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
4986
4987 2002-06-22  Paul Eggert  <eggert@twinsun.com>
4988
4989         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
4990         Do not assume SA_SIGINFO behavior.
4991         Bug reported by Jim Meyering on NetBSD 1.5.2.
4992
4993 2002-06-22  Jim Meyering  <meyering@lucent.com>
4994
4995         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
4996
4997         * exitfail.c, exitfail.h: Likewise.
4998         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
4999
5000         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
5001         of fnmatch.h.
5002         (EXTRA_DIST): Add fnmatch_loop.c.
5003         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
5004
5005         * fnmatch_loop.c: New file, from diffutils-2.8.2.
5006         * fnmatch.c: Update from diffutils-2.8.2.
5007         * fnmatch_.h: New file.  From diffutils-2.8.2.
5008         * fnmatch.h: Remove file.
5009
5010 2002-06-18  Paul Eggert  <eggert@twinsun.com>
5011
5012         * file-type.h: Report an error if neither S_ISREG nor
5013         S_IFREG is defined, instead of using a test specific to glibc
5014         2.2.  This should be safe, since POSIX requires S_ISREG and
5015         Unix Version 7 had S_IFREG.  We don't need to check for
5016         <sys/types.h> since we don't use any symbols that it defines.
5017
5018 2002-06-15  Jim Meyering  <meyering@lucent.com>
5019
5020         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
5021         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
5022         have been included before this file.
5023
5024 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
5025
5026         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
5027         so that each temporary file name is unique and valid in the first
5028         8 characters, for operation under DOS.
5029
5030 2002-06-15  Jim Meyering  <meyering@lucent.com>
5031
5032         Work even with DJGPP 2.03, which lacks support for symlinks.
5033         From Richard Dawe.
5034         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
5035         is defined.
5036         * lchown.c (S_ISLNK): Likewise.
5037
5038 2002-06-14  Jim Meyering  <meyering@lucent.com>
5039
5040         * file-type.h: Use the version from diffutils-2.8.2.
5041         * file-type.c: Likewise.
5042
5043 2002-05-27  Jim Meyering  <meyering@lucent.com>
5044
5045         Fix a problem seen only on nonconforming systems whereby ls.c's
5046         use of localtime, and then of gettimeofday would cause trouble:
5047         the localtime call used to initialize rpl_gettimeofday's save
5048         mechanism would clobber ls's current local time information so
5049         that in any long listing the first file would always be listed
5050         with date 1970-01-01.  Analysis by Volker Borchert.
5051
5052         * gettimeofday.c (localtime): Undefine.
5053         (rpl_localtime): New function.
5054
5055 2002-05-22  Jim Meyering  <meyering@lucent.com>
5056
5057         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
5058         * file-type.h: New file.
5059         * file-type.c (file_type): New file/function.  Extracted from diffutils.
5060
5061 2002-04-29  Paul Eggert  <eggert@twinsun.com>
5062
5063         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
5064
5065 2002-04-28  Paul Eggert  <eggert@twinsun.com>
5066
5067         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
5068         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
5069         of 127, since 64 is the largest conceivable number for ancient
5070         nonstandard hosts.
5071         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
5072
5073 2002-04-28  Jim Meyering  <meyering@lucent.com>
5074
5075         * sig2str.c (WTERMSIG): Remove definition (unused).
5076
5077 2002-04-28  Paul Eggert  <eggert@twinsun.com>
5078
5079         * sig2str.h, sig2str.c: New files.
5080         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
5081
5082 2002-04-24  Jim Meyering  <meyering@lucent.com>
5083
5084         * gettext.h: New file, from Gettext.
5085         * Makefile.am (INCLUDES): Remove -I../intl.
5086         (libfetish_a_SOURCES): Add gettext.h.
5087
5088 2002-04-16  Jim Meyering  <meyering@lucent.com>
5089
5090         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
5091         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
5092         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
5093
5094 2002-04-12  Jim Meyering  <meyering@lucent.com>
5095
5096         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
5097
5098 2002-03-10  Jim Meyering  <meyering@lucent.com>
5099
5100         * makepath.c (make_path): Remove a comma from a diagnostic.
5101         Suggestion from Santiago Vila.
5102
5103 2002-03-08  Jim Meyering  <meyering@lucent.com>
5104
5105         * rename.c: Mention that this wrapper is needed also on
5106         mips-dec-ultrix4.4 systems.
5107
5108 2002-03-02  Jim Meyering  <meyering@lucent.com>
5109
5110         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
5111         not HAVE_CLOCK_SETTIME.
5112
5113 2002-02-27  Paul Eggert  <eggert@twinsun.com>
5114
5115         * nanosleep.h: Rename to....
5116         * timespec.h: New name for nanosleep.h.  All uses changed.
5117
5118         * gettime.c: New file.
5119         * settime.c: New file.
5120         * stime.c: Remove.
5121
5122         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
5123         timespec.h.  Remove nanosleep.h.
5124
5125 2002-02-25  Paul Eggert  <eggert@twinsun.com>
5126
5127         * acl.c, acl.h: New files.
5128         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
5129
5130 2002-02-24  Jim Meyering  <meyering@lucent.com>
5131
5132         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
5133         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
5134         cause trouble.  Reported by Nelson Beebe.
5135
5136 2002-02-23  Paul Eggert  <eggert@twinsun.com>
5137
5138         * path-concat.c (xpath_concat): Reorder code to pacify
5139         compilers that don't know that xalloc_die never returns.
5140
5141 2002-02-20  Jim Meyering  <meyering@lucent.com>
5142
5143         * getdate.c: Regenerate using bison-1.33.
5144
5145 2002-02-15  Paul Eggert  <eggert@twinsun.com>
5146
5147         * posixver.c, posixver.h: New files.
5148         * Makefile.am (libfetish_a_SOURCES): Add them.
5149
5150 2002-02-02  Paul Eggert  <eggert@twinsun.com>
5151             Bruno Haible  <bruno@clisp.org>
5152
5153         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
5154         (fwrite_success_callback): New declaration.
5155         * unicodeio.c (unicode_to_mb): New function, extracted from
5156         print_unicode_char. Call failure callback instead of error.
5157         (fwrite_success_callback): New function.
5158         (exit_failure_callback): New function.
5159         (fallback_failure_callback): New function.
5160         (print_unicode_char): Call unicode_to_mb.
5161
5162 2002-01-26  Jim Meyering  <meyering@lucent.com>
5163
5164         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
5165
5166 2002-01-22  Jim Meyering  <meyering@lucent.com>
5167
5168         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
5169         Otherwise, some versions of automake would omit the rule that makes
5170         Makefile from Makefile.in.
5171
5172 2001-01-21  Paul Eggert  <eggert@twinsun.com>
5173
5174         * xmemcoll.h, xmemcoll.c: New files.
5175         * Makefile.am (libfetish_a_SOURCES): Add them.
5176         * memcoll.c: Include errno.h, and declare errno if not defined.
5177         (memcoll): Set errno to zero if there is no error.
5178
5179         * quotearg.c (quotearg_buffer_restyled):
5180         Fix bug with quoting buffers containing NUL when backslashing escapes.
5181         This bug was exposed by the other changes in this patch.
5182         (quotearg_n_options): New arg ARGSIZE.
5183         All callers changed.
5184         (quoting_options_from_style): New function.
5185         (quotearg_n_style): Use it.
5186         (quotearg_n_style_mem): New function.
5187
5188         * quotearg.h (quotearg_n_style_mem): New function.
5189
5190 2002-01-16  Jim Meyering  <meyering@lucent.com>
5191
5192         * getdate.y: Add three semicolons, each just before a closing brace.
5193         Bison (as of version 1.31) no longer papers over that mistake.
5194
5195 2002-02-14  Paul Eggert  <eggert@twinsun.com>
5196
5197         * backupfile.c (ISDIGIT): Comment fix.
5198         * getdate.y (ISDIGIT): Likewise.
5199         * posixtm.c (ISDIGIT, year): Likewise.
5200         * strverscmp.c (ISDIGIT): Likewise.
5201         * userspec.c (ISDIGIT): Likewise.
5202
5203 2002-01-05  Jim Meyering  <meyering@lucent.com>
5204
5205         * version-etc.c (version_etc_copyright): Update copyright year.
5206
5207 2001-01-19  Paul Eggert  <eggert@twinsun.com>
5208
5209         * closeout.c (close_stdout_status): If ferror (stdout), do
5210         not silently exit merely because the output buffer happens to
5211         have nothing pending.
5212
5213 2001-12-18  Paul Eggert  <eggert@twinsun.com>
5214
5215         See the big note in ../ChangeLog.
5216         * human.c (suffixes): Prefer K to k for 1024.
5217         (generate_suffix_backwards): New function.
5218         (human_readable_inexact): Use it.
5219         * xstrtol.c (__xstrtol): If there is no number but there
5220         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
5221         Accept 'K' as well as 'k'.
5222
5223 2001-12-15  Jim Meyering  <meyering@lucent.com>
5224
5225         * regex.h (__restrict_arr): Update from libc.
5226
5227         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
5228         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
5229         (STREQ): Define.
5230
5231 2001-12-10  Jim Meyering  <meyering@lucent.com>
5232
5233         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
5234         Instead, include "xalloc.h".
5235         (initbuffer): Don't cast xmalloc return value to char*.
5236         (readline): Reword comment.
5237         Don't cast xrealloc return value to char*
5238         Return NULL, not 0.
5239
5240 2001-12-09  Jim Meyering  <meyering@lucent.com>
5241
5242         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
5243         `signed and unsigned type in conditional expression'.
5244         * posixtm.c (posix_time_parse): Likewise.
5245
5246         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
5247
5248         * readtokens.c (readtoken): Declare an index to be of type unsigned
5249         to avoid a pedantic warning.
5250
5251         * getstr.c: Don't include assert.h.
5252         (getstr): Remove warning-evoking assertions.
5253         Return -1 if offset parameter is out of bounds.
5254         Change the type of a local from int to size_t.
5255
5256         * strftime.c (my_strftime_localtime_r): Include this function
5257         definition in the `#if ! HAVE_TM_GMTOFF' block.
5258
5259         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
5260         Include xalloc.h instead.
5261
5262 2001-12-02  Jim Meyering  <meyering@lucent.com>
5263
5264         * tempname.c: Don't declare getenv, thus reverting the change of
5265         2001-11-18.  It's no longer necessary, now that stdlib.h is always
5266         included.
5267
5268         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
5269         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
5270
5271 2001-11-30  Akim Demaille  <akim@epita.fr>
5272
5273         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
5274         before being defined.
5275
5276 2001-11-27  Paul Eggert  <eggert@twinsun.com>
5277
5278         * quotearg.h (quotearg_n, quotearg_n_style):
5279         First arg is int, not unsigned.
5280         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
5281         (SIZE_MAX, UINT_MAX): New macros.
5282         (quotearg_n_options): Abort if N is negative.
5283         Avoid overflow check on hosts where size_t is 64 bits and int
5284         is 32 bits, as overflow is impossible there.
5285         Fix off-by-one typo that caused unnecessary reallocation.
5286
5287 2001-11-27  Jim Meyering  <meyering@lucent.com>
5288
5289         * tempname.c: Merge with version from libc.
5290         * regex.c: Likewise.
5291
5292         * tempname.c: Include stdlib.h unconditionally.  On some old systems
5293         for which STDC_HEADERS is 0, it was not included, resulting in a
5294         warning about an integer-to-pointer conversion problem with getenv.
5295         Reported by Volker Borchert.
5296
5297 2001-11-26  Jim Meyering  <meyering@lucent.com>
5298
5299         * gtod.h: Remove file.
5300         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
5301         * gettimeofday.c: Don't include gtod.h.
5302         (GTOD_init): Remove function.
5303         (rpl_gettimeofday): Do its job here instead, rather than aborting.
5304         Suggestion from Volker Borchert.
5305
5306 2001-11-23  Jim Meyering  <meyering@lucent.com>
5307
5308         * hash.h (struct hash_table): Don't define here.  Merely declare it.
5309         * hash.c (struct hash_table): Define it here instead.
5310
5311 2001-11-22  Jim Meyering  <meyering@lucent.com>
5312
5313         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
5314
5315 2001-11-18  Paul Eggert  <eggert@twinsun.com>
5316
5317         * tempname.c (TMP_MAX): Remove; no longer needed.
5318         (TEMPORARIES): New macro.
5319         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
5320         removes an artificial limitation (e.g. HP-UX 10.20, where
5321         TMP_MAX is 17576).
5322
5323 2001-11-18  Jim Meyering  <meyering@lucent.com>
5324
5325         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
5326         on SunOS 4.
5327
5328         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
5329         files will be created before anything else.
5330
5331 2001-11-17  Jim Meyering  <meyering@lucent.com>
5332
5333         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
5334         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
5335         rather than group writable.  Patch by Juan F. Codagnone.
5336
5337         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
5338         Instead, include "xalloc.h".
5339
5340         * mountlist.c: Include unlocked-io.h after all system headers.
5341         Remove explicit declarations of xmalloc, xrealloc,
5342         and xstrdup.  Instead, include "xalloc.h".
5343
5344         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
5345         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
5346         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
5347
5348         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
5349         Reported by Padraig Brady.
5350
5351         * mkstemp.c: #undef mkstemp.
5352         Include config.h.
5353         (rpl_mkstemp): Rename from mkstemp.
5354         Protoize.
5355
5356 2001-11-16  Jim Meyering  <meyering@lucent.com>
5357
5358         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
5359         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
5360         determine the amount of total physical memory, use pstat_getstatic.
5361         HPUX-11 doesn't define _SC_PHYS_PAGES.
5362         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
5363         If sysconf couldn't be used to determine the amount of available
5364         physical memory, use both pstat_getstatic and pstat_getdynamic.
5365         Based on a patch from Bob Proulx.
5366
5367 2001-11-05  Jim Meyering  <meyering@lucent.com>
5368
5369         * xstat.in (slash_aware_lstat): Correct a misleading comment.
5370
5371 2001-11-03  Jim Meyering  <meyering@lucent.com>
5372
5373         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
5374         in argmatch_to_argument call.
5375
5376         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
5377         argument.
5378
5379         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
5380         e.g., a fault due to an attempt to free a NULL pointer.
5381
5382 2001-11-01  Jim Meyering  <meyering@lucent.com>
5383
5384         * dirfd.c, dirfd.h: New files.
5385         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
5386
5387         * hash.c (hash_print) [TESTING]: Clean up.
5388
5389 2001-10-22  Paul Eggert  <eggert@twinsun.com>
5390
5391         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
5392         to avoid a warning if -Wall.
5393
5394 2001-10-21  Paul Eggert  <eggert@twinsun.com>
5395
5396         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
5397
5398 2001-10-21  Jim Meyering  <meyering@lucent.com>
5399
5400         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
5401         this code would end up calling gettext even in packages built
5402         with --disable-nls.
5403         * getopt.c (_): Likewise.
5404         * regex.c (_): Likewise.
5405
5406 2001-10-20  Paul Eggert  <eggert@twinsun.com>
5407
5408         * error.c (strerror_r): Do not declare unless !_LIBC.
5409         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
5410         Use strerror_r that is only a macro, even if it is not a function.
5411         (strerror): Check for HAVE_DECL_STRERROR before declaring.
5412         (private_strerror): Use prototypes, not old-style function definition.
5413         (print_errno_message): New function.
5414         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
5415         char*-flavored one.
5416         (error_tail, error, error_at_line): Use it.
5417
5418 2001-10-11  Jim Meyering  <meyering@lucent.com>
5419
5420         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
5421         and quote_n (1, ... to avoid clobbering a buffer.
5422
5423 2001-10-05  Jim Meyering  <meyering@lucent.com>
5424
5425         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
5426         * hash-pjw.c: New file (factored out of fileutils' remove.c).
5427         * hash-pjw.h: New file.
5428
5429 2001-09-30  Jim Meyering  <meyering@lucent.com>
5430
5431         * mountlist.c [MOUNTED_GETFSSTAT]:
5432         Include <sys/ucred.h>, for Apple Darwin.
5433         Include sys/mount.h and sys/fs_types.h only if available.
5434         (FS_TYPE): Define.
5435         (read_filesystem_list): Use FS_TYPE.
5436
5437 2001-09-29  Paul Eggert  <eggert@twinsun.com>
5438
5439         * exclude.c (excluded_filename): 0 -> false, since it's
5440         a boolean context.
5441
5442 2001-09-28  Paul Eggert  <eggert@twinsun.com>
5443
5444         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
5445         #defines strtoimax.  Also treat the other strto* functions
5446         like strtoimax.
5447
5448         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
5449         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
5450         (strtoimax, strtoumax): Do not declare if already defined as a macro.
5451
5452 2001-09-26  Jim Meyering  <meyering@lucent.com>
5453
5454         Most macros in unlocked-io.h had the wrong number of arguments.
5455         * gen-uio: New script.
5456         (USE_UNLOCKED_IO): Define to 1 if not already defined.
5457         * unlocked-io.hin: Remove file.
5458         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
5459         rather than trying to embed it here.
5460         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
5461         Reported by Padraig Brady.
5462
5463 2001-09-25  Volker Borchert  <bt@teknon.de>
5464
5465         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
5466
5467 2001-09-23  Jim Meyering  <meyering@lucent.com>
5468
5469         * mountlist.c: Remove useless parentheses in #if directives.
5470         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
5471         the deprecated MOUNTED symbol is no longer defined in mntent.h.
5472
5473 2001-09-22  Jim Meyering  <meyering@lucent.com>
5474
5475         * localcharset.c: Update from latest gettext.
5476         * config.charset: Likewise.
5477
5478 2001-09-20  Jim Meyering  <meyering@lucent.com>
5479
5480         * xstrtol.c (strtoimax): Guard declaration with
5481         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
5482         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
5483         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
5484         (strtoumax): Likewise, for completeness (it wasn't necessary).
5485
5486 2001-09-06  Paul Eggert  <eggert@twinsun.com>
5487
5488         * strtoimax.c (HAVE_LONG_LONG):
5489         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
5490         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
5491         to work around bug in IBM C compiler.
5492
5493 2001-09-16  Jim Meyering  <meyering@lucent.com>
5494
5495         * mkdir.c: New file.
5496
5497 2001-09-04  Paul Eggert  <eggert@twinsun.com>
5498
5499         * xgetcwd.c: Revert some of the previous change; intead,
5500         fix the HAVE_GETCWD_NULL code to behave more like the
5501         !HAVE_GETCWD_NULL code used to.
5502
5503         Include "xalloc.h".
5504         (xgetcwd): Do not return NULL when memory is exhausted; instead,
5505         invoke xalloc_die.
5506
5507 2001-09-04  Paul Eggert  <eggert@twinsun.com>
5508
5509         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
5510         Use ssize_t, not int, to store result of readlink.
5511         Check for ssize_t overflow as well as size_t overflow,
5512         as POSIX says the result of readlink is implementation-defined
5513         when ssize_t overflows.
5514         Remove unnecessary cast to char*.
5515         Use free+malloc instead of realloc, as the storage doesn't need
5516         to be preserved and it's clearer and can be more efficient that way.
5517         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
5518         * xreadlink.h (xreadlink): Update prototype.
5519
5520 2001-09-03  Paul Eggert  <eggert@twinsun.com>
5521
5522         * exclude.c (fnmatch_no_wildcards): Fix confusion between
5523         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
5524         spotted by Jim Meyering.
5525
5526 2001-09-03  Jim Meyering  <meyering@lucent.com>
5527
5528         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
5529
5530 2001-09-03  Paul Eggert  <eggert@twinsun.com>
5531
5532         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
5533         like the HAVE_GETCWD_NULL code.
5534         Include pathmax.h if not HAVE_GETCWD.
5535         Do not include xalloc.h.
5536         (INITIAL_BUFFER_SIZE): New symbol.
5537         Do not use xmalloc / xrealloc, since the caller is responsible for
5538         handling errors.  Preserve errno around `free' during failure.
5539         Do not overrun buffer when using getwd.
5540
5541 2001-09-03  Paul Eggert  <eggert@twinsun.com>
5542
5543         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
5544         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
5545
5546 2001-09-02  Jim Meyering  <meyering@lucent.com>
5547
5548         * error.c: Update from GNU libc.
5549
5550 2001-09-01  Jim Meyering  <meyering@lucent.com>
5551
5552         * xreadlink.c: New file.
5553         * xreadlink.h: New file.
5554         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
5555
5556         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
5557         doesn't conflict with sparc Solaris 7's definition in
5558         /usr/include/sys/int_types.h.
5559
5560         * exclude.c: Use `""', not `<>' to #include non-system header files.
5561         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
5562         and strncasecmp as r-values.  Unixware didn't have declarations.
5563
5564 2001-08-31  Jim Meyering  <meyering@lucent.com>
5565
5566         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
5567         Use an initial, malloc'd, buffer of length 128 rather than
5568         a statically allocated one of length 1024.
5569
5570 2001-08-30  Paul Eggert  <eggert@twinsun.com>
5571
5572         * xgetcwd.c: Don't include pathmax.h.
5573         Include stdlib.h and unistd.h if available.
5574         Include xalloc.h.
5575         (xmalloc, xstrdup, free): Remove decls.
5576         (xgetcwd): Don't assume sizes fit in unsigned.
5577         Check for overflow when computing sizes.
5578         Simplify reallocation code.
5579
5580 2001-08-28  Paul Eggert  <eggert@twinsun.com>
5581
5582         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
5583
5584         * strtoimax.c: Renamed from strtoxmax.c, removing the
5585         old strtoimax.c.
5586
5587         Also, make the following further changes to make this file's
5588         configuration more similar to that of strtol.c:
5589         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
5590         (strtoumax, uintmax_t, strtoull, strtol): Remove.
5591         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
5592         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
5593         changed to signed values.
5594
5595         And make the following changes as well:
5596         Fix copyright notice, as 1999 was missing.
5597         (verify): New macro.
5598         (strtoimax): Check sizes at compile-time, not run-time.
5599         Prefer strtol to strtoll if both work.
5600         (main): Remove; it was not that useful and was a pain to maintain.
5601
5602         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
5603
5604 2001-08-30  Paul Eggert  <eggert@twinsun.com>
5605
5606         * savedir.c (savedir): Remove size parameter, as POSIX says that
5607         a directory's st_size can have an arbitrary value, so the old
5608         usage could waste an arbitrary amount of memory.  All uses
5609         changed.
5610         * savedir.h: Update prototype.
5611
5612 2001-08-30  Paul Eggert  <eggert@twinsun.com>
5613
5614         * xstrtol.c (strtoimax): New decl.
5615
5616 2001-08-28  Paul Eggert  <eggert@twinsun.com>
5617
5618         * xstrtol.h: Add copyright notice.
5619         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
5620         LONGINT_INVALID_SUFFIX_CHAR.
5621
5622 2001-08-30  Paul Eggert  <eggert@twinsun.com>
5623
5624         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
5625         tm to be declared.
5626
5627 2001-08-30  Paul Eggert  <eggert@twinsun.com>
5628
5629         * hash.c: Remove '2001' from copyright notice.
5630
5631 2001-08-30  Paul Eggert  <eggert@twinsun.com>
5632
5633         * full-write.h: New file.
5634         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
5635         * full-write.c: Correct credits, as cccp.c no longer
5636         exists and anyway it was so heavily changed from the old cccp
5637         code as to be unrecognizable.  Include full-write.h.
5638         (full_write) Return size_t, with short writes meaning failure.
5639         All callers changed.  This fixes a bug with large buffers
5640         on 64-bit hosts.
5641         * utime.c: Include full-write.h.
5642
5643 2001-08-30  Paul Eggert  <eggert@twinsun.com>
5644
5645         Merge 'exclude' changes from tar 1.13.22.
5646         This fixes one or two unlikely storage allocation overflow bugs,
5647         but doesn't change user-visible behavior otherwise.
5648
5649 2001-08-30  Paul Eggert  <eggert@twinsun.com>
5650
5651         * exclude.c (bool): Declare, perhaps by including stdbool.h.
5652         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
5653         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
5654         Include if available.
5655         (<xalloc.h>): Include
5656         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
5657         (verify): New macro.  Use it to verify that EXCLUDE macros do not
5658         collide with FNM macros.
5659         (struct patopts): New struct.
5660         (struct exclude): Use it, as exclude patterns now come with options.
5661         (new_exclude): Support above changes.
5662         (new_exclude, add_exclude_file):
5663         Initial size must now be a power of two to simplify overflow checking.
5664         (free_exclude, fnmatch_no_wildcards): New function.
5665         (excluded_filename): No longer requires options arg, as the options
5666         are determined by add_exclude.  Now returns bool, not int.
5667         (excluded_filename, add_exclude):
5668         Add support for the fancy new exclusion options.
5669         (add_exclude, add_exclude_file): Now takes int options arg.
5670         Check for arithmetic overflow when computing sizes.
5671         (add_exclude_file): xrealloc might modify errno, so don't
5672         realloc until after errno might be used.
5673
5674         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
5675         New macros.
5676         (free_exclude): New decl.
5677         (add_exclude, add_exclude_file): Now takes int options arg.
5678         (excluded_filename): No longer requires options arg, as the options
5679         are determined by add_exclude.  Now returns bool, not int.
5680
5681 2001-08-30  Paul Eggert  <eggert@twinsun.com>
5682
5683         * alloca.c (alloca): Arg is of type size_t, not unsigned.
5684
5685 2001-08-27  Jim Meyering  <meyering@lucent.com>
5686
5687         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
5688
5689         * version-etc.c (N_): Remove definition.
5690         Revert most of last change.
5691         Instead, simply don't mark the `Copyright...' string for translation.
5692         Based on advice from Paul Eggert.
5693
5694         * strtoxmax.c: Tweak comment.
5695
5696 2001-08-26  Jim Meyering  <meyering@lucent.com>
5697
5698         * version-etc.c (version_etc_copyright_fmt): Replace literal year
5699         of copyright with `%s' so translators don't get an untranslated
5700         message in 2002.
5701         (COPYRIGHT_YEAR): Define.
5702         (version_etc): Use fprintf rather than fputs.
5703         Suggestion from Ulrich Drepper.
5704
5705         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
5706
5707         * strtoll.c: New file, from GNU libc.
5708         * xstrtoimax.c: New file.
5709
5710         * xstrtol.h: Add xstrtoimax.
5711         * strtoumax.c: New file.  Simply include "strtoumax.c".
5712         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
5713
5714         * strtoumax.c: Factor to work both for unsigned and signed types, ...
5715         * strtoxmax.c: ... then renamed to this.
5716
5717 2001-08-13  Paul Eggert  <eggert@twinsun.com>
5718
5719         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
5720         Port to Solaris 8, where 'sed' requires a space after the 'r'
5721         command, and where sh dislikes "$/".  Clean up the spacing a bit.
5722         Redirect output to $tmp just once.
5723
5724 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
5725
5726         * addext.c (<errno.h>): Include.
5727         (errno): Declare if not defined.
5728         (addext): Work correctly when pathconf returns -1 and leaves
5729         errno alone because there is no limit.  Also, work even if
5730         pathconf returns a value greater than SIZE_MAX.
5731
5732 2001-08-12  Jim Meyering  <meyering@lucent.com>
5733
5734         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
5735         Simply `return getcwd (NULL, 0);'.
5736         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
5737         Use 1300 as initial value for length, not PATH_MAX.
5738
5739         * pathmax.h: Clean up cpp syntax.
5740
5741 2001-08-12  Jim Meyering  <meyering@lucent.com>
5742
5743         * gettimeofday.c: New file.
5744         * gtod.h: New file.
5745         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
5746
5747 2001-08-04  Jim Meyering  <meyering@lucent.com>
5748
5749         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
5750         to get in sync with glibc.
5751
5752 2001-08-03  Paul Eggert  <eggert@twinsun.com>
5753
5754         The following changes are from gettext 0.10.39 as maintained by
5755         Bruno Haible.
5756
5757         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
5758         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
5759         with inverted sense.  All uses changed.
5760
5761         * mbswidth.c: Don't include <limits.h>.
5762         Include <stdlib.h> and <string.h> unconditionally.
5763         (iswcntrl, mbsinit, ISCNTRL): New macros.
5764         (mbsnwidth): Use K&R style function declarations.
5765         Don't bother checking for MB_LEN_MAX == 1, since the compiler
5766         can optimize it when MB_CUR_MAX == 1.
5767         The width of control characters is zero, not 1.
5768
5769 2001-07-15  Jim Meyering  <meyering@lucent.com>
5770
5771         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
5772         (BUILT_SOURCES): Add unlocked-io.h.
5773         (io_functions): Define.
5774         (unlocked-io.h): New rule.
5775         (DISTCLEANFILES): Add unlocked-io.h.
5776         (all-local): Depend on unlocked-io.h, to ensure it is created.
5777
5778         * unlocked-io.hin: New file
5779
5780         * regex.c: Update from glibc.
5781
5782 2001-07-05  Jim Meyering  <meyering@lucent.com>
5783
5784         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
5785         recommendation.
5786         (libfetish_a_SOURCES): Put all .h files here instead.
5787         Remove a thus-exposed (better checks in automake) duplicate and
5788         two unnecessary .h files.
5789
5790 2001-06-11  Jim Meyering  <meyering@lucent.com>
5791
5792         * regex.c: Update from GNU libc.
5793
5794 2001-05-27  Jim Meyering  <meyering@lucent.com>
5795
5796         * readutmp.h (UT_TYPE): Define.
5797
5798 2001-05-24  Jim Meyering  <meyering@lucent.com>
5799
5800         * argmatch.c: Include "quote.h".
5801         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
5802         quote function.  Reported by Göran Uddeborg.
5803
5804 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
5805
5806         * dirname.c (dir_name): Compute append_dot using path, not newpath
5807         which is not yet declared.
5808
5809 2001-05-11  Paul Eggert  <eggert@twinsun.com>
5810
5811         * Makefile.am (libfetish_a_SOURCES):
5812         Add strftime.c, since we now compile it on all hosts.
5813
5814         * strftime.c (my_strftime):
5815         Define to nstrftime if emacs, but only if my_strftime is not defined.
5816         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
5817         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
5818         Add one more extra argument: a nanoseconds value.
5819         All uses changed.
5820         (ns): New macro.
5821         (my_strftime function): Add %N format.
5822         (emacs_strftimeu): Renamed from emacs_strftime,
5823         with extra ut argument.
5824
5825 2001-05-11  Paul Eggert  <eggert@twinsun.com>
5826
5827         dirname code cleanup.  base_name now behaves more compatibly
5828         with POSIX basename when given file names that have trailing
5829         slashes, and similarly for dir_name.  Add new primitives
5830         base_len and dir_len.  Put the directory-name-related decls
5831         into dirname.h.
5832
5833         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
5834         * backupfile.c (base_name): Likewise.
5835         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
5836         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
5837         * makepath.c (strip_trailing_slashes): Likewise.
5838         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
5839         Likewise.
5840         * rename.c (strip_trailing_slashes): Likewise.
5841         * same.c (base_name): Likewise.
5842         * stripslash.c (ISSLASH): Likewise.
5843
5844         * addext.c: Include <dirname.h> after size_t is defined.
5845         * backupfile.c: Likewise.
5846
5847         * addext.c (addext): Use base_len to trim redundant
5848         trailing slashes instead of doing it ourselves.
5849         But do not trim the last slash if it is not redundant.
5850
5851         * backupfile.c (find_backup_file_name,
5852         max_backup_version): Use base_len instead of rolling it ourselves.
5853         Handle the case of "" and (on DOS) "C:" correctly.
5854
5855         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
5856         Include <string.h>, <dirname.h>.
5857         (base_name): Allow file names ending in slashes, other than names
5858         that are all slashes.  In this case, return the basename followed
5859         by the slashes.  This is more general, and can be used in places
5860         where the original base_name purposely had an assertion failure.
5861         (base_len): New function.
5862
5863         * dirname.c: Include <string.h> instead of <stdlib.h>.
5864         Do not include <assert.h>; no longer needed.
5865         Include xalloc.h.
5866         (memrchr): Remove decl.
5867         (dir_name_r): Remove.
5868         (dir_len): Renamed from dirlen.  All callers changed.
5869         Rewrite in terms of base_name, for simplicity and consistency.
5870         (dir_name): Never return NULL.  All callers changed.
5871         Do not include <stdlib.h> in test program; no longer needed.
5872         return 0; is fine for test program.
5873
5874         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
5875         New macros.
5876         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
5877
5878         * path-concat.c (path_concat): Use base_len to compute
5879         base length, not strlen; this means we cannot rely on memcpy
5880         to null-terminate.
5881
5882         * same.c (STREQ): Remove.
5883         (same_name): Handle the case where the basename ends in trailing '/'.
5884
5885         * stripslash.c (strip_trailing_slashes): Return nonzero if
5886         a slash was stripped.  Do not strip the last slash after a
5887         file system prefix.
5888
5889 2001-04-08  Jim Meyering  <meyering@lucent.com>
5890
5891         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
5892         recomputed; that's necessary when the offset spans a DST transition.
5893         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
5894
5895 2001-04-02  Jim Meyering  <meyering@lucent.com>
5896
5897         * regex.h, regex.c: Update from GNU libc.
5898
5899 2001-03-19  Paul Eggert  <eggert@twinsun.com>
5900
5901         * version-etc.c (version_etc_copyright): Update to 2001.
5902
5903 2001-03-16  Paul Eggert  <eggert@twinsun.com>
5904
5905         * tempname.c (uint64_t): Define to uintmax_t if
5906         not defined, and if UINT64_MAX is not defined.
5907         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
5908         Reported by John David Anglin.
5909
5910 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
5911
5912         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
5913         alias if codeset is empty.
5914         * config.charset (BeOS): Use wildcard syntax.
5915
5916 2001-03-13  Jim Meyering  <meyering@lucent.com>
5917
5918         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
5919         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
5920         From Bruno Haible.
5921
5922 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
5923
5924         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
5925         Don't return NULL.
5926         * unicodeio.c (print_unicode_char): Simplify accordingly.
5927
5928 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
5929
5930         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
5931         support for DOS/DJGPP.
5932
5933 2001-02-28  Paul Eggert  <eggert@twinsun.com>
5934
5935         * Makefile.am (libfetish_a_SOURCES):
5936         Add dup-safer.c, fopen-safer.c.
5937         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
5938
5939         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
5940
5941 2001-02-25  Paul Eggert  <eggert@twinsun.com>
5942
5943         The mkstemp replacement is taken from glibc 2.2.2, with some
5944         portability fixes for use outside glibc, as follows:
5945
5946         * tempname.c (struct_stat64): New macro.
5947         (direxists, __gen_tempname): Use it.
5948         This avoids a portability problem with Solaris 8.
5949
5950         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
5951         (<stddef.h>, <stdint.h>, <string.h>):
5952         Include only if STDC_HEADERS || _LIBC.
5953         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
5954         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
5955         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
5956         (__set_errno): Define this macro if <errno.h> doesn't.
5957         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
5958         Define these macros if <stdio.h> doesn't.
5959         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
5960         Define these macros if <sys/stat.h>
5961         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
5962         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
5963         __xstat64): Define if not _LIBC.
5964         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
5965         (__gen_tempname): Invoke gettimeofday only if
5966         HAVE_GETTIMEOFDAY || _LIBC;
5967         otherwise, fall back on plain "time".
5968         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
5969
5970         * mkstemp.c (__GT_FILE): Define to zero if not defined.
5971
5972         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
5973
5974 2001-02-17  Jim Meyering  <meyering@lucent.com>
5975
5976         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
5977         around included file name.
5978
5979         * strnlen.c (__strnlen): Merge in a change from GNU libc.
5980
5981         * strftime.c: Update from GNU libc (the only changes were to comments).
5982
5983 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
5984
5985         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
5986
5987 2001-02-17  Paul Eggert  <eggert@twinsun.com>
5988
5989         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
5990         Remove workaround macros for hosts that have mbrtowc but not
5991         mbstate_t, as we now insist on proper declarations for both
5992         before using mbrtowc.
5993
5994 2001-02-17  Jim Meyering  <meyering@lucent.com>
5995
5996         * regex.c: Update from libc.
5997
5998 2001-02-16  Paul Eggert  <eggert@twinsun.com>
5999
6000         * alloca.c (malloc): Undef before defining, since stdlib.h
6001         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
6002         Reported by Mark Hounschell via Paul Eggert.
6003
6004 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
6005
6006         * config.charset: Update for FreeBSD 4.2.
6007
6008 2001-01-26  Jim Meyering  <meyering@lucent.com>
6009
6010         * quotearg.c: Include stddef.h.
6011         * quote.c: Include stddef.h.
6012         Reported by Axel Kittenberger.
6013
6014         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
6015         line in double quotes so that it evokes a better diagnostic.
6016         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
6017         Reported by Axel Kittenberger.
6018
6019 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
6020
6021         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
6022         to avoid a warning.  Add back 'const' to inptr.
6023
6024 2001-01-16  Jim Meyering  <meyering@lucent.com>
6025
6026         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
6027         From Bruno Haible.
6028
6029 2001-01-14  Jim Meyering  <meyering@lucent.com>
6030
6031         * rename.c: New file.  From Volker Borchert.
6032         Include stdlib.h, string.h or strings.h, and xalloc.h.
6033         Use strip_trailing_slashes rather than open-coding it.
6034
6035 2001-01-03  Paul Eggert  <eggert@twinsun.com>
6036
6037         * strftime.c: Sync with glibc time/strftime.c 1.81.
6038
6039 2001-01-03  Jim Meyering  <meyering@lucent.com>
6040
6041         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
6042         local `inptr' to avoid warning with some system declarations of iconv.
6043
6044 2000-12-29  Paul Eggert  <eggert@twinsun.com>
6045
6046         * modechange.c: Do not assume that mode_t uses the
6047         traditional octal encoding.  E.g. "chmod 1 FOO" should set
6048         the other-execute bit of FOO even if S_IXOTH != 1.
6049
6050         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
6051         WOTH, XOTH, ALLM): New macros.
6052         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
6053          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
6054         Use them.
6055         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
6056         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
6057         (mode_compile):
6058         No need to use uintmax_t; unsigned long is long enough.
6059         Don't bother to get suffix since we don't use it.
6060
6061 2000-12-24  Jim Meyering  <meyering@lucent.com>
6062
6063         * hash.c (is_prime): Return explicit boolean values.
6064         (hash_get_first): Return NULL to appease Irix5.6's 89.
6065         Reported by Nelson Beebe.
6066
6067 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
6068
6069         * localcharset.c (locale_charset): Add support for Win32.
6070
6071 2000-12-18  Paul Eggert  <eggert@twinsun.com>
6072
6073         * physmem.h, physmem.c: New files.
6074
6075         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
6076         (noinst_HEADERS): Add physmem.h.
6077
6078         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
6079         't' for compatibility with Solaris 8 sort.
6080
6081 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
6082
6083         * config.charset: Add support for BeOS.
6084
6085 2000-12-16  Jim Meyering  <meyering@lucent.com>
6086
6087         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
6088         SHELLS_FILE to a file name that's useful on djgpp systems.
6089         Include stdlib.h.
6090         (ADDITIONAL_DEFAULT_SHELLS): Define.
6091         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
6092         Based mostly on a patch from Prashant TR.
6093
6094 2000-12-16  Jim Meyering  <meyering@lucent.com>
6095
6096         This bug had a serious impact on chown: `chown N:M FILE' (for integer
6097         N and M) would have treated it like `chown N:N FILE'.
6098
6099         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
6100
6101 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
6102
6103         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
6104         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
6105         to the list of canonical encodings. Rename EUC-CN to GB2312.
6106
6107 2000-12-08  Andreas Schwab  <schwab@suse.de>
6108
6109         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
6110         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
6111
6112 2000-12-07  Jim Meyering  <meyering@lucent.com>
6113
6114         * stripslash.c (ISSLASH): Define.
6115         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
6116         From Prashant TR.
6117
6118         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
6119         (dir_name_r): Declare this function as static.
6120         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
6121         manifest itself on a name containing a mix of slashes and
6122         backslashes.
6123         Make this function work with names starting with a DOS-style
6124         drive letter and colon prefix.
6125         (dir_name): Append `.' if necessary.
6126         Based mostly on patches from Prashant TR and Eli Zaretskii.
6127
6128         * dirname.h (dir_name_r): Remove prototype.
6129
6130 2000-12-05  Jim Meyering  <meyering@lucent.com>
6131
6132         * dirname.c (dir_name_r): Add `const' in a few local declarations.
6133
6134 2000-12-04  Jim Meyering  <meyering@lucent.com>
6135
6136         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
6137         Also include memory.h, stdlib.h, unistd.h if appropriate.
6138         Reported by Andreas Jaeger (conflicting declaration of malloc).
6139
6140 2000-12-02  Jim Meyering  <meyering@lucent.com>
6141
6142         * closeout.h: Make idempotent, to avoid some obscure warnings.
6143
6144 2000-12-01  Paul Eggert  <eggert@twinsun.com>
6145
6146         * memrchr.c: Include <config.h> before any system include file.
6147
6148 2000-11-29  Paul Eggert  <eggert@twinsun.com>
6149
6150         * dirname.c (dir_name_r): Fix typo: int -> size_t.
6151
6152 2000-11-26  Jim Meyering  <meyering@lucent.com>
6153
6154         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
6155
6156 2000-11-22  Paul Eggert  <eggert@twinsun.com>
6157
6158         * strftime.c (my_strftime): Do not invoke mbrlen with a
6159         size of (size_t) -1; it's not portable.
6160
6161 2000-11-17  Akim Demaille  <akim@epita.fr>
6162
6163         * obstack.h: Formatting changes.
6164         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
6165         prevent type checking.
6166         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
6167         cast the value to (void *): assigning a `foo *' to a `void *'
6168         variable is valid.
6169         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
6170
6171 2000-11-17  Jim Meyering  <meyering@lucent.com>
6172
6173         * strstr.c: Update from GNU libc.
6174
6175 2000-11-16  Jim Meyering  <meyering@lucent.com>
6176
6177         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
6178
6179 2000-11-11  Jim Meyering  <meyering@lucent.com>
6180
6181         * error.c: Add a couple #includes, merging from GNU libc version.
6182
6183 2000-11-10  Jim Meyering  <meyering@lucent.com>
6184
6185         * obstack.h: Update from GNU libc.
6186         * obstack.c: Likewise.
6187
6188 2000-11-06  Paul Eggert  <eggert@twinsun.com>
6189
6190         * getusershell.c (setusershell): Use rewind rather than
6191         fseek/fseeko, to avoid configuration hassles with fseeko.
6192         Don't bother opening SHELLS_FILE if shellstream is NULL;
6193         it's not necessary.
6194
6195 2000-11-05  Jim Meyering  <meyering@lucent.com>
6196
6197         * makepath.h (make_dir): Declare.
6198         * makepath.c (make_dir): Remove `static' attribute.
6199         Tweak a comment.
6200
6201 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
6202
6203         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
6204         last one in a bucket, advance to the next bucket.
6205
6206 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
6207
6208         * fnmatch.c: Do not comment out all the code if we are using
6209         the GNU C library, because in some cases we are replacing buggy
6210         code in the GNU C library itself.
6211
6212 2000-10-30  Paul Eggert  <eggert@twinsun.com>
6213
6214         * error.h, getline.h, modechange.h:
6215         Remove "2000" from Copyright line, as the file hasn't been
6216         changed this year other than in the copyright notice.
6217
6218         * xalloc.h: Add "2000" to Copyright line, as this file
6219         was changed this year.
6220
6221 2000-10-30  Paul Eggert  <eggert@twinsun.com>
6222
6223         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
6224         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
6225         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
6226
6227 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
6228
6229         * regex.h (__restrict_arr): Move definition out of #ifndef block.
6230         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
6231         doesn't define __restrict_arr.
6232
6233 2000-10-29  Jim Meyering  <meyering@lucent.com>
6234
6235         * xstat.in: Fix grammar in comment.
6236
6237 2000-10-28  Jim Meyering  <meyering@lucent.com>
6238
6239         * memchr.c: Update from libc.
6240         Adjust for portability:
6241         [HAVE_STDLIB_H]: Include stdlib.h.
6242         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
6243         Undef __memchr, too.
6244         [!weak_alias]: Define __memchr to memchr.
6245
6246         * regex.c: Update from libc.
6247         * regex.h: Likewise.
6248         * getopt1.c: Likewise.
6249         * memcmp.c: Likewise.
6250
6251         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
6252         Avoid using fseek, when possible -- it's broken by design.
6253         Patch by Ulrich Drepper.
6254
6255 2000-10-26  Jim Meyering  <meyering@lucent.com>
6256
6257         * strftime.c: Update from libc.
6258
6259 2000-10-25  Jim Meyering  <meyering@lucent.com>
6260
6261         * obstack.c: Update from libc.
6262
6263 2000-10-23  Jim Meyering  <meyering@lucent.com>
6264
6265         * hard-locale.c (hard_locale): Revert last change -- it was simply
6266         wrong.  That set_locale call must not have any side effects.
6267         From Paul Eggert.
6268
6269 2000-10-22  Jim Meyering  <meyering@lucent.com>
6270
6271         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
6272         [CYCLIC]: Remove now-unused definition.
6273
6274         * save-cwd.c (O_DIRECTORY): Define, if needed.
6275         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
6276         Suggestion from Ulrich Drepper.
6277
6278 2000-10-21  Jim Meyering  <meyering@lucent.com>
6279
6280         * dirname.c (dir_name_r): New function, factored out of dir_name.
6281         (dir_name): Use dir_name_r.
6282         * dirname.h (dir_name_r): Declare it.
6283
6284 2000-10-21  Jim Meyering  <meyering@lucent.com>
6285
6286         * dirname.c (memrchr): Declare if necessary.
6287         (dir_name): Remove the restriction that there be no
6288         trailing slashes.  Now, this code skips past them, effectively
6289         ignoring them.
6290         [TEST_DIRNAME] (main): New unit tests.
6291
6292         * memrchr.c: New file from GNU libc.
6293         Undef __memrchr, too.
6294         [!weak_alias]: Define __memrchr to memrchr.
6295         Guard weak_alias use with `#ifdef weak_alias'.
6296
6297 2000-10-17  Jim Meyering  <meyering@lucent.com>
6298
6299         * quote.h (PARAMS): Define and use.
6300         Reported by Akim Demaille.
6301
6302         * getopt.c: Update from libc.
6303
6304 2000-10-16  Jim Meyering  <meyering@lucent.com>
6305
6306         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
6307         From Jan Fedak.
6308
6309 2000-09-25  Jim Meyering  <meyering@lucent.com>
6310
6311         * md5.h (rol): Define (from GnuPG).
6312
6313         * sha.c: Give credit (GnuPG) where due.
6314         (M): Use rol rather than open-coding it.
6315         Add a FIXME comment.
6316
6317 2000-09-21  Jim Meyering  <meyering@lucent.com>
6318
6319         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
6320         Reported by Michael Stone.
6321
6322 2000-09-20  Jim Meyering  <meyering@lucent.com>
6323
6324         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
6325         (noinst_HEADERS): Add sha.h.
6326         Based on code from Scott G. Miller and from GnuPG.
6327
6328 2000-09-15  Jim Meyering  <meyering@lucent.com>
6329
6330         * regex.c: Update from libc.
6331
6332 2000-09-10  Jim Meyering  <meyering@lucent.com>
6333
6334         * getopt.c (_getopt_internal): Update from glibc.
6335
6336 2000-09-09  Jim Meyering  <meyering@lucent.com>
6337
6338         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
6339         think it should be used as a general replacement for isascii.
6340         * fnmatch.c: Likewise.
6341         * mbswidth.c: Likewise
6342         * regex.c: Likewise.
6343
6344         Don't use atoi.
6345         * userspec.c: Include sys/param.h and limits.h.
6346         Include xstrtol.h.
6347         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
6348         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
6349         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
6350         UID, GID.  Check range.
6351
6352 2000-09-06  Jim Meyering  <meyering@lucent.com>
6353
6354         * getopt.c (_getopt_internal): Update from glibc.
6355
6356 2000-08-30  Jim Meyering  <meyering@lucent.com>
6357
6358         * strftime.c: Merge in changes from GNU libc.
6359
6360 2000-08-26  Jim Meyering  <meyering@lucent.com>
6361
6362         * closeout.c: Include "__fpending.h".
6363         (close_stdout_status): Return right away if there's nothing to flush.
6364
6365         * Makefile.am (noinst_HEADERS): Add __fpending.h.
6366         * __fpending.c: New file.
6367         * __fpending.h: New file.
6368
6369 2000-08-07  Paul Eggert  <eggert@twinsun.com>
6370
6371         Standardize on "memory exhausted" instead of "Memory exhausted"
6372         or "virtual memory exhausted".
6373         * obstack.c (print_and_abort): Use "memory exhausted", not
6374         "virtual memory exhausted".
6375         * same.c (same_name): Invoke xalloc_die instead of printing
6376         our own message.
6377         * userspec.c (parse_user_spec): Likewise.
6378         * bumpalloc.h: comment fix
6379         * same.c, userspec.c: Include xalloc.h.
6380
6381         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
6382         not char *const and pointing to a constant array.
6383         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
6384         (xrealloc): Comment fix.
6385
6386         * userspec.c (parse_user_spec):
6387         Don't translate a message until just before returning,
6388         to avoid unnecessary translation.
6389
6390 2000-08-07  Jim Meyering  <meyering@lucent.com>
6391
6392         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
6393         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
6394         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
6395         getgroups.c, gethostname.c, getopt.h, group-member.c,
6396         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
6397         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
6398         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
6399         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
6400         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
6401         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
6402         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
6403         yesno.c: Back out Copyright date changes for each file with no change
6404         this year.  This eases coordination with other programs using the same
6405         source code modules.  From Paul Eggert.
6406
6407 2000-08-03  Greg McGary  <greg@mcgary.org>
6408
6409         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
6410         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
6411         (EXTEND_BUFFER): Use them.
6412
6413 2000-08-01  Jim Meyering  <meyering@lucent.com>
6414
6415         * dirname.c (ISSLASH): Define.
6416         (BACKSLASH_IS_PATH_SEPARATOR): Define.
6417         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
6418         both `\' and `/' may be use as path separators.
6419         Based on a patch from Prashant TR.
6420
6421 2000-07-31  Paul Eggert  <eggert@twinsun.com>
6422
6423         * quotearg.c (quotearg_n_options): Don't make the initial
6424         slot vector a constant, since it might get modified.
6425
6426 2000-07-31  Jim Meyering  <meyering@lucent.com>
6427
6428         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
6429         * obstack.c (print_and_abort): Likewise.
6430
6431 2000-07-30  Paul Eggert  <eggert@twinsun.com>
6432
6433         * quotearg.c (quotearg_n_options): Preallocate a slot 0
6434         buffer, so that the caller can always quote one small
6435         component of a "memory exhausted" message in slot 0.
6436         From a suggestion by Jim Meyering.
6437
6438 2000-07-30  Jim Meyering  <meyering@lucent.com>
6439
6440         * makepath.c (make_path): Quote the other instance, too.
6441
6442         * quotearg.c (N_STATIC_SLOTVECS): Define.
6443         (STATIC_BUF_SIZE): Define.
6444         (quotearg_n_options): Use only statically allocated storage when
6445         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
6446         than STATIC_BUF_SIZE.
6447
6448 2000-07-29  Jim Meyering  <meyering@lucent.com>
6449
6450         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
6451         * dirname.c (dir_name): Likewise.
6452
6453         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
6454
6455         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
6456         (dir_name): Assert that there are no trailing slashes.
6457
6458 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
6459
6460         * mbswidth.h (mbswidth): Add a flags argument.
6461         (mbswidth): New declaration.
6462         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
6463         * mbswidth.c (mbswidth): Add a flags argument.
6464         (mbsnwidth): New function.
6465
6466 2000-07-24  Jim Meyering  <meyering@lucent.com>
6467
6468         * mbswidth.c: Remove useless #else.  From Bruno Haible.
6469
6470 2000-07-23  Paul Eggert  <eggert@twinsun.com>
6471
6472         * mbswidth.c (_XOPEN_SOURCE):
6473         Don't define; this causes problems on Solaris 7.
6474         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
6475
6476 2000-07-23  Paul Eggert  <eggert@twinsun.com>
6477
6478         * quotearg.c:
6479         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
6480         so that mbstate_t is always defined.
6481
6482         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
6483         be 1 in at least one GCC installation, and this configuration
6484         error is likely to be common.  Ignoring MB_LEN_MAX hurts
6485         performance on hosts that have mbrtowc but have only unibyte
6486         locales, but I assume these hosts are rare.
6487
6488 2000-07-23  Paul Eggert  <eggert@twinsun.com>
6489
6490         * quotearg.c: Streamline by invoking multibyte code only if needed.
6491         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
6492         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
6493         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
6494         invoke multibyte primitives.
6495
6496 2000-07-23  Jim Meyering  <meyering@lucent.com>
6497
6498         * basename.c (base_name): Add an assertion.
6499
6500 2000-07-15  Bruno Haible  <clisp.cons.org>
6501
6502         * quotearg.c: When the system forces us to redefine mbstate_t,
6503         shadow its mbsinit function.
6504
6505 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
6506
6507         * mbswidth.h: New file.
6508         * mbswidth.c: New file.
6509         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
6510         (noinst_HEADERS): Add mbswidth.h.
6511
6512 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
6513
6514         * config.charset: Add support for FreeBSD. Improve support for HP-UX
6515         and IRIX 6.
6516
6517 2000-07-15  Jim Meyering  <meyering@lucent.com>
6518
6519         * makepath.c: Include quote.h.
6520         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
6521         corresponding argument in a `quote (...)' call.
6522         Give better diagnostics.
6523
6524         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
6525         (noinst_HEADERS): Add quote.h.
6526
6527         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
6528         from tar's src/misc.c.
6529         * quote.h: New file.  Prototypes for same.
6530
6531 2000-07-10  Paul Eggert  <eggert@twinsun.com>
6532
6533         From a suggestion by Bruno Haible.
6534         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
6535         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
6536         to decide whether to define the BeOS workaround macro;
6537         this adjusts to the change to AC_MBSTATE_T.
6538
6539 2000-07-13  Paul Eggert  <eggert@twinsun.com>
6540
6541         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
6542
6543         * quotearg.c (quoting_style_args, quoting_style_vals,
6544         quotearg_buffer_restyled): Add support for
6545         clocale_quoting_style.  Undo previous change to
6546         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
6547         and "{RIGHT QUOTATION MARK}" msgids.
6548
6549 2000-07-05  Paul Eggert  <eggert@twinsun.com>
6550
6551         The old behavior of quoting `like this' doesn't look good with
6552         newer, ISO-style fonts.  See:
6553         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
6554
6555         Instead, quote "like this" by default.  Let the translator
6556         tailor the locale-specific quoting behavior by providing
6557         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
6558
6559         * quotearg.c (N_): New macro.
6560         (gettext_default): New function.
6561         (quotearg_buffer_restyled): Use
6562         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
6563         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
6564
6565 2000-07-09  Jim Meyering  <meyering@lucent.com>
6566
6567         * Most files: Update copyright dates to include 2000.
6568
6569 2000-07-08  Jim Meyering  <meyering@lucent.com>
6570
6571         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
6572         if not defined.
6573         (xgethostname): Remove now-unnecessary #ifdef.
6574         Move declaration of `err' into loop where it's used.
6575
6576 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
6577
6578         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
6579         by allocating a larger buffer. Test the gethostname return value for
6580         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
6581         returns an error and ENAMETOOLONG isn't defined.
6582
6583 2000-07-05  Paul Eggert  <eggert@twinsun.com>
6584         and Bruno Haible  <haible@clisp.cons.org>
6585
6586         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
6587
6588 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
6589
6590         * quotearg.c (struct quoting_options): Simplify quote_these_too
6591         dimension.
6592
6593 2000-07-03  Jim Meyering  <meyering@lucent.com>
6594
6595         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
6596         Reported by Bruno Haible.
6597
6598 2000-07-04  Jim Meyering  <meyering@lucent.com>
6599
6600         * quotearg.c: Make inclusion of <wchar.h> independent of whether
6601         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
6602         lacks mbrtowc.
6603
6604 2000-07-03  Paul Eggert  <eggert@twinsun.com>
6605         and Bruno Haible  <haible@clisp.cons.org>
6606
6607         * quotearg.c (mbrtowc):
6608         Assign to *pwc, and return 1 only if result is nonzero.
6609         (iswprint): Use ISPRINT when substituting our own mbrtowc.
6610
6611 2000-07-03  Jim Meyering  <meyering@lucent.com>
6612
6613         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
6614         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
6615         From Bob Proulx.
6616
6617 2000-07-02  Jim Meyering  <meyering@lucent.com>
6618
6619         * quotearg.c (mbstate_t): Don't define here.
6620
6621 2000-07-02  Jim Meyering  <meyering@lucent.com>
6622
6623         * nanosleep.c (SIGCONT): Define if not already defined.
6624
6625 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
6626
6627         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
6628         per change in ../m4/ls-mntd-fs.m4.
6629         (read_filesystem_list): Ignore symbolic links.
6630
6631 2000-06-29  Jim Meyering  <meyering@lucent.com>
6632
6633         * same.c: Include <string.h> or <strings.h>, as appropriate,
6634         for declaration of strcmp.
6635
6636         * long-options.c: Include <stdlib.h>, for declaration of exit.
6637
6638         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
6639         Avoid warning by casting result to `char *' to remove `const'.
6640
6641 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
6642
6643         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
6644
6645 2000-06-26  Paul Eggert  <eggert@twinsun.com>
6646
6647         savedir now sets errno on failure and invokes xmalloc to get memory.
6648         Fix a couple of other minor bugs while we're at it.
6649
6650         * savedir.c (<unistd.h>): Do not include; there's no need.
6651         (NAMLEN): Remove macro.
6652         (malloc, realloc): Remove decls.
6653         (stpcpy): Likewise.
6654         ("xalloc.h"): Include.
6655         (NAME_SIZE_DEFAULT): New macro.
6656         (savedir): Use xmalloc / xrealloc to allocate memory.
6657         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
6658         Skip "" directory entries.
6659         Use strlen to calculate directory entry length, since the old method
6660         is rarely used these days and isn't worth supporting.
6661         Don't use a pointer after freeing it.
6662         Check for integer overflow when calculating allocation size.
6663         Use memcpy to copy entries, instead of stpcpy.
6664         Set errno properly when returning NULL.
6665         Check for readdir error.
6666
6667 2000-06-26  Jim Meyering  <meyering@lucent.com>
6668
6669         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
6670
6671 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
6672
6673         * getusershell.c (xmalloc, xrealloc): Remove functions.
6674         Include xalloc.h.
6675         Don't include <stdlib.h>.  Don't declare malloc, realloc.
6676
6677 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
6678
6679         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
6680
6681 2000-06-24  Jim Meyering  <meyering@lucent.com>
6682
6683         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
6684
6685 2000-06-21  Jim Meyering  <meyering@lucent.com>
6686
6687         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
6688
6689 2000-06-19  Paul Eggert  <eggert@twinsun.com>
6690
6691         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
6692         (mbrtowc, mbstate_t): Define substitutes if
6693         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
6694         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
6695         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
6696
6697 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
6698
6699         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
6700         than 1024, return a memory chunk of least possible size, instead
6701         of size PATH_MAX + 2. In the loop, increment the size proportionally.
6702         Use free/xmalloc instead of xrealloc to avoid copying for very long
6703         paths.
6704
6705 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
6706
6707         * canon-host.c (canon_host): Use malloc and memcpy to copy an
6708         address, not strdup.  Include <stdlib.h> and don't declare free().
6709
6710 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
6711
6712         * path-concat.c (path_concat): Don't access dir[-1] if dir is
6713         the empty string.
6714
6715 2000-06-21  Jim Meyering  <meyering@lucent.com>
6716
6717         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
6718         (noinst_HEADERS): Add getstr.h.
6719
6720         * getline.c (getstr): Move into a separate file.
6721         * getstr.c (getstr): New file, extracted from getline.c, with
6722         the following changes: new parameter, delim2; both delim[12]
6723         parameters have type `int', not `char'.  The latter would lose
6724         with 8-bit delimiters.
6725         * getstr.h: New file.
6726
6727 2000-06-19  Jim Meyering  <meyering@lucent.com>
6728
6729         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
6730
6731 2000-06-18  Jim Meyering  <meyering@lucent.com>
6732
6733         * mkdir.c: Remove file, due mainly to copyright incompatibility.
6734         Besides, these days every porting target provides a mkdir function.
6735
6736         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
6737         (this snippet comes from src/system.h).
6738
6739 2000-06-15  Paul Eggert  <eggert@twinsun.com>
6740
6741         * human.c (adjust_value): New function.
6742         (human_readable_inexact): Apply rounding style even when
6743         printing approximate values.
6744
6745 2000-06-14  Paul Eggert  <eggert@twinsun.com>
6746
6747         * human.c (human_readable_inexact): Allow an input block
6748         size that is not a multiple of the output block size, and vice versa.
6749         Reported by Piergiorgio Sartor.
6750
6751 2000-06-14  Paul Eggert  <eggert@twinsun.com>
6752
6753         * getdate.y (get_date): Apply relative times after time
6754         zone indicator, not before.  Reported by Todd A. Jacobs.
6755
6756 2000-06-13  Jim Meyering  <meyering@lucent.com>
6757
6758         * Makefile.am (all-local): Depend on lstat.c and stat.c.
6759
6760         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
6761
6762 2000-06-12  Paul Eggert  <eggert@twinsun.com>
6763
6764         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
6765
6766 2000-06-04  Paul Eggert  <eggert@twinsun.com>
6767
6768         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
6769
6770 2000-06-04  Jim Meyering  <meyering@lucent.com>
6771
6772         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
6773         SunOS 4.1.4 for which gid_t is an unsigned type.
6774
6775 2000-06-03  Jim Meyering  <meyering@lucent.com>
6776
6777         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
6778
6779 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
6780
6781         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
6782         newer, don't install charset.alias.
6783         * config.charset: Change the Linux/glibc rules so they become empty
6784         on glibc-2.1 or newer.
6785
6786 2000-06-02  Jim Meyering  <meyering@lucent.com>
6787
6788         * mountlist.c: Back out last change.  Instead, do this...
6789         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
6790         member using the same `ignore'-testing code.
6791         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
6792         fs_type strings.
6793         From Mark D. Roth.
6794
6795 2000-05-29  Jim Meyering  <meyering@lucent.com>
6796
6797         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
6798         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
6799
6800 2000-05-22  Jim Meyering  <meyering@lucent.com>
6801
6802         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
6803
6804 2000-05-18  Jim Meyering  <meyering@lucent.com>
6805
6806         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
6807         back, too, since it may have been modified by allocate_entry.
6808         (hash_delete): Rewrite to use neither the assignment operator
6809         nor the comma operator in an if-expression.
6810
6811 2000-05-15  Paul Eggert  <eggert@twinsun.com>
6812
6813         * closeout.c:
6814         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
6815         Remove; no longer needed.
6816         "quotearg.h": Add include.
6817         (file_name): Do not bother to explicitly initialize to NULL; it's less
6818         efficient on some hosts.
6819         (close_stdout_status): Remove test as to whether stdout was already
6820         closed; it breaks for the case "echo x | sort >&-".
6821         Quote file name colons.
6822         Do not assume that _("write error") lacks format strings.
6823
6824 2000-05-15  Jim Meyering  <meyering@lucent.com>
6825
6826         * version-etc.c (version_etc_copyright): Update the copyright string
6827         used in all --version output.
6828
6829 2000-05-14  Jim Meyering  <meyering@lucent.com>
6830
6831         * closeout.c (close_stdout_set_file_name): New function.
6832         (close_stdout_status): Use new file-scoped global.
6833         Return right away if fstat says the stdout file descriptor is invalid.
6834         * closeout.h (close_stdout_set_file_name): Declare.
6835
6836 2000-05-10  Jim Meyering  <meyering@lucent.com>
6837
6838         * closeout.c [default_exit_status]: New file-scoped variable.
6839         (close_stdout_set_status): New function.
6840         * closeout.h (close_stdout_set_status): Declare.
6841
6842 2000-05-08  Jim Meyering  <meyering@lucent.com>
6843
6844         * long-options.c: Don't include closeout.h.
6845         (parse_long_options): Don't call close_stdout for --version.
6846
6847 2000-05-06  Jim Meyering  <meyering@lucent.com>
6848
6849         * strnlen.c: Undefine __strnlen and strnlen.
6850         [!weak_alias]: Define __strnlen to strnlen.
6851
6852         * atexit.c: New file, from libiberty.
6853
6854 2000-05-06  Jim Meyering  <meyering@lucent.com>
6855
6856         * closeout.c (close_stdout_status): Also check for errors on the
6857         stderr stream.
6858
6859 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
6860
6861         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
6862         instead of xmalloc, xrealloc, path_concat.
6863         (locale_charset): Treat empty environment variables as absent.
6864         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
6865
6866 2000-05-04  Jim Meyering  <meyering@lucent.com>
6867
6868         * getopt.c: Update from glibc.
6869         * obstack.c: Likewise.
6870         * obstack.h: Likewise.
6871         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
6872
6873         * regex.h: Likewise.
6874         * strndup.c: Likewise.
6875         * strnlen.c: New file, from glibc.
6876
6877 2000-05-01  Jim Meyering  <meyering@lucent.com>
6878
6879         * full-write.c (full_write): Remove `FIXME' part of comment.
6880
6881 2000-04-29  Jim Meyering  <meyering@lucent.com>
6882
6883         * path-concat.c: Declare strdup only if it's not defined.
6884         * canon-host.c: Likewise.
6885
6886 2000-04-28  Jim Meyering  <meyering@lucent.com>
6887
6888         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
6889         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
6890         included first, then limits.h is included by locale.h by libintl.h.
6891         From John David Anglin.
6892
6893 2000-04-25  Jim Meyering  <meyering@lucent.com>
6894
6895         * makepath.c (S_IRWXUGO): Define.
6896         (make_path): Always perform explicit chmod if MODE specifies any
6897         of the `special' permission bits.  Prompted by a bug report against
6898         install from Mate Wierdl and Joost van Baal.
6899
6900 2000-04-18  Jim Meyering  <meyering@lucent.com>
6901
6902         * README: New file.
6903
6904         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
6905         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
6906
6907 2000-04-17  Jim Meyering  <meyering@lucent.com>
6908
6909         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
6910         the definition of it to rpl_strftime also defined-away the system's
6911         declaration.
6912
6913 2000-04-15  Jim Meyering  <meyering@lucent.com>
6914
6915         Use `C' to denote so-called `contiguous' files, the same way
6916         that tar does.
6917         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
6918         (ftypelet): Use S_ISCTG.
6919         From Michael Deutschmann.
6920
6921 2000-04-14  Jim Meyering  <meyering@lucent.com>
6922
6923         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
6924
6925 2000-04-08  Jim Meyering  <meyering@lucent.com>
6926
6927         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
6928         names don't conflict.  Reported by Eli Zaretskii.
6929
6930 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
6931
6932         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
6933         bug.  Deal with the different error behavior of Irix iconv.
6934
6935 2000-04-07  Jim Meyering  <meyering@lucent.com>
6936
6937         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
6938         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
6939
6940 2000-04-05  Jim Meyering  <meyering@lucent.com>
6941
6942         Portability tweaks required for ultrix4.3.
6943         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
6944         * readutmp.c: Include sys/types.h before sys/stat.h.
6945         * canon-host.c: Declare strdup.
6946         * path-concat.c: Likewise.
6947         From John David Anglin.
6948
6949 2000-04-04  Jim Meyering  <meyering@lucent.com>
6950
6951         Be more DOS 8.3-friendly.
6952         * ref-add.sin: Renamed from ref-add.sed.in.
6953         * ref-del.sin: Renamed from ref-del.sed.in.
6954         * Makefile.am: Reflect renaming.
6955         Reported by Eli Zaretskii.
6956
6957         Use a temporary file name that won't clash with `charset.alias'
6958         in the DOS 8.3 name space.
6959         * Makefile.am (charset_tmp): Define.
6960         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
6961         (uninstall-local): Likewise.
6962         Reported by Eli Zaretskii.
6963
6964 2000-03-29  Paul Eggert  <eggert@twinsun.com>
6965
6966         * time/strftime.c (my_strftime): Make sure we call the system
6967         strftime, not ourselves, when invoking the underlying strftime.
6968
6969 2000-03-24  Jim Meyering  <meyering@lucent.com>
6970
6971         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
6972         (charset_alias): Define.
6973         (install-exec-local): Factor out common code.
6974         (uninstall-local): Split lines longer than 80.
6975         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
6976         (SUFFIXES): Define.
6977         (.sed.in.sed): New rule.  Don't redirect directly to $@.
6978         (CLEANFILES): Add ref-add.sed and ref-del.sed.
6979
6980 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
6981
6982         * config.charset: Output a line containing "Packages using this file".
6983         * ref-add.sed.in, ref-del.sed.in: New files.
6984         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
6985         ref-del.sed): New rules.
6986
6987 2000-03-17  Jim Meyering  <meyering@lucent.com>
6988
6989         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
6990         Otherwise, include <strings.h>
6991
6992 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
6993
6994         * unicodeio.c (utf8_wctomb): New function.
6995         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
6996         format instead of in UCS-4 with platform dependent endianness.
6997
6998 2000-03-07  Paul Eggert  <eggert@twinsun.com>
6999
7000         * savedir.c (savedir): Work even if directory size is
7001         negative; this can happen with some screwy NFS configurations.
7002
7003 2000-03-06  Jim Meyering  <meyering@lucent.com>
7004
7005         * localcharset.c (get_charset_aliases): Don't try to free file_name
7006         if it's NULL (because we ran out of memory).  From Bruno Haible.
7007
7008 2000-03-05  Jim Meyering  <meyering@lucent.com>
7009
7010         * localcharset.c ("path-concat.h"): Include.
7011         (get_charset_aliases): Use path_concat instead of ANSI string
7012         concatenation.
7013
7014         * unicodeio.h (PARAMS): Define.
7015         Use it to guard prototype.
7016
7017 2000-03-04  Jim Meyering  <meyering@lucent.com>
7018
7019         * Makefile.am (install-exec-local): Create $(libdir) before installing
7020         into it.
7021         (uninstall-local): Uncomment this rule so `make distcheck' works
7022         once again.
7023
7024         * unicodeio.c (<errno.h>): Include it.
7025         (errno): Declare if not defined.
7026
7027         * localcharset.c: Add Bruno's comment justifying use of volatile.
7028
7029         * config.charset: New version, incorporating remarks from a linux
7030         i18n mailing list.  From Bruno Haible.
7031
7032 2000-03-02  Jim Meyering  <meyering@lucent.com>
7033
7034         * Makefile.am (EXTRA_DIST): Add config.charset.
7035
7036 2000-03-01  Jim Meyering  <meyering@lucent.com>
7037
7038         * localcharset.c: Guard some #includes with `#if HAVE_...'.
7039         * unicodeio.c: Likewise.
7040
7041 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
7042
7043         * config.charset: New file.
7044         * localcharset.c: New file.
7045         * unicodeio.h, unicodeio.c: New files.
7046         * Makefile.am (DEFS): Add -DLIBDIR=...
7047         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
7048         (noinst_HEADERS): Add unicodeio.h.
7049         (all-local, install-exec-local, charset.alias): New targets.
7050
7051 2000-02-28  Paul Eggert  <eggert@twinsun.com>
7052
7053         * quotearg.c (ALERT_CHAR): New macro.
7054         (quotearg_buffer_restyled): Use it.
7055
7056 2000-02-27  Jim Meyering  <meyering@lucent.com>
7057
7058         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
7059         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
7060
7061         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
7062         not `#if STDC_HEADERS'.
7063         Declare malloc if needed.
7064
7065         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
7066         now that autoconf always defines the HAVE_DECL_ symbols.
7067         * human.c: Likewise.
7068         * same.c: Likewise.
7069         * strtoumax.c: Likewise.
7070
7071         * backupfile.c: Arrange for cpp to fail if the configure-time
7072         declaration check was not run.
7073         * hash.c: Likewise.
7074         * human.c: Likewise.
7075         * same.c: Likewise.
7076         * strtoumax.c: Likewise.
7077
7078         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
7079         then first look up the entire `.'-containing string as a login name.
7080
7081 2000-02-18  Paul Eggert  <eggert@twinsun.com>
7082
7083         * getdate.y: Handle two-digit years with leading zeros correctly.
7084         (textint): New typedef.
7085         (parser_control): Member year changed from int to textint.
7086         All uses changed.
7087         (YYSTYPE): Removed; replaced by %union with int and textint members.
7088         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
7089         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
7090         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
7091         (tSNUMBER, tUNUMBER): Now of type <textintval>.
7092         (date, number, to_year): Use width of number in digits, not its value,
7093         to determine whether it's a 2-digit year, or a 2-digit time.
7094         (yylex): Store number of digits of numeric tokens.
7095         Reported by John Kendall.
7096
7097         (parser_control): Changed from struct parser_control to typedef (for
7098         consistency).  All uses changed.
7099
7100         (tID): Removed; not used.
7101         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
7102
7103 2000-02-14  Paul Eggert  <eggert@twinsun.com>
7104
7105         * getpagesize.h (getpagesize): Port to VMS for Alpha;
7106         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
7107
7108 2000-02-12  Jim Meyering  <meyering@lucent.com>
7109
7110         * userspec.c (ISDIGIT): Define it.
7111         (isdigit): Remove definition.
7112         (is_number): Use ISDIGIT, not isdigit.
7113         <libintl.h>: Include.
7114         (_ and N_): Define.
7115         (parse_user_spec): Mark translatable strings.
7116
7117 2000-02-10  Jim Meyering  <meyering@lucent.com>
7118
7119         With these changes, nanosleep.[ch] are finally enough like the other
7120         lib/* replacement files to compile on a few more losing systems.
7121
7122         * nanosleep.h: Don't include config.h.
7123         Remove prototype from declaration of nanosleep.
7124         (PARAMS): Remove now-unneeded definition.
7125         * nanosleep.c: #undef nanosleep.
7126         (rpl_nanosleep): Rename from nanosleep.
7127
7128 2000-02-03  Jim Meyering  <meyering@lucent.com>
7129
7130         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
7131         rather than with `#if HAVE_UTMPNAME'.
7132
7133 2000-02-01  Jim Meyering  <meyering@lucent.com>
7134
7135         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
7136
7137 2000-01-31  Jim Meyering  <meyering@lucent.com>
7138
7139         * nanosleep.h (nanosleep): Guard declaration with
7140         `#if ! HAVE_DECL_NANOSLEEP'.
7141         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
7142         the declaration in that vendor's sys/timers.h.
7143         Reported by Christian Krackowizer.
7144
7145         * quotearg.c (ISASCII): Add #undef and move definition to follow
7146         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
7147         (ISPRINT): Likewise.
7148         Reported by Tom Tromey.
7149
7150 2000-01-30  Jim Meyering  <meyering@lucent.com>
7151
7152         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
7153         uses of ->ut_name.  The latter doesn't work with new Linux header files
7154         where only utmpx.ut_user is declared.
7155
7156         * readutmp.h (UT_USER): Define.
7157
7158 2000-01-23  Jim Meyering  <meyering@lucent.com>
7159
7160         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
7161         obstack.c.
7162
7163 2000-01-22  Jim Meyering  <meyering@lucent.com>
7164
7165         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
7166         [! HAVE_DECL_STRTOULL]: Declare strtoull.
7167         Required for some AIX systems.  Reported by Christian Krackowizer.
7168         [TESTING] (main): New function.
7169
7170         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
7171         * dirname.c (dir_name): Support for DOS-style file names with drive
7172         letters.
7173
7174         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
7175
7176         * strverscmp.c (ISDIGIT): Define.
7177         (strverscmp): Use ISDIGIT, not isdigit.
7178
7179 2000-01-17  Paul Eggert  <eggert@twinsun.com>
7180
7181         * nanosleep.c (nanosleep):
7182         Don't use SA_INTERRUPT to decide whether to call sigaction, as
7183         POSIX.1 doesn't require SA_INTERRUPT and some systems
7184         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
7185         it's been part of POSIX.1 since day 1 (in 1988).
7186
7187 2000-01-17  Jim Meyering  <meyering@lucent.com>
7188
7189         * interlock: Remove unused file.  Reported by François Pinard.
7190
7191 2000-01-16  Paul Eggert  <eggert@twinsun.com>
7192
7193         * quotearg.c (quotearg_buffer_restyled): Do not quote
7194         alert, backslash, formfeed, and vertical tab unnecessarily in
7195         shell quoting style.
7196
7197
7198 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
7199 Free Software Foundation, Inc.
7200 Copying and distribution of this file, with or without modification,
7201 are permitted provided the copyright notice and this notice are preserved.