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