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