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