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