7793af0cd64ecb53d9978879504a942e9b4bca20
[gnulib.git] / lib / ChangeLog
1 2002-04-24  Jim Meyering  <meyering@lucent.com>
2
3         * Makefile.am (INCLUDES): Remove -I../intl.
4         (libfetish_a_SOURCES): Add gettext.h.
5
6 2002-04-16  Jim Meyering  <meyering@lucent.com>
7
8         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
9         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
10         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
11
12 2002-04-12  Jim Meyering  <meyering@lucent.com>
13
14         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
15
16 2002-03-10  Jim Meyering  <meyering@lucent.com>
17
18         * makepath.c (make_path): Remove a comma from a diagnostic.
19         Suggestion from Santiago Vila.
20
21 2002-03-08  Jim Meyering  <meyering@lucent.com>
22
23         * rename.c: Mention that this wrapper is needed also on
24         mips-dec-ultrix4.4 systems.
25
26 2002-03-02  Jim Meyering  <meyering@lucent.com>
27
28         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
29         not HAVE_CLOCK_SETTIME.
30
31 2002-02-27  Paul Eggert  <eggert@twinsun.com>
32
33         * nanosleep.h: Rename to....
34         * timespec.h: New name for nanosleep.h.  All uses changed.
35
36         * gettime.c: New file.
37         * settime.c: New file.
38         * stime.c: Remove.
39
40         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
41         timespec.h.  Remove nanosleep.h.
42
43 2002-02-25  Paul Eggert  <eggert@twinsun.com>
44
45         * acl.c, acl.h: New files.
46         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
47
48 2002-02-24  Jim Meyering  <meyering@lucent.com>
49
50         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
51         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
52         cause trouble.  Reported by Nelson Beebe.
53
54 2002-02-23  Paul Eggert  <eggert@twinsun.com>
55
56         * path-concat.c (xpath_concat): Reorder code to pacify
57         compilers that don't know that xalloc_die never returns.
58
59 2002-02-20  Jim Meyering  <meyering@lucent.com>
60
61         * getdate.c: Regenerate using bison-1.33.
62
63 2002-02-15  Paul Eggert  <eggert@twinsun.com>
64
65         * posixver.c, posixver.h: New files.
66         * Makefile.am (libfetish_a_SOURCES): Add them.
67
68 2002-02-02  Paul Eggert  <eggert@twinsun.com>
69             Bruno Haible  <bruno@clisp.org>
70
71         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
72         (fwrite_success_callback): New declaration.
73         * unicodeio.c (unicode_to_mb): New function, extracted from
74         print_unicode_char. Call failure callback instead of error.
75         (fwrite_success_callback): New function.
76         (exit_failure_callback): New function.
77         (fallback_failure_callback): New function.
78         (print_unicode_char): Call unicode_to_mb.
79
80 2002-01-26  Jim Meyering  <meyering@lucent.com>
81
82         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
83
84 2002-01-22  Jim Meyering  <meyering@lucent.com>
85
86         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
87         Otherwise, some versions of automake would omit the rule that makes
88         Makefile from Makefile.in.
89
90 2001-01-21  Paul Eggert  <eggert@twinsun.com>
91
92         * xmemcoll.h, xmemcoll.c: New files.
93         * Makefile.am (libfetish_a_SOURCES): Add them.
94         * memcoll.c: Include errno.h, and declare errno if not defined.
95         (memcoll): Set errno to zero if there is no error.
96
97         * quotearg.c (quotearg_buffer_restyled):
98         Fix bug with quoting buffers containing NUL when backslashing escapes.
99         This bug was exposed by the other changes in this patch.
100         (quotearg_n_options): New arg ARGSIZE.
101         All callers changed.
102         (quoting_options_from_style): New function.
103         (quotearg_n_style): Use it.
104         (quotearg_n_style_mem): New function.
105
106         * quotearg.h (quotearg_n_style_mem): New function.
107
108 2002-01-16  Jim Meyering  <meyering@lucent.com>
109
110         * getdate.y: Add three semicolons, each just before a closing brace.
111         Bison (as of version 1.31) no longer papers over that mistake.
112
113 2002-02-14  Paul Eggert  <eggert@twinsun.com>
114
115         * backupfile.c (ISDIGIT): Comment fix.
116         * getdate.y (ISDIGIT): Likewise.
117         * posixtm.c (ISDIGIT, year): Likewise.
118         * strverscmp.c (ISDIGIT): Likewise.
119         * userspec.c (ISDIGIT): Likewise.
120
121 2002-01-05  Jim Meyering  <meyering@lucent.com>
122
123         * version-etc.c (version_etc_copyright): Update copyright year.
124
125 2001-01-19  Paul Eggert  <eggert@twinsun.com>
126
127         * closeout.c (close_stdout_status): If ferror (stdout), do
128         not silently exit merely because the output buffer happens to
129         have nothing pending.
130
131 2001-12-18  Paul Eggert  <eggert@twinsun.com>
132
133         See the big note in ../ChangeLog.
134         * human.c (suffixes): Prefer K to k for 1024.
135         (generate_suffix_backwards): New function.
136         (human_readable_inexact): Use it.
137         * xstrtol.c (__xstrtol): If there is no number but there
138         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
139         Accept 'K' as well as 'k'.
140
141 2001-12-15  Jim Meyering  <meyering@lucent.com>
142
143         * regex.h (__restrict_arr): Update from libc.
144
145         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
146         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
147         (STREQ): Define.
148
149 2001-12-10  Jim Meyering  <meyering@lucent.com>
150
151         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
152         Instead, include "xalloc.h".
153         (initbuffer): Don't cast xmalloc return value to char*.
154         (readline): Reword comment.
155         Don't cast xrealloc return value to char*
156         Return NULL, not 0.
157
158 2001-12-09  Jim Meyering  <meyering@lucent.com>
159
160         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
161         `signed and unsigned type in conditional expression'.
162         * posixtm.c (posix_time_parse): Likewise.
163
164         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
165
166         * readtokens.c (readtoken): Declare an index to be of type unsigned
167         to avoid a pedantic warning.
168
169         * getstr.c: Don't include assert.h.
170         (getstr): Remove warning-evoking assertions.
171         Return -1 if offset parameter is out of bounds.
172         Change the type of a local from int to size_t.
173
174         * strftime.c (my_strftime_localtime_r): Include this function
175         definition in the `#if ! HAVE_TM_GMTOFF' block.
176
177         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
178         Include xalloc.h instead.
179
180 2001-12-02  Jim Meyering  <meyering@lucent.com>
181
182         * tempname.c: Don't declare getenv, thus reverting the change of
183         2001-11-18.  It's no longer necessary, now that stdlib.h is always
184         included.
185
186         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
187         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
188
189 2001-11-30  Akim Demaille  <akim@epita.fr>
190
191         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
192         before being defined.
193
194 2001-11-27  Paul Eggert  <eggert@twinsun.com>
195
196         * quotearg.h (quotearg_n, quotearg_n_style):
197         First arg is int, not unsigned.
198         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
199         (SIZE_MAX, UINT_MAX): New macros.
200         (quotearg_n_options): Abort if N is negative.
201         Avoid overflow check on hosts where size_t is 64 bits and int
202         is 32 bits, as overflow is impossible there.
203         Fix off-by-one typo that caused unnecessary reallocation.
204
205 2001-11-27  Jim Meyering  <meyering@lucent.com>
206
207         * tempname.c: Merge with version from libc.
208         * regex.c: Likewise.
209
210         * tempname.c: Include stdlib.h unconditionally.  On some old systems
211         for which STDC_HEADERS is 0, it was not included, resulting in a
212         warning about an integer-to-pointer conversion problem with getenv.
213         Reported by Volker Borchert.
214
215 2001-11-26  Jim Meyering  <meyering@lucent.com>
216
217         * gtod.h: Remove file.
218         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
219         * gettimeofday.c: Don't include gtod.h.
220         (GTOD_init): Remove function.
221         (rpl_gettimeofday): Do its job here instead, rather than aborting.
222         Suggestion from Volker Borchert.
223
224 2001-11-23  Jim Meyering  <meyering@lucent.com>
225
226         * hash.h (struct hash_table): Don't define here.  Merely declare it.
227         * hash.c (struct hash_table): Define it here instead.
228
229 2001-11-22  Jim Meyering  <meyering@lucent.com>
230
231         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
232
233 2001-11-18  Paul Eggert  <eggert@twinsun.com>
234
235         * tempname.c (TMP_MAX): Remove; no longer needed.
236         (TEMPORARIES): New macro.
237         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
238         removes an artificial limitation (e.g. HP-UX 10.20, where
239         TMP_MAX is 17576).
240
241 2001-11-18  Jim Meyering  <meyering@lucent.com>
242
243         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
244         on SunOS4.
245
246         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
247         files will be created before anything else.
248
249 2001-11-17  Jim Meyering  <meyering@lucent.com>
250
251         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
252         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
253         rather than group writable.  Patch by Juan F. Codagnone.
254
255         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
256         Instead, include "xalloc.h".
257
258         * mountlist.c: Include unlocked-io.h after all system headers.
259         Remove explicit declarations of xmalloc, xrealloc,
260         and xstrdup.  Instead, include "xalloc.h".
261
262         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
263         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
264         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
265
266         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
267         Reported by Padraig Brady.
268
269         * mkstemp.c: #undef mkstemp.
270         Include config.h.
271         (rpl_mkstemp): Rename from mkstemp.
272         Protoize.
273
274 2001-11-16  Jim Meyering  <meyering@lucent.com>
275
276         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
277         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
278         determine the amount of total physical memory, use pstat_getstatic.
279         HPUX-11 doesn't define _SC_PHYS_PAGES.
280         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
281         If sysconf couldn't be used to determine the amount of available
282         physical memory, use both pstat_getstatic and pstat_getdynamic.
283         Based on a patch from Bob Proulx.
284
285 2001-11-05  Jim Meyering  <meyering@lucent.com>
286
287         * xstat.in (slash_aware_lstat): Correct a misleading comment.
288
289 2001-11-03  Jim Meyering  <meyering@lucent.com>
290
291         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
292         in argmatch_to_argument call.
293
294         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
295         argument.
296
297         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
298         e.g., a fault due to an attempt to free a NULL pointer.
299
300 2001-11-01  Jim Meyering  <meyering@lucent.com>
301
302         * dirfd.c, dirfd.h: New files.
303         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
304
305         * hash.c (hash_print) [TESTING]: Clean up.
306
307 2001-10-22  Paul Eggert  <eggert@twinsun.com>
308
309         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
310         to avoid a warning if -Wall.
311
312 2001-10-21  Paul Eggert  <eggert@twinsun.com>
313
314         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
315
316 2001-10-21  Jim Meyering  <meyering@lucent.com>
317
318         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
319         this code would end up calling gettext even in packages built
320         with --disable-nls.
321         * getopt.c (_): Likewise.
322         * regex.c (_): Likewise.
323
324 2001-10-20  Paul Eggert  <eggert@twinsun.com>
325
326         * error.c (strerror_r): Do not declare unless !_LIBC.
327         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
328         Use strerror_r that is only a macro, even if it is not a function.
329         (strerror): Check for HAVE_DECL_STRERROR before declaring.
330         (private_strerror): Use prototypes, not old-style function definition.
331         (print_errno_message): New function.
332         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
333         char*-flavored one.
334         (error_tail, error, error_at_line): Use it.
335
336 2001-10-11  Jim Meyering  <meyering@lucent.com>
337
338         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
339         and quote_n (1, ... to avoid clobbering a buffer.
340
341 2001-10-05  Jim Meyering  <meyering@lucent.com>
342
343         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
344         * hash-pjw.c: New file (factored out of fileutils' remove.c).
345         * hash-pjw.h: New file.
346
347 2001-09-30  Jim Meyering  <meyering@lucent.com>
348
349         * mountlist.c [MOUNTED_GETFSSTAT]:
350         Include <sys/ucred.h>, for Apple Darwin.
351         Include sys/mount.h and sys/fs_types.h only if available.
352         (FS_TYPE): Define.
353         (read_filesystem_list): Use FS_TYPE.
354
355 2001-09-29  Paul Eggert  <eggert@twinsun.com>
356
357         * exclude.c (excluded_filename): 0 -> false, since it's
358         a boolean context.
359
360 2001-09-28  Paul Eggert  <eggert@twinsun.com>
361
362         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
363         #defines strtoimax.  Also treat the other strto* functions
364         like strtoimax.
365
366         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
367         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
368         (strtoimax, strtoumax): Do not declare if already defined as a macro.
369
370 2001-09-26  Jim Meyering  <meyering@lucent.com>
371
372         Most macros in unlocked-io.h had the wrong number of arguments.
373         * gen-uio: New script.
374         (USE_UNLOCKED_IO): Define to 1 if not already defined.
375         * unlocked-io.hin: Remove file.
376         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
377         rather than trying to embed it here.
378         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
379         Reported by Padraig Brady.
380
381 2001-09-25  Volker Borchert  <bt@teknon.de>
382
383         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
384
385 2001-09-23  Jim Meyering  <meyering@lucent.com>
386
387         * mountlist.c: Remove useless parentheses in #if directives.
388         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
389         the deprecated MOUNTED symbol is no longer defined in mntent.h.
390
391 2001-09-22  Jim Meyering  <meyering@lucent.com>
392
393         * localcharset.c: Update from latest gettext.
394         * config.charset: Likewise.
395
396 2001-09-20  Jim Meyering  <meyering@lucent.com>
397
398         * xstrtol.c (strtoimax): Guard declaration with
399         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
400         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
401         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
402         (strtoumax): Likewise, for completeness (it wasn't necessary).
403
404 2001-09-06  Paul Eggert  <eggert@twinsun.com>
405
406         * strtoimax.c (HAVE_LONG_LONG):
407         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
408         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
409         to work around bug in IBM C compiler.
410
411 2001-09-16  Jim Meyering  <meyering@lucent.com>
412
413         * mkdir.c: New file.
414
415 2001-09-04  Paul Eggert  <eggert@twinsun.com>
416
417         * xgetcwd.c: Revert some of the previous change; intead,
418         fix the HAVE_GETCWD_NULL code to behave more like the
419         !HAVE_GETCWD_NULL code used to.
420
421         Include "xalloc.h".
422         (xgetcwd): Do not return NULL when memory is exhausted; instead,
423         invoke xalloc_die.
424
425 2001-09-04  Paul Eggert  <eggert@twinsun.com>
426
427         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
428         Use ssize_t, not int, to store result of readlink.
429         Check for ssize_t overflow as well as size_t overflow,
430         as POSIX says the result of readlink is implementation-defined
431         when ssize_t overflows.
432         Remove unnecessary cast to char*.
433         Use free+malloc instead of realloc, as the storage doesn't need
434         to be preserved and it's clearer and can be more efficient that way.
435         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
436         * xreadlink.h (xreadlink): Update prototype.
437
438 2001-09-03  Paul Eggert  <eggert@twinsun.com>
439
440         * exclude.c (fnmatch_no_wildcards): Fix confusion between
441         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
442         spotted by Jim Meyering.
443
444 2001-09-03  Jim Meyering  <meyering@lucent.com>
445
446         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
447
448 2001-09-03  Paul Eggert  <eggert@twinsun.com>
449
450         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
451         like the HAVE_GETCWD_NULL code.
452         Include pathmax.h if not HAVE_GETCWD.
453         Do not include xalloc.h.
454         (INITIAL_BUFFER_SIZE): New symbol.
455         Do not use xmalloc / xrealloc, since the caller is responsible for
456         handling errors.  Preserve errno around `free' during failure.
457         Do not overrun buffer when using getwd.
458
459 2001-09-03  Paul Eggert  <eggert@twinsun.com>
460
461         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
462         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
463
464 2001-09-02  Jim Meyering  <meyering@lucent.com>
465
466         * error.c: Update from GNU libc.
467
468 2001-09-01  Jim Meyering  <meyering@lucent.com>
469
470         * xreadlink.c: New file.
471         * xreadlink.h: New file.
472         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
473
474         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
475         doesn't conflict with sparc-sun-solaris2.7's definition in
476         /usr/include/sys/int_types.h.
477
478         * exclude.c: Use `""', not `<>' to #include non-system header files.
479         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
480         and strncasecmp as r-values.  Unixware didn't have declarations.
481
482 2001-08-31  Jim Meyering  <meyering@lucent.com>
483
484         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
485         Use an initial, malloc'd, buffer of length 128 rather than
486         a statically allocated one of length 1024.
487
488 2001-08-30  Paul Eggert  <eggert@twinsun.com>
489
490         * xgetcwd.c: Don't include pathmax.h.
491         Include stdlib.h and unistd.h if available.
492         Include xalloc.h.
493         (xmalloc, xstrdup, free): Remove decls.
494         (xgetcwd): Don't assume sizes fit in unsigned.
495         Check for overflow when computing sizes.
496         Simplify reallocation code.
497
498 2001-08-28  Paul Eggert  <eggert@twinsun.com>
499
500         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
501
502         * strtoimax.c: Renamed from strtoxmax.c, removing the
503         old strtoimax.c.
504
505         Also, make the following further changes to make this file's
506         configuration more similar to that of strtol.c:
507         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
508         (strtoumax, uintmax_t, strtoull, strtol): Remove.
509         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
510         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
511         changed to signed values.
512
513         And make the following changes as well:
514         Fix copyright notice, as 1999 was missing.
515         (verify): New macro.
516         (strtoimax): Check sizes at compile-time, not run-time.
517         Prefer strtol to strtoll if both work.
518         (main): Remove; it was not that useful and was a pain to maintain.
519
520         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
521
522 2001-08-30  Paul Eggert  <eggert@twinsun.com>
523
524         * savedir.c (savedir): Remove size parameter, as POSIX says that
525         a directory's st_size can have an arbitrary value, so the old
526         usage could waste an arbitrary amount of memory.  All uses
527         changed.
528         * savedir.h: Update prototype.
529
530 2001-08-30  Paul Eggert  <eggert@twinsun.com>
531
532         * xstrtol.c (strtoimax): New decl.
533
534 2001-08-28  Paul Eggert  <eggert@twinsun.com>
535
536         * xstrtol.h: Add copyright notice.
537         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
538         LONGINT_INVALID_SUFFIX_CHAR.
539
540 2001-08-30  Paul Eggert  <eggert@twinsun.com>
541
542         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
543         tm to be declared.
544
545 2001-08-30  Paul Eggert  <eggert@twinsun.com>
546
547         * hash.c: Remove '2001' from copyright notice.
548
549 2001-08-30  Paul Eggert  <eggert@twinsun.com>
550
551         * full-write.h: New file.
552         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
553         * full-write.c: Correct credits, as cccp.c no longer
554         exists and anyway it was so heavily changed from the old cccp
555         code as to be unrecognizable.  Include full-write.h.
556         (full_write) Return size_t, with short writes meaning failure.
557         All callers changed.  This fixes a bug with large buffers
558         on 64-bit hosts.
559         * utime.c: Include full-write.h.
560
561 2001-08-30  Paul Eggert  <eggert@twinsun.com>
562
563         Merge 'exclude' changes from tar 1.13.22.
564         This fixes one or two unlikely storage allocation overflow bugs,
565         but doesn't change user-visible behavior otherwise.
566
567 2001-08-30  Paul Eggert  <eggert@twinsun.com>
568
569         * exclude.c (bool): Declare, perhaps by including stdbool.h.
570         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
571         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
572         Include if available.
573         (<xalloc.h>): Include
574         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
575         (verify): New macro.  Use it to verify that EXCLUDE macros do not
576         collide with FNM macros.
577         (struct patopts): New struct.
578         (struct exclude): Use it, as exclude patterns now come with options.
579         (new_exclude): Support above changes.
580         (new_exclude, add_exclude_file):
581         Initial size must now be a power of two to simplify overflow checking.
582         (free_exclude, fnmatch_no_wildcards): New function.
583         (excluded_filename): No longer requires options arg, as the options
584         are determined by add_exclude.  Now returns bool, not int.
585         (excluded_filename, add_exclude):
586         Add support for the fancy new exclusion options.
587         (add_exclude, add_exclude_file): Now takes int options arg.
588         Check for arithmetic overflow when computing sizes.
589         (add_exclude_file): xrealloc might modify errno, so don't
590         realloc until after errno might be used.
591
592         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
593         New macros.
594         (free_exclude): New decl.
595         (add_exclude, add_exclude_file): Now takes int options arg.
596         (excluded_filename): No longer requires options arg, as the options
597         are determined by add_exclude.  Now returns bool, not int.
598
599 2001-08-30  Paul Eggert  <eggert@twinsun.com>
600
601         * alloca.c (alloca): Arg is of type size_t, not unsigned.
602
603 2001-08-27  Jim Meyering  <meyering@lucent.com>
604
605         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
606
607         * version-etc.c (N_): Remove definition.
608         Revert most of last change.
609         Instead, simply don't mark the `Copyright...' string for translation.
610         Based on advice from Paul Eggert.
611
612         * strtoxmax.c: Tweak comment.
613
614 2001-08-26  Jim Meyering  <meyering@lucent.com>
615
616         * version-etc.c (version_etc_copyright_fmt): Replace literal year
617         of copyright with `%s' so translators don't get an untranslated
618         message in 2002.
619         (COPYRIGHT_YEAR): Define.
620         (version_etc): Use fprintf rather than fputs.
621         Suggestion from Ulrich Drepper.
622
623         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
624
625         * strtoll.c: New file, from GNU libc.
626         * xstrtoimax.c: New file.
627
628         * xstrtol.h: Add xstrtoimax.
629         * strtoumax.c: New file.  Simply include "strtoumax.c".
630         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
631
632         * strtoumax.c: Factor to work both for unsigned and signed types, ...
633         * strtoxmax.c: ... then renamed to this.
634
635 2001-08-13  Paul Eggert  <eggert@twinsun.com>
636
637         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
638         Port to Solaris 8, where 'sed' requires a space after the 'r'
639         command, and where sh dislikes "$/".  Clean up the spacing a bit.
640         Redirect output to $tmp just once.
641
642 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
643
644         * addext.c (<errno.h>): Include.
645         (errno): Declare if not defined.
646         (addext): Work correctly when pathconf returns -1 and leaves
647         errno alone because there is no limit.  Also, work even if
648         pathconf returns a value greater than SIZE_MAX.
649
650 2001-08-12  Jim Meyering  <meyering@lucent.com>
651
652         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
653         Simply `return getcwd (NULL, 0);'.
654         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
655         Use 1300 as initial value for length, not PATH_MAX.
656
657         * pathmax.h: Clean up cpp syntax.
658
659 2001-08-12  Jim Meyering  <meyering@lucent.com>
660
661         * gettimeofday.c: New file.
662         * gtod.h: New file.
663         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
664
665 2001-08-04  Jim Meyering  <meyering@lucent.com>
666
667         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
668         to get in sync with glibc.
669
670 2001-08-03  Paul Eggert  <eggert@twinsun.com>
671
672         The following changes are from gettext 0.10.39 as maintained by
673         Bruno Haible.
674
675         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
676         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
677         with inverted sense.  All uses changed.
678
679         * mbswidth.c: Don't include <limits.h>.
680         Include <stdlib.h> and <string.h> unconditionally.
681         (iswcntrl, mbsinit, ISCNTRL): New macros.
682         (mbsnwidth): Use K&R style function declarations.
683         Don't bother checking for MB_LEN_MAX == 1, since the compiler
684         can optimize it when MB_CUR_MAX == 1.
685         The width of control characters is zero, not 1.
686
687 2001-07-15  Jim Meyering  <meyering@lucent.com>
688
689         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
690         (BUILT_SOURCES): Add unlocked-io.h.
691         (io_functions): Define.
692         (unlocked-io.h): New rule.
693         (DISTCLEANFILES): Add unlocked-io.h.
694         (all-local): Depend on unlocked-io.h, to ensure it is created.
695
696         * unlocked-io.hin: New file
697
698         * regex.c: Update from glibc.
699
700 2001-07-05  Jim Meyering  <meyering@lucent.com>
701
702         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
703         recommendation.
704         (libfetish_a_SOURCES): Put all .h files here instead.
705         Remove a thus-exposed (better checks in automake) duplicate and
706         two unnecessary .h files.
707
708 2001-06-11  Jim Meyering  <meyering@lucent.com>
709
710         * regex.c: Update from GNU libc.
711
712 2001-05-27  Jim Meyering  <meyering@lucent.com>
713
714         * readutmp.h (UT_TYPE): Define.
715
716 2001-05-24  Jim Meyering  <meyering@lucent.com>
717
718         * argmatch.c: Include "quote.h".
719         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
720         quote function.  Reported by Göran Uddeborg.
721
722 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
723
724         * dirname.c (dir_name): Compute append_dot using path, not newpath
725         which is not yet declared.
726
727 2001-05-11  Paul Eggert  <eggert@twinsun.com>
728
729         * Makefile.am (libfetish_a_SOURCES):
730         Add strftime.c, since we now compile it on all hosts.
731
732         * strftime.c (my_strftime):
733         Define to nstrftime if emacs, but only if my_strftime is not defined.
734         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
735         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
736         Add one more extra argument: a nanoseconds value.
737         All uses changed.
738         (ns): New macro.
739         (my_strftime function): Add %N format.
740         (emacs_strftimeu): Renamed from emacs_strftime,
741         with extra ut argument.
742
743 2001-05-11  Paul Eggert  <eggert@twinsun.com>
744
745         dirname code cleanup.  base_name now behaves more compatibly
746         with POSIX basename when given file names that have trailing
747         slashes, and similarly for dir_name.  Add new primitives
748         base_len and dir_len.  Put the directory-name-related decls
749         into dirname.h.
750
751         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
752         * backupfile.c (base_name): Likewise.
753         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
754         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
755         * makepath.c (strip_trailing_slashes): Likewise.
756         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
757         Likewise.
758         * rename.c (strip_trailing_slashes): Likewise.
759         * same.c (base_name): Likewise.
760         * stripslash.c (ISSLASH): Likewise.
761
762         * addext.c: Include <dirname.h> after size_t is defined.
763         * backupfile.c: Likewise.
764
765         * addext.c (addext): Use base_len to trim redundant
766         trailing slashes instead of doing it ourselves.
767         But do not trim the last slash if it is not redundant.
768
769         * backupfile.c (find_backup_file_name,
770         max_backup_version): Use base_len instead of rolling it ourselves.
771         Handle the case of "" and (on DOS) "C:" correctly.
772
773         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
774         Include <string.h>, <dirname.h>.
775         (base_name): Allow file names ending in slashes, other than names
776         that are all slashes.  In this case, return the basename followed
777         by the slashes.  This is more general, and can be used in places
778         where the original base_name purposely had an assertion failure.
779         (base_len): New function.
780
781         * dirname.c: Include <string.h> instead of <stdlib.h>.
782         Do not include <assert.h>; no longer needed.
783         Include xalloc.h.
784         (memrchr): Remove decl.
785         (dir_name_r): Remove.
786         (dir_len): Renamed from dirlen.  All callers changed.
787         Rewrite in terms of base_name, for simplicity and consistency.
788         (dir_name): Never return NULL.  All callers changed.
789         Do not include <stdlib.h> in test program; no longer needed.
790         return 0; is fine for test program.
791
792         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
793         New macros.
794         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
795
796         * path-concat.c (path_concat): Use base_len to compute
797         base length, not strlen; this means we cannot rely on memcpy
798         to null-terminate.
799
800         * same.c (STREQ): Remove.
801         (same_name): Handle the case where the basename ends in trailing '/'.
802
803         * stripslash.c (strip_trailing_slashes): Return nonzero if
804         a slash was stripped.  Do not strip the last slash after a
805         file system prefix.
806
807 2001-04-08  Jim Meyering  <meyering@lucent.com>
808
809         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
810         recomputed; that's necessary when the offset spans a DST transition.
811         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
812
813 2001-04-02  Jim Meyering  <meyering@lucent.com>
814
815         * regex.h, regex.c: Update from GNU libc.
816
817 2001-03-19  Paul Eggert  <eggert@twinsun.com>
818
819         * version-etc.c (version_etc_copyright): Update to 2001.
820
821 2001-03-16  Paul Eggert  <eggert@twinsun.com>
822
823         * tempname.c (uint64_t): Define to uintmax_t if
824         not defined, and if UINT64_MAX is not defined.
825         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
826         Reported by John David Anglin.
827
828 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
829
830         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
831         alias if codeset is empty.
832         * config.charset (BeOS): Use wildcard syntax.
833
834 2001-03-13  Jim Meyering  <meyering@lucent.com>
835
836         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
837         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
838         From Bruno Haible.
839
840 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
841
842         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
843         Don't return NULL.
844         * unicodeio.c (print_unicode_char): Simplify accordingly.
845
846 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
847
848         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
849         support for DOS/DJGPP.
850
851 2001-02-28  Paul Eggert  <eggert@twinsun.com>
852
853         * Makefile.am (libfetish_a_SOURCES):
854         Add dup-safer.c, fopen-safer.c.
855         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
856
857         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
858
859 2001-02-25  Paul Eggert  <eggert@twinsun.com>
860
861         The mkstemp replacement is taken from glibc 2.2.2, with some
862         portability fixes for use outside glibc, as follows:
863
864         * tempname.c (struct_stat64): New macro.
865         (direxists, __gen_tempname): Use it.
866         This avoids a portability problem with Solaris 8.
867
868         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
869         (<stddef.h>, <stdint.h>, <string.h>):
870         Include only if STDC_HEADERS || _LIBC.
871         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
872         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
873         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
874         (__set_errno): Define this macro if <errno.h> doesn't.
875         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
876         Define these macros if <stdio.h> doesn't.
877         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
878         Define these macros if <sys/stat.h>
879         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
880         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
881         __xstat64): Define if not _LIBC.
882         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
883         (__gen_tempname): Invoke gettimeofday only if
884         HAVE_GETTIMEOFDAY || _LIBC;
885         otherwise, fall back on plain "time".
886         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
887
888         * mkstemp.c (__GT_FILE): Define to zero if not defined.
889
890         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
891
892 2001-02-17  Jim Meyering  <meyering@lucent.com>
893
894         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
895         around included file name.
896
897         * strnlen.c (__strnlen): Merge in a change from GNU libc.
898
899         * strftime.c: Update from GNU libc (the only changes were to comments).
900
901 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
902
903         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
904
905 2001-02-17  Paul Eggert  <eggert@twinsun.com>
906
907         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
908         Remove workaround macros for hosts that have mbrtowc but not
909         mbstate_t, as we now insist on proper declarations for both
910         before using mbrtowc.
911
912 2001-02-17  Jim Meyering  <meyering@lucent.com>
913
914         * regex.c: Update from libc.
915
916 2001-02-16  Paul Eggert  <eggert@twinsun.com>
917
918         * alloca.c (malloc): Undef before defining, since stdlib.h
919         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
920         Reported by Mark Hounschell via Paul Eggert.
921
922 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
923
924         * config.charset: Update for FreeBSD 4.2.
925
926 2001-01-26  Jim Meyering  <meyering@lucent.com>
927
928         * quotearg.c: Include stddef.h.
929         * quote.c: Include stddef.h.
930         Reported by Axel Kittenberger.
931
932         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
933         line in double quotes so that it evokes a better diagnostic.
934         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
935         Reported by Axel Kittenberger.
936
937 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
938
939         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
940         to avoid a warning.  Add back 'const' to inptr.
941
942 2001-01-16  Jim Meyering  <meyering@lucent.com>
943
944         * basename.c: Include <stdio.h>, needed by assert on SunOS4.
945         From Bruno Haible.
946
947 2001-01-14  Jim Meyering  <meyering@lucent.com>
948
949         * rename.c: New file.  From Volker Borchert.
950         Include stdlib.h, string.h or strings.h, and xalloc.h.
951         Use strip_trailing_slashes rather than open-coding it.
952
953 2001-01-03  Paul Eggert  <eggert@twinsun.com>
954
955         * strftime.c: Sync with glibc time/strftime.c 1.81.
956
957 2001-01-03  Jim Meyering  <meyering@lucent.com>
958
959         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
960         local `inptr' to avoid warning with some system declarations of iconv.
961
962 2000-12-29  Paul Eggert  <eggert@twinsun.com>
963
964         * modechange.c: Do not assume that mode_t uses the
965         traditional octal encoding.  E.g. "chmod 1 FOO" should set
966         the other-execute bit of FOO even if S_IXOTH != 1.
967
968         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
969         WOTH, XOTH, ALLM): New macros.
970         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
971          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
972         Use them.
973         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
974         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
975         (mode_compile):
976         No need to use uintmax_t; unsigned long is long enough.
977         Don't bother to get suffix since we don't use it.
978
979 2000-12-24  Jim Meyering  <meyering@lucent.com>
980
981         * hash.c (is_prime): Return explicit boolean values.
982         (hash_get_first): Return NULL to appease Irix5.6's 89.
983         Reported by Nelson Beebe.
984
985 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
986
987         * localcharset.c (locale_charset): Add support for Win32.
988
989 2000-12-18  Paul Eggert  <eggert@twinsun.com>
990
991         * physmem.h, physmem.c: New files.
992
993         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
994         (noinst_HEADERS): Add physmem.h.
995
996         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
997         't' for compatibility with Solaris 8 sort.
998
999 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
1000
1001         * config.charset: Add support for BeOS.
1002
1003 2000-12-16  Jim Meyering  <meyering@lucent.com>
1004
1005         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
1006         SHELLS_FILE to a file name that's useful on djgpp systems.
1007         Include stdlib.h.
1008         (ADDITIONAL_DEFAULT_SHELLS): Define.
1009         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
1010         Based mostly on a patch from Prashant TR.
1011
1012 2000-12-16  Jim Meyering  <meyering@lucent.com>
1013
1014         This bug had a serious impact on chown: `chown N:M FILE' (for integer
1015         N and M) would have treated it like `chown N:N FILE'.
1016
1017         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
1018
1019 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
1020
1021         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
1022         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
1023         to the list of canonical encodings. Rename EUC-CN to GB2312.
1024
1025 2000-12-08  Andreas Schwab  <schwab@suse.de>
1026
1027         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
1028         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
1029
1030 2000-12-07  Jim Meyering  <meyering@lucent.com>
1031
1032         * stripslash.c (ISSLASH): Define.
1033         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
1034         From Prashant TR.
1035
1036         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
1037         (dir_name_r): Declare this function as static.
1038         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
1039         manifest itself on a name containing a mix of slashes and
1040         backslashes.
1041         Make this function work with names starting with a DOS-style
1042         drive letter and colon prefix.
1043         (dir_name): Append `.' if necessary.
1044         Based mostly on patches from Prashant TR and Eli Zaretskii.
1045
1046         * dirname.h (dir_name_r): Remove prototype.
1047
1048 2000-12-05  Jim Meyering  <meyering@lucent.com>
1049
1050         * dirname.c (dir_name_r): Add `const' in a few local declarations.
1051
1052 2000-12-04  Jim Meyering  <meyering@lucent.com>
1053
1054         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
1055         Also include memory.h, stdlib.h, unistd.h if appropriate.
1056         Reported by Andreas Jaeger (conflicting declaration of malloc).
1057
1058 2000-12-02  Jim Meyering  <meyering@lucent.com>
1059
1060         * closeout.h: Make idempotent, to avoid some obscure warnings.
1061
1062 2000-12-01  Paul Eggert  <eggert@twinsun.com>
1063
1064         * memrchr.c: Include <config.h> before any system include file.
1065
1066 2000-11-29  Paul Eggert  <eggert@twinsun.com>
1067
1068         * dirname.c (dir_name_r): Fix typo: int -> size_t.
1069
1070 2000-11-26  Jim Meyering  <meyering@lucent.com>
1071
1072         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
1073
1074 2000-11-22  Paul Eggert  <eggert@twinsun.com>
1075
1076         * strftime.c (my_strftime): Do not invoke mbrlen with a
1077         size of (size_t) -1; it's not portable.
1078
1079 2000-11-17  Akim Demaille  <akim@epita.fr>
1080
1081         * obstack.h: Formatting changes.
1082         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
1083         prevent type checking.
1084         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
1085         cast the value to (void *): assigning a `foo *' to a `void *'
1086         variable is valid.
1087         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
1088
1089 2000-11-17  Jim Meyering  <meyering@lucent.com>
1090
1091         * strstr.c: Update from GNU libc.
1092
1093 2000-11-16  Jim Meyering  <meyering@lucent.com>
1094
1095         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
1096
1097 2000-11-11  Jim Meyering  <meyering@lucent.com>
1098
1099         * error.c: Add a couple #includes, merging from GNU libc version.
1100
1101 2000-11-10  Jim Meyering  <meyering@lucent.com>
1102
1103         * obstack.h: Update from GNU libc.
1104         * obstack.c: Likewise.
1105
1106 2000-11-06  Paul Eggert  <eggert@twinsun.com>
1107
1108         * getusershell.c (setusershell): Use rewind rather than
1109         fseek/fseeko, to avoid configuration hassles with fseeko.
1110         Don't bother opening SHELLS_FILE if shellstream is NULL;
1111         it's not necessary.
1112
1113 2000-11-05  Jim Meyering  <meyering@lucent.com>
1114
1115         * makepath.h (make_dir): Declare.
1116         * makepath.c (make_dir): Remove `static' attribute.
1117         Tweak a comment.
1118
1119 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
1120
1121         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
1122         last one in a bucket, advance to the next bucket.
1123
1124 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
1125
1126         * fnmatch.c: Do not comment out all the code if we are using
1127         the GNU C library, because in some cases we are replacing buggy
1128         code in the GNU C library itself.
1129
1130 2000-10-30  Paul Eggert  <eggert@twinsun.com>
1131
1132         * error.h, getline.h, modechange.h:
1133         Remove "2000" from Copyright line, as the file hasn't been
1134         changed this year other than in the copyright notice.
1135
1136         * xalloc.h: Add "2000" to Copyright line, as this file
1137         was changed this year.
1138
1139 2000-10-30  Paul Eggert  <eggert@twinsun.com>
1140
1141         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
1142         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
1143         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
1144
1145 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
1146
1147         * regex.h (__restrict_arr): Move definition out of #ifndef block.
1148         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
1149         doesn't define __restrict_arr.
1150
1151 2000-10-29  Jim Meyering  <meyering@lucent.com>
1152
1153         * xstat.in: Fix grammar in comment.
1154
1155 2000-10-28  Jim Meyering  <meyering@lucent.com>
1156
1157         * memchr.c: Update from libc.
1158         Adjust for portability:
1159         [HAVE_STDLIB_H]: Include stdlib.h.
1160         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
1161         Undef __memchr, too.
1162         [!weak_alias]: Define __memchr to memchr.
1163
1164         * regex.c: Update from libc.
1165         * regex.h: Likewise.
1166         * getopt1.c: Likewise.
1167         * memcmp.c: Likewise.
1168
1169         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
1170         Avoid using fseek, when possible -- it's broken by design.
1171         Patch by Ulrich Drepper.
1172
1173 2000-10-26  Jim Meyering  <meyering@lucent.com>
1174
1175         * strftime.c: Update from libc.
1176
1177 2000-10-25  Jim Meyering  <meyering@lucent.com>
1178
1179         * obstack.c: Update from libc.
1180
1181 2000-10-23  Jim Meyering  <meyering@lucent.com>
1182
1183         * hard-locale.c (hard_locale): Revert last change -- it was simply
1184         wrong.  That set_locale call must not have any side effects.
1185         From Paul Eggert.
1186
1187 2000-10-22  Jim Meyering  <meyering@lucent.com>
1188
1189         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
1190         [CYCLIC]: Remove now-unused definition.
1191
1192         * save-cwd.c (O_DIRECTORY): Define, if needed.
1193         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
1194         Suggestion from Ulrich Drepper.
1195
1196 2000-10-21  Jim Meyering  <meyering@lucent.com>
1197
1198         * dirname.c (dir_name_r): New function, factored out of dir_name.
1199         (dir_name): Use dir_name_r.
1200         * dirname.h (dir_name_r): Declare it.
1201
1202 2000-10-21  Jim Meyering  <meyering@lucent.com>
1203
1204         * dirname.c (memrchr): Declare if necessary.
1205         (dir_name): Remove the restriction that there be no
1206         trailing slashes.  Now, this code skips past them, effectively
1207         ignoring them.
1208         [TEST_DIRNAME] (main): New unit tests.
1209
1210         * memrchr.c: New file from GNU libc.
1211         Undef __memrchr, too.
1212         [!weak_alias]: Define __memrchr to memrchr.
1213         Guard weak_alias use with `#ifdef weak_alias'.
1214
1215 2000-10-17  Jim Meyering  <meyering@lucent.com>
1216
1217         * quote.h (PARAMS): Define and use.
1218         Reported by Akim Demaille.
1219
1220         * getopt.c: Update from libc.
1221
1222 2000-10-16  Jim Meyering  <meyering@lucent.com>
1223
1224         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
1225         From Jan Fedak.
1226
1227 2000-09-25  Jim Meyering  <meyering@lucent.com>
1228
1229         * md5.h (rol): Define (from GnuPG).
1230
1231         * sha.c: Give credit (GnuPG) where due.
1232         (M): Use rol rather than open-coding it.
1233         Add a FIXME comment.
1234
1235 2000-09-21  Jim Meyering  <meyering@lucent.com>
1236
1237         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
1238         Reported by Michael Stone.
1239
1240 2000-09-20  Jim Meyering  <meyering@lucent.com>
1241
1242         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
1243         (noinst_HEADERS): Add sha.h.
1244         Based on code from Scott G. Miller and from GnuPG.
1245
1246 2000-09-15  Jim Meyering  <meyering@lucent.com>
1247
1248         * regex.c: Update from libc.
1249
1250 2000-09-10  Jim Meyering  <meyering@lucent.com>
1251
1252         * getopt.c (_getopt_internal): Update from glibc.
1253
1254 2000-09-09  Jim Meyering  <meyering@lucent.com>
1255
1256         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
1257         think it should be used as a general replacement for isascii.
1258         * fnmatch.c: Likewise.
1259         * mbswidth.c: Likewise
1260         * regex.c: Likewise.
1261
1262         Don't use atoi.
1263         * userspec.c: Include sys/param.h and limits.h.
1264         Include xstrtol.h.
1265         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
1266         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
1267         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
1268         UID, GID.  Check range.
1269
1270 2000-09-06  Jim Meyering  <meyering@lucent.com>
1271
1272         * getopt.c (_getopt_internal): Update from glibc.
1273
1274 2000-08-30  Jim Meyering  <meyering@lucent.com>
1275
1276         * strftime.c: Merge in changes from GNU libc.
1277
1278 2000-08-26  Jim Meyering  <meyering@lucent.com>
1279
1280         * closeout.c: Include "__fpending.h".
1281         (close_stdout_status): Return right away if there's nothing to flush.
1282
1283         * Makefile.am (noinst_HEADERS): Add __fpending.h.
1284         * __fpending.c: New file.
1285         * __fpending.h: New file.
1286
1287 2000-08-07  Paul Eggert  <eggert@twinsun.com>
1288
1289         Standardize on "memory exhausted" instead of "Memory exhausted"
1290         or "virtual memory exhausted".
1291         * obstack.c (print_and_abort): Use "memory exhausted", not
1292         "virtual memory exhausted".
1293         * same.c (same_name): Invoke xalloc_die instead of printing
1294         our own message.
1295         * userspec.c (parse_user_spec): Likewise.
1296         * bumpalloc.h: comment fix
1297         * same.c, userspec.c: Include xalloc.h.
1298
1299         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
1300         not char *const and pointing to a constant array.
1301         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
1302         (xrealloc): Comment fix.
1303
1304         * userspec.c (parse_user_spec):
1305         Don't translate a message until just before returning,
1306         to avoid unnecessary translation.
1307
1308 2000-08-07  Jim Meyering  <meyering@lucent.com>
1309
1310         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
1311         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
1312         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
1313         getgroups.c, gethostname.c, getopt.h, group-member.c,
1314         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
1315         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
1316         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
1317         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
1318         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
1319         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
1320         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
1321         yesno.c: Back out Copyright date changes for each file with no change
1322         this year.  This eases coordination with other programs using the same
1323         source code modules.  From Paul Eggert.
1324
1325 2000-08-03  Greg McGary  <greg@mcgary.org>
1326
1327         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
1328         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
1329         (EXTEND_BUFFER): Use them.
1330
1331 2000-08-01  Jim Meyering  <meyering@lucent.com>
1332
1333         * dirname.c (ISSLASH): Define.
1334         (BACKSLASH_IS_PATH_SEPARATOR): Define.
1335         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
1336         both `\' and `/' may be use as path separators.
1337         Based on a patch from Prashant TR.
1338
1339 2000-07-31  Paul Eggert  <eggert@twinsun.com>
1340
1341         * quotearg.c (quotearg_n_options): Don't make the initial
1342         slot vector a constant, since it might get modified.
1343
1344 2000-07-31  Jim Meyering  <meyering@lucent.com>
1345
1346         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
1347         * obstack.c (print_and_abort): Likewise.
1348
1349 2000-07-30  Paul Eggert  <eggert@twinsun.com>
1350
1351         * quotearg.c (quotearg_n_options): Preallocate a slot 0
1352         buffer, so that the caller can always quote one small
1353         component of a "memory exhausted" message in slot 0.
1354         From a suggestion by Jim Meyering.
1355
1356 2000-07-30  Jim Meyering  <meyering@lucent.com>
1357
1358         * makepath.c (make_path): Quote the other instance, too.
1359
1360         * quotearg.c (N_STATIC_SLOTVECS): Define.
1361         (STATIC_BUF_SIZE): Define.
1362         (quotearg_n_options): Use only statically allocated storage when
1363         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
1364         than STATIC_BUF_SIZE.
1365
1366 2000-07-29  Jim Meyering  <meyering@lucent.com>
1367
1368         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
1369         * dirname.c (dir_name): Likewise.
1370
1371         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
1372
1373         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
1374         (dir_name): Assert that there are no trailing slashes.
1375
1376 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
1377
1378         * mbswidth.h (mbswidth): Add a flags argument.
1379         (mbswidth): New declaration.
1380         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
1381         * mbswidth.c (mbswidth): Add a flags argument.
1382         (mbsnwidth): New function.
1383
1384 2000-07-24  Jim Meyering  <meyering@lucent.com>
1385
1386         * mbswidth.c: Remove useless #else.  From Bruno Haible.
1387
1388 2000-07-23  Paul Eggert  <eggert@twinsun.com>
1389
1390         * mbswidth.c (_XOPEN_SOURCE):
1391         Don't define; this causes problems on Solaris 7.
1392         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
1393
1394 2000-07-23  Paul Eggert  <eggert@twinsun.com>
1395
1396         * quotearg.c:
1397         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
1398         so that mbstate_t is always defined.
1399
1400         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
1401         be 1 in at least one GCC installation, and this configuration
1402         error is likely to be common.  Ignoring MB_LEN_MAX hurts
1403         performance on hosts that have mbrtowc but have only unibyte
1404         locales, but I assume these hosts are rare.
1405
1406 2000-07-23  Paul Eggert  <eggert@twinsun.com>
1407
1408         * quotearg.c: Streamline by invoking multibyte code only if needed.
1409         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
1410         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
1411         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
1412         invoke multibyte primitives.
1413
1414 2000-07-23  Jim Meyering  <meyering@lucent.com>
1415
1416         * basename.c (base_name): Add an assertion.
1417
1418 2000-07-15  Bruno Haible  <clisp.cons.org>
1419
1420         * quotearg.c: When the system forces us to redefine mbstate_t,
1421         shadow its mbsinit function.
1422
1423 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
1424
1425         * mbswidth.h: New file.
1426         * mbswidth.c: New file.
1427         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
1428         (noinst_HEADERS): Add mbswidth.h.
1429
1430 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
1431
1432         * config.charset: Add support for FreeBSD. Improve support for HP-UX
1433         and IRIX 6.
1434
1435 2000-07-15  Jim Meyering  <meyering@lucent.com>
1436
1437         * makepath.c: Include quote.h.
1438         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
1439         corresponding argument in a `quote (...)' call.
1440         Give better diagnostics.
1441
1442         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
1443         (noinst_HEADERS): Add quote.h.
1444
1445         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
1446         from tar's src/misc.c.
1447         * quote.h: New file.  Prototypes for same.
1448
1449 2000-07-10  Paul Eggert  <eggert@twinsun.com>
1450
1451         From a suggestion by Bruno Haible.
1452         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
1453         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
1454         to decide whether to define the BeOS workaround macro;
1455         this adjusts to the change to AC_MBSTATE_T.
1456
1457 2000-07-13  Paul Eggert  <eggert@twinsun.com>
1458
1459         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
1460
1461         * quotearg.c (quoting_style_args, quoting_style_vals,
1462         quotearg_buffer_restyled): Add support for
1463         clocale_quoting_style.  Undo previous change to
1464         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
1465         and "{RIGHT QUOTATION MARK}" msgids.
1466
1467 2000-07-05  Paul Eggert  <eggert@twinsun.com>
1468
1469         The old behavior of quoting `like this' doesn't look good with
1470         newer, ISO-style fonts.  See:
1471         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
1472
1473         Instead, quote "like this" by default.  Let the translator
1474         tailor the locale-specific quoting behavior by providing
1475         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
1476
1477         * quotearg.c (N_): New macro.
1478         (gettext_default): New function.
1479         (quotearg_buffer_restyled): Use
1480         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
1481         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
1482
1483 2000-07-09  Jim Meyering  <meyering@lucent.com>
1484
1485         * Most files: Update copyright dates to include 2000.
1486
1487 2000-07-08  Jim Meyering  <meyering@lucent.com>
1488
1489         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
1490         if not defined.
1491         (xgethostname): Remove now-unnecessary #ifdef.
1492         Move declaration of `err' into loop where it's used.
1493
1494 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
1495
1496         * xgethostname.c (xgethostname): Protect against the SunOS5.5 bug
1497         by allocating a larger buffer. Test the gethostname return value for
1498         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
1499         returns an error and ENAMETOOLONG isn't defined.
1500
1501 2000-07-05  Paul Eggert  <eggert@twinsun.com>
1502         and Bruno Haible  <haible@clisp.cons.org>
1503
1504         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
1505
1506 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
1507
1508         * quotearg.c (struct quoting_options): Simplify quote_these_too
1509         dimension.
1510
1511 2000-07-03  Jim Meyering  <meyering@lucent.com>
1512
1513         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
1514         Reported by Bruno Haible.
1515
1516 2000-07-04  Jim Meyering  <meyering@lucent.com>
1517
1518         * quotearg.c: Make inclusion of <wchar.h> independent of whether
1519         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
1520         lacks mbrtowc.
1521
1522 2000-07-03  Paul Eggert  <eggert@twinsun.com>
1523         and Bruno Haible  <haible@clisp.cons.org>
1524
1525         * quotearg.c (mbrtowc):
1526         Assign to *pwc, and return 1 only if result is nonzero.
1527         (iswprint): Use ISPRINT when substituting our own mbrtowc.
1528
1529 2000-07-03  Jim Meyering  <meyering@lucent.com>
1530
1531         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
1532         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
1533         From Bob Proulx.
1534
1535 2000-07-02  Jim Meyering  <meyering@lucent.com>
1536
1537         * quotearg.c (mbstate_t): Don't define here.
1538
1539 2000-07-02  Jim Meyering  <meyering@lucent.com>
1540
1541         * nanosleep.c (SIGCONT): Define if not already defined.
1542
1543 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1544
1545         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
1546         per change in ../m4/ls-mntd-fs.m4.
1547         (read_filesystem_list): Ignore symbolic links.
1548
1549 2000-06-29  Jim Meyering  <meyering@lucent.com>
1550
1551         * same.c: Include <string.h> or <strings.h>, as appropriate,
1552         for declaration of strcmp.
1553
1554         * long-options.c: Include <stdlib.h>, for declaration of exit.
1555
1556         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
1557         Avoid warning by casting result to `char *' to remove `const'.
1558
1559 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1560
1561         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
1562
1563 2000-06-26  Paul Eggert  <eggert@twinsun.com>
1564
1565         savedir now sets errno on failure and invokes xmalloc to get memory.
1566         Fix a couple of other minor bugs while we're at it.
1567
1568         * savedir.c (<unistd.h>): Do not include; there's no need.
1569         (NAMLEN): Remove macro.
1570         (malloc, realloc): Remove decls.
1571         (stpcpy): Likewise.
1572         ("xalloc.h"): Include.
1573         (NAME_SIZE_DEFAULT): New macro.
1574         (savedir): Use xmalloc / xrealloc to allocate memory.
1575         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
1576         Skip "" directory entries.
1577         Use strlen to calculate directory entry length, since the old method
1578         is rarely used these days and isn't worth supporting.
1579         Don't use a pointer after freeing it.
1580         Check for integer overflow when calculating allocation size.
1581         Use memcpy to copy entries, instead of stpcpy.
1582         Set errno properly when returning NULL.
1583         Check for readdir error.
1584
1585 2000-06-26  Jim Meyering  <meyering@lucent.com>
1586
1587         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
1588
1589 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1590
1591         * getusershell.c (xmalloc, xrealloc): Remove functions.
1592         Include xalloc.h.
1593         Don't include <stdlib.h>.  Don't declare malloc, realloc.
1594
1595 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
1596
1597         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
1598
1599 2000-06-24  Jim Meyering  <meyering@lucent.com>
1600
1601         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
1602
1603 2000-06-21  Jim Meyering  <meyering@lucent.com>
1604
1605         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
1606
1607 2000-06-19  Paul Eggert  <eggert@twinsun.com>
1608
1609         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
1610         (mbrtowc, mbstate_t): Define substitutes if
1611         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
1612         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
1613         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
1614
1615 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1616
1617         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
1618         than 1024, return a memory chunk of least possible size, instead
1619         of size PATH_MAX + 2. In the loop, increment the size proportionally.
1620         Use free/xmalloc instead of xrealloc to avoid copying for very long
1621         paths.
1622
1623 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1624
1625         * canon-host.c (canon_host): Use malloc and memcpy to copy an
1626         address, not strdup.  Include <stdlib.h> and don't declare free().
1627
1628 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
1629
1630         * path-concat.c (path_concat): Don't access dir[-1] if dir is
1631         the empty string.
1632
1633 2000-06-21  Jim Meyering  <meyering@lucent.com>
1634
1635         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
1636         (noinst_HEADERS): Add getstr.h.
1637
1638         * getline.c (getstr): Move into a separate file.
1639         * getstr.c (getstr): New file, extracted from getline.c, with
1640         the following changes: new parameter, delim2; both delim[12]
1641         parameters have type `int', not `char'.  The latter would lose
1642         with 8-bit delimiters.
1643         * getstr.h: New file.
1644
1645 2000-06-19  Jim Meyering  <meyering@lucent.com>
1646
1647         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
1648
1649 2000-06-18  Jim Meyering  <meyering@lucent.com>
1650
1651         * mkdir.c: Remove file, due mainly to copyright incompatibility.
1652         Besides, these days every porting target provides a mkdir function.
1653
1654         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
1655         (this snippet comes from src/system.h).
1656
1657 2000-06-15  Paul Eggert  <eggert@twinsun.com>
1658
1659         * human.c (adjust_value): New function.
1660         (human_readable_inexact): Apply rounding style even when
1661         printing approximate values.
1662
1663 2000-06-14  Paul Eggert  <eggert@twinsun.com>
1664
1665         * human.c (human_readable_inexact): Allow an input block
1666         size that is not a multiple of the output block size, and vice versa.
1667         Reported by Piergiorgio Sartor.
1668
1669 2000-06-14  Paul Eggert  <eggert@twinsun.com>
1670
1671         * getdate.y (get_date): Apply relative times after time
1672         zone indicator, not before.  Reported by Todd A. Jacobs.
1673
1674 2000-06-13  Jim Meyering  <meyering@lucent.com>
1675
1676         * Makefile.am (all-local): Depend on lstat.c and stat.c.
1677
1678         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
1679
1680 2000-06-12  Paul Eggert  <eggert@twinsun.com>
1681
1682         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
1683
1684 2000-06-04  Paul Eggert  <eggert@twinsun.com>
1685
1686         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
1687
1688 2000-06-04  Jim Meyering  <meyering@lucent.com>
1689
1690         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
1691         SunOS4.1.4 for which gid_t is an unsigned type.
1692
1693 2000-06-03  Jim Meyering  <meyering@lucent.com>
1694
1695         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
1696
1697 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
1698
1699         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
1700         newer, don't install charset.alias.
1701         * config.charset: Change the Linux/glibc rules so they become empty
1702         on glibc-2.1 or newer.
1703
1704 2000-06-02  Jim Meyering  <meyering@lucent.com>
1705
1706         * mountlist.c: Back out last change.  Instead, do this...
1707         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
1708         member using the same `ignore'-testing code.
1709         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
1710         fs_type strings.
1711         From Mark D. Roth.
1712
1713 2000-05-29  Jim Meyering  <meyering@lucent.com>
1714
1715         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
1716         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
1717
1718 2000-05-22  Jim Meyering  <meyering@lucent.com>
1719
1720         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
1721
1722 2000-05-18  Jim Meyering  <meyering@lucent.com>
1723
1724         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
1725         back, too, since it may have been modified by allocate_entry.
1726         (hash_delete): Rewrite to use neither the assignment operator
1727         nor the comma operator in an if-expression.
1728
1729 2000-05-15  Paul Eggert  <eggert@twinsun.com>
1730
1731         * closeout.c:
1732         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
1733         Remove; no longer needed.
1734         "quotearg.h": Add include.
1735         (file_name): Do not bother to explicitly initialize to NULL; it's less
1736         efficient on some hosts.
1737         (close_stdout_status): Remove test as to whether stdout was already
1738         closed; it breaks for the case "echo x | sort >&-".
1739         Quote file name colons.
1740         Do not assume that _("write error") lacks format strings.
1741
1742 2000-05-15  Jim Meyering  <meyering@lucent.com>
1743
1744         * version-etc.c (version_etc_copyright): Update the copyright string
1745         used in all --version output.
1746
1747 2000-05-14  Jim Meyering  <meyering@lucent.com>
1748
1749         * closeout.c (close_stdout_set_file_name): New function.
1750         (close_stdout_status): Use new file-scoped global.
1751         Return right away if fstat says the stdout file descriptor is invalid.
1752         * closeout.h (close_stdout_set_file_name): Declare.
1753
1754 2000-05-10  Jim Meyering  <meyering@lucent.com>
1755
1756         * closeout.c [default_exit_status]: New file-scoped variable.
1757         (close_stdout_set_status): New function.
1758         * closeout.h (close_stdout_set_status): Declare.
1759
1760 2000-05-08  Jim Meyering  <meyering@lucent.com>
1761
1762         * long-options.c: Don't include closeout.h.
1763         (parse_long_options): Don't call close_stdout for --version.
1764
1765 2000-05-06  Jim Meyering  <meyering@lucent.com>
1766
1767         * strnlen.c: Undefine __strnlen and strnlen.
1768         [!weak_alias]: Define __strnlen to strnlen.
1769
1770         * atexit.c: New file, from libiberty.
1771
1772 2000-05-06  Jim Meyering  <meyering@lucent.com>
1773
1774         * closeout.c (close_stdout_status): Also check for errors on the
1775         stderr stream.
1776
1777 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
1778
1779         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
1780         instead of xmalloc, xrealloc, path_concat.
1781         (locale_charset): Treat empty environment variables as absent.
1782         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
1783
1784 2000-05-04  Jim Meyering  <meyering@lucent.com>
1785
1786         * getopt.c: Update from glibc.
1787         * obstack.c: Likewise.
1788         * obstack.h: Likewise.
1789         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
1790
1791         * regex.h: Likewise.
1792         * strndup.c: Likewise.
1793         * strnlen.c: New file, from glibc.
1794
1795 2000-05-01  Jim Meyering  <meyering@lucent.com>
1796
1797         * full-write.c (full_write): Remove `FIXME' part of comment.
1798
1799 2000-04-29  Jim Meyering  <meyering@lucent.com>
1800
1801         * path-concat.c: Declare strdup only if it's not defined.
1802         * canon-host.c: Likewise.
1803
1804 2000-04-28  Jim Meyering  <meyering@lucent.com>
1805
1806         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
1807         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
1808         included first, then limits.h is included by locale.h by libintl.h.
1809         From John David Anglin.
1810
1811 2000-04-25  Jim Meyering  <meyering@lucent.com>
1812
1813         * makepath.c (S_IRWXUGO): Define.
1814         (make_path): Always perform explicit chmod if MODE specifies any
1815         of the `special' permission bits.  Prompted by a bug report against
1816         install from Mate Wierdl and Joost van Baal.
1817
1818 2000-04-18  Jim Meyering  <meyering@lucent.com>
1819
1820         * README: New file.
1821
1822         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
1823         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
1824
1825 2000-04-17  Jim Meyering  <meyering@lucent.com>
1826
1827         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
1828         the definition of it to rpl_strftime also defined-away the system's
1829         declaration.
1830
1831 2000-04-15  Jim Meyering  <meyering@lucent.com>
1832
1833         Use `C' to denote so-called `contiguous' files, the same way
1834         that tar does.
1835         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
1836         (ftypelet): Use S_ISCTG.
1837         From Michael Deutschmann.
1838
1839 2000-04-14  Jim Meyering  <meyering@lucent.com>
1840
1841         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
1842
1843 2000-04-08  Jim Meyering  <meyering@lucent.com>
1844
1845         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
1846         names don't conflict.  Reported by Eli Zaretskii.
1847
1848 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
1849
1850         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
1851         bug.  Deal with the different error behavior of Irix iconv.
1852
1853 2000-04-07  Jim Meyering  <meyering@lucent.com>
1854
1855         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
1856         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
1857
1858 2000-04-05  Jim Meyering  <meyering@lucent.com>
1859
1860         Portability tweaks required for ultrix4.3.
1861         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
1862         * readutmp.c: Include sys/types.h before sys/stat.h.
1863         * canon-host.c: Declare strdup.
1864         * path-concat.c: Likewise.
1865         From John David Anglin.
1866
1867 2000-04-04  Jim Meyering  <meyering@lucent.com>
1868
1869         Be more DOS 8.3-friendly.
1870         * ref-add.sin: Renamed from ref-add.sed.in.
1871         * ref-del.sin: Renamed from ref-del.sed.in.
1872         * Makefile.am: Reflect renaming.
1873         Reported by Eli Zaretskii.
1874
1875         Use a temporary file name that won't clash with `charset.alias'
1876         in the DOS 8.3 name space.
1877         * Makefile.am (charset_tmp): Define.
1878         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
1879         (uninstall-local): Likewise.
1880         Reported by Eli Zaretskii.
1881
1882 2000-03-29  Paul Eggert  <eggert@twinsun.com>
1883
1884         * time/strftime.c (my_strftime): Make sure we call the system
1885         strftime, not ourselves, when invoking the underlying strftime.
1886
1887 2000-03-24  Jim Meyering  <meyering@lucent.com>
1888
1889         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
1890         (charset_alias): Define.
1891         (install-exec-local): Factor out common code.
1892         (uninstall-local): Split lines longer than 80.
1893         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
1894         (SUFFIXES): Define.
1895         (.sed.in.sed): New rule.  Don't redirect directly to $@.
1896         (CLEANFILES): Add ref-add.sed and ref-del.sed.
1897
1898 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
1899
1900         * config.charset: Output a line containing "Packages using this file".
1901         * ref-add.sed.in, ref-del.sed.in: New files.
1902         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
1903         ref-del.sed): New rules.
1904
1905 2000-03-17  Jim Meyering  <meyering@lucent.com>
1906
1907         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
1908         Otherwise, include <strings.h>
1909
1910 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
1911
1912         * unicodeio.c (utf8_wctomb): New function.
1913         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
1914         format instead of in UCS-4 with platform dependent endianness.
1915
1916 2000-03-07  Paul Eggert  <eggert@twinsun.com>
1917
1918         * savedir.c (savedir): Work even if directory size is
1919         negative; this can happen with some screwy NFS configurations.
1920
1921 2000-03-06  Jim Meyering  <meyering@lucent.com>
1922
1923         * localcharset.c (get_charset_aliases): Don't try to free file_name
1924         if it's NULL (because we ran out of memory).  From Bruno Haible.
1925
1926 2000-03-05  Jim Meyering  <meyering@lucent.com>
1927
1928         * localcharset.c ("path-concat.h"): Include.
1929         (get_charset_aliases): Use path_concat instead of ANSI string
1930         concatenation.
1931
1932         * unicodeio.h (PARAMS): Define.
1933         Use it to guard prototype.
1934
1935 2000-03-04  Jim Meyering  <meyering@lucent.com>
1936
1937         * Makefile.am (install-exec-local): Create $(libdir) before installing
1938         into it.
1939         (uninstall-local): Uncomment this rule so `make distcheck' works
1940         once again.
1941
1942         * unicodeio.c (<errno.h>): Include it.
1943         (errno): Declare if not defined.
1944
1945         * localcharset.c: Add Bruno's comment justifying use of volatile.
1946
1947         * config.charset: New version, incorporating remarks from a linux
1948         i18n mailing list.  From Bruno Haible.
1949
1950 2000-03-02  Jim Meyering  <meyering@lucent.com>
1951
1952         * Makefile.am (EXTRA_DIST): Add config.charset.
1953
1954 2000-03-01  Jim Meyering  <meyering@lucent.com>
1955
1956         * localcharset.c: Guard some #includes with `#if HAVE_...'.
1957         * unicodeio.c: Likewise.
1958
1959 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
1960
1961         * config.charset: New file.
1962         * localcharset.c: New file.
1963         * unicodeio.h, unicodeio.c: New files.
1964         * Makefile.am (DEFS): Add -DLIBDIR=...
1965         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
1966         (noinst_HEADERS): Add unicodeio.h.
1967         (all-local, install-exec-local, charset.alias): New targets.
1968
1969 2000-02-28  Paul Eggert  <eggert@twinsun.com>
1970
1971         * quotearg.c (ALERT_CHAR): New macro.
1972         (quotearg_buffer_restyled): Use it.
1973
1974 2000-02-27  Jim Meyering  <meyering@lucent.com>
1975
1976         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
1977         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
1978
1979         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
1980         not `#if STDC_HEADERS'.
1981         Declare malloc if needed.
1982
1983         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
1984         now that autoconf always defines the HAVE_DECL_ symbols.
1985         * human.c: Likewise.
1986         * same.c: Likewise.
1987         * strtoumax.c: Likewise.
1988
1989         * backupfile.c: Arrange for cpp to fail if the configure-time
1990         declaration check was not run.
1991         * hash.c: Likewise.
1992         * human.c: Likewise.
1993         * same.c: Likewise.
1994         * strtoumax.c: Likewise.
1995
1996         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
1997         then first look up the entire `.'-containing string as a login name.
1998
1999 2000-02-18  Paul Eggert  <eggert@twinsun.com>
2000
2001         * getdate.y: Handle two-digit years with leading zeros correctly.
2002         (textint): New typedef.
2003         (parser_control): Member year changed from int to textint.
2004         All uses changed.
2005         (YYSTYPE): Removed; replaced by %union with int and textint members.
2006         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
2007         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
2008         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
2009         (tSNUMBER, tUNUMBER): Now of type <textintval>.
2010         (date, number, to_year): Use width of number in digits, not its value,
2011         to determine whether it's a 2-digit year, or a 2-digit time.
2012         (yylex): Store number of digits of numeric tokens.
2013         Reported by John Kendall.
2014
2015         (parser_control): Changed from struct parser_control to typedef (for
2016         consistency).  All uses changed.
2017
2018         (tID): Removed; not used.
2019         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
2020
2021 2000-02-14  Paul Eggert  <eggert@twinsun.com>
2022
2023         * getpagesize.h (getpagesize): Port to VMS for Alpha;
2024         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
2025
2026 2000-02-12  Jim Meyering  <meyering@lucent.com>
2027
2028         * userspec.c (ISDIGIT): Define it.
2029         (isdigit): Remove definition.
2030         (is_number): Use ISDIGIT, not isdigit.
2031         <libintl.h>: Include.
2032         (_ and N_): Define.
2033         (parse_user_spec): Mark translatable strings.
2034
2035 2000-02-10  Jim Meyering  <meyering@lucent.com>
2036
2037         With these changes, nanosleep.[ch] are finally enough like the other
2038         lib/* replacement files to compile on a few more losing systems.
2039
2040         * nanosleep.h: Don't include config.h.
2041         Remove prototype from declaration of nanosleep.
2042         (PARAMS): Remove now-unneeded definition.
2043         * nanosleep.c: #undef nanosleep.
2044         (rpl_nanosleep): Rename from nanosleep.
2045
2046 2000-02-03  Jim Meyering  <meyering@lucent.com>
2047
2048         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
2049         rather than with `#if HAVE_UTMPNAME'.
2050
2051 2000-02-01  Jim Meyering  <meyering@lucent.com>
2052
2053         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
2054
2055 2000-01-31  Jim Meyering  <meyering@lucent.com>
2056
2057         * nanosleep.h (nanosleep): Guard declaration with
2058         `#if ! HAVE_DECL_NANOSLEEP'.
2059         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
2060         the declaration in that vendor's sys/timers.h.
2061         Reported by Christian Krackowizer.
2062
2063         * quotearg.c (ISASCII): Add #undef and move definition to follow
2064         inclusion of wctype.h to work around solaris2.6 namespace pollution.
2065         (ISPRINT): Likewise.
2066         Reported by Tom Tromey.
2067
2068 2000-01-30  Jim Meyering  <meyering@lucent.com>
2069
2070         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
2071         uses of ->ut_name.  The latter doesn't work with new Linux header files
2072         where only utmpx.ut_user is declared.
2073
2074         * readutmp.h (UT_USER): Define.
2075
2076 2000-01-23  Jim Meyering  <meyering@lucent.com>
2077
2078         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
2079         obstack.c.
2080
2081 2000-01-22  Jim Meyering  <meyering@lucent.com>
2082
2083         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
2084         [! HAVE_DECL_STRTOULL]: Declare strtoull.
2085         Required for some AIX systems.  Reported by Christian Krackowizer.
2086         [TESTING] (main): New function.
2087
2088         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
2089         * dirname.c (dir_name): Support for DOS-style file names with drive
2090         letters.
2091
2092         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
2093
2094         * strverscmp.c (ISDIGIT): Define.
2095         (strverscmp): Use ISDIGIT, not isdigit.
2096
2097 2000-01-17  Paul Eggert  <eggert@twinsun.com>
2098
2099         * nanosleep.c (nanosleep):
2100         Don't use SA_INTERRUPT to decide whether to call sigaction, as
2101         POSIX.1 doesn't require SA_INTERRUPT and some systems
2102         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
2103         it's been part of POSIX.1 since day 1 (in 1988).
2104
2105 2000-01-17  Jim Meyering  <meyering@lucent.com>
2106
2107         * interlock: Remove unused file.  Reported by François Pinard.
2108
2109 2000-01-16  Paul Eggert  <eggert@twinsun.com>
2110
2111         * quotearg.c (quotearg_buffer_restyled): Do not quote
2112         alert, backslash, formfeed, and vertical tab unnecessarily in
2113         shell quoting style.
2114
2115 Local Variables:
2116 version-control: never
2117 End: