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