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