* modules/getloadavg (Files): Add m4/getloadavg.m4.
[gnulib.git] / lib / ChangeLog
1 2006-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * getloadavg.c [defined gl_GETLOADAVG]: Don't include config.h
4         or stdbool.h, because they might not exist while configuring.
5
6         * chdir-long.c: Include <fcntl.h>, for O_DIRECTORY.
7         Don't include unistd.h or limits.h; not needed, since chdir-long.h
8         does that for us.
9         (O_DIRECTORY): Remove.
10
11 2006-08-30  Paul Eggert  <eggert@cs.ucla.edu>
12
13         Work around a bug in both the Linux and SunOS 64-bit kernels:
14         nanosleep mishandles sleeps for longer than 2**31 seconds.
15         Problem reported by Frank v Waveren in
16         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00298.html>.
17         * nanosleep.c (BILLION): New constant.
18         (getnow) [HAVE_BUG_BIG_NANOSLEEP]: New functions.
19         (rpl_nanosleep) [HAVE_BUG_BIG_NANOSLEEP]: Completely new implementation.
20
21 2006-08-30  Jim Meyering  <jim@meyering.net>
22
23         * isapipe.c (isapipe): Rename local s/fd/fd_pair/ to avoid shadowing
24         the parameter.
25
26 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
27
28         * isapipe.c, isapipe.h: New files.
29
30 2006-08-29  Eric Blake  <ebb9@byu.net>
31
32         * error.c (error_at_line, print_errno_message): Match libc, after
33         resolution of upstream bug 3044.
34
35 2006-08-29  Bruno Haible  <bruno@clisp.org>
36
37         * localcharset.c: Include configmake.h in order to get LIBDIR defined.
38
39 2006-08-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
40
41         Sync from Libtool:
42
43         2006-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
44
45         * libltdl/argz.c: Use `#ifdef HAVE_CONFIG_H', to facilitate code
46         sharing with gnulib.  Report by Eric Blake.
47
48 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
49
50         * fcntl_.h: New file.
51         * chdir-safer.c (O_DIRECTORY, O_NOFOLLOW): Remove, now that we have
52         the fcntl module.
53         * dirchownmod.c: Likewise.
54         * fts.c: Likewise.
55
56         * inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
57         Include @ABSOLUTE_INTTYPES_H@ if available, but do nothing else.
58         * stdint_.h (_GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H): Define
59         just before including <inttypes.h>, to avoid circular inclusion.
60
61 2006-08-28  Bruno Haible  <bruno@clisp.org>
62
63         * inttypes_.h (SCNX*): Remove definitions.
64         Reported by Eric Blake.
65
66 2006-08-26  Bruno Haible  <bruno@clisp.org>
67
68         * vasnprintf.c (EOVERFLOW): Remove definition.
69         (VASNPRINTF): Return a string of length > INT_MAX without failing.
70         * vasprintf.c: Include errno.h, limits.h.
71         (EOVERFLOW): New fallback definition.
72         (vasprintf): Test here whether the string length is > INT_MAX.
73         * vsnprintf.c: Include errno.h, limits.h.
74         (EOVERFLOW): New fallback definition.
75         (vsnprintf): Fix bug when generated string was too long for the buffer.
76         Test here whether the string length is > INT_MAX.
77
78 2006-08-26  Bruno Haible  <bruno@clisp.org>
79             Simon Josefsson  <jas@extundo.com>
80
81         BeOS portability.
82         * getaddrinfo.c (PF_INET, PF_UNSPEC): New macros.
83
84 2006-08-28  Bruno Haible  <bruno@clisp.org>
85
86         * c-strstr.h: New file, from GNU gettext.
87         * c-strstr.c: New file, from GNU gettext.
88
89 2006-08-26  Bruno Haible  <bruno@clisp.org>
90
91         * inttypes_.h: New file.
92         * inttypes.h: Remove file.
93         * stdint_.h: Include <inttypes.h> through its absolute filename.
94
95         * imaxabs.c: New file.
96
97         * imaxdiv.c: New file.
98
99 2006-08-22  Bruno Haible  <bruno@clisp.org>
100
101         * readutmp.h: Skip most definitions if neither <utmp.h> nor
102         <utmpx.h> exists.
103
104 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
105
106         BeOS portability.
107         * dirchownmod.c (dirchownmod): Don't use fchmod if it doesn't exist.
108         Problem reported by Bruno Haible.
109
110 2006-08-21  Bruno Haible  <bruno@clisp.org>
111
112         BeOS portability.
113         * mbchar.h: Include <wctype.h> only if it exists.
114
115 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
116
117         * cycle-check.h: Include <stdint.h> unconditionally, since we
118         now assume the stdint module.  Do not include inttypes.h.
119         * fsusage.h: Likewise.
120         * getndelim2.c: Likewise.
121         * human.h: Likewise.
122         * inttostr.h: Likewise.
123         * obstack.c: Likewise.
124         * regex_internal.h: Likewise.
125         * tempname.c: Likewise.
126         * utimecmp.c: Likewise.
127         * xstrtol.h: Likewise.
128
129         * stat_.h: Fix typo: HAVE_FUNC_LSTAT -> HAVE_LSTAT.
130
131         * strtoimax.c: Adjust to macro name changes in Autoconf,
132         e.g., HAVE_LONG_LONG -> HAVE_LONG_LONG_INT.
133         * xtime.h: Likewise.
134
135 2006-08-19  Paul Eggert  <eggert@cs.ucla.edu>
136
137         * fchmodat.c: New file, from coreutils.  This was inadvertently
138         omitted in the 2006-08-17 update.  Problem reported by Jay Youngman.
139
140 2006-08-18  Bruno Haible  <bruno@clisp.org>
141
142         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
143         (ME_DUMMY): Treat "kernfs" as a dummy.
144         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
145
146 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
147
148         Update from coreutils.
149
150         * __fpending.h: Add copyright notice.
151         * fprintftime.h: Likewise.
152         * savedir.c: Use (C) in copyright notice.
153         * savedir.h: Likewise.
154
155         2006-08-15  Jim Meyering  <jim@meyering.net>
156
157         * at-func.c: New file, with the logic of all emulated at-functions.
158         * openat-priv.h: Include <errno.h> and define ENOSYS,
159         in support of the EXPECTED_ERRNO macro.
160         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
161         Instead, define the appropriate symbols and include "at-func.c".
162         * mkdirat.c (mkdirat): Likewise.
163         * fchmodat.c (fchmodat): Likewise.
164         (ENOSYS): Remove definition.
165         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
166         Don't include "unistd--.h" -- it wasn't ever used.
167
168         2006-01-17  Jim Meyering  <jim@meyering.net>
169
170         Rewrite fts.c not to change the current working directory,
171         by using openat, fstatat, fdopendir, etc..
172
173         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
174         (HAVE_OPENAT_SUPPORT): Define.
175         [_LIBC] (fchdir): Don't undef or define; no longer used.
176         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
177         Now, this `function' always succeeds, and consumes its file descriptor
178         parameter -- so callers must not close such FDs.  Update callers.
179         (diropen_fd, opendirat, cwd_advance_fd): New functions.
180         (diropen): Add parameter, SP.  Adjust all callers.
181         Implement using diropen_fd, rather than open.
182         (fts_open): Initialize new member, fts_cwd_fd.
183         Remove fts_rft-setting code.
184         (fts_close): Close fts_cwd_fd, if necessary.
185         (__opendir2): Define in terms of opendir or opendirat,
186         depending on whether the FST_NOCHDIR flag is set.
187         (fts_build): Since fts_safe_changedir consumes its FD, and since
188         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
189         and close the dup'd file descriptor upon failure.
190         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
191         (fts_safe_changedir): Tweak semantics to reflect that this function
192         now calls cwd_advance_fd and hence consumes its FD argument.
193         * fts_.h [struct FTS] (fts_cwd_fd): New member.
194         [struct FTS] (fts_rft): Remove now-unused member.
195         [struct FTS] (fts_cycle.state): Improve comment.
196
197         * openat.c (openat_needs_fchdir): New function.
198         * openat.h (openat_needs_fchdir): Declare it.
199
200 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
201
202         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
203         Problem and fix reported by Pádraig Brady in
204         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
205
206 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
207
208         * memcoll.c (memcoll): Optimize for the common case where the
209         arguments are bytewise equal.
210
211 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
212
213         Change copyright notice from LGPL 2 to GPL 2, since that's the
214         standard form used in the gnulib repository.
215         * lock.c: LGPL -> GPL.
216         * lock.h: Likewise.
217         * strnlen1.c: Likewise.
218         * strnlen1.h: Likewise.
219         * tls.c: Likewise.
220         * tls.h: Likewise.
221         * tmpdir.c: Likewise.
222
223         * TODO: Remove; this belongs only in coreutils.
224
225 2006-08-14  Eric Blake  <ebb9@byu.net>
226
227         Import the following change from libc:
228
229         2006-08-12  Ulrich Drepper  <drepper@redhat.com>
230
231         Upstream bug 2997.
232         * misc/error.c: Add space between program name and message if file
233         name is missing.
234
235 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
236
237         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
238         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
239
240         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
241         in wchar_t.  Problem reported by Eric Blake.
242
243         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
244         LEN is smaller than SIZE.  Suggested by Bruno Haible.
245         Also, help the compiler to keep LEN in a register.
246
247 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
248
249         * .cppi-disable: Add snprintf.h, socket_.h.
250         * snprintf.c: Include <errno.h> and <limits.h>.
251         (EOVERFLOW): Define if the system does not.
252         Do not include "minmax.h"; it wasn't used.
253         (snprintf): Don't assume size_t promotes to an unsigned type.
254         Fix bug when generated string was too long for the buffer: the
255         buffer's contents are supposed to be the initial prefix of the
256         output.  Don't assume vasnprintf returns EOVERFLOW if the size
257         exceeds INT_MAX; do the check ourselves.
258
259         Import the following changes from libc:
260
261         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
262
263         * posix/regex_internal.c (re_string_skip_chars): If no character has
264         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
265         to the byte which couldn't be converted.
266         (re_string_reconstruct): Don't clear valid_raw_len before calling
267         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
268         tip_context using re_string_context_at.
269
270         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
271
272         * posix/regex.h: g++ still cannot handled [restrict].
273
274         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
275
276         * posix/regex.h: Remove special handling for VMS.
277
278 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
279
280         Sync from coreutils.
281
282         2006-07-19  Mike Frysinger  <vapier@gentoo.org>
283
284         * lib/mountlist.c [ME_REMOTE]: Filter out cifs.
285         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
286
287 2006-08-08  Eric Blake  <ebb9@byu.net>
288
289         * verror.c (verror_at_line): Work around glibc bug 2997, so that
290         verror_at_line output complies with GNU Coding Standards even when
291         file is NULL.
292
293 2006-08-08  Eric Blake  <ebb9@byu.net>
294
295         * verror.h, verror.c: New files.
296
297 2006-08-07  Bruno Haible  <bruno@clisp.org>
298
299         * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer
300         versions of AIX.
301         Reported by Ralf Wildenhues.
302
303 2006-08-06  Eric Blake  <ebb9@byu.net>
304
305         * error.h: Fold in some upstream changes from glibc.
306         * error.c: Likewise.
307
308 2006-07-29  Bruno Haible  <bruno@clisp.org>
309
310         * localcharset.c: Assume <stddef.h>, <stdlib.h>, <string.h> exist.
311
312 2006-07-29  Bruno Haible  <bruno@clisp.org>
313
314         * setenv.c: Undo unintended modification done on 2006-02-27.
315
316 2006-07-28  Eric Blake  <ebb9@byu.net>
317
318         * regex_internal.h (struct re_dfa_t) [!_LIBC]: Avoid invalid C89
319         macro expansion.
320
321 2006-07-28  Simon Josefsson  <jas@extundo.com>
322
323         * inet_ntop.h, inet_pton.h: No need to guard netinet/in.h
324         #include's.
325
326 2006-07-28  Simon Josefsson  <jas@extundo.com>
327
328         * inet_ntop.h, inet_pton.h: No need to guard arpa/inet.h
329         #include's.
330
331 2006-07-28  Bruno Haible <bruno@clisp.org>
332
333         * inet_ntop.h, inet_pton.h: Use #if HAVE* instead of #ifdef HAVE*.
334
335 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
336
337         * inet_ntop.h, inet_pton.h: Need to include netinet/in.h before
338         arpa/inet.h.
339
340 2006-07-28  Bruno Haible  <bruno@clisp.org>
341
342         * mbchar.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph,
343         iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Define
344         fallbacks.
345         Avoids link error on FreeBSD 4.x.
346         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
347
348         * wcwidth.h (iswprint): Assume an ASCII compatible wide character
349         encoding.
350         * mbswidth.c (iswcntrl): Likewise.
351
352 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
353
354         * modechange.c (mode_compile): Numeric modes now affect setuid and
355         setgid on directories only if they set these bits.
356         * modechange.h: Remove obsolete comment about masks.
357
358 2006-07-27  Bruno Haible  <bruno@clisp.org>
359
360         * stdint_.h (INT*_C, UINT*_C) [C++]: Define these if
361         __STDC_CONSTANT_MACROS is defined, not if __STDC_LIMIT_MACROS is
362         defined.
363
364 2006-07-26  Eric Blake  <ebb9@byu.net>
365
366         * mkstemp-safer.c [! HAVE_MKSTEMP]: Add prototype for platforms
367         like mingw that lack mkstemp.
368         * pipe-safer.c (pipe_safer) [!HAVE_FUNC_PIPE]: Provide fallback to
369         avoid compilation warning on mingw.
370
371 2006-07-25  Bruno Haible  <bruno@clisp.org>
372
373         * version-etc.c (version_etc_va): Use va_copy, assumed to be defined in
374         <stdarg.h> or config.h.
375
376 2006-07-24  Bruno Haible  <bruno@clisp.org>
377
378         * clean-temp.h: New file, from GNU gettext.
379         * clean-temp.c: New file, from GNU gettext.
380
381 2006-07-24  Bruno Haible  <bruno@clisp.org>
382
383         * tmpdir.h: New file, from GNU gettext.
384         * tmpdir.c: New file, from GNU gettext.
385
386 2006-07-23  Bruno Haible  <bruno@clisp.org>
387
388         * gl_anylinked_list2.h (ASYNCSAFE): New macro.
389         (gl_linked_add_first, gl_linked_add_last, gl_linked_add_before,
390         gl_linked_add_after, gl_linked_add_at, gl_linked_remove_node,
391         gl_linked_remove_at): Use it.
392
393 2006-07-23  Eric Blake  <ebb9@byu.net>
394
395         * tmpfile-safer.c: New file.
396         * stdio-safer.h (fopen_safer): Add prototype.
397         * stdio--.h (tmpfile): Make safer.
398
399 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
400
401         * close-stream.c, close-stream.h: New files.
402
403 2006-07-22  Bruno Haible  <bruno@clisp.org>
404
405         Merge from GNU gettext 0.15.
406
407         2005-07-05  Bruno Haible  <bruno@clisp.org>
408
409                 * printf-args.c (printf_fetchargs): Work around broken
410                 definition of wint_t on mingw.
411
412         2005-02-12  Bruno Haible  <bruno@clisp.org>
413
414                 * xallocsa.h: Add extern "C" for C++.
415
416         2006-05-17  Bruno Haible  <bruno@clisp.org>
417
418                 Cygwin portability.
419                 * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
420
421         2006-04-30  Bruno Haible  <bruno@clisp.org>
422
423                 * progreloc.c: Include <mach-o/dyld.h> if available.
424                 (find_executable): Use _NSGetExecutablePath when possible.
425
426         2006-05-06  Charles Wilson  <cygwin@cwilson.fastmail.fm>
427
428                 * progreloc.c (maybe_executable) [CYGWIN]: Use the access()
429                 function.
430
431         2005-12-29  Bruno Haible  <bruno@clisp.org>
432
433                 * progreloc.c (set_program_name_and_installdir): Fix
434                 compilation error.
435
436         2005-12-04  Bruno Haible  <bruno@clisp.org>
437
438                 Cygwin portability.
439                 * progreloc.c: Include <windows.h> also on Cygwin.
440                 (find_executable): Add support for Cygwin.
441                 (set_program_name_and_installdir): Handle also platforms with
442                 nonempty EXEEXT.
443
444         2006-07-11  Bruno Haible  <bruno@clisp.org>
445
446                 * javacomp.c: Fix a comment.
447                 Reported by Jim Meyering.
448
449         2006-04-30  Bruno Haible  <bruno@clisp.org>
450
451                 * javacomp.h (compile_java_class): Add source_version,
452                 target_version arguments.
453                 * javacomp.c: Rewritten to choose only a compiler that
454                 respects the specified source_version and target_version.
455
456         2006-06-27  Bruno Haible  <bruno@clisp.org>
457
458                 Assume correct S_ISDIR macro.
459                 * mkdtemp.c: Remove test of STAT_MACROS_BROKEN.
460
461         2006-07-22  Bruno Haible  <bruno@clisp.org>
462
463                 * javaversion.h: New file, from GNU gettext.
464                 * javaversion.c: New file, from GNU gettext.
465                 * javaversion.java: New file, from GNU gettext.
466                 * javaversion.class: New file, from GNU gettext.
467
468         2006-05-17  Bruno Haible  <bruno@clisp.org>
469
470                 Cygwin portability.
471                 * javaexec.c (execute_java_class): Test for jview program
472                 also on Cygwin.
473
474         2006-04-09  Bruno Haible  <bruno@clisp.org>
475
476                 * fatal-signal.c: Don't include string.h.
477                 (at_fatal_signal): Use a copying loop instead of memcpy.
478
479         2005-12-04  Bruno Haible  <bruno@clisp.org>
480
481                 * csharpexec.c: Add support for 'clix' launcher (untested).
482                 (execute_csharp_using_sscli): New function.
483                 (execute_csharp_program): Call it.
484
485         2006-06-21  Bruno Haible  <bruno@clisp.org>
486
487                 Avoid warnings from recent versions of mcs.
488                 * csharpcomp.c (compile_csharp_using_mono): Don't use options
489                 -o, -L, -r any more. Use options documented since mcs-1.0
490                 instead. Similarly for -g.
491
492         2005-07-09  Bruno Haible  <bruno@clisp.org>
493
494                 * csharpcomp.c (compile_csharp_using_sscli): For -l option,
495                 add a .dll suffix.
496                 Reported by Mark Junker <mjscod@gmx.de>.
497
498         2006-06-17  Bruno Haible  <bruno@clisp.org>
499
500                 * config.charset: Update for NetBSD 3.0.
501
502         2006-05-17  Bruno Haible  <bruno@clisp.org>
503
504                 Cygwin portability.
505                 * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
506
507         2006-05-16  Bruno Haible  <bruno@clisp.org>
508
509                 * localcharset.c [CYGWIN]: Include <windows.h>.
510                 (get_charset_aliases): For Cygwin, return the same CPxxx
511                 aliases list as under WIN32.
512                 (locale_charset) [CYGWIN]: Try to retrieve the encoding from
513                 the environment variables. Fall back to GetACP().
514
515         2006-04-05  Bruno Haible  <bruno@clisp.org>
516
517                 * config.charset: Update Juan Manuel Guerrero's address.
518
519         2005-02-12  Bruno Haible  <bruno@clisp.org>
520
521                 * allocsa.h: Add extern "C" for C++.
522
523         2005-02-10  Bruno Haible  <bruno@clisp.org>
524
525                 * allocsa.h (sa_alignof): Define differently with AIX xlc, to
526                 avoid a bug of this compiler on AIX 3.2.5 dealing with enums.
527
528         2006-07-22  Bruno Haible  <bruno@clisp.org>
529
530                 * gettext.h: Update to GNU gettext-0.15.
531
532 2006-07-22  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
533         and Simon Josefsson <jas@extundo.com>
534
535         * getaddrinfo.h (AI_PASSIVE): Make sure it is defined.
536
537         * getaddrinfo.c (getaddrinfo): Support AI_PASSIVE.
538
539 2006-07-21  Eric Blake  <ebb9@byu.net>
540
541         * stdlib-safer.h: New file from coreutils, required by
542         stdlib--.h.
543
544 2006-07-19  Derek R. Price  <derek@ximbiot.com>
545
546         * getaddrinfo.h: Don't define unimplemented AI_* flags.
547         Reindent and repaginate.
548
549 2006-07-17  Bruno Haible  <bruno@clisp.org>
550
551         * gl_list.h: New file.
552         * gl_list.c: New file.
553         * gl_array_list.h: New file.
554         * gl_array_list.c: New file.
555         * gl_carray_list.h: New file.
556         * gl_carray_list.c: New file.
557         * gl_linked_list.h: New file.
558         * gl_linked_list.c: New file.
559         * gl_anylinked_list1.h: New file.
560         * gl_anylinked_list2.h: New file.
561         * gl_avltree_list.h: New file.
562         * gl_avltree_list.c: New file.
563         * gl_anyavltree_list1.h: New file.
564         * gl_anyavltree_list2.h: New file.
565         * gl_rbtree_list.h: New file.
566         * gl_rbtree_list.c: New file.
567         * gl_anyrbtree_list1.h: New file.
568         * gl_anyrbtree_list2.h: New file.
569         * gl_anytree_list1.h: New file.
570         * gl_anytree_list2.h: New file.
571         * gl_linkedhash_list.h: New file.
572         * gl_linkedhash_list.c: New file.
573         * gl_anyhash_list1.h: New file.
574         * gl_anyhash_list2.h: New file.
575         * gl_avltreehash_list.h: New file.
576         * gl_avltreehash_list.c: New file.
577         * gl_rbtreehash_list.h: New file.
578         * gl_rbtreehash_list.c: New file.
579         * gl_anytreehash_list1.h: New file.
580         * gl_anytreehash_list2.h: New file.
581
582         * gl_oset.h: New file.
583         * gl_oset.c: New file.
584         * gl_array_oset.h: New file.
585         * gl_array_oset.c: New file.
586         * gl_avltree_oset.h: New file.
587         * gl_avltree_oset.c: New file.
588         * gl_rbtree_oset.h: New file.
589         * gl_rbtree_oset.c: New file.
590         * gl_anytree_oset.h: New file.
591
592 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
593
594         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
595         New files.
596         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
597         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
598         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
599         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
600         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
601         callers changed.  Revamp internals significantly, by not
602         attempting to create directories that are temporarily more
603         permissive than the final results.  Do not attempt to use
604         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
605         This removes some race conditions, fixes some bugs, and simplifies
606         things.  Use new dirchownmod function to do owner and mode changes.
607         * mkdir-p.h: Likewise.
608         * modechange.c (octal_to_mode): New function.
609         (struct mode_change): New member mentioned.
610         (make_node_op_equals): New arg mentioned.  All callers changed.
611         (mode_compile): Keep track of which mode bits the user has explicitly
612         mentioned.
613         (mode_adjust): New arg DIR, so that we implement the X op correctly.
614         New arg PMODE_BITS, to keep track of which mode bits the user
615         mentioned; it treats S_ISUID and S_ISGID speciall.
616         All callers changed.
617         * modechange.h: Likewise.
618
619 2006-07-11  Derek R. Price  <derek@ximbiot.com>
620
621         * glob.c: s/NAMLEN/_D_EXACT_NAMLEN/.
622
623 2006-07-10  Derek R. Price  <derek@ximbiot.com>
624
625         * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:
626         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
627         macros into the GNU _D_EXACT_NAMLEN.
628         * savedir.c:  Likewise.
629         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
630
631 2006-07-09  Jim Meyering  <jim@meyering.net>
632
633         * argp-pv.c: Remove a doubled word in a comment.
634         * check-version.c (check_version): Likewise.
635         * javacomp.c (compile_java_class): Likewise.
636
637 2006-07-08  Jim Meyering  <jim@meyering.net>
638
639         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
640
641 2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
642
643         * lib/getaddrinfo.c: Changes to compile under MSVC6: changed
644         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
645         brackets.  Other minor changes to suppress some compiler
646         warnings.
647
648 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
649
650         * getloadavg.c: Use __VMS, not VMS.
651         * getopt.c: Likewise.
652         * getpagesize.h: Likewise.
653         * glob.c: Remove most VMS cruft; it hasn't been tested for a while and
654         probably does not work.
655
656 2006-07-06  Derek R. Price  <derek@ximbiot.com>
657         and Paul Eggert  <eggert@cs.ucla.edu>
658
659         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
660         Don't worry about this obsolete case any more.
661         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
662         directories.
663         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
664         worry about this obsolete case any more.
665         * fts.c: Likewise.
666         * getcwd.c: Likewise.
667         * glob.h: Likewise.
668         * savedir.c: Likewise.
669
670 2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
671
672         * .cppi-disable: Add wcwidth.
673         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
674         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
675         (ISGRAPH): Remove.  All uses changed to isgraph.
676         (FOLD) [!defined _LIBC]: Remove special case.
677         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
678         * regex_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
679         HAVE_ISBLANK.
680         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
681
682 2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
683
684         * strtod.c (strtod): cast the argument of tolower to unsigned char.
685
686 2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
687
688         * memcasecmp.c: Include <limits.h>.
689         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
690         * strtod.c (strtod): Don't assume isspace works on negative chars.
691         Don't assume isdigit succeeds only on '0' through '9'.
692
693 2006-07-05  Derek R. Price  <derek@ximbiot.com>
694
695         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
696         All uses of is_space replaced by isspace.
697         * exit.h: Don't talk about STDC_HEADERS.
698         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
699         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
700         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
701         replaced by isprint etc.
702         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
703         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
704         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
705         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
706         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
707         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
708
709 2006-07-05  Eric Blake  <ebb9@byu.net>
710
711         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
712         missing from netdb.h.
713         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
714
715 2006-06-27  Bruno Haible  <bruno@clisp.org>
716
717         Assume ANSI C header files and <ctype.h> functions.
718         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
719         (mbsnwidth): Use isprint, iscntrl instead.
720
721 2006-07-03  Jim Meyering  <jim@meyering.net>
722
723         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
724         macro is used before the first cycle_check call.
725
726 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
727
728         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
729         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
730         reported by Mark D. Baushke, one in
731         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
732
733         Merge from coreutils.
734
735         * .cppi-disable: Add stdint_.h.
736         * .cvsignore: Add stdint.h.
737
738         2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
739
740         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
741         both double and long double versions.
742         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
743         * xstrtold.c: New file.
744         * xstrtod.h (xstrtold): New decl.
745
746         2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
747
748         * filemode.c (setst): Remove.
749         (strmode): Rewrite to avoid setst.  This makes the code shorter,
750         (arguably) clearer, and the generated code is a bit smaller on my
751         Debian GNU/Linux stable x86 host.
752
753         2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
754
755         * filemode.c: Include "filemode.h" first, to test the interface.
756         Assume that filemode.h includes sys/types.h and sys/stat.h.
757         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
758         (ftypelet): Reorder to put common cases first, for efficiency.
759         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
760         to do 'M'.
761         (strmode): Renamed from mode_string, and now stores 12 bytes instead
762         of 10, for compatibility with FreeBSD.  All callers changed.
763         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
764         that can't be deduced solely from st_mode.  First arg is now a const
765         pointer.
766         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
767         (strmode): Renamed from mode_string.
768         (filemodestring): New decl.
769         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
770         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
771         (S_ISPORT, S_ISWHT): New macros, if not already defined.
772
773         2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
774
775         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
776         fsusage.h now does that.  Include fsusage.h first, to test interface.
777         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
778         at most one method (the old code could have generated decls that
779         didn't conform to C89, not that this was ever exercised).
780         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
781
782         2006-03-19  Jim Meyering  <jim@meyering.net>
783
784         Work even in a chroot where d_ino values for entries in "/"
785         don't match the stat.st_ino values for the same names.
786         * getcwd.c (__getcwd): When no d_ino value matches the target inode
787         number, iterate through all entries again, using lstat instead.
788         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
789         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
790
791         * getcwd.c (__getcwd): Clarify a comment.
792         Use memcpy in place of a call to strcpy.
793
794         2006-03-12  Jim Meyering  <jim@meyering.net>
795
796         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
797         that of the current directory (which we're about to chdir ".." out of),
798         then save the dev-ino of the parent, instead.
799
800         * same-inode.h (SAME_INODE): New file/macro.
801         * chdir-safer.c (SAME_INODE): Remove definition.
802         Include "same-inode.h", instead.
803         * same.c: Likewise.
804         * cycle-check.h: Include "same-inode.h".
805         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
806         * cycle-check.c (SAME_INODE): Remove definition.
807         * root-dev-ino.h: Include "same-inode.h".
808
809         2006-03-11  Eric Blake  <ebb9@byu.net>
810
811         * same.c (same_name): s/base_name/last_component/
812         * backupfile.c (check_extension, numbered_backup): Likewise.
813         * filenamecat.c (file_name_concat): Likewise.
814
815         2006-03-11  Eric Blake  <ebb9@byu.net>,
816                     Paul Eggert  <eggert@cs.ucla.edu>
817
818         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
819         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
820         drive prefix.
821         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
822         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
823         (last_component): New method.
824         * dirname.c (dir_len): Determine when drive letters need a
825         subsequent slash.  Preserve // when it is special.
826         (dir_name): Don't append dot when drive letter is absolute.
827         [TEST_DIRNAME]: Move into a full-blown gnulib test.
828         * basename.c (base_name): New semantics - malloc the result.
829         Preserve // when it is special.  Preserve relative files that look
830         like drive letters.
831         (base_len): Preserve // when it is special.
832         (last_component): New method, similar to old base_name semantics.
833         * stripslash.c (strip_trailing_slashes): Use last_component, not
834         base_name.  Strip redundant slashes from ///.
835
836 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
837
838         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
839         both are 64 bits, since this seems to be the tradition, and this
840         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
841         we ever run into a host that prefers long long to long in this
842         case, we'll need another configure-time test.  Problem reported by
843         Jim Meyering.
844
845 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
846
847         * stdint_.h (_GL_STDINT_H): Renamed from _STDINT_H, to avoid
848         possible collision with system files.
849         (<stdio.h>, <time.h>, <wchar.h>) [defined __cplusplus && ! defined
850         __STDC_CONSTANT_MACROS)]: Do not include, since we don't need
851         WCHAR_MIN and WCHAR_MAX in this case.
852         (<stddef.h>): Do not include; no longer needed.
853         (<sys/types.h>): Include if @HAVE_SYS_TYPES_H@, not if
854         (defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)).
855         (<sys/inttypes.h>): Include if @HAVE_SYS_INTTYPES_H@ &&
856         !@HAVE_INTTYPES_H@, not if (defined(__FreeBSD__)
857         && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)).
858         (__STDINT_H__) [@HAVE_STDINT_H@ && defined __sgi && ! defined
859         __c99]: Define, to work around IRIX <stdint.h> incompatibility.
860         (@FULL_PATH_STDINT_H@) [!(defined(__sgi) && @HAVE_INTTYPES_H@ &&
861         !defined(__c99))]: Include in this case too, since it's harmless
862         now.
863         (<inttypes.h>) [@HAVE_INTTYPES_H@]: Include, since it's no longer
864         dangerous to do so.
865         (@FULL_PATH_INTTYPES_H@) [(defined(__hpux) || defined(_AIX)) &&
866         @HAVE_INTTYPES_H@]: Do not include, since we now include <inttypes.h>.
867         (_STDINT_MIN, _STDINT_MAX): New macros.
868         (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t):
869         (uint64_t, int_least8_t, uint_least8_t, int_least16_t):
870         (uint_least16_t, int_least32_t, uint_least32_t, int_least64_t):
871         (uint_least64_t, int_fast8_t, uint_fast8_t, int_fast16_t):
872         (uint_fast16_t, int_fast32_t, uint_fast32_t, int_fast64_t):
873         (uint_fast64_t, intptr_t, uintptr_t, intmax_t, uintmax_t): Now
874         macros, not typedefs; this simplifies things quite a bit.
875         Use long int for all types narrower than int64_t.
876         (intmax_t, uintmax_t, INTMAX_C, UINTMAX_C):
877         Define in terms of long long int or int64_t or long int,
878         not int64_t or int32_t.  This saves some compile-time testing.
879         (INT8_MIN, INT8_MAX, UINT8_MAX, INT16_MIN, INT16_MAX, UINT16_MAX):
880         (INT32_MIN, INT32_MAX, UINT32_MAX, INT64_MIN, INT64_MAX):
881         (UINT64_MAX, INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX):
882         (INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX):
883         (INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX):
884         (INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, INT_FAST8_MIN):
885         (INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX):
886         (UINT_FAST16_MAX, INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX):
887         (INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTPTR_MIN):
888         (INTPTR_MAX, UINTPTR_MAX, INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX):
889         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
890         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
891         undef any previous version and define our own version, for
892         simplicity and consistency with the new macros for types.
893         (PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX):
894         (SIZE_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX):
895         Simplify definitions by using _STDINT_MIN and _STDINT_MAX
896         where appropriate.  Rely on new symbols @PTRDIFF_T_SUFFIX@,
897         @SIG_ATOMIC_T_SUFFIX@, @SIZE_T_SUFFIX@, @WCHAR_T_SUFFIX@,
898         @WINT_T_SUFFIX@ to keep things simple here.
899         (UINT8_C, UINT16_C, UINT32_C, INT64_C, UINT64_C):
900         Simplify by assuming typical 8/16/32/64 host, since we're
901         already doing that elsewhere anyway.
902         Use (LONG_MAX >> 31 >> 31 == 1) rather than @HAVE_LONG_64BIT@,
903         and assume long long int is 64 bits if available.  This
904         speeds up 'configure'.
905
906 2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
907
908         * getaddrinfo.c: fixed typo
909
910 2006-06-29  Eric Blake  <ebb9@byu.net>
911
912         * stat_.h (rpl_mkdir): Declare inline, to avoid warnings about
913         unused static function.
914
915 2006-06-29  Eric Blake  <ebb9@byu.net>
916
917         * stat_.h: New file.
918
919 2006-06-29  Derek R. Price  <derek@ximbiot.com>
920
921         * strftime.c: Assume strftime() exists.
922
923 2006-06-28  Bruno Haible  <bruno@clisp.org>
924
925         * getaddrinfo.h: Fix POSIX URL.
926         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
927         (use_win32_p): Make static.
928         (getaddrinfo): Reject service name if it is empty or does not consist
929         solely of decimal digits, or if its value is > 65535.
930         (getnameinfo): Remove useless casts.
931
932 2006-06-28  Derek R. Price  <derek@ximbiot.com>
933
934         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
935         Autoconf 2.60 says this stuff was obsolete.
936
937 2006-05-12  Bruno Haible  <bruno@clisp.org>
938
939         * mkdtemp.c [MINGW]: Include <io.h>.
940         (mkdir): Define using _mkdir.
941
942 2006-06-28  Bruno Haible  <bruno@clisp.org>
943
944         * wcwidth.h: Declare nothing if !HAVE_WCHAR_T. Provide a fallback
945         declaration for wcwidth.
946         * mbswidth.c: Restore the includes of <wchar.h> and <wctypes.h>.
947
948 2006-06-28  Eric Blake  <ebb9@byu.net>
949
950         * xvasprintf.h: Fix comments.
951
952 2006-06-28  Eric Blake  <ebb9@byu.net>
953
954         * mbchar.h (wcwidth): Include wcwidth.h.
955         * mbswidth.c (wcwidth): Move from here...
956         * wcwidth.h: ...to this new file.
957
958 2006-06-28  Simon Josefsson  <jas@extundo.com>
959
960         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
961         functions there.  It will succeed on Windows XP, but on Windows
962         2000 and (presumably) earlier, it will fail, and use the internal
963         re-implementation.
964         (use_win32_p): New function.
965         (getaddrinfo): Use strtoul on servname, to support numeric ports.
966         Support AI_NUMERICSERV to disable getservbyname.
967         (getnameinfo): New function, only supports
968         NI_NUMERICHOST|NI_NUMERICSERV for now.
969
970         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
971         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
972         getnameinfo.
973
974 2006-06-27  Bruno Haible  <bruno@clisp.org>
975
976         * stdint_.h (intmax_t, uintmax_t): Undefine before typedef.
977
978 2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
979
980         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
981         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
982         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
983
984 2006-06-26  Bruno Haible  <bruno@clisp.org>
985
986         * stdint_.h: Include <wchar.h> if necessary for WCHAR_MIN or
987         WCHAR_MAX.
988         Reported by Mark D. Baushke and Larry Jones.
989
990 2006-06-26  Bruno Haible  <bruno@clisp.org>
991
992         * stdint_.h: Don't include <stdint.h> when using the SGI C compiler
993         in pre-C99 mode.
994         Suggested by Mark D. Baushke and Larry Jones.
995
996 2006-06-23  Mark D. Baushke  <mdb@gnu.org>
997
998         * stdint_.h: Treat BSD/OS like OpenBSD.
999
1000 2006-06-23  Bruno Haible  <bruno@clisp.org>
1001
1002         * stdint_.h: Treat IRIX like OpenBSD.
1003
1004 2006-06-23  Bruno Haible  <bruno@clisp.org>
1005
1006         * stdint_.h (UINT8_C, UINT16_C, UINT32_C): Define according to
1007         ISO C 99 Technical Corrigendum 1.
1008
1009 2006-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1010
1011         * glob.c (collated_compare): Remove 'const' uses that weren't needed.
1012         Some compiler complained about some of them.  Problem reported by
1013         Larry Jones in
1014         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00172.html>.
1015
1016 2006-06-21  Simon Josefsson  <jas@extundo.com>
1017
1018         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
1019         variable.
1020
1021         * socket_.h: Don't define WINVER.
1022
1023         * inet_pton.h, inet_pton.c: New file, taken from glibc but
1024         slightly modified to work in gnulib.
1025
1026 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1027
1028         * read-file.c (fread_file): Start with buffer allocation of
1029         0 bytes rather than 1 byte; this simplifies the code.
1030         Don't invoke feof; it's not needed.  Refactor to avoid duplicate
1031         code to free buffer and save/restore errno.
1032         (internal_read_file): Remove unused local.
1033
1034 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1035
1036         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
1037         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
1038         Problem reported by Denis Excoffier in
1039         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
1040
1041 2006-06-19  Simon Josefsson  <jas@extundo.com>
1042
1043         * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it.
1044
1045 2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
1046
1047         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
1048
1049 2006-06-17  Bruno Haible  <bruno@clisp.org>
1050
1051         * stdint_.h [FreeBSD >= 5]: Don't include <sys/inttypes.h>.
1052
1053 2006-06-17  Bruno Haible  <bruno@clisp.org>
1054
1055         * stdint_.h (_UINT8_T, _UINT32_T, _UINT64_T): New macros. Fixes a
1056         problem on Solaris 2.5.1.
1057
1058 2006-06-16  Eric Blake  <ebb9@byu.net>
1059
1060         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
1061         * unicodeio.c [!defined errno]: Likewise.
1062         * strtol.c [!defined errno]: Likewise.
1063         * strtod.c [!defined errno]: Likewise.
1064
1065 2006-06-15  Bruno Haible  <bruno@clisp.org>
1066
1067         * stdint_.h: Rewritten to be fully auto-configured.
1068         Fixes bug on HP-UX/IA64.
1069
1070 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
1071
1072         * getdate.y (__attribute__): Don't define if already defined.
1073         Problem reported by Larry Jones.
1074         * utimens.c (__attribute__): Likewise.
1075
1076 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1077
1078         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
1079         reported by Andreas Schwab.
1080
1081 2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1082             Bruno Haible  <bruno@clisp.org>
1083
1084         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
1085
1086 2006-05-26  Martin Lambers  <marlam@marlam.de>
1087
1088         * getpass.c: Updates the test for the native W32 API, and adds
1089         missing includes, thus fixing compilation warnings.
1090
1091 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
1092
1093         * tempname.c (small_open, large_open): New macros.
1094         (__open, __open64) [!_LIBC]: Remove.
1095         (__gen_tempname): Use small_open and large_open instead of __open
1096         and __open64.  This fixes a portability bug on HP-UX 11.11i
1097         reported by Simon Wing-Tang in
1098         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
1099
1100 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1101
1102         * exclude.c (exclude_fnmatch): New function.
1103         (excluded_file_name): Call exclude_fnmatch.
1104         * exclude.h (excluded_file_name): New prototype
1105
1106 2006-05-24  Bruno Haible  <bruno@clisp.org>
1107
1108         * printf-args.c (printf_fetchargs): Turn NULL pointers for
1109         TYPE_STRING and TYPE_WIDE_STRING into a non-NULL replacement.
1110         Reported by Thorsten Maerz <torte@netztorte.de> via
1111         Aaron Stone <aaron@serendipity.cx>.
1112
1113 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
1114
1115         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
1116         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
1117         (my_usleep): Don't mishandle maximum value.
1118
1119 2006-05-19  Jim Meyering  <jim@meyering.net>
1120
1121         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
1122
1123 2006-05-17  Bruno Haible  <bruno@clisp.org>
1124
1125         Cygwin portability.
1126         * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
1127
1128 2006-05-17  Bruno Haible  <bruno@clisp.org>
1129
1130         * stdint_.h: Fix recognition of Cygwin.
1131
1132 2006-05-11  Jim Meyering  <jim@meyering.net>
1133
1134         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
1135
1136 2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
1137
1138         * crc.c (crc32_update): Remove unnecessary L suffix.
1139         * md4.c (rol): Cast right-shift arg to uint32_t to prevent
1140         unwanted sign propagation, e.g., on hosts with 64-bit int.
1141         There still are some problems with reeelly weird theoretical hosts
1142         (e.g., 33-bit int) but it's not worth worrying about now.
1143         * sha1.c (rol): Likewise.
1144         (K1, K2, K3, K4): Remove unnecessary L suffix.
1145
1146 2006-05-10  Bruno Haible  <bruno@clisp.org>
1147
1148         * des.c: Cast to avoid warnings.
1149
1150 2006-05-10  Simon Josefsson  <jas@extundo.com>
1151
1152         * md4.c: Typo fix, update copyright years.
1153         (K1, K2): Don't use L because it turn computations into 64-bit on
1154         64-bit platforms.
1155
1156 2006-05-09  Bruno Haible  <bruno@clisp.org>
1157
1158         * xvasprintf.c: Include limits.h, string.h, xsize.h.
1159         (EOVERFLOW): Define fallback value.
1160         (xstrcat): New function.
1161         (xvasprintf): Recognize the special case of a string concatenation.
1162
1163 2006-05-01  Bruno Haible  <bruno@clisp.org>
1164
1165         * stdint_.h: Shorter URL.
1166         * inttypes.h: Likewise.
1167
1168 2006-05-02  Paul Eggert  <eggert@cs.ucla.edu>
1169
1170         * verify.h: Document the internals better.  Most of this change
1171         was written by Bruno Haible.
1172
1173 2006-04-29  Bruno Haible  <bruno@clisp.org>
1174
1175         * gcd.c: Use WORD_T and GCD instead of unsigned long and gcd.
1176         Suggested by Oskar Liljeblad <oskar@osk.mine.nu>.
1177
1178 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1179
1180         * getdate.y (get_date): When adding relative date, start with the
1181         initial time, not with the result of the first mktime call.
1182
1183 2006-04-23  Bruno Haible  <bruno@clisp.org>
1184
1185         * copy-file.c: Include <unistd.h> unconditionally.
1186         * execute.c: Likewise.
1187         * fatal-signal.c: Likewise.
1188         * findprog.c: Likewise.
1189         * mkdtemp.c: Likewise.
1190         * pipe.h: Likewise.
1191         * pipe.c: Likewise.
1192         * wait-process.h: Likewise.
1193
1194 2006-04-23  Bruno Haible  <bruno@clisp.org>
1195
1196         * fwriteerror.c (fwriteerror): Call fclose also when an error
1197         condition was already detected.
1198         Reported by Ben Pfaff <blp@cs.stanford.edu>.
1199
1200 2006-04-19  Derek Price  <derek@ximbiot.com>
1201             Eric Blake  <ebb9@byu.net>
1202
1203         * inttypes.h: Correct grammar in comment.
1204
1205 2006-04-18  Derek Price  <derek@ximbiot.com>
1206             Paul Eggert  <eggert@cs.ucla.edu>
1207
1208         * inttypes.h: New file.
1209         * strtoimax.c: Assume <inttypes.h>.
1210
1211 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
1212
1213         * utimens.c (futimens): glibc futimesat messes up if /proc
1214         isn't mounted.  Problem reported by Kir Kolyshkin.
1215
1216 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
1217
1218         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
1219         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
1220         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
1221
1222 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
1223
1224         Merge regex changes from libc, removing some of our
1225         POSIX-conformance changes that were rejected and redoing them in a
1226         less-intrusive way.
1227
1228         * regcomp.c (re_compile_internal, init_dfa):
1229         Length arg is now size_t, not Idx.  All uses changed.
1230         (peek_token): Forward decl now says internal_function.
1231         (__re_error_msgid, __re_error_msgid_idx):
1232         Now static rather than extern with attribute_hidden.
1233         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
1234         For some reason libc prefers K&R style defns for external functions.
1235         (regerror) [!defined _LIBC]: Likewise.
1236         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
1237         (seek_collating_symbol_entry, lookup_collation_sequence_value):
1238         (build_range_exp, build_collating_symbol):
1239         Use K&R-style defn.
1240         (re_compile_fastmap): Use '\0' to memset, not 0.
1241         (utf8_sb_map): Make the calculations more obvious.
1242         (init_dfa, parse_bracket_exp, build_charclass_op):
1243         Call calloc and cast result, as glibc does.
1244         (init_word_char, fetch_token, peek_token, peek_token_bracket):
1245         (build_range_exp, build_collating_symbol):
1246         Now internal functions.
1247
1248         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
1249
1250         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
1251         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
1252         Don't depend on VMS; depend on __VMS instead, for POSIX
1253         namespace cleanness.
1254         (regoff_t): Define to ssize_t, not long int.
1255
1256         Remove the REG_ macros named below.  Instead, make the old names
1257         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
1258         __USE_GNU_REGEX.
1259         (REG_BACKSLASH_ESCAPE_IN_LISTS):
1260         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
1261         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
1262         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
1263         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
1264         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
1265         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
1266         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
1267         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
1268         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
1269         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
1270         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
1271         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
1272         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
1273         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
1274         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
1275         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
1276         (REG_NREGS):
1277         Remove.  All uses replaced by the old RE_* names.
1278         (RE_BACKSLASH_ESCAPE_IN_LISTS):
1279         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
1280         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
1281         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
1282         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
1283         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
1284         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
1285         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
1286         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
1287         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
1288         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
1289         Don't bother having these macros be independent of each others'
1290         values, since they no longer exist in the POSIX name space.
1291
1292         Rename the following member names back to their old names,
1293         unless !__USE_GNU_REGEX.  All uses changed back.
1294         (buffer): Renamed from re_buffer.
1295         (allocated): Renamed from re_allocated.
1296         (used): Renamed from re_used.
1297         (syntax): Renamed from re_syntax.
1298         (fastmap): Renamed from re_fastmap.
1299         (translate): Renamed from re_translate.
1300         (can_be_null): Renamed from re_can_be_null.
1301         (regs_allocated): Renamed from re_regs_allocated.
1302         (fastmap_accurate): Renamed from re_fastmap_accurate.
1303         (no_sub): Renamed from re_no_sub.
1304         (not_bol): Renamed from re_not_bol.
1305         (not_eol): Renamed from re_not_eol.
1306         (newline_anchor): Renamed from re_newline_anchor.
1307         (num_regs): Renamed from rm_num_regs.
1308         (start): Renamed from rm_start.
1309         (end): Renamed from rm_end.
1310
1311         (free_state): Move up a bit.
1312
1313         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
1314         #define to be empty.
1315         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
1316         when that is what is intended.
1317         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
1318         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
1319         (MAX): New macro.
1320         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
1321         All uses changed back to re_malloc, etc.  It's now the caller's
1322         responsibility to check for overflow; all callers changed.
1323         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
1324         (re_x2nrealloc): Remove.
1325         (free_state): Remove decl.
1326
1327         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
1328         (re_set_registers, re_exec):
1329         Use K&R-style defn.
1330
1331         2006-01-31  Roland McGrath  <roland@redhat.com>
1332
1333         * regcomp.c (calc_eclosure_iter): Remove dead variables.
1334         Reported by Mike Frysinger <vapier@gentoo.org>.
1335
1336         2006-01-15  Andreas Jaeger  <aj@suse.de>
1337
1338         [BZ #1950]
1339         * regex_internal.c (re_string_reconstruct): Adjust for
1340         build_wcs_upper_buffer change.
1341         (build_wcs_upper_buffer): Change return type.
1342
1343         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
1344
1345         * regex_internal.h: Include <stdint.h> if available.
1346
1347         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
1348
1349         * regex_internal.h (SIZE_MAX): Provide a default definition.
1350
1351         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
1352
1353         * regcomp.c: Adjust for changed secondary hash function.
1354
1355         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
1356
1357         * regex.h: Pretty printing.
1358         Clean up namespace a bit.
1359
1360         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
1361
1362         * regexec.c (update_cur_sifted_state, check_arrival,
1363         check_arrival_add_next_nodes): Avoid using uninitialized variable.
1364
1365         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1366                     Ulrich Drepper  <drepper@redhat.com>
1367
1368         [BZ #1302]
1369         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
1370         (bitset_word_t): Renamed from bitset_word.  All uses changed.
1371
1372         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
1373
1374         [BZ #281]
1375         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
1376         * regcomp.c: Remove unnecessary uses of
1377         unsigned RE_TRANSLATE_TYPE.
1378         * regex_internal.h: Likewise.
1379         * regex_internal.c: Likewise.
1380         * regexec.c: Likewise.
1381         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
1382
1383         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
1384
1385         * regexec.c (find_recover_state): Remove unnecessary
1386         initialization.
1387         (transit_state_bkref): Make DFA a const pointer.
1388         (get_subexp): Likewise.
1389         (check_arrival): Likewise.
1390         (update_cur_sifted_state): Likewise.
1391         (re_search_internal): Likewise.
1392         (prune_impossible_nodes): Likewise.
1393         (acquire_init_state_context): Likewise.
1394         (proceed_next_node): Likewise.
1395         (set_regs): Likewise.
1396         (free_fail_stack_return): Likewise.
1397         (check_arrival_expand_ecl): Mark DFA parameter as const.
1398         (check_arrival_expand_ecl_sub): Likewise.
1399         (check_subexp_limits): Likewise.
1400         (sub_epsilon_src_nodes):  Likewise.
1401         (add_epsilon_src_nodes):  Likewise.
1402         (merge_state_array): Likewise.
1403         (update_regs): Likewise.
1404         (build_trtable): Likewise.
1405         (sift_states_backward): Mark MCTX parameter as const.
1406         (build_sifted_states): Likewise.
1407         (update_cur_sifted_state): Likewise.
1408         (sift_states_mkref): Likewise.
1409         (check_arrival_expand_ecl): Mark eclosure as const.
1410         (check_dst_limits_calc_pos_1): Likewise.
1411         * regex_internal.h (re_match_context_t): Make dfa a const
1412         pointer.
1413
1414         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1415
1416         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1417         (transit_state_sb): Likewise.
1418         (transit_state_mb): Likewise.
1419         (sift_states_iter_mb): Likewise.
1420         (check_arrival_add_next_nodes): Likewise.
1421         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1422         [_LIBC] (re_search_2_stub): Use mempcpy.
1423
1424         * regex_internal.c (re_string_reconstruct): Avoid calling
1425         mbrtowc for very simple UTF-8 case.
1426
1427         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1428         a pointer-to-const.
1429         (re_acquire_state_context): Likewise.
1430         * regex_internal.h: Adjust prototypes.
1431
1432         * regex.c: Prevent using C++ compilers.
1433
1434         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1435         (re_acquire_state_context): Likewise.
1436
1437 2006-03-29  Mark D. Baushke  <mdb@gnu.org>
1438             Bruno Haible  <bruno@clisp.org>
1439
1440         * stdint_.h: On OpenBSD, don't redefine types already included in
1441         <sys/types.h> and <inttypes.h>.
1442
1443 2006-03-24  Eric Blake  <ebb9@byu.net>
1444
1445         * time_r.c (copy_string_result): Remove, as it is no longer used.
1446
1447 2006-03-24  Simon Josefsson  <jas@extundo.com>
1448
1449         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
1450         including some doc fixes.
1451         (base64_encode_alloc): Fix +1 bug on allocation failures.
1452
1453 2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1454
1455         * base64.c (base64_encode): Do not read past end of array with
1456         unsanitized input on systems with CHAR_BIT > 8.
1457
1458 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1459
1460         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1461         Typedef to long int, not to off_, as POSIX will likely change
1462         in that direction.
1463
1464 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1465
1466         * argp-help.c (validate_uparams): Fix typo
1467         * argp-parse.c (argp_default_options): Consistently begin help
1468         messages with a lowercase letter.
1469
1470 2006-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1471
1472         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1473         overrun buffers and shouldn't be used (much as gets shouldn't be
1474         used).
1475         * time_r.c (asctime_r, ctime_r): Likewise.
1476
1477 2006-03-08  Simon Josefsson  <jas@extundo.com>
1478
1479         * gc-gnulib.c (randomize): Don't open files called 'no', they
1480         signal that configure disabled the device.
1481
1482 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
1483
1484         * c-stack.c: Include unistd.h unconditionally, since we now assume
1485         the unistd module.
1486         * getlogin_r.c: Likewise.
1487         * getlogin_r.h: Likewise.
1488         * glob.c: Likewise.
1489         * pagealign_alloc.c: Likewise.
1490         * unistd_.h: Remove; no longer needed.
1491
1492 2006-03-07  Simon Josefsson  <jas@extundo.com>
1493
1494         * unistd_.h: New file.
1495
1496 2006-03-07  Simon Josefsson  <jas@extundo.com>
1497
1498         * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
1499
1500 2006-03-01  Simon Josefsson  <jas@extundo.com>
1501
1502         * readline.c: Fix typo, tiny patch from Stepan Kasal
1503         <kasal@ucw.cz>.
1504
1505 2006-02-28  Simon Josefsson  <jas@extundo.com>
1506
1507         * getopt.c: Protect #include of unistd.h, for MSVS.
1508
1509 2006-02-27  Simon Josefsson  <jas@extundo.com>
1510
1511         * base64.h: Indent #define's.  From Jim Meyering
1512         <jim@meyering.net>.
1513
1514 2006-02-27  Jim Meyering  <jim@meyering.net>
1515
1516         Revert the change of 2006-02-24, so these files can continue
1517         to be sync'd from gettext.
1518         * mkdtemp.c, setenv.c, unsetenv.c: *Un*-normalize inclusion
1519         of `config.h'.
1520
1521 2006-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1522
1523         * glob.c: Say "invalid" rather than "illegal" in comments.
1524
1525 2006-02-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1526
1527         * mkdtemp.c, setenv.c, unsetenv.c: Normalize inclusion of `config.h'.
1528
1529 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1530
1531         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1532         AT_FDCWD exceeds INT_MAX.
1533         * openat.h (AT_FDCWD): Likewise.
1534
1535 2006-02-14  Jim Meyering  <jim@meyering.net>
1536
1537         Sync from coreutils.
1538
1539         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1540         failure on deficient systems, and simplify gnulib lgpl dependencies.
1541         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1542         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1543
1544         * xalloc-die.c: Remove unused definition of N_.
1545
1546 2006-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1547
1548         * argp-fmtstream.c: Restore another bugfix lost on 2005-12-12
1549
1550 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1551
1552         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1553         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1554
1555 2006-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1556
1557         * argp-namefrob.h: Restore changes accidentally lost during the
1558         "autoupdate" on 2005-12-12.
1559
1560 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1561
1562         * fnmatch.c (L_): Renamed from L, to work around a bug in
1563         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1564         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1565         All uses changed.
1566
1567 2006-01-26  Simon Josefsson  <jas@extundo.com>
1568
1569         * socket_.h: Set WINVER to 0x0501, to make sure getaddrinfo
1570         prototype is visible on mingw32.
1571
1572         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1573         for mingw32.
1574
1575         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1576         mingw32).
1577
1578 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1579
1580         * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
1581         attempt to open for write; this always fails, at least on POSIX
1582         hosts.  This reinstates the 2006-01-09 change, which was
1583         inadvertently removed.
1584
1585 2006-01-26  Bruno Haible  <bruno@clisp.org>
1586             Paul Eggert  <eggert@cs.ucla.edu>
1587
1588         * stdbool_.h (_Bool)
1589         [(! (defined __cplusplus || defined __BEOS__)
1590           && !defined __GNUC__
1591           && !(defined __HP_cc || defined __xlc__
1592                || (defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1))
1593                || defined __sgi))]:
1594         #define to signed char in these cases too; this simplifies
1595         the code (so that we don't have to worry about HP-UX, AIX, SunPRO,
1596         etc., separately) and makes it more conservative.
1597
1598 2006-01-21  Jim Meyering  <jim@meyering.net>
1599
1600         Sync from the stable (b5) branch of coreutils:
1601
1602         * fts.c (fts_children): Don't let close() clobber errno from
1603         failed fchdir().
1604
1605         * fts.c (fts_stat): When following a symlink-to-directory,
1606         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1607         a dangling symlink.  That can also happen at least for ELOOP.
1608         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1609         FYI, this bug predates the inclusion of fts.c in coreutils.
1610
1611         * fts.c (fts_open): Put new maxarglen declaration and uses
1612         in their own block, so pre-c99 compilers don't object.
1613
1614         Avoid the double-free (first in fts_read, second in fts_close) that
1615         would occur when an `active' directory is made inaccessible (e.g.,
1616         via chmod a-x) during a traversal.
1617         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1618         before returning.  Reproduce this failure by
1619         mkdir -p a/b; cd a; chmod a-x . b
1620         Reported by Stavros Passas.
1621
1622 2006-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1623
1624         * argp-namefrob.h: Bugfix. Remove stray #
1625
1626 2006-01-25  Bruno Haible  <bruno@clisp.org>
1627
1628         * stdbool_.h (_Bool) [IRIX cc]: Define as 'signed char', to avoid
1629         warnings.
1630         Reported by Paul Eggert.
1631
1632 2006-01-25  Jim Meyering  <jim@meyering.net>
1633
1634         * fileblocks.c: Remove more useless parentheses.
1635         * readutmp.h: Likewise.
1636
1637 2006-01-24  Bruno Haible  <bruno@clisp.org>
1638
1639         * stdbool_.h (_Bool) [__cplusplus]: Don't define if the compiler already
1640         has it.
1641         Report and patch by Albert Chin-A-Young  <china@thewrittenword.com> on
1642         2005-11-26.
1643
1644         * stdbool_.h (_Bool) [HP-UX cc, AIX cc,xlc]: Define as 'signed char'
1645         to avoid problems with the built-in _Bool type.
1646         Reported by Paul Eggert on 2005-11-26.
1647
1648 2006-01-24  Jim Meyering  <jim@meyering.net>
1649
1650         * socket_.h: Remove useless parentheses in uses of cpp `defined'.
1651
1652 2006-01-24  Simon Josefsson  <jas@extundo.com>
1653
1654         * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by
1655         Bruno.
1656
1657 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1658
1659         Work around porting bugs reported by Dieter in
1660         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1661         * getopt.c (_NOPROTO): Remove; no longer needed.
1662         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1663         Include "getopt.h" first, to check interface.
1664         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1665         !HAVE_DECL_GETENV.
1666         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1667         (__strndup): Revert to K&R-style function dfns, the glibc style.
1668         * strnlen.c: Don't claim it's taken from glibc; it's not.
1669         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1670         Include strnlen.h first, to get prototype properly.
1671         (strnlen): Renamed from __strnlen.
1672         Remove weak alias.
1673
1674 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1675
1676         These changes imported from libc.
1677         * getopt.c: Use __fxprintf instead of inline stream orientation
1678         test and two separate function calls.
1679         * strndup.c (__strndup): Add libc_hidden_def.
1680
1681 2006-01-22  Bruno Haible  <bruno@clisp.org>
1682
1683         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1684         temporary buffer for sprintf, take into account the precision also
1685         for 'd', 'i', 'u', 'o', 'x', 'X'.
1686
1687 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1688
1689         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1690         to pacify gcc -Wswitch-default.
1691
1692 2006-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1693
1694         * argp-help.c (usage_long_opt): Do not print DOC options.
1695         (__argp_base_name): Removed
1696         * argp-namefrob.h (__argp_basename): Removed definition. Was a
1697         typo.
1698         (__argp_base_name): Provide macro definition or extern declaration
1699         depending on the configuration
1700
1701 2006-01-20  Simon Josefsson  <jas@extundo.com>
1702
1703         * inet_ntop.h: Unconditionally include sys/socket.h.
1704
1705 2006-01-19  Simon Josefsson  <jas@extundo.com>
1706
1707         * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
1708
1709 2006-01-12  Simon Josefsson  <jas@extundo.com>
1710
1711         * base64.c: Fix warning, reported by Bruno Haible
1712         <bruno@clisp.org> and patch by Paul Eggert <eggert@CS.UCLA.EDU>.
1713
1714 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1715
1716         Sync from coreutils.
1717         * md5.c: Fix commentary typos.
1718         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1719         * md5.h (__attribute__): Remove; unused.
1720         * sha1.c: Fix commentary to match md5 better.
1721         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1722         so that we don't need to worry about alignment.  All uses changed.
1723         This merges the 2005-10-28 md5 change into sha1.
1724
1725 2006-01-11  Jim Meyering  <jim@meyering.net>
1726
1727         Sync from coreutils.
1728         * md5.c (OP): Fix spacing.
1729
1730 2006-01-11  Simon Josefsson  <jas@extundo.com>
1731
1732         * stdint_.h (SIZE_MAX): Add missing (.
1733
1734 2006-01-10  Bruno Haible  <bruno@clisp.org>
1735
1736         * argp.h (__const): Remove macro. Use const instead.
1737         * argp-fmtstream.h (__const): Likewise.
1738         * glob_.h (__const): Remove macro.
1739         * glob-libc.h: Use const instead of __const.
1740
1741 2006-01-10  Jim Meyering  <jim@meyering.net>
1742
1743         Avoid the double-free (first in fts_read, second in fts_close) that
1744         would occur when an `active' directory is made inaccessible (e.g.,
1745         via chmod a-x) during a traversal.
1746         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1747         before returning.  Reproduce this failure by
1748         mkdir -p a/b; cd a; chmod a-x . b
1749         Reported by Stavros Passas.
1750
1751         Sync from coreutils.
1752         * sha1.c: Tweak grammar in a comment.
1753
1754 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1755
1756         * regex_internal.h (BITSET_WORD_BITS):
1757         Work around a bug in 64-bit PGC (before version 6.1-2), where the
1758         preprocessor mishandles large unsigned values as if they were signed.
1759         Problem reported by Claudio Fontana in
1760         <http://lists.gnu.org/archive/html/bug-gnulib/2005-12/msg00061.html>.
1761
1762 2006-01-10  Simon Josefsson  <jas@extundo.com>
1763
1764         * socket_.h: New file.
1765
1766 2006-01-10  Bruno Haible  <bruno@clisp.org>
1767
1768         * localcharset.c: Update from GNU gettext.
1769
1770 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
1771
1772         Sync from coreutils.
1773         * chdir-long.c (cdb_free): Don't bother trying to open directory
1774         for write access: POSIX says that must fail.
1775         * fts.c (diropen): Likewise.
1776         * save-cwd.c (save_cwd): Likewise.
1777         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1778         well, for minor improvements on hosts that lack O_DIRECTORY.
1779         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1780         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1781         Fall back on chown if open failed with EACCES.
1782
1783         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1784         Report an error at compile-time if only a 1-second nominal clock
1785         resolution is found.
1786
1787         * lchmod.h: New file.
1788         * mkdir-p.c: Include lchmod.h, lchown.h.
1789         (make_dir_parents): Use lchown rather than chown, and
1790         lchmod rather than chmod.
1791
1792         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1793         too.  Problem with "none" reported by Bob Proulx.  Problem with
1794         "proc" reported by n0dalus.
1795
1796         * mountlist.c: Include <limits.h>.
1797         (dev_from_mount_options)
1798         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1799         New function.  It no longer assumes "dev=" has the System V meaning
1800         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1801         (read_file_system_list)
1802         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1803         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1804         dev= in that case.
1805
1806         * posixtm.h (PDS_PRE_2000): New macro.
1807         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1808         All usages changed.  Reject dates outside the range 1969-1999 if
1809         PDS_PRE_2000 is used.
1810
1811 2006-01-09  Jim Meyering  <jim@meyering.net>
1812
1813         Sync from coreutils.
1814
1815         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1816
1817         * chdir-safer.h, chdir-safer.c: New files.
1818
1819         * modechange.c (mode_compile): Reject an invalid mode string
1820         that starts with an octal digit.  From Andreas Gruenbacher.
1821
1822         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1823         and dup to open_safer and dup_safer, respectively.
1824         (openat_permissive): Fix typo in comment.
1825
1826         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1827         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1828         (_): Remove; no longer needed.
1829         (openat): Renamed from rpl_openat; no need for rpl_openat
1830         since openat.h renames openat for us.
1831         Replace most of the body with a call to openat_permissive,
1832         to avoid duplicate code.
1833         Port to (probably hypothetical) environments were mode_t is
1834         wider than int.
1835         (openat_permissive): Require mode arg, so that we can check
1836         types better.  Put it just after flags.  Change cwd failure
1837         indicator from pointer-to-bool to pointer-to-errno-value.
1838         All callers changed.
1839         Invoke openat_save_fail and/or openat_restore_fail if
1840         cwd_errno is null, so that openat can call us.
1841         (openat_permissive, fdopendir, fstatat, unlinkat):
1842         Simplify errno handling to avoid some duplicate code,
1843         as it's OK to set errno on success.
1844         * openat.h: Revamp code so that function macros depend on
1845         __OPENAT_PREFIX only, not also on AT_FDCWD.
1846         (openat_ro): Remove.  Caller changed to use openat_permissive.
1847         (openat_permissive): Now a macro, if not a function.
1848         (openat_restore_fail, openat_save_fail): Now always functions,
1849         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1850
1851         * openat-priv.h: New file, defining macros used by mkdirat.c
1852         and openat.c.
1853         * mkdirat.c: Include openat-priv.h.
1854         Remove definitions of macros defined therein.
1855         * openat.c: Likewise.
1856
1857         * mkdirat.c (mkdirat): New file and function.
1858         * openat.h (mkdirat): Declare.
1859
1860         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1861
1862         * openat.h (openat_permissive): Declare.
1863         (openat_ro): Define.
1864
1865         * openat.c (EXPECTED_ERRNO): New macro.
1866         (openat_permissive): New function -- used in remove.c rewrite.
1867         (all functions): Set errno just before returning, only if there
1868         was an actual failure.
1869         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1870
1871         Emulate openat-family functions using Linux's procfs, if possible.
1872         Idea and some code based on Ulrich Drepper's glibc changes.
1873
1874         * openat.c: (BUILD_PROC_NAME): New macro.
1875         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1876         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1877         before falling back on save_cwd and restore_cwd.
1878         (fdopendir, fstatat, unlinkat): Likewise.
1879
1880         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1881         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1882
1883         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1884         as second argument to va_arg.  Otherwise, some versions of gcc
1885         warn that `if this code is reached, the program will abort'.
1886
1887 2006-01-09  Andreas Gruenbacher  <agruen@suse.de>
1888
1889         Sync from coreutils.
1890
1891         Add POSIX ACL support
1892         * acl.h (copy_acl, set_acl): Add declarations.
1893         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1894         systems other than Linux.
1895         (chmod_or_fchmod): New function: use fchmod when possible,
1896         and chmod otherwise.
1897         (file_has_acl): Add a POSIX ACL implementation, with a
1898         Linux-specific subcase.
1899         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1900         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1901         acls are unsupported.
1902         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1903         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1904         are unsupported.
1905
1906 2006-01-09  Bruno Haible  <bruno@clisp.org>
1907
1908         * sysexit_.h (EX_OK): New macro.
1909         Suggested by Martin Lambers <marlam@marlam.de>.
1910
1911 2006-01-09  Bruno Haible  <bruno@clisp.org>
1912
1913         * javacomp.sh.in: Move to ../build-aux/javacomp.sh.in.
1914         * javaexec.sh.in: Move to ../build-aux/javaexec.sh.in.
1915         * csharpcomp.sh.in: Move to ../build-aux/csharpcomp.sh.in.
1916         * csharpexec.sh.in: Move to ../build-aux/csharpexec.sh.in.
1917
1918 2006-01-09  Bruno Haible  <bruno@clisp.org>
1919
1920         * stdint_.h (SIZE_MAX): Write the value without involving negative
1921         numbers.
1922
1923 2005-10-16  Bruno Haible  <bruno@clisp.org>
1924
1925         * stdint_.h: On Linux libc4 and libc5, include <sys/bitypes.h> and
1926         don't define _STDINT_H_NEED_SIGNED_INT_TYPES.
1927
1928 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1929
1930         * strftime.c (tzname): Don't declare if it is already #defined.
1931         Problem reported for Mingw by Mark Junker.
1932
1933 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1934
1935         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1936         long int, not int, for nanosecond counts, so that people who are
1937         used to POSIX struct timespec won't be surprised.  Reported by Jim
1938         Meyering.
1939
1940 2005-12-16  Jim Meyering  <jim@meyering.net>
1941
1942         * fprintftime.c, fprintftime.h: New files.
1943
1944 2005-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1945
1946         * argp-fmtstream.c (__argp_fmtstream_update): Fix coredump
1947         * argp-help.c (fill_in_uparams): Check if the constructed
1948         struct uparams is valid. Fall back to the default values if it is
1949         not.
1950
1951 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1952
1953         * argp-help.c (__argp_base_name): New function
1954         (__argp_short_program_name): Rewrite using __argp_base_name
1955         * argp-namefrob.h: Define program_invocation_name and
1956         program_invocation_short_name if requested
1957         (__argp_base_name): Add prototype
1958         * argp-parse.c (argp_def): Use gettext wrappers
1959         (argp_default_parser): Use __argp_base_name
1960         * argp-pin.c: New file. Defines program_invocation_name and
1961         program_invocation_short_name on systems that lack them.
1962
1963 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1964
1965         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1966         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1967         porting problem reported by Georg Schwarz in
1968         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1969
1970 2005-07-09  Bruno Haible  <bruno@clisp.org>
1971
1972         * csharpcomp.sh.in (options_csc): For -l option, add a .dll suffix.
1973         * csharpcomp.c (compile_csharp_using_sscli): Likewise.
1974         Reported by Mark Junker <mjscod@gmx.de>.
1975
1976 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
1977
1978         * stdint_.h (intmax_t) [defined intmax_t]: Do not declare.
1979         (uintmax_t) [defined uintmax_t]: Do not declare.
1980         (SIZE_MAX) [defined SIZE_MAX]: Do not define.
1981         This works around a problem if intmax_t.m4 and/or uintmax_t.m4
1982         and/or size_max.m4 are also used.  Problem reported by Mark D. Baushke.
1983         (SIZE_MAX): Define to ((size_t) -1), not (~(size_t)0), for the
1984         sake of portability to weird hosts that C allows (though we don't
1985         know of any practical examples).
1986
1987         * savedir.h (fdsavedir): New decl.
1988         * savedir.c (fdsavedir, savedirstream): New functions; the latter
1989         contains most of the former guts of savedir.
1990         (savedir): Use savedirstream.
1991         Include "openat.h".
1992
1993 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1994
1995         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1996         coreutils no longer futzes with rounding modes.
1997
1998 2005-11-14  Jim Meyering  <jim@meyering.net>
1999
2000         * mkstemp-safer.c: Include <config.h>, required for possible
2001         replacement of mkstemp.
2002
2003 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
2004
2005         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
2006         business.
2007         (gethrxtime) [! (HAVE_NANOUPTIME
2008         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
2009         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
2010         our own approximation.
2011
2012 2005-11-10  Simon Josefsson  <jas@extundo.com>
2013
2014         * readline.c: Remove EOL.
2015
2016 2005-11-08  Eric Blake  <ebb9@byu.net>
2017
2018         * inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2019
2020 2005-11-08  Eric Blake  <ebb9@byu.net>
2021
2022         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
2023
2024 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
2025
2026         Fix porting problem reported by Theodoros V. Kalamatianos.
2027         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
2028         Don't assume that futimes failing means we must fail.
2029
2030 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
2031
2032         * getcwd.c (__getcwd): Don't assume that system calls after readdir
2033         leave errno alone.  Problem reported by Dmitry V. Levin.
2034
2035 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2036
2037         * savedir.c (savedir): Don't assume that xrealloc etc. leave
2038         errno alone.  Problem reported by Frederic Jolliton.
2039
2040 2005-10-28  Simon Josefsson  <jas@extundo.com>
2041
2042         * inet_ntop.h, inet_ntop.c: Make it work under mingw32: Add
2043         "restrict" keywords, as per POSIX.  Protect the function
2044         declaration around HAVE_DECL_INET_NTOP rather than HAVE_INET_NTOP.
2045         Don't use K&R prototypes.  Check the sprintf return values.
2046         Re-define EAFNOSUPPORT if not present.  Indent.
2047
2048         * md5.h, md5.c: Simplify buffer handling visavi alignment,
2049         suggested by Bruno Haible <bruno@clisp.org>.
2050
2051         * gc-gnulib.c, gc-libgcrypt.c: Check calloc return value.
2052
2053         * gc.h: Add MD2 and RMD160 length defines.  Add prototypes.
2054
2055         * gc-libgcrypt.c: Add MD2 (which is not available through
2056         libgcrypt).
2057
2058         * gc-gnulib.c: Add MD2.  Implement gc_hash_* API.
2059
2060         * md2.h, md2.c: New files.
2061
2062 2005-10-24  Simon Josefsson  <jas@extundo.com>
2063
2064         * md4.h: Shrink buffer size, now that we changed the type.
2065
2066 2005-10-22  Simon Josefsson  <jas@extundo.com>
2067
2068         * arcfour.h, arcfour.c: Use fixed size indices in the
2069         arcfour_context struct (simplify test vector testing in GNU
2070         Shishi).
2071
2072 2005-10-22  Simon Josefsson  <jas@extundo.com>
2073
2074         * md4.h, md4.c: Simplify buffer handling visavi alignment,
2075         suggested by Bruno Haible <bruno@clisp.org>.
2076
2077 2005-10-22  Simon Josefsson  <jas@extundo.com>
2078
2079         * crc.h: Include stddef.h, for size_t.
2080
2081 2005-10-21  Simon Josefsson  <jas@extundo.com>
2082
2083         * arctwo.h (arctwo_setkey): Protect variable in CPP macro,
2084         suggested by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
2085
2086 2005-10-21  Simon Josefsson  <jas@extundo.com>
2087
2088         * rijndael-api-fst.c: Fix bugs in CBC mode for more than one
2089         block.
2090
2091 2005-10-21  Simon Josefsson  <jas@extundo.com>
2092
2093         * gc-gnulib.c: Support ARCTWO in CBC mode.
2094
2095 2005-10-21  Simon Josefsson  <jas@extundo.com>
2096
2097         * hmac-md5.c (hmac_md5): Add comments, suggested by Bruno Haible
2098         <bruno@clisp.org>.
2099
2100         * hmac-sha1.c (hmac_sha1): Likewise.
2101
2102         * crc.c (crc32_update): Actually use crc parameter, suggested by
2103         Bruno Haible <bruno@clisp.org>.
2104
2105         * crc.h: Include stdint.h directly, suggested by Bruno Haible
2106         <bruno@clisp.org>.
2107
2108 2005-10-21  Simon Josefsson  <jas@extundo.com>
2109
2110         * des.h, des.c: New files.
2111
2112         * gc-gnulib.c: Support DES.c
2113
2114 2005-10-21  Simon Josefsson  <jas@extundo.com>
2115
2116         * arctwo.h, arctwo.c: New files.
2117
2118         * gc-gnulib.c: Support ARCTWO.
2119
2120 2005-10-21  Simon Josefsson  <jas@extundo.com>
2121
2122         * gc-libgcrypt.c (gc_cipher_open): Handle ECB.
2123
2124 2005-10-19  Simon Josefsson  <jas@extundo.com>
2125
2126         * gc-gnulib.c: Support ARCFOUR.
2127
2128 2005-10-19  Simon Josefsson  <jas@extundo.com>
2129
2130         * gc-gnulib.c: Implement gc_cipher_* API, currently only with AES
2131         support.
2132
2133         * gc.h: Add ECB enum type.
2134
2135         * hmac-md5.c, hmac-sha1.c: Include memxor.h.
2136
2137 2005-10-19  Simon Josefsson  <jas@extundo.com>
2138
2139         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support MD4.
2140
2141 2005-10-18  Simon Josefsson  <jas@extundo.com>
2142
2143         * md4.h, md4.c: New files, based on md5.?.
2144
2145 2005-10-17  Simon Josefsson  <jas@extundo.com>
2146
2147         * gc-libgcrypt.c (gc_hmac_sha1): Fix assert.
2148
2149         * gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
2150
2151 2005-10-17  Simon Josefsson  <jas@extundo.com>
2152
2153         * gc.h, gc-libgcrypt.c: Add more hash types/functions.
2154
2155 2005-10-17  Simon Josefsson  <jas@extundo.com>
2156
2157         * gc.h, gc-libgcrypt.c: Add ciphers.
2158
2159 2005-10-17  Simon Josefsson  <jas@extundo.com>
2160
2161         * sha1.c: Use uint32_t instead of md5_uint32.t
2162
2163         * sha1.h: Use stdint.h and uint32_t instead of md5_uint32 from
2164         md5.h.
2165
2166         * md5.c: Use uin32_t.  Fix non-gcc UNALIGNED_P macro.
2167
2168         * md5.h: Use stdint.h and uint32_t.  Doc fix.
2169
2170 2005-10-15  Simon Josefsson  <jas@extundo.com>
2171
2172         * rijndael-api-fst.h, rijndael-api-fst.c: New files.
2173
2174         * rijndael-alg-fst.h, rijndael-alg-fst.c: New files.
2175
2176 2005-10-14  Simon Josefsson  <jas@extundo.com>
2177
2178         * arcfour.h, arcfour.c: New files.
2179
2180 2005-10-14  Paul Eggert  <eggert@cs.ucla.edu>
2181
2182         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
2183         include <wchar.h>; no longer needed.
2184
2185 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
2186         and  Ulrich Drepper  <drepper@redhat.com>
2187
2188         Import from libc.
2189         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
2190         instead of inline stream orientation test and two separate
2191         function calls.  Pay no attention to USE_IN_LIBIO.
2192
2193 2005-10-14  Roland McGrath  <roland@redhat.com>
2194
2195         Import from libc.  [BZ #1331]
2196         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
2197         macro argument.
2198         Reported by Matej Vela <vela@debian.org>.
2199
2200 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2201
2202         * mkdir-p.c (make_dir_parents): Don't report an error if an
2203         intermediate directory is in a read-only file system.  Problem
2204         reported by Eric Blake.
2205
2206 2005-10-13  Simon Josefsson  <jas@extundo.com>
2207
2208         * gc-pbkdf2-sha1.c (gc_pbkdf2_sha1): Optimize CEIL computation.
2209         Move memory allocation outside of loop.
2210
2211 2005-10-12  Simon Josefsson  <jas@extundo.com>
2212
2213         * gc-pbkdf2-sha1.c: New file.
2214
2215         * gc.h: Add gc_pbkdf2_sha1 prototype.
2216
2217 2005-10-12  Simon Josefsson  <jas@extundo.com>
2218
2219         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Use Gc_rc for return types,
2220         suggested by Bruno Haible <bruno@clisp.org>.
2221
2222 2005-10-12  Simon Josefsson  <jas@extundo.com>
2223
2224         * gc-libgcrypt.c (gc_hmac_sha1): New function.
2225
2226         * gc-gnulib.c (gc_hmac_sha1): New function.
2227
2228 2005-10-12  Simon Josefsson  <jas@extundo.com>
2229
2230         * gc.h, gc-gnulib.c, gc-libgcrypt.c: Support SHA-1.
2231
2232 2005-10-12  Simon Josefsson  <jas@extundo.com>
2233
2234         * gc-gnulib.c: Condition MD5 and HMAC-MD5 use on GC_USE_MD5 and
2235         GC_USE_HMAC_MD5, respectively.
2236
2237         * gc-libgcrypt.c (gc_md5): Fix assert call.
2238         (gc_md5): Fix typo.
2239
2240         * gc.h (gc_hash_buffer): Use gc_hash in prototype.
2241
2242         * gc-libgcrypt.c (gc_hash_buffer): Ditto.
2243
2244         * gc-gnulib.c (gc_hash_buffer): Ditto.
2245
2246 2005-10-11  Bruno Haible  <bruno@clisp.org>
2247
2248         * c-strcasestr.h: New file, from GNU gettext.
2249         * c-strcasestr.c: New file, from GNU gettext.
2250
2251 2005-10-11  Bruno Haible  <bruno@clisp.org>
2252
2253         * c-strcase.h: New file, from GNU gettext.
2254         * c-strcasecmp.c: New file, from GNU gettext.
2255         * c-strncasecmp.c: New file, from GNU gettext.
2256
2257 2005-10-11  Simon Josefsson  <jas@extundo.com>
2258
2259         * crc.h, crc.c: New files.
2260
2261         * gc.h (gc_hash_buffer): Add doc.
2262
2263 2005-10-08  Simon Josefsson  <jas@extundo.com>
2264
2265         * gc.h: Add gc_hash and gc_hash_buffer.
2266
2267         * gc-gnulib.c (gc_hash_buffer): Add.  Reorder #include's.
2268
2269         * gc-libgcrypt.c (gc_hash_buffer): Add.
2270
2271 2005-10-11  Bruno Haible  <bruno@clisp.org>
2272
2273         * strcasecmp.c: Include limits.h.
2274         (strcasecmp): Avoid integer overflow on exotic platforms.
2275         * strncasecmp.c: Include limits.h.
2276         (strncasecmp): Avoid integer overflow on exotic platforms.
2277         Reported by Paul Eggert.
2278
2279 2005-10-06  Simon Josefsson  <jas@extundo.com>
2280
2281         * hmac-md5.c: New file.
2282
2283         * hmac.h: New file.
2284
2285 2005-10-06  Simon Josefsson  <jas@extundo.com>
2286
2287         * memxor.c (memxor): Avoid casts and warnings.
2288
2289 2005-10-05  Derek Price  <derek@ximbiot.com>
2290
2291         * getdelim.c (SIZE_MAX): New macro, if not already defined.
2292
2293 2005-10-05  Simon Josefsson  <jas@extundo.com>
2294
2295         * memxor.c (memxor): Fix compiler error.
2296
2297         * md5.h (MD5_DIGEST_SIZE, MD5_BLOCK_SIZE): Add, see also
2298         <http://sourceware.org/bugzilla/show_bug.cgi?id=1423>.
2299
2300         * memxor.h, memxor.c: New files.
2301
2302         * getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
2303         we assume all systems have it, suggested by Jim Meyering
2304         <jim@meyering.net>.  Remove HAVE_SYS_SOCKET_H test too, to see if
2305         any systems lack sys/socket.h; mingw32 is known to lack it, but we
2306         don't support it yet anyway.  Also remove HAVE_NETDB_H test, for
2307         same reasons.
2308
2309 2005-10-04  Bruno Haible  <bruno@clisp.org>
2310
2311         * verify.h (verify_true): Provide alternative definition for C++.
2312
2313 2005-10-04  Simon Josefsson  <jas@extundo.com>
2314
2315         * getaddrinfo.h: Move sys/types.h include first, reported by "Mark
2316         D. Baushke" <mdb@gnu.org>.
2317
2318 2005-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2319
2320         * getdelim.c: Include getdelim.h first.  Include <limits.h>.
2321         (SSIZE_MAX): New macro, if not already defined.
2322         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
2323         than 2 GiB.
2324
2325 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2326
2327         * exclude.c: Include verify.h.
2328         (verify): Remove.  All callers changed to use verify.h's version.
2329         * strtoimax.c: Likewise.
2330         * utimecmp.c: Likewis.e
2331
2332         Sync from coreutils.
2333         * .cppi-disable: Add getaddrinfo.h, getdelim.h, getline.h, getpass.c
2334         mbchar.h, mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2335         * .cvsignore: Add fts.h, search.h, t-fpending.
2336         * settime.c (settime): Fix { typo in previous patch.  Also, don't
2337         bother returning ENOSYS if settimeofday or stime fails; just let
2338         them return whatever errno they want to return.
2339         * utimens.c: Include unistd.h, for dup2.
2340         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
2341         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2342
2343 2005-10-02  Jim Meyering  <jim@meyering.net>
2344
2345         Sync from coreutils.
2346         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
2347         * openat-die.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H'.
2348         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
2349         Remove AT_FDCWD test.
2350         Do not consume the fd unless successful.
2351         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
2352         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
2353         block, so that we don't even try to compile it if settimeofday is
2354         available.  This works around a compilation failure on OSF1 V5.1,
2355         due to stime requiring a `long int*' while tv_sec is `int'.
2356
2357 2005-09-30  Eric Blake  <ebb9@byu.net>  (tiny change)
2358
2359         * getdelim.c (getdelim): Remove unused variables.
2360
2361 2005-10-01  Simon Josefsson  <jas@extundo.com>
2362
2363         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
2364         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
2365         AI_* and EAI_* definitions.  Protect function declarations.
2366
2367 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
2368
2369         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
2370         so that the code works even with ancient cpp.  Portability problem
2371         with GCC 2.7.2.1 reported by Thomas M.Ott.
2372
2373 2005-09-27  Jim Meyering  <jim@meyering.net>
2374
2375         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
2376
2377         * intprops.h (signed_type_or_expr__): Define.
2378         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
2379         for unsigned types.
2380
2381 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2382
2383         * verify.h (verify_expr): Remove, replacing with:
2384         (verify_true): New macro that returns true instead of void.
2385         (verify_type__): Remove.
2386         (verify): Use verify_true rather than verify_type__.
2387
2388 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2389
2390         * utimens.c (ENOSYS): Define if not already defined.
2391         (futimens): Support having a null PATH if the file descriptor
2392         is nonnegative.
2393
2394         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
2395         Remove.
2396         (__attribute): Define to empty unless GCC 3.1 or later.
2397         This works around a core dump on OpenBSD 3.4, which has GCC
2398         2.95.3, which dumps core when given __attribute__(()).  It also
2399         simplifies other tests, since we really don't want to bother with
2400         worrying about which ancient version of GCC supported what.
2401         Original problem reported by Yoann Vandoorselaere, with part of
2402         the fix suggested by Derek Price.
2403
2404 2005-09-24  Jim Meyering  <jim@meyering.net>
2405
2406         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
2407         so we can once again use a positive bitfield width of 1 -- now we
2408         don't have to explain why we were using a bitfield width of 2.
2409
2410 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2411
2412         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
2413         Problem reported by Eric Blake.
2414         (getaddrinfo): Initialize se so that it's not garbage.
2415         Redo internal storage allocation so that it doesn't make unportable
2416         assumptions about alignment.
2417         Fix a memory leak.
2418
2419         * utimens.c (futimens): Use futimesat if available.
2420         Prefer it to futimes since it doesn't have the futimes bug.
2421
2422         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
2423         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
2424         Instead, declare a function that returns a pointer to an array,
2425         and use verify_type__ to declare the size of the array.
2426         Problem and germ of a solution reported by Bruno Haible.
2427         (verify_type__): Use 2, not 1, for bitfield size, to avoid
2428         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
2429
2430 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2431
2432         Sync from coreutils.
2433
2434         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h,
2435         stat-time.h.
2436         * argmatch.h: Include verify.h
2437         (ARGMATCH_VERIFY): Use verify rather than rolling our own.
2438         (ARGMATCH_ASSERT): Remove; unused.
2439         * canonicalize.c: Assume STDC_HEADERS.
2440         * exclude.c: Include "strcase.h".
2441         * regex_internal.h [!defined _LIBC]: Likewise.
2442         * getusershell.c: Include stdio--.h rather than stdio.h
2443         and stdio-safer.h.
2444         (getusershell): Call fopen, not fopen_safer.
2445         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2446         Do not include unistd-safer.h.
2447         (save_cwd): Don't call fd_safer; no longer needed
2448         now that we include fcntl--.h.
2449
2450         * getdate.y (relative_time): New type.
2451         (RELATIVE_TIME_0): New constant.
2452         (parser_control): Use relative_time instead of doing it ourselves.
2453         (%union): Add new relative_time rel member.
2454         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2455         Now typeless.
2456         (relunit, relunit_snumber): Now of type rel.
2457         (zone, rel, relunit, get_date): Adjust to above changes.
2458
2459         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2460         Do not include unistd-safer.h.
2461         (getloadavg): Don't call fd_safer; no longer needed
2462         now that we include fcntl--.h.
2463
2464         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
2465         (make_dir_parents): Treat ENOSYS like EEXIST.
2466
2467         Improve quality of diagnostics on restore_cwd failure.
2468         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2469         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2470         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2471         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2472         each time through the loop.  Do not diagnose restore_cwd failure;
2473         that is the caller's job (and perhaps the caller does not care).
2474
2475         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2476         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2477         If the file already exists but is not a directory, don't bother
2478         to try to make its parents.
2479         Close potential file descriptor leak if we can't chdir("/") (!).
2480         Don't always return true if chdir($PWD) fails; return true only
2481         if the requested action was done successfully (except for the
2482         chdir($PWD)).
2483         Don't log final directory unless we actually made it.
2484         Refactor to avoid duplicate code to fix up permissions.
2485         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2486
2487         * strftime.c (my_strftime): Rewrite the previous change slightly,
2488         to make it a bit faster and (I hope) clearer.
2489         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2490         Fix bug in formats like %2N.
2491
2492         * verify.h: New file.
2493
2494 2005-09-22  Jim Meyering  <jim@meyering.net>
2495
2496         Sync from coreutils.
2497
2498         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2499
2500         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2501         the .tm_year member, since otherwise gcc-4.0 would now warn about
2502         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2503
2504         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2505         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2506
2507         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2508         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2509         when run in a time zone for which daylight savings time is in effect
2510         for the starting date.
2511
2512         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2513         stop us from restricting permissions of just-created absolute-named
2514         directories.
2515         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2516         to restore initial working directory.
2517         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2518         to tell caller if/when we change the working directory and are
2519         unable to return to the initial one.
2520         * mkdir-p.h (make_dir_parents): Update prototype.
2521         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2522         `return false'.  This fixes a bug introduced on 2004-07-30.
2523
2524         * openat.c (fdopendir): Be sure to close the supplied
2525         file descriptor before returning.  This makes our replacement
2526         implementation a little closer to Solaris's, where fdopendir
2527         ties the file descriptor to the returned DIR* pointer.
2528         * openat.c (unlinkat): New function.
2529         * openat.h (unlinkat): Add prototype.
2530         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2531         (openat_restore_fail): Rename from openat_restore_die.
2532         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2533
2534         Provide an alternative to exiting immediately upon save_cwd or
2535         restore_cwd failure.  Now, an application can arrange e.g.,
2536         to perform a longjump in that case.
2537         * openat.c: Include dirname.h.
2538         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2539         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2540         and openat_restore_die rather than calling error directly.
2541         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2542
2543         * openat-die.c (openat_save_die, openat_restore_die): New file.
2544         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2545
2546         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
2547         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
2548                             int utc, int nanoseconds);
2549         Background:
2550         date should not have to allocate a megabyte of virtual memory to
2551         handle a format argument like +%1048575T.  When implemented with
2552         strftime, it must allocate such a buffer, use strftime to fill it
2553         in, print it, then free it.
2554         With fprintftime, it simply prints everything and exits.
2555         With no need for memory allocation, that's one fewer way to fail.
2556         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
2557         optional field width, not before, so we accept %9:z, not %:9z.
2558         (my_strftime): Be sure to use L_('x') for literals.
2559
2560         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2561         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2562         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2563         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2564         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2565         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2566         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2567         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2568         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2569
2570         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2571         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2572         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2573         and don't include <sys/file.h>).
2574
2575 2005-09-22  Eric Blake  <ebb9@byu.net>  (tiny change)
2576
2577         Sync from coreutils.
2578
2579         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2580         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2581         [!LDAV_DONE]: Avoid unused variable warning.
2582
2583 2005-09-21  Bruno Haible  <bruno@clisp.org>
2584
2585         * unicodeio.h (unicode_to_mb): New declaration.
2586
2587 2005-09-20  Derek Price  <derek@ximbiot.com>
2588
2589         * getaddrinfo.c: Don't include <netdb.h> included from getaddrinfo.h.
2590
2591 2005-09-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2592
2593         Use a consistent style for including <config.h>.
2594         * __fpending.c, acl.c, argmatch.c,
2595         argp-help.c, argp-parse.c,
2596         argp-pvh.c, backupfile.c, basename.c, c-stack.c,
2597         calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
2598         creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
2599         dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
2600         fd-safer.c, file-type.c, fileblocks.c, filemode.c,
2601         filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
2602         fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
2603         getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
2604         getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
2605         hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
2606         inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
2607         memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
2608         modechange.c, mountlist.c, open-safer.c, physmem.c,
2609         pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
2610         progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
2611         readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
2612         safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
2613         strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
2614         strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
2615         strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
2616         userspec.c, utimecmp.c, version-etc-fsf.c,
2617         version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
2618         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
2619         xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
2620         Standardize inclusion of config.h.
2621         * __fpending.h, dirfd.h, getdate.h, human.h,
2622         inttostr.h:  Removed inclusion of config.h from header files.
2623         * inttostr.c:  Adjusted in-tree users.
2624         * timespec.h: Remove superfluous warning to include config.h.
2625         * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
2626         gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
2627         nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
2628         unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
2629
2630 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2631
2632         * stat-time.h: New file.
2633         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
2634         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
2635         in a different way.
2636         (timespec_cmp): New function.
2637         * utimecmp.c: Include stat-time.h.
2638         (SYSCALL_RESOLUTION): Depend on whether various struct stat
2639         members exist, not on the obsolescent ST_MTIM_NSEC.
2640         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2641
2642 2005-09-15  Derek Price  <derek@ximbiot.com>
2643             Paul Eggert  <eggert@cs.ucla.edu>
2644
2645         * regcomp.c, regexec.c, regex_internal.c: Back out previous
2646         changes, consolidating in...
2647         * regex_internal.h: ...this file.
2648
2649 2005-09-15  Derek Price  <derek@ximbiot.com>
2650
2651         * regex_internal.h: Blank `pure' for GNUC < 3.
2652         * regex_internal.c: Ditto, using this...
2653         (__GNUC_PREREQ): ...new macro.
2654         * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
2655         (__GNUC_PREREQ): ...this new macro.
2656
2657         * strstr.h: Include string.h. Define strstr as a macro here.
2658
2659 2005-09-13  Derek Price  <derek@ximbiot.com>
2660
2661         * canon-host.c (canon_host_r): Set *cherror on memory allocation
2662         failure.
2663         Reported by Jim Meyering  <jim@meyering.net>.
2664
2665 2005-09-13  Jim Meyering  <jim@meyering.net>
2666
2667         * canon-host.c: Filter through gnu indent and reword comments slightly.
2668         * canon-host.h (ch_strerror_r): Tweak cpp indentation and spacing.
2669
2670 2005-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2671
2672         * lib/base64.c: Typo.
2673         (base64_encode): Put b64str in initialized data section.
2674
2675 2005-09-12  Derek Price  <derek@ximbiot.com>
2676
2677         Return usable errors from canon-host.
2678         * canon-host.h: New file.
2679         * canon-host.c (canon_host): Wrap...
2680         (canon_host_r): ...this new function, which now relies exclusively on
2681         getaddrinfo.
2682         (ch_strerror): New function.
2683         (last_cherror): New global.
2684         * getaddrinfo.c: Move include of getaddrinfo.h first to test interface.
2685         (getaddrinfo): Add AI_CANONNAME functionality.  Don't do arithmetic on
2686         void *.
2687         (freeaddrinfo): Free ai->ai_canonname when set.
2688
2689 2005-09-12  Derek Price  <derek@ximbiot.com>
2690             Paul Eggert  <eggert@cs.ucla.edu>
2691
2692         * glob-libc.h: Renamed from glob_.h.  The new version is
2693         taken from libc's glob.h, except with '#ifdef __GLOB_GNULIB'
2694         protecting things that should be done only in gnulib contexts.
2695         * glob_.h: New file, containing only the glob things needed for
2696         gnulib.
2697         (GLOB_PREFIX): Remove.  All uses changed to look for __GLOB_GNULIB.
2698         (__GLOB_CONCAT, __GLOB_XCONCAT, __GLOB_ID): Remove; no longer needed.
2699         (glob, globfree, glob_pattern_p): Now defined simply in terms of
2700         rpl_glob, rpl_globfree, rpl_glob_pattern_p.
2701         (__GLOB_GNULIB): New macro, to keep the glob.h changes clearer
2702         and to respect the namespace rules better.
2703
2704 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
2705
2706         Merge glibc and coreutils changes into gnulib, plus a few
2707         extra fixes.
2708         * md5.c: Use #error rather than a string.
2709         (CYCLIC): New macro, from glibc source.  Use it instead of rol.
2710         * md5.h (__GNUC_PREREQ, __THROW): Define if not defined already.
2711         (__attribute__): Define to empty for non recent-GCC.
2712         (__md5_buffer, __md5_finish_ctx, __md5_init_ctx, __md5_process_block):
2713         (__md5_process_bytes, __md5_read_ctx, __md5_stream):
2714         Renamed from their non-__ counterparts, with new macros replacing
2715         them if not _LIBC.  Add __THROW attribute.
2716         (rol): Remove.
2717         (struct md5_ctx): Align buffer if using GCC.
2718         * sha1.h (struct sha1_ctx): Likewise.
2719         * sha1.c (SWAP): Renamed from the NOTSWAP.  All uses changed.
2720         The old name was backwards.
2721         (NOTSWAP): Remove; not used.
2722         (rol): New macro, moved here from md5.h.
2723         (sha1_process_block): Remove a FIXME that doesn't make sense.
2724
2725 2005-09-12  Derek Price  <derek@ximbiot.com>
2726
2727         * gai_strerror.c: Include config.h when available.  Include
2728         getaddrinfo.h before other headers to test interface.
2729         Reported by Larry Jones <lawrence.jones@ugs.com>.
2730
2731 2005-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2732
2733         * glob.c (glob, globfree, __glob_pattern_p): Use old-style function
2734         definitions, since that's the preferred style in glibc.
2735         Fix a minor spacing issue, and update copyright notice to match glibc's.
2736
2737 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2738
2739         * regex_internal.h (bitset_not): Add parens to avoid gcc -Wall warning.
2740
2741 2005-09-06  Simon Josefsson  <jas@extundo.com>
2742
2743         * getpass.c (getpass): Fix typo, test for HAVE_TCSETATTR and not
2744         TCSETATTR.  Reported by Derek Price <derek@ximbiot.com>.
2745
2746 2005-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2747
2748         Change bitset word type from unsigned int to unsigned long int,
2749         as this has better performance on typical 64-bit hosts.
2750         Port bitset code to hosts with unusual word sizes.
2751         * regcomp.c (build_equiv_class, build_charclass, build_range_exp):
2752         (build_collating_symbol):
2753         Prefer bitset to re_bitset_ptr_t in prototypes, when the actual
2754         argument is a bitset.  This is merely a style issue, but it makes
2755         it clearer that an entire array is expected.
2756         (re_compile_fastmap_iter, init_dfa, init_word_char, optimize_subexps):
2757         * regcomp.c (lower_subexp, parse_bracket_exp, built_charclass_op):
2758         Port to the case where bitset_word is not the same as unsigned int.
2759         * regex_internal.h (bitset_set, bitset_clear, bitset_contain):
2760         (bitset_not, bitset_merge, bitset_set_all, bitset_mask):
2761         Likewise.
2762         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2763         (build_trtable, group_nodes_into_DFAstates):
2764         Likewise.
2765         * regcomp.c (re_compile_fastmap_iter, utf8_sb_map, optimize_utf8):
2766         Don't assume that SBC_MAX is a multiple of BITSET_WORD_BITS.
2767         * regex_internal.h (bitset_set_all, bitset_not): Likewise.
2768         * regexec.c (group_nodes_into_DFAstates): Likewise.
2769         * regcomp.c (utf8_sb_map): Don't assume UINT_MAX == 0xffffffff.
2770         * regcomp.c (optimize_subexps, lower_subexp):
2771         Work even if bitset_word has holes in its bitwise representation.
2772         * regex_internal.h (BITSET_WORD_BITS): Likewise.
2773         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2774         Likewise.
2775         * regex_internal.c (re_string_reconstruct):
2776         Don't assume UCHAR_MAX == 255.
2777         * regex_internal.h (bitset_set_all): Likewise.
2778         * regex_internal.h (BITSET_WORD_BITS): Renamed from UINT_BITS.
2779         All uses changed.
2780         (BITSET_WORDS): Renamed from BITSET_UINTS.  All uses changed.
2781         (bitset_word): New type, replacing 'unsigned int' for bitset uses.
2782         All uses changed.
2783         (BITSET_WORD_MAX): New macro.
2784         (bitset_set, bitset_clear, bitset_contain, bitset_empty):
2785         (bitset_set_all, bitset_copy):  Now inline functions, not macros.
2786         (bitset_empty, bitset_copy):
2787         Prefer sizeof (bitset) to multiplying it out ourselves.
2788         (bitset_not_merge): Remove; unused.
2789         (bitset_contain): Return bool, not unsigned int with one bit on.
2790         All callers changed.
2791         * regexec.c (build_trtable): Don't assume bitset has no stricter
2792         alignment than re_node_set; do this by defining a new internal
2793         type struct dests_alloc and using it to allocate memory.
2794
2795 2005-09-02  Paul Eggert  <eggert@cs.ucla.edu>
2796
2797         Check for arithmetic overflow when calculating sizes, to prevent
2798         some buffer-overflow issues.  These patches are conservative, in the
2799         sense that when I couldn't determine whether an overflow was possible,
2800         I inserted a run-time check.
2801         * regex_internal.h (re_xmalloc, re_xrealloc, re_x2realloc): New macros.
2802         (SIZE_MAX) [!defined SIZE_MAX]: New macro.
2803         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc):
2804         (re_xnrealloc, re_x2nrealloc): New inline functions.
2805         * lib/regcomp.c (init_dfa, analyze, build_range_exp, parse_bracket_exp):
2806         (build_equiv_class, build_charclass): Check for arithmetic overflow
2807         in size expression calculations.
2808         * lib/regex_internal.c (re_string_realloc_buffers):
2809         (build_wcs_upper_buffer, re_node_set_add_intersect):
2810         (re_node_set_init_union, re_node_set_insert, re_node_set_insert_last):
2811         (re_dfa_add_node, register_state): Likewise.
2812         * lib/regexec.c (re_search_stub, re_copy_regs, re_search_internal):
2813         (prune_impossible_nodes, push_fail_stack, set_regs, check_arrival):
2814         (build_trtable, extend_buffers, match_ctx_init, match_ctx_add_entry):
2815         (match_ctx_add_subtop, match_ctx_add_sublast): Likewise.
2816
2817 2005-09-01  Paul Eggert  <eggert@cs.ucla.edu>
2818
2819         * glob.c (GET_LOGIN_NAME_MAX): Renamed from LOGIN_NAME_MAX,
2820         to avoid a collision with bits/local_lim.h in glibc.
2821         All uses changed.  Problem reported by Dmitry V. Levin in
2822         <http://sources.redhat.com/bugzilla/show_bug.cgi?id=1060>.
2823
2824         * regex_internal.c (build_wcs_upper_buffer): Fix portability
2825         bugs in int versus size_t comparisons.
2826         (re_string_context_at): Fix bug where the code assumed that
2827         Idx is signed.
2828
2829         Use bool where appropriate.
2830         * regcomp.c (re_set_fastmap): ICASE arg is bool, not int.
2831         All callers changed.
2832         (calc_eclosure_iter): Likewise, for ROOT arg.
2833         (parse_bracket_element): Likewise, for ACCEPT_HYPHEN arg.
2834         (build_charclass_op): Likewise, for NON_MATCH arg.
2835         * regex_internal.c (re_string_allocate, re_string_construct):
2836         (re_string_construct_common): Likewise, for ICASE arg.
2837         * regexec.c (re_search_2_stub, re_search_stub):
2838         Likewise, for RET_LEN arg.
2839         (check_matching): Likewise, for FL_LONGEST_MATCH arg.
2840         (set_regs): Likewise, for FL_BACKTRACK arg.
2841         * regcomp.c (re_compile_fastmap_iter, optimize_utf8):
2842         (duplicate_node_closure, calc_inveclosure, calc_eclosure):
2843         (calc_eclosure_iter, parse_bracket_exp):
2844         Use bool for internal variables that are booleans.
2845         * regexec.c (re_search_internal, check_matching, proceed_next_node):
2846         (set_regs, build_sifted_states, sift_states_bkref):
2847         (check_arrival_add_next_nodes, check_arrival_expand_ecl_sub):
2848         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
2849         (find_collation_sequence_value):
2850         Likewise.
2851         * regex_internal.c (re_node_set_insert, re_node_set_insert_last):
2852         (re_node_set_compare):
2853         Return bool, not int. All callers changed.
2854         * regexec.c (check_halt_node_context, check_dst_limits):
2855         (build_trtable, check_node_accept): Likewise.
2856         * regex_internal.h: Include stdbool.h.
2857
2858         Fix bugs uncovered when converting to bool.
2859         * regcomp.c (calc_eclosure_iter): Check for storage allocation
2860         failure instead of charging ahead blindly.
2861         * regex_internal.c (register_state): Likewise.
2862         * regexec.c (re_search_2_stub): Use simpler method than boolean
2863         for freeing internal storage.
2864         (group_nodes_into_DFA_states): Use unsigned int, not int, for
2865         bitset pieces used as boolean, to avoid undefined behavior
2866         on hosts that do int overflow checking.
2867
2868 2005-08-31  Derek Price  <derek@ximbiot.com>
2869
2870         * getdelim.c (getdelim): Return EOF on EOF.
2871         Reported by Larry Jones <lawrence.jones@ugs.com>.
2872
2873 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2874
2875         * regex_internal.c (re_string_reconstruct): Don't assume buffer
2876         lengths fit in regoff_t; this isn't true if regoff_t is the same
2877         width as size_t.
2878         * regex.c (re_search_internal): 5th arg is LAST_START
2879         (= START + RANGE) instead of RANGE.  This avoids overflow
2880         problems when regoff_t is the same width as size_t.
2881         All callers changed.
2882         (re_search_2_stub): Check for overflow when adding the
2883         sizes of the two strings.
2884         (re_search_stub): Check for overflow when adding START
2885         to RANGE; if it occurs, substitute the extreme value.
2886
2887 2005-08-31  Jim Meyering  <jim@meyering.net>
2888
2889         * regcomp.c (search_duplicated_node): Make first pointer arg
2890         a pointer-to-const.
2891         * regex_internal.c (create_ci_newstate, create_cd_newstate):
2892         (register_state): Likewise.
2893         * regexec.c (search_cur_bkref_entry, check_dst_limits):
2894         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2895         (group_nodes_into_DFAstates): Likewise.
2896
2897 2005-08-31  Paul Eggert  <eggert@cs.ucla.edu>
2898
2899         On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the
2900         old glibc regex code mishandles strings longer than 2**31 bytes.
2901         This patch fixes this when the regex code is used in gnulib
2902         (i.e., outside glibc).
2903
2904         This patch should not affect the use of the regex code inside
2905         glibc.  No doubt this problem also needs to be handled for glibc
2906         as well, but the result will be an incompatible change to the
2907         glibc ABI, and the old ABI will have to be supported too.  That
2908         can be the the subject for another patch.
2909
2910         * regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro,
2911         governing whether the rest of this patch is active.  By default,
2912         the macro is disabled and the patch has no effect.
2913         (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int.
2914         (__re_idx_t, __re_size_t, __re_long_size_t): New types.
2915         (struct re_pattern_buffer, re_search, re_search_2, re_match):
2916         (re_match_2, re_set_registers): Use the new types.
2917         * regex_internal.h (Idx, re_hashval_t): New types.
2918         (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
2919         New macros.
2920         (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers):
2921         (re_string_context_at, bin_tree_t, re_dfastate_t):
2922         (struct re_state_table_entry, state_array_t, re_sub_match_last_t):
2923         (re_sub_match_top_t, re_match_context_t, re_sift_context_t):
2924         (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t):
2925         (re_string_char_size_at, re_string_wchar_at):
2926         (re_string_elem_size_at):
2927         Use the new types and macros to port to 64-bit hosts.
2928         Use unsigned types for internal values, so that the code
2929         mostly works even for arrays larger than SSIZE_MAX.
2930         * regcomp.c (re_compile_internal, init_dfa, duplicate_node):
2931         (search_duplicated_node, calc_eclosure_iter, fetch_number):
2932         (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp):
2933         (build_equiv_class, build_charclass, re_compile_fastmap_iter):
2934         (free_dfa_content, create_initial_state, optimize_utf8, analyze):
2935         (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure):
2936         (calc_inveclosure, parse_dup_op, build_range_exp):
2937         (build_collating_symbol, parse_bracket_exp, build_charclass_op):
2938         (fetch_number, create_token_tree, mark_opt_subexp):
2939         Likewise.
2940         * regex_internal.c (re_string_construct_common, create_ci_newstate):
2941         (create_cd_newstate, re_string_allocate, re_string_construct):
2942         (re_string_realloc_buffers, build_wcs_upper_buffer):
2943         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
2944         (re_string_reconstruct, re_string_peek_byte_case):
2945         (re_string_fetch_byte_case, re_string_context_at):
2946         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
2947         (re_node_set_init_copy, re_node_set_add_intersect):
2948         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
2949         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
2950         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
2951         (re_acquire_state, re_acquire_state_context, register_state):
2952         Likewise.
2953         * regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry):
2954         (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init):
2955         (re_search_internal, re_search_2_stub, re_search_stub)
2956         (re_copy_regs, check_matching, check_halt_state_context, update_regs):
2957         (push_fail_stack, sift_states_iter_mb, build_sifted_states):
2958         (update_cur_sifted_state, check_dst_limits):
2959         (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos):
2960         (check_subexp_limits, sift_states_bkref, merge_state_array):
2961         (check_subexp_matching_top, get_subexp, get_subexp_sub):
2962         (find_subexp_node, check_arrival, check_arrival_add_next_nodes):
2963         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
2964         (expand_bkref_cache, check_node_accept_bytes):
2965         (group_nodes_into_DFAstates, check_node_accept, regexec, re_match):
2966         (re_search, re_match_2, re_search_2, prune_impossible_nodes):
2967         (acquire_init_state_context, check_halt_node_context):
2968         (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return):
2969         (sift_states_backward, clean_state_log_if_needed):
2970         (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log):
2971         (find_recover_state, transit_state_sb, transit_state_mb):
2972         (transit_state_bkref, build_trtable, match_ctx_clean):
2973         Likewise.
2974         * regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned,
2975         to work around an assumption that REG_MISSING is negative.
2976
2977         * regcomp.c (re_comp) [defined _REGEX_RE_COMP || defined _LIBC]:
2978         (seek_collating_symbol_entry) [defined _LIBC]:
2979         (lookup_collation_sequence_value) [defined _LIBC]:
2980         (build_range_exp, build_collating_symbol) [defined _LIBC]:
2981         Use prototypes rather than old-style function definitions.
2982         * regexec.c (re_exec) [defined _REGEX_RE_COMP || defined _LIBC]:
2983         (transit_state_sb) [0]:
2984         (find_collation_sequence_value) [defined _LIBC]: Likewise.
2985
2986         * regexec.c (re_search_internal): Simplify update of rm_so and
2987         rm_eo.
2988
2989         * regcomp.c (re_compile_fastmap_iter, init_dfa, init_word_char):
2990         (optimize_subexps, lower_subexp):
2991         Don't assume 1<<31 has defined behavior on hosts with 32-bit int,
2992         since the signed shift might overflow.  Use 1u<<31 instead.
2993         * regex_internal.h (bitset_set, bitset_clear, bitset_contain): Likewise.
2994         * regexec.c (check_dst_limits_calc_pos_1, check_subexp_matching_top):
2995         Likewise.
2996
2997         * regcomp.c (optimize_subexps, lower_subexp):
2998         Use CHAR_BIT rather than 8, for clarity.
2999         * regexec.c (check_dst_limits_calc_pos_1):
3000         (check_subexp_matching_top): Likewise.
3001         * regcomp.c (init_dfa): Make table_size unsigned, so that we don't
3002         have to worry about portability issues when shifting it left.
3003         Remove no-longer-needed test for table_size > 0.
3004         * regcomp.c (parse_sub_exp): Do not shift more bits than there are
3005         in a word, as the resulting behavior is undefined.
3006         * regexec.c (check_dst_limits_calc_pos_1): Likewise;
3007         in one case, a <= should have been an <, and in another case the
3008         whole test was missing.
3009         * regex_internal.h (BYTE_BITS): Remove.  All uses changed to
3010         the standard name CHAR_BIT.
3011         * regexec.c (match_ctx_add_entry): Don't assume that ~0 == -1;
3012         this is not true on one's complement and signed-magnitude hosts.
3013
3014         * regex_internal.h (re_sub_match_top_t): Remove unused member
3015         next_last_offset.
3016         (struct re_dfa_t): Remove unused member states_alloc.
3017         * regcomp.c (init_dfa): Don't initialize unused members.
3018
3019 2005-08-31  Bruno Haible  <bruno@clisp.org>
3020
3021         * strstr.c: Include <stddef.h>, for NULL.
3022         * strcasestr.c: Likewise.
3023         Reported by Yoann Vandoorselaere <yoann.v@prelude-ids.com>.
3024
3025 2005-08-30  "Oskar Liljeblad" <oskar@osk.mine.nu>
3026
3027         * iconvme.h: Add prototype for iconv_alloc.
3028
3029 2005-08-29  Simon Josefsson  <jas@extundo.com>
3030
3031         * iconvme.c: Fix errno.
3032
3033 2005-08-29  "Oskar Liljeblad" <oskar@osk.mine.nu>
3034
3035         * iconvme.c: Split iconv_string into iconv_alloc.
3036
3037 2005-08-27  Jim Meyering  <jim@meyering.net>
3038
3039         * fopen-safer.c: Merge minor changes from coreutils.
3040         * dup-safer.c: Likewise.
3041         * fd-safer.c: Likewise.
3042
3043         Merge from coreutils.
3044         * stdio--.h: New file.
3045         * stdlib--.h: New file.
3046         * mkstemp-safer.c: New file.
3047
3048         GNU tar needs these.
3049         * pipe-safer.c: New file.
3050         * creat-safer.c: New file.
3051         * fcntl--.h (creat): Define to creat_safer.
3052         * fcntl-safer.h: Include <sys/types.h> and declare creat_safer.
3053         * unistd--.h (pipe): Define to pipe_safer.
3054         * unistd-safer.h: Declare pipe_safer.
3055
3056 2005-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3057
3058         * regex_internal.h: Remove all references to
3059         RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89
3060         or better.
3061         (bitset_not, bitset_merge, bitset_not_merge):
3062         (bitset_mask, re_string_allocate, re_string_construct):
3063         (re_string_reconstruct, re_string_destruct, re_string_elem_size_at):
3064         (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case):
3065         (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1):
3066         (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect):
3067         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3068         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3069         (re_node_set_remove_at, re_dfa_add_node, re_acquire_state):
3070         (re_acquire_state_context):
3071         Remove unnecessary forward decls.
3072         (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at):
3073         Put __attribute at function definition,
3074         now that the function decl has been removed.
3075         * lib/regex_internal.c (re_string_peek_byte_case):
3076         (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
3077         Likewise.
3078
3079 2005-08-26  Simon Josefsson  <jas@extundo.com>
3080
3081         * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno
3082         Haible <bruno@clisp.org>.
3083
3084 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3085
3086         * regexec.c (set_regs): Don't alloca with an unbounded size.
3087
3088         alloca modernization/simplification for regex.
3089         * regex.c: Remove portability cruft for alloca.  This no longer
3090         needs to be at the start of the file, and can be moved into
3091         regex_internal.h and simplified.
3092         * regex_internal.h: Include <alloca.h>.
3093         (__libc_use_alloca) [!defined _LIBC]: New macro.
3094         * regexec.c (build_trtable): Remove "#ifdef _LIBC", since the code
3095         now works outside glibc.
3096
3097 2005-08-24  Simon Josefsson  <jas@extundo.com>
3098
3099         * getpass.c: Add WIN32 implementation.  Conditionalize use of
3100         termios.h, tcgetattr, tcsetattr and __fsetlocking.  Remove some
3101         GLIBC specific code.
3102
3103 2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3104
3105         Make regex safe for g++.  This fixes one real bug (an "err"
3106         that should have been "*err").  g++ problem reported by
3107         Sam Steingold.
3108         * regex_internal.h (re_calloc): New macro, consistent with
3109         re_malloc etc.  All callers of calloc changed to use re_calloc.
3110         * regex_internal.c (build_wcs_upper_buffer): Return reg_errcode_t,
3111         not int.  All callers changed.
3112         * regcomp.c (re_compile_fastmap_iter): Don't use alloca (mb_cur_max);
3113         just use an array of size MB_LEN_MAX.
3114         * regexec.c (push_fail_stack): Use re_realloc, not realloc.
3115         (find_recover_state): Change "err" to "*err"; this fixes what
3116         appears to be a real bug.
3117         (check_arrival_expand_ecl_sub): Be consistent about reg_errcode_t
3118         versus int.
3119
3120 2005-08-25  Jim Meyering  <jim@meyering.net>
3121
3122         * open-safer.c: Include <config.h>.
3123         Otherwise, we'd lose LARGEFILE support in any file using
3124         e.g. "fcntl--.h"
3125
3126 2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3127
3128         * regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX.
3129         * regex.h (regerror): Likewise.
3130
3131         * regex.c: Do not include <sys/types.h>, as POSIX no longer
3132         requires this.  (The code never needed it.)
3133
3134         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
3135         All uses of recently-renamed identifiers changed to use the new,
3136         POSIX-compliant names.  The code will build and run just fine
3137         without these changes, but it's better to eat our own dog food
3138         and use the standard-conforming names.
3139
3140         * regex.h: Fix a multitude of POSIX name space violations.
3141         These changes have an effect only for programs that define
3142         _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they
3143         do not change anything for programs compiled in the normal way.
3144         Also, there is no effect on the ABI.
3145
3146         (_REGEX_SOURCE): New macro.
3147         Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both
3148         defined and _GNU_SOURCE is not; this fixes a name space violation.
3149
3150         Rename the following macros to obey POSIX requirements.
3151         The old names are still visible as macros if _REGEX_SOURCE is defined.
3152         (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from
3153         RE_BACKSLASH_ESCAPE_IN_LISTS.
3154         (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM.
3155         (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES.
3156         (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS.
3157         (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS.
3158         (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS.
3159         (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE.
3160         (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL.
3161         (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE.
3162         (REG_INTERVALS): renamed from RE_INTERVALS.
3163         (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS.
3164         (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT.
3165         (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES.
3166         (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS.
3167         (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS.
3168         (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR.
3169         (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES.
3170         (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from
3171         RE_UNMATCHED_RIGHT_PAREN_ORD.
3172         (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING.
3173         (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS.
3174         (REG_DEBUG): renamed from RE_DEBUG.
3175         (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD.
3176         (REG_IGNORE_CASE): renamed from RE_ICASE.  This renaming is a bit
3177         unusual, since we can't clash with the POSIX REG_ICASE.
3178         (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE.
3179         (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP.
3180         (REG_NO_SUB): renamed from RE_NO_SUB.
3181         (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS.
3182         (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK.
3183         (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK.
3184         (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK.
3185         (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP.
3186         (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP.
3187         (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP.
3188         (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED.
3189         (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED.
3190         (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON.
3191         (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC.
3192         (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from
3193         RE_SYNTAX_POSIX_MINIMAL_BASIC.
3194         (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED.
3195         (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from
3196         RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
3197         (REG_DUP_MAX): renamed from RE_DUP_MAX.  No need to undef it.
3198         (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED.
3199         (REG_REALLOCATE): Renamed from REGS_REALLOCATE.
3200         (REG_FIXED): Renamed from REGS_FIXED.
3201         (REG_NREGS): Renamed from RE_NREGS.
3202
3203         (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values
3204         of other REG_* macros, since POSIX says the user is allowed to
3205         #undef these macros selectively.
3206
3207         (reg_errcode_t): Update comment stating what other tables need
3208         to be consistent.
3209
3210         Rename the following enum values to obey POSIX requirements.
3211         The old names are still visible as macros.
3212         (_REG_ENOSYS): Renamed from REG_ENOSYS.  Define even if _XOPEN_SOURCE
3213         is not defined, since GNU is supposed to be a superset of POSIX as
3214         much as possible, and since we want reg_errcode_t to be a signed
3215         type for implementation consistency.
3216         (_REG_NOERROR): Renamed from REG_NOERROR.
3217         (_REG_NOMATCH): Renamed from REG_NOMATCH.
3218         (_REG_BADPAT): Renamed from REG_BADPAT.
3219         (_REG_ECOLLATE): Renamed from REG_ECOLLATE.
3220         (_REG_ECTYPE): Renamed from REG_ECTYPE.
3221         (_REG_EESCAPE): Renamed from REG_EESCAPE.
3222         (_REG_ESUBREG): Renamed from REG_ESUBREG.
3223         (_REG_EBRACK): Renamed from REG_EBRACK.
3224         (_REG_EPAREN): Renamed from REG_EPAREN.
3225         (_REG_EBRACE): Renamed from REG_EBRACE.
3226         (_REG_BADBR): Renamed from REG_BADBR.
3227         (_REG_ERANGE): Renamed from REG_ERANGE.
3228         (_REG_ESPACE): Renamed from REG_ESPACE.
3229         (_REG_BADRPT): Renamed from REG_BADRPT.
3230         (_REG_EEND): Renamed from REG_EEND.
3231         (_REG_ESIZE): Renamed from REG_ESIZE.
3232         (_REG_ERPAREN): Renamed from REG_ERPAREN.
3233         (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE):
3234         (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN):
3235         (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND):
3236         (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants.
3237
3238         (_REG_RE_NAME, _REG_RM_NAME): New macros.
3239         (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE.  All uses
3240         changed.  But support the old name if the new one is not defined
3241         and if _REGEX_SOURCE.
3242
3243         Change the following member names in struct re_pattern_buffer.
3244         The old names are still supported if !_REGEX_SOURCE.
3245         The new names are always supported, regardless of _REGEX_SOURCE.
3246         (re_buffer): Renamed from buffer.
3247         (re_allocated): Renamed from allocated.
3248         (re_used): Renamed from used.
3249         (re_syntax): Renamed from syntax.
3250         (re_fastmap): Renamed from fastmap.
3251         (re_translate): Renamed from translate.
3252         (re_can_be_null): Renamed from can_be_null.
3253         (re_regs_allocated): Renamed from regs_allocated.
3254         (re_fastmap_accurate): Renamed from fastmap_accurate.
3255         (re_no_sub): Renamed from no_sub.
3256         (re_not_bol): Renamed from not_bol.
3257         (re_not_eol): Renamed from not_eol.
3258         (re_newline_anchor): Renamed from newline_anchor.
3259
3260         Change the following member names in struct re_registers.
3261         The old names are still supported if !_REGEX_SOURCE.
3262         The new names are always supported, regardless of _REGEX_SOURCE.
3263         (rm_num_regs): Renamed from num_regs.
3264         (rm_start): Renamed from start.
3265         (rm_end): Renamed from end.
3266
3267         (re_set_syntax, re_compile_pattern, re_compile_fastmap):
3268         (re_search, re_search_2, re_match, re_match_2, re_set_registers):
3269         Prepend __ to parameter names.
3270
3271         Undo yesterday's changes.
3272
3273 2005-08-24  Jim Meyering  <jim@meyering.net>
3274
3275         Sync from coreutils.
3276         * fcntl--.h, fcntl-safer.h, open-safer.c: New files.
3277
3278 2005-08-21  Bruno Haible  <bruno@clisp.org>
3279
3280         * lock.h: Add multiple inclusion guard.
3281         * tls.h: Add multiple inclusion guard.
3282
3283 2005-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3284
3285         * regex.h (REG_NOSYS)
3286         [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]:
3287         Define, since POSIX requires it as of 2001.
3288         (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]:
3289         New private symbol, used to keep the enum signed in all cases.
3290         * regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman
3291         in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
3292
3293         * regex_internal.c (re_string_skip_chars, register_state):
3294         (calc_state_hash):
3295         Remove forward decls; no longer needed now that we use prototypes.
3296         * regexec.c (acquire_init_state_context, check_halt_node_context):
3297         (proceed_next_node, pop_fail_stack, sub_epsilon_src_nodes):
3298         (clean_state_log_if_needed): Likewise.
3299
3300 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3301
3302         Fix problems reported by Sam Steingold in
3303         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00007.html>.
3304         * regexec.c (sift_states_bkref): Fix portability bug: the code
3305         assumed that reg_errcode_t is a signed type, which is not
3306         necessarily true if _XOPEN_SOURCE is not defined.
3307         * regex_internal.c (calc_state_hash): Put 'inline' before type, since
3308         some compilers warn about it otherwise.
3309
3310 2005-08-20  Jim Meyering  <jim@meyering.net>
3311
3312         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
3313         of unused local, dfa.
3314
3315 2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3316
3317         * regcomp.c (create_initial_state): Remove duplicate decl.
3318         (init_word_char, create_initial_state, duplicate_node_closure):
3319         (fetch_token, peek_token_bracket, build_range_exp):
3320         (build_collating_symbol): Remove forward decls; no longer needed
3321         now that we use prototypes.
3322
3323         * regcomp.c:
3324         (re_compile_pattern, re_set_syntax, re_compile_fastmap):
3325         (re_compile_fastmap_iter, regcomp, regerror, regfree):
3326         (re_compile_internal, init_dfa, init_word_char, free_workarea_compile):
3327         (create_initial_state, optimize_utf8, analyze, postorder, preorder):
3328         (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next):
3329         (link_nfa_nodes, duplicate_node_closure, search_duplicated_node):
3330         (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter):
3331         (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp):
3332         (parse_branch, parse_expression, parse_sub_exp, parse_dup_op):
3333         (build_range_exp, build_collating_symbol, parse_bracket_exp):
3334         (parse_bracket_element, parse_bracket_symbol, build_equiv_class):
3335         (build_charclass, build_charclass_op, fetch_number, create_tree):
3336         (create_token_tree, mark_opt_subexp, duplicate_tree):
3337         Use prototypes rather than old-style definitions.
3338
3339         * regex_internal.c:
3340         (re_string_allocate, re_string_construct, re_string_realloc_buffers):
3341         (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer):
3342         (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer):
3343         (re_string_reconstruct, re_string_peek_byte_case):
3344         (re_string_fetch_byte_case, re_string_destruct, re_string_context_at):
3345         (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2):
3346         (re_node_set_init_copy, re_node_set_add_intersect):
3347         (re_node_set_init_union, re_node_set_merge, re_node_set_insert):
3348         (re_node_set_insert_last, re_node_set_compare, re_node_set_contains):
3349         (re_node_set_remove_at, re_dfa_add_node, calc_state_hash):
3350         (re_acquire_state, re_acquire_state_context, register_state):
3351         (create_ci_newstate, create_cd_newstate, free_state):
3352         Likewise.
3353         * regexec.c (regexec, re_match, re_search, re_match_2, re_search_2):
3354         (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers):
3355         (re_search_internal, prune_impossible_nodes):
3356         (acquire_init_state_context, check_matching, static):
3357         (check_halt_node_context, check_halt_state_context, proceed_next_node):
3358         (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return):
3359         (update_regs, sift_states_backward, build_sifted_states):
3360         (clean_state_log_if_needed, merge_state_array):
3361         (update_cur_sifted_state, add_epsilon_src_nodes):
3362         (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1):
3363         (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref):
3364         (sift_states_iter_mb, transit_state, merge_state_with_log, static):
3365         (find_recover_state, check_subexp_matching_top, transit_state_mb):
3366         (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node):
3367         (check_arrival, check_arrival_add_next_nodes):
3368         (check_arrival_expand_ecl, check_arrival_expand_ecl_sub):
3369         (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates):
3370         (check_node_accept_bytes, check_node_accept, extend_buffers):
3371         (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry):
3372         (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast):
3373         (sift_ctx_init):
3374         Likewise.
3375
3376         * regex_internal.h:
3377         (re_string_allocate, re_string_construct, re_string_reconstruct):
3378         (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer):
3379         (build_upper_buffer, re_string_translate_buffer, re_string_destruct):
3380         (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at):
3381         (re_string_context_at, re_string_peek_byte_case):
3382         (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES
3383         is defined, since we now use prototypes always.
3384
3385         * regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
3386         C89 or better.  All uses removed.
3387
3388 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3389
3390         * regex_internal.c (re_acquire_state, re_acquire_state_context)
3391         [defined lint]: Suppress bogus uninitialized-variable warnings.
3392
3393         * regcomp.c (duplicate_node): Return new index, not an error code,
3394         and let the caller return REG_ESPACE if out of space.  This
3395         removes an uninitialied-variable warning with GCC 4.0.1, and also
3396         avoids taking the address of a local variable.  All callers
3397         changed.
3398
3399 2005-08-19  Jim Meyering  <jim@meyering.net>
3400
3401         * regexec.c (proceed_next_node): Redo local variables to
3402         avoid GCC shadowing warnings.
3403
3404 2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3405
3406         * regex_internal.c (re_string_realloc_buffers, re_node_set_insert):
3407         (re_node_set_insert_last, re_dfa_add_node):
3408         Rename local variables to avoid GCC shadowing warnings.
3409
3410 2005-08-18  Bruno Haible  <bruno@clisp.org>
3411
3412         * strstr.c (strstr): Fix return value in multibyte case.
3413         * strcasestr.c (strcasestr): Likewise.
3414
3415 2005-08-17  Jim Meyering  <jim@meyering.net>
3416
3417         Make the %s format (seconds since the epoch) work for a negative
3418         number and when used with a zero-padded field width, e.g. %015s.
3419
3420         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
3421         label so that it precedes the code to set `digits'.  Otherwise,
3422         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
3423         print `00-22'.  Now, it prints `-0022', as it should.
3424
3425 2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3426
3427         * regex.h: Remove useless space-before-tab.  From coreutils.
3428
3429 2005-08-17  Bruno Haible  <bruno@clisp.org>
3430
3431         * strcasestr.h: New file.
3432         * strcasestr.c: New file.
3433
3434 2005-08-17  Bruno Haible  <bruno@clisp.org>
3435
3436         * strstr.h: Ignore HAVE_STRSTR, always declare the gnulib function.
3437         * strstr.c: Completely rewritten, with multibyte locale support.
3438
3439 2005-08-17  Bruno Haible  <bruno@clisp.org>
3440
3441         * strcasecmp.c: Use mbuiter.h.
3442
3443 2005-08-17  Bruno Haible  <bruno@clisp.org>
3444
3445         * mbuiter.h: New file.
3446
3447 2005-08-16  Bruno Haible  <bruno@clisp.org>
3448
3449         * strcasecmp.c (struct mbiter_multi): Remove at_end field.
3450         (mbi_init): Update.
3451         (mbi_avail, mbi_advance): Let the iteration end before the terminating
3452         NUL byte, not after it.
3453
3454 2005-08-16  Bruno Haible  <bruno@clisp.org>
3455
3456         * mbchar.h (mb_cmp, mb_casecmp): Order the invalid characters after
3457         the valid ones. Makes the comparison operations transitive:
3458         cmp (a, b) < 0 && cmp (b, c) < 0 ==> cmp (a, c) < 0.
3459         * strcasecmp.c (strcasecmp): Use mb_casecmp.
3460
3461 2005-08-16  Bruno Haible  <bruno@clisp.org>
3462
3463         * strcase.h (strcasecmp): Add note in comments.
3464         * strncasecmp.c: Use code from strcasecmp.c.
3465         * strcasecmp.c: Use mbchar module. Define private mbiter variant.
3466         (strcasecmp): Work correctly in multibyte locales.
3467
3468 2005-08-16  Bruno Haible  <bruno@clisp.org>
3469
3470         * strnlen1.h: New file.
3471         * strnlen1.c: New file.
3472
3473 2005-08-16  Bruno Haible  <bruno@clisp.org>
3474
3475         * mbfile.h: New file.
3476
3477 2005-08-16  Bruno Haible  <bruno@clisp.org>
3478
3479         * mbiter.h: New file.
3480
3481 2005-08-16  Bruno Haible  <bruno@clisp.org>
3482
3483         * mbchar.h: New file.
3484         * mbchar.c: New file.
3485
3486 2005-08-16  Bruno Haible  <bruno@clisp.org>
3487
3488         * tls.h: New file, from GNU gettext.
3489         * tls.c: New file, from GNU gettext.
3490
3491 2005-08-15  Bruno Haible  <bruno@clisp.org>
3492
3493         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
3494         is defined.
3495
3496 2005-08-14  Jim Meyering  <jim@meyering.net>
3497
3498         Sync from coreutils.
3499
3500         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
3501         Use the hash-table-based cycle-detection code not just when
3502         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
3503         Reported by James Youngman in
3504         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
3505         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
3506         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
3507         This lets us compile with -DFTS_DEBUG, once again.
3508         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
3509         * fts.c (fd_safer): Remove decl.
3510         Include fcntl--.h rather than unistd-safer.h
3511         (fts_safe_changedir): Don't call fd_safer; no longer needed
3512         now that we include fcntl--.h.
3513
3514 2005-08-11  Simon Josefsson  <jas@extundo.com>
3515
3516         * readline.h, readline.c: New file.
3517
3518 2005-08-11  Bruno Haible  <bruno@clisp.org>
3519
3520         * strnlen.h (strnlen): Change parameter name to match comment.
3521
3522 2005-08-10  Simon Josefsson  <jas@extundo.com>
3523
3524         * strndup.c: Use strnlen.h.
3525
3526         * strnlen.h: New file.
3527
3528 2005-08-02  Simon Josefsson  <jas@extundo.com>
3529
3530         * getline.h, getline.c: Rewrite.
3531
3532         * getdelim.h, getdelim.c: New files, ported from glibc.
3533
3534 2005-07-31  Bruno Haible  <bruno@clisp.org>
3535
3536         * lock.h (gl_lock_initializer): New macro.
3537         (gl_lock_define_initialized): Use it.
3538         (gl_rwlock_initializer): New macro.
3539         (gl_rwlock_define_initialized): Use it.
3540         (gl_recursive_lock_initializer): New macro.
3541         (gl_recursive_lock_define_initialized): Use it.
3542
3543 2005-07-26  Bruno Haible  <bruno@clisp.org>
3544
3545         * lock.h: Update from GNU gettext.
3546         * lock.c: Update from GNU gettext.
3547
3548 2005-07-18  Bruno Haible  <bruno@clisp.org>
3549
3550         * lock.h (gl_once_t): New type.
3551         (gl_once_define, gl_once): New macros.
3552         * lock.c (fresh_once): New variable.
3553         (glthread_once, glthread_once_call, glthread_once_singlethreaded): New
3554         functions.
3555
3556 2005-07-18  Simon Josefsson  <jas@extundo.com>
3557
3558         * check-version.c (check_version): Accept identical versions too.
3559
3560 2005-07-18  Bruno Haible  <bruno@clisp.org>
3561
3562         * lock.h: New file, from GNU gettext.
3563         * lock.c: New file, from GNU gettext.
3564
3565 2005-07-15  Paul Eggert  <eggert@cs.ucla.edu>
3566
3567         * quotearg.c: Add translator comment suggested by Bruno Haible,
3568         with a minor change.
3569
3570 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3571
3572         * version-etc-fsf.c (version_etc_copyright): Parameterize the
3573         copyright symbol and the year.
3574         * version-etc.c (COPYRIGHT_YEAR): New constant.
3575         (version_etc_va): Use parameterized copyright notice.
3576         Reword to conform to the current GNU coding standards.
3577
3578 2005-07-11  Simon Josefsson  <jas@extundo.com>
3579
3580         * size_max.h: New file.
3581
3582 2005-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3583
3584         * argp-namefrob.h: Include unlocked-io.h. Removed unnecessary
3585         block of defines.
3586
3587 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
3588        and  Paul Eggert  <eggert@cs.ucla.edu>
3589
3590         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
3591         in wint_t, not wchar_t.  Remove now-unnecessary cast.
3592
3593 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3594
3595         * regex.c, regex.h: Sync from libc.
3596         * regcomp.c, regexec_internal.c, regex_internal.h, regexec.c:
3597         New files, synced from libc, except that regex_internal.h
3598         currently has a small porting fix.
3599
3600 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3601
3602         Remove the dependency of the strftime module on the tzset module.
3603         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
3604         Copy the input structure, to work around some of the bug with
3605         Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
3606         Solaris releases, you should also use the tzset module, but we won't
3607         require it as a dependency any more since we don't want LGPLed code
3608         to depend on GPLed code.
3609
3610 2005-07-02  Jim Meyering  <jim@meyering.net>
3611
3612         * backupfile.c (backup_args): Change a `0' to NULL.
3613
3614 2005-07-01  Jim Meyering  <jim@meyering.net>
3615
3616         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
3617         * getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
3618         * save-cwd.c, tempname.c:
3619         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
3620         and don't include <sys/file.h>).
3621
3622 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3623
3624         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
3625         declares only 'struct timespec;' (!).
3626
3627 2005-06-29  Jim Meyering  <jim@meyering.net>
3628
3629         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
3630         type name.  Use the variable name instead.
3631         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
3632
3633 2005-06-28  Simon Josefsson  <jas@extundo.com>
3634
3635         * check-version.h, check-version.c: New files.
3636
3637 2005-06-28  Simon Josefsson  <jas@extundo.com>
3638
3639         * base64.c (base64_encode): Indent.  Rename 'b64' to avoid
3640         collision with global variable.  Better indentation.  Don't
3641         increment buffer pointer beyond buffer end.  Based on comments
3642         from Paul Eggert <eggert@cs.ucla.edu>.
3643
3644         * base64.h: Indent.
3645
3646 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3647
3648         * canon-host.c (canon-host): Append trailing "," to 0 in
3649         initializer of struct addrinfo, as an indication that we don't
3650         care how many members the structure has.
3651
3652 2005-06-24  Derek Price  <derek@ximbiot.com>
3653         and Bruno Haible  <bruno@clisp.org>
3654
3655         Remove stat module & update lstat.
3656         * stat.c: Remove this file...
3657         (slash_aware_lstat): ...moving this content and its support...
3658         * lstat.c (rpl_lstat): ...into here.
3659         * lstat.h: New file.
3660
3661 2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3662
3663         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
3664         (ranged_convert): Don't save conversion in a temporary struct.
3665         This causes a warning with GCC 4.0.0, and anyway in the typical
3666         case it's not worth the extra 100 bytes or so of code.
3667         (ranged_convert, __mktime_internal): When calling a function via a
3668         pointer P, use P () rather than (*P) (), as we now assume C89 or
3669         better.
3670
3671 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3672
3673         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
3674         "who -r" failed to give output.  Problem reported by Tim Waugh.
3675
3676         * xmalloc.c (HAVE_GNU_CALLOC): New constant.
3677         (xcalloc): Use it to avoid needless tests.
3678         Problem reported by Jim Meyering.
3679
3680 2005-06-16  Jim Meyering  <jim@meyering.net>
3681
3682         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
3683         when either N or S is zero.
3684
3685 2005-06-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3686
3687         * argp.h (__option_is_short): Check upper limit of
3688         __key. Isprint() requires its argument to have the value
3689         of an unsigned char or EOF.
3690
3691 2005-06-10  Paul Eggert  <eggert@cs.ucla.edu>
3692
3693         * fnmatch.c (fnmatch): If there is an encoding error in a
3694         multibyte string or pattern, fall back on unibyte matching.
3695         Problem reported by James Youngman.
3696
3697 2005-06-08  Bruno Haible  <bruno@clisp.org>
3698
3699         * binary-io.h (fileno): Undefine before defining it. Avoids a gcc
3700         warning on mingw.
3701
3702 2005-06-08  Bruno Haible  <bruno@clisp.org>
3703
3704         * csharpcomp.h: New file, from GNU gettext.
3705         * csharpcomp.c: New file, from GNU gettext.
3706         * csharpcomp.sh.in: New file, from GNU gettext.
3707
3708 2005-06-07  Derek Price  <derek@ximbiot.com>
3709
3710         Sync from CVS.
3711         * glob_.h: Indent nested #ifdef.
3712
3713 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3714
3715         Sync from coreutils.
3716         Use "file name" when talking about file names, instead of "filename"
3717         or "path", as per the GNU coding standards.
3718         * mkdir-p.c: Renamed from makepath.c.
3719         (make_dir_parents): Renamed from make_path.  All callers changed.
3720         * mkdir-p.h: Likewise.  All includers changed.
3721         * filenamecat.c: Renamed from path-concat.c.
3722         (file_name_concat): Renamed from path_concat.  All callers changed.
3723         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
3724         * filenamecat.h: Likewise.  All includers changed.
3725         * acl.c: Don't use "path" or "filename" to mean "file name"
3726         in comments or local variable names.
3727         * basename.c: Likewise.
3728         * canonicalize.c, canonicalize.h: Likewise.
3729         * dirname.c, dirname.h: Likewise.
3730         * euidaccess.c: Likewise.
3731         * exclude.c: Likewise
3732         * fnmatch_.h, fnmatch_loop.c: Likewise.
3733         * fsusage.c, fsuage.h: Likewise.
3734         * fts.c, fts_.h: Likewise.
3735         * getcwd.c: Likewise.
3736         * getloadavg.c: Likewise.
3737         * mkstemp.c: Likewise.
3738         * mountlist.c, mountlist.h: Likewise.
3739         * openat.c, openat.h: Likewise.
3740         * readlink-stub.c: Likewise.
3741         * readutmp.c, readutmp.h: Likewise.
3742         * rename.c: Likewise.
3743         * rmdir.c: Likewise.
3744         * same.c: Likewise.
3745         * savedir.c: Likewise.
3746         * stripslash.c: Likewise.
3747         * tempname.c: Likewise.
3748         * xreadlink.c: Likewise.
3749         * exclude.c (excluded_file_name): Renamed from excluded_filename.
3750         All uses changed.
3751         * exclude.h: Likewise.
3752
3753         * euidaccess.c (getuid, getgid, getuid, getegid)
3754         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3755         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
3756         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3757         * pathmax.h: Include <limits.h> unconditionally, since other
3758         files have been getting away with it for years (MORE/BSD 4.3
3759         is extinct now).
3760         * userspec.c (getpwnam, getgrnam, getgrgid)
3761         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
3762
3763         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
3764         Define to 256, not 255, as per modern POSIX.
3765
3766 2005-06-01  Bruno Haible  <bruno@clisp.org>
3767
3768         * csharpexec.h: New file, from GNU gettext.
3769         * csharpexec.c: New file, from GNU gettext.
3770         * csharpexec.sh.in: New file, from GNU gettext.
3771
3772 2005-05-31  Derek Price  <derek@ximbiot.com>
3773             Paul Eggert  <eggert@cs.ucla.edu>
3774
3775         Sync from cvs.
3776         * glob_.h: s/MISSING_SYS_CDEFS_H/_SYS_CDEFS_H/ and comment.
3777
3778 2005-05-29  Derek Price  <derek@ximbiot.com>
3779             Paul Eggert  <eggert@cs.ucla.edu>
3780
3781         * glob_.h, glob.c: New files.
3782
3783 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
3784
3785         * getlogin_r.c (getlogin_r): Don't set errno to 0 on return.
3786
3787         * fts.c: Don't worry about debugging on pre-C99-compatible hosts;
3788         the configuration hassle isn't worth it.
3789         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
3790         (LONGEST_MODIFIER, PRIuMAX): Remove.
3791
3792 2005-05-27  Bruno Haible  <bruno@clisp.org>
3793
3794         * getlogin_r.h: Remove second include of <stddef.h>.
3795
3796 2005-05-25  Bruno Haible  <bruno@clisp.org>
3797             Derek Price  <derek@ximbiot.com>
3798
3799         * getlogin_r.h: Simplify API documentation.
3800
3801 2005-05-25  Derek Price  <derek@ximbiot.com>
3802             Paul Eggert  <eggert@cs.ucla.edu>
3803
3804         * getlogin_r.c, getlogin_r.h: New files.
3805
3806 2005-05-22  Bruno Haible  <bruno@clisp.org>
3807
3808         * minmax.h: Include <limits.h> only when it defines MIN, MAX.
3809         Also include <sys/param.h> if it defines MIN, MAX.
3810         Based on a patch by Derek Price <derek@ximbiot.com>.
3811
3812 2005-05-22  Bruno Haible  <bruno@clisp.org>
3813
3814         * stdint_.h (_STDINT_H_HAVE_INT64): New macro. Use it in #ifdefs.
3815         (INT64_MIN): Fix definition.
3816         Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3817
3818         * stdint_.h (_STDINT_H_NEED_SIGNED_INT_TYPES): Renamed from
3819         NEED_SIGNED_INT_TYPES.
3820
3821         * stdint_.h (_STDINT_H_HAVE_SYSTEM_INTTYPES): Renamed from
3822         HAVE_SYSTEM_INTTYPES.
3823
3824 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3825
3826         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
3827         so that unistd-safer.h (GPL'ed code) need not be included.
3828
3829 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
3830
3831         New fts module.
3832         * fts.c: Don't include "cycle-check.h" or "hash.h".
3833         (setup_dir, free_dir): New functions.
3834         (enter_dir, leave_dir): Define trivial
3835         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
3836         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
3837         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
3838         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
3839         Move to fts-cycle.c.
3840         (fts_open): Use setup_dir.
3841         (fts_close): Use free_dir.
3842         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
3843         This adds a label and some gotos, but the alternatives were messier.
3844         Check for memory allocation failure when entering a dir.
3845         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
3846         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
3847         (FTS): New member fts_cycle, that is a union that contains the
3848         old active_dir_ht and cycle_state.  All uses changed to mention
3849         fts_cycle.ht and fts_cycle.state.
3850         * fts-cycle.c: New file, containing GPL'ed code migrated out of
3851         fts.c, with the following changes:
3852         (setup_dir, free_dir): New functions.
3853         (enter_dir): Now returns bool.  Return true if successful, false
3854         if memory exhausted.  All callers changed.
3855         Do not bother partly cleaning up on
3856         memory allocation failure; that is free_dir's job.
3857         However, free ad if hash_insert fails, to avoid memory leak.
3858         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
3859         fts->fts_options to see which union member to use.
3860
3861 2005-05-20  Jim Meyering  <jim@meyering.net>
3862
3863         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
3864         Now a macro, to pacify GCC.
3865
3866 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
3867
3868         * chown.c (rpl_chown): Return -1 on failure.
3869
3870 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
3871
3872         * canonicalize.c: Include canonicalize.h first, to test interface.
3873         Include <stddef.h> unconditionally, since we assume C89 now.
3874         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
3875         * fts.c: Include fts_.h first, to check interface.
3876         Do not include intprops.h; no longer needed.
3877         Include cycle-check.h and hash.h, since fts_.h no longer does.
3878         Remove unnecessary casts of closedir to void.
3879         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
3880         decide whether to decrement nlinks.
3881         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
3882         (FTS): Use struct hash_table * instead of Hash_table, so that
3883         we no longer need to include hash.h here.
3884
3885 2005-05-17  Jim Meyering  <jim@meyering.net>
3886
3887         * fts.c, fts_.h: New files, from coreutils.
3888
3889 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3890
3891         Sync from coreutils.
3892         * unlinkdir.c, unlinkdir.h: New files.
3893         * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c,
3894         regex.h, unlocked-io.h, xtime.h:
3895         White space changes only.
3896         * makepath.c (make_path): Port to hosts where leading "//" is special.
3897         * yesno.c: Include getline.h, not ctype.h.
3898         (yesno): Don't remove leading white space; POSIX doesn't allow it.
3899         Use getline to remove arbitrary restriction on response length.
3900
3901 2005-05-13  Bruno Haible  <bruno@clisp.org>
3902
3903         * stdint_.h (int64_t, uint64_t, int_least64_t, uint_least64_t,
3904         int_fast64_t, uint_fast64_t, intmax_t, uintmax_t, INT64_MIN, INT64_MAX,
3905         UINT64_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
3906         INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, INTMAX_MIN,
3907         INTMAX_MAX, UINTMAX_MAX, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C):
3908         Add support for 64-bit integers in the MSVC compiler.
3909
3910 2005-05-13  Paul Eggert  <eggert@cs.ucla.edu>
3911
3912         * byteswap_.h, getsubopt.h, iconvme.h, strsep.c, strsep.h:
3913         Change the initial comment to refer to GPL, not LGPL.
3914         gnulib-tool will change it to LGPL as needed.
3915
3916         * __fpending.c, acl.c, acl.h, alloca_.h, allocsa.c, allocsa.h,
3917         argmatch.c, argmatch.h, argp-ba.c, argp-eexst.c, argp-fmtstream.c,
3918         argp-fmtstream.h, argp-fs-xinl.c, argp-help.c, argp-namefrob.h,
3919         argp-parse.c, argp-pv.c, argp-pvh.c, argp-xinl.c, argp.h, argz.c,
3920         argz_.h, asnprintf.c, asprintf.c, atanl.c, backupfile.c,
3921         backupfile.h, base64.c, base64.h, basename.c, binary-io.h,
3922         byteswap_.h, c-ctype.c, c-ctype.h, c-stack.c, c-stack.h,
3923         c-strtod.c, calloc.c, canon-host.c, canonicalize.c,
3924         canonicalize.h, ceill.c, chdir-long.c, chdir-long.h, chown.c,
3925         classpath.c, classpath.h, cloexec.c, closeout.c, closeout.h,
3926         concatpath.c, config.charset, copy-file.c, copy-file.h,
3927         cycle-check.c, cycle-check.h, diacrit.c, diacrit.h, dirfd.c,
3928         dirfd.h, dirname.c, dirname.h, dummy.c, dup-safer.c, dup2.c,
3929         eealloc.h, error.c, error.h, euidaccess.c, exclude.c, exclude.h,
3930         execute.c, execute.h, exit.h, exitfail.c, exitfail.h, expl.c,
3931         fatal-signal.c, fatal-signal.h, fd-safer.c, file-type.c,
3932         file-type.h, fileblocks.c, filemode.c, filemode.h, findprog.c,
3933         findprog.h, floorl.c, fnmatch.c, fnmatch_.h, fnmatch_loop.c,
3934         fopen-safer.c, free.c, frexpl.c, fsusage.c, fsusage.h,
3935         full-read.c, full-read.h, full-write.c, full-write.h,
3936         fwriteerror.c, fwriteerror.h, gai_strerror.c, gcd.c, gcd.h,
3937         getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h,
3938         getdate.y, getdomainname.c, getdomainname.h, getgroups.c,
3939         gethostname.c, gethrxtime.c, gethrxtime.h, getline.c, getline.h,
3940         getloadavg.c, getndelim2.c, getndelim2.h, getnline.c, getnline.h,
3941         getopt.c, getopt1.c, getopt_.h, getopt_int.h, getpagesize.h,
3942         getpass.c, getpass.h, getsubopt.c, getsubopt.h, gettext.h,
3943         gettime.c, gettimeofday.c, getugroups.c, getusershell.c,
3944         group-member.c, group-member.h, hard-locale.c, hard-locale.h,
3945         hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h,
3946         iconvme.c, iconvme.h, idcache.c, inet_ntop.h, intprops.h,
3947         inttostr.c, inttostr.h, isdir.c, javacomp.c, javacomp.h,
3948         javacomp.sh.in, javaexec.c, javaexec.h, javaexec.sh.in,
3949         lbrkprop.h, lchown.c, ldexpl.c, linebreak.c, linebreak.h,
3950         linebuffer.c, linebuffer.h, localcharset.c, localcharset.h,
3951         logl.c, long-options.c, long-options.h, lstat.c, makepath.c,
3952         makepath.h, malloc.c, mathl.h, mbswidth.c, mbswidth.h, md5.c,
3953         md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c,
3954         memcoll.h, memcpy.c, memmem.c, memmem.h, mempcpy.c, mempcpy.h,
3955         memrchr.c, memrchr.h, memset.c, minmax.h, mkdir.c, mkdtemp.c,
3956         mkdtemp.h, mkstemp.c, mktime.c, modechange.c, modechange.h,
3957         mountlist.c, mountlist.h, nanosleep.c, obstack.c, obstack.h,
3958         openat.c, openat.h, pagealign_alloc.c, pagealign_alloc.h,
3959         path-concat.c, path-concat.h, pathmax.h, pathname.h, physmem.c,
3960         physmem.h, pipe.c, pipe.h, poll.c, poll_.h, posixtm.c, posixtm.h,
3961         posixver.c, printf-args.c, printf-args.h, printf-parse.c,
3962         printf-parse.h, progname.c, progname.h, progreloc.c, putenv.c,
3963         quote.c, quote.h, quotearg.c, quotearg.h, raise.c, readlink.c,
3964         readtokens.c, readtokens.h, readtokens0.c, readtokens0.h,
3965         readutmp.c, readutmp.h, realloc.c, ref-add.sin, ref-del.sin,
3966         regex.c, regex.h, rename.c, rmdir.c, rpmatch.c, safe-read.c,
3967         safe-read.h, safe-write.c, safe-write.h, same.c, same.h,
3968         save-cwd.c, save-cwd.h, savedir.c, savedir.h, setenv.c, setenv.h,
3969         settime.c, sh-quote.c, sh-quote.h, sha1.c, sha1.h, sig2str.c,
3970         sig2str.h, sincosl.c, snprintf.c, snprintf.h, sqrtl.c,
3971         stat-macros.h, stat.c, stdbool_.h, stdint_.h, stdio-safer.h,
3972         stpcpy.c, stpcpy.h, stpncpy.c, stpncpy.h, strcase.h, strcasecmp.c,
3973         strchrnul.c, strchrnul.h, strcspn.c, strdup.c, strdup.h,
3974         strerror.c, strftime.c, strftime.h, stripslash.c, strndup.c,
3975         strndup.h, strnlen.c, strpbrk.c, strpbrk.h, strsep.c, strsep.h,
3976         strstr.c, strstr.h, strtod.c, strtoimax.c, strtok_r.c, strtok_r.h,
3977         strtol.c, strtoll.c, strtoul.c, strtoull.c, strverscmp.c,
3978         strverscmp.h, sysexit_.h, tempname.c, time_r.c, time_r.h,
3979         timegm.c, timegm.h, timespec.h, trigl.c, trigl.h, ucs4-utf16.h,
3980         ucs4-utf8.h, unicodeio.c, unicodeio.h, unistd-safer.h,
3981         unlocked-io.h, unsetenv.c, userspec.c, utf16-ucs4.h, utf8-ucs4.h,
3982         utime.c, utimecmp.c, utimecmp.h, utimens.c, vasnprintf.c,
3983         vasnprintf.h, vasprintf.c, vasprintf.h, version-etc-fsf.c,
3984         version-etc.c, version-etc.h, vsnprintf.c, vsnprintf.h,
3985         w32spawn.h, wait-process.c, wait-process.h, xalloc-die.c,
3986         xalloc.h, xallocsa.c, xallocsa.h, xasprintf.c, xgetcwd.c,
3987         xgetcwd.h, xgetdomainname.c, xgetdomainname.h, xgethostname.c,
3988         xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xreadlink.h,
3989         xsetenv.c, xsetenv.h, xsize.h, xstrndup.c, xstrndup.h, xstrtod.c,
3990         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c,
3991         xtime.h, xvasprintf.c, xvasprintf.h, yesno.c, yesno.h:
3992         Update FSF postal mail address.
3993
3994 2005-05-10  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
3995
3996         * getaddrinfo.c: Don't fail when SOCK_STREAM or SOCK_DGRAM are
3997         specified in ai_socktype. Fix invalid ai_protocol
3998         check. ai_protocol is usually set to 0 or depending on
3999         ai_family/ai_socktype to IPPROTO_TCP / IPPROTO_UDP.  Checking for
4000         SOCK_STREAM / SOCK_DGRAM in ai_protocol was invalid.  Set
4001         ai_socktype / ai_protocol in the returned addrinfo structure.
4002
4003 2005-05-09  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
4004             Bruno Haible  <bruno@clisp.org>
4005
4006         * inet_ntop.h: New file.
4007         * inet_ntop.c: New file, from glibc with modifications.
4008
4009 2005-05-08  Jim Meyering  <jim@meyering.net>
4010
4011         * classpath.c (PATH_SEPARATOR): Remove insignificant trailing blank.
4012
4013 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
4014
4015         Merge from coreutils.  Among other things,
4016         add bulletproofing for cases where stdin, stdout, or stderr are closed.
4017         * fd-safer.c: New file.
4018         * fcntl-safer.h, open-safer.c: Remove.
4019         * chdir-long.c: Fix comment "fetish" -> "coreutils".
4020         * dup-safer.c: Include unistd-safer.h first.
4021         Don't include errno.h.
4022         (dup_safer) [!defined F_DUPFD]: Let fd_safer do the real work.
4023         * file-type.h: Don't assume invoker included sys/stat.h first.
4024         * file-type.c: Rely on file-type.h change.
4025         * getloadavg.c: Include unistd-safer.h.
4026         (getloadavg): Use safer open.
4027         * getusershell.c: Include "stdio-safer.h".
4028         (getusershell): Use safer fopen.
4029         * long-options.c (long_options): Use NULL rather than 0.
4030         * modechange.h (mode_free): Remove; all callers changed to invoke
4031         'free'.
4032         * modechange.c: Likewise.
4033         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
4034         (MODE_DONE): New constant.
4035         (struct mode_change): Remove 'next' member.
4036         (make_node_op_equals): New function; like the old one of the
4037         same name, except it allocates an array.
4038         (mode_compile, mode_create_from_ref): Use it.
4039         (mode_compile): Allocate result as an array, not a linked list.
4040         Parse octal string ourself, so that we catch mistakes like "+0".
4041         (mode_adjust): Arg is an array, not a linked list.
4042         * modechange.c: Include stat-macros.h, xalloc.h.
4043         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
4044         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
4045         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
4046         Remove.  This is now stat-macros.h's job.
4047         (talloc): Remove.  All callers replaced by xalloc, so that
4048         our invokers don't have to worry about reporting memory failures.
4049         (make_node_op_equals): Remove.
4050         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4051         New constants.
4052         (struct mode_change): Moved here from modechange.h.
4053         (mode_append_entry): Remove.
4054         (mode_compile): Remove MASKED_OPS arg, since it encouraged
4055         apps to have incorrect behavior.  Use simpler algorithm for head
4056         and tail.  Don't futz with umask; that's now the job of mode_adjust.
4057         Detect more invalid usages rather than having somewhat-random behavior.
4058         Don't insert an "a=" action, as that leads to incorrect behavior.
4059         (mode_compile, mode_create_from_ref): Return NULL on error instead
4060         of an enum, since now there's only one way to have an error.  All
4061         callers changed.
4062         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
4063         at the correct time.  Simplify calculation of "+u" and its ilk.
4064         Don't mishandle "+X".
4065         (mode_free): Remove "register" and localize decls.
4066         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
4067         (struct mode_change): Move to modechange.c; callers don't
4068         need to see this stuff.
4069         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
4070         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
4071         (mode_change, mode_adjust): Reflect the new signatures noted above.
4072         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
4073         that might redefine system include files.
4074         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
4075         (my_usleep): Use NULL rather than (void *) 0.
4076         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
4077         Use siginterrupt to specify that system calls should be interrupted.
4078         (rpl_nanosleep): Move initialization of suspended closer to call of
4079         my_usleep.
4080         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
4081         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
4082         (desirable_utmp_entry): New function.
4083         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
4084         using x2nrealloc, to simplify logic.
4085         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
4086         size calculation.  Do not assume utmp file is a regular file.
4087         * readutmp.h (UT_PID): Moved here from ../src/who.c.
4088         (READ_UTMP_CHECK_PIDS): New constant.
4089         * save-cwd.c: Include unistd-safer.h.
4090         (save_cwd): Use fd_safer.
4091         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
4092         [!_LIBC] Include "stat-macros.h" instead.
4093         * unistd-safer.h (fd_safer): New decl.
4094
4095 2005-05-01  Oskar Liljeblad  <oskar@osk.mine.nu>
4096
4097         * byteswap_.h: New file.
4098
4099 2005-04-25  Albert Chin  <china@thewrittenword.com>
4100
4101         * regex.c: Include <stdio.h>, as a workaround to a Compaq Desktop
4102         Toolkit C bug.
4103
4104 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
4105
4106         * getdate.y (zone): Allow relunit_snumber after tZONE, so
4107         that "UTC +1 second" continues to work.  Problem reported
4108         by Dmitry V. Levin.
4109         (relunit_snumber): New rule.
4110         (relunit): Use it.
4111
4112 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4113
4114         * getdate.y (universal_time_zone_table): New constant.
4115         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
4116         universal_time_zone_table.
4117         (lookup_zone): Prefer universal_time_zone_table to
4118         local_time_zone_table, so that "GMT" time stamps are allowed in
4119         London during the summer.  Problem reported by Ian Abbott.
4120
4121 2005-04-12  Jim Meyering  <jim@meyering.net>
4122
4123         * human.c (humblock): Set *options even when returning due to
4124         xstrtoumax conversion failure.  Thanks to a used-uninitialized
4125         warning from gcc-4.
4126
4127 2005-04-09  Jim Meyering  <jim@meyering.net>
4128
4129         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
4130         -Wuninitialized: initialize tm0.tm_year.
4131
4132 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4133
4134         * getdate.y (parser_control): rels_seen is now a boolean, not a
4135         count, since there's no maximum.  All uses changed.
4136         Add member dsts_seen.
4137         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
4138         not being INT_MAX.
4139         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
4140         Use pc_rels_seen to decide whther a date is absolute.
4141
4142         * getdate.y (number): Don't overwrite year.
4143         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
4144         check.
4145
4146 2005-04-02  Simon Josefsson  <jas@extundo.com>
4147
4148         * getaddrinfo.h: Fix OpenBSD compilation failure, inspired by tiny
4149         patch from Yoann Vandoorselaere <yoann@prelude-ids.org>.
4150
4151 2005-03-27  Jim Meyering  <jim@meyering.net>
4152
4153         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
4154
4155 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
4156
4157         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
4158         "one's complement" -> "ones' complement" in comment, as per Knuth.
4159         "value of type" -> "type or expression" in comment.
4160         * mktime.c, strftime.c: Propagate intprops.h comment nits.
4161
4162 2005-03-26  Jim Meyering  <jim@meyering.net>
4163
4164         Comment nits.
4165         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
4166         Correct typos: s/or/of/.
4167
4168 2005-03-23  Jim Meyering  <jim@meyering.net>
4169
4170         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
4171
4172 2005-03-21  Jim Meyering  <jim@meyering.net>
4173
4174         Changes imported from coreutils.
4175
4176         * cycle-check.c: Don't include xalloc.h.
4177
4178         * path-concat.c: Don't include assert.h.
4179         (path_concat): Remove assertion that would have triggered
4180         for ABASE starting with more than one slash.
4181         Reported by Andreas Schwab.
4182
4183         * path-concat.c (path_concat): Set *BASE_IN_RESULT
4184         properly when ABASE is an absolute file name.
4185         Correct the description of this function.
4186         Include <assert.h>.
4187         Add an assertion and a test driver.
4188         This fixes a bug introduced on 2004-07-02.
4189         Andreas Schwab reported the resulting failure of cp --parents:
4190         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
4191
4192 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
4193
4194         * strftime.c (my_strftime): If the underlying strftime returns 0
4195         (which shouldn't happen), generate nothing instead of returning 0
4196         immediately, so that nstrftime (NULL, ...) doesn't return 0.
4197
4198 2005-03-16  Bruno Haible  <bruno@clisp.org>
4199
4200         * stdint_.h: Use HAVE_LONG_LONG_64BIT instead of HAVE_LONGLONG_64BIT.
4201
4202 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
4203
4204         * strftime.c (my_strftime): Prepend space to format so that we can
4205         reliably distinguish strftime failure from empty output on POSIX
4206         hosts.
4207
4208 2005-03-08  Paul Eggert  <eggert@cs.ucla.edu>
4209
4210         * iconvme.c (SIZE_MAX): New macro, if not already defined.
4211         (iconv_string): Don't guess a size-zero buffer, as that might cause
4212         buffer overrun.  Instead, avoid multiplying by MB_LEN_MAX if the
4213         result would be 'too large', where 'too large' is (heuristically)
4214         the square root of SIZE_MAX, divided by MB_LEN_MAX to allay
4215         overflow concerns.  This will prevent some unwanted malloc failures
4216         when the inputs are very large.
4217
4218 2005-03-15  Bruno Haible  <bruno@clisp.org>
4219
4220         * regex.c (byte_re_match_2_internal): Rename local variable 'not' to
4221         'negate'.
4222
4223         * regex.c (byte_re_match_2_internal): Reduce scope of same_str_p
4224         variable.
4225
4226         * regex.c (EXTEND_BUFFER, regcomp): Cast the realloc/malloc results.
4227
4228 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
4229
4230         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
4231         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
4232         intprops.h.
4233         * strtol.c: Likewise.
4234
4235 2005-03-14  Simon Josefsson  <jas@extundo.com>
4236
4237         * timegm.h: Use proper prototype CPP guards, reported by Dave Love
4238         <fx@gnu.org>.
4239
4240 2005-03-14  Jim Meyering  <jim@meyering.net>
4241
4242         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
4243         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
4244         to be nonzero so that we (and caller) can detect the difference
4245         between a valid zero-length expansion and an error return, even
4246         when the underlying strftime fails before writing anything into
4247         that location.
4248
4249 2005-03-10  Jim Meyering  <jim@meyering.net>
4250
4251         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
4252         so that this module works on systems without fchdir.
4253
4254 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
4255
4256         Factor int-properties macros into a single file, except for
4257         glibc-related files.
4258         * intprops.h: New file.
4259         * getloadavg.c: Include it instead of limits.h.
4260         (INT_STRLEN_BOUND): Remove.
4261         * human.c: Include intprops.h.
4262         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
4263         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
4264         * inttostr.h: Include intprops.h instead of limits.h.
4265         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
4266         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
4267         for consistency with intprops.h.
4268         (time_t_is_integer, twos_complement_arithmetic): Use them.
4269         * sig2str.h: Include <signal.h>, intprops.h.
4270         (INT_STRLEN_BOUND): Remove.
4271         * strftime.c (TYPE_SIGNED): Remove.
4272         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
4273         * strtol.c: Adjust comments to match intprops.h.
4274         * userspec.c: Include intprops.h.
4275         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
4276         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
4277         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
4278         instead of rolling our own expressions.
4279         * xstrtol.c: Include xstrtol.h first, to test interface.
4280
4281         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
4282         instead of int.
4283         (my_strftime): Do not mishandle years close to INT_MAX, by doing
4284         the right thing even if adding 1900 would overflow.  Similarly
4285         for tm_mon + 1 and tm_yday + 1.
4286         Make %Y always equivalent to %C%y, and similarly for %G and %g.
4287         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
4288         (DO_SIGNED_NUMBER): New macro.
4289         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
4290
4291 2005-03-07  Bruno Haible  <bruno@clisp.org>
4292
4293         * pagealign_alloc.c (MAP_FILE, MAP_FAILED): Define fallbacks.
4294
4295 2005-03-03  Derek R. Price  <derek@ximbiot.com>
4296             Bruno Haible  <bruno@clisp.org>
4297
4298         * pagealign_alloc.h: New file.
4299         * pagealign_alloc.c: New file.
4300
4301 2005-01-28  Bruno Haible  <bruno@clisp.org>
4302
4303         * stpncpy.h (stpncpy): Define as a macro without arguments, so that
4304         stpncpy.c uses it.
4305
4306 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
4307
4308         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
4309         The workaround isn't strictly needed for POSIX conformance, and
4310         it's too much of a pain to configure and maintain.  We'll ask
4311         people to fix their kernels instead.
4312         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
4313         (NANOSLEEP_BUG_WORKAROUND): Remove.
4314         (xnanosleep): Remove the workaround.
4315
4316 2005-02-12  Bruno Haible  <bruno@clisp.org>
4317
4318         * vasnprintf.c (EOVERFLOW): Define to a fallback if needed.
4319
4320 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4321
4322         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
4323         * timespec.h (gettime): Return void, since it always
4324         succeeds now.  All uses changed.
4325         * gettime.c (gettime) Likewise.
4326         [HAVE_NANOTIME]: Prefer nanotime.
4327         Assume gettimeofday succeeds, as POSIX requires.
4328         Assime time () succeeds, since other code already does.
4329         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
4330         (timespec_subtract): Remove.
4331         (NANOSLEEP_BUG_WORKAROUND): New constant.
4332         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
4333         things considerably.  Use it only on GNU/Linux hosts, since the
4334         workaround shouldn't be needed elsewhere.
4335
4336 2005-02-24  Bruno Haible  <bruno@clisp.org>
4337
4338         * gettext.h: Update from GNU gettext 0.14.2.
4339
4340 2005-02-24  Bruno Haible  <bruno@clisp.org>
4341
4342         * localcharset.c: Update from GNU gettext 0.14.2.
4343         * config.charset: Update from GNU gettext 0.14.2.
4344
4345 2005-02-22  Simon Josefsson  <jas@extundo.com>
4346
4347         * iconvme.h, iconvme.c: New files, from libc.
4348
4349 2005-02-20  Neil Conway  <neilc@samurai.com>
4350
4351         * xgethostname.c (xgethostname): Check for ENOMEM, which is
4352         returned by OSX/Darwin if the specified buffer is not large
4353         enough for the hostname.
4354
4355 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4356
4357         * memrchr.h: New file.
4358         * chdir-long.c: Include it.
4359         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>
4360         Don't bother including stddef.h.
4361
4362 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4363
4364         * argp-help.c (__argp_help): Create a fake struct argp_state and
4365         pass it to _help, otherwise the latter coredumps trying to
4366         dereference state.root_argp.
4367
4368 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
4369
4370         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
4371         inclusion.
4372         Include <sys/types.h>, for dev_t.
4373         (ME_DUMMY, ME_REMOTE): Move from here....
4374         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
4375         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
4376         Dmitry V. Levin.
4377         Include mountlist.h first, to test the interface.
4378
4379 2005-01-29  Bruno Haible  <bruno@clisp.org>
4380
4381         * progname.c (program_name): Initialize.
4382         Needed when linking statically on MacOS X.
4383
4384 2005-01-28  Bruno Haible  <bruno@clisp.org>
4385
4386         * javacomp.sh.in: New file, from GNU gettext.
4387         * javacomp.h: New file, from GNU gettext.
4388         * javacomp.c: New file, from GNU gettext.
4389
4390 2005-01-26  Bruno Haible  <bruno@clisp.org>
4391
4392         * javaexec.sh.in: New file, from GNU gettext.
4393         * javaexec.h: New file, from GNU gettext.
4394         * javaexec.c: New file, from GNU gettext.
4395
4396 2005-01-26  Simon Josefsson  <jas@extundo.com>
4397
4398         * gai_strerror.c: Use GPL in header.
4399
4400 2005-01-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4401
4402         * argp-help.c (hol_entry_help): Avoid using non-constant
4403         initializers for struct pentry_state.
4404         (__argp_error): Check return value of __asprintf
4405         (__argp_failure): Translate error message
4406
4407         * argp-parse.c: Removed braces around the expansion of N_()
4408
4409 2005-01-21  Jim Meyering  <jim@meyering.net>
4410
4411         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
4412         same value as for Solaris 9.
4413
4414         * chdir-long.c (chdir_long): Rewrite to remove limitation on
4415         component length.  This included changing the parameter to be
4416         of type `char *' rather than `char const *'.
4417         * chdir-long.h (chdir_long): Update prototype.
4418
4419         * openat.c (fdopendir, fstatat): New functions.
4420         * openat.h: Include headers required for use of DIR and struct stat.
4421         [AT_SYMLINK_NOFOLLOW]: Define.
4422         (fdopendir, fstatat): Add prototypes.
4423
4424 2005-01-21  Bruno Haible  <bruno@clisp.org>
4425
4426         * classpath.h: New file, from GNU gettext.
4427         * classpath.c: New file, from GNU gettext.
4428
4429 2005-01-20  Simon Josefsson  <jas@extundo.com>
4430
4431         * version-etc-fsf.c: New file, with version_etc_copyright.
4432         * version-etc.c: Remove version_etc_copyright.
4433         * version-etc.h (version_etc_copyright): Use [] instead of * in
4434         prototype, suggested by Paul Eggert <eggert@CS.UCLA.EDU>.
4435
4436 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
4437
4438         * save-cwd.c (save_cwd): Remove code to support the case
4439         where fchdir is missing or flaky.
4440
4441 2005-01-20  Simon Josefsson  <jas@extundo.com>
4442
4443         * base64.h (isbase64): Add.
4444
4445         * base64.c (isb64): Rename to isbase64, use to_uchar instead of
4446         using a unsigned prototype, don't inline.
4447         (base64_decode): Use it.
4448
4449 2005-01-19  Bruno Haible  <bruno@clisp.org>
4450
4451         * sh-quote.h: New file, from GNU gettext.
4452         * sh-quote.c: New file, from GNU gettext.
4453
4454 2005-01-18  Paul Eggert  <eggert@cs.ucla.edu>
4455
4456         Merge changes from coreutils, as described below in several
4457         changelogs dated today.
4458
4459         * save-cwd.c: Include "save-cwd.h" before other include files.
4460         (O_DIRECTORY): Remove; not needed here, since "." must be
4461         a directory.  All uses removed.
4462         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
4463         universal on Suns, and we also need to test for IRIX.
4464         Revamp code to use 'if' rather than '#if'.
4465         Avoid unnecessary comparison of cwd->desc to 0.
4466
4467         * utimens.c (futimens): Robustify the previous patch, by checking
4468         for known valid error numbers rather than observed invalid ones.
4469
4470 2005-01-18  Jim Meyering  <jim@meyering.net>
4471
4472         * version-etc.c (version_etc_copyright): Update copyright date.
4473
4474         * utimens.c (futimens): Account for the fact that futimes
4475         can also fail with errno == ENOSYS or errno == ENOENT.
4476         Patch from Dmitry V. Levin.
4477
4478         Change the name of the robust chdir function from chdir to chdir_long.
4479         * save-cwd.c: Include chdir-long.h rather than chdir.h.
4480         (restore_cwd): Use chdir_long, not chdir.
4481         * chdir-long.c: Renamed from chdir.c.
4482         * chdir-long.h: Renamed from chdir.h.
4483         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the
4484         Hurd.
4485
4486 2005-01-18  Bob Proulx  <bob@proulx.com>
4487
4488         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
4489         offsetof() macro construct to avoid compile failure with native HP-UX
4490         11.0 ANSI C compiler.
4491
4492 2005-01-06  Bruno Haible  <bruno@clisp.org>
4493
4494         * stpncpy.c: Remove HAVE_STPNCPY and gnu_stpncpy renaming, redundant
4495         because stpncpy.m4 takes care of it.
4496
4497 2004-01-24  Bruno Haible  <bruno@clisp.org>
4498
4499         * progreloc.c (xstrdup): Define as strdup if no xmalloc should be used.
4500
4501 2003-10-09  Bruno Haible  <bruno@clisp.org>
4502
4503         * progreloc.c: Include xalloc.h instead of xmalloc.h.
4504
4505 2005-01-06  Bruno Haible  <bruno@clisp.org>
4506
4507         * fwriteerror.h (fwriteerror): Change specification to include fclose.
4508         * fwriteerror.c: Include <stdbool.h>.
4509         (fwriteerror): At the end, close the file stream. Record whether
4510         stdout was already closed.
4511
4512 2004-05-27  Bruno Haible  <bruno@clisp.org>
4513
4514         * execute.c (environ): Declare if needed.
4515         * pipe.c (environ): Likewise.
4516         Reported by Michael Schloh von Bennewitz <michael.schloh@cw.com>.
4517
4518 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4519
4520         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
4521         definitions to be after all include files, to avoid collisions.
4522         Problem reported by Bob Proulx.
4523
4524 2004-12-28  Paul Eggert  <eggert@cs.ucla.edu>
4525
4526         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
4527         not needed.  This removes a dependency on the gettext module.
4528         [defined _LIBC]: Do not include <libintl.h>; not needed.
4529
4530 2004-12-24  Paul Eggert  <eggert@cs.ucla.edu>
4531
4532         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
4533         HAVE_DECL_STRTOLD.
4534
4535 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4536
4537         * argp-parse.c: Include <stddef.h>.
4538         (alignof, alignto): New macros.
4539         (parser_init): Don't assume that void * is aligned sufficiently
4540         for struct option.
4541
4542         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
4543         need to extend the stack.
4544         (YYINITDEPTH): New macro, so that the initial stack isn't overly
4545         large.
4546
4547 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4548
4549         * argp-parse.c (parser_init): Avoid arithmetics on void pointers.
4550
4551 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
4552
4553         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
4554         Remove now-obsolete comment about AIX.
4555         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
4556         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
4557         (YYMAXDEPTH): New macro.
4558
4559 2004-12-18  Bruno Haible  <bruno@clisp.org>
4560
4561         * fatal-signal.c (fatal_signals): Make non-const.
4562         (init_fatal_signals): New function.
4563         (uninstall_handlers, install_handlers): Ignore signals that were set to
4564         SIG_IGN.
4565         (at_fatal_signal): Call init_fatal_signals.
4566         (init_fatal_signal_set): Likewise. Ignore signals that were set to
4567         SIG_IGN.
4568         Reported by Paul Eggert.
4569
4570 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
4571
4572         * getdate.y (textint): New member "negative".
4573         (time_zone_hhmm): New function.
4574         Expect 14 shift-reduce conflicts, not 13.
4575         (o_colon_minutes): New rule.
4576         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
4577         (yylex): Set the "negative" member of signed numbers.
4578
4579 2004-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4580
4581         Changes imported from coreutils.
4582         * hard-locale.c: Assume <locale.h> exists.
4583         Include "strdup.h".
4584         (GLIBC_VERSION): New macro.
4585         (hard_locale): Assume setlocale exists.
4586         Rewrite to avoid #ifdef.
4587         Use strdup rather than malloc + strcpy.
4588         * human.c: Assume <locale.h> exists.
4589         (human_readable): Assume localeconv exists.
4590
4591 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4592
4593         * mktime.c (__mktime_internal): If SEC_REQUESTED != SEC,
4594         convert T2, not T.  (Imported from libc.)
4595
4596 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
4597
4598         * getcwd.c (is_ENAMETOOLONG): New macro.
4599         (__getcwd.c): Don't restore errno; glibc doesn't.
4600         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
4601         first, falling back to our code only if its results look suspicious.
4602         Ensure that the resulting buffer is only as large as necessary.
4603
4604         * readutmp.c: Include readutmp.h first.
4605         Include <errno.h>, since readutmp.h no longer does that.
4606         * readutmp.h: Don't include <errno.h>,
4607         <sys/param.h>, <time.h>; not needed to establish interface.
4608         (errno): Remove decl.
4609         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
4610         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
4611         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
4612
4613 2004-11-28  Simon Josefsson  <jas@extundo.com>
4614
4615         * base64.h, base64.c: New file.
4616
4617 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4618
4619         * getcwd.h: New file, which I forgot to check in on 2004-11-25.
4620
4621 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
4622
4623         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
4624         HP's ANSI C compiler.
4625         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
4626         Declaring int functions causes warnings on some modern systems and
4627         shouldn't be needed to compile on ancient ones.
4628         * same.c (MIN) [defined MIN]: Don't define, since it's already
4629         defined.
4630
4631         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
4632         with the following changes.
4633         (__set_errno): Parenthesize properly.
4634         Include <stdbool.h>.
4635         (MIN, MAX, MATCHING_INO): New macros.
4636         (__getcwd): Define with prototype, not K&R form.
4637         Use heuristics to allocate default buffer on stack if possible.
4638         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
4639         behavior, and to avoid the PATH_MAX limit when computing
4640         ../../../../...
4641         Use MATCHING_INO to compare inode number to file.
4642         Check for arithmetic overflow in size calculations.
4643         Fix bug in reallocation of dot array that caused getcwd to fail
4644         on directories nested deeper than 75.
4645         Be more careful about saving errno on error.
4646         Do not use realloc; use only free+malloc, as this is a bit
4647         more flexible and avoids a needless copy operation.
4648         Do not inspect st_dev and st_ino for symbolic links; POSIX
4649         doesn't specify the latter.
4650         Check for closedir errors.
4651         Avoid needless casts.
4652         Use "#ifdef weak_alias" around weak_alias, to be like other
4653         glibc code.
4654         The following changes to getcwd.c have effect only when used in
4655         gnulib; they have no effect inside glibc proper.
4656         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
4657         as alloca isn't used.
4658         (alloca, __alloca): Likewise.
4659         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
4660         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4661         unconditionally, as gnulib assumes C89 or better.
4662         Do not include <sys/param.h>.
4663         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
4664         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
4665         better.
4666         (NULL) [!defined NULL]: Remove; we assume C89 or better.
4667         Include <dirent.h> in a way that is compatible with modern Autoconf.
4668         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
4669         New macros, if not already defined.
4670         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
4671         Use "_LIBC", not "defined _LIBC", for consistency.
4672         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
4673         a mempcpy module.
4674         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
4675         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
4676         * xgetcwd.c: David MacKenzie's old code was removed, so give
4677         credit only to Jim Meyering and adjust the copyright dates.
4678         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
4679         <stdlib.h>, <unistd.h>, "pathmax.h".
4680         Instead, include "xgetcwd.h" (first) and "getcwd.h".
4681         (INITIAL_BUFFER_SIZE): Remove.
4682         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
4683
4684 2004-11-23  Jim Meyering  <jim@meyering.net>
4685
4686         * getopt_.h: Remove trailing blanks.
4687
4688 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
4689
4690         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
4691         (futimens): New function, which uses futimes if available.
4692         (futimens, utimens): Support timespec==NULL, with same semantics
4693         as utime and utimens.
4694         * utimens.h (futimens): New decl.
4695
4696 2004-11-23  Jim Meyering  <jim@meyering.net>
4697
4698         * __fpending.c: Add comment.
4699
4700 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4701
4702         * getopt_.h: Re-addition of __getopt_argv_const caused
4703         redefinition warnings. To avoid them, include the defines
4704         in `#if !defined __need_getopt ... #endif'. The only place
4705         where __getopt_argv_const is used is in definitions
4706         of getopt_long and getopt_long_only below, which are as well
4707         protected by `#ifndef __need_getopt'.
4708         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
4709         __need_getopt after including <stdio.h> and <unistd.h> These
4710         headers might have defined it.
4711
4712 2004-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4713
4714         * getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
4715         New macros.
4716         (getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
4717         optopt): Use them instead of invoking ## directly; otherwise, the
4718         symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
4719
4720 2004-11-19  Bruno Haible  <bruno@clisp.org>
4721
4722         * strtok_r.c: Move comments from here...
4723         * strtok_r.h: ... to here.
4724
4725 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
4726
4727         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
4728         might fail.  Problem reported by Yoann Vandoorselaere.
4729         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
4730         that mishandle size_t overflow.
4731
4732 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4733
4734         * canon-host.c: Include "strdup.h".
4735         (canon_host): Use getaddrinfo if available, so that IPv6 works.
4736         Use strdup instead of malloc/strcpy to duplicate strings.
4737
4738         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
4739         (human_space_before_unit): New constant.
4740         * human.c (human_readable): Support it.
4741
4742         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
4743         (xgetcwd): Set errno correctly when failing.
4744         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
4745         the failure is actually due to a PATH_MAX problem.
4746
4747         Further getopt changes to make it more likely that glibc will
4748         buy the changes back.
4749         * getopt.c (POSIXLY_CORRECT): New constant.
4750         (getopt): Use it, so to preserve glibc semantic
4751         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
4752         when compiling for libc.
4753         * getopt_.h (__getopt_argv_const): Bring it back.
4754         (getopt_long, getopt_long_only): Use it.
4755
4756         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
4757         New arg POSIXLY_CORRECT.  All callers changed.
4758         (getopt): Argv is now char * const *, as per standard.
4759         (_getopt_internal_r, _getopt_internal): Argv is now char **,
4760         not char *__getopt_argv_const *.
4761         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4762         _getopt_long_only_r): Likewise.
4763         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
4764         * getopt_int.h (_getopt_internal, _getopt_internal_r,
4765         _getopt_long_r, _getopt_long_only_r): Likewise.
4766         * getopt_.h (__getopt_argv_const): Remove.
4767         (getopt): Argv is now char * const *, as per standard.
4768
4769         * getdate.y (tORDINAL): New token.
4770         (day, relunit): Allow it for relative times.
4771         (relative_time_table): Use tORDINAL for ordinals.
4772
4773 2004-11-15  Jim Meyering  <jim@meyering.net>
4774
4775         * closeout.c: Include "__fpending.h" once again.
4776         Include <stdbool.h>.
4777         (close_stdout): Don't fail just because stdout was closed initially,
4778         since some programs don't write to stdout in the normal course of
4779         operation (other than --version and --help), and we don't want this
4780         function to make e.g. `touch file >&-' fail.
4781         But do fail if it was closed and someone has tried to write to it.
4782         E.g., `printf foo >&-' must fail.
4783
4784 2004-11-11  Simon Josefsson  <jas@extundo.com>
4785
4786         * strtok_r.h, strtok_r.c: New file.
4787
4788 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
4789
4790         * getopt_.h (__getopt_argv_const): New macro, to be used so that
4791         we can stop lying to compilers about the constness of argv when we
4792         are compiled outside glibc.
4793         (getopt, getopt_long, getopt_long_only): Use it.
4794         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal,
4795         getopt): Likewise.
4796         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
4797         _getopt_long_only_r): Likewise.
4798         * getopt_int.h (_getopt_internal, _getopt_internal_r, _getopt_long_r,
4799         _getopt_long_only_r): Likewise.
4800
4801         * getopt_.h [defined __GETOPT_PREFIX && !defined __need_getopt]:
4802         Include <stdlib.h> and <stdio.h>, and <unistd.h> if available.
4803         Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
4804         the other external symbols.
4805         (getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
4806         declaration, since the above renaming now works around collisions.
4807
4808 2004-11-11  Jim Meyering  <jim@meyering.net>
4809
4810         * linebreak.c: Remove trailing blanks.
4811         * alloca_.h: Likewise.
4812         * acosl.c: Likewise.
4813         * euidaccess.c: Likewise.
4814         * allocsa.h: Likewise.
4815
4816 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
4817
4818         * mktime.c (SHR): New macro, which is a portable
4819         substitute for >> that should work even on Crays.
4820         (TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
4821         Problem reported by Mark D. Baushke in
4822         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
4823         * getdate.y (SHR): Likewise.
4824         (tm_diff): Use it.
4825         * strftime.c (SHR): Likewise.
4826         (tm_diff): Use it.
4827         * quotearg.c (struct quoting_options): Use unsigned int for
4828         quote_these_too, so that right shifts are well defined.  All uses
4829         changed.
4830
4831 2004-11-10  Simon Josefsson  <jas@extundo.com>
4832
4833         * getaddrinfo.h, getaddrinfo.c: New files.
4834
4835 2004-11-10  Jim Meyering  <jim@meyering.net>
4836
4837         Ensure that no close failure goes unreported.
4838         * closeout.c (close_stdout): Always close stdout.  I.e., don't
4839         return early when it seems there's nothing to flush.
4840         Don't include __fpending.h.
4841
4842 2004-11-09  Paul Eggert  <eggert@cs.ucla.edu>
4843
4844         * strftime.c (DO_MULTIBYTE): Check for wchar.h, too.
4845
4846 2004-11-05  Bruno Haible  <bruno@clisp.org>
4847
4848         * readlink.c: Include stddef.h, needed for size_t on Woe32.
4849         Reported by Mark D. Baushke <mdb@cvshome.org>.
4850
4851 2004-11-04  Bruno Haible  <bruno@clisp.org>
4852
4853         2004-09-11  Bruno Haible  <bruno@clisp.org>
4854                 * allocsa.valgrind: New file.
4855         2004-02-06  Bruno Haible  <bruno@clisp.org>
4856                 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to
4857                 avoid a bug of this cc on HP-UX 10.20 dealing with enums.
4858                 Reported by Christopher Seip <chris.seip@hp.com>.
4859
4860 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
4861
4862         * xreadlink.c (xreadlink): AIX and HP-UX readlink return -1
4863         with errno == ERANGE if the buffer is too small.
4864         Problem reported by Mark D. Baushke.
4865
4866 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4867
4868         * xreadlink.c (MAXSIZE): New macro.
4869         (xreadlink): Use it instead of SSIZE_MAX.  Ensure initial buffer
4870         size does not exceed MAXSIZE.  Avoid cast.
4871         As suggested by Mark D. Baushke in
4872         <http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
4873         if readlink fails with buffer size just under MAXSIZE, try again
4874         with MAXSIZE.
4875
4876 2004-11-02  Derek R. Price  <derek@ximbiot.com>
4877         and  Paul Eggert  <eggert@cs.ucla.edu>
4878
4879         * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
4880         (get_date): Overparenthesize to avoid GCC warning.
4881
4882 2004-11-02  Bruno Haible  <bruno@clisp.org>
4883
4884         * setenv.h (unsetenv): Define as a macro if the system's unsetenv()
4885         function returns void.
4886
4887 2004-11-01  Paul Eggert  <eggert@cs.ucla.edu>
4888
4889         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4890         (funlockfile, fputs_unlocked, putc_unlocked): Don't define if
4891         already declared.
4892
4893 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
4894
4895         * getdate.y: Add support for TZ="foo" within a date string.
4896         Fix some bugs near time_t boundaries.  Reject dates with
4897         out-of-range components, e.g., "Sept 31".
4898         Include <stdlib.h>, "setenv.h", "xalloc.h".
4899         (ISDIGIT_LOCALE): Remove; unused.
4900         Note that the TZ and time functions used here are not reentrant.
4901         (mktime_ok, get_tz): New functions.
4902         (TZBUFSIZE): New constant.
4903         (get_date): Parse leading TZ="foo".  Reject out-of-range components;.
4904         This requires that we sometimes generate our own TZ="XXX..." setting.
4905
4906 2004-10-27  Derek R. Price  <derek@ximbiot.com>
4907
4908         * mktime.c (not_equal_tm): Remove redundant check.
4909
4910 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
4911
4912         * getdate.y: Use Bison 1.875 features, and some minor
4913         code cleanups.  This change does not affect semantics.
4914         Don't include <stdlib.h>; no longer needed.
4915         Don't include unlocked-io.h; only the "#if TEST" code uses
4916         stdio, and performance isn't crucial there.
4917         (PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
4918         Bison 1.875 features as described below.
4919         All uses of "PC." replaced by "pc->".
4920         (YYSTYPE): Add a forward declaration.
4921         (yylex, yyerror): Use full prototypes in forward decls.
4922         Use "%pure-parser" rather than obsolescent "%pure_parser".
4923         Use %parse-param and %lex-param instead of obsolescent
4924         YYPARSE_PARAM and YYLEX_PARAM.
4925         (meridian_table, month_and_day_table, time_units_table,
4926         relative_time_table, time_zone_table, military_table,
4927         lookup_zone, lookup_word, get_date):
4928         Use NULL instead of 0 where appropriate.
4929         (to_hour): Avoid abort (), to avoid a dependency on
4930         stdlib.h.
4931         (yyerror, yylex): Now accepts parser_control * arg.
4932         (main) [TEST]: Use '\0' rather than 0 for char.
4933
4934 2004-10-22  Paul Eggert  <eggert@cs.ucla.edu>
4935
4936         * getpagesize.c (getpagesize): Don't assume <sys/param.h> exists.
4937         It's now the caller's responsibility to handle the case where
4938         !HAVE_GETPAGESIZE && !defined getpagesize.
4939
4940         * mktime.c (leapyear): Arg is long int, not int.
4941
4942 2004-10-18  Paul Eggert  <eggert@cs.ucla.edu>
4943
4944         * argp-fs-xinl.c, argp-xinl.c: Update from glibc.
4945
4946 2004-10-12  Simon Josefsson  <jas@extundo.com>
4947
4948         * getpass.c (fflush_unlocked, flockfile, funlockfile)
4949         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
4950         to real functions.
4951
4952 2004-10-11  Yoann Vandoorselaere  <yoann@prelude-ids.org>
4953
4954         * vsnprintf.h: New file.
4955         * vsnprintf.c: New file.
4956
4957 2004-10-07  Bruno Haible  <bruno@clisp.org>
4958
4959         * snprintf.c (snprintf): Avoid a memory allocation if the result fits
4960         into the provided buffer.
4961
4962 2004-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4963
4964         * diacrit.c, diacrit.h: Add GPL notice.
4965
4966         * atanl.c, logl.c: Add GPL notice, to match glibc's added LGPL notice.
4967         * atanl.c (atanl): Keep the code as similar to glibc as possible.
4968         * logl.c (logl): Keep the code as similar to glibc as possible.
4969         This avoids a potential constant-folding bug.
4970
4971 2004-10-05  Bruno Haible  <bruno@clisp.org>
4972
4973         * strsep.h: Don't declare strsep() if HAVE_STRSEP.
4974
4975 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4976
4977         * xalloc.h (xmemdup): Renamed from xclone.  All uses changed.
4978         * xmalloc.c (xmemdup): Likewise.
4979         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
4980         XFREE): Remove these long-obsolescent macros.
4981         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
4982         * xstrdup.c: Remove.
4983
4984         * regex.c (re_comp): Cast gettext return value to char *,
4985         Problem reported by Martin Neitzel via Mark D. Baushke.
4986
4987 2004-10-04  Simon Josefsson  <jas@extundo.com>
4988
4989         * error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
4990         '#ifdef USE_UNLOCKED_IO'.
4991
4992 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4993
4994         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
4995         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
4996         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
4997         regex.c, sha1.c, version-etc.c, yesno.c:
4998         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
4999         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
5000         the includer's responsibility.
5001
5002         Sync from coreutils.
5003
5004         * modechange.c (mode_compile): Don't decrement a pointer that
5005         points to the start of a string, as the C Standard says the
5006         resulting behavior is undefined.
5007
5008         * backupfile.h (enum backuptype): Rename none -> no_backups,
5009         simple -> simple_backups, numbered_existing ->
5010         numbered_existing_backups, numbered -> numbered_backups
5011         to avoid shadowing problems.  All uses changed.
5012         * argmatch.c (enum backuptype) [defined TEST]: Likewise.
5013         * backupfile.c (check_extension, numbered_backup):
5014         Rename locals to avoid shadowing 'basename'.
5015         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
5016         once.
5017
5018         * .cppi-disable: Add getopt_.h, getopt_int.h.
5019         * .cvsignore: Add getopt.h.
5020
5021 2004-10-04  Simon Josefsson  <jas@extundo.com>
5022
5023         * memmem.h: New file.
5024         * memmem.c: New file, taken from glibc.
5025
5026 2004-10-02  Jim Meyering  <jim@meyering.net>
5027
5028         * dirfd.h, getpagesize.h: Add copyright notice.
5029
5030 2004-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5031
5032         * snprintf.c: Remove comments as to why each header is needed.
5033
5034 2004-10-01  Yoann Vandoorselaere <yoann@prelude-ids.org>
5035
5036         * strsep.h: New file.
5037         * strsep.c: New file.
5038
5039 2004-10-01  Simon Josefsson  <jas@extundo.com>
5040
5041         * snprintf.c (snprintf): Handle size==0.
5042
5043 2004-10-01  Simon Josefsson  <jas@extundo.com>
5044             Bruno Haible  <bruno@clisp.org>
5045
5046         * snprintf.c: Include <stdarg.h>, <stdlib.h>, <string.h>.
5047         (snprintf): Declare 'args'.
5048
5049 2004-09-30  Simon Josefsson  <jas@extundo.com>
5050
5051         * snprintf.h, snprintf.c: New files.
5052
5053 2004-09-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5054
5055         * argp-help.c (canon_doc_option): Fixed coredump if *name==NULL
5056         (hol_entry_help): Never translate an empty string.
5057         Do not translate option tag (opt->name) if OPTION_NO_TRANS is set
5058         * argp.h (OPTION_NO_TRANS): New option.
5059
5060 2004-09-29  Oskar Liljeblad  <oskar@osk.mine.nu>
5061
5062         * xvasprintf.c: Include xalloc.h.
5063         (xvasprintf): Use xalloc_die, not xmalloc_die.
5064
5065 2004-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5066
5067         * dummy.c: Change copyright notice to FSF, and license to GPL.
5068
5069 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5070
5071         * argp-pvh.c (argp_program_version_hook): Provide initial value.
5072         Problem reported by Bruno Haible in:
5073         http://lists.gnu.org/archive/html/bug-tar/2004-09/msg00023.html
5074
5075 2004-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5076
5077         * mempcpy.h: Wrap the entire include file inside #ifndef mempcpy,
5078         in case some system header has #define'd it.  Problem reported by
5079         Soeren D. Schulze in
5080         <http://lists.gnu.org/archive/html/bug-gnulib/2004-09/msg00017.html>.
5081
5082 2004-09-08  Bruno Haible  <bruno@clisp.org>
5083
5084         * stdint_.h: New file, taken from GNU clisp.
5085
5086 2004-09-08  Oskar Liljeblad  <oskar@osk.mine.nu>
5087
5088         * xvasprintf.h: New file.
5089         * xvasprintf.c: New file.
5090         * xasprintf.c: New file.
5091
5092 2004-09-08  Bruno Haible  <bruno@clisp.org>
5093
5094         * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
5095         is > INT_MAX.
5096         * vasprintf.c (vasprintf): Don't test for length > INT_MAX any more.
5097
5098 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
5099
5100         Import from coreutils.
5101         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
5102         strings on unbounded length.  alloca's performance benefits aren't
5103         that important here.
5104         (V_STRDUP): Remove.
5105         (parse_with_separator): New function, with most of the internals
5106         of the old parse_user_spec.  Allow user to omit both user and group,
5107         for compatibility with FreeBSD.
5108         Clone only the user name, not the entire spec.
5109         Do not set *uid, *gid unless entirely successful.
5110         Avoid memory leak in some failing cases.
5111         Fix regression for USER.GROUP reported by Dmitry V. Levin in
5112         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
5113         (parse_user_spec): Rewrite to use parse_with_separator.
5114
5115 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5116
5117         * argp-help.c, argp-parse.c: Use "gettext.h" instead of
5118         its complicated substitute.
5119         * argp-help.c: Include <errno.h>, for program_invocation_short_name
5120         and program_invocation_name.
5121         (__argp_basename) [!_LIBC]: Remove; the only use was
5122         replaced by its body.
5123         (__argp_short_program_name): Change condition from
5124         !defined __argp_short_program_name to
5125         ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME),
5126         to match argp-namefrob.h.
5127         (__argp_failure): Don't assume strerror_r returns char *.
5128         * argp-parse.c (N_): Define unconditionally.
5129         (argp_default_options): Fill out initializers with 0 to avoid
5130         gcc warnings.
5131
5132 2004-08-12  Simon Josefsson  <jas@extundo.com>
5133
5134         * getopt.c, getopt1.c: Remove ELIDE_CODE hack.
5135         * getopt_.h: Renamed from getopt.h.
5136
5137 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5138
5139         Merge from coreutils.
5140
5141         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
5142         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
5143         for Reliant Unix 5.43.
5144
5145         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
5146         (union fooround): Use uintmax_t, not long int.
5147         The rest is a merge from libc:
5148         [defined _LIBC]: Include <shlib-compat.h>.
5149         (_obstack) [defined _LIBC]: Remove after 2.3.4.
5150
5151         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
5152
5153         * strverscmp.c: Convert to UTF-8.
5154
5155 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5156
5157         * obstack.h (obstack_empty_p):
5158         Don't assume that chunk->contents is suitably aligned.
5159         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
5160         Likewise. Problem reported by Benno in
5161         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
5162
5163         * chown.c (rpl_chown): Work even if the file is writeable but not
5164         readable.  This could be improved further but it'd take some work.
5165
5166 2004-08-08  Simon Josefsson  <jas@extundo.com>
5167
5168         * xgethostname.c: Don't include error.h (not used).
5169
5170         * getpass.h: Add.
5171         * getpass.c: Include getpass.h first.
5172
5173 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
5174
5175         * xalloc-die.c: New files.
5176         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
5177         All uses removed.
5178         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
5179         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
5180         (_, N_, xalloc_die): Move to xalloc-die.c.
5181         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
5182         so that we needn't mess with xalloc_msg_memory_exhausted.
5183
5184         * sha1.h: Renamed from sha.h.
5185         (SHA1_H): Renamed from _SHA_H.
5186         (sha1_ctx): Renamed from sha_ctx.
5187         (sha1_init_ctx): Renamed from sha_init_ctx.
5188         (sha1_process_block): Renamed from sha_process_block.
5189         (sha1_process_bytes): Renamed from sha_process_bytes.
5190         (sha1_finish_ctx): Renamed from sha_finish_ctx.
5191         (sha1_read_ctx): Renamed from sha_read_ctx.
5192         (sha1_stream): Renamed from sha_stream.
5193         (sha1_buffer): Renamed from sha_buffer.
5194         * sha1.c: Likewise; renamed from sha.c.
5195         Do not include <sys/types.h>.
5196         Include <stddef.h> rather than <stdlib.h>.
5197
5198 2004-08-08  Bruno Haible  <bruno@clisp.org>
5199
5200         * pathname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
5201         FILESYSTEM_PREFIX_LEN.
5202         * progreloc.c: Likewise.
5203         * concatpath.c (concatenated_pathname): Use FILE_SYSTEM_PREFIX_LEN.
5204
5205 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5206
5207         Merge from tar.
5208         * argp-help.c (make_hol, hol_append): Don't assume that
5209         SIZE_MAX is a valid preprocessor constant.
5210         (__argp_basename): Change from "#ifndef _LIBC"
5211         to "#ifndef __argp_short_program_name", so that
5212         we don't compile these functions for tar.
5213
5214         More merges from coreutils.
5215         * raise.c, readtokens0.h, readtokens0.c, strftime.h, utimens.h,
5216         utimens.c, utimecmp.h, utimecmp.c, xnanosleep.h, xnanosleep.c,
5217         yesno.h: New files.
5218         * addext.c: Remove; no longer needed.
5219         * yesno.c, argmatch.h, argmatch.c, backupfile.h, backupfile.c,
5220         euidaccess.c, filemode.c, closeout.c, dup2.c, exclude.c,
5221         fileblocks.c, filemode.c, fnmatch.c, fnmtahc_loop.c,
5222         fopen-safer.c, fsusage.c, fsusage.h, ftruncate.c, full-write.c,
5223         getdate.y, getloadavg.c, getugroups.c, hard-locale.c, hard-locale.h,
5224         hash.c, human.c, human.h, lchown.c, lchown.h, makepath.c, makepath.h,
5225         md5.c, md5.h, memchr.c, memcoll.c, memrchr.c, modechange.c,
5226         modechange.h, mountlist.c, mountlist.h, nanosleep.c, posixtm.c,
5227         putenv.c, quotearg.c, quotearg.h, readtokens.c, readutmp.c,
5228         readutmp.h, rmdir.c, safe-read.c, save-cwd.c, savedir.c, setenv.c,
5229         sig2str.c, stat.c, strtoimax.c, strverscmp.c, userspec.c, utime.c,
5230         version-etc.c., xgethostname.c, xmemcoll.c, xreadlink.c, xstrtod.c,
5231         xstrtod.h, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoumax.c:
5232         Import changes from coreutils.
5233
5234 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
5235
5236         Merge from coreutils.
5237
5238         * .gdb-history: Remove; this doesn't belong here.
5239
5240         * c-strtod.c, c-strtod.h, c-strtold.c, cycle-check.c,
5241         cycle-check.h, dev-ino.h, canonicalize.h, canonicalize.c,
5242         fcntl-safer.h, fcntl-safer.c, getcwd.c: New files.
5243
5244         * dirname.h: Include <stdbool.h>.
5245         (FILE_SYSTEM_PREFIX_LEN): Renamed from FILESYSTEM_PREFIX_LEN,
5246         for consistency with POSIX terminology.  All uses changed.
5247         (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
5248         (strip_trailing_slashes): Use bool for booleans.
5249         * stripslash.c (strip_trailing_slashes): Likewise.
5250
5251         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
5252         sometimes returns a positive errno value even when it succeeds.
5253         (print_errno_message) [!LIBC]: Fall back on strerror if
5254         __strerror_r fails.
5255
5256         * path-concat.c (mempcpy): Don't define if a system header defines it.
5257         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
5258         (longest_relative_suffix): New function.
5259         (path_concat): Use it.  Assume first argument is not NULL.
5260         Port to DOS.  Omit redundant separators.
5261         Report an error instead of returning NULL.
5262         Use mempcpy instead of memcpy.
5263         (xpath_concat): Remove: not declared or used.
5264
5265         * same.h: Include <stdbool.h>
5266         (same_name): Return bool, not int.
5267         * same.c (same_name): Likewise.
5268         (errno): Don't declare; we assume C89 or better now.
5269
5270         * stat-macros (S_ISCTG, S_ISOFD, S_ISOFL): New macros,
5271         if not already defined.
5272
5273         * xgetcwd.c (errno): Don't declare; we assume C89 or better now.
5274         * dup-safer.c (errno): Likewise.
5275
5276 2004-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5277
5278         * fatal.c, fatal.h: Remove as the "fatal" module wasn't used or
5279         working.
5280
5281 2004-08-03  Simon Josefsson  <jas@extundo.com>
5282
5283         * strdup.h: Only use HAVE_DECL_STRDUP if defined.
5284         * progname.h: Don't include stdbool.h.
5285
5286 2004-08-02  Simon Josefsson  <jas@extundo.com>
5287
5288         * getsubopt.h: New file, with comments from Bruno Haible.
5289         * getsubopt.c: New file, from glibc, but slightly modified based on
5290         suggestions from Paul Eggert <eggert@cs.ucla.edu>.
5291
5292 2004-08-01  Simon Josefsson  <jas@extundo.com>
5293
5294         * xgetdomainname.c: Include stdlib.h, for free().
5295
5296 2004-07-16  Simon Josefsson  <jas@extundo.com>
5297
5298         * dummy.c: New file.
5299
5300 2004-07-16  Bruno Haible  <bruno@clisp.org>
5301
5302         * backupfile.h: Add extern "C" for C++.
5303         * closeout.h: Likewise.
5304         * copy-file.h: Likewise.
5305         * findprog.h: Likewise.
5306         * full-write.h: Likewise.
5307         * pathname.h: Likewise.
5308         * progname.h: Likewise.
5309         * stpcpy.h: Likewise.
5310         * stpncpy.h: Likewise.
5311         * strcase.h: Likewise.
5312         * strstr.h: Likewise.
5313         * xalloc.h: Likewise.
5314
5315         * mbswidth.h: Add extern "C" for C++.
5316         Reported by Albert Chin-A-Young <china@thewrittenword.com>.
5317
5318 2004-07-09  Simon Josefsson  <jas@extundo.com>
5319
5320         * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
5321         failed without this.)
5322
5323 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5324
5325         * fchown-stub.c: New file.
5326
5327 2004-06-24  Jim Meyering  <jim@meyering.net>
5328
5329         * obstack.h (obstack_base): Cast to (void *), per documentation.
5330
5331 2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
5332
5333         * argz.c, argz_.h: New files, which are autoupdated from libtool.
5334
5335 2004-06-01  Jim Meyering  <jim@meyering.net>
5336
5337         * calloc.c: New file.
5338
5339 2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5340
5341         * getdate.y (yylex): Allow space between sign and number.
5342         Problem reported by Dan Jacobson.
5343
5344 2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5345         and  Jim Meyering  <jim@meyering.net>
5346
5347         Merge from coreutils CVS.
5348
5349         * stat-macros.h: New file, with contents from file-type.h
5350         and coreutils' system.h.
5351         * file-type.c: Include "stat-macros.h".
5352         * file-type.h (file_type): Move all macro definitions to new file,
5353         stat-macros.h.
5354
5355         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
5356         Wrap old code with this conditional.
5357         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
5358         function that does not dereference symlinks.
5359         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
5360
5361         * xreadlink.c: Include xreadlink.h first, to catch .h file
5362         dependency problems.
5363         (xreadlink): Accept new arg SIZE, for efficiency.
5364         All decls and uses changed.
5365         * xreadlink.h: Include <stddef.h>, for size_t.
5366
5367         * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
5368         gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
5369
5370         * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
5371
5372 2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5373
5374         * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
5375         macros to be defined.
5376         (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
5377         the allocator returns NULL because the requested size is zero.
5378
5379 2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5380
5381         * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
5382         var.  Add comment explaining why libc still defines it.  This
5383         merges the following patch from glibc:
5384         http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
5385
5386 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5387
5388         * obstack.c (_obstack): Remove unused variable.  It hasn't been
5389         present in glibc since revision 1.1 of this file.
5390         * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
5391         obstack_alignment_mask, obstack_alloc, obstack_base,
5392         obstack_blank, obstack_blank_fast, obstack_chunk_size,
5393         obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
5394         obstack_grow0, obstack_init, obstack_int_grow,
5395         obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
5396         obstack_next_free, obstack_object_size, obstack_ptr_grow,
5397         obstack_ptr_grow_fast, obstack_room): Remove declarations of
5398         nonexistent functions.
5399
5400 2004-05-17  Derek R. Price  <derek@ximbiot.com>
5401             Paul Eggert  <eggert@cs.ucla.edu>
5402
5403         * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
5404
5405 2004-05-14  Bruno Haible  <bruno@clisp.org>
5406
5407         * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
5408         that consists of a '.' followed by an empty digit string.
5409         Patch by Tor Lillqvist <tml@iki.fi>.
5410
5411 2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
5412
5413         Port obstack to the AS/400, where pointers are 16 bytes wide and
5414         you cannot cast an integer to a valid pointer.  This patch is
5415         currently waiting to be integrated into glibc; see
5416         <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
5417
5418         * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
5419         All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
5420         (__BPTR_ALIGN, __PTR_ALIGN): New macros.
5421         (struct obstack): temp member is now a union of a pointer and
5422         an integer, instead of an integer.  All integer uses changed.
5423         This does not affect the physical layout of struct obstack,
5424         except on hosts (like the AS/400) where the size or alignment of
5425         void * is greater than that of ptrdiff_t.
5426         (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
5427         __STDC__)]: Store temporary in pointer member of union, not
5428         integer member.
5429         * obstack.c: Include <stddef.h>, for offsetof.
5430         (struct fooalign): Remove; it doesn't need a name.
5431         (union fooround): Change double to long double, and add void *.
5432         (DEFAULT_ALIGNMENT): Use offsetof to compute.
5433         (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
5434         not a macro.  Hence the values are always int; so remove all
5435         casts-to-int in uses.
5436
5437 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5438             Derek Price  <derek@ximbiot.com>
5439
5440         * alloca.c: Include <alloca.h>, to get our interface.
5441         * alloca_.h: Use __alloca on AIX, so that we don't have to
5442         include <alloca.h> first.  Use C89 prototype for alloca; this
5443         requires including <stddef.h> for size_t.  Use extern "C" if C++.
5444         Use #elif for simplicity, since we can assume C89 now.
5445         Don't try to source the system alloca.h since it will not be found
5446         and to prevent recursively including its replacement.
5447         * fnmatch.c: Include <alloca.h> instead of opencoding.
5448         * regex.c: Likewise.
5449
5450 2004-05-16  Derek Price  <derek@ximbiot.com>
5451             Paul Eggert  <eggert@cs.ucla.edu>
5452
5453         getline cleanup.  This changes the getndelim2 API: both order of
5454         arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
5455         no delimiter).
5456
5457         * getline.c: Don't include stddef.h or stdio.h, since our
5458         interface does that.
5459         (getline): Always use getdelim, so that we don't have two
5460         copies of this code.
5461         * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
5462         if available.
5463         (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
5464         (GETNDELIM2_MAXIMUM): New macro.
5465         (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
5466         instead of the old practice of delim2==0.  All callers changed.
5467         Return -1 on overflow, instead of returning junk.
5468         Do not set *linesize unless allocation succeeds.
5469         * getndelim2.h: Do not include stddef.h; no longer needed, now
5470         that we include sys/types.h.
5471         * getnline.h: Likewise.
5472         * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
5473         (getndelim2): Reorder arguments.
5474         * getnline.c (getnline, getndelim):
5475         Don't discard the NMAX argument.
5476         (getnline): Invoke getndelim, to avoid code duplication.
5477         * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
5478         of (size_t) -1 by callers of the getnline family.
5479
5480 2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
5481
5482         * nanosleep.c (suspended): Change its type from int to
5483         sig_atomic_t volatile.
5484         (first_call): Make it private to rpl_nanosleep, and have it
5485         be zero initially as that's a bit faster.
5486         (my_usleep): Round up fractional times instead of truncating them,
5487         as this is the usual meaning for 'sleep'.
5488
5489         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
5490         doesn't work.
5491         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
5492         (ENOSYS): Define if not defined.
5493         (settime): Fall back on stime if it exists and settimeofday fails.
5494         But don't bother with fallbacks if a method fails with errno == EPERM.
5495
5496 2004-05-11  Jim Meyering  <jim@meyering.net>
5497
5498         Prior to this change, the save_cwd caller required read access to the
5499         current directory on most systems (ones with the fchdir function).
5500
5501         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
5502         fails, try write-only, and finally, resort to using xgetcwd.
5503
5504 2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5505
5506         * obstack.c, obstack.h: Import changes from libc.
5507
5508 2004-04-28  Bruno Haible  <bruno@clisp.org>
5509
5510         * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
5511         implicitly appends .exe to executables.
5512         * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
5513         accepts Windows pathnames.
5514         * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5515         Cygwin like Windows, since it now accepts Windows pathnames.
5516         * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
5517         Cygwin like Windows, since it now accepts Windows pathnames.
5518         Reported by Derek Robert Price <derek@ximbiot.com>.
5519
5520 2004-04-20  Jim Meyering  <jim@meyering.net>
5521
5522         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
5523
5524 2004-04-20  Jim Meyering  <jim@meyering.net>
5525             Bruno Haible  <bruno@clisp.org>
5526
5527         * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
5528         memory when realloc fails.
5529
5530 2004-04-18  Jim Meyering  <jim@meyering.net>
5531
5532         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
5533         don't leak memory and do call END_UTMP_ENT.
5534
5535 2004-04-11  Paul Eggert  <eggert@twinsun.com>
5536
5537         * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
5538         (CHAR_BIT): Remove, since we assume C89.
5539         Include <stdint.h> if available, as per current Autoconf CVS advice.
5540
5541 2004-03-30  Paul Eggert  <eggert@twinsun.com>
5542
5543         * cloexec.h, cloexec.c (set_cloexec_flag): Return int
5544         not bool, to be more consistent with Unix conventions.
5545         Suggested by Bruno Haible.
5546
5547         Merge from coreutils.
5548
5549         * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
5550         New files.
5551
5552         * getdate.h: Include stdbool.h, and timespec.h instead of
5553         the usual <time.h> dance.
5554         (get_date): Change signature to support fractional time stamps.
5555         All callers changed.
5556         * getdate.y: Include "getdate.h" first, as we can now
5557         assume C89 and don't need to worry about 'const'.
5558         Similarly, include "unlocked-io.h" near start, not in middle.
5559         Include <limits.h>.
5560         (textint.value): Use long int rather than int.
5561         (textint.digits): Use size_t rather than int.
5562         (BILLION, LOG10_BILLION): New constants.
5563         (parser_control): New member rel_ns.  Members day_ordinal,
5564         time_zone, month, day, hour, minutes, rel_year, rel_month,
5565         rel_day, rel_hour, rel_minutes, rel_seconds
5566         are now long int, not int.  Member seconds is now struct timespec,
5567         not int.  New member timespec_seen.  Members dates_seen, days_seen,
5568         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
5569         not int.
5570         (%union.intval): Now long int, not int.
5571         New member timespec.
5572         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
5573         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
5574         (spec): Now is a timespec or an item list.
5575         (timespec, items): New nonterminals.
5576         (time, rel, relunit, number, get_date):
5577         Add support for fractional seconds.
5578         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
5579         (gmtime, localtime, mktime): Remove decls; not needed with C89.
5580         (to_hour): First arg is now long int, not int.
5581         (to_year): Returns long int, not int.
5582         Don't treat year -70 like 70.
5583         (tm_diff): Returns long int, not int.
5584         (lookup_word): Use bool instead of int when appropriate.
5585         (yylex): Use size_t for count, not int.
5586         Detect overflow when parsing large integer constants.
5587         Add support for fractions.
5588         (get_date): Make pointers 'const' if possible.
5589         Use more-portable code to detect integer overflow.
5590         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
5591         Don't use ctime; it's not reliable if the year has >4 digits.
5592
5593         * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
5594         This is for compatibility with BSD.
5595
5596         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
5597         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5598         From coreutils' system.h.
5599
5600         * userspec.c: Don't include "posixver.h".
5601         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
5602         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
5603         compatible extension.  Simplify code by removing a boolean int
5604         that was always nonzero if a string was nonnull.
5605
5606 2004-03-30  Jim Meyering  <jim@meyering.net>
5607
5608         Merge from coreutils.
5609
5610         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
5611
5612         * readtokens.c (readtoken): Don't leak 64 bytes when reading
5613         an empty input stream.
5614
5615         * readtokens.c: Include <stdbool.h>.
5616         (readtoken): Use `size_t' rather than int/long.
5617         All callers adjusted.
5618         Use `bool' rather than `int' where appropriate.
5619         Use memset rather than an explicit loop.
5620         Use x2nrealloc rather than xrealloc.
5621         Allow the use of `\0' as a delimiter.
5622         (readtokens): Likewise.
5623         * readtokens.h (readtoken, readtokens): Update prototypes.
5624
5625 2004-03-30  Bruno Haible  <bruno@clisp.org>
5626
5627         * getloadavg.c (getloadavg): Don't assume setlocale returns
5628         nonnull.
5629
5630 2004-03-29  Paul Eggert  <eggert@twinsun.com>
5631
5632         Merge changes to getloadavg.c from coreutils and Emacs.
5633
5634         * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
5635         Define to an expression, not to the empty string.
5636         Include cloexec.h and xalloc.h.
5637         (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
5638         Use set_cloexec_flag rather than rolling our own.
5639         * cloexec.c, cloexec.h: New files.
5640
5641 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5642
5643         * getopt.h: Sync with libc CVS.
5644
5645 2004-03-18  Paul Eggert  <eggert@twinsun.com>
5646             Bruno Haible  <bruno@clisp.org>
5647
5648         * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
5649         not on all platforms that have <wchar.h>.
5650         * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
5651
5652 2004-03-09  Paul Eggert  <eggert@twinsun.com>
5653
5654         * argp-parse.c, getopt.c, getopt.h, getopt1.c:
5655         Sync with libc CVS.
5656         * getopt_int.h: New file, also synced from libc.
5657
5658 2004-03-07  Paul Eggert  <eggert@twinsun.com>
5659
5660         * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
5661         '#if' expressions.  Unlike the code it replaces, it does not
5662         depend on (defined _SC_PAGESIZE).  However, it does depend on
5663         HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
5664         first reported by Jason Andrade in
5665         <http://mail.gnu.org/archive/html/bug-textutils/2003-03/msg00027.html>.
5666
5667 2004-01-18  Simon Josefsson  <jas@extundo.com>
5668
5669         * strdup.h: New file.
5670         * strdup.c: Include it.
5671         * path-concat.c: Include strdup.h. Drop strdup declaration.
5672         * userspec.c: Include strdup.h. Drop strdup declaration.
5673
5674 2004-02-06  Karl Berry  <karl@gnu.org>
5675
5676         * config.charset: update from gettext 0.14.1.
5677
5678 2004-02-05  Paul Eggert  <eggert@twinsun.com>
5679
5680         Add comments and code, prompted by suggestions from Bruno Haible
5681         for sh-quote.
5682         * quotearg.h (quotearg_alloc): New decl.  Improve the comments
5683         describing the enum quoting_style values.
5684         * quotearg.c (quotearg_alloc): New function.
5685         (quotearg_buffer_restyled): Treat lone { and } as special.
5686         Treat = as special.  Work around bug with older shells
5687         that "see" a '\' that is really the 2nd byte of a multibyte char.
5688         Quote empty string with shell_quoting_style.
5689
5690 2004-02-03  Bruno Haible  <bruno@clisp.org>
5691
5692         * pipe.h: New file, from GNU gettext.
5693         * pipe.c: New file, from GNU gettext.
5694
5695 2004-01-27  Bruno Haible  <bruno@clisp.org>
5696
5697         * execute.h: New file, from GNU gettext.
5698         * execute.c: New file, from GNU gettext.
5699         * w32spawn.h: New file, from GNU gettext.
5700
5701 2004-01-23  Paul Eggert  <eggert@twinsun.com>
5702
5703         Exit-status fix from coreutils.
5704
5705         Use exit_failure consistently in place of EXIT_FAILURE,
5706         so that program exit statuses are consistent on failure.
5707
5708         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
5709         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
5710         * argmatch.h: Comment fix to match the above.
5711         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
5712         Now a macro referring to exit_failure, instead of a separate
5713         variable.  Include "exitfail.h" to get it.
5714         * xstrtol.h: Include "exitfail.h".
5715         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
5716
5717         * long-options.c (parse_long_options): Use prototype
5718         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
5719         for clarity.
5720
5721 2004-01-21  Jim Meyering  <jim@meyering.net>
5722
5723         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
5724         so as not to conflict with a different-sized __mktime_internal
5725         function in GNU libc.
5726         * timegm.c (__mktime_internal) [!_LIBC]: Likewise.
5727         Problem building statically-linked `ls' reported by Michael Brunnbauer.
5728
5729 2004-01-18  Paul Eggert  <eggert@twinsun.com>
5730
5731         Merge from diffutils.
5732
5733         * file-type.c (file_type): Add typed memory objects.
5734         * file-type.h (S_TYPEISTMO): New macro.
5735
5736         * c-stack.h (c_stack_action): Remove argv argument.
5737         * c-stack.c (c_stack_action): Likewise.  All uses changed.
5738         (die): Don't calculate message unless segv_action returns.
5739         (get_stack_location, min_address_from_argv, max_address_from_argv,
5740         volatile stack_base, volatile_stack_size): Remove.
5741         (segv_handler): If ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC, assume
5742         that every segmentation violation is a stack overflow.  (Ouch!)
5743         See Debian bug 136249 (still outstanding) for more info about why
5744         HAVE_XSI_STACK_OVERFLOW_HEURISTIC fails on Linux kernels.
5745
5746 2003-11-30  Bruno Haible  <bruno@clisp.org>
5747
5748         Safer stack allocation.
5749         * setenv.c: Include allocsa.h.
5750         (alloca): Remove fallback definition.
5751         (freea): Remove macro.
5752         (__add_to_environ) [!_LIBC]: Use allocsa instead of alloca. Use freesa
5753         instead of freea.
5754
5755 2003-10-17  Bruno Haible  <bruno@clisp.org>
5756
5757         * binary-io.h: Avoid warnings on Cygwin.
5758
5759 2003-12-28  Bruno Haible  <bruno@clisp.org>
5760
5761         * wait-process.c (wait_subprocess): Add ignore_sigpipe argument.
5762         * wait-process.c (wait_subprocess): Likewise. Handle SIGPIPE specially.
5763
5764 2003-11-28  Bruno Haible  <bruno@clisp.org>
5765
5766         * wait-process.c (cleanup_slaves): Use ANSI C declaration.
5767
5768 2003-11-27  Bruno Haible  <bruno@clisp.org>
5769
5770         * wait-process.c: On Windows, include windows.h. Needed on mingw.
5771
5772 2003-11-17  Bruno Haible  <bruno@clisp.org>
5773
5774         * wait-process.c (wait_process): Disable the 2003-10-31 waitid() patch.
5775
5776 2003-11-24  Bruno Haible  <bruno@clisp.org>
5777
5778         * xallocsa.h: New file, from GNU gettext.
5779         * xallocsa.c: New file, from GNU gettext.
5780
5781 2003-11-24  Bruno Haible  <bruno@clisp.org>
5782
5783         * allocsa.h: New file, from GNU gettext.
5784         * allocsa.c: New file, from GNU gettext.
5785
5786 2003-11-24  Bruno Haible  <bruno@clisp.org>
5787
5788         * eealloc.h: New file.
5789
5790 2004-01-15  Jim Meyering  <jim@meyering.net>
5791
5792         Merge from coreutils.
5793
5794         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
5795         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
5796         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
5797
5798         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
5799         optional configure-time default.
5800
5801         * version-etc.c (version_etc_copyright): Update copyright date.
5802
5803         * xreadlink.c (xreadlink): Correct outdated comment.
5804
5805 2004-01-15  Paul Eggert  <eggert@twinsun.com>
5806
5807         Merge from coreutils.
5808
5809         * posixver.c: Include posixver.h.
5810
5811         * same.c: Include <stdbool.h>, <limits.h>.
5812         (_POSIX_NAME_MAX): Define if not defined.
5813         (MIN): New macro.
5814         (same_name): If file names are silently truncated, report
5815         that the file names are the same if they are the same after
5816         the silent truncation.
5817
5818         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
5819         conversion function.
5820         * xstrtod.c (xstrtod): Likewise.  All callers changed to
5821         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
5822         longer needed.
5823
5824 2004-01-14  Paul Eggert  <eggert@twinsun.com>
5825
5826         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
5827         with like-named macro in fnmatch.c.
5828         (EXT): Use an internal constant instead.
5829
5830         Merge fnmatch patches from glibc.
5831         * fnmatch.c (mbsinit): Remove define.
5832         Add libc_hidden_ver (__fnmatch, fnmatch).
5833         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
5834         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
5835
5836 2003-12-14  Karl Berry  <karl@gnu.org>
5837
5838         * config.charset: update from gettext-runtime.
5839
5840 2003-12-03  Paul Eggert  <eggert@twinsun.com>
5841
5842         * getgroups.c (getgroups): xmalloc takes one argument, not two.
5843         Bug reported by Alfred M. Szmidt.
5844
5845 2003-11-29  Karl Berry  <karl@gnu.org>
5846
5847         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
5848
5849 2003-11-23  Paul Eggert  <eggert@twinsun.com>
5850             Bruno Haible  <bruno@clisp.org>
5851
5852         * printf-parse.h: Don't include sys/types.h.
5853         (ARG_NONE): New macro.
5854         (char_directive): Change type of *arg_index fields to size_t.
5855         * printf-parse.c: Don't include sys/types.h.
5856         (SSIZE_MAX): Remove macro.
5857         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
5858         Remove unnecessary overflow check.
5859         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
5860         fields.
5861
5862 2003-11-24  Paul Eggert  <eggert@twinsun.com>
5863
5864         * alloca.c: Remove dependency on xalloc module.
5865         (xalloc_die): Remove.
5866         (memory_full) [!defined emacs]: New macro.
5867         [!defined emacs]: Don't include xalloc.h.
5868         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
5869         address arithmetic overflows.  Change datatypes a bit to avoid
5870         unnecessary casts.
5871
5872 2003-11-22  Jim Meyering  <jim@meyering.net>
5873
5874         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
5875
5876 2003-11-17  Bruno Haible  <bruno@clisp.org>
5877
5878         * vasnprintf.c (alloca): Remove fallback definition.
5879         (freea): Remove definition.
5880         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
5881         Reported by Paul Eggert.
5882
5883 2003-11-17  Jim Meyering  <jim@meyering.net>
5884
5885         On systems without utime and without a utimes function capable of
5886         dealing with a NULL struct utimbuf* argument, this utime replacement
5887         could -- in unusual circumstances -- leak a file descriptor.
5888         * utime.c: Include <unistd.h> and <errno.h>.
5889         (utime_null): Be sure to close `fd' and to preserve errno.
5890         Reported by Geoff Collyer via Arnold Robbins.
5891
5892 2003-11-16  Paul Eggert  <eggert@twinsun.com>
5893             Bruno Haible  <bruno@clisp.org>
5894
5895         Protect against address arithmetic overflow.
5896         * printf-args.h: Include stddef.h.
5897         (arguments): Change type of field 'count' to size_t.
5898         * printf-args.c (printf_fetchargs): Use size_t instead of
5899         'unsigned int' where appropriate.
5900         * printf-parse.h: Include sys/types.h.
5901         (char_directive): Change type of *arg_index fields to ssize_t.
5902         (char_directives): Change type of fields 'count', max_*_length to
5903         size_t.
5904         * printf-parse.c: Include sys/types.h and xsize.h.
5905         (SSIZE_MAX): Define fallback value.
5906         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
5907         instead of 'int' where appropriate. Check a_allocated, d_allocated
5908         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
5909         * vasnprintf.c: Include xsize.h.
5910         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
5911         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
5912         overflow. Avoid wraparound when converting a width or precision from
5913         decimal to binary.
5914
5915 2003-11-16  Bruno Haible  <bruno@clisp.org>
5916
5917         Update from GNU gettext.
5918         * printf-parse.c: Generalize to it can be compiled for wide strings.
5919         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
5920         * vasnprintf.c: Generalize to it can be compiled for wide strings.
5921         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
5922         SNPRINTF): New macros.
5923         Don't include <alloca.h> if the file is used inside libintl.
5924         (local_wcslen): New function, for Solaris 2.5.1.
5925         (VASNPRINTF): Use it instead of wcslen.
5926
5927 2003-11-16  Bruno Haible  <bruno@clisp.org>
5928
5929         * xsize.h (xmax): New function.
5930         (xsum, xsum3, xsum4): Declare as "pure" functions.
5931
5932 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5933
5934         * xalloc.h: Do not include <limits.h> or <stdint.h>.
5935         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
5936         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
5937         heuristic is just as accurate as far as we know, and it removes a
5938         dependency on size_max.m4 and ptrdiff_max.m4.
5939
5940 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5941
5942         * xstrtol.c (__xstrtol): Remove "break" immediately after
5943         "return", to pacify some unknown compiler.  Problem reported
5944         by Joerg Schilling.
5945
5946 2003-11-11  Bruno Haible  <bruno@clisp.org>
5947
5948         * xsize.h (SIZE_MAX): Remove fallback definition.
5949         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
5950         defined.
5951
5952 2003-11-10  Paul Eggert  <eggert@twinsun.com>
5953
5954         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
5955         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
5956         rejected some allocations of exactly SIZE_MAX - 2 bytes.
5957         From Bruno Haible.
5958         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
5959         not (size_t) -1, since it's defined here.
5960
5961 2003-11-06  Paul Eggert  <eggert@twinsun.com>
5962
5963         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
5964         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
5965         Reject sizes of exactly SIZE_MAX bytes.
5966         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
5967         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
5968
5969 2003-11-05  Bruno Haible  <bruno@clisp.org>
5970
5971         * xsize.h: Include limits.h, to avoid a possible collision with
5972         SIZE_MAX defined in <limits.h> on Solaris.
5973
5974 2003-11-04  Bruno Haible  <bruno@clisp.org>
5975
5976         * xsize.h: New file.
5977         * linebreak.c: Include xsize.h.
5978         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
5979         argument for overflow.
5980         Suggested by Paul Eggert.
5981
5982 2003-10-31  Bruno Haible  <bruno@clisp.org>
5983
5984         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
5985         to avoid (extremely rare) race condition.
5986         Suggested by Paul Eggert.
5987
5988 2003-11-03  Jim Meyering  <jim@meyering.net>
5989
5990         * userspec.c: Include "userspec.h".
5991         * userspec.h: New file.
5992
5993 2003-10-31  Paul Eggert  <eggert@twinsun.com>
5994
5995         * mountlist.h (struct mount_entry.me_type_malloced): New member.
5996         * mountlist.c (SIZE_MAX): Define if not defined already.
5997         (read_filesystem_list): Set and use me_type_malloced.
5998         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
5999         whatever the type happens to be), for brevity and consistency.
6000         Check for size calculation overflow on Alphas running OSF/1.
6001
6002 2003-10-31  Jim Meyering  <jim@meyering.net>
6003
6004         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
6005
6006         * linebuffer.c: Include <string.h> for declaration of memset.
6007
6008 2003-10-30  Paul Eggert  <eggert@twinsun.com>
6009             Bruno Haible  <bruno@clisp.org>
6010
6011         * vasprintf.c: Include <limits.h>, <stdlib.h>.
6012         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
6013
6014 2003-10-29  Paul Eggert  <eggert@twinsun.com>
6015
6016         * xalloc.h (xalloc_oversized): Now a macro, not a function,
6017         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
6018         no longer needed.
6019         * quotearg.c (quotearg_n_options): Use it.
6020         * group-member.c: Include <stdbool.h>.
6021         (free_group_info): Arg is now const *; don't free arg.
6022         (get_group_info): Now returns bool and accepts struct group_info *,
6023         rather than returning a malloc'ed struct group_info *.
6024         All uses changed.  Check for overflow in internal size calculation.
6025
6026         * getusershell.c (readname): Simplify the code by using x2nrealloc
6027         rather than xmalloc/xrealloc.
6028         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
6029         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
6030         conformance bug: the old code used a pointer after freeing the
6031         storage that it addressed.
6032         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
6033         rather than doing it by hand.
6034         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
6035         the buffer preserved.  Use free and xmalloc instead.
6036         * quotearg.c (quotearg_n_options): Likewise.
6037         Use a simpler test for size overflow.  Don't use xalloc_oversized
6038         because unsigned int might be wider than size_t (!); this suggests
6039         that we should switch from unsigned int to size_t for slot numbers.
6040
6041 2003-10-27  Bruno Haible  <bruno@clisp.org>
6042
6043         * stdbool_.h: Better support for BeOS.
6044
6045 2003-10-27  Paul Eggert  <eggert@twinsun.com>
6046
6047         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
6048         to allocate the returned structure.  Do not allocate a subarray,
6049         as x2nrealloc will do that.
6050         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
6051         instead of xnrealloc.
6052         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
6053
6054 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6055
6056         * xalloc.h (xalloc_oversized): New static inline function, for
6057         callers that want to do their own size-overflow checking.  Include
6058         <stdbool.h>, since xalloc_oversized returns bool.
6059         * xalloc.c (array_size_overflow): Remove.  All callers changed
6060         to use xalloc_oversized.
6061
6062         Add two functions x2realloc, x2nrealloc, for programs that grow
6063         arrays dynamically by doubling their sizes.
6064         * xalloc.h (x2realloc, x2nrealloc): New decls.
6065         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
6066         New functions.
6067
6068         Port to C99 semantics for 'inline' of external functions.
6069         Bug reported by Bruno Haible.
6070         * xmalloc.c (xnmalloc_inline): New static inline function,
6071         with the old contents of xnmalloc.
6072         (xnmalloc, xmalloc): Use it.
6073         (xnrealloc_inline): New static inline function,
6074         with the old contents of xnrealloc.
6075         (xnrealloc, xrealloc): Use it.
6076
6077         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
6078
6079 2003-10-25  Paul Eggert  <eggert@twinsun.com>
6080
6081         Fix several address-calculation bugs in the hash modules,
6082         plus some minor code cleanup.
6083
6084         * hash.h: Include <stdbool.h>, for bool.
6085         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
6086         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
6087         hash_get_n_entries, hash_get_max_bucket_length,
6088         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
6089         hash_rehash): Use size_t rather than unsigned.
6090         * hash.c (struct hash_table, hash_get_n_buckets,
6091         hash_get_n_buckets_used, hash_get_n_entries,
6092         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
6093         hash_get_entries, hash_do_for_each, hash_string, is_prime,
6094         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
6095         Likewise.
6096         (SIZE_MAX): Define if not defined.
6097         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
6098         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
6099         hash_print):
6100         Use const * when possible.
6101         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
6102         (check_tuning): Fix bug: if tuning parameters were very close to
6103         0 or 1, rounding errors could have caused subscript violations.
6104         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
6105         (hash_initialize): Add 'fail:' label
6106         to free table and return NULL, and use it to simplify code.
6107         Use calloc rather than clearing the storage ourself.
6108         (hash_initialize, hash_rehash): Check for arithmetic overflow in
6109         buffer size calculations.
6110         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
6111         Include <stddef.h>, for size_t.
6112         * hash-pjw.c (hash_pjw): Likewise.
6113         Switch to method described by Bruno Haible.
6114         Include <limits.h>, for CHAR_BIT.
6115         (SIZE_BITS): New macro.
6116
6117 2003-10-21  Paul Eggert  <eggert@twinsun.com>
6118
6119         * getndelim2.c (getndelim2): When size calculation overflows,
6120         ceiling the allocation at NMAX bytes rather than silently
6121         discarding input bytes before NMAX is reached.  This makes
6122         a difference only if NMAX exceeds SIZE_MAX / 2.
6123
6124         * obstack.c: Merge from glibc.
6125         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
6126         Add libc_hidden_def (_obstack_newchunk).
6127         (_obstack_free) [! defined _LIBC]: Remove.
6128         [defined _LIBC]: Make a strong alias from obstack_free, rather than
6129         a clone of the function body.
6130         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
6131         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
6132
6133         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
6134         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
6135         arg to memcpy.
6136
6137         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
6138         (obstack_ptr_grow_fast, obstack_int_grow_fast):
6139         Don't use lvalue casts, as GCC plans to remove support for them
6140         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
6141         was also present in the non-GCC version, indicating that this
6142         code had always been buggy and had never been widely used.
6143         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
6144         Use the fast variant of each macro, rather than copying the
6145         definiens of the fast variant; that way, we'll be more likely to
6146         catch future bugs in the fast variants.
6147
6148 2003-10-20  Bruno Haible  <bruno@clisp.org>
6149
6150         * wait-process.h: New file, from GNU gettext.
6151         * wait-process.c: New file, from GNU gettext.
6152
6153 2003-10-19  Jim Meyering  <jim@meyering.net>
6154
6155         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
6156
6157 2003-10-16  Paul Eggert  <eggert@twinsun.com>
6158
6159         * getgroups.c: Include <errno.h>, <stdlib.h>.
6160         (getgroups): First arg is int, not size_t.
6161         Don't let 'free' mangle errno.
6162
6163 2003-10-16  Jim Meyering  <jim@meyering.net>
6164
6165         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
6166
6167 2003-10-15  Paul Eggert  <eggert@twinsun.com>
6168
6169         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
6170         (SIZE_MAX): Remove.
6171         (new_exclude, add_exclude_file): Initial size no longer needs to
6172         be a power of 2.
6173         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
6174         our own address arithmetic overflow checking.
6175
6176         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
6177         (fnmatch): Do not alloca more than 2000 wide characters;
6178         instead, use malloc for large buffers.
6179         Check for address arithmetic overflow, and return -1
6180         with errno set to ENOMEM in that case.
6181         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
6182         (NEW_PATTERN): Do not alloca more than 8000 bytes;
6183         instead, return -1.  Check for address arithmetic overflow.
6184
6185 2003-10-14  Paul Eggert  <eggert@twinsun.com>
6186
6187         Handle invalid suffixes and overflow independently, so that
6188         callers can treat them independently as needed.  Fix some bugs in
6189         suffix handling, e.g., "100k@" was not diagnosed as an invalid
6190         suffix for a human-readable blocksize.  The major caller-visible
6191         change is the addition of a new
6192         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
6193         that both overflow and suffix chars were found.
6194
6195         * human.c (humblock): Don't check separately for invalid suffix
6196         char; that is xstrtoumax's job (now that its bug is fixed).
6197         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
6198         INTMAX_MAX]: New macros.
6199         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
6200         TYPE_MAXIMUM): New macros.
6201         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
6202         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
6203         if overflow occurs, as it's what __strtol does and it's more useful
6204         in practice.
6205         (__xstrtol): If __strtol reports some error other than ERANGE,
6206         reflect it to the caller as LONGINT_INVALID.  If it reports
6207         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
6208         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
6209         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
6210         value.
6211         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
6212         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
6213         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
6214         [defined UINTMAX_MAX]: New macros.
6215
6216 2003-10-14  Bruno Haible  <bruno@clisp.org>
6217
6218         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
6219         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
6220         Also use volatile where needed.
6221
6222 2003-10-12  Paul Eggert  <eggert@twinsun.com>
6223
6224         * xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
6225         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
6226         and define in terms of the other primitives.
6227         * xmalloc.c: Include stdbool.h; do not include exit.h.
6228         (SIZE_MAX): Define if not already defined.
6229         (array_size_overflow): New function.
6230         (xalloc_die): Abort instead of exiting if 'error' returns.
6231         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
6232         (xmalloc, xrealloc): Use them.
6233         (xcalloc): Check for address arithmetic overflow.
6234         * xstrdup.c (xstrdup): Use xclone, since memcpy should be
6235         a bit faster than strcpy.
6236
6237 2003-10-08  Paul Eggert  <eggert@twinsun.com>
6238
6239         Merge getpass from libc, plus a few fixes.
6240
6241         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
6242         Include <stdbool.h>.
6243         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
6244         __fsetlocking to empty.
6245         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
6246         do include <bits/libc-lock.h>.
6247         Do not include <fcntl.h>; not needed.
6248         [_LIBC]: Include <wchar.h>.
6249         (NOTCANCEL_MODE): New macro.
6250         (flockfile, funlockfile) [_LIBC]: New macros.
6251         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
6252         [!_LIBC]: New macros.
6253         (call_fclose): New function.
6254         (getpass): Use it.  Save tty stream separately; this simplifies the
6255         code and makes it more reliable if stdin happens to equal stdout.
6256         Invoke __fsetlocking on tty.
6257         Handle thread cancellation if needed.
6258         Namespace cleanup (use __tcgetattr, __getline).
6259         Use bool for Booleans.
6260         [USE_IN_LIBIO]: Handle wide streams.
6261         [!_LIBC]: Unconditionally do the fseek, since we don't know what
6262         stream might go where.
6263
6264         * unlocked-io.h: Include <stdio.h>, so that the caller
6265         doesn't have to include <stdio.h> before us.
6266         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
6267         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
6268         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
6269         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
6270         if not declared, so that we can use getpass.c code from libc without
6271         rewriting it.
6272         (flockfile, ftrylockfile, funlockfile): New macros.
6273
6274 2003-10-06  Bruno Haible  <bruno@clisp.org>
6275
6276         * version-etc-2.h: Remove file.
6277         * version-etc-2.c: Remove file.
6278
6279 2003-09-25  Jim Meyering  <jim@meyering.net>
6280             Bruno Haible  <bruno@clisp.org>
6281
6282         This lets translators provide better translations for the
6283         "Written by ..." part of --version output.
6284         * version-etc.h: Include stdarg.h.
6285         (version_etc_copyright): Declare as readonly.
6286         (version_etc): Make this function variadic with a NULL-terminated list
6287         of author name strings.
6288         (version_etc_va): New declaration.
6289         * version-etc.c: Include stdarg.h, stdlib.h.
6290         (version_etc_copyright): Declare as readonly.
6291         (version_etc_va): New function. Provide a different translatable string
6292         for each possible number of authors < 10. Abbreviate when there are 10
6293         authors or more.
6294         (version_etc): Make this function variadic. Call version_etc_va.
6295         Suggestion from Gary V. Vaughan.
6296
6297         * long-options.h (parse_long_options): Change prototype: the authors
6298         string is moved to the end and becomes variadic.
6299         * long-options.c: Include stdarg.h.
6300         (parse_long_options): Make this function variadic, too.
6301         Call version_etc_va, not version_etc.
6302
6303 2003-10-06  Bruno Haible  <bruno@clisp.org>
6304
6305         * fatal-signal.h: New file, from GNU gettext.
6306         * fatal-signal.c: New file, from GNU gettext.
6307
6308 2003-10-04  Karl Berry  <karl@gnu.org>
6309
6310         * argp*: update from libc.
6311
6312 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
6313
6314         * getpass.c (getpass): Use a no-op fseek when switching from input to
6315         output mode on the same stream.
6316
6317 2003-09-29  Paul Eggert  <eggert@twinsun.com>
6318
6319         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
6320         Fix arg typo in previous patch.
6321
6322 2003-09-28  Jim Meyering  <jim@meyering.net>
6323
6324         * error.c: Correct cpp indentation.
6325
6326 2003-09-27  Paul Eggert  <eggert@twinsun.com>
6327
6328         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
6329         Omit the special code that used __typeof__, since we worry that
6330         it could be more trouble than it's worth.  See:
6331         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
6332         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
6333
6334         * free.c: New file.
6335
6336 2003-09-26  Jim Meyering  <jim@meyering.net>
6337
6338         * error.c (error_tail): Move some declarations
6339         into inner scope where the local variables are used.
6340
6341 2003-09-26  Bruno Haible  <bruno@clisp.org>
6342
6343         * stpncpy.h (gnu_stpncpy): New declaration.
6344         (stpncpy): Define as alias for gnu_stpncpy.
6345         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
6346
6347 2003-09-26  Paul Eggert  <eggert@twinsun.com>
6348
6349         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
6350         (error_tail): Do not loop, reallocating temporary buffer, since
6351         the output cannot contain more wide characters than the input
6352         contains bytes, the size must be big enough already.  This avoids
6353         one potential size overflow calculation.  Check for size overflow
6354         when calculating temporary buffer size.  Free temporary buffer
6355         when done, if it was allocated with malloc; this plugs a memory
6356         leak.  Remove casts from void * to pointers, that are no longer
6357         needed now that we're assuming C89 or better.
6358
6359         Merge error changes from glibc.
6360
6361         * error.c, error.h: Update copyright notice header to match glibc.
6362         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
6363         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
6364         Disable cancellation while printing error.
6365         * error.h: Prepend __ to parameter names.
6366
6367 2003-09-25  Karl Berry  <karl@gnu.org>
6368
6369         * argp-fmtstream.c, argp-help.c: update from libc.
6370
6371 2003-09-25  Bruno Haible  <bruno@clisp.org>
6372
6373         * version-etc-2.h: New file, from version-etc.h with modifications.
6374         * version-etc-2.c: New file, from version-etc.c with modifications.
6375
6376 2003-09-25  Simon Josefsson  <jas@extundo.com>
6377
6378         * xgetdomainname.h: New file.
6379         * xgetdomainname.c: New file.
6380
6381 2003-09-25  Simon Josefsson  <jas@extundo.com>
6382             Bruno Haible  <bruno@clisp.org>
6383
6384         * getdomainname.h: New file.
6385         * getdomainname.c: New file.
6386
6387 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6388
6389         * linebuffer.c (freebuffer): Don't free the argument, just
6390         the buffer associated with the argument.  Bug reported by
6391         Simon Josefsson.
6392
6393 2003-09-19  Karl Berry  <karl@gnu.org>
6394
6395         * argp.h: update from libc.
6396
6397 2003-09-16  Paul Eggert  <eggert@twinsun.com>
6398
6399         * linebuffer.c (readlinebuffer): Return NULL immediately upon
6400         input error, instead of returning NULL the next time we are called
6401         (and therefore losing track of errno).
6402
6403 2003-09-15  Paul Eggert  <eggert@twinsun.com>
6404
6405         * getndelim2.c (getndelim2): Don't trash errno when a read
6406         fails, so that the caller gets the proper errno.
6407
6408         * readutmp.c (read_utmp): Likewise.
6409         Check for fstat error.  Close stream and free storage
6410         when failing.
6411
6412 2003-09-14  Bruno Haible  <bruno@clisp.org>
6413
6414         * fwriteerror.h: New file.
6415         * fwriteerror.c: New file.
6416
6417 2003-09-14  Jim Meyering  <jim@meyering.net>
6418
6419         * getloadavg.c: Correct cpp indentation.
6420         * strdup.c: Likewise.
6421         * vasnprintf.c: Likewise.
6422
6423 2003-09-12  Paul Eggert  <eggert@twinsun.com>
6424
6425         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
6426         * obstack.c [!defined _LIBC]: Likewise.
6427         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
6428         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
6429         * exitfail.c: Don't include stdlib.h; no longer needed.
6430
6431         More changes to assume C89 or better.
6432
6433         * error.c (error_tail): Assume vprintf.
6434
6435         * argmatch.c (getenv): Remove decl.
6436         * progreloc.c (get_full_program_name): Define via prototype.
6437         * setenv.c (clearenv): Likewise.
6438         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
6439         needed.
6440         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
6441         (malloc, memcpy): Remove decls.
6442         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
6443         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
6444         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6445         (memcpy): Remove macro.
6446         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
6447         (__P): Remove.  All uses removed.
6448         (PTR): Remove.  All uses changed to void *.
6449         (CHAR_BIT, NULL): Remove.
6450         (spaces, zeros, memset_space, memset_zero)
6451         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
6452         Remove.
6453         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
6454         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
6455         Define with prototype.
6456         Remove now-unnecessary prototype decl.
6457         (extra_args_spec): Assume ANSI C.  All uses changed.
6458         (extra_args_spec_iso): Remove.
6459         (my_strftime, emacs_strftimeu): Define via prototype.
6460         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
6461         unconditionally.
6462         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
6463         * strtoimax.c: Include <stdlib.h> unconditionally.
6464         (strtoul, strtol): Remove decls.
6465         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
6466         LONG_MAX): Remove.
6467         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
6468         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
6469         (LOCALE_PARAM_PROTO): New macro.
6470         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
6471         (INTERNAL (strtol), strtol): Define with a prototype.
6472         (PARAMS): Remove.  All uses removed.
6473         * tempname.c: Include <string.h> unconditionally.
6474         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
6475         * xgethostname.c (main): Define with a prototype.
6476         * xmalloc.c: Include "xalloc.h" first, to check interface.
6477         Include <stdlib.h> unconditionally.
6478         (calloc, malloc, realloc, free): Remove decls.
6479         * xstrtod.c: Include "xstrtod.h" first, to check interface.
6480         Include <stdlib.h> unconditionally.  Sort include file names.
6481         (strtod): Remove.
6482         (xstrtod): Define with a prototype.
6483         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
6484         (strtol, strtoul): Remove decls.
6485
6486 2003-09-11  Paul Eggert  <eggert@twinsun.com>
6487
6488         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
6489         Include <stdlib.h>, <string.h> unconditionally.
6490         Remove now-unnecessary cast to char *.
6491         * strnlen.c: Include <string.h> unconditionally.
6492         * yesno.c (yesno): Define with a prototype.
6493
6494 2003-09-10  Bruno Haible  <bruno@clisp.org>
6495
6496         * strcspn.c: Include <string.h> unconditionally.
6497         * strpbrk.c: Include <string.h> unconditionally.
6498         * strstr.c: Include <string.h> unconditionally.
6499         * unicodeio.c: Include <string.h> unconditionally.
6500         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
6501         * unsetenv.c: Likewise.
6502         * xreadlink.c: Include <stdlib.h> unconditionally.
6503         * yesno.c: Include <stdlib.h> unconditionally.
6504         (rpmatch): Add prototype.
6505
6506 2003-09-10  Jim Meyering  <jim@meyering.net>
6507
6508         * error.c: Correct indentation of cpp directives.
6509
6510 2003-09-09  Paul Eggert  <eggert@twinsun.com>
6511
6512         More K&R removal.
6513
6514         * acosl.c (main): Use a prototype.
6515         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
6516         tanl.c: Likewise.
6517
6518         * getloadavg.c (getloadavg, main): Define via prototypes.
6519
6520         * getopt.h (struct option.name): Assume C89, and use 'const'.
6521         (getopt, etopt_long, getopt_long_only, _getopt_internal)
6522         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
6523         with a prototype.
6524         * getopt.c (const): Remove macro.
6525         Include <string.h> unconditionally.
6526         (my_index): Remove; all uses changed to strchr.
6527         (strlen): Remove decl.
6528         (exchange): Remove forward decl; no longer needed.
6529         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
6530         Define with prototype.
6531         * getopt1.c (const): Remove macro.
6532         (getopt_long, getopt_long_only, main): Define with prototype.
6533
6534         * getugroups.c: Include <string.h> unconditionally.
6535
6536         * getusershell.c: Include <stdlib.h> unconditionally.
6537         (getusershell, setusershell, endusershell, readname, main):
6538         Define with prototypes.
6539
6540         * group-member.c: Include group-member.h first.
6541         Include <stdlib.h> unconditionally.
6542
6543         * hard-locale.c: Include hard-locale.h first.
6544         Include <stdlib.h>, <string.h> unconditionally.
6545
6546         * hash.c (free, malloc): Remove decls.
6547         Include <stdlib.h> unconditionally.
6548
6549         * human.c: Include <stdlib.h>, <string.h> unconditionally.
6550         (getenv): Do not declare.
6551
6552         * idcache.c: Include <string.h> unconditionally.
6553
6554         * long-options.c: Include long-options.h first, to test interface.
6555         Include <stdlib.h> unconditionally.
6556
6557         * makepath.c: Include makepath.h first, to test interface.
6558         Include <stdlib.h> and <string.h> unconditionally.
6559
6560         * linebuffer.c: Include <stdlib.h>.
6561         (free): Remove decl.
6562
6563         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
6564         rpl_malloc returns void *, not char *.
6565         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
6566
6567         * md5.h: Include <limits.h> unconditionally.
6568         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
6569         (__P): Remove; all uses removed.
6570         * md5.c: Include "md5.h" first.
6571         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
6572         md5_buffer, md5_process_bytes, md5_process_block):
6573         Define with prototypes.
6574         * sha.h (__P): Remove all uses.  (It wasn't defined??)
6575         * sha.c: Include "sha.h" first.
6576         Include <stdlib.h>, <string.h> unconditionally.
6577
6578         * memchr.c (__ptr_t): Remove; all uses changed to void *.
6579         * memcmp.c (__ptr_t): Likewise.
6580         * memrchr.c (__ptr_t): Likewise.
6581         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
6582         Include <string.h> unconditionally.
6583         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
6584         * memchr.c: Include <stdlib.h> unconditionally.
6585         * memchr.c (LONG_MAX): Remove.
6586         * memrchr.c (LONG_MAX): Likewise.
6587         * memchr.c (__memchr): Define via a prototype.
6588         * memrchr.c (__memrchr): Likewise.
6589         * memcmp.c (__P): Remove, and remove all uses.
6590         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
6591         Remove forward decls; no longer needed.
6592         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
6593         Use types required by C89 in prototype.
6594
6595         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
6596         * savedir.c: Likewise.
6597         * mkdir.c (free): Remove decl.
6598         * rmdir.c (rmdir): Define with a prototype.
6599         * savedir.c: Include savedir.h first, to test interface.
6600
6601         * mktime.c (STDC_HEADERS): Remove.
6602         Include <stdlib.h>, <string.h> unconditionally.
6603
6604         * modechange.c: Include <stdlib.h> unconditionally.
6605         (malloc): Remove decl.
6606
6607         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
6608         (free): Remove decl.
6609
6610         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
6611         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
6612         (This type really should be intptr_t, but that's a C99ism.)
6613         (_obstack_memcpy): Remove: all uses changed to memcpy.
6614         Include <string.h> unconditionally.
6615         (struct obstack): Assume __STDC__ for types of members
6616         chunkfun, freefun, extra_arg.
6617         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
6618         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
6619         obstack_begin, obstack_specify_allocation,
6620         obstack_specify_allocation_with_arg, obstack_chunkfun,
6621         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
6622         Remove unprototyped decls and the macros that use them.
6623         * obstack.c (POINTER): Remove.  All uses changed to void *.
6624         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
6625         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
6626         (defined __STDC__ && __STDC__)]:
6627         Remove nonprototyped code.
6628         Include <stdlib.h> unconditionally.
6629         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
6630         _obstack_allocated_p, _obstack_free, obstack_free,
6631         _obstack_memory_used, print_and_abort):
6632         Define using prototypes.
6633         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
6634         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
6635         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
6636         obstack_next_free, obstack_object_size, obstack_room) [0]:
6637         Remove unused, unprototyped code.
6638
6639         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
6640
6641         * physmem.c (physmem_total, physmem_available, main): Define
6642         with prototypes.
6643
6644         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
6645         (main): Define with a prototype.
6646
6647         * posixver.c (getenv): Remove decl.
6648
6649         * putenv.c (malloc): Returns void *, not char *.
6650         Include <string.h> unconditionally.
6651         (strchr, memcpy, NULL): Do not define.
6652
6653         * readtokens.c: Include readtokens.h first, to test interface.
6654         Include <stdlib.h>, <string.h> unconditionally.
6655         (init_tokenbuffer): Define with a prototype.
6656
6657         * regex.c (PARAMS): Remove.  All uses removed.
6658         All uses of _RE_ARGS removed, too.
6659         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
6660         unconditionally.
6661         (bzero): Assume memset exists.
6662         (memcmp, memcpy, NULL): Remove.
6663         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
6664         char, or assignments to local vars of type signed char.
6665         (init_syntax_once, PREFIX(extract_number_and_incr),
6666         PREFIX(print_partial_compiled_pattern),
6667         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
6668         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
6669         PREFIX(regex_grow_registers), PREFIX(regex_compile),
6670         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
6671         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
6672         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
6673         wcs_compile_range, byte_compile_range, truncate_wchar,
6674         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
6675         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
6676         count_mbs_length, wcs_re_match_2_internal,
6677         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
6678         PREFIX(alt_match_null_string_p),
6679         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
6680         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
6681         regfree, PREFIX(extract_number)): Define with prototype.  Remove
6682         now-unnecessary declaration, if any.
6683         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
6684         regcomp, regexec):
6685         Remove now-unnecessary casts among pointer types.
6686         * regex.h (_RE_ARGS): Remove.  All uses removed.
6687
6688         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
6689         (free): Remove decl.
6690
6691         * rpmatch.c: Include <stdlib.h> unconditionally.
6692
6693         * same.c: Include <stdlib.h>, <string.h> unconditionally.
6694         (free): Remove decl.
6695
6696         * save-cwd.c: Include <stdlib.h> unconditionally.
6697         * xgetcwd.c: Likewise.
6698
6699         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
6700         (free): Remove decl.
6701
6702         * strchrnul.c (strchrnul): Define with a prototype.
6703         Fix bug: c_in was not converted to char before searching.
6704
6705         The following changes are not K&R related:
6706
6707         * group-member.h: Include <sys/types.h>, so that this file is
6708         self-contained.
6709         * makepath.h: Likewise.
6710
6711         * getusershell.c (readname, default_index, line_size, readname):
6712         Use size_t, not int, for sizes.
6713         (readname): If the size overflows, report an error instead of
6714         looping forever.
6715
6716 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
6717
6718         * getndelim2.c: Assume stdlib.h per the C89 spec.
6719
6720 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6721
6722         Assume C89 or better; remove K&R cruft.
6723         A few of these changes were first proposed by Derek Robert Price
6724         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
6725
6726         * addext.c: Include <string.h> unconditionally.
6727         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
6728         Don't declare getenv or malloc.
6729
6730         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
6731         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
6732         (NULL): Remove.
6733         (find_stack_direction, alloca): Use prototypes.
6734
6735         * atexit.c (atexit): Define using a prototype.
6736
6737         * basename.c, dirname.c, stripslash.c:
6738         Include <string.h> unconditionally.
6739
6740         * bcopy.c: Include <stddef.h>.
6741         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
6742
6743         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
6744
6745         * error.h (error, error_at_line, error_print_progname)
6746         [! (defined (__STDC__) && __STDC__)]: Remove decls.
6747         * error.c: Include error.h first, to check interface.
6748         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6749         (VA_START): Remove; all uses changeed to va_start.
6750         (exit, strerror): Remove decls.
6751         (error_print_progname): Prototype uncondionally.
6752         Don't include <errno.h>; no longer needed.
6753         (private_strerror): Remove.
6754         (error_tail): Always define.
6755         (error, error_at_line): Assume C89 or better; always use prototypes.
6756         * fatal.c: Include "fatal.h" first, to test interface.
6757         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
6758         (VA_START): Remove; all uses changed to va_start.
6759         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
6760         this case.
6761         (exit): Remove decl.
6762         (fatal): Prototype unconditionally.  Assume va_start works.
6763         Abort at end, to pacify gcc.
6764
6765         * euidaccess.c (main): Define with a prototype.
6766
6767         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
6768
6769         * exitfail.c: Include <stdlib.h> unconditionally.
6770
6771         * fnmatch_.h (__P): Remove.  All uses changed to assume
6772         prototypes.
6773         * fnmatch.c: Include fnmatch.h first, to test interface.
6774         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
6775         (getenv): Remove decl.
6776         (fnmatch): Define using a prototype.
6777         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
6778         (FCT): Define using a prototype.
6779
6780         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
6781
6782         * gethostname.c: Include <stddef.h>.
6783         (gethostname): Define with prototype.  Length is size_t, not int.
6784
6785 2003-09-08  Paul Eggert  <eggert@twinsun.com>
6786
6787         * getversion.c: Remove; was migrated to backupfile.c in 1997.
6788         getversion.c should have been removed then, but was accidentally
6789         preserved.
6790
6791         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
6792         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
6793
6794 2003-09-07  Paul Eggert  <eggert@twinsun.com>
6795
6796         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
6797         copy_tm_result.  Bug reported by Simon Josefsson in
6798         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
6799
6800 2003-09-06  Paul Eggert  <eggert@twinsun.com>
6801
6802         * time_r.c, time_r.h: New files.
6803
6804         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
6805         __localtime_r.
6806         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
6807         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
6808
6809         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
6810         __gmtime_r.
6811         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
6812         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
6813         Include <time_r.h>.
6814
6815         * timegm.c: Switch to glibc implementation, with the following changes:
6816         [defined HAVE_CONFIG_H]: Include <config.h>.
6817         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
6818         (__mktime_internal) [!defined _LIBC]: New decl.
6819         (__gmtime_r) [!defined _LIBC]: New macro and function.
6820         (timegm): Use a prototype, since gnulib assumes C89.
6821         Do not bother declaring tmp to be const, as it's not really usefu.
6822         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
6823         (timegm): Declare only if HAVE_DECL_TIMEGM.
6824
6825 2003-09-03  Paul Eggert  <eggert@twinsun.com>
6826
6827         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
6828         Bug reported by Lute Kamstra in
6829         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
6830
6831         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
6832         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
6833         course with correspondingly smaller numbers for tomorrow and
6834         yesterday.  From Tadayoshi Funaba.  Originally installed into
6835         sh-utils on 1999-08-07, but the patch got lost (I guess during the
6836         coreutils merge?).
6837
6838 2003-08-31  Simon Josefsson  <jas@extundo.com>
6839
6840         * timegm.h: New file.
6841         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
6842
6843 2003-08-31  Karl Berry  <karl@gnu.org>
6844
6845         * argp.h: update from libc.
6846
6847 2003-08-28  Bruno Haible  <bruno@clisp.org>
6848
6849         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
6850         warning on QNX, which defines O_BINARY to 000000.
6851
6852 2003-08-24  Bruno Haible  <bruno@clisp.org>
6853
6854         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
6855         MSVC7 <stdio.h> is included later.
6856
6857 2003-08-20  Bruno Haible  <bruno@clisp.org>
6858
6859         * progname.h: New file, from GNU gettext.
6860         * progname.c: New file, from GNU gettext.
6861         * progreloc.c: New file, from GNU gettext.
6862
6863 2003-08-19  Bruno Haible  <bruno@clisp.org>
6864
6865         * xstrdup.c: Assume <string.h> exists.
6866
6867 2003-08-18  Jim Meyering  <jim@meyering.net>
6868
6869         * setenv.h: Indent nested cpp directive.
6870         * vasnprintf.c: Remove trailing blanks.
6871
6872 2003-08-17  Simon Josefsson  <jas@extundo.com>
6873             Bruno Haible  <bruno@clisp.org>
6874
6875         * xstrndup.h: New file.
6876         * xstrndup.c: New file.
6877
6878 2003-08-17  Bruno Haible  <bruno@clisp.org>
6879
6880         * strndup.h: New file.
6881
6882 2003-08-16  Paul Eggert  <eggert@twinsun.com>
6883
6884         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
6885         space, undoing this 2003-08-12 change:
6886         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
6887
6888 2003-08-16  Jim Meyering  <jim@meyering.net>
6889
6890         Merge from coreutils.
6891         * xstrtoimax.c: #else #if -> #elif.
6892         * xstrtoumax.c: Likewise.
6893
6894 2003-08-15  Paul Eggert  <eggert@twinsun.com>
6895
6896         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
6897         rather than tab, after '#' in shell-script copyright notices.
6898         Suggested by Bruno Haible.
6899
6900 2003-08-15  Jim Meyering  <jim@meyering.net>
6901         and Paul Eggert  <eggert@twinsun.com>
6902
6903         Merge from coreutils.
6904         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
6905         member but strut utmpx does not.  Needed for AIX 4.3.3.
6906         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6907
6908 2003-08-15  Jim Meyering  <jim@meyering.net>
6909
6910         Merge from coreutils.
6911         * xgethostname.c: Include <stdlib.h>.
6912         (xghostname): Don't exit for anything other than memory-related
6913         failure; just return NULL.
6914         * userspec.c: Include "posixver.h".
6915         (parse_user_spec): Accept `.' as a separator only
6916         in pre-POSIX-200112 mode.
6917         * strtoimax.c: Use #elif rather than #else #if.
6918         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
6919         Remove function, now that we can rely on a working tzset function.
6920         [!_LIBC]: Ensure that the required autoconf test has been run.
6921         [!defined _NL_CURRENT && HAVE_STRFTIME]:
6922         Use underlying_strftime for %r.
6923         * sha.c: Merge in some clean-up and optimization changes from glibc.
6924         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
6925         Ensure that it is a multiple of 64.
6926         Rearrange loop exit tests so as to avoid performing an
6927         additional fread after encountering an error or EOF.
6928         * realloc.c: Update copyright date.
6929
6930 2003-08-14  Jim Meyering  <jim@meyering.net>
6931
6932         Merge from coreutils.
6933         * obstack.h: Whitespace changes.
6934         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
6935         and xcalloc return values.
6936         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
6937         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
6938         hang on OSF/1 5.1 for DIR on both local and remote file systems.
6939         Reported by (and fix confirmed by) Nelson H. F. Beebe.
6940         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
6941         error from mntctl.
6942         Use mntctl's return value to drive the entry-processing loop, since
6943         we can't rely on the value of the vmt_length member in the last
6944         entry.  On some systems doing so could result in exhausting
6945         virtual memory.  Based in part on a patch from Mike Jetzer.
6946
6947 2003-08-14  Jim Meyering  <jim@meyering.net>
6948         and Paul Eggert  <eggert@twinsun.com>
6949
6950         Merges from coreutils, plus other fixes.
6951         * physmem.c: Merge in portability changes from gcc/libiberty
6952         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
6953         for credits and details.  Thanks to Kaveh Ghazi for helping
6954         to keep these files in sync.
6955         (ARRAY_SIZE): Define it.
6956         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
6957         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
6958         (memcasecmp): Don't assume size_t fits in unsigned int.
6959         Remove casts and duplicate code.
6960         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
6961         (memcpy): Remove definition.
6962         Merge in some clean-up and optimization changes from glibc.
6963         [BLOCKSIZE]: Move definition to top of file.
6964         Ensure that it is a multiple of 64.
6965         Rearrange loop exit tests so as to avoid performing an
6966         additional fread after encountering an error or EOF.
6967         * md5.h (md5_uintptr): Define.
6968         * makepath.c (CLEANUP_CWD): Report an error if we failed to
6969         return to the initial working directory.  Preserve errno
6970         for caller.
6971         * idcache.c: Include "xalloc.h".
6972         (xmalloc, xrealloc): Remove decls.
6973         (getuser): Remove casts no longer required in C89.
6974         * human.c: Include stdio.h, for sprintf.
6975         * group-member.c: Include "xalloc.h".
6976         (xmalloc, xrealloc): Remove decls.
6977         (get_group_info): Remove casts no longer required in C89.
6978         * getusershell.c (readname): Remove casts no longer required in C89.
6979         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
6980         * getline.c: Whitespace fix, from coreutils.
6981
6982 2003-08-13  Paul Eggert  <eggert@twinsun.com>
6983
6984         * exclude.c: Include <ctype.h>
6985         (IN_CTYPE_DOMAIN): New macro.
6986         (is_space): New fn.
6987         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
6988         and empty lines.
6989
6990         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6991         Undo previous (whitespace-only) change.
6992
6993 2003-08-12  Paul Eggert  <eggert@twinsun.com>
6994
6995         * argp-help.c, argp-parse.c, config.charset, getopt.h:
6996         Normalize leading white space and remove trailing white space.
6997         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
6998         notice, as per ../config/srclist-update.
6999
7000         Merge from coreutils.
7001         * euidaccess.h: New file.
7002         * euidaccess.c: Include it.
7003         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
7004         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
7005         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
7006
7007 2003-08-11  Bruno Haible  <bruno@clisp.org>
7008
7009         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
7010         (vasnprintf): Use it instead of wcslen.
7011
7012 2003-08-11  Bruno Haible  <bruno@clisp.org>
7013
7014         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
7015         value to ensure that _Bool promotes to int. Use #define for _Bool when
7016         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
7017
7018 2003-08-10  Karl Berry  <karl@gnu.org>
7019
7020         * regex.h: update from libc (whitespace fix).
7021
7022 2003-08-09  Paul Eggert  <eggert@twinsun.com>
7023
7024         Merge some files from coreutils.  These changes were
7025         originally made by Jim Meyering.
7026         * acl.c: Include <sys/types.h> before <sys/stat.h>;
7027         many older Unixes require this.
7028         * alloca.c (alloca): Remove cast to argument of free;
7029         no longer needed in C89.
7030         * alloca_.h, regex.h: Fix white space to match
7031         what GNU indent does.
7032
7033 2003-08-05  Paul Eggert  <eggert@twinsun.com>
7034
7035         * bumpalloc.h: Remove.
7036
7037 2003-08-04  Paul Eggert  <eggert@twinsun.com>
7038
7039         * getloadavg.c: Change copyright notice and spacing to conform to
7040         GNU coding style.
7041
7042         Merge from coreutils.
7043         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
7044         From glibc.
7045         * getdate.y (date): Also accept dates like May-23-2003; suggestion
7046         from Karl Berry, implemented by Jim Meyering.
7047         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
7048         from Dmitry V. Levin.
7049         Remove anachronistic cast of xrealloc.
7050         * fnmatch_.h (__const): Remove.  Use 'const'.
7051         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
7052         type. Otherwise, it wouldn't compile with at least /bin/cc on
7053         ymp-cray-unicos9.0.2.X.
7054         Combine two mostly-identical uses of alloca into one.
7055         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
7056
7057 2003-08-04  Dave Love <d.love@dl.ac.uk>
7058
7059         [From Emacs.]
7060
7061         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
7062         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
7063         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
7064         obsolete NLIST_NAME_UNION.
7065         [__GNU__]: Undef BSD and FSCALE.
7066         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
7067
7068 2003-08-03  Paul Eggert  <eggert@twinsun.com>
7069
7070         * stdbool_.h (_Bool): Make it signed char, instead of
7071         an enum type, so that it's guaranteed to promote to int.  See:
7072         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
7073
7074 2003-07-31  Paul Eggert  <eggert@twinsun.com>
7075
7076         * strerror.c: Include config.h, limits.h.  Declare sprintf.
7077         (strerror): Don't assume that a printable int fits in 14 bytes.
7078
7079 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
7080             Bruno Haible  <bruno@clisp.org>
7081
7082         * getline.h (getline, getdelim): Change return type to ssize_t.
7083         * getline.c (getline, getdelim): Likewise.
7084         Remove _GNU_SOURCE define; now it's defined in config.h through
7085         m4/getline.m4.
7086
7087 2003-07-22  Paul Eggert  <eggert@twinsun.com>
7088
7089         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
7090         over-parenthesization in macros.
7091
7092         Sync with coreutils.
7093
7094         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
7095         required by C99.
7096
7097         Use `exit_failure' for xalloc and xmemcoll instead of their own
7098         private exit-failure variables.
7099         * xalloc.h (xalloc_exit_failure): Remove.
7100         * xmalloc.c: Likewise.  Include exitfail.h.
7101         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
7102         * xmemcoll.h (xmemcoll_exit_failure): Remove.
7103         * xmemcoll.c: Likewise.  Include exitfail.h.
7104         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
7105
7106 2003-07-18  Paul Eggert  <eggert@twinsun.com>
7107
7108         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
7109         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
7110         to test that it can stand by itself.  Include "exitfail.h".
7111         Clients should set exit_failure instead.
7112         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
7113
7114 2003-07-18  Andreas Schwab  <schwab@suse.de>
7115
7116         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
7117
7118 2003-07-18  Bruno Haible  <bruno@clisp.org>
7119
7120         * getndelim2.h: New file.
7121         * getndelim2.c: Make into a module of its own. Include config.h,
7122         getndelim2.h.
7123         (getndelim2): Make non-static. Change return type to ssize_t.
7124         * getline.h: Change argument names.
7125         * getline.c: Include getndelim2.h instead of getndelim2.c.
7126         * getnline.c: Include getndelim2.h.
7127
7128 2003-07-17  Bruno Haible  <bruno@clisp.org>
7129
7130         * Makefile.am: Remove file.
7131         * Makefile.in: Remove file.
7132
7133 2003-07-17  Bruno Haible  <bruno@clisp.org>
7134
7135         * getnline.h: New file.
7136         * getnline.c: New file.
7137         * getndelim2.c: New file, extracted from getline.c.
7138         (getndelim2): Renamed from getdelim2, with added nmax argument.
7139         * getline.c: Include getndelim2.c.
7140         (getdelim2): Moved out to getndelim2.c.
7141         (getline, getdelim): Update.
7142
7143 2003-07-15    <karl@gnu.org>
7144
7145         * vasnprintf.c: update from gettext.
7146
7147 2003-07-15  Jim Meyering  <jim@meyering.net>
7148
7149         * makepath.c (make_path): Enclose diagnostic in _(...).
7150
7151 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7152
7153         * asnprintf.c, asprintf.c, config.charset, gettext.h,
7154         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
7155         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
7156         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
7157         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
7158         updated automatically by ../config/srclist-update.  This changes
7159         their license from LPGL to GPL.
7160
7161 2003-07-14  Jim Meyering  <jim@meyering.net>
7162
7163         Don't emit diagnostics.  Let callers do that.
7164         * save-cwd.c: Don't include "error.h".
7165         (save_cwd): Don't call error.  Ensure that errno is valid
7166         when returning nonzero.
7167
7168         * save-cwd.h (restore_cwd): Update prototype.
7169         * save-cwd.c (restore_cwd): Remove two parameters.
7170         Simplify.  Don't call error upon failure.  Let callers do that.
7171         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
7172         when auditing is enabled.  But don't bother updating the #if.
7173
7174 2003-07-14  Simon Josefsson  <jas@extundo.com>
7175
7176         * mempcpy.h: New file.
7177         * mempcpy.c: New file.
7178
7179 2003-07-14  Paul Eggert  <eggert@twinsun.com>
7180
7181         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
7182         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
7183         unicodeio.c, unicodeio.h, unlocked-io.h:
7184         Switch from LGPL to GPL.
7185
7186 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
7187
7188         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
7189         it breaks C++ compilation.
7190         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
7191
7192 2003-07-10  Jim Meyering  <jim@meyering.net>
7193
7194         * vasnprintf.c: Remove trailing blanks.
7195         Make cpp indentation consistent.
7196
7197 2003-07-09  Paul Eggert  <eggert@twinsun.com>
7198
7199         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
7200         posixver.c, strftime.c, strnlen.c, strverscmp.c:
7201         Switch from LGPL to GPL.
7202
7203 2003-07-07  Paul Eggert  <eggert@twinsun.com>
7204
7205         * mktime.c: Fix some boundary cases and remove need for floating point.
7206
7207         Issue a compile-time diagnostic if time_t is floating point, or if
7208         two's complement arithmetic is not in effect, or if arithmetic
7209         right shift does not propagate the sign.  These assumptions were
7210         all in the original code but they weren't checked.
7211
7212         (TIME_T_MIDPOINT, verify): New macros.
7213         (__isleap): Remove; it has integer overflow problems.
7214         (leapyear): New function, without those problems.
7215         (ydhms_tm_diff): Remove; splitting into two parts.
7216         (ydhms_diff): New function, containing the arithmetic part of
7217         the old ydhms_tm_diff function.  Issue a compile-time
7218         diagnostic if we are not using C99 integer division.
7219         Avoid casts when possible.
7220         (guess_time_tm): New function, containing the checking part of
7221         the old ydhms_tm_diff function.  Return the new value, rather than
7222         the difference between it and the old.  Accept a new argument T
7223         so that *T specifies the old value.  Check for overflow in the result.
7224
7225         (__mktime_internal): Use a time_t offset, not a long int offset.
7226         This undoes the 2003-06-04 change, which is no longer needed now
7227         that we have better overflow checking.
7228         (localtime_offset): Likewise.
7229
7230         (__mktime_internal): Avoid harmful overflow on hosts where time_t
7231         and long are 64-bit but int is only 32-bit.
7232         (ydhms_diff): Use long int to store year1 and yday1.
7233         Issue a compile-time diagnostic if long int is not wide enough.
7234
7235         (__mktime_internal): Use long int to store adjusted year and yday.
7236         Use plain C rather than preprocessor commands, if that doesn't
7237         affect efficiency.
7238         Check for overflow (and try to repair) after each probe
7239         rather than checking only at the very end.  This avoids some bugs
7240         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
7241         does not equal GMT offset at maximum time).
7242         Use integer to check for overflow rather than floating point; this
7243         is more portable to non-IEEE hosts, and is a tad faster.
7244         When we detect that we are oscillating between two values,
7245         don't check whether tm_isdst has the requested value, since
7246         we already know the answer.  When tm_isdst has the wrong value,
7247         use a different heuristic to find the right one, based on the
7248         extreme values actually observed in practice in tz2003a,
7249         rather than the (overly optimistic) "previous 3 calendar quarters".
7250
7251         (not_equal_tm, print_tm, check_result): Use "const T" rather than
7252         "T const" to accommodate glibc style.
7253         (check_result): Use less-confusing report format.  "long" -> "long int.
7254         (main): Likewise.
7255         Don't loop if the iteration overflows time_t.
7256         Allow a negative step in the iteration.
7257
7258 2003-07-01  Paul Eggert  <eggert@twinsun.com>
7259
7260         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
7261         having it depend on HAVE_SYS_TYPES_H.
7262
7263 2003-06-25  Bruno Haible  <bruno@clisp.org>
7264
7265         * readlink.c: New file.
7266
7267 2003-06-20  Bruno Haible  <bruno@clisp.org>
7268
7269         Assume C89, so PARAMS isn't needed.
7270         * unicodeio.h (PARAMS): Remove.
7271         * unicodeio.c: Don't use PARAMS.
7272
7273 2003-06-18  Jim Meyering  <jim@meyering.net>
7274
7275         Merge changes from coreutils.
7276         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
7277         Remove explicit declarations of xmalloc and realloc.
7278         Include xalloc.h.
7279         (read_utmp): Remove anachronistic cast of xmalloc.
7280
7281 2003-06-17  Paul Eggert  <eggert@twinsun.com>
7282
7283         Assume C89, so PARAMS isn't needed.
7284         * backupfile.h (PARAMS): Remove.  All uses removed.
7285         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
7286         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
7287         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
7288         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
7289         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
7290         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
7291         xstrtol.h: Likewise.
7292         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
7293         same.h, strverscmp.h: Do not include config.h; no longer needed.
7294         Anyway, config.h should always be included before any other file.
7295
7296 2003-06-11  Simon Josefsson  <jas@extundo.com>
7297
7298         * sysexit_.h: New file.
7299
7300 2003-05-20  Derek Price  <derek@ximbiot.com>
7301
7302         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
7303
7304 2003-06-10  Simon Josefsson  <jas@extundo.com>
7305
7306         * strchrnul.h: New file.
7307         * strchrnul.c: New file.
7308
7309 2003-06-10  Simon Josefsson <jas@extundo.com>
7310
7311         * argp.h: New file, from glibc.
7312         * argp-ba.c: New file, from glibc.
7313         * argp-eexst.c: New file, from glibc.
7314         * argp-fmtstream.c: New file, from glibc.
7315         * argp-fmtstream.h: New file, from glibc.
7316         * argp-fs-xinl.c: New file, from glibc.
7317         * argp-help.c: New file, from glibc.
7318         * argp-namefrob.h: New file, from glibc.
7319         * argp-parse.c: New file, from glibc.
7320         * argp-pv.c: New file, from glibc.
7321         * argp-pvh.c: New file, from glibc.
7322         * argp-xinl.c: New file, from glibc.
7323
7324 2003-06-07  Jim Meyering  <jim@meyering.net>
7325
7326         * readtokens.h: Put `Free Software Foundation, Inc.'
7327         in place of my name in the copyright comment.
7328         Remove definition and uses of __P.
7329
7330         From coreutils.
7331         * stat.c: Don't declare xmalloc explicitly.
7332         Instead, include "xalloc.h".
7333         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
7334         xrealloc, and xcalloc return values.
7335         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
7336         Improve comment.
7337         * xgetcwd.h: Remove definition/uses of PARAMS.
7338
7339 2003-06-06  Jim Meyering  <jim@meyering.net>
7340
7341         * stdbool_.h: Renamed from stdbool.h.in.
7342
7343 2003-06-06  Jim Meyering  <jim@meyering.net>
7344
7345         Merge from coreutils.
7346         * same.c: (same_name): Declare *_basename locals to be `const'.
7347         Consolidate declarations and initializations of *_base* locals.
7348
7349         Merge from coreutils.
7350         This avoids a core dump on systems without GNU putenv,
7351         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
7352         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
7353         (unsetenv): New static function, from GNU libc.
7354         (rpl_putenv): Use it.
7355
7356         * modechange.c: Remove trailing blanks.
7357
7358         Merge from coreutils.
7359         * fsusage.c: Remove declaration of statfs.
7360         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
7361
7362         * posixtm.c: Include <stdbool.h> unconditionally.
7363
7364 2003-06-05  Paul Eggert  <eggert@twinsun.com>
7365
7366         * mktime.c (__mktime_internal): When resolving a tm_isdst
7367         mismatch, look in future quarters as well as past.  This fixes a
7368         bug when processing fall-backwards gaps immediately after a long
7369         period of daylight-saving time.
7370
7371         * mktime.c: Assume freestanding C89 or better.
7372         (HAVE_LIMITS_H): Remove.  Assume it's 1.
7373         (__P): Remove; not used.
7374         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
7375         (mktime, not_equal_tm, print_tm, check_result,
7376         main): Use prototypes.  Use const * where appropriate.
7377         (main): Fix typo in testing code that uncovered by above changes.
7378         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
7379
7380 2003-06-04  Paul Eggert  <eggert@twinsun.com>
7381
7382         * mktime.c: Fix Debian bug 177940
7383         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
7384         (localtime_offset): Now long int, not time_t, because we want it
7385         to be guaranteed to be signed.  All uses changed.
7386         (__mktime_internal): If overflow would occur when adding offset,
7387         don't add it.
7388
7389         Merge 'human' changes from coreutils.  Rewrite to support
7390         locale-specific notations like thousands separators.
7391         * human.c: Simplify authorship notice.
7392         Include human.h immediately after config.h.
7393         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
7394         <limits.h>: Do not include, since human.h does.
7395         (SIZE_MAX, UINTMAX_MAX): New macros.
7396         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
7397         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
7398         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
7399         (power_letter): Renamed from suffixes.
7400         (generate_suffix_backwards): Remove.
7401         (adjust_value): Now takes int style (because of human.h changes)
7402         and long double value (for greater precision on some platforms).
7403         (group_number): New function.
7404         (human_readable): Use it.  Use integer options, not enum.
7405         Put the options before the sizes in the arg list.
7406         Support all the new options.
7407         The old human_readable function has been removed;
7408         use inttostr.h instead.
7409         (human_readable, default_block_size, humblock):
7410         Use uintmax_t, not int, for block sizes.
7411         (human_readable_inexact, block_size_types): Remove.
7412         (block_size_opts): New constant.
7413         (human_options): Renamed from human_block_size, with new signature
7414         that allows block sizes up to UINTMAX_MAX.  All callers changed.
7415         * human.h: Add copyright and authorship notice.
7416         Include <limits.h> and <stdbool.h> unconditionally.
7417         (PARAMS): Remove.  All uses removed.
7418         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
7419         (enum human_inexact_style): Remove tag; now a nameless enum.
7420         (human_floor, human_ceiling, human_round_to_even): Now have
7421         values 2, 0, 1 rather than -1, 1, 0.
7422         (human_group_digits, human_suppress_point_zero, human_autoscale,
7423         human_base_1024, human_SI, human_B): New constants.
7424         (human_readable_inexact, human_block_size): Remove.
7425         (human_readable): Size args are now uintmax_t, not int.
7426         (human_options): New decl.
7427
7428         * exclude.c: (new_exclude, add_exclude): Remove casts that are
7429         unnecessary now that we assume C89 or better.  This change
7430         imported from coreutils.
7431
7432         * mktime.c (__mktime_internal): Do not reject negative timestamps
7433         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
7434         in the 2003-05-30 sync from glibc.
7435
7436         .h files should stand alone, but we shouldn't include <sys/types.h>
7437         if we can get away with just <stddef.h>.
7438
7439         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
7440         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
7441         rather than <sys/types.h>, as we merely need size_t.
7442         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
7443         to get size_t.
7444         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
7445         Include <stdio.h>, to get FILE.
7446         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
7447         memcasecmp.h has included <stddef.h> and all we need is size_t.
7448         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
7449         our interface, instead of including <sys/types.h>
7450
7451 2003-06-02  Paul Eggert  <eggert@twinsun.com>
7452
7453         [from coreutils]
7454         Fix some minor time-related bugs with POSIX time arguments.
7455         Some valid time stamps were being rejected (notably -1, and
7456         time stamps before 1900 on 64-bit hosts).  And some invalid
7457         time stamps were being accepted, e.g. September 31.
7458
7459         * posixtm.h (posixtime): Return bool instead of time_t, so
7460         that we can return (time_t) -1 successfully.
7461         * posixtm.c: Likewise.
7462         [HAVE_STDBOOL_H]: Include <stdbool.h>.
7463         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
7464         (t): Remove static var.
7465         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
7466         of static var.  All uses changed.
7467         (year): Do not reject years before 1900; they can occur with
7468         64-bit time_t.
7469         (posix_time_parse): Do not check for out-of-range components;
7470         that is now the caller's responsibility, since our checks were
7471         only approximations.
7472         (posixtime): Use mktime to check for out-of-range components,
7473         since it knows them exactly.
7474         If mktime returns (time_t) -1, check whether an error actually occurred
7475         by invoking localtime on -1.
7476         (main) [TEST_POSIXTIME]: Check for input data errors, and report
7477         posixtime failures better.
7478         Improve the test data (in comments only).
7479
7480 2003-05-30    <karl@gnu.org>
7481
7482         * mktime.c: update from libc.
7483
7484 2003-05-30  Bruno Haible  <bruno@clisp.org>
7485
7486         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
7487         * localcharset.h: Likewise.
7488         * localcharset.c: Likewise.
7489
7490 2003-05-28  Paul Eggert  <eggert@twinsun.com>
7491
7492         Assume the headers required for C89 freestanding compilers.
7493         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
7494         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
7495         without checking for HAVE_LIMITS_H.
7496         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
7497         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
7498         to do that.
7499         * fatal.c: Include <stdarg.h> without checking for __STDC__.
7500         * exclude.c: Include <stdbool.h> unconditionally.
7501         * tempname.c: Include <stddef.h> unconditionally.
7502         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
7503         * modechange.c, rpmatch.c (NULL): Don't define, since
7504         <stddef.h> does that.
7505         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
7506         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
7507         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
7508         * xstrtol.c: Likewise.
7509         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
7510         * savedir.c: Include <stddef.h> instead of defining NULL.
7511
7512         * addext.c (addext): Use assignment rather than cast, to avoid
7513         warnings on some platforms.
7514
7515         * mktime.c (__mktime_internal): Do not reject negative timestamps
7516         arbitrarily.
7517
7518 2003-05-10  Bruno Haible  <bruno@clisp.org>
7519
7520         * linebreak.c (iconv_string_length): Don't return -1 just because the
7521         string is longer than 4 KB.
7522
7523 2003-05-12  Jim Meyering  <jim@meyering.net>
7524
7525         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
7526         the space-padded-by-default conversion specifiers, %e, %k, %l.
7527
7528 2003-05-03  Bruno Haible  <bruno@clisp.org>
7529
7530         Upgrade to Unicode-4.0.
7531         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
7532         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
7533         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
7534         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
7535         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
7536         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
7537         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
7538         Change width of U+E0100..U+E01EF from 1 to 0.
7539
7540 2003-04-25  Bruno Haible  <bruno@clisp.org>
7541
7542         * copy-file.c: Include <stddef.h>, for size_t.
7543
7544 2003-04-25  Jim Meyering  <jim@meyering.net>
7545
7546         * copy-file.c (copy_file_preserving): Declare buf_size to be
7547         of type size_t, not int.
7548
7549 2003-04-11  Jim Meyering  <jim@meyering.net>
7550
7551         Merge changes from Coreutils.
7552
7553         2003-03-22  Jim Meyering  <jim@meyering.net>
7554
7555         * strftime.c (widen): Cast alloca return value to proper type.
7556
7557         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
7558
7559         From GNU libc.
7560         * strftime.c (my_strftime): Handle very large width
7561         specifications for numeric values correctly.  Improve checks for
7562         overflow.
7563
7564         2003-01-19  Jim Meyering  <jim@meyering.net>
7565
7566         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
7567         (nl_get_alt_digit) [! defined my_strftime]: Define.
7568         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
7569         _nl_get_alt_digit and _nl_get_walt_digit.
7570
7571         * strftime.c (my_strftime): Merge in locale-related changes from libc.
7572         These changes have no effect outside of _LIBC.
7573
7574 2003-04-10  Bruno Haible  <bruno@clisp.org>
7575
7576         * findprog.h: New file, from GNU gettext.
7577         * findprog.c: New file, from GNU gettext.
7578
7579 2003-04-05  Jim Meyering  <jim@meyering.net>
7580
7581         Merge changes from Coreutils.
7582
7583         * exclude.h (PARAMS): Remove definition and uses.
7584         * exclude.c: Remove uses of `PARAMS'.
7585
7586         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
7587         Add test-cases for DOS filenames. Declare program_name.
7588         (main): Set up program_name.  Patch by Rich Dawe.
7589
7590         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
7591         error from mntctl.
7592         Use mntctl's return value to drive the entry-processing loop, since
7593         we can't rely on the value of the vmt_length member in the last
7594         entry.  On some systems doing so could result in exhausting
7595         virtual memory.  Based in part on a patch from Mike Jetzer.
7596
7597 2003-04-04  Bruno Haible  <bruno@clisp.org>
7598
7599         * linebreak.h: New file, from GNU gettext.
7600         * linebreak.c: New file, from GNU gettext with slight modifications.
7601         * lbrkprop.h: New file, from GNU gettext.
7602
7603 2003-04-03  Bruno Haible  <bruno@clisp.org>
7604
7605         * utf8-ucs4.h: New file, from GNU gettext.
7606         * utf16-ucs4.h: New file, from GNU gettext.
7607         * ucs4-utf8.h: New file, from GNU gettext.
7608         * ucs4-utf16.h: New file, from GNU gettext.
7609
7610 2003-04-02  Bruno Haible  <bruno@clisp.org>
7611
7612         * binary-io.h: New file, from GNU gettext.
7613
7614 2003-04-01  Bruno Haible  <bruno@clisp.org>
7615
7616         * pathname.h: New file, from GNU gettext.
7617         * concatpath.c: New file, from GNU gettext.
7618
7619 2003-03-30  Bruno Haible  <bruno@clisp.org>
7620
7621         * copy-file.c (copy_file_preserving): Don't set owner if the function
7622         chown() doesn't exist.
7623
7624 2003-03-28  Bruno Haible  <bruno@clisp.org>
7625
7626         * copy-file.h: New file, from GNU gettext.
7627         * copy-file.c: New file, from GNU gettext.
7628
7629 2003-03-18  Jim Meyering  <jim@meyering.net>
7630
7631         * quote.c (quote_n): Fix typo in comment.
7632
7633 2003-03-14  Jim Meyering  <jim@meyering.net>
7634
7635         Merge changes from Coreutils.
7636         * obstack.h (obstack_object_size): Declare temporary, __o,
7637         to be const, in order to avoid warnings.
7638         (obstack_room): Likewise.
7639         (obstack_empty_p): Likewise.
7640
7641 2003-03-13  Paul Eggert  <eggert@twinsun.com>
7642
7643         Merge changes from Bison.
7644         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
7645         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7646         when compiling Bison 1.875's `bitset bset = obstack_alloc
7647         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
7648         * hash.c: Include <stdbool.h> unconditionally.
7649
7650 2003-03-09  Paul Eggert  <eggert@twinsun.com>
7651
7652         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
7653         Reported by Bruce Becker; see:
7654         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
7655
7656 2003-03-03  Paul Eggert  <eggert@twinsun.com>
7657             Bruno Haible  <bruno@clisp.org>
7658
7659         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
7660         Reported by John Hughes, see
7661         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
7662
7663 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
7664
7665         * poll_.h: New file.
7666         * poll.c: New file.
7667
7668 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
7669
7670         * mathl.h: New file.
7671         * acosl.c: New file.
7672         * asinl.c: New file.
7673         * atanl.c: New file.
7674         * ceill.c: New file.
7675         * cosl.c: New file.
7676         * expl.c: New file.
7677         * floorl.c: New file.
7678         * frexpl.c: New file.
7679         * ldexpl.c: New file.
7680         * logl.c: New file.
7681         * sincosl.c: New file.
7682         * sinl.c: New file.
7683         * sqrtl.c: New file.
7684         * tanl.c: New file.
7685         * trigl.c: New file.
7686         * trigl.h: New file.
7687
7688 2003-02-17  Bruno Haible  <bruno@clisp.org>
7689
7690         * mkdtemp.h: New file, from GNU gettext.
7691         * mkdtemp.c: New file, from GNU gettext.
7692
7693 2003-01-31  Bruno Haible  <bruno@clisp.org>
7694
7695         * rename.c: #undef rename before defining rpl_rename.
7696         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
7697
7698 2003-01-30  Bruno Haible  <bruno@clisp.org>
7699
7700         * printf-args.h: New file, from GNU gettext.
7701         * printf-args.c: New file, from GNU gettext.
7702         * printf-parse.h: New file, from GNU gettext.
7703         * printf-parse.c: New file, from GNU gettext.
7704         * vasnprintf.h: New file, from GNU gettext.
7705         * vasnprintf.c: New file, from GNU gettext.
7706         * asnprintf.c: New file, from GNU gettext.
7707         * vasprintf.h: New file, from GNU gettext with modifications.
7708         * vasprintf.c: New file, from GNU gettext.
7709         * asprintf.c: New file, from GNU gettext.
7710
7711 2003-01-29  Bruno Haible  <bruno@clisp.org>
7712
7713         * stpncpy.h: New file, from GNU gettext with modifications.
7714         * stpncpy.c: New file, from GNU gettext with modifications.
7715
7716 2003-01-28  Bruno Haible  <bruno@clisp.org>
7717
7718         * c-ctype.h: New file, from GNU gettext, with changes suggested by
7719         Paul Eggert.
7720         * c-ctype.c: New file, from GNU gettext, with changes suggested by
7721         Paul Eggert.
7722
7723 2003-01-27  Bruno Haible  <bruno@clisp.org>
7724
7725         * xsetenv.h: New file, from GNU gettext.
7726         * xsetenv.c: New file, from GNU gettext.
7727
7728 2003-01-23  Bruno Haible  <bruno@clisp.org>
7729
7730         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
7731
7732 2003-01-22  Bruno Haible  <bruno@clisp.org>
7733
7734         * exit.h: New file, from GNU gettext.
7735
7736 2003-01-11  Bruno Haible  <bruno@clisp.org>
7737
7738         * stpcpy.h (stpcpy): Use ANSI C function declarations.
7739         * strcase.h (strcasecmp, strncasecmp): Likewise.
7740
7741 2003-01-14  Jim Meyering  <jim@meyering.net>
7742
7743         * same.c (same_name): Tweak a comment.
7744
7745 2003-01-11  Bruno Haible  <bruno@clisp.org>
7746
7747         * same.c (same_name): Reorder tests so as to avoid calling stat()
7748         when a string comparison is sufficient.
7749
7750 2003-01-11  Bruno Haible  <bruno@clisp.org>
7751
7752         * readtokens.c (readtoken): Cast character to 'unsigned char', not
7753         'unsigned int'.
7754
7755 2003-01-11  Bruno Haible  <bruno@clisp.org>
7756
7757         * hash-pjw.c: Add comment about low quality of this function.
7758
7759 2003-01-12  Paul Eggert  <eggert@twinsun.com>
7760
7761         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
7762         to avoid collisions with libcurses and libreadline.
7763
7764         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
7765         * getstr.h, getstr.c: Remove.
7766         * getline.c: Include "getline.h", to check interface.
7767         Move body of old getstr.c here: this defines MIN_CHUNK and
7768         declares getdelim2, which is renamed from getstr.
7769         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
7770
7771         * linebuffer.c (readlinebuffer): Renamed from readline.
7772         All uses changed.
7773         * linebuffer.h: Likewise.
7774         (readline): Remove backward-compatibility macro.
7775
7776 2003-01-12  Jim Meyering  <jim@meyering.net>
7777
7778         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
7779
7780 2003-01-10  Bruno Haible  <bruno@clisp.org>
7781
7782         * alloca_.h: New file.
7783         * getdate.y: Unconditionally include alloca.h.
7784         * makepath.c: Likewise.
7785         * setenv.c: Likewise.
7786         * userspec.c: Likewise.
7787
7788 2003-01-09  Bruno Haible  <bruno@clisp.org>
7789
7790         * stdbool.h.in: New file.
7791
7792 2003-01-08  Bruno Haible  <bruno@clisp.org>
7793
7794         * safe-read.c: Include specification header first, to ensure its
7795         selfcontainedness.
7796         * full-write.c: Likewise.
7797
7798 2003-01-08  Jim Meyering  <jim@meyering.net>
7799
7800         * full-write.c: Undefine and define-away `const' after inclusion
7801         of errno.h, not before.  Suggestion from Bruno Haible.
7802
7803 2003-01-07  Jim Meyering  <jim@meyering.net>
7804
7805         * full-write.c: Rework so that it may serve to define full_read, too.
7806         * full-read.c: Simply #define FULL_READ and include full-write.c.
7807
7808 2003-01-06  Jim Meyering  <jim@meyering.net>
7809
7810         * version-etc.c: Update year in translatable copyright string.
7811
7812 2002-12-25  Bruno Haible  <bruno@clisp.org>
7813
7814         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
7815         * xstrtol.h: Likewise.
7816         * xstrtoimax.c: Likewise.
7817         * xstrtoumax.c: Likewise.
7818         * human.h: Likewise.
7819
7820         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
7821         on systems that have <inttypes.h> but not <stdint.h>.
7822
7823 2002-12-31  Paul Eggert  <eggert@twinsun.com>
7824
7825         * memcoll.c (memcoll): Fall back on a simple algorithm using
7826         memcmp if strcoll doesn't work.
7827
7828 2002-12-23  Bruno Haible  <bruno@clisp.org>
7829
7830         * localcharset.h: New file.
7831         * localcharset.c: Include it.
7832         * unicodeio.c: Likewise.
7833
7834 2002-12-22  Bruno Haible  <bruno@clisp.org>
7835
7836         * utime.c (utime_null): No need to call ftruncate if the file was
7837         nonempty.
7838
7839 2002-12-23  Bruno Haible  <bruno@clisp.org>
7840
7841         * memcoll.c (STRCOLL): New macro.
7842         (memcoll): Use it.
7843
7844 2002-12-22  Bruno Haible  <bruno@clisp.org>
7845
7846         * getstr.h (getstr): Define, to avoid clash with libcurses.
7847         * linebuffer.h (readline): Define, to avoid clash with libreadline.
7848
7849 2002-12-22  Bruno Haible  <bruno@clisp.org>
7850
7851         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
7852
7853 2002-12-23  Bruno Haible  <bruno@clisp.org>
7854
7855         * getline.h: Include <stddef.h>, for size_t.
7856
7857         * unicodeio.h: Include <stddef.h>, for size_t.
7858         * unicodeio.c: Don't include <stddef.h>.
7859
7860 2002-12-17  Bruno Haible  <bruno@clisp.org>
7861
7862         * canon-host.c (strdup): Remove unused declaration.
7863
7864         * fsusage.c: Include full_read.h.
7865         (get_fs_usage): Use full_read instead of safe_read.
7866
7867         * utime.c (utime_null): Use SAFE_READ_ERROR.
7868
7869 2002-12-11  Bruno Haible  <bruno@clisp.org>
7870
7871         * setenv.h: Rewritten to cope with systems that have setenv() but not
7872         unsetenv().
7873         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
7874         modifications:
7875
7876         2002-12-11  Bruno Haible  <bruno@clisp.org>
7877
7878                 * setenv.c (alloca): Fall back to malloc.
7879                 (freea): New macro.
7880                 (setenv): Use freea() to free memory allocated with alloca().
7881
7882         2002-11-13  Bruno Haible  <bruno@clisp.org>
7883
7884                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
7885                 function declarations.
7886                 * unsetenv.c (unsetenv): Likewise.
7887
7888         2002-03-04  Bruno Haible  <bruno@clisp.org>
7889
7890                 Portability to AIX 4.3.3.
7891                 * unsetenv.c: New file, extracted from setenv.c.
7892                 * setenv.c: Move the unsetenv() function to unsetenv.c.
7893
7894         2001-12-20  Bruno Haible  <bruno@clisp.org>
7895
7896                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
7897                 use malloc instead. For SunOS 4.
7898
7899         2001-12-11  Bruno Haible  <bruno@clisp.org>
7900
7901                 * setenv.c: Declare alloca.
7902                 (compar_fn_t): New typedef.
7903                 (KNOWN_VALUE, STORE_VALUE): Use it.
7904
7905         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
7906         setenv.h.
7907
7908 2002-12-10  Paul Eggert  <eggert@twinsun.com>
7909
7910         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
7911         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
7912         Choose values that are less likely to collide with system fnmatch
7913         options.
7914         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
7915         defined (e.g., a pure POSIX system).
7916         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
7917         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
7918
7919 2002-12-06  Jim Meyering  <jim@meyering.net>
7920
7921         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
7922
7923         Merge in changes from libc's misc/error.c, in preparation
7924         for the merge of gnulib's changes back into libc.
7925
7926         * error.c (_): Define only if not already defined.
7927         Move definition to follow all #include directives.
7928         Include unlocked-io.h only if !_LIBC.
7929         [_LIBC]: Include <libio/libioP.h>.
7930         [USE_IN_LIBIO]: Include <libio/iolibio.h>
7931         (fflush): Tweak definition to use INTUSE.
7932         (putc): Define.
7933
7934 2002-12-05  Paul Eggert  <eggert@twinsun.com>
7935
7936         * alloca.c [defined emacs]: Include "lisp.h".
7937         (xalloc_die) [defined emacs]: New macro.
7938         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
7939         [! defined emacs]: Include <xalloc.h>.
7940         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
7941         (pointer): Typedef to POINTER_TYPE *.
7942         (malloc): Remove decl; we now always use xmalloc.
7943         (alloca): Use old-style definition, since Emacs needs this.
7944         Check for arithmetic overflow when computing combined size.
7945
7946 2002-12-04  Paul Eggert  <eggert@twinsun.com>
7947
7948         Do not generate unlocked-io.h automatically, since it's easier to
7949         maintain it by hand.
7950
7951         * unlocked-io.h: New file, from GNU diffutils,
7952         but with proper copyright notice and attribution.
7953         * gen-uio: Remove.
7954         * Makefile.am: Add copyright notice.
7955         (libfetish_a_SOURCES): Add unlocked-io.h.
7956         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
7957         (DISTCLEANFILES, io_functions): Remove macros.
7958         (EXTRA_DIST): Remove gen_uio.
7959         (unlocked-io.h): Remove rule.
7960
7961 2002-12-04  Jim Meyering  <jim@meyering.net>
7962
7963         Reflect the fact that stat.c and lstat.c are no longer generated.
7964         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
7965         (DISTCLEANFILES): Likewise.
7966         (EXTRA_DIST): Likewise.
7967         (all_local): Don't depend on stat.c or lstat.c.
7968         (stat.c, lstat.c): Remove rules.
7969         (EXTRA_DIST): Remove xstat.in.
7970
7971         * xstat.in: Remove file.  Contents moved into stat.c.
7972         * stat.c: New file.  Contents mostly from xstat.in.
7973         * stat.c: Rework so that it may serve to define rpl_lstat, too.
7974         * lstat.c: New file. Simply #define LSTAT and include stat.c.
7975
7976         * safe-read.c: Rework so that it may serve to define safe_write, too.
7977         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
7978
7979 2002-12-03  Jim Meyering  <jim@meyering.net>
7980
7981         * safe-read.c, safe-write.c: Change variable names and comments, but
7982         not semantics, to minimize the differences between these two files.
7983         (safe_read): Change comment to mention SAFE_READ_ERROR.
7984
7985         * safe-read.c (IS_EINTR): Define.
7986         (safe_read): Use IS_EINTR in place of in-function cpp directives.
7987
7988 2002-12-02  Bruno Haible  <bruno@clisp.org>
7989
7990         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
7991         Define, taken from safe-read.c.
7992         (INT_MAX): Provide fallback.
7993         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
7994         * safe-write.h (SAFE_WRITE_ERROR): Define.
7995
7996         * safe-read.c (EINTR): Remove definition.
7997         (safe_read): Don't use EINTR if it is absent.
7998
7999 2002-12-02  Jim Meyering  <jim@meyering.net>
8000
8001         * safe-read.c (EINTR): Define.
8002         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
8003         (INT_MAX): Provide fallback.
8004         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
8005
8006         * safe-read.h (SAFE_READ_ERROR): Define.
8007
8008 2002-12-01  Jim Meyering  <jim@meyering.net>
8009
8010         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
8011         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
8012
8013 2002-11-27  Paul Eggert  <eggert@twinsun.com>
8014
8015         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8016         hash_rehash): Replace `if (limit <= value) abort ();' with
8017         `if (! (value < limit)) abort ();', for readability.
8018
8019 2002-11-26    <karl@gnu.org>
8020
8021         * strdup.c: copy from libc again, with jim's ok.
8022         * .cppi-disable: re-add strdup.c
8023
8024 2002-11-25    <karl@gnu.org>
8025
8026         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
8027         instead of "strtol.c".
8028
8029 2002-11-25  Jim Meyering  <jim@meyering.net>
8030
8031         * mktime.c: Sync from libc, now that it has the latest fix.
8032
8033 2002-11-24    <karl@gnu.org>
8034
8035         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
8036         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
8037
8038 2002-11-24  Jim Meyering  <jim@meyering.net>
8039
8040         Update from coreutils:
8041
8042         * mktime.c: Merge in changes from libc.
8043
8044         Avoid a link-time failure on some Linux systems.
8045         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
8046         (__mon_yday): Declare with the STATIC attribute.
8047         (__mktime_internal): Likewise.
8048         Based on a report from Greg Schafer.
8049
8050 2002-11-23  Jim Meyering  <jim@meyering.net>
8051
8052         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
8053         Use `unsigned', not `int', as type of index.
8054
8055         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
8056
8057         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
8058
8059 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8060
8061         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
8062         hint that one should use `if (! x) abort ();' rather than `assert
8063         (x);', and anyway it's one less thing to worry about configuring.
8064         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
8065         hash_rehash, hash_insert): Use abort rather than assert.
8066
8067 2002-11-22  Paul Eggert  <eggert@twinsun.com>
8068
8069         * quotearg.h: Allow multiple inclusion by surrounding with
8070         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
8071         so that we can be included first.
8072         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
8073         * quotearg.c: Include quotearg.h immediately after config.h.
8074         No need to include stddef.h or sys/types.h any more.
8075         Surround local include files with "", not "<>".
8076         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
8077         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
8078         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
8079         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8080         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8081         (ISPRINT): Remove; no longer needed now that we assume C89.
8082
8083         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
8084         Preserve errno.
8085
8086         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
8087         quotearg_char): Use SIZE_MAX rather than
8088         (size_t) -1 when we are talking about "infinity".
8089
8090         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
8091
8092 2002-11-22  Bruno Haible  <bruno@clisp.org>
8093
8094         * safe-read.h: Assume C89. Add comments.
8095         (safe_read): Change return type to size_t.
8096         * safe-read.c (safe_read): Change return type to size_t. Handle byte
8097         counts > SSIZE_MAX correctly.
8098         * safe-write.h: New file.
8099         * safe-write.c: New file.
8100         * full-read.h: New file.
8101         * full-read.c: New file.
8102         * full-write.h: Assume C89. Add comments.
8103         * full-write.c: Include safe-write.h.
8104         (full_write): Rewritten to use safe_write.
8105         Suggested by Jim Meyering and Paul Eggert.
8106
8107 2002-11-21  Bruno Haible  <bruno@clisp.org>
8108
8109         Remove case insensitive option matching.
8110         * argmatch.h (argcasematch): Remove declaration.
8111         (ARGCASEMATCH): Remove macro.
8112         (__xargmatch_internal): Remove case_sensitive argument.
8113         (XARGMATCH): Update.
8114         (XARGCASEMATCH): Remove macro.
8115         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
8116         case_sensitive argument.
8117         (argcasematch): Remove function.
8118         (__xargmatch_internal): Remove case_sensitive argument.
8119         (main): Use XARGMATCH instead of XARGCASEMATCH.
8120
8121         * xmalloc.c: Change compile-time error message. Add comment about
8122         required autoconf version.
8123
8124 2002-11-21  Jim Meyering  <jim@meyering.net>
8125
8126         * strdup.c (strdup): Tweak comment and initial #if/#include.
8127
8128         Merge in changes from the coreutils.
8129
8130         2002-09-25  Paul Eggert  <eggert@twinsun.com>
8131         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
8132         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
8133         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
8134         int.  Work more efficiently if X is the same width as uintmax_t.
8135         Do not compare X to -1, to avoid bogus compiler warning.
8136         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
8137         Don't assume that f_frsize and f_bsize are the same type.
8138
8139         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
8140         on FreeBSD.
8141
8142         * makepath.c (make_path): Restore umask *before* creating the final
8143         component.
8144         (make_path): Minor reformatting.
8145
8146         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
8147         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
8148
8149         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
8150         ones.  At least on GNU/Linux systems, `auto' means something else.
8151         From Michael Stone.
8152
8153 2002-11-20  Paul Eggert  <eggert@twinsun.com>
8154
8155         Merge argmatch cleanups from Bison.  Assume C89.
8156
8157         * argmatch.c: Include config.h here, not in argmatch.h.
8158         Include stdlib.h, for EXIT_FAILURE.
8159         Always include <string.h>, since we assume C89.
8160         (EXIT_FAILURE): Remove pre-C89 bug workaround.
8161         * argmatch.h: Do not include <config.h> or <sys/types.h>.
8162         Include <stddef.h> instead, since it's all we need for size_t.
8163         (PARAMS): Remove.  All uses removed.
8164         (ARRAY_CARDINALITY): Do not bother to #undef.
8165         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
8166         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8167         Remove unnecessary parentheses.
8168         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
8169         Insert necessary parentheses.
8170         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
8171         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
8172
8173 2002-11-19  Bruno Haible  <bruno@clisp.org>
8174
8175         * mbswidth.c: Include mbswidth.h right at the beginning.
8176         * mbswidth.h: Include <stddef.h>, for size_t.
8177
8178         * mbswidth.h (PARAMS): Remove macro.
8179         (mbswidth, mbsnwidth): Use ANSI C function declarations.
8180         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
8181
8182         * gcd.h (PARAMS): Remove macro.
8183         (gcd): Use ANSI C function declarations.
8184         * gcd.c (gcd): Likewise.
8185
8186 2002-11-15  Bruno Haible  <bruno@clisp.org>
8187
8188         * strcspn.c: Include <stddef.h>.
8189         (strcspn): Use ANSI C function declaration. Change return type to
8190         size_t. Use NULL.
8191         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
8192         (strpbrk): Use NULL.
8193         * strpbrk.h (PARAMS): Remove macro.
8194         (strpbrk): Use ANSI C function declaration.
8195         * strstr.c: Don't include <sys/types.h>.
8196         * strstr.h (PARAMS): Remove macro.
8197         (strstr): Use ANSI C function declarations.
8198
8199 2002-11-06  Bruno Haible  <bruno@clisp.org>
8200
8201         * gcd.h (gcd): Change argument type to 'unsigned long'.
8202         * gcd.c (gcd): Likewise.
8203
8204 2002-11-05  Bruno Haible  <bruno@clisp.org>
8205
8206         * gcd.h: New file, from gettext-0.11.5.
8207         * gcd.c: New file, from gettext-0.11.5.
8208
8209 2002-11-05  Bruno Haible  <bruno@clisp.org>
8210
8211         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8212         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8213         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8214         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
8215
8216         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8217         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
8218
8219         * closeout.c: Include gettext.h instead of <libintl.h>.
8220         * human.c: Include gettext.h instead of <libintl.h>.
8221         * quotearg.c: Include gettext.h instead of <libintl.h>.
8222         * rpmatch.c: Include gettext.h instead of <libintl.h>.
8223         * unicodeio.c: Include gettext.h instead of <libintl.h>.
8224         * userspec.c: Include gettext.h instead of <libintl.h>.
8225         * version-etc.c: Include gettext.h instead of <libintl.h>.
8226         * xmalloc.c: Include gettext.h instead of <libintl.h>.
8227         (textdomain): Remove definition.
8228         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
8229
8230         * long-options.c: Remove include of <libintl.h> and definition of _.
8231         * same.c: Remove include of <libintl.h> and definition of _.
8232
8233 2002-11-04  Bruno Haible  <bruno@clisp.org>
8234
8235         * stpcpy.h: New file, from GNU gettext-0.11.5.
8236         * strcase.h: New file, from GNU gettext-0.11.5.
8237         * strpbrk.h: New file, from GNU gettext-0.11.5.
8238         * strstr.h: New file, from GNU gettext-0.11.5.
8239         * xgetcwd.h: New file, from GNU gettext-0.11.5.
8240
8241 2002-05-09  Bruno Haible  <bruno@clisp.org>
8242
8243         * config.charset: Update for newest glibc. Add canonical names
8244         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
8245
8246 2002-05-09  Bruno Haible  <bruno@clisp.org>
8247
8248         * localcharset.c (get_charset_aliases): Add more Windows specific
8249         aliases.
8250
8251 2002-05-08  Owen Taylor  <otaylor@redhat.com>
8252
8253         * config.charset: A few additions for Solaris.
8254
8255 2001-12-05  Bruno Haible  <bruno@clisp.org>
8256
8257         * localcharset.c (locale_charset): Don't return an empty string.
8258
8259 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
8260
8261         * config.charset: msdos in uk_UA uses CP1125.
8262
8263 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
8264
8265         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
8266         * localcharset.c (locale_charset): Declare as extern "C".
8267
8268 2002-02-15  Bruno Haible  <bruno@clisp.org>
8269
8270         * config.charset [msdosdjgpp]: For Russian, use CP866.
8271
8272 2002-02-11  Bruno Haible  <bruno@clisp.org>
8273
8274         * config.charset: Add support for NetBSD.
8275
8276 2002-09-25    <karl@gnu.org>
8277
8278         * strdup.c: copy from libc/string (via ../config/srclist*).
8279         * getopt*: copy from libc/posix.
8280         * gettext.h: copy from gettext.
8281         * .cppi-disable: add strdup.c, gettext.h.
8282
8283 2002-07-01  Jim Meyering  <meyering@lucent.com>
8284
8285         * c-stack.c: Include sys/time.h.
8286         From Volker Borchert.
8287
8288 2002-06-11  Paul Eggert  <eggert@twinsun.com>
8289
8290         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
8291         New macro.  Use it uniformly instead of
8292         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
8293         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
8294         reported by Vin Shelton.
8295
8296 2002-06-22  Jim Meyering  <meyering@lucent.com>
8297
8298         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
8299         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
8300
8301 2002-06-22  Paul Eggert  <eggert@twinsun.com>
8302
8303         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
8304         Do not assume SA_SIGINFO behavior.
8305         Bug reported by Jim Meyering on NetBSD 1.5.2.
8306
8307 2002-06-22  Jim Meyering  <meyering@lucent.com>
8308
8309         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
8310
8311         * exitfail.c, exitfail.h: Likewise.
8312         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
8313
8314         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
8315         of fnmatch.h.
8316         (EXTRA_DIST): Add fnmatch_loop.c.
8317         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
8318
8319         * fnmatch_loop.c: New file, from diffutils-2.8.2.
8320         * fnmatch.c: Update from diffutils-2.8.2.
8321         * fnmatch_.h: New file.  From diffutils-2.8.2.
8322         * fnmatch.h: Remove file.
8323
8324 2002-06-18  Paul Eggert  <eggert@twinsun.com>
8325
8326         * file-type.h: Report an error if neither S_ISREG nor
8327         S_IFREG is defined, instead of using a test specific to glibc
8328         2.2.  This should be safe, since POSIX requires S_ISREG and
8329         Unix Version 7 had S_IFREG.  We don't need to check for
8330         <sys/types.h> since we don't use any symbols that it defines.
8331
8332 2002-06-15  Jim Meyering  <meyering@lucent.com>
8333
8334         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
8335         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
8336         have been included before this file.
8337
8338 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
8339
8340         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
8341         so that each temporary file name is unique and valid in the first
8342         8 characters, for operation under DOS.
8343
8344 2002-06-15  Jim Meyering  <meyering@lucent.com>
8345
8346         Work even with DJGPP 2.03, which lacks support for symlinks.
8347         From Richard Dawe.
8348         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
8349         is defined.
8350         * lchown.c (S_ISLNK): Likewise.
8351
8352 2002-06-14  Jim Meyering  <meyering@lucent.com>
8353
8354         * file-type.h: Use the version from diffutils-2.8.2.
8355         * file-type.c: Likewise.
8356
8357 2002-05-27  Jim Meyering  <meyering@lucent.com>
8358
8359         Fix a problem seen only on nonconforming systems whereby ls.c's
8360         use of localtime, and then of gettimeofday would cause trouble:
8361         the localtime call used to initialize rpl_gettimeofday's save
8362         mechanism would clobber ls's current local time information so
8363         that in any long listing the first file would always be listed
8364         with date 1970-01-01.  Analysis by Volker Borchert.
8365
8366         * gettimeofday.c (localtime): Undefine.
8367         (rpl_localtime): New function.
8368
8369 2002-05-22  Jim Meyering  <meyering@lucent.com>
8370
8371         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
8372         * file-type.h: New file.
8373         * file-type.c (file_type): New file/function.  Extracted from diffutils.
8374
8375 2002-04-29  Paul Eggert  <eggert@twinsun.com>
8376
8377         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
8378
8379 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8380
8381         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
8382         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
8383         of 127, since 64 is the largest conceivable number for ancient
8384         nonstandard hosts.
8385         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
8386
8387 2002-04-28  Jim Meyering  <meyering@lucent.com>
8388
8389         * sig2str.c (WTERMSIG): Remove definition (unused).
8390
8391 2002-04-28  Paul Eggert  <eggert@twinsun.com>
8392
8393         * sig2str.h, sig2str.c: New files.
8394         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
8395
8396 2002-04-24  Jim Meyering  <meyering@lucent.com>
8397
8398         * gettext.h: New file, from Gettext.
8399         * Makefile.am (INCLUDES): Remove -I../intl.
8400         (libfetish_a_SOURCES): Add gettext.h.
8401
8402 2002-04-16  Jim Meyering  <meyering@lucent.com>
8403
8404         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
8405         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
8406         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
8407
8408 2002-04-12  Jim Meyering  <meyering@lucent.com>
8409
8410         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
8411
8412 2002-03-10  Jim Meyering  <meyering@lucent.com>
8413
8414         * makepath.c (make_path): Remove a comma from a diagnostic.
8415         Suggestion from Santiago Vila.
8416
8417 2002-03-08  Jim Meyering  <meyering@lucent.com>
8418
8419         * rename.c: Mention that this wrapper is needed also on
8420         mips-dec-ultrix4.4 systems.
8421
8422 2002-03-02  Jim Meyering  <meyering@lucent.com>
8423
8424         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
8425         not HAVE_CLOCK_SETTIME.
8426
8427 2002-02-27  Paul Eggert  <eggert@twinsun.com>
8428
8429         * nanosleep.h: Rename to....
8430         * timespec.h: New name for nanosleep.h.  All uses changed.
8431
8432         * gettime.c: New file.
8433         * settime.c: New file.
8434         * stime.c: Remove.
8435
8436         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
8437         timespec.h.  Remove nanosleep.h.
8438
8439 2002-02-25  Paul Eggert  <eggert@twinsun.com>
8440
8441         * acl.c, acl.h: New files.
8442         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
8443
8444 2002-02-24  Jim Meyering  <meyering@lucent.com>
8445
8446         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
8447         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
8448         cause trouble.  Reported by Nelson Beebe.
8449
8450 2002-02-23  Paul Eggert  <eggert@twinsun.com>
8451
8452         * path-concat.c (xpath_concat): Reorder code to pacify
8453         compilers that don't know that xalloc_die never returns.
8454
8455 2002-02-20  Jim Meyering  <meyering@lucent.com>
8456
8457         * getdate.c: Regenerate using bison-1.33.
8458
8459 2002-02-15  Paul Eggert  <eggert@twinsun.com>
8460
8461         * posixver.c, posixver.h: New files.
8462         * Makefile.am (libfetish_a_SOURCES): Add them.
8463
8464 2002-02-02  Paul Eggert  <eggert@twinsun.com>
8465             Bruno Haible  <bruno@clisp.org>
8466
8467         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
8468         (fwrite_success_callback): New declaration.
8469         * unicodeio.c (unicode_to_mb): New function, extracted from
8470         print_unicode_char. Call failure callback instead of error.
8471         (fwrite_success_callback): New function.
8472         (exit_failure_callback): New function.
8473         (fallback_failure_callback): New function.
8474         (print_unicode_char): Call unicode_to_mb.
8475
8476 2002-01-26  Jim Meyering  <meyering@lucent.com>
8477
8478         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
8479
8480 2002-01-22  Jim Meyering  <meyering@lucent.com>
8481
8482         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
8483         Otherwise, some versions of automake would omit the rule that makes
8484         Makefile from Makefile.in.
8485
8486 2001-01-21  Paul Eggert  <eggert@twinsun.com>
8487
8488         * xmemcoll.h, xmemcoll.c: New files.
8489         * Makefile.am (libfetish_a_SOURCES): Add them.
8490         * memcoll.c: Include errno.h, and declare errno if not defined.
8491         (memcoll): Set errno to zero if there is no error.
8492
8493         * quotearg.c (quotearg_buffer_restyled):
8494         Fix bug with quoting buffers containing NUL when backslashing escapes.
8495         This bug was exposed by the other changes in this patch.
8496         (quotearg_n_options): New arg ARGSIZE.
8497         All callers changed.
8498         (quoting_options_from_style): New function.
8499         (quotearg_n_style): Use it.
8500         (quotearg_n_style_mem): New function.
8501
8502         * quotearg.h (quotearg_n_style_mem): New function.
8503
8504 2002-01-16  Jim Meyering  <meyering@lucent.com>
8505
8506         * getdate.y: Add three semicolons, each just before a closing brace.
8507         Bison (as of version 1.31) no longer papers over that mistake.
8508
8509 2002-02-14  Paul Eggert  <eggert@twinsun.com>
8510
8511         * backupfile.c (ISDIGIT): Comment fix.
8512         * getdate.y (ISDIGIT): Likewise.
8513         * posixtm.c (ISDIGIT, year): Likewise.
8514         * strverscmp.c (ISDIGIT): Likewise.
8515         * userspec.c (ISDIGIT): Likewise.
8516
8517 2002-01-05  Jim Meyering  <meyering@lucent.com>
8518
8519         * version-etc.c (version_etc_copyright): Update copyright year.
8520
8521 2001-01-19  Paul Eggert  <eggert@twinsun.com>
8522
8523         * closeout.c (close_stdout_status): If ferror (stdout), do
8524         not silently exit merely because the output buffer happens to
8525         have nothing pending.
8526
8527 2001-12-18  Paul Eggert  <eggert@twinsun.com>
8528
8529         See the big note in ../ChangeLog.
8530         * human.c (suffixes): Prefer K to k for 1024.
8531         (generate_suffix_backwards): New function.
8532         (human_readable_inexact): Use it.
8533         * xstrtol.c (__xstrtol): If there is no number but there
8534         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
8535         Accept 'K' as well as 'k'.
8536
8537 2001-12-15  Jim Meyering  <meyering@lucent.com>
8538
8539         * regex.h (__restrict_arr): Update from libc.
8540
8541         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
8542         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
8543         (STREQ): Define.
8544
8545 2001-12-10  Jim Meyering  <meyering@lucent.com>
8546
8547         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
8548         Instead, include "xalloc.h".
8549         (initbuffer): Don't cast xmalloc return value to char*.
8550         (readline): Reword comment.
8551         Don't cast xrealloc return value to char*
8552         Return NULL, not 0.
8553
8554 2001-12-09  Jim Meyering  <meyering@lucent.com>
8555
8556         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
8557         `signed and unsigned type in conditional expression'.
8558         * posixtm.c (posix_time_parse): Likewise.
8559
8560         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
8561
8562         * readtokens.c (readtoken): Declare an index to be of type unsigned
8563         to avoid a pedantic warning.
8564
8565         * getstr.c: Don't include assert.h.
8566         (getstr): Remove warning-evoking assertions.
8567         Return -1 if offset parameter is out of bounds.
8568         Change the type of a local from int to size_t.
8569
8570         * strftime.c (my_strftime_localtime_r): Include this function
8571         definition in the `#if ! HAVE_TM_GMTOFF' block.
8572
8573         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
8574         Include xalloc.h instead.
8575
8576 2001-12-02  Jim Meyering  <meyering@lucent.com>
8577
8578         * tempname.c: Don't declare getenv, thus reverting the change of
8579         2001-11-18.  It's no longer necessary, now that stdlib.h is always
8580         included.
8581
8582         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
8583         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
8584
8585 2001-11-30  Akim Demaille  <akim@epita.fr>
8586
8587         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
8588         before being defined.
8589
8590 2001-11-27  Paul Eggert  <eggert@twinsun.com>
8591
8592         * quotearg.h (quotearg_n, quotearg_n_style):
8593         First arg is int, not unsigned.
8594         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
8595         (SIZE_MAX, UINT_MAX): New macros.
8596         (quotearg_n_options): Abort if N is negative.
8597         Avoid overflow check on hosts where size_t is 64 bits and int
8598         is 32 bits, as overflow is impossible there.
8599         Fix off-by-one typo that caused unnecessary reallocation.
8600
8601 2001-11-27  Jim Meyering  <meyering@lucent.com>
8602
8603         * tempname.c: Merge with version from libc.
8604         * regex.c: Likewise.
8605
8606         * tempname.c: Include stdlib.h unconditionally.  On some old systems
8607         for which STDC_HEADERS is 0, it was not included, resulting in a
8608         warning about an integer-to-pointer conversion problem with getenv.
8609         Reported by Volker Borchert.
8610
8611 2001-11-26  Jim Meyering  <meyering@lucent.com>
8612
8613         * gtod.h: Remove file.
8614         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
8615         * gettimeofday.c: Don't include gtod.h.
8616         (GTOD_init): Remove function.
8617         (rpl_gettimeofday): Do its job here instead, rather than aborting.
8618         Suggestion from Volker Borchert.
8619
8620 2001-11-23  Jim Meyering  <meyering@lucent.com>
8621
8622         * hash.h (struct hash_table): Don't define here.  Merely declare it.
8623         * hash.c (struct hash_table): Define it here instead.
8624
8625 2001-11-22  Jim Meyering  <meyering@lucent.com>
8626
8627         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
8628
8629 2001-11-18  Paul Eggert  <eggert@twinsun.com>
8630
8631         * tempname.c (TMP_MAX): Remove; no longer needed.
8632         (TEMPORARIES): New macro.
8633         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
8634         removes an artificial limitation (e.g. HP-UX 10.20, where
8635         TMP_MAX is 17576).
8636
8637 2001-11-18  Jim Meyering  <meyering@lucent.com>
8638
8639         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
8640         on SunOS 4.
8641
8642         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
8643         files will be created before anything else.
8644
8645 2001-11-17  Jim Meyering  <meyering@lucent.com>
8646
8647         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
8648         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
8649         rather than group writable.  Patch by Juan F. Codagnone.
8650
8651         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
8652         Instead, include "xalloc.h".
8653
8654         * mountlist.c: Include unlocked-io.h after all system headers.
8655         Remove explicit declarations of xmalloc, xrealloc,
8656         and xstrdup.  Instead, include "xalloc.h".
8657
8658         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
8659         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
8660         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
8661
8662         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
8663         Reported by Padraig Brady.
8664
8665         * mkstemp.c: #undef mkstemp.
8666         Include config.h.
8667         (rpl_mkstemp): Rename from mkstemp.
8668         Protoize.
8669
8670 2001-11-16  Jim Meyering  <meyering@lucent.com>
8671
8672         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
8673         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
8674         determine the amount of total physical memory, use pstat_getstatic.
8675         HPUX-11 doesn't define _SC_PHYS_PAGES.
8676         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
8677         If sysconf couldn't be used to determine the amount of available
8678         physical memory, use both pstat_getstatic and pstat_getdynamic.
8679         Based on a patch from Bob Proulx.
8680
8681 2001-11-05  Jim Meyering  <meyering@lucent.com>
8682
8683         * xstat.in (slash_aware_lstat): Correct a misleading comment.
8684
8685 2001-11-03  Jim Meyering  <meyering@lucent.com>
8686
8687         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
8688         in argmatch_to_argument call.
8689
8690         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
8691         argument.
8692
8693         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
8694         e.g., a fault due to an attempt to free a NULL pointer.
8695
8696 2001-11-01  Jim Meyering  <meyering@lucent.com>
8697
8698         * dirfd.c, dirfd.h: New files.
8699         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
8700
8701         * hash.c (hash_print) [TESTING]: Clean up.
8702
8703 2001-10-22  Paul Eggert  <eggert@twinsun.com>
8704
8705         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
8706         to avoid a warning if -Wall.
8707
8708 2001-10-21  Paul Eggert  <eggert@twinsun.com>
8709
8710         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
8711
8712 2001-10-21  Jim Meyering  <meyering@lucent.com>
8713
8714         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
8715         this code would end up calling gettext even in packages built
8716         with --disable-nls.
8717         * getopt.c (_): Likewise.
8718         * regex.c (_): Likewise.
8719
8720 2001-10-20  Paul Eggert  <eggert@twinsun.com>
8721
8722         * error.c (strerror_r): Do not declare unless !_LIBC.
8723         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
8724         Use strerror_r that is only a macro, even if it is not a function.
8725         (strerror): Check for HAVE_DECL_STRERROR before declaring.
8726         (private_strerror): Use prototypes, not old-style function definition.
8727         (print_errno_message): New function.
8728         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
8729         char*-flavored one.
8730         (error_tail, error, error_at_line): Use it.
8731
8732 2001-10-11  Jim Meyering  <meyering@lucent.com>
8733
8734         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
8735         and quote_n (1, ... to avoid clobbering a buffer.
8736
8737 2001-10-05  Jim Meyering  <meyering@lucent.com>
8738
8739         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
8740         * hash-pjw.c: New file (factored out of fileutils' remove.c).
8741         * hash-pjw.h: New file.
8742
8743 2001-09-30  Jim Meyering  <meyering@lucent.com>
8744
8745         * mountlist.c [MOUNTED_GETFSSTAT]:
8746         Include <sys/ucred.h>, for Apple Darwin.
8747         Include sys/mount.h and sys/fs_types.h only if available.
8748         (FS_TYPE): Define.
8749         (read_filesystem_list): Use FS_TYPE.
8750
8751 2001-09-29  Paul Eggert  <eggert@twinsun.com>
8752
8753         * exclude.c (excluded_filename): 0 -> false, since it's
8754         a boolean context.
8755
8756 2001-09-28  Paul Eggert  <eggert@twinsun.com>
8757
8758         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
8759         #defines strtoimax.  Also treat the other strto* functions
8760         like strtoimax.
8761
8762         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
8763         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
8764         (strtoimax, strtoumax): Do not declare if already defined as a macro.
8765
8766 2001-09-26  Jim Meyering  <meyering@lucent.com>
8767
8768         Most macros in unlocked-io.h had the wrong number of arguments.
8769         * gen-uio: New script.
8770         (USE_UNLOCKED_IO): Define to 1 if not already defined.
8771         * unlocked-io.hin: Remove file.
8772         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
8773         rather than trying to embed it here.
8774         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
8775         Reported by Padraig Brady.
8776
8777 2001-09-25  Volker Borchert  <bt@teknon.de>
8778
8779         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
8780
8781 2001-09-23  Jim Meyering  <meyering@lucent.com>
8782
8783         * mountlist.c: Remove useless parentheses in #if directives.
8784         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
8785         the deprecated MOUNTED symbol is no longer defined in mntent.h.
8786
8787 2001-09-22  Jim Meyering  <meyering@lucent.com>
8788
8789         * localcharset.c: Update from latest gettext.
8790         * config.charset: Likewise.
8791
8792 2001-09-20  Jim Meyering  <meyering@lucent.com>
8793
8794         * xstrtol.c (strtoimax): Guard declaration with
8795         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
8796         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
8797         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
8798         (strtoumax): Likewise, for completeness (it wasn't necessary).
8799
8800 2001-09-06  Paul Eggert  <eggert@twinsun.com>
8801
8802         * strtoimax.c (HAVE_LONG_LONG):
8803         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
8804         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
8805         to work around bug in IBM C compiler.
8806
8807 2001-09-16  Jim Meyering  <meyering@lucent.com>
8808
8809         * mkdir.c: New file.
8810
8811 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8812
8813         * xgetcwd.c: Revert some of the previous change; intead,
8814         fix the HAVE_GETCWD_NULL code to behave more like the
8815         !HAVE_GETCWD_NULL code used to.
8816
8817         Include "xalloc.h".
8818         (xgetcwd): Do not return NULL when memory is exhausted; instead,
8819         invoke xalloc_die.
8820
8821 2001-09-04  Paul Eggert  <eggert@twinsun.com>
8822
8823         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
8824         Use ssize_t, not int, to store result of readlink.
8825         Check for ssize_t overflow as well as size_t overflow,
8826         as POSIX says the result of readlink is implementation-defined
8827         when ssize_t overflows.
8828         Remove unnecessary cast to char*.
8829         Use free+malloc instead of realloc, as the storage doesn't need
8830         to be preserved and it's clearer and can be more efficient that way.
8831         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
8832         * xreadlink.h (xreadlink): Update prototype.
8833
8834 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8835
8836         * exclude.c (fnmatch_no_wildcards): Fix confusion between
8837         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
8838         spotted by Jim Meyering.
8839
8840 2001-09-03  Jim Meyering  <meyering@lucent.com>
8841
8842         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
8843
8844 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8845
8846         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
8847         like the HAVE_GETCWD_NULL code.
8848         Include pathmax.h if not HAVE_GETCWD.
8849         Do not include xalloc.h.
8850         (INITIAL_BUFFER_SIZE): New symbol.
8851         Do not use xmalloc / xrealloc, since the caller is responsible for
8852         handling errors.  Preserve errno around `free' during failure.
8853         Do not overrun buffer when using getwd.
8854
8855 2001-09-03  Paul Eggert  <eggert@twinsun.com>
8856
8857         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
8858         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
8859
8860 2001-09-02  Jim Meyering  <meyering@lucent.com>
8861
8862         * error.c: Update from GNU libc.
8863
8864 2001-09-01  Jim Meyering  <meyering@lucent.com>
8865
8866         * xreadlink.c: New file.
8867         * xreadlink.h: New file.
8868         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
8869
8870         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
8871         doesn't conflict with sparc Solaris 7's definition in
8872         /usr/include/sys/int_types.h.
8873
8874         * exclude.c: Use `""', not `<>' to #include non-system header files.
8875         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
8876         and strncasecmp as r-values.  Unixware didn't have declarations.
8877
8878 2001-08-31  Jim Meyering  <meyering@lucent.com>
8879
8880         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
8881         Use an initial, malloc'd, buffer of length 128 rather than
8882         a statically allocated one of length 1024.
8883
8884 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8885
8886         * xgetcwd.c: Don't include pathmax.h.
8887         Include stdlib.h and unistd.h if available.
8888         Include xalloc.h.
8889         (xmalloc, xstrdup, free): Remove decls.
8890         (xgetcwd): Don't assume sizes fit in unsigned.
8891         Check for overflow when computing sizes.
8892         Simplify reallocation code.
8893
8894 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8895
8896         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
8897
8898         * strtoimax.c: Renamed from strtoxmax.c, removing the
8899         old strtoimax.c.
8900
8901         Also, make the following further changes to make this file's
8902         configuration more similar to that of strtol.c:
8903         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
8904         (strtoumax, uintmax_t, strtoull, strtol): Remove.
8905         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
8906         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
8907         changed to signed values.
8908
8909         And make the following changes as well:
8910         Fix copyright notice, as 1999 was missing.
8911         (verify): New macro.
8912         (strtoimax): Check sizes at compile-time, not run-time.
8913         Prefer strtol to strtoll if both work.
8914         (main): Remove; it was not that useful and was a pain to maintain.
8915
8916         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
8917
8918 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8919
8920         * savedir.c (savedir): Remove size parameter, as POSIX says that
8921         a directory's st_size can have an arbitrary value, so the old
8922         usage could waste an arbitrary amount of memory.  All uses
8923         changed.
8924         * savedir.h: Update prototype.
8925
8926 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8927
8928         * xstrtol.c (strtoimax): New decl.
8929
8930 2001-08-28  Paul Eggert  <eggert@twinsun.com>
8931
8932         * xstrtol.h: Add copyright notice.
8933         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
8934         LONGINT_INVALID_SUFFIX_CHAR.
8935
8936 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8937
8938         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8939         tm to be declared.
8940
8941 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8942
8943         * hash.c: Remove '2001' from copyright notice.
8944
8945 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8946
8947         * full-write.h: New file.
8948         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
8949         * full-write.c: Correct credits, as cccp.c no longer
8950         exists and anyway it was so heavily changed from the old cccp
8951         code as to be unrecognizable.  Include full-write.h.
8952         (full_write) Return size_t, with short writes meaning failure.
8953         All callers changed.  This fixes a bug with large buffers
8954         on 64-bit hosts.
8955         * utime.c: Include full-write.h.
8956
8957 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8958
8959         Merge 'exclude' changes from tar 1.13.22.
8960         This fixes one or two unlikely storage allocation overflow bugs,
8961         but doesn't change user-visible behavior otherwise.
8962
8963 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8964
8965         * exclude.c (bool): Declare, perhaps by including stdbool.h.
8966         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
8967         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
8968         Include if available.
8969         (<xalloc.h>): Include
8970         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
8971         (verify): New macro.  Use it to verify that EXCLUDE macros do not
8972         collide with FNM macros.
8973         (struct patopts): New struct.
8974         (struct exclude): Use it, as exclude patterns now come with options.
8975         (new_exclude): Support above changes.
8976         (new_exclude, add_exclude_file):
8977         Initial size must now be a power of two to simplify overflow checking.
8978         (free_exclude, fnmatch_no_wildcards): New function.
8979         (excluded_filename): No longer requires options arg, as the options
8980         are determined by add_exclude.  Now returns bool, not int.
8981         (excluded_filename, add_exclude):
8982         Add support for the fancy new exclusion options.
8983         (add_exclude, add_exclude_file): Now takes int options arg.
8984         Check for arithmetic overflow when computing sizes.
8985         (add_exclude_file): xrealloc might modify errno, so don't
8986         realloc until after errno might be used.
8987
8988         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
8989         New macros.
8990         (free_exclude): New decl.
8991         (add_exclude, add_exclude_file): Now takes int options arg.
8992         (excluded_filename): No longer requires options arg, as the options
8993         are determined by add_exclude.  Now returns bool, not int.
8994
8995 2001-08-30  Paul Eggert  <eggert@twinsun.com>
8996
8997         * alloca.c (alloca): Arg is of type size_t, not unsigned.
8998
8999 2001-08-27  Jim Meyering  <meyering@lucent.com>
9000
9001         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
9002
9003         * version-etc.c (N_): Remove definition.
9004         Revert most of last change.
9005         Instead, simply don't mark the `Copyright...' string for translation.
9006         Based on advice from Paul Eggert.
9007
9008         * strtoxmax.c: Tweak comment.
9009
9010 2001-08-26  Jim Meyering  <meyering@lucent.com>
9011
9012         * version-etc.c (version_etc_copyright_fmt): Replace literal year
9013         of copyright with `%s' so translators don't get an untranslated
9014         message in 2002.
9015         (COPYRIGHT_YEAR): Define.
9016         (version_etc): Use fprintf rather than fputs.
9017         Suggestion from Ulrich Drepper.
9018
9019         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
9020
9021         * strtoll.c: New file, from GNU libc.
9022         * xstrtoimax.c: New file.
9023
9024         * xstrtol.h: Add xstrtoimax.
9025         * strtoumax.c: New file.  Simply include "strtoumax.c".
9026         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
9027
9028         * strtoumax.c: Factor to work both for unsigned and signed types, ...
9029         * strtoxmax.c: ... then renamed to this.
9030
9031 2001-08-13  Paul Eggert  <eggert@twinsun.com>
9032
9033         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
9034         Port to Solaris 8, where 'sed' requires a space after the 'r'
9035         command, and where sh dislikes "$/".  Clean up the spacing a bit.
9036         Redirect output to $tmp just once.
9037
9038 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
9039
9040         * addext.c (<errno.h>): Include.
9041         (errno): Declare if not defined.
9042         (addext): Work correctly when pathconf returns -1 and leaves
9043         errno alone because there is no limit.  Also, work even if
9044         pathconf returns a value greater than SIZE_MAX.
9045
9046 2001-08-12  Jim Meyering  <meyering@lucent.com>
9047
9048         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
9049         Simply `return getcwd (NULL, 0);'.
9050         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
9051         Use 1300 as initial value for length, not PATH_MAX.
9052
9053         * pathmax.h: Clean up cpp syntax.
9054
9055 2001-08-12  Jim Meyering  <meyering@lucent.com>
9056
9057         * gettimeofday.c: New file.
9058         * gtod.h: New file.
9059         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
9060
9061 2001-08-04  Jim Meyering  <meyering@lucent.com>
9062
9063         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
9064         to get in sync with glibc.
9065
9066 2001-08-03  Paul Eggert  <eggert@twinsun.com>
9067
9068         The following changes are from gettext 0.10.39 as maintained by
9069         Bruno Haible.
9070
9071         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
9072         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
9073         with inverted sense.  All uses changed.
9074
9075         * mbswidth.c: Don't include <limits.h>.
9076         Include <stdlib.h> and <string.h> unconditionally.
9077         (iswcntrl, mbsinit, ISCNTRL): New macros.
9078         (mbsnwidth): Use K&R style function declarations.
9079         Don't bother checking for MB_LEN_MAX == 1, since the compiler
9080         can optimize it when MB_CUR_MAX == 1.
9081         The width of control characters is zero, not 1.
9082
9083 2001-07-15  Jim Meyering  <meyering@lucent.com>
9084
9085         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
9086         (BUILT_SOURCES): Add unlocked-io.h.
9087         (io_functions): Define.
9088         (unlocked-io.h): New rule.
9089         (DISTCLEANFILES): Add unlocked-io.h.
9090         (all-local): Depend on unlocked-io.h, to ensure it is created.
9091
9092         * unlocked-io.hin: New file
9093
9094         * regex.c: Update from glibc.
9095
9096 2001-07-05  Jim Meyering  <meyering@lucent.com>
9097
9098         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
9099         recommendation.
9100         (libfetish_a_SOURCES): Put all .h files here instead.
9101         Remove a thus-exposed (better checks in automake) duplicate and
9102         two unnecessary .h files.
9103
9104 2001-06-11  Jim Meyering  <meyering@lucent.com>
9105
9106         * regex.c: Update from GNU libc.
9107
9108 2001-05-27  Jim Meyering  <meyering@lucent.com>
9109
9110         * readutmp.h (UT_TYPE): Define.
9111
9112 2001-05-24  Jim Meyering  <meyering@lucent.com>
9113
9114         * argmatch.c: Include "quote.h".
9115         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
9116         quote function.  Reported by Göran Uddeborg.
9117
9118 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
9119
9120         * dirname.c (dir_name): Compute append_dot using path, not newpath
9121         which is not yet declared.
9122
9123 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9124
9125         * Makefile.am (libfetish_a_SOURCES):
9126         Add strftime.c, since we now compile it on all hosts.
9127
9128         * strftime.c (my_strftime):
9129         Define to nstrftime if emacs, but only if my_strftime is not defined.
9130         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
9131         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
9132         Add one more extra argument: a nanoseconds value.
9133         All uses changed.
9134         (ns): New macro.
9135         (my_strftime function): Add %N format.
9136         (emacs_strftimeu): Renamed from emacs_strftime,
9137         with extra ut argument.
9138
9139 2001-05-11  Paul Eggert  <eggert@twinsun.com>
9140
9141         dirname code cleanup.  base_name now behaves more compatibly
9142         with POSIX basename when given file names that have trailing
9143         slashes, and similarly for dir_name.  Add new primitives
9144         base_len and dir_len.  Put the directory-name-related decls
9145         into dirname.h.
9146
9147         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
9148         * backupfile.c (base_name): Likewise.
9149         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
9150         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
9151         * makepath.c (strip_trailing_slashes): Likewise.
9152         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
9153         Likewise.
9154         * rename.c (strip_trailing_slashes): Likewise.
9155         * same.c (base_name): Likewise.
9156         * stripslash.c (ISSLASH): Likewise.
9157
9158         * addext.c: Include <dirname.h> after size_t is defined.
9159         * backupfile.c: Likewise.
9160
9161         * addext.c (addext): Use base_len to trim redundant
9162         trailing slashes instead of doing it ourselves.
9163         But do not trim the last slash if it is not redundant.
9164
9165         * backupfile.c (find_backup_file_name,
9166         max_backup_version): Use base_len instead of rolling it ourselves.
9167         Handle the case of "" and (on DOS) "C:" correctly.
9168
9169         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
9170         Include <string.h>, <dirname.h>.
9171         (base_name): Allow file names ending in slashes, other than names
9172         that are all slashes.  In this case, return the basename followed
9173         by the slashes.  This is more general, and can be used in places
9174         where the original base_name purposely had an assertion failure.
9175         (base_len): New function.
9176
9177         * dirname.c: Include <string.h> instead of <stdlib.h>.
9178         Do not include <assert.h>; no longer needed.
9179         Include xalloc.h.
9180         (memrchr): Remove decl.
9181         (dir_name_r): Remove.
9182         (dir_len): Renamed from dirlen.  All callers changed.
9183         Rewrite in terms of base_name, for simplicity and consistency.
9184         (dir_name): Never return NULL.  All callers changed.
9185         Do not include <stdlib.h> in test program; no longer needed.
9186         return 0; is fine for test program.
9187
9188         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9189         New macros.
9190         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9191
9192         * path-concat.c (path_concat): Use base_len to compute
9193         base length, not strlen; this means we cannot rely on memcpy
9194         to null-terminate.
9195
9196         * same.c (STREQ): Remove.
9197         (same_name): Handle the case where the basename ends in trailing '/'.
9198
9199         * stripslash.c (strip_trailing_slashes): Return nonzero if
9200         a slash was stripped.  Do not strip the last slash after a
9201         file system prefix.
9202
9203 2001-04-08  Jim Meyering  <meyering@lucent.com>
9204
9205         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
9206         recomputed; that's necessary when the offset spans a DST transition.
9207         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
9208
9209 2001-04-02  Jim Meyering  <meyering@lucent.com>
9210
9211         * regex.h, regex.c: Update from GNU libc.
9212
9213 2001-03-19  Paul Eggert  <eggert@twinsun.com>
9214
9215         * version-etc.c (version_etc_copyright): Update to 2001.
9216
9217 2001-03-16  Paul Eggert  <eggert@twinsun.com>
9218
9219         * tempname.c (uint64_t): Define to uintmax_t if
9220         not defined, and if UINT64_MAX is not defined.
9221         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
9222         Reported by John David Anglin.
9223
9224 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
9225
9226         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
9227         alias if codeset is empty.
9228         * config.charset (BeOS): Use wildcard syntax.
9229
9230 2001-03-13  Jim Meyering  <meyering@lucent.com>
9231
9232         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
9233         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
9234         From Bruno Haible.
9235
9236 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9237
9238         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
9239         Don't return NULL.
9240         * unicodeio.c (print_unicode_char): Simplify accordingly.
9241
9242 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
9243
9244         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
9245         support for DOS/DJGPP.
9246
9247 2001-02-28  Paul Eggert  <eggert@twinsun.com>
9248
9249         * Makefile.am (libfetish_a_SOURCES):
9250         Add dup-safer.c, fopen-safer.c.
9251         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
9252
9253         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
9254
9255 2001-02-25  Paul Eggert  <eggert@twinsun.com>
9256
9257         The mkstemp replacement is taken from glibc 2.2.2, with some
9258         portability fixes for use outside glibc, as follows:
9259
9260         * tempname.c (struct_stat64): New macro.
9261         (direxists, __gen_tempname): Use it.
9262         This avoids a portability problem with Solaris 8.
9263
9264         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
9265         (<stddef.h>, <stdint.h>, <string.h>):
9266         Include only if STDC_HEADERS || _LIBC.
9267         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
9268         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
9269         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
9270         (__set_errno): Define this macro if <errno.h> doesn't.
9271         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
9272         Define these macros if <stdio.h> doesn't.
9273         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
9274         Define these macros if <sys/stat.h>
9275         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
9276         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
9277         __xstat64): Define if not _LIBC.
9278         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
9279         (__gen_tempname): Invoke gettimeofday only if
9280         HAVE_GETTIMEOFDAY || _LIBC;
9281         otherwise, fall back on plain "time".
9282         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
9283
9284         * mkstemp.c (__GT_FILE): Define to zero if not defined.
9285
9286         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
9287
9288 2001-02-17  Jim Meyering  <meyering@lucent.com>
9289
9290         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
9291         around included file name.
9292
9293         * strnlen.c (__strnlen): Merge in a change from GNU libc.
9294
9295         * strftime.c: Update from GNU libc (the only changes were to comments).
9296
9297 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
9298
9299         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
9300
9301 2001-02-17  Paul Eggert  <eggert@twinsun.com>
9302
9303         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
9304         Remove workaround macros for hosts that have mbrtowc but not
9305         mbstate_t, as we now insist on proper declarations for both
9306         before using mbrtowc.
9307
9308 2001-02-17  Jim Meyering  <meyering@lucent.com>
9309
9310         * regex.c: Update from libc.
9311
9312 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9313
9314         * alloca.c (malloc): Undef before defining, since stdlib.h
9315         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
9316         Reported by Mark Hounschell via Paul Eggert.
9317
9318 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
9319
9320         * config.charset: Update for FreeBSD 4.2.
9321
9322 2001-01-26  Jim Meyering  <meyering@lucent.com>
9323
9324         * quotearg.c: Include stddef.h.
9325         * quote.c: Include stddef.h.
9326         Reported by Axel Kittenberger.
9327
9328         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
9329         line in double quotes so that it evokes a better diagnostic.
9330         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
9331         Reported by Axel Kittenberger.
9332
9333 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
9334
9335         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
9336         to avoid a warning.  Add back 'const' to inptr.
9337
9338 2001-01-16  Jim Meyering  <meyering@lucent.com>
9339
9340         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
9341         From Bruno Haible.
9342
9343 2001-01-14  Jim Meyering  <meyering@lucent.com>
9344
9345         * rename.c: New file.  From Volker Borchert.
9346         Include stdlib.h, string.h or strings.h, and xalloc.h.
9347         Use strip_trailing_slashes rather than open-coding it.
9348
9349 2001-01-03  Paul Eggert  <eggert@twinsun.com>
9350
9351         * strftime.c: Sync with glibc time/strftime.c 1.81.
9352
9353 2001-01-03  Jim Meyering  <meyering@lucent.com>
9354
9355         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
9356         local `inptr' to avoid warning with some system declarations of iconv.
9357
9358 2000-12-29  Paul Eggert  <eggert@twinsun.com>
9359
9360         * modechange.c: Do not assume that mode_t uses the
9361         traditional octal encoding.  E.g. "chmod 1 FOO" should set
9362         the other-execute bit of FOO even if S_IXOTH != 1.
9363
9364         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
9365         WOTH, XOTH, ALLM): New macros.
9366         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
9367          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
9368         Use them.
9369         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
9370         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
9371         (mode_compile):
9372         No need to use uintmax_t; unsigned long is long enough.
9373         Don't bother to get suffix since we don't use it.
9374
9375 2000-12-24  Jim Meyering  <meyering@lucent.com>
9376
9377         * hash.c (is_prime): Return explicit boolean values.
9378         (hash_get_first): Return NULL to appease Irix5.6's 89.
9379         Reported by Nelson Beebe.
9380
9381 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9382
9383         * localcharset.c (locale_charset): Add support for Win32.
9384
9385 2000-12-18  Paul Eggert  <eggert@twinsun.com>
9386
9387         * physmem.h, physmem.c: New files.
9388
9389         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
9390         (noinst_HEADERS): Add physmem.h.
9391
9392         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
9393         't' for compatibility with Solaris 8 sort.
9394
9395 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
9396
9397         * config.charset: Add support for BeOS.
9398
9399 2000-12-16  Jim Meyering  <meyering@lucent.com>
9400
9401         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
9402         SHELLS_FILE to a file name that's useful on djgpp systems.
9403         Include stdlib.h.
9404         (ADDITIONAL_DEFAULT_SHELLS): Define.
9405         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
9406         Based mostly on a patch from Prashant TR.
9407
9408 2000-12-16  Jim Meyering  <meyering@lucent.com>
9409
9410         This bug had a serious impact on chown: `chown N:M FILE' (for integer
9411         N and M) would have treated it like `chown N:N FILE'.
9412
9413         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
9414
9415 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
9416
9417         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
9418         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
9419         to the list of canonical encodings. Rename EUC-CN to GB2312.
9420
9421 2000-12-08  Andreas Schwab  <schwab@suse.de>
9422
9423         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
9424         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
9425
9426 2000-12-07  Jim Meyering  <meyering@lucent.com>
9427
9428         * stripslash.c (ISSLASH): Define.
9429         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
9430         From Prashant TR.
9431
9432         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
9433         (dir_name_r): Declare this function as static.
9434         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
9435         manifest itself on a name containing a mix of slashes and
9436         backslashes.
9437         Make this function work with names starting with a DOS-style
9438         drive letter and colon prefix.
9439         (dir_name): Append `.' if necessary.
9440         Based mostly on patches from Prashant TR and Eli Zaretskii.
9441
9442         * dirname.h (dir_name_r): Remove prototype.
9443
9444 2000-12-05  Jim Meyering  <meyering@lucent.com>
9445
9446         * dirname.c (dir_name_r): Add `const' in a few local declarations.
9447
9448 2000-12-04  Jim Meyering  <meyering@lucent.com>
9449
9450         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
9451         Also include memory.h, stdlib.h, unistd.h if appropriate.
9452         Reported by Andreas Jaeger (conflicting declaration of malloc).
9453
9454 2000-12-02  Jim Meyering  <meyering@lucent.com>
9455
9456         * closeout.h: Make idempotent, to avoid some obscure warnings.
9457
9458 2000-12-01  Paul Eggert  <eggert@twinsun.com>
9459
9460         * memrchr.c: Include <config.h> before any system include file.
9461
9462 2000-11-29  Paul Eggert  <eggert@twinsun.com>
9463
9464         * dirname.c (dir_name_r): Fix typo: int -> size_t.
9465
9466 2000-11-26  Jim Meyering  <meyering@lucent.com>
9467
9468         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
9469
9470 2000-11-22  Paul Eggert  <eggert@twinsun.com>
9471
9472         * strftime.c (my_strftime): Do not invoke mbrlen with a
9473         size of (size_t) -1; it's not portable.
9474
9475 2000-11-17  Akim Demaille  <akim@epita.fr>
9476
9477         * obstack.h: Formatting changes.
9478         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
9479         prevent type checking.
9480         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9481         cast the value to (void *): assigning a `foo *' to a `void *'
9482         variable is valid.
9483         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9484
9485 2000-11-17  Jim Meyering  <meyering@lucent.com>
9486
9487         * strstr.c: Update from GNU libc.
9488
9489 2000-11-16  Jim Meyering  <meyering@lucent.com>
9490
9491         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
9492
9493 2000-11-11  Jim Meyering  <meyering@lucent.com>
9494
9495         * error.c: Add a couple #includes, merging from GNU libc version.
9496
9497 2000-11-10  Jim Meyering  <meyering@lucent.com>
9498
9499         * obstack.h: Update from GNU libc.
9500         * obstack.c: Likewise.
9501
9502 2000-11-06  Paul Eggert  <eggert@twinsun.com>
9503
9504         * getusershell.c (setusershell): Use rewind rather than
9505         fseek/fseeko, to avoid configuration hassles with fseeko.
9506         Don't bother opening SHELLS_FILE if shellstream is NULL;
9507         it's not necessary.
9508
9509 2000-11-05  Jim Meyering  <meyering@lucent.com>
9510
9511         * makepath.h (make_dir): Declare.
9512         * makepath.c (make_dir): Remove `static' attribute.
9513         Tweak a comment.
9514
9515 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
9516
9517         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
9518         last one in a bucket, advance to the next bucket.
9519
9520 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9521
9522         * fnmatch.c: Do not comment out all the code if we are using
9523         the GNU C library, because in some cases we are replacing buggy
9524         code in the GNU C library itself.
9525
9526 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9527
9528         * error.h, getline.h, modechange.h:
9529         Remove "2000" from Copyright line, as the file hasn't been
9530         changed this year other than in the copyright notice.
9531
9532         * xalloc.h: Add "2000" to Copyright line, as this file
9533         was changed this year.
9534
9535 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9536
9537         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
9538         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
9539         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
9540
9541 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
9542
9543         * regex.h (__restrict_arr): Move definition out of #ifndef block.
9544         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
9545         doesn't define __restrict_arr.
9546
9547 2000-10-29  Jim Meyering  <meyering@lucent.com>
9548
9549         * xstat.in: Fix grammar in comment.
9550
9551 2000-10-28  Jim Meyering  <meyering@lucent.com>
9552
9553         * memchr.c: Update from libc.
9554         Adjust for portability:
9555         [HAVE_STDLIB_H]: Include stdlib.h.
9556         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
9557         Undef __memchr, too.
9558         [!weak_alias]: Define __memchr to memchr.
9559
9560         * regex.c: Update from libc.
9561         * regex.h: Likewise.
9562         * getopt1.c: Likewise.
9563         * memcmp.c: Likewise.
9564
9565         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
9566         Avoid using fseek, when possible -- it's broken by design.
9567         Patch by Ulrich Drepper.
9568
9569 2000-10-26  Jim Meyering  <meyering@lucent.com>
9570
9571         * strftime.c: Update from libc.
9572
9573 2000-10-25  Jim Meyering  <meyering@lucent.com>
9574
9575         * obstack.c: Update from libc.
9576
9577 2000-10-23  Jim Meyering  <meyering@lucent.com>
9578
9579         * hard-locale.c (hard_locale): Revert last change -- it was simply
9580         wrong.  That set_locale call must not have any side effects.
9581         From Paul Eggert.
9582
9583 2000-10-22  Jim Meyering  <meyering@lucent.com>
9584
9585         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
9586         [CYCLIC]: Remove now-unused definition.
9587
9588         * save-cwd.c (O_DIRECTORY): Define, if needed.
9589         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
9590         Suggestion from Ulrich Drepper.
9591
9592 2000-10-21  Jim Meyering  <meyering@lucent.com>
9593
9594         * dirname.c (dir_name_r): New function, factored out of dir_name.
9595         (dir_name): Use dir_name_r.
9596         * dirname.h (dir_name_r): Declare it.
9597
9598 2000-10-21  Jim Meyering  <meyering@lucent.com>
9599
9600         * dirname.c (memrchr): Declare if necessary.
9601         (dir_name): Remove the restriction that there be no
9602         trailing slashes.  Now, this code skips past them, effectively
9603         ignoring them.
9604         [TEST_DIRNAME] (main): New unit tests.
9605
9606         * memrchr.c: New file from GNU libc.
9607         Undef __memrchr, too.
9608         [!weak_alias]: Define __memrchr to memrchr.
9609         Guard weak_alias use with `#ifdef weak_alias'.
9610
9611 2000-10-17  Jim Meyering  <meyering@lucent.com>
9612
9613         * quote.h (PARAMS): Define and use.
9614         Reported by Akim Demaille.
9615
9616         * getopt.c: Update from libc.
9617
9618 2000-10-16  Jim Meyering  <meyering@lucent.com>
9619
9620         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
9621         From Jan Fedak.
9622
9623 2000-09-25  Jim Meyering  <meyering@lucent.com>
9624
9625         * md5.h (rol): Define (from GnuPG).
9626
9627         * sha.c: Give credit (GnuPG) where due.
9628         (M): Use rol rather than open-coding it.
9629         Add a FIXME comment.
9630
9631 2000-09-21  Jim Meyering  <meyering@lucent.com>
9632
9633         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
9634         Reported by Michael Stone.
9635
9636 2000-09-20  Jim Meyering  <meyering@lucent.com>
9637
9638         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
9639         (noinst_HEADERS): Add sha.h.
9640         Based on code from Scott G. Miller and from GnuPG.
9641
9642 2000-09-15  Jim Meyering  <meyering@lucent.com>
9643
9644         * regex.c: Update from libc.
9645
9646 2000-09-10  Jim Meyering  <meyering@lucent.com>
9647
9648         * getopt.c (_getopt_internal): Update from glibc.
9649
9650 2000-09-09  Jim Meyering  <meyering@lucent.com>
9651
9652         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
9653         think it should be used as a general replacement for isascii.
9654         * fnmatch.c: Likewise.
9655         * mbswidth.c: Likewise
9656         * regex.c: Likewise.
9657
9658         Don't use atoi.
9659         * userspec.c: Include sys/param.h and limits.h.
9660         Include xstrtol.h.
9661         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
9662         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
9663         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
9664         UID, GID.  Check range.
9665
9666 2000-09-06  Jim Meyering  <meyering@lucent.com>
9667
9668         * getopt.c (_getopt_internal): Update from glibc.
9669
9670 2000-08-30  Jim Meyering  <meyering@lucent.com>
9671
9672         * strftime.c: Merge in changes from GNU libc.
9673
9674 2000-08-26  Jim Meyering  <meyering@lucent.com>
9675
9676         * closeout.c: Include "__fpending.h".
9677         (close_stdout_status): Return right away if there's nothing to flush.
9678
9679         * Makefile.am (noinst_HEADERS): Add __fpending.h.
9680         * __fpending.c: New file.
9681         * __fpending.h: New file.
9682
9683 2000-08-07  Paul Eggert  <eggert@twinsun.com>
9684
9685         Standardize on "memory exhausted" instead of "Memory exhausted"
9686         or "virtual memory exhausted".
9687         * obstack.c (print_and_abort): Use "memory exhausted", not
9688         "virtual memory exhausted".
9689         * same.c (same_name): Invoke xalloc_die instead of printing
9690         our own message.
9691         * userspec.c (parse_user_spec): Likewise.
9692         * bumpalloc.h: comment fix
9693         * same.c, userspec.c: Include xalloc.h.
9694
9695         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
9696         not char *const and pointing to a constant array.
9697         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
9698         (xrealloc): Comment fix.
9699
9700         * userspec.c (parse_user_spec):
9701         Don't translate a message until just before returning,
9702         to avoid unnecessary translation.
9703
9704 2000-08-07  Jim Meyering  <meyering@lucent.com>
9705
9706         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
9707         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
9708         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
9709         getgroups.c, gethostname.c, getopt.h, group-member.c,
9710         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
9711         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
9712         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
9713         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
9714         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
9715         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
9716         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
9717         yesno.c: Back out Copyright date changes for each file with no change
9718         this year.  This eases coordination with other programs using the same
9719         source code modules.  From Paul Eggert.
9720
9721 2000-08-03  Greg McGary  <greg@mcgary.org>
9722
9723         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
9724         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
9725         (EXTEND_BUFFER): Use them.
9726
9727 2000-08-01  Jim Meyering  <meyering@lucent.com>
9728
9729         * dirname.c (ISSLASH): Define.
9730         (BACKSLASH_IS_PATH_SEPARATOR): Define.
9731         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
9732         both `\' and `/' may be use as path separators.
9733         Based on a patch from Prashant TR.
9734
9735 2000-07-31  Paul Eggert  <eggert@twinsun.com>
9736
9737         * quotearg.c (quotearg_n_options): Don't make the initial
9738         slot vector a constant, since it might get modified.
9739
9740 2000-07-31  Jim Meyering  <meyering@lucent.com>
9741
9742         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
9743         * obstack.c (print_and_abort): Likewise.
9744
9745 2000-07-30  Paul Eggert  <eggert@twinsun.com>
9746
9747         * quotearg.c (quotearg_n_options): Preallocate a slot 0
9748         buffer, so that the caller can always quote one small
9749         component of a "memory exhausted" message in slot 0.
9750         From a suggestion by Jim Meyering.
9751
9752 2000-07-30  Jim Meyering  <meyering@lucent.com>
9753
9754         * makepath.c (make_path): Quote the other instance, too.
9755
9756         * quotearg.c (N_STATIC_SLOTVECS): Define.
9757         (STATIC_BUF_SIZE): Define.
9758         (quotearg_n_options): Use only statically allocated storage when
9759         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
9760         than STATIC_BUF_SIZE.
9761
9762 2000-07-29  Jim Meyering  <meyering@lucent.com>
9763
9764         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
9765         * dirname.c (dir_name): Likewise.
9766
9767         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
9768
9769         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
9770         (dir_name): Assert that there are no trailing slashes.
9771
9772 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
9773
9774         * mbswidth.h (mbswidth): Add a flags argument.
9775         (mbswidth): New declaration.
9776         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
9777         * mbswidth.c (mbswidth): Add a flags argument.
9778         (mbsnwidth): New function.
9779
9780 2000-07-24  Jim Meyering  <meyering@lucent.com>
9781
9782         * mbswidth.c: Remove useless #else.  From Bruno Haible.
9783
9784 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9785
9786         * mbswidth.c (_XOPEN_SOURCE):
9787         Don't define; this causes problems on Solaris 7.
9788         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
9789
9790 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9791
9792         * quotearg.c:
9793         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
9794         so that mbstate_t is always defined.
9795
9796         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
9797         be 1 in at least one GCC installation, and this configuration
9798         error is likely to be common.  Ignoring MB_LEN_MAX hurts
9799         performance on hosts that have mbrtowc but have only unibyte
9800         locales, but I assume these hosts are rare.
9801
9802 2000-07-23  Paul Eggert  <eggert@twinsun.com>
9803
9804         * quotearg.c: Streamline by invoking multibyte code only if needed.
9805         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
9806         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
9807         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
9808         invoke multibyte primitives.
9809
9810 2000-07-23  Jim Meyering  <meyering@lucent.com>
9811
9812         * basename.c (base_name): Add an assertion.
9813
9814 2000-07-15  Bruno Haible  <clisp.cons.org>
9815
9816         * quotearg.c: When the system forces us to redefine mbstate_t,
9817         shadow its mbsinit function.
9818
9819 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
9820
9821         * mbswidth.h: New file.
9822         * mbswidth.c: New file.
9823         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
9824         (noinst_HEADERS): Add mbswidth.h.
9825
9826 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
9827
9828         * config.charset: Add support for FreeBSD. Improve support for HP-UX
9829         and IRIX 6.
9830
9831 2000-07-15  Jim Meyering  <meyering@lucent.com>
9832
9833         * makepath.c: Include quote.h.
9834         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
9835         corresponding argument in a `quote (...)' call.
9836         Give better diagnostics.
9837
9838         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
9839         (noinst_HEADERS): Add quote.h.
9840
9841         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
9842         from tar's src/misc.c.
9843         * quote.h: New file.  Prototypes for same.
9844
9845 2000-07-10  Paul Eggert  <eggert@twinsun.com>
9846
9847         From a suggestion by Bruno Haible.
9848         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
9849         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
9850         to decide whether to define the BeOS workaround macro;
9851         this adjusts to the change to AC_MBSTATE_T.
9852
9853 2000-07-13  Paul Eggert  <eggert@twinsun.com>
9854
9855         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
9856
9857         * quotearg.c (quoting_style_args, quoting_style_vals,
9858         quotearg_buffer_restyled): Add support for
9859         clocale_quoting_style.  Undo previous change to
9860         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
9861         and "{RIGHT QUOTATION MARK}" msgids.
9862
9863 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9864
9865         The old behavior of quoting `like this' doesn't look good with
9866         newer, ISO-style fonts.  See:
9867         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
9868
9869         Instead, quote "like this" by default.  Let the translator
9870         tailor the locale-specific quoting behavior by providing
9871         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
9872
9873         * quotearg.c (N_): New macro.
9874         (gettext_default): New function.
9875         (quotearg_buffer_restyled): Use
9876         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
9877         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
9878
9879 2000-07-09  Jim Meyering  <meyering@lucent.com>
9880
9881         * Most files: Update copyright dates to include 2000.
9882
9883 2000-07-08  Jim Meyering  <meyering@lucent.com>
9884
9885         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
9886         if not defined.
9887         (xgethostname): Remove now-unnecessary #ifdef.
9888         Move declaration of `err' into loop where it's used.
9889
9890 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9891
9892         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
9893         by allocating a larger buffer. Test the gethostname return value for
9894         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
9895         returns an error and ENAMETOOLONG isn't defined.
9896
9897 2000-07-05  Paul Eggert  <eggert@twinsun.com>
9898         and Bruno Haible  <haible@clisp.cons.org>
9899
9900         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
9901
9902 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
9903
9904         * quotearg.c (struct quoting_options): Simplify quote_these_too
9905         dimension.
9906
9907 2000-07-03  Jim Meyering  <meyering@lucent.com>
9908
9909         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
9910         Reported by Bruno Haible.
9911
9912 2000-07-04  Jim Meyering  <meyering@lucent.com>
9913
9914         * quotearg.c: Make inclusion of <wchar.h> independent of whether
9915         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
9916         lacks mbrtowc.
9917
9918 2000-07-03  Paul Eggert  <eggert@twinsun.com>
9919         and Bruno Haible  <haible@clisp.cons.org>
9920
9921         * quotearg.c (mbrtowc):
9922         Assign to *pwc, and return 1 only if result is nonzero.
9923         (iswprint): Use ISPRINT when substituting our own mbrtowc.
9924
9925 2000-07-03  Jim Meyering  <meyering@lucent.com>
9926
9927         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
9928         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
9929         From Bob Proulx.
9930
9931 2000-07-02  Jim Meyering  <meyering@lucent.com>
9932
9933         * quotearg.c (mbstate_t): Don't define here.
9934
9935 2000-07-02  Jim Meyering  <meyering@lucent.com>
9936
9937         * nanosleep.c (SIGCONT): Define if not already defined.
9938
9939 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9940
9941         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
9942         per change in ../m4/ls-mntd-fs.m4.
9943         (read_filesystem_list): Ignore symbolic links.
9944
9945 2000-06-29  Jim Meyering  <meyering@lucent.com>
9946
9947         * same.c: Include <string.h> or <strings.h>, as appropriate,
9948         for declaration of strcmp.
9949
9950         * long-options.c: Include <stdlib.h>, for declaration of exit.
9951
9952         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
9953         Avoid warning by casting result to `char *' to remove `const'.
9954
9955 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9956
9957         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
9958
9959 2000-06-26  Paul Eggert  <eggert@twinsun.com>
9960
9961         savedir now sets errno on failure and invokes xmalloc to get memory.
9962         Fix a couple of other minor bugs while we're at it.
9963
9964         * savedir.c (<unistd.h>): Do not include; there's no need.
9965         (NAMLEN): Remove macro.
9966         (malloc, realloc): Remove decls.
9967         (stpcpy): Likewise.
9968         ("xalloc.h"): Include.
9969         (NAME_SIZE_DEFAULT): New macro.
9970         (savedir): Use xmalloc / xrealloc to allocate memory.
9971         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
9972         Skip "" directory entries.
9973         Use strlen to calculate directory entry length, since the old method
9974         is rarely used these days and isn't worth supporting.
9975         Don't use a pointer after freeing it.
9976         Check for integer overflow when calculating allocation size.
9977         Use memcpy to copy entries, instead of stpcpy.
9978         Set errno properly when returning NULL.
9979         Check for readdir error.
9980
9981 2000-06-26  Jim Meyering  <meyering@lucent.com>
9982
9983         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
9984
9985 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
9986
9987         * getusershell.c (xmalloc, xrealloc): Remove functions.
9988         Include xalloc.h.
9989         Don't include <stdlib.h>.  Don't declare malloc, realloc.
9990
9991 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
9992
9993         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
9994
9995 2000-06-24  Jim Meyering  <meyering@lucent.com>
9996
9997         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
9998
9999 2000-06-21  Jim Meyering  <meyering@lucent.com>
10000
10001         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
10002
10003 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10004
10005         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
10006         (mbrtowc, mbstate_t): Define substitutes if
10007         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
10008         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
10009         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10010
10011 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10012
10013         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
10014         than 1024, return a memory chunk of least possible size, instead
10015         of size PATH_MAX + 2. In the loop, increment the size proportionally.
10016         Use free/xmalloc instead of xrealloc to avoid copying for very long
10017         paths.
10018
10019 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10020
10021         * canon-host.c (canon_host): Use malloc and memcpy to copy an
10022         address, not strdup.  Include <stdlib.h> and don't declare free().
10023
10024 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
10025
10026         * path-concat.c (path_concat): Don't access dir[-1] if dir is
10027         the empty string.
10028
10029 2000-06-21  Jim Meyering  <meyering@lucent.com>
10030
10031         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
10032         (noinst_HEADERS): Add getstr.h.
10033
10034         * getline.c (getstr): Move into a separate file.
10035         * getstr.c (getstr): New file, extracted from getline.c, with
10036         the following changes: new parameter, delim2; both delim[12]
10037         parameters have type `int', not `char'.  The latter would lose
10038         with 8-bit delimiters.
10039         * getstr.h: New file.
10040
10041 2000-06-19  Jim Meyering  <meyering@lucent.com>
10042
10043         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
10044
10045 2000-06-18  Jim Meyering  <meyering@lucent.com>
10046
10047         * mkdir.c: Remove file, due mainly to copyright incompatibility.
10048         Besides, these days every porting target provides a mkdir function.
10049
10050         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
10051         (this snippet comes from src/system.h).
10052
10053 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10054
10055         * human.c (adjust_value): New function.
10056         (human_readable_inexact): Apply rounding style even when
10057         printing approximate values.
10058
10059 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10060
10061         * human.c (human_readable_inexact): Allow an input block
10062         size that is not a multiple of the output block size, and vice versa.
10063         Reported by Piergiorgio Sartor.
10064
10065 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10066
10067         * getdate.y (get_date): Apply relative times after time
10068         zone indicator, not before.  Reported by Todd A. Jacobs.
10069
10070 2000-06-13  Jim Meyering  <meyering@lucent.com>
10071
10072         * Makefile.am (all-local): Depend on lstat.c and stat.c.
10073
10074         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
10075
10076 2000-06-12  Paul Eggert  <eggert@twinsun.com>
10077
10078         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
10079
10080 2000-06-04  Paul Eggert  <eggert@twinsun.com>
10081
10082         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
10083
10084 2000-06-04  Jim Meyering  <meyering@lucent.com>
10085
10086         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
10087         SunOS 4.1.4 for which gid_t is an unsigned type.
10088
10089 2000-06-03  Jim Meyering  <meyering@lucent.com>
10090
10091         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
10092
10093 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
10094
10095         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
10096         newer, don't install charset.alias.
10097         * config.charset: Change the Linux/glibc rules so they become empty
10098         on glibc-2.1 or newer.
10099
10100 2000-06-02  Jim Meyering  <meyering@lucent.com>
10101
10102         * mountlist.c: Back out last change.  Instead, do this...
10103         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
10104         member using the same `ignore'-testing code.
10105         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
10106         fs_type strings.
10107         From Mark D. Roth.
10108
10109 2000-05-29  Jim Meyering  <meyering@lucent.com>
10110
10111         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
10112         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
10113
10114 2000-05-22  Jim Meyering  <meyering@lucent.com>
10115
10116         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
10117
10118 2000-05-18  Jim Meyering  <meyering@lucent.com>
10119
10120         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
10121         back, too, since it may have been modified by allocate_entry.
10122         (hash_delete): Rewrite to use neither the assignment operator
10123         nor the comma operator in an if-expression.
10124
10125 2000-05-15  Paul Eggert  <eggert@twinsun.com>
10126
10127         * closeout.c:
10128         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
10129         Remove; no longer needed.
10130         "quotearg.h": Add include.
10131         (file_name): Do not bother to explicitly initialize to NULL; it's less
10132         efficient on some hosts.
10133         (close_stdout_status): Remove test as to whether stdout was already
10134         closed; it breaks for the case "echo x | sort >&-".
10135         Quote file name colons.
10136         Do not assume that _("write error") lacks format strings.
10137
10138 2000-05-15  Jim Meyering  <meyering@lucent.com>
10139
10140         * version-etc.c (version_etc_copyright): Update the copyright string
10141         used in all --version output.
10142
10143 2000-05-14  Jim Meyering  <meyering@lucent.com>
10144
10145         * closeout.c (close_stdout_set_file_name): New function.
10146         (close_stdout_status): Use new file-scoped global.
10147         Return right away if fstat says the stdout file descriptor is invalid.
10148         * closeout.h (close_stdout_set_file_name): Declare.
10149
10150 2000-05-10  Jim Meyering  <meyering@lucent.com>
10151
10152         * closeout.c [default_exit_status]: New file-scoped variable.
10153         (close_stdout_set_status): New function.
10154         * closeout.h (close_stdout_set_status): Declare.
10155
10156 2000-05-08  Jim Meyering  <meyering@lucent.com>
10157
10158         * long-options.c: Don't include closeout.h.
10159         (parse_long_options): Don't call close_stdout for --version.
10160
10161 2000-05-06  Jim Meyering  <meyering@lucent.com>
10162
10163         * strnlen.c: Undefine __strnlen and strnlen.
10164         [!weak_alias]: Define __strnlen to strnlen.
10165
10166         * atexit.c: New file, from libiberty.
10167
10168 2000-05-06  Jim Meyering  <meyering@lucent.com>
10169
10170         * closeout.c (close_stdout_status): Also check for errors on the
10171         stderr stream.
10172
10173 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
10174
10175         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
10176         instead of xmalloc, xrealloc, path_concat.
10177         (locale_charset): Treat empty environment variables as absent.
10178         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
10179
10180 2000-05-04  Jim Meyering  <meyering@lucent.com>
10181
10182         * getopt.c: Update from glibc.
10183         * obstack.c: Likewise.
10184         * obstack.h: Likewise.
10185         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
10186
10187         * regex.h: Likewise.
10188         * strndup.c: Likewise.
10189         * strnlen.c: New file, from glibc.
10190
10191 2000-05-01  Jim Meyering  <meyering@lucent.com>
10192
10193         * full-write.c (full_write): Remove `FIXME' part of comment.
10194
10195 2000-04-29  Jim Meyering  <meyering@lucent.com>
10196
10197         * path-concat.c: Declare strdup only if it's not defined.
10198         * canon-host.c: Likewise.
10199
10200 2000-04-28  Jim Meyering  <meyering@lucent.com>
10201
10202         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
10203         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
10204         included first, then limits.h is included by locale.h by libintl.h.
10205         From John David Anglin.
10206
10207 2000-04-25  Jim Meyering  <meyering@lucent.com>
10208
10209         * makepath.c (S_IRWXUGO): Define.
10210         (make_path): Always perform explicit chmod if MODE specifies any
10211         of the `special' permission bits.  Prompted by a bug report against
10212         install from Mate Wierdl and Joost van Baal.
10213
10214 2000-04-18  Jim Meyering  <meyering@lucent.com>
10215
10216         * README: New file.
10217
10218         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
10219         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
10220
10221 2000-04-17  Jim Meyering  <meyering@lucent.com>
10222
10223         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
10224         the definition of it to rpl_strftime also defined-away the system's
10225         declaration.
10226
10227 2000-04-15  Jim Meyering  <meyering@lucent.com>
10228
10229         Use `C' to denote so-called `contiguous' files, the same way
10230         that tar does.
10231         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
10232         (ftypelet): Use S_ISCTG.
10233         From Michael Deutschmann.
10234
10235 2000-04-14  Jim Meyering  <meyering@lucent.com>
10236
10237         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
10238
10239 2000-04-08  Jim Meyering  <meyering@lucent.com>
10240
10241         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
10242         names don't conflict.  Reported by Eli Zaretskii.
10243
10244 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
10245
10246         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
10247         bug.  Deal with the different error behavior of Irix iconv.
10248
10249 2000-04-07  Jim Meyering  <meyering@lucent.com>
10250
10251         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
10252         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
10253
10254 2000-04-05  Jim Meyering  <meyering@lucent.com>
10255
10256         Portability tweaks required for ultrix4.3.
10257         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
10258         * readutmp.c: Include sys/types.h before sys/stat.h.
10259         * canon-host.c: Declare strdup.
10260         * path-concat.c: Likewise.
10261         From John David Anglin.
10262
10263 2000-04-04  Jim Meyering  <meyering@lucent.com>
10264
10265         Be more DOS 8.3-friendly.
10266         * ref-add.sin: Renamed from ref-add.sed.in.
10267         * ref-del.sin: Renamed from ref-del.sed.in.
10268         * Makefile.am: Reflect renaming.
10269         Reported by Eli Zaretskii.
10270
10271         Use a temporary file name that won't clash with `charset.alias'
10272         in the DOS 8.3 name space.
10273         * Makefile.am (charset_tmp): Define.
10274         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
10275         (uninstall-local): Likewise.
10276         Reported by Eli Zaretskii.
10277
10278 2000-03-29  Paul Eggert  <eggert@twinsun.com>
10279
10280         * time/strftime.c (my_strftime): Make sure we call the system
10281         strftime, not ourselves, when invoking the underlying strftime.
10282
10283 2000-03-24  Jim Meyering  <meyering@lucent.com>
10284
10285         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
10286         (charset_alias): Define.
10287         (install-exec-local): Factor out common code.
10288         (uninstall-local): Split lines longer than 80.
10289         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
10290         (SUFFIXES): Define.
10291         (.sed.in.sed): New rule.  Don't redirect directly to $@.
10292         (CLEANFILES): Add ref-add.sed and ref-del.sed.
10293
10294 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
10295
10296         * config.charset: Output a line containing "Packages using this file".
10297         * ref-add.sed.in, ref-del.sed.in: New files.
10298         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
10299         ref-del.sed): New rules.
10300
10301 2000-03-17  Jim Meyering  <meyering@lucent.com>
10302
10303         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
10304         Otherwise, include <strings.h>
10305
10306 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
10307
10308         * unicodeio.c (utf8_wctomb): New function.
10309         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
10310         format instead of in UCS-4 with platform dependent endianness.
10311
10312 2000-03-07  Paul Eggert  <eggert@twinsun.com>
10313
10314         * savedir.c (savedir): Work even if directory size is
10315         negative; this can happen with some screwy NFS configurations.
10316
10317 2000-03-06  Jim Meyering  <meyering@lucent.com>
10318
10319         * localcharset.c (get_charset_aliases): Don't try to free file_name
10320         if it's NULL (because we ran out of memory).  From Bruno Haible.
10321
10322 2000-03-05  Jim Meyering  <meyering@lucent.com>
10323
10324         * localcharset.c ("path-concat.h"): Include.
10325         (get_charset_aliases): Use path_concat instead of ANSI string
10326         concatenation.
10327
10328         * unicodeio.h (PARAMS): Define.
10329         Use it to guard prototype.
10330
10331 2000-03-04  Jim Meyering  <meyering@lucent.com>
10332
10333         * Makefile.am (install-exec-local): Create $(libdir) before installing
10334         into it.
10335         (uninstall-local): Uncomment this rule so `make distcheck' works
10336         once again.
10337
10338         * unicodeio.c (<errno.h>): Include it.
10339         (errno): Declare if not defined.
10340
10341         * localcharset.c: Add Bruno's comment justifying use of volatile.
10342
10343         * config.charset: New version, incorporating remarks from a linux
10344         i18n mailing list.  From Bruno Haible.
10345
10346 2000-03-02  Jim Meyering  <meyering@lucent.com>
10347
10348         * Makefile.am (EXTRA_DIST): Add config.charset.
10349
10350 2000-03-01  Jim Meyering  <meyering@lucent.com>
10351
10352         * localcharset.c: Guard some #includes with `#if HAVE_...'.
10353         * unicodeio.c: Likewise.
10354
10355 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
10356
10357         * config.charset: New file.
10358         * localcharset.c: New file.
10359         * unicodeio.h, unicodeio.c: New files.
10360         * Makefile.am (DEFS): Add -DLIBDIR=...
10361         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
10362         (noinst_HEADERS): Add unicodeio.h.
10363         (all-local, install-exec-local, charset.alias): New targets.
10364
10365 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10366
10367         * quotearg.c (ALERT_CHAR): New macro.
10368         (quotearg_buffer_restyled): Use it.
10369
10370 2000-02-27  Jim Meyering  <meyering@lucent.com>
10371
10372         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
10373         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
10374
10375         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
10376         not `#if STDC_HEADERS'.
10377         Declare malloc if needed.
10378
10379         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
10380         now that autoconf always defines the HAVE_DECL_ symbols.
10381         * human.c: Likewise.
10382         * same.c: Likewise.
10383         * strtoumax.c: Likewise.
10384
10385         * backupfile.c: Arrange for cpp to fail if the configure-time
10386         declaration check was not run.
10387         * hash.c: Likewise.
10388         * human.c: Likewise.
10389         * same.c: Likewise.
10390         * strtoumax.c: Likewise.
10391
10392         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
10393         then first look up the entire `.'-containing string as a login name.
10394
10395 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10396
10397         * getdate.y: Handle two-digit years with leading zeros correctly.
10398         (textint): New typedef.
10399         (parser_control): Member year changed from int to textint.
10400         All uses changed.
10401         (YYSTYPE): Removed; replaced by %union with int and textint members.
10402         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
10403         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
10404         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10405         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10406         (date, number, to_year): Use width of number in digits, not its value,
10407         to determine whether it's a 2-digit year, or a 2-digit time.
10408         (yylex): Store number of digits of numeric tokens.
10409         Reported by John Kendall.
10410
10411         (parser_control): Changed from struct parser_control to typedef (for
10412         consistency).  All uses changed.
10413
10414         (tID): Removed; not used.
10415         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
10416
10417 2000-02-14  Paul Eggert  <eggert@twinsun.com>
10418
10419         * getpagesize.h (getpagesize): Port to VMS for Alpha;
10420         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
10421
10422 2000-02-12  Jim Meyering  <meyering@lucent.com>
10423
10424         * userspec.c (ISDIGIT): Define it.
10425         (isdigit): Remove definition.
10426         (is_number): Use ISDIGIT, not isdigit.
10427         <libintl.h>: Include.
10428         (_ and N_): Define.
10429         (parse_user_spec): Mark translatable strings.
10430
10431 2000-02-10  Jim Meyering  <meyering@lucent.com>
10432
10433         With these changes, nanosleep.[ch] are finally enough like the other
10434         lib/* replacement files to compile on a few more losing systems.
10435
10436         * nanosleep.h: Don't include config.h.
10437         Remove prototype from declaration of nanosleep.
10438         (PARAMS): Remove now-unneeded definition.
10439         * nanosleep.c: #undef nanosleep.
10440         (rpl_nanosleep): Rename from nanosleep.
10441
10442 2000-02-03  Jim Meyering  <meyering@lucent.com>
10443
10444         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
10445         rather than with `#if HAVE_UTMPNAME'.
10446
10447 2000-02-01  Jim Meyering  <meyering@lucent.com>
10448
10449         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
10450
10451 2000-01-31  Jim Meyering  <meyering@lucent.com>
10452
10453         * nanosleep.h (nanosleep): Guard declaration with
10454         `#if ! HAVE_DECL_NANOSLEEP'.
10455         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
10456         the declaration in that vendor's sys/timers.h.
10457         Reported by Christian Krackowizer.
10458
10459         * quotearg.c (ISASCII): Add #undef and move definition to follow
10460         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
10461         (ISPRINT): Likewise.
10462         Reported by Tom Tromey.
10463
10464 2000-01-30  Jim Meyering  <meyering@lucent.com>
10465
10466         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
10467         uses of ->ut_name.  The latter doesn't work with new Linux header files
10468         where only utmpx.ut_user is declared.
10469
10470         * readutmp.h (UT_USER): Define.
10471
10472 2000-01-23  Jim Meyering  <meyering@lucent.com>
10473
10474         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
10475         obstack.c.
10476
10477 2000-01-22  Jim Meyering  <meyering@lucent.com>
10478
10479         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
10480         [! HAVE_DECL_STRTOULL]: Declare strtoull.
10481         Required for some AIX systems.  Reported by Christian Krackowizer.
10482         [TESTING] (main): New function.
10483
10484         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
10485         * dirname.c (dir_name): Support for DOS-style file names with drive
10486         letters.
10487
10488         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
10489
10490         * strverscmp.c (ISDIGIT): Define.
10491         (strverscmp): Use ISDIGIT, not isdigit.
10492
10493 2000-01-17  Paul Eggert  <eggert@twinsun.com>
10494
10495         * nanosleep.c (nanosleep):
10496         Don't use SA_INTERRUPT to decide whether to call sigaction, as
10497         POSIX.1 doesn't require SA_INTERRUPT and some systems
10498         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
10499         it's been part of POSIX.1 since day 1 (in 1988).
10500
10501 2000-01-17  Jim Meyering  <meyering@lucent.com>
10502
10503         * interlock: Remove unused file.  Reported by François Pinard.
10504
10505 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10506
10507         * quotearg.c (quotearg_buffer_restyled): Do not quote
10508         alert, backslash, formfeed, and vertical tab unnecessarily in
10509         shell quoting style.
10510
10511
10512 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
10513 Free Software Foundation, Inc.
10514 Copying and distribution of this file, with or without modification,
10515 are permitted provided the copyright notice and this notice are preserved.