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