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