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