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