1 2006-10-12 Jim Meyering <jim@meyering.net>
3 * Makefile.am (libcoreutils_a_LIBADD): Append $(LIBOBJS),
4 to accommodate the latest version of gnulib-tool.
5 (libcoreutils_a_DEPENDENCIES): Likewise.
8 2006-10-06 Jim Meyering <jim@meyering.net>
10 Avoid a compiler warning: const'ify and remove a cast.
11 * randread.c (struct randread_source) [handler]: Make parameter "const".
12 [handler_arg]: Add "const" attribute.
13 (randread_error): Make parameter "const".
14 (simple_new, randread_set_handler, randread_set_handler_arg): Likewise.
15 (randread_new): Remove now-unnecessary cast.
16 * randread.h: Adjust prototypes.
18 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
20 * .cvsignore: Add openat-proc.c.
22 2006-09-25 Paul Eggert <eggert@cs.ucla.edu>
24 * .cvsignore: Add fchmodat.c.
26 2006-09-25 Jim Meyering <jim@meyering.net>
28 * fchmodat.c: Remove file. gnulib's copy is identical.
30 2006-09-01 Paul Eggert <eggert@cs.ucla.edu>
32 * .cvsignore: Add fcntl.h, fcntl_.h, inttypes_.h, isapipe.c,
35 2006-08-25 Paul Eggert <eggert@cs.ucla.edu>
37 * euidaccess-stat.c: Include <config.h> unconditionally, since
38 we now assume config.h exists.
39 * fchmodat.c: Likewise.
40 * fd-reopen.c: Likewise.
41 * fdopendir-glibc.c: Likewise.
42 * memxfrm.c: Likewise.
43 * printf-parse.c: Likewise.
44 * rand-isaac.c: Likewise.
45 * randint.c: Likewise.
46 * randperm.c: Likewise.
47 * randread.c: Likewise.
48 * root-dev-ino.c: Likewise.
51 * stdopen.c: Likewise.
52 * strintcmp.c: Likewise.
53 * strnumcmp.c: Likewise.
54 * t-chdir-long: Likewise.
55 * tsearch.c: Likewise.
56 * unicodeio.c: Likewise.
57 * vasnprintf.c: Likewise.
59 * xmemxfrm.c: Likewise.
61 * .cvsignore: Add configmake.h, stamp-h1.
63 2006-08-23 Paul Eggert <eggert@cs.ucla.edu>
65 * .cvsignore: Add config.h, config.hin.
66 * Makefile.am (AM_CPPFLAGS): Remove; we no longer need '-I..'.
68 2006-08-22 Paul Eggert <eggert@cs.ucla.edu>
70 * .cvsignore: Add Makefile.in, getdate.tab.h.
71 Remove stat.c, sysexit.h.
73 2006-08-22 Jim Meyering <jim@meyering.net>
75 * .cvsignore: Add files that are now generated by ../bootstrap.
77 2006-08-21 Eric Blake <ebb9@byu.net>
79 * Makefile.am (LDADD): Restore this line; it is still needed for
80 t-fpending on platforms without __fpending.
82 2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
84 Add a bootstrap procedure, so that the CVS version contains fewer
85 files and we bootstrap the rest from gnulib, gettext, etc.
86 * Makefile.am: include gnulib.mk, so that we can remove most of
88 (AM_CPPFLAGS): Don't mention -I$(srcdir), since that's now done
90 (noinst_LIBRARIES, LDDADD, DEFS): Remove.
91 (libcoreutils_a_SOURCES): Trim down greatly, just to the files
92 that aren't in gnulib.
93 (libcoreutils_a_LIBADD, lib_OBJECTS, BUILT_SOURCES, CLEANFILES):
94 (MAINTAINERCLEANFILES, MOSTLYCLEANDIRS, MOSTLYCLEANFILES):
95 (SUFFIXES, EXTRA_DIST, all-local, charset_alias, charset_tmp):
96 (install-exec-local, uninstall-local, charset.alias, .sin.sed):
97 (stdbool.h, stdint.h, fnmatch.h, arpa/inet.h, netinet/in.h):
98 (sys/socket.h, getopt.h): Remove.
100 * Makefile.in, README, __fpending.c, __fpending.h, acl.c, acl.h:
101 * alloca.c, alloca_.h, allocsa.c, allocsa.h, argmatch.c, argmatch.h:
102 * asnprintf.c, asprintf.c, at-func.c, atexit.c, backupfile.c:
103 * backupfile.h, base64.c, base64.h, basename.c, bcopy.c, c-strtod.c:
104 * c-strtod.h, c-strtold.c, calloc.c, canon-host.c, canon-host.h:
105 * canonicalize.c, canonicalize.h, chdir-long.c, chdir-long.h:
106 * chdir-safer.c, chdir-safer.h, chown.c, cloexec.c, cloexec.h:
107 * close-stream.c, close-stream.h, closeout.c, closeout.h:
108 * config.charset, creat-safer.c, cycle-check.c, cycle-check.h:
109 * dev-ino.h, diacrit.c, diacrit.h, dirchownmod.c, dirchownmod.h:
110 * dirfd.c, dirfd.h, dirname.c, dirname.h, dup-safer.c, dup2.c:
111 * error.c, error.h, euidaccess.c, euidaccess.h, exclude.c:
112 * exclude.h, exit.h, exitfail.c, exitfail.h, fchown-stub.c:
113 * fcntl--.h, fcntl-safer.h, fd-safer.c, file-type.c, file-type.h:
114 * fileblocks.c, filemode.c, filemode.h, filenamecat.c:
115 * filenamecat.h, fnmatch.c, fnmatch_.h, fnmatch_loop.c:
116 * fopen-safer.c, fprintftime.c, fprintftime.h, free.c, fsusage.c:
117 * fsusage.h, ftruncate.c, fts-cycle.c, fts.c, fts_.h, full-read.c:
118 * full-read.h, full-write.c, full-write.h, gai_strerror.c:
119 * getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h:
120 * getdate.y, getdelim.c, getdelim.h, getgroups.c, gethostname.c:
121 * gethrxtime.c, gethrxtime.h, getline.c, getline.h, getloadavg.c:
122 * getndelim2.c, getndelim2.h, getopt.c, getopt1.c, getopt_.h:
123 * getopt_int.h, getpagesize.h, getpass.c, getpass.h, gettext.h:
124 * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
125 * group-member.c, group-member.h, hard-locale.c, hard-locale.h:
126 * hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h:
127 * idcache.c, imaxtostr.c, inet_ntop.c, inet_ntop.h, intprops.h:
128 * inttostr.c, inttostr.h, lchmod.h, lchown.c, lchown.h:
129 * linebuffer.c, linebuffer.h, localcharset.c, localcharset.h:
130 * long-options.c, long-options.h, lstat.c, lstat.h, malloc.c:
131 * mbchar.c, mbchar.h, mbswidth.c, mbswidth.h, mbuiter.h, md5.c:
132 * md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c:
133 * memcoll.h, memcpy.c, memmove.c, mempcpy.c, mempcpy.h, memrchr.c:
134 * memrchr.h, memset.c, mkancesdirs.c, mkancesdirs.h, mkdir-p.c:
135 * mkdir-p.h, mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c:
136 * mktime.c, modechange.c, modechange.h, mountlist.c, mountlist.h:
137 * nanosleep.c, obstack.c, obstack.h, offtostr.c, open-safer.c:
138 * openat-die.c, openat-priv.h, openat.c, openat.h, pathmax.h:
139 * physmem.c, physmem.h, pipe-safer.c, posixtm.c, posixtm.h:
140 * posixver.c, posixver.h, printf-args.c, printf-args.h:
141 * printf-parse.h, putenv.c, quote.c, quote.h, quotearg.c:
142 * quotearg.h, raise.c, readlink.c, readtokens.c, readtokens.h:
143 * readtokens0.c, readtokens0.h, readutmp.c, readutmp.h, realloc.c:
144 * ref-add.sin, ref-del.sin, regcomp.c, regex.c, regex.h:
145 * regex_internal.c, regex_internal.h, regexec.c, rename.c, rmdir.c:
146 * rpmatch.c, safe-read.c, safe-read.h, safe-write.c, safe-write.h:
147 * same-inode.h, same.c, same.h, save-cwd.c, save-cwd.h, savedir.c:
148 * savedir.h, setenv.c, setenv.h, settime.c, sha1.c, sha1.h:
149 * sig2str.c, sig2str.h, snprintf.c, snprintf.h, socket_.h:
150 * stat-macros.h, stat-time.h, stdbool_.h, stdint_.h, stdio--.h:
151 * stdio-safer.h, stdlib--.h, stdlib-safer.h, stpcpy.c, strcase.h:
152 * strcasecmp.c, strcspn.c, strdup.c, strdup.h, strftime.c:
153 * strftime.h, stripslash.c, strncasecmp.c, strndup.c, strndup.h:
154 * strnlen.c, strnlen.h, strnlen1.c, strnlen1.h, strpbrk.c, strstr.c:
155 * strstr.h, strtod.c, strtoimax.c, strtol.c, strtoll.c, strtoul.c:
156 * strtoull.c, strtoumax.c, strverscmp.c, strverscmp.h, tempname.c:
157 * time_r.c, time_r.h, timespec.h, umaxtostr.c, unicodeio.h:
158 * unistd--.h, unistd-safer.h, unlinkdir.c, unlinkdir.h:
159 * unlocked-io.h, unsetenv.c, userspec.c, userspec.h, utime.c:
160 * utimecmp.c, utimecmp.h, utimens.c, utimens.h, vasnprintf.h:
161 * vasprintf.c, vasprintf.h, verify.h, version-etc-fsf.c:
162 * version-etc.c, version-etc.h, wcwidth.h, xalloc-die.c, xalloc.h:
163 * xgetcwd.c, xgetcwd.h, xgethostname.c, xgethostname.h, xmalloc.c:
164 * xmemcoll.c, xmemcoll.h, xnanosleep.c, xnanosleep.h, xreadlink.c:
165 * xreadlink.h, xstrndup.c, xstrndup.h, xstrtod.c, xstrtod.h:
166 * xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtold.c, xstrtoul.c:
167 * xstrtoumax.c, xtime.h, yesno.c, yesno.h:
168 Remove from CVS, since ../bootstrap generates them automatically.
170 2006-08-18 Bruno Haible <bruno@clisp.org>
172 * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
173 (ME_DUMMY): Treat "kernfs" as a dummy.
174 (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
176 2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
178 * ChangeLog: Add copyright notice.
179 * .gdb-history: Likewise.
181 * __fpending.h: Likewise.
182 * fdopendir-glibc.c: Likewise.
183 * fprintftime.h: Likewise.
184 * root-dev-ino.h: Likewise.
185 * search_.h: Likewise.
186 * t-chdir-long: Likewise.
187 * t-fpending.c: Likewise.
188 * savedir.c: Use (C) in copyright notice.
189 * savedir.h: Likewise.
191 2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
193 * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
194 Problem and fix reported by Pádraig Brady in
195 <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
197 2006-08-16 Jim Meyering <jim@meyering.net>
199 * fts.c (fts_children): Remove obsolete "// FIXME ..." comment.
200 Reported by Bruno Haible.
202 2006-08-15 Jim Meyering <jim@meyering.net>
204 * at-func.c: New file, with the logic of all emulated at-functions.
205 * openat-priv.h: Include <errno.h> and define ENOSYS,
206 in support of the EXPECTED_ERRNO macro.
207 * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
208 Instead, define the appropriate symbols and include "at-func.c".
209 * mkdirat.c (mkdirat): Likewise.
210 * fchmodat.c (fchmodat): Likewise.
211 (ENOSYS): Remove definition.
212 * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
213 Don't include "unistd--.h" -- it wasn't ever used.
215 2006-08-14 Paul Eggert <eggert@cs.ucla.edu>
217 * memcoll.c (memcoll): Optimize for the common case where the
218 arguments are bytewise equal.
220 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
222 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
223 HAVE_PIPE. Fix a file descriptor leak when fd_safer fails.
225 * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
226 in wchar_t. Problem reported by Eric Blake.
228 * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
229 LEN is smaller than SIZE. Suggested by Bruno Haible.
230 Also, help the compiler to keep LEN in a register.
232 2006-08-10 Paul Eggert <eggert@cs.ucla.edu>
234 Import the following changes from libc:
236 2006-06-02 Jakub Jelinek <jakub@redhat.com>
238 * posix/regex_internal.c (re_string_skip_chars): If no character has
239 been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc
240 to the byte which couldn't be converted.
241 (re_string_reconstruct): Don't clear valid_raw_len before calling
242 re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set
243 tip_context using re_string_context_at.
245 2006-05-02 Ulrich Drepper <drepper@redhat.com>
247 * posix/regex.h: g++ still cannot handled [restrict].
249 2006-04-21 Ulrich Drepper <drepper@redhat.com>
251 * posix/regex.h: Remove special handling for VMS.
253 Accommodate new getaddrinfo implementation in gnulib.
254 * inet_ntop.c, inet_ntop.h, snprintf.c, snprintf.h, socket_.h:
255 New files, from gnulib.
256 * .cppi-disable: Add snprintf.h, socket_.h.
257 * Makefile.am (libcoreutils_a_SOURCES): Add inet_ntop.h, snprintf.h.
258 (MOSTLYCLEANDIRS): New macro.
259 (BUILT_SOURCES): Add $(ARPA_INET_H), $(SYS_SOCKET_H), $(NETINET_IN_H).
260 (arpa/inet.h, netinet/in.h, sys/socket.h): New rules.
261 (MOSTLYCLEANFILES): Add arpa/inet.h, arpa/inet.h-t, netinet/in.h,
262 netinet/in.h-t, sys/socket.h, sys/socket.h-t.
263 (EXTRA_DIST): Add socket_.h.
265 2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
267 * allocsa.h, config.charset, error.c, error.h, exitfail.c, full-write.c:
268 * getaddrinfo.c, getaddrinfo.h, gettext.h, localcharset.c, mbchar.h:
269 * mbswidth.c, mkstemp-safer.c, pipe-safer.c, printf-args.c, quote.c:
270 * readlink.c, regex_internal.h, setenv.c, stdint_.h, stdio--.h:
271 * stdio-safer.h, stpcpy.c, strcspn.c, strtoimax.c, vasnprintf.h:
272 * version-etc.c, wcwidth.h:
275 2006-08-09 Jim Meyering <jim@meyering.net>
277 * rand-isaac.c: Include <config.h>.
279 2006-08-08 Paul Eggert <eggert@cs.ucla.edu>
281 * Makefile.am (libcoreutils_a_SOURCES): Add xmemxfrm.c, xmemxfrm.h.
282 * memxfrm.c, memxfrm.h, randint.c, randint.h, randperm.c, randperm.h:
283 * randread.c, randread.h, xmemxfrm.c, xmemxfrm.h: New files.
284 * rand-isaac.h: New file.
285 * rand-isaac.c: New file, mostly taken from ../src/rand-isaac.c.
287 2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
289 * modechange.c (mode_compile): Numeric modes now affect setuid and
290 setgid on directories only if they set these bits.
291 * modechange.h: Remove obsolete comment about masks.
293 2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
295 * close-stream.c, close-stream.h: New files.
296 * closeout.c (close_stdout): Use new function close_stream.
298 2006-07-19 Mike Frysinger <vapier@gentoo.org>
300 * mountlist.c [ME_REMOTE]: Filter out cifs.
301 Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
303 2006-07-20 Jim Meyering <jim@meyering.net>
305 * mountlist.c (ME_REMOTE): Compare strchr's result to NULL, not 0,
306 for better readability.
308 2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
310 * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
312 * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
313 unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
314 save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
315 (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
316 MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
317 callers changed. Revamp internals significantly, by not
318 attempting to create directories that are temporarily more
319 permissive than the final results. Do not attempt to use
320 save_cwd/restore_cwd; it isn't worth it for mkdir and install.
321 This removes some race conditions, fixes some bugs, and simplifies
322 things. Use new dirchownmod function to do owner and mode changes.
323 * mkdir-p.h: Likewise.
324 * modechange.c (octal_to_mode): New function.
325 (struct mode_change): New member mentioned.
326 (make_node_op_equals): New arg mentioned. All callers changed.
327 (mode_compile): Keep track of which mode bits the user has explicitly
329 (mode_adjust): New arg DIR, so that we implement the X op correctly.
330 New arg PMODE_BITS, to keep track of which mode bits the user
331 mentioned; it treats S_ISUID and S_ISGID speciall.
333 * modechange.h: Likewise.
335 2006-07-16 Jim Meyering <jim@meyering.net>
337 * userspec.c (parse_with_separator): Say "invalid spec" rather than
338 the sometimes erroneous "cannot get the login group of a numeric UID"
339 for a spec like "not-a-username:" or "1:". Reported by
340 suckfish@ihug.co.nz in https://bugzilla.redhat.com/bugzilla/199027.
342 2006-07-10 Derek R. Price <derek@ximbiot.com>
344 * backupfile.c, dirfd.h, fts.c, getcwd.c:
345 Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN
346 macros into the GNU _D_EXACT_NAMLEN.
347 * savedir.c: Likewise.
348 (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
350 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
352 * Makefile.am (stdint.h): FULL_PATH_STDINT_H -> ABSOLUTE_STDINT_H,
353 to accommodate update from gnulib.
355 Update from gnulib, as follows:
357 2006-07-06 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
359 * getaddrinfo.c: Changes to compile under MSVC6: changed
360 '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
361 brackets. Other minor changes to suppress some compiler
364 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
366 * getloadavg.c: Use __VMS, not VMS.
367 * getopt.c: Likewise.
368 * getpagesize.h: Likewise.
370 2006-07-06 Derek R. Price <derek@ximbiot.com>
371 and Paul Eggert <eggert@cs.ucla.edu>
373 * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
374 Don't worry about this obsolete case any more.
375 (HAVE_DIR): Remove. All uses removed; we now assume you can read
377 * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
378 worry about this obsolete case any more.
380 * getcwd.c: Likewise.
381 * savedir.c: Likewise.
383 2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
385 * fnmatch.c (ISBLANK): Remove. All uses changed to isblank.
386 (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
387 (ISGRAPH): Remove. All uses changed to isgraph.
388 (FOLD) [!defined _LIBC]: Remove special case.
389 * getdate.y (lookup_word): Remove no-longer-needed call to islower.
390 * regext_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
392 * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
394 2006-07-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
396 * strtod.c (strtod): cast the argument of tolower to unsigned char.
398 2006-07-05 Paul Eggert <eggert@cs.ucla.edu>
400 * memcasecmp.c: Include <limits.h>.
401 (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
402 * strtod.c (strtod): Don't assume isspace works on negative chars.
403 Don't assume isdigit succeeds only on '0' through '9'.
405 2006-07-05 Derek R. Price <derek@ximbiot.com>
407 * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
408 All uses of is_space replaced by isspace.
409 * exit.h: Don't talk about STDC_HEADERS.
410 * fnmatch.c (ISASCII): Remove; no longer needed. All uses removed.
411 (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
412 (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed. All uses
413 replaced by isprint etc.
414 * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
415 * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
416 * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
417 * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
418 * strtol.c (IN_CTYPE_DOMAIN): Likewise.
419 * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
421 2006-07-05 Eric Blake <ebb9@byu.net>
423 * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
424 missing from netdb.h.
425 * getaddrinfo.c (includes): Include inet_ntop and snprintf.
427 2006-06-27 Bruno Haible <bruno@clisp.org>
429 Assume ANSI C header files and <ctype.h> functions.
430 * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
431 (mbsnwidth): Use isprint, iscntrl instead.
433 2006-07-08 Jim Meyering <jim@meyering.net>
435 * getndelim2.h (getndelim2): Remove doubled "after" in comment.
437 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
439 * Makefile.am (libcoreutils_a_SOURCES): Add setenv.h, wcwidth.h,
440 to accommodate sync from gnulib.
444 2006-06-30 Jim Hyslop <jhyslop@dreampossible.ca> (tiny change)
446 * getaddrinfo.c: fixed typo
448 2006-06-28 Bruno Haible <bruno@clisp.org>
450 * getaddrinfo.h: Fix POSIX URL.
451 * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
452 (use_win32_p): Make static.
453 (getaddrinfo): Reject service name if it is empty or does not consist
454 solely of decimal digits, or if its value is > 65535.
455 (getnameinfo): Remove useless casts.
457 2006-06-28 Eric Blake <ebb9@byu.net>
459 * mbchar.h (wcwidth): Include wcwidth.h.
460 * mbswidth.c (wcwidth): Move from here...
461 * wcwidth.h: ...to this new file.
463 2006-06-28 Simon Josefsson <jas@extundo.com>
465 * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
466 functions there. It will succeed on Windows XP, but on Windows
467 2000 and (presumably) earlier, it will fail, and use the internal
469 (use_win32_p): New function.
470 (getaddrinfo): Use strtoul on servname, to support numeric ports.
471 Support AI_NUMERICSERV to disable getservbyname.
472 (getnameinfo): New function, only supports
473 NI_NUMERICHOST|NI_NUMERICSERV for now.
475 * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
476 only have some of them. Add AI_NUMERICSERV. Add prototype for
479 2006-06-26 Paul Eggert <eggert@cs.ucla.edu>
481 * base64.c (B64): Use _ as the formal parameter, not x, to avoid
482 bug in IBM C V6 for AIX. Problem reported by Larry Jones in
483 <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
485 2006-06-21 Simon Josefsson <jas@extundo.com>
487 * getaddrinfo.c (getaddrinfo): Set ai_family in the return
490 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
492 * alloca_.h (alloca) [defined alloca]: Don't define or declare.
494 2006-06-16 Eric Blake <ebb9@byu.net>
496 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
497 * unicodeio.c [!defined errno]: Likewise.
498 * strtol.c [!defined errno]: Likewise.
499 * strtod.c [!defined errno]: Likewise.
501 2006-05-26 Martin Lambers <marlam@marlam.de>
503 * getpass.c: Updates the test for the native W32 API, and adds
504 missing includes, thus fixing compilation warnings.
506 2006-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
508 * exclude.c (exclude_fnmatch): New function.
509 (excluded_file_name): Call exclude_fnmatch.
510 * exclude.h (excluded_file_name): New prototype
512 2006-05-19 Jim Meyering <jim@meyering.net>
514 * getugroups.c: Correct an outdated comment. From Bruno Haible.
516 2006-05-10 Paul Eggert <eggert@cs.ucla.edu>
518 * sha1.c (rol): Cast right-shift arg to uint32_t to prevent
519 unwanted sign propagation, e.g., on hosts with 64-bit int.
520 There still are some problems with reeelly weird theoretical hosts
521 (e.g., 33-bit int) but it's not worth worrying about now.
522 (K1, K2, K3, K4): Remove unnecessary L suffix.
524 2006-03-24 Simon Josefsson <jas@extundo.com>
526 * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
527 including some doc fixes.
528 (base64_encode_alloc): Fix +1 bug on allocation failures.
530 2006-03-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
532 * base64.c (base64_encode): Do not read past end of array with
533 unsanitized input on systems with CHAR_BIT > 8.
535 2006-03-24 Eric Blake <ebb9@byu.net>
537 * time_r.c (copy_string_result): Remove, as it is no longer used.
539 2006-07-03 Paul Eggert <eggert@cs.ucla.edu>
541 * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
542 MacOS X 10.4.6. Don't mention <sys/int_types.h>. Problems
543 reported by Mark D. Baushke, one in
544 <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
546 2006-07-03 Jim Meyering <jim@meyering.net>
548 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
549 macro is used before the first cycle_check call.
551 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
553 * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
554 both are 64 bits, since this seems to be the tradition, and this
555 prevents gcc -Wformat from warning about usages with PRIuMAX. If
556 we ever run into a host that prefers long long to long in this
557 case, we'll need another configure-time test. Problem reported by
560 2006-07-02 Paul Eggert <eggert@cs.ucla.edu>
562 * Makefile.am (stdint.h): Sync from gnulib.
563 * stdint_.h: Sync from gnulib.
565 2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
567 * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
568 both double and long double versions.
569 (XSTRTOD): Renamed from xstrtod. Use DOUBLE internally.
570 * xstrtold.c: New file.
571 * xstrtod.h (xstrtold): New decl.
573 2006-06-29 Derek R. Price <derek@ximbiot.com>
575 * strftime.c: Assume strftime exists.
577 2006-06-28 Derek R. Price <derek@ximbiot.com>
579 * savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
580 Autoconf 2.60 says this stuff was obsolete.
582 2006-06-20 Paul Eggert <eggert@cs.ucla.edu>
584 * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
585 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
586 Problem reported by Denis Excoffier in
587 <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
589 2006-06-19 Jim Meyering <jim@meyering.net>
591 Apply this change from gnulib:
592 2006-06-16 Eric Blake <ebb9@byu.net>
593 * unsetenv.c [!defined errno]: Assume errno.h declares errno.
595 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
597 * getdate.y (__attribute__): Don't define if already defined.
598 Problem reported by Larry Jones.
599 * utimens.c (__attribute__): Likewise.
601 2006-06-10 Jim Meyering <jim@meyering.net>
603 Apply this change from gnulib:
605 2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
606 Bruno Haible <bruno@clisp.org>
608 * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
610 2006-06-04 Paul Eggert <eggert@cs.ucla.edu>
612 * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
613 reported by Andreas Schwab.
615 2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
617 * tempname.c (small_open, large_open): New macros.
618 (__open, __open64) [!_LIBC]: Remove.
619 (__gen_tempname): Use small_open and large_open instead of __open
620 and __open64. This fixes a portability bug on HP-UX 11.11i
621 reported by Simon Wing-Tang in
622 <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
624 2006-05-23 Paul Eggert <eggert@cs.ucla.edu>
626 * filemode.c: Don't include <string.h>; this include was
627 inadvertently put into the previous patch. Problem noted
630 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
632 * filemode.c (setst): Remove.
633 (strmode): Rewrite to avoid setst. This makes the code shorter,
634 (arguably) clearer, and the generated code is a bit smaller on my
635 Debian GNU/Linux stable x86 host.
638 * verify.h: Document the internals better. Most of this change
639 was written by Bruno Haible.
641 2006-05-21 Jim Meyering <jim@meyering.net>
643 * fts.c (fts_open): Fail with EINVAL if a caller violates this rule:
644 Either FTS_LOGICAL or FTS_PHYSICAL must be provided to the
647 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
649 * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
650 Use the usual Autoconf way to include <time.h> and/or sys/time.h.
651 (my_usleep): Don't mishandle maximum value.
653 2006-05-15 Jim Meyering <jim@meyering.net>
655 Avoid the expense of an fstat, when possible.
656 * fts.c (O_NOFOLLOW, STREQ): Define.
657 (diropen_fd): Remove function. Merge it into sole caller...
658 (diropen): ...here. Use O_NOFOLLOW when appropriate.
659 (fts_safe_changedir): Call fstat for dev/inode check, only if the
660 previous open/openat call may have opened the wrong directory.
662 2006-05-13 Jim Meyering <jim@meyering.net>
664 * xfts.c (xfts_open): Always use FTS_CWDFD.
666 Restore the parts of fts that were removed on 2006-01-17, so that
667 it's easier for legacy applications designed for the version
668 of fts in glibc or BSD to convert to this more robust version.
669 Add a new mode, FTS_CWDFD, by which to enable the improved
670 (openat- based -- aka no-chdir) semantics.
671 * fts_.h (FTS_CWDFD): Define. Callers must use this fts_open
672 option to enable the more robust behavior.
673 (FTS_OPTIONMASK): Widen accordingly.
674 * fts.c: Restore removed code, reverting the default behavior.
676 2006-05-11 Jim Meyering <jim@meyering.net>
678 * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley.
680 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
682 * getdate.y (get_date): When adding relative date, start with the
683 initial time, not with the result of the first mktime call.
685 2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
687 * filemode.c: Include "filemode.h" first, to test the interface.
688 Assume that filemode.h includes sys/types.h and sys/stat.h.
689 (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
690 (ftypelet): Reorder to put common cases first, for efficiency.
691 Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
693 (strmode): Renamed from mode_string, and now stores 12 bytes instead
694 of 10, for compatibility with FreeBSD. All callers changed.
695 (filemodestring): Now stores 12 bytes instead of 10, and sets file types
696 that can't be deduced solely from st_mode. First arg is now a const
698 * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
699 (strmode): Renamed from mode_string.
700 (filemodestring): New decl.
701 * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
702 (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
703 (S_ISPORT, S_ISWHT): New macros, if not already defined.
705 * openat.h (openat_needs_fchdir) [ ! defined __OPENAT_PREFIX]:
706 Turn this into a macro that always returns false.
708 2006-04-15 Paul Eggert <eggert@cs.ucla.edu>
710 * utimens.c (futimens): glibc futimesat messes up if /proc
711 isn't mounted. Problem reported by Kir Kolyshkin.
713 2006-04-14 Jim Meyering <jim@meyering.net>
715 Remove unreachable code and plug leaks in code that handles degenerate
716 input and some failure cases.
717 * fts.c (fts_build): #if-0-out a block of unused code. Patch from glibc.
718 (fts_build): Remove just-#if-0'd code and the code that
719 declares and sets cderrno.
720 (fts_build): Free `head' before returning NULL, in two places,
721 to avoid leaks. Patch from glibc.
722 (fts_open): Don't allocate parent if *argv==NULL. Patch from glibc.
724 2006-04-13 Paul Eggert <eggert@cs.ucla.edu>
726 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
727 is not defined. Problem reported by Mark D. Baushke via Derek R. Price.
728 * regex.h (RE_DUP_MAX): Update comment to match current implementation.
730 2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
732 * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
733 fsusage.h now does that. Include fsusage.h first, to test interface.
734 Prefer statvfs if it works, since it's blessed by POSIX. Attempt
735 at most one method (the old code could have generated decls that
736 didn't conform to C89, not that this was ever exercised).
737 * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
739 2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
741 Merge regex changes from libc, removing some of our
742 POSIX-conformance changes that were rejected and redoing them in a
745 * regcomp.c (re_compile_internal, init_dfa):
746 Length arg is now size_t, not Idx. All uses changed.
747 (peek_token): Forward decl now says internal_function.
748 (__re_error_msgid, __re_error_msgid_idx):
749 Now static rather than extern with attribute_hidden.
750 (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
751 For some reason libc prefers K&R style defns for external functions.
752 (regerror) [!defined _LIBC]: Likewise.
753 (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
754 (seek_collating_symbol_entry, lookup_collation_sequence_value):
755 (build_range_exp, build_collating_symbol):
757 (re_compile_fastmap): Use '\0' to memset, not 0.
758 (utf8_sb_map): Make the calculations more obvious.
759 (init_dfa, parse_bracket_exp, build_charclass_op):
760 Call calloc and cast result, as glibc does.
761 (init_word_char, fetch_token, peek_token, peek_token_bracket):
762 (build_range_exp, build_collating_symbol):
763 Now internal functions.
765 * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
767 * regex.h (__USE_GNU_REGEX): New macro. Don't depend on
768 _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
769 Don't depend on VMS; depend on __VMS instead, for POSIX
771 (regoff_t): Define to ssize_t, not long int.
773 Remove the REG_ macros named below. Instead, make the old names
774 (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
776 (REG_BACKSLASH_ESCAPE_IN_LISTS):
777 (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
778 (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
779 (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
780 (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
781 (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
782 (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
783 (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
784 (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
785 (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
786 (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
787 (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
788 (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
789 (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
790 (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
791 (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
792 (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
794 Remove. All uses replaced by the old RE_* names.
795 (RE_BACKSLASH_ESCAPE_IN_LISTS):
796 (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
797 (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
798 (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
799 (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
800 (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
801 (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
802 (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
803 (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
804 (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
805 (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
806 Don't bother having these macros be independent of each others'
807 values, since they no longer exist in the POSIX name space.
809 Rename the following member names back to their old names,
810 unless !__USE_GNU_REGEX. All uses changed back.
811 (buffer): Renamed from re_buffer.
812 (allocated): Renamed from re_allocated.
813 (used): Renamed from re_used.
814 (syntax): Renamed from re_syntax.
815 (fastmap): Renamed from re_fastmap.
816 (translate): Renamed from re_translate.
817 (can_be_null): Renamed from re_can_be_null.
818 (regs_allocated): Renamed from re_regs_allocated.
819 (fastmap_accurate): Renamed from re_fastmap_accurate.
820 (no_sub): Renamed from re_no_sub.
821 (not_bol): Renamed from re_not_bol.
822 (not_eol): Renamed from re_not_eol.
823 (newline_anchor): Renamed from re_newline_anchor.
824 (num_regs): Renamed from rm_num_regs.
825 (start): Renamed from rm_start.
826 (end): Renamed from rm_end.
828 (free_state): Move up a bit.
830 * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
832 (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
833 when that is what is intended.
834 (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
835 (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
837 (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
838 All uses changed back to re_malloc, etc. It's now the caller's
839 responsibility to check for overflow; all callers changed.
840 (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
841 (re_x2nrealloc): Remove.
842 (free_state): Remove decl.
844 * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
845 (re_set_registers, re_exec):
848 2006-01-31 Roland McGrath <roland@redhat.com>
850 * regcomp.c (calc_eclosure_iter): Remove dead variables.
851 Reported by Mike Frysinger <vapier@gentoo.org>.
853 2006-01-15 Andreas Jaeger <aj@suse.de>
856 * regex_internal.c (re_string_reconstruct): Adjust for
857 build_wcs_upper_buffer change.
858 (build_wcs_upper_buffer): Change return type.
860 2005-12-10 Ulrich Drepper <drepper@redhat.com>
862 * regex_internal.h: Include <stdint.h> if available.
864 2005-12-06 Paolo Bonzini <bonzini@gnu.org>
866 * regex_internal.h (SIZE_MAX): Provide a default definition.
868 2005-10-14 Ulrich Drepper <drepper@redhat.com>
870 * regcomp.c: Adjust for changed secondary hash function.
872 2005-09-30 Ulrich Drepper <drepper@redhat.com>
874 * regex.h: Pretty printing.
875 Clean up namespace a bit.
877 2005-09-30 Jakub Jelinek <jakub@redhat.com>
879 * regexec.c (update_cur_sifted_state, check_arrival,
880 check_arrival_add_next_nodes): Avoid using uninitialized variable.
882 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
883 Ulrich Drepper <drepper@redhat.com>
886 * regex_internal.h (bitset_t): Renamed from bitset. All uses changed.
887 (bitset_word_t): Renamed from bitset_word. All uses changed.
889 2005-09-22 Ulrich Drepper <drepper@redhat.com>
892 * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
893 * regcomp.c: Remove unnecessary uses of
894 unsigned RE_TRANSLATE_TYPE.
895 * regex_internal.h: Likewise.
896 * regex_internal.c: Likewise.
897 * regexec.c: Likewise.
898 Based on a patch by Stepan Kasal <kasal@ucw.cz>.
900 2005-09-07 Ulrich Drepper <drepper@redhat.com>
902 * regexec.c (find_recover_state): Remove unnecessary
904 (transit_state_bkref): Make DFA a const pointer.
905 (get_subexp): Likewise.
906 (check_arrival): Likewise.
907 (update_cur_sifted_state): Likewise.
908 (re_search_internal): Likewise.
909 (prune_impossible_nodes): Likewise.
910 (acquire_init_state_context): Likewise.
911 (proceed_next_node): Likewise.
912 (set_regs): Likewise.
913 (free_fail_stack_return): Likewise.
914 (check_arrival_expand_ecl): Mark DFA parameter as const.
915 (check_arrival_expand_ecl_sub): Likewise.
916 (check_subexp_limits): Likewise.
917 (sub_epsilon_src_nodes): Likewise.
918 (add_epsilon_src_nodes): Likewise.
919 (merge_state_array): Likewise.
920 (update_regs): Likewise.
921 (build_trtable): Likewise.
922 (sift_states_backward): Mark MCTX parameter as const.
923 (build_sifted_states): Likewise.
924 (update_cur_sifted_state): Likewise.
925 (sift_states_mkref): Likewise.
926 (check_arrival_expand_ecl): Mark eclosure as const.
927 (check_dst_limits_calc_pos_1): Likewise.
928 * regex_internal.h (re_match_context_t): Make dfa a const
931 2005-09-06 Ulrich Drepper <drepper@redhat.com>
933 * regexec.c (merge_state_with_log): Define dfa as const pointer.
934 (transit_state_sb): Likewise.
935 (transit_state_mb): Likewise.
936 (sift_states_iter_mb): Likewise.
937 (check_arrival_add_next_nodes): Likewise.
938 (check_node_accept_bytes): Change first parameter to pointer-to-const.
939 [_LIBC] (re_search_2_stub): Use mempcpy.
941 * regex_internal.c (re_string_reconstruct): Avoid calling
942 mbrtowc for very simple UTF-8 case.
944 * regex_internal.c (re_acquire_state): Make DFA pointer arg
946 (re_acquire_state_context): Likewise.
947 * regex_internal.h: Adjust prototypes.
949 * regex.c: Prevent using C++ compilers.
951 * regex_internal.c (re_acquire_state): Minor code rearrangement.
952 (re_acquire_state_context): Likewise.
954 2006-03-11 Eric Blake <ebb9@byu.net>
956 * same.c (same_name): s/base_name/last_component/
957 * backupfile.c (check_extension, numbered_backup): Likewise.
958 * filenamecat.c (file_name_concat): Likewise.
960 2006-03-11 Eric Blake <ebb9@byu.net>,
961 Paul Eggert <eggert@cs.ucla.edu>
963 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
964 [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
966 (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
967 platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
968 (last_component): New method.
969 * dirname.c (dir_len): Determine when drive letters need a
970 subsequent slash. Preserve // when it is special.
971 (dir_name): Don't append dot when drive letter is absolute.
972 [TEST_DIRNAME]: Move into a full-blown gnulib test.
973 * basename.c (base_name): New semantics - malloc the result.
974 Preserve // when it is special. Preserve relative files that look
976 (base_len): Preserve // when it is special.
977 (last_component): New method, similar to old base_name semantics.
978 * stripslash.c (strip_trailing_slashes): Use last_component, not
979 base_name. Strip redundant slashes from ///.
981 2006-03-19 Jim Meyering <jim@meyering.net>
983 Work even in a chroot where d_ino values for entries in "/"
984 don't match the stat.st_ino values for the same names.
985 * getcwd.c (__getcwd): When no d_ino value matches the target inode
986 number, iterate through all entries again, using lstat instead.
987 Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
988 Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
990 * getcwd.c (__getcwd): Clarify a comment.
991 Use memcpy in place of a call to strcpy.
993 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
995 * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
996 Typedef to long int, not to off_, as POSIX will likely change
999 2006-03-12 Jim Meyering <jim@meyering.net>
1001 * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1002 that of the current directory (which we're about to chdir ".." out of),
1003 then save the dev-ino of the parent, instead.
1005 * same-inode.h (SAME_INODE): New file/macro.
1006 * chdir-safer.c (SAME_INODE): Remove definition.
1007 Include "same-inode.h", instead.
1009 * cycle-check.h: Include "same-inode.h".
1010 (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1011 * cycle-check.c (SAME_INODE): Remove definition.
1012 * root-dev-ino.h: Include "same-inode.h".
1014 2006-03-12 Paul Eggert <eggert@cs.ucla.edu>
1016 * Makefile.am (libcoreutils_a_SOURCES): Remove time_r.c, time_r.h,
1017 as this is now done in m4.
1018 * time_r.h (asctime_r, ctime_r): Remove. These functions can
1019 overrun buffers and shouldn't be used (much as gets shouldn't be
1021 * time_r.c (asctime_r, ctime_r): Likewise.
1023 2006-02-17 Simon Josefsson <jas@extundo.com>
1025 * base64.h, base64.c: New files.
1026 * Makefile.am (libcoreutils_a_SOURCES): Add base64.h and base64.c.
1028 2006-02-20 Paul Eggert <eggert@cs.ucla.edu>
1030 * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1031 AT_FDCWD exceeds INT_MAX.
1032 * openat.h (AT_FDCWD): Likewise.
1034 2006-02-17 Jim Meyering <jim@meyering.net>
1036 * openat.c: Include lstat.h, so that uses of lstat are converted
1037 to uses of rpl_lstat, e.g., on Solaris 9. Otherwise, programs like
1038 du (which now uses the openat-enabled fts and hence fstatat) would
1039 mistakenly fail to dereference a symlink-to-directory specified
1040 with a trailing slash.
1042 2006-02-14 Paul Eggert <eggert@cs.ucla.edu>
1044 * vasnprintf.c (VASNPRINTF): Rewrite the computation so that we
1047 2006-02-14 Bruno Haible <bruno@clisp.org>
1051 * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1052 temporary buffer for sprintf, take into account the precision also
1053 for 'd', 'i', 'u', 'o', 'x', 'X'.
1055 2006-02-14 Simon Josefsson <jas@extundo.com>
1059 * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1062 * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1065 2006-02-07 Paul Eggert <eggert@cs.ucla.edu>
1067 * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1068 ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1070 2006-02-02 Jim Meyering <jim@meyering.net>
1072 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1073 failure on deficient systems, and simplify gnulib lgpl dependencies.
1074 * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1075 xmalloc/lstat combination. Based on a patch from Bruno Haible.
1077 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
1079 * fnmatch.c (L_): Renamed from L, to work around a bug in
1080 Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1081 <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1084 2006-01-26 Paul Eggert <eggert@cs.ucla.edu>
1086 * stdbool_.h: Sync from gnulib.
1087 Use signed char with all non-GCC compilers.
1089 2006-01-25 Paul Eggert <eggert@cs.ucla.edu>
1091 * stdbool_.h: Merge from gnulib; we still don't quite match exactly,
1092 but we're getting closer.
1093 (true, false) [defined __BEOS__]: undef, as before.
1094 (_Bool) [!@HAVE__BOOL@ && defined __GNUC__]: Use an enum
1095 rather than a #define.
1097 2006-01-25 Jim Meyering <jim@meyering.net>
1099 * fileblocks.c: Remove useless parentheses in cpp directive.
1100 * readutmp.h: Likewise.
1102 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
1104 Work around porting bugs reported by Dieter in
1105 <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1106 * getopt.c (_NOPROTO): Remove; no longer needed.
1107 Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1108 Include "getopt.h" first, to check interface.
1109 (getenv): Declare only if defined HAVE_DECL_GETENV &&
1111 * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1112 (__strndup): Revert to K&R-style function dfns, the glibc style.
1113 * strnlen.c: Don't claim it's taken from glibc; it's not.
1114 (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1115 Include strnlen.h first, to get prototype properly.
1116 (strnlen): Renamed from __strnlen.
1119 2006-01-23 Ulrich Drepper <drepper@redhat.com>
1121 These changes imported from libc.
1122 * getopt.c: Use __fxprintf instead of inline stream orientation
1123 test and two separate function calls.
1124 * strndup.c (__strndup): Add libc_hidden_def.
1126 2006-01-23 Jim Meyering <jim@meyering.net>
1128 * xalloc-die.c: Remove unused definition of N_.
1130 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
1132 * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1133 to pacify gcc -Wswitch-default.
1135 2006-01-17 Jim Meyering <jim@meyering.net>
1137 Rewrite fts.c not to change the current working directory,
1138 by using openat, fstatat, fdopendir, etc..
1140 * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
1141 (HAVE_OPENAT_SUPPORT): Define.
1142 [_LIBC] (fchdir): Don't undef or define; no longer used.
1143 (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
1144 Now, this `function' always succeeds, and consumes its file descriptor
1145 parameter -- so callers must not close such FDs. Update callers.
1146 (diropen_fd, opendirat, cwd_advance_fd): New functions.
1147 (diropen): Add parameter, SP. Adjust all callers.
1148 Implement using diropen_fd, rather than open.
1149 (fts_open): Initialize new member, fts_cwd_fd.
1150 Remove fts_rft-setting code.
1151 (fts_close): Close fts_cwd_fd, if necessary.
1152 (__opendir2): Define in terms of opendir or opendirat,
1153 depending on whether the FST_NOCHDIR flag is set.
1154 (fts_build): Since fts_safe_changedir consumes its FD, and since
1155 this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
1156 and close the dup'd file descriptor upon failure.
1157 (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
1158 (fts_safe_changedir): Tweak semantics to reflect that this function
1159 now calls cwd_advance_fd and hence consumes its FD argument.
1160 * fts_.h [struct FTS] (fts_cwd_fd): New member.
1161 [struct FTS] (fts_rft): Remove now-unused member.
1162 [struct FTS] (fts_cycle.state): Improve comment.
1164 * openat.c (openat_needs_fchdir): New function.
1165 * openat.h (openat_needs_fchdir): Declare it.
1167 2006-01-12 Jim Meyering <jim@meyering.net>
1169 * stdint_.h: Remove useless parentheses in cpp directives, so that
1170 this file passes coreutils' `make syntax-check' tests.
1172 2006-01-11 Paul Eggert <eggert@cs.ucla.edu>
1174 * .cvsignore: Add stdint.h.
1175 * Makefile.am (BUILT_SOURCES, EXTRA_DIST, stdint.h, MOSTLYCLEANFILES):
1177 * md5.c: Fix commentary typos.
1178 (alignof, UNALIGNED_P): No need for a GCC-specific version.
1179 * md5.h (__attribute__): Remove; unused.
1180 * sha1.c, sha256.c, sha256.c: Fix commentary to match md5 better.
1181 * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1182 so that we don't need to worry about alignment. All uses changed.
1183 This merges the 2005-10-28 md5 change into sha1.
1184 * sha256.h (struct sha256_ctx): Likewise.
1185 * sha512.h (struct sha512_ctx): Likewise.
1186 * sha256.h: Include stdint.h rather than md5.h.
1187 * sha512.h: Include stdint.h uniformly, since we now have the
1189 * stdint_.h: New file, from gnulib.
1191 2006-01-11 Jim Meyering <jim@meyering.net>
1193 * fts.c (fts_stat): When following a symlink-to-directory,
1194 don't necessarily interpret stat-fails+lstat-succeeds as indicating
1195 a dangling symlink. That can also happen at least for ELOOP.
1196 The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1197 FYI, this bug predates the inclusion of fts.c in coreutils.
1199 2006-01-11 Jim Meyering <jim@meyering.net>
1201 * fts.c [!_LIBC]: Include "fcntl--.h", to map open to open_safer.
1202 (fts_open): Put new (2006-01-04) maxarglen declaration and uses
1203 in their own block, so pre-c99 compilers don't object.
1205 * openat.c (fchownat): New function.
1206 * openat.h (fchmodat, fchownat): Declare.
1207 (chmodat, lchmodat): Define convenience functions.
1208 (chownat, lchownat): Likewise.
1209 * fchmodat.c (fchmodat): New file and function.
1211 * md5.c (OP): Remove useless space-before-TAB.
1213 2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
1215 * localcharset.c, md5.c, md5.h, savedir.c, savedir.h, sha1.c, sha1.h
1216 * strcasecmp.c, strncasecmp.c, verify.h, regex_internal.h:
1218 * sha256.c, sha256.h, sha512.c, sha512.h:
1219 Replace all instances of md5_uint32_t with uint32_t, to accommodate
1222 2006-01-10 Jim Meyering <jim@meyering.net>
1224 Avoid the double-free (first in fts_read, second in fts_close) that
1225 would occur when an `active' directory is made inaccessible (e.g.,
1226 via chmod a-x) during a traversal.
1227 * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1228 before returning. Reproduce this failure by
1229 mkdir -p a/b; cd a; chmod a-x . b
1230 Reported by Stavros Passas.
1232 2006-01-06 Jim Meyering <jim@meyering.net>
1234 * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1236 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
1238 * strftime.c (tzname): Don't declare if it is already #defined.
1239 Problem reported for Mingw by Mark Junker.
1241 2006-01-04 Jim Meyering <jim@meyering.net>
1244 * fts.c (fts_open): Avoid function call in MAX macro use.
1246 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
1248 * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1249 long int, not int, for nanosecond counts, so that people who are
1250 used to POSIX struct timespec won't be surprised. Reported by Jim
1253 2006-01-01 Paul Eggert <eggert@cs.ucla.edu>
1255 * chmod-safer.c, chmod-safer.h: Remove.
1256 * lchmod.h: New file.
1257 * mkdir-p.c: Include lchmod.h, lchown.h.
1258 (make_dir_parents): Use lchown rather than chown, and
1259 lchmod rather than chmod.
1261 2005-12-26 Paul Eggert <eggert@cs.ucla.edu>
1263 * chdir-long.c (cdb_free): Don't bother trying to open directory
1264 for write access: POSIX says that must fail.
1265 * chdir-safer.c (chdir_no_follow): Likewise.
1266 * fts.c (diropen): Likewise.
1267 * save-cwd.c (save_cwd): Likewise.
1268 * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1269 well, for minor improvements on hosts that lack O_DIRECTORY.
1270 * chmod-safer.c (defined_S_IFMT): New macro.
1271 Include stat-macros.h.
1272 Include stdlib.h, for abort().
1273 Don't include stdio.h or assert.h; no longer needed.
1274 (same_file_type): Don't assume S_IFMT is defined, as POSIX
1275 does not require this. Don't assume S_IFCHR and S_IFBLK have
1276 their usual sort of bit pattern.
1277 (fchmod_new): Open with O_NOCTTY for as well, for minor
1278 improvement on hosts where that matters. Don't bother to assert,
1279 since the caller (in this source file) checks the same thing.
1280 Discard any errno from a close failure, for consistency with other
1282 * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1283 Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1284 Fall back on chown if open failed with EACCES.
1286 2005-12-26 Jim Meyering <jim@meyering.net>
1288 * chdir-safer.c (chdir_no_follow): Move declaration of local,
1289 sb2, `down' into the scope where it is used.
1290 Note that on some systems this function also fails when DIR
1291 is a writable-yet-unreadable directory.
1293 2005-12-25 Paul Eggert <eggert@cs.ucla.edu>
1295 * chdir-safer.h (FCHMOD_SAFER_H): Remove: it was misnamed, and
1296 wasn't needed anyay.
1297 * chdir-safer.c (chdir_no_follow): Don't include stdio.h, assert.h,
1298 fcntl--.h; not needed.
1299 (O_DIRECTORY): Define if not already defined.
1300 (chdir_no_follow): Revamp describing comment to match code more
1301 closely. Redo use of internal vars to avoid lint complaints.
1302 Work even if directory is writeable but not readable.
1303 Open with O_DIRECTORY | O_NOCTTY, for benefit of hosts that
1304 don't have O_NOFOLLOW. Use O_NONBLOCK (POSIX spelling) rather
1305 than O_NDELAY. Don't bother invoking fstat if open does not
1306 dereference symlink, since the result isn't used then.
1307 Don't assume file descriptor is positive; it might be zero
1308 now that we no longer include fcntl--.h (we don't need fcntl--.h
1309 since we immediately close the descriptor).
1311 2005-12-25 Jim Meyering <jim@meyering.net>
1313 * chdir-safer.c (chdir_no_follow): Remove unnecessary
1314 test of S_ISDIR (sb_init.st_mode).
1316 2005-12-23 Jim Meyering <jim@meyering.net>
1318 * mkdir-p.c (make_dir_parents): Use chdir_no_follow only
1319 if we've just created the directory.
1321 * chdir-safer.c (chdir_no_follow): Rewrite to use fchdir even
1322 when O_NOFOLLOW is not defined. Suggested by James Youngman.
1324 * chmod-safer.c (O_NOFOLLOW): Define, if necessary.
1325 * chdir-safer.c (O_NOFOLLOW): Likewise.
1326 Reported by Eric Blake.
1328 2005-12-22 Jim Meyering <jim@meyering.net>
1330 * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1331 and dup to open_safer and dup_safer, respectively.
1332 (openat_permissive): Fix typo in comment.
1334 2005-12-21 Jim Meyering <jim@meyering.net>
1336 Like chdir(2), but safer, if possible.
1337 * chdir-safer.c, chdir-safer.h: New files.
1339 2005-12-20 Jim Meyering <jim@meyering.net>
1341 * mkdir-p.c (RW_USR): Remove definition.
1342 (make_dir_parents): Use S_IRWXU, now that read access is also required.
1344 Avoid a race condition, on systems where open honors O_NOFOLLOW.
1345 * mkdir-p.c (make_dir_parents): Include chdir-safer.h.
1346 Use chdir_no_follow in place of chdir.
1348 * mkdir-p.c (make_dir_parents): Remove unnecessary casts of alloca,
1349 since now it's guaranteed to be (void *).
1351 * chmod-safer.c (fchmod_new): Don't try to close fd if it's < 0.
1353 2005-12-19 Jim Meyering <jim@meyering.net>
1355 * chmod-safer.c, chmod-safer.h: New files.
1357 2005-12-05 Andreas Gruenbacher <agruen@suse.de>
1359 Add POSIX ACL support
1360 * acl.h (copy_acl, set_acl): Add declarations.
1361 * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1362 systems other than Linux.
1363 (chmod_or_fchmod): New function: use fchmod when possible,
1364 and chmod otherwise.
1365 (file_has_acl): Add a POSIX ACL implementation, with a
1366 Linux-specific subcase.
1367 (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1368 S_ISVTX from one file to another. Fall back to fchmod/chmod when
1369 acls are unsupported.
1370 (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1371 S_ISVTX to a defined value. Fall back to fchmod/chmod when acls
1374 2005-12-16 Paul Eggert <eggert@cs.ucla.edu>
1376 * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1377 "gettext.h"; either no longer needed or are guaranteed by openat.h.
1378 (_): Remove; no longer needed.
1379 (openat): Renamed from rpl_openat; no need for rpl_openat
1380 since openat.h renames openat for us.
1381 Replace most of the body with a call to openat_permissive,
1382 to avoid duplicate code.
1383 Port to (probably hypothetical) environments were mode_t is
1385 (openat_permissive): Require mode arg, so that we can check
1386 types better. Put it just after flags. Change cwd failure
1387 indicator from pointer-to-bool to pointer-to-errno-value.
1388 All callers changed.
1389 Invoke openat_save_fail and/or openat_restore_fail if
1390 cwd_errno is null, so that openat can call us.
1391 (openat_permissive, fdopendir, fstatat, unlinkat):
1392 Simplify errno handling to avoid some duplicate code,
1393 as it's OK to set errno on success.
1394 * openat.h: Revamp code so that function macros depend on
1395 __OPENAT_PREFIX only, not also on AT_FDCWD.
1396 (openat_ro): Remove. Caller changed to use openat_permissive.
1397 (openat_permissive): Now a macro, if not a function.
1398 (openat_restore_fail, openat_save_fail): Now always functions,
1399 since mkdirat needs them even if __OPENAT_PREFIX is defined.
1401 2005-12-14 Jim Meyering <jim@meyering.net>
1403 * Makefile.am (libcoreutils_a_SOURCES): Remove fprintftime.c
1404 and fprintftime.h. Now they're pulled in via the .m4 file.
1406 2005-12-13 Paul Eggert <eggert@cs.ucla.edu>
1408 * Makefile.am (stdbool.h): Resurrect the 'sed' that goes along
1409 with '#if !@HAVE_BOOL@".
1410 * stdbool_.h (_Bool): Resurrect the "#if !@HAVE__BOOL@" check, to
1411 work around compilers that have a (possibly-broken) _Bool but lack
1412 a working <stdbool.h>.
1414 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
1416 * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1417 TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1418 porting problem reported by Georg Schwarz in
1419 <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1421 2005-12-04 Jim Meyering <jim@meyering.net>
1423 * openat-priv.h (EXPECTED_ERRNO): Add ENOSYS, for Solaris 8.
1424 Paul Eggert reported that unlink/rmdir vs. e.g., /proc/self/fd/N/FILE
1425 fails with ENOSYS. This makes openat revert to using save-cwd.c
1426 functions in that case.
1428 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
1432 * exclude.c: Include verify.h.
1433 (verify): Remove. All callers changed to use verify.h's version.
1434 * strtoimax.c: Likewise.
1435 * utimecmp.c: Likewis.e
1437 * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
1438 include <wchar.h>; no longer needed.
1440 2005-12-01 Jim Meyering <jim@meyering.net>
1444 * intprops.h (signed_type_or_expr__): Define.
1445 (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
1448 2005-12-01 Jakub Jelinek <jakub@redhat.com>
1449 and Ulrich Drepper <drepper@redhat.com>
1451 Import from libc via gnulib.
1452 * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
1453 instead of inline stream orientation test and two separate
1454 function calls. Pay no attention to USE_IN_LIBIO.
1456 2005-12-01 Roland McGrath <roland@redhat.com>
1458 Import from libc via gnulib. [BZ #1331]
1459 * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
1461 Reported by Matej Vela <vela@debian.org>.
1463 2005-11-30 Jim Meyering <jim@meyering.net>
1465 * openat-priv.h: New file, defining macros used by mkdirat.c
1467 * mkdirat.c: Include openat-priv.h.
1468 Remove definitions of macros defined therein.
1469 * openat.c: Likewise.
1471 * mkdirat.c (mkdirat): New file and function.
1472 * openat.h (mkdirat): Declare.
1474 2005-11-25 Paul Eggert <eggert@cs.ucla.edu>
1476 * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1477 too. Problem with "none" reported by Bob Proulx. Problem with
1478 "proc" reported by n0dalus.
1480 * mountlist.c: Include <limits.h>.
1481 (dev_from_mount_options)
1482 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1483 New function. It no longer assumes "dev=" has the System V meaning
1484 on Linux (since it doesn't). It also parses "dev=" more carefully.
1485 (read_file_system_list)
1486 [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1487 MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1490 * Makefile.am (stdbool.h): Just copy stdbool_.h; no need to sed
1493 * stdbool_.h: Simplify greatly, under the assumption that these
1494 days most people use C99-compatible compilers to debug, so it's
1495 not worth worrying about catering to older compilers for that.
1496 This works around some porting problems with HP-UX compilers.
1497 (false, true) [defined __BEOS__]: Don't #undef; no longer needed.
1498 (_Bool): typedef to bool if C++ or BeOS, and #define to signed char
1501 * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1502 Report an error at compile-time if only a 1-second nominal clock
1503 resolution is found.
1505 2005-11-23 Paul Eggert <eggert@cs.ucla.edu>
1507 * Makefile.am (libcoreutils_a_SOURCES): Add buffer-lcm.c, buffer-lcm.h.
1508 * buffer-lcm.c, buffer-lcm.h: New files, from diffutils.
1510 2005-11-23 Jim Meyering <jim@meyering.net>
1512 * openat.c (fdopendir): Don't change errno when returning non-NULL.
1514 2005-11-22 Jim Meyering <jim@meyering.net>
1516 * openat.h (openat_permissive): Declare.
1517 (openat_ro): Define.
1519 * openat.c (EXPECTED_ERRNO): New macro.
1520 (openat_permissive): New function -- used in remove.c rewrite.
1521 (all functions): Set errno just before returning, only if there
1522 was an actual failure.
1523 Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1525 2005-11-20 Jim Meyering <jim@meyering.net>
1527 * euidaccess-stat.c: New file, mostly from euidaccess.c.
1528 * euidaccess-stat.h: New file.
1530 2005-11-15 Paul Eggert <eggert@cs.ucla.edu>
1532 * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1533 coreutils no longer futzes with rounding modes.
1535 2005-11-08 Eric Blake <ebb9@byu.net>
1537 * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1539 2005-11-13 Jim Meyering <jim@meyering.net>
1541 * mkstemp-safer.c: Include <config.h>, required for possible
1542 replacement of mkstemp.
1544 2005-11-12 Jim Meyering <jim@meyering.net>
1546 Emulate openat-family functions using Linux's procfs, if possible.
1547 Idea and some code based on Ulrich Drepper's glibc changes.
1549 * openat.c: (BUILD_PROC_NAME): New macro.
1550 Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1551 (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1552 before falling back on save_cwd and restore_cwd.
1553 (fdopendir, fstatat, unlinkat): Likewise.
1555 2005-11-11 Jim Meyering <jim@meyering.net>
1557 * openat.c (fstatat, unlinkat): Perform the syscall directly,
1558 skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1560 2005-11-10 Paul Eggert <eggert@cs.ucla.edu>
1562 * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1564 (gethrxtime) [! (HAVE_NANOUPTIME
1565 || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1566 || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1567 our own approximation.
1569 2005-11-01 Paul Eggert <eggert@cs.ucla.edu>
1571 * posixtm.h (PDS_PRE_2000): New macro.
1572 * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1573 All usages changed. Reject dates outside the range 1969-1999 if
1574 PDS_PRE_2000 is used.
1576 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
1578 Fix porting problems reported by Theodoros V. Kalamatianos.
1579 * fd-reopen.c [defined HAVE_CONFIG_H]: Include <config.h>,
1580 so that large files can be opened.
1581 * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1582 Don't assume that futimes failing means we must fail.
1584 2005-10-29 Paul Eggert <eggert@cs.ucla.edu>
1586 * getcwd.c (__getcwd): Don't assume that system calls after readdir
1587 leave errno alone. Problem reported by Dmitry V. Levin.
1589 2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
1591 * savedir.c (savedir): Don't assume that xrealloc etc. leave
1592 errno alone. Problem reported by Frederic Jolliton.
1594 2005-10-24 Jim Meyering <jim@meyering.net>
1596 * mkdir-p.c (make_dir_parents): Like the code above, don't rely
1597 on mkdir failing with a particular errno value (EEXIST).
1598 Based on a patch by Dmitry V. Levin.
1600 * mkdir-p.c (make_dir_parents): Make the preceding fix a little
1601 more robust, e.g., when the final component is created as a non-
1602 directory by another process just before `mkdir -p's final mkdir.
1604 A command like `mkdir -p nonexistent/.' would create the
1605 directory but exit nonzero with a diagnostic. This could also be
1606 triggered with a non-`.' component, e.g., in a race with another
1607 process running the same `mkdir -p nonexistent/sub' command.
1609 * mkdir-p.c (make_dir_parents): Handle the case of an
1610 existing final component.
1611 Reported by Matthias Andree here:
1612 http://savannah.gnu.org/bugs/?func=detailitem&item_id=14848
1614 2005-10-23 Jim Meyering <jim@meyering.net>
1616 * sha512.h: Remove no-longer-relevant comment.
1618 2005-08-27 David Madore <david.madore@ens.fr>
1620 * sha256.h, sha256.c, sha512.h, sha512.c: New files - sha-2
1623 2005-10-20 Jim Meyering <jim@meyering.net>
1625 * modechange.c (mode_compile): Reject an invalid mode string
1626 that starts with an octal digit. From Andreas Gruenbacher.
1628 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
1630 * mkdir-p.c (make_dir_parents): Don't report an error if an
1631 intermediate directory is in a read-only file system. Problem
1632 reported by Eric Blake.
1634 2005-10-08 Jim Meyering <jim@meyering.net>
1636 * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1637 as second argument to va_arg. Otherwise, some versions of gcc
1638 warn that `if this code is reached, the program will abort'.
1641 * getdelim.c: (SIZE_MAX): New macro, if not already defined.
1643 2005-10-05 Jim Meyering <jim@meyering.net>
1645 * Makefile.am (libcoreutils_a_DEPENDENCIES): Remove definition.
1646 Once it's gone, automake generates an equivalent one.
1647 Suggestion from Stepan Kasal.
1649 * getaddrinfo.h: Merge from gnulib.
1651 2005-10-04 Jim Meyering <jim@meyering.net>
1654 * getaddrinfo.h: Include sys/types.h before other headers.
1656 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
1658 * getdelim.c: Import from gnulib (to fix unused var warnings) then
1659 apply the following fixes:
1660 Include getdelim.h first. Include <limits.h>.
1661 (SSIZE_MAX): New macro, if not already defined.
1662 (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
1665 2005-10-01 Simon Josefsson <jas@extundo.com>
1667 * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
1668 Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO. Protect
1669 AI_* and EAI_* definitions. Protect function declarations.
1671 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
1673 * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
1674 Remove AT_FDCWD test.
1675 Do not consume the fd unless successful.
1676 * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
1678 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
1680 * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
1681 so that the code works even with ancient cpp. Portability problem
1682 with GCC 2.7.2.1 reported by Thomas M.Ott.
1684 * settime.c (settime): Fix { typo in previous patch. Also, don't
1685 bother returning ENOSYS if settimeofday or stime fails; just let
1686 them return whatever errno they want to return.
1688 2005-09-29 Jim Meyering <jim@meyering.net>
1690 * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
1691 block, so that we don't even try to compile it if settimeofday is
1692 available. This works around a compilation failure on OSF1 V5.1,
1693 due to stime requiring a `long int*' while tv_sec is `int'.
1695 2005-09-27 Jim Meyering <jim@meyering.net>
1697 * fprintftime.c [HAVE_CONFIG_H]: Include <config.h> conditionally,
1698 to be consistent with gnulib.
1699 * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
1700 * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
1701 * strnumcmp.c [HAVE_CONFIG_H]: Include <config.h> here, now that
1702 strnumcmp-in.h no longer includes it.
1704 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
1706 * utimens.c: Include unistd.h, for dup2.
1707 (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
1708 (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
1710 2005-09-25 Jim Meyering <jim@meyering.net>
1712 * strnumcmp-in.h: Protect against multiple inclusion.
1714 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
1716 * utimens.c (ENOSYS): Define if not already defined.
1717 (futimens): Support having a null PATH if the file descriptor
1720 * Makefile.am (libcoreutils_a_SOURCES): Remove mbchar.c, since
1721 it doesn't build in OpenBSD 3.4. See
1722 <http://lists.gnu.org/archive/html/bug-gnulib/2005-09/msg00242.html>.
1724 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
1726 (__attribute): Define to empty unless GCC 3.1 or later.
1727 This works around a core dump on OpenBSD 3.4, which has GCC
1728 2.95.3, which dumps core when given __attribute__(()). It also
1729 simplifies other tests, since we really don't want to bother with
1730 worrying about which ancient version of GCC supported what.
1731 Original problem reported by Yoann Vandoorselaere, with part of
1732 the fix suggested by Derek Price.
1734 2005-09-24 Jim Meyering <jim@meyering.net>
1736 * openat-die.c, root-dev-ino.c, setenv.c, stdopen.c:
1737 * tsearch.c, unsetenv.c, xfts.c: Use `#ifdef HAVE_CONFIG_H',
1738 not `#if HAVE_CONFIG_H', for consistency with gnulib.
1740 * strintcmp.c: Include <config.h> here, ...
1741 * strnumcmp-in.h: ..., not here.
1745 * verify.h (verify_type__): Use `unsigned int' as the bitfield type
1746 so we can once again use a positive bitfield width of 1 -- now we
1747 don't have to explain why we were using a bitfield width of 2.
1749 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
1751 * utimens.c (futimens): Use futimesat if available.
1752 Prefer it to futimes since it doesn't have the futimes bug.
1754 * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
1755 (verify): Don't use the __LINE__ trick, as it doesn't work in general.
1756 Instead, declare a function that returns a pointer to an array,
1757 and use verify_type__ to declare the size of the array.
1758 Problem and germ of a solution reported by Bruno Haible.
1759 (verify_type__): Use 2, not 1, for bitfield size, to avoid
1760 a warning with Irix 6.5 cc. Problem reported by Bruno Haible.
1762 2005-09-23 Jim Meyering <jim@meyering.net>
1764 * strnumcmp-in.h: Include <config.h>. Otherwise builds with strict
1765 C89 (e.g., Sun's /opt/SUNWspro/bin/c89) would fail due to the use
1768 2005-09-22 Paul Eggert <eggert@cs.ucla.edu>
1770 * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
1771 Problem reported by Eric Blake.
1772 (getaddrinfo): Initialize se so that it's not garbage.
1773 Redo internal storage allocation so that it doesn't make unportable
1774 assumptions about alignment.
1777 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
1781 * Makefile.am (libcoreutils_a_SOURCES): Add getaddrinfo.h,
1782 mbchar.c, mbchar.h, mbuiter.h, strcase.h, strlen1.c, strnlen1.h,
1785 * argmatch.h (GL_CONCAT): Remove.
1786 Include "verify.h" instead.
1787 (ARGMATCH_CONSTRAINT, ARGMATCH_ASSERT): Remove.
1788 (ARGMATCH_VERIFY): Rewrite in terms of new verify macros.
1790 * xalloc.h (VERIFY_EXPR, X2NREALLOC, X2REALLOC): Remove.
1791 The latter two macros are moving to ../src/system.h for now.
1792 This reverts this file to the gnulib version.
1794 * xanstrftime.c, xanstrftime.h: Remove; no longer used.
1796 * .cppi-disable: Add getaddrinfo.h, getdelim.h, mbchar.h,
1797 mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
1799 * canon-host.h, gai_strerror.c, getaddrinfo.c, getaddrinfo.h:
1800 * getdelim.c, getdelim.h, mbchar.c, mbchar.h, mbuiter.h:
1801 * strcase.h, strnlen.h, strnlen1.c, strnlen1.h, strstr.h:
1802 New files, from gnulib.
1804 * __fpending.c, __fpending.h, acl.c, argmatch.c, atexit.c:
1805 * backupfile.c, basename.c, calloc.c, canonicalize.c:
1806 * chdir-long.c, chown.c, cloexec.c, closeout.c, creat-safer.c:
1807 * cycle-check.c, dirfd.c, dirfd.h, dirname.c, dup-safer.c:
1808 * dup2.c, euidaccess.c, exclude.c, exitfail.c, fchown-stub.c:
1809 * fd-safer.c, file-type.c, fileblocks.c, filemode.c:
1810 * filenamecat.c, fnmatch.c, fopen-safer.c, free.c, fsusage.c:
1811 * ftruncate.c, full-write.c, getcwd.c, getcwd.h, getdate.h:
1812 * getgroups.c, getndelim2.c, getopt1.c, getopt_.h:
1813 * gettimeofday.c, getugroups.c, group-member.c, hard-locale.c:
1814 * hash-pjw.c, hash.c, human.c, human.h, idcache.c, inttostr.c:
1815 * inttostr.h, lchown.c, long-options.c, lstat.c, malloc.c:
1816 * memcasecmp.c, memchr.c, memcmp.c, memcoll.c, memcpy.c:
1817 * memmove.c, mkdir.c, mkstemp.c, mktime.c, modechange.c:
1818 * mountlist.c, nanosleep.c, open-safer.c, openat.c, physmem.c:
1819 * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
1820 * quotearg.c, raise.c, readlink.c, readtokens0.c, readutmp.c:
1821 * realloc.c, regex.c, regex_internal.h, rename.c, rmdir.c:
1822 * rpmatch.c, safe-read.c, same.c, save-cwd.c, savedir.c:
1823 * settime.c, sig2str.c, strcspn.c, stripslash.c, strndup.c:
1824 * strnlen.c, strtod.c, strtoimax.c, strtol.c, strverscmp.c:
1825 * tempname.c, time_r.c, time_r.h, timespec.h, unicodeio.h:
1826 * unistd--.h, unlinkdir.c, userspec.c, utimecmp.c:
1827 * version-etc-fsf.c, version-etc.c, xalloc-die.c, xgetcwd.c:
1828 * xgethostname.c, xmalloc.c, xmemcoll.c, xnanosleep.c:
1829 * xreadlink.c, xstrndup.c, xstrtoimax.c, xstrtol.c:
1830 * xstrtoumax.c, yesno.c:
1833 * canon-host.c, getline.c, getline.h, getpass.c, strcasecmp.c:
1834 * strncasecmp.c, strstr.c:
1835 Nontrivial sync from gnulib.
1837 * .cvsignore: Sort entries.
1839 * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
1840 (make_dir_parents): Treat ENOSYS like EEXIST.
1842 2005-09-20 Jim Meyering <jim@meyering.net>
1844 * openat.c (fdopendir): Be sure to close the supplied
1845 file descriptor before returning. This makes our replacement
1846 implementation a little closer to Solaris's, where fdopendir
1847 ties the file descriptor to the returned DIR* pointer.
1849 2005-09-19 Jim Meyering <jim@meyering.net>
1851 * openat.c (unlinkat): New function.
1852 * openat.h (unlinkat): Add prototype.
1854 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
1857 * stat-time.h: New file.
1858 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
1859 (MTIME_CMP, TIMESPEC_NS): Remove. Now done by stat-time.h,
1861 (timespec_cmp): New function.
1862 * utimecmp.c: Include stat-time.h.
1863 (SYSCALL_RESOLUTION): Depend on whether various struct stat
1864 members exist, not on the obsolescent ST_MTIM_NSEC.
1865 (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
1867 * .cppi-disable: Add stat-time.h.
1869 2005-09-16 Jim Meyering <jim@meyering.net>
1871 * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
1872 size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
1873 int utc, int nanoseconds);
1875 date should not have to allocate a megabyte of virtual memory to
1876 handle a format argument like +%1048575T. When implemented with
1877 strftime, it must allocate such a buffer, use strftime to fill it
1878 in, print it, then free it.
1879 With fprintftime, it simply prints everything and exits.
1880 With no need for memory allocation, that's one fewer way to fail.
1882 * fprintftime.c, fprintftime.h: New files.
1883 * Makefile.am (libcoreutils_a_SOURCES):
1884 Add fprintftime.c and fprintftime.h.
1886 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
1888 * strftime.c (my_strftime): Rewrite the previous change slightly,
1889 to make it a bit faster and (I hope) clearer.
1891 2005-09-14 Jim Meyering <jim@meyering.net>
1893 * strftime.c (my_strftime): Parse the colons of %:::z *after* the
1894 optional field width, not before, so we accept %9:z, not %:9z.
1895 (my_strftime): Be sure to use L_('x') for literals.
1897 2005-09-13 Paul Eggert <eggert@cs.ucla.edu>
1899 Merge md5 from libc, and clean up some sha1 glitches.
1900 * md5.h (__GNUC_PREREQ, __THROW, __attribute__): New macros.
1901 (__md5_buffer): Renamed from md5_buffer. Add a macro undoing this
1902 if _LIBC is not defined. Add __THROW.
1903 (__md5_finish_ctx, __md5_init_ctx, __md5_process_block):
1904 (__md5_process_bytes, __md5_read_ctx, __md5_stream): Likewise.
1905 (struct md5_ctx): Mark buffer as being aligned.
1906 (rol): Remove; all uses changed to CYCLIC.
1907 * md5.c (CYCLIC): New macro. All uses of rol changed to use CYCLIC.
1908 Redo comment to minimize changes from libc.
1909 * sha1.h (struct sha1_ctx): Mark buffer as being aligned.
1910 * sha1.c (SWAP): Renamed from NOTSWAP, to avoid a horrible misnaming.
1911 All uses changed. Remove the old SWAP.
1912 Remove obvious comment about BLOCKSIZE.
1913 (rol): New macro, moved here from md5.h.
1914 (sha1_process_block): Remove an incoherent FIXME comment.
1916 * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
1917 Fix bug in formats like %2N.
1919 2005-09-13 Jim Meyering <jim@meyering.net>
1921 * xalloc.h: Revert unintended change that removed definitions
1922 of X2REALLOC and X2NREALLOC.
1924 * backupfile.c: Use ARGMATCH_VERIFY, just in case.
1926 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
1928 * regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h:
1929 * regexec.c: Import from gnulib, to fix some 64-bit bugs.
1931 2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
1933 * verify.h (__builtin_constant_p): Remove, undoing previous change.
1934 (verify_type__): Solve the problem by using a bit-field rather
1937 2005-09-05 Jim Meyering <jim@meyering.net>
1939 * verify.h (__builtin_constant_p) [__GNUC__ <= 2]: Define to 1.
1940 (verify_type__) [verify_error_if_non_const__]: New member/test,
1941 to help detect when verify or verify_expr is mistakenly passed
1942 a non-constant argument within a function.
1944 2005-08-31 Jim Meyering <jim@meyering.net>
1946 * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
1947 order to avoid an unsuppressible warning from gcc on 64-bit systems.
1949 * localcharset.c (get_charset_aliases): Add `void' in parameter list
1950 to placate gcc's -Wstrict-prototypes.
1952 2005-08-27 Jim Meyering <jim@meyering.net>
1954 * md5.c: Use `#error' rather than a string literal to provoke failure.
1957 2005-08-25 Jim Meyering <jim@meyering.net>
1959 * open-safer.c: Include <config.h>.
1960 Otherwise, we'd lose LARGEFILE support in any file using
1963 2005-08-24 Jim Meyering <jim@meyering.net>
1965 * stdopen.c (stdopen): Revert to iterating over descriptors, but
1966 rather than using fstat, use fcntl with its F_GETFD flag, which
1967 is more efficient. Unlike the 2-syscall dup-close approach,
1968 this one doesn't apply any unnecessary pressure on the file
1969 descriptor pool -- thus there is one fewer way to fail.
1971 2005-08-23 Jim Meyering <jim@meyering.net>
1973 * regcomp.c, regex.c, regex.h, regex_internal.c: Update from gnulib.
1974 * regex_internal.h, regexec.c: Likewise.
1976 2005-08-19 Jim Meyering <jim@meyering.net>
1978 * stdopen.c (stdopen): Return `bool' so caller can detect failure.
1980 2005-08-17 Jim Meyering <jim@meyering.net>
1982 Make the %s format (seconds since the epoch) work for a negative
1983 number and when used with a zero-padded field width, e.g. %015s.
1985 * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
1986 label so that it precedes the code to set `digits'. Otherwise,
1987 %0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
1988 print `00-22'. Now, it prints `-0022', as it should.
1990 2005-08-15 Bruno Haible <bruno@clisp.org>
1993 * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
1996 2005-08-13 Jim Meyering <jim@meyering.net>
1998 * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
1999 the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2000 when run in a time zone for which daylight savings time is in effect
2001 for the starting date.
2003 2005-08-12 Jim Meyering <jim@meyering.net>
2005 * regcomp.c (duplicate_node) [lint]: Set *new_idx to -1, to avoid
2006 warnings (unfounded) in caller that it may be used uninitialized.
2008 * regex.c (IF_LINT): Define.
2010 * regex_internal.c (re_string_realloc_buffers): Rename local-shadowed
2011 variable: s/new_array/offsets/.
2012 (re_acquire_state) [lint]: Set *err, to avoid warnings in caller.
2014 * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
2015 of unused local, dfa.
2016 (proceed_next_node): Remove outer declaration and
2017 unnecessary initialization of local-shadowed `dest_node'.
2018 Declare it in inner scopes, nearer its uses instead.
2020 * regex.h (RE_SYNTAX_POSIX_AWK): Remove useless space-before-TAB.
2022 * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
2023 Use the hash-table-based cycle-detection code not just when
2024 FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
2025 Reported by James Youngman in
2026 <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
2027 * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
2029 * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
2030 This lets us compile with -DFTS_DEBUG, once again.
2032 2005-08-02 Jim Meyering <jim@meyering.net>
2034 * xanstrftime.c, xanstrftime.h: New files.
2036 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
2038 * getdate.y (relative_time): New type.
2039 (RELATIVE_TIME_0): New constant.
2040 (parser_control): Use relative_time instead of doing it ourselves.
2041 (%union): Add new relative_time rel member.
2042 (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2044 (relunit, relunit_snumber): Now of type rel.
2045 (zone, rel, relunit, get_date): Adjust to above changes.
2047 2005-07-12 Jim Meyering <jim@meyering.net>
2049 * xalloc.h (X2NREALLOC): Define.
2051 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
2053 * verify.h (verify_expr): Use ((verify_type__ (R) *) 0), not
2054 sizeof (verify_type__ (R)), to pacify C++ compilers. Problem
2055 reported by Bruno Haible.
2057 * version-etc-fsf.c (version_etc_copyright): Parameterize the
2058 copyright symbol and the year.
2059 * version-etc.c (COPYRIGHT_YEAR): New constant.
2060 (version_etc_va): Use parameterized copyright notice.
2061 Reword to conform to the current GNU coding standards.
2063 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
2065 * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2066 [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2067 [!LDAV_DONE]: Avoid unused variable warning.
2069 2005-07-08 Eric Blake <ebb9@byu.net> (tiny change)
2070 and Paul Eggert <eggert@cs.ucla.edu>
2072 * regcomp.c (init_dfa, build_range_exp): Store __btowc value
2073 in wint_t, not wchar_t. Remove now-unnecessary cast.
2075 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
2077 Switch to Isamu Hasegawa's implementation of regex, which is
2079 * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
2080 New files, from gnulib.
2081 * regex.h, regex.c: Sync from gnulib.
2082 * Makefile.am (libcoreutils_a_SOURCES): Remove regex.h; gnulib
2083 now does this automatically for us.
2084 * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h.
2086 2005-07-04 Paul Eggert <eggert@cs.ucla.edu>
2088 * verify.h (GL_CONCAT0, GL_CONCAT): Define unconditionally; don't
2089 depend on whether verify_decl is defined.
2090 (verify): Renamed from verify_decl. All uses changed.
2091 Use an extern function decl, as it can't possibly collide with other
2093 (verify_expr): Renamed from verify. All uses changed.
2094 (verify_type__): New private macro.
2095 (verify, verify_expr): Use it.
2097 2005-07-04 Jim Meyering <jim@meyering.net>
2099 * verify.h (verify, verify_decl): New file/macros.
2100 * Makefile.am (libcoreutils_a_SOURCES): Add verify.h here, temporarily.
2101 Eventually, it'll be pulled in via AC_LIBSOURCES.
2103 * argmatch.h (verify_dcl): Rename from VERIFY. Update use.
2105 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
2107 Remove the dependency of the strftime module on the tzset module.
2108 * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
2109 Copy the input structure, to work around some of the bug with
2110 Solaris 2.5.1 and Solaris 2.6.
2112 2005-07-03 Jim Meyering <jim@meyering.net>
2114 * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2115 the .tm_year member, since otherwise gcc-4.0 would now warn about
2116 tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2118 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
2120 * Makefile.am (libcoreutils_a_SOURCES): Undo previous change.
2122 * Makefile.am (libcoreutils_a_SOURCES): Add fcntl--.h, stdio--h,
2123 stdlib--.h, unistd--.h.
2124 * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
2125 * lstat.c: Sync from gnulib.
2126 * lstat.h: New file, from gnulib.
2129 2005-07-03 Jim Meyering <jim@meyering.net>
2131 * fd-reopen.c: Include <unistd.h> for declaration of close.
2133 2005-07-02 Paul Eggert <eggert@cs.ucla.edu>
2135 Cleanup to isolate "safer" functions to a small part of the code.
2136 * fcntl--.h, stdio--.h, stdlib--.h, unistd--.h, fcntl-safer.h:
2137 * open-safer.c, stdlib-safer.h, mkstemp-safer.c, fd-reopen.h:
2138 * fd-reopen.c: New files.
2139 * fopen-safer.c: Include stdio-safer.h first, to check interface.
2140 Don't bother including stdio.h, since stdio-safer.h does.
2141 * fts.c (fd_safer): Remove decl.
2142 Include fcntl--.h rather than unistd-safer.h
2143 (fts_safe_changedir): Don't call fd_safer; no longer needed
2144 now that we include fcntl--.h.
2145 * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2146 Do not include unistd-safer.h.
2147 (getloadavg): Don't call fd_safer; no longer needed
2148 now that we include fcntl--.h.
2149 * getusershell.c: Include stdio--.h rather than stdio.h
2151 (getusershell): Call fopen, not fopen_safer.
2152 * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2153 Do not include unistd-safer.h.
2154 (save_cwd): Don't call fd_safer; no longer needed
2155 now that we include fcntl--.h.
2157 2005-07-02 Jim Meyering <jim@meyering.net>
2159 * getopt_.h: Assume HAVE_UNISTD_H, i.e., include <unistd.h>
2162 * fnmatch.c: Update from gnulib.
2164 * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2165 * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2166 * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2167 * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2168 * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2169 * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2170 * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2171 * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2172 Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2174 2005-07-01 Jim Meyering <jim@meyering.net>
2176 * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2177 * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2178 Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2179 and don't include <sys/file.h>).
2181 2005-07-01 Paul Eggert <eggert@cs.ucla.edu>
2183 * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
2184 declares only 'struct timespec;' (!).
2186 2005-06-30 Jim Meyering <jim@meyering.net>
2188 * stdopen.c: Add copyright.
2189 Include <fcntl.h> and <unistd.h> unconditionally --
2190 it seems to be ok to do this, these days.
2192 * stdopen.c: Rewritten by Paul Eggert.
2193 Now, the minimum overhead is just two system calls: dup and close.
2195 * stdopen.c: New file. As yet unused.
2196 The minimum overhead is three fstat calls.
2197 * stdopen.h: New file.
2199 * argmatch.h [!VERIFY] (VERIFY): Define.
2200 (ARGMATCH_VERIFY): Use it, so this macro may be used more than
2201 once in any given scope.
2203 * xalloc.h (VERIFY_EXPR): Undef before defining, and add a comment.
2205 2005-06-29 Jim Meyering <jim@meyering.net>
2207 * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
2208 type name. Use the variable name instead.
2209 * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
2211 * xalloc.h (VERIFY_EXPR): Define.
2212 (X2REALLOC): New macro, to make using x2realloc a little safer.
2214 2005-06-26 Jim Meyering <jim@meyering.net>
2216 * Makefile.am (libcoreutils_a_SOURCES): Remove diacrit.c and diacrit.h.
2218 2005-06-25 Jim Meyering <jim@meyering.net>
2220 * Makefile.am (libcoreutils_a_SOURCES): Remove
2221 root-dev-ino.c and root-dev-ino.h.
2222 (libcoreutils_a_SOURCES): Remove dev-ino.h too, now that we
2223 get it via root-dev-ino.m4
2224 (libcoreutils_a_SOURCES): Remove version-etc.c version-etc.h
2225 and version-etc-fsf.c.
2227 2005-06-24 Paul Eggert <eggert@cs.ucla.edu>
2229 * canon-host.c (canon_host) [HAVE_GETADDRINFO]: Use `= { 0, };' to
2230 initialize local `hint'. This undoes the previous change, and
2233 2005-06-23 Jim Meyering <jim@meyering.net>
2235 * Makefile.am (libcoreutils_a_SOURCES): Remove xreadlink.c
2237 (libcoreutils_a_SOURCES): Remove xstrtod.c and xstrtod.h.
2239 * backupfile.c (backup_args): Change a `0' to NULL.
2241 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
2243 * mktime.c: Include <string.h> even if !DEBUG. (From glibc.)
2244 (ranged_convert): Don't save conversion in a temporary struct.
2245 This causes a warning with GCC 4.0.0, and anyway in the typical
2246 case it's not worth the extra 100 bytes or so of code.
2247 (ranged_convert, __mktime_internal): When calling a function via a
2248 pointer P, use P () rather than (*P) (), as we now assume C89 or better.
2250 * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
2251 "who -r" failed to give output. Problem reported by Tim Waugh.
2253 2005-06-22 Jim Meyering <jim@meyering.net>
2255 * xmalloc.c: Update from gnulib.
2257 2005-06-19 Jim Meyering <jim@meyering.net>
2259 * Makefile.am (libcoreutils_a_SOURCES): Remove xgetcwd.c, xgetcwd.h,
2262 2005-06-16 Jim Meyering <jim@meyering.net>
2264 * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
2265 when either N or S is zero.
2267 2005-06-15 Jim Meyering <jim@meyering.net>
2269 * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2270 stop us from restricting permissions of just-created absolute-named
2273 2005-06-14 Paul Eggert <eggert@cs.ucla.edu>
2275 Improve quality of diagnostics on restore_cwd failure.
2276 * mkdir-p.h (make_dir): Remove. All uses replaced by mkdir.
2277 (make_dir_parents): Last arg is now int * (for errno), not bool *.
2278 * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2279 Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2280 each time through the loop. Do not diagnose restore_cwd failure;
2281 that is the caller's job (and perhaps the caller does not care).
2283 * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2284 (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2285 If the file already exists but is not a directory, don't bother
2286 to try to make its parents.
2287 Close potential file descriptor leak if we can't chdir("/") (!).
2288 Don't always return true if chdir($PWD) fails; return true only
2289 if the requested action was done successfully (except for the
2291 Don't log final directory unless we actually made it.
2292 Refactor to avoid duplicate code to fix up permissions.
2293 Don't attempt to fix up parent permissions if chdir($PWD) fails.
2295 2005-06-14 Jim Meyering <jim@meyering.net>
2297 * openat-die.c (openat_save_fail): Rename from openat_save_die.
2298 (openat_restore_fail): Rename from openat_restore_die.
2299 * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2301 * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2302 to restore initial working directory.
2304 Provide an alternative to exiting immediately upon save_cwd or
2305 restore_cwd failure. Now, an application can arrange e.g.,
2306 to perform a longjump in that case.
2307 * openat.c: Include dirname.h.
2308 Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2309 (rpl_openat, fdopendir, fstatat): Call openat_save_die
2310 and openat_restore_die rather than calling error directly.
2311 Don't include "error.h" or "exitfail.h"; they're no longer needed.
2313 * openat-die.c (openat_save_die, openat_restore_die): New file.
2314 * openat.h (openat_save_die, openat_restore_die): Declare and define.
2316 2005-06-13 Jim Meyering <jim@meyering.net>
2318 * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2319 to tell caller if/when we change the working directory and are
2320 unable to return to the initial one.
2321 * mkdir-p.h (make_dir_parents): Update prototype.
2323 2005-06-12 Jim Meyering <jim@meyering.net>
2325 * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2326 `return false'. This fixes a bug introduced on 2004-07-30.
2328 2005-06-01 Paul Eggert <eggert@cs.ucla.edu>
2330 Use "file name" when talking about file names, instead of "filename"
2331 or "path", as per the GNU coding standards.
2332 * mkdir-p.c: Renamed from makepath.c.
2333 (make_dir_parents): Renamed from make_path. All callers changed.
2334 * mkdir-p.h: Likewise. All includers changed.
2335 * filenamecat.c: Renamed from path-concat.c.
2336 (file_name_concat): Renamed from path_concat. All callers changed.
2337 [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
2338 * filenamecat.h: Likewise. All includers changed.
2339 * acl.c: Don't use "path" or "filename" to mean "file name"
2340 in comments or local variable names.
2341 * basename.c: Likewise.
2342 * canonicalize.c, canonicalize.h: Likewise.
2343 * dirname.c, dirname.h: Likewise.
2344 * euidaccess.c: Likewise.
2345 * exclude.c: Likewise
2346 * fnmatch_.h, fnmatch_loop.c: Likewise.
2347 * fsusage.c, fsuage.h: Likewise.
2348 * fts.c, fts_.h: Likewise.
2349 * getcwd.c: Likewise.
2350 * getloadavg.c: Likewise.
2351 * mkstemp.c: Likewise.
2352 * mountlist.c, mountlist.h: Likewise.
2353 * openat.c, openat.h: Likewise.
2354 * readlink-stub.c: Likewise.
2355 * readutmp.c, readutmp.h: Likewise.
2356 * rename.c: Likewise.
2357 * rmdir.c: Likewise.
2359 * savedir.c: Likewise.
2360 * stripslash.c: Likewise.
2361 * tempname.c: Likewise.
2362 * xreadlink.c: Likewise.
2363 * exclude.c (excluded_file_name): Renamed from excluded_filename.
2365 * exclude.h: Likewise.
2367 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
2369 * euidaccess.c (getuid, getgid, getuid, getegid)
2370 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2371 * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
2372 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2373 * pathmax.h: Include <limits.h> unconditionally, since other
2374 files have been getting away with it for years (MORE/BSD 4.3
2376 * userspec.c (getpwnam, getgrnam, getgrgid)
2377 [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2379 2005-05-29 Paul Eggert <eggert@cs.ucla.edu>
2381 * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
2382 Define to 256, not 255, as per modern POSIX.
2384 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
2386 * fts.c: Don't worry about debugging on pre-C99-comopatible hosts;
2387 the configuration hassle isn't worth it.
2388 Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
2389 (LONGEST_MODIFIER, PRIuMAX): Remove.
2391 * strnumcmp.c, strnumcmp.h, strnumcmp-in.h, strintcmp.c:
2394 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
2396 * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
2397 so that unistd-safer.h (GPL'ed code) need not be included.
2399 2005-05-20 Paul Eggert <eggert@cs.ucla.edu>
2401 Split the fts code into GPL'ed and LGPL'ed parts, and fix some
2402 minor memory-allocation bugs.
2404 * fts.c: Don't include "cycle-check.h" or "hash.h".
2405 (setup_dir, free_dir): New functions.
2406 (enter_dir, leave_dir): Define trivial
2407 alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
2408 (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
2409 (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
2410 (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
2411 Move to fts-cycle.c.
2412 (fts_open): Use setup_dir.
2413 (fts_close): Use free_dir.
2414 (fts_read): Have just one copy of the ENTER_DIR code rather than three.
2415 This adds a label and some gotos, but the alternatives were messier.
2416 Check for memory allocation failure when entering a dir.
2417 (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
2418 * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
2419 (FTS): New member fts_cycle, that is a union that contains the
2420 old active_dir_ht and cycle_state. All uses changed to mention
2421 fts_cycle.ht and fts_cycle.state.
2422 * fts-cycle.c: New file, containing GPL'ed code migrated out of
2423 fts.c, with the following changes:
2424 (setup_dir, free_dir): New functions.
2425 (enter_dir): Now returns bool. Return true if successful, false
2426 if memory exhausted. All callers changed.
2427 Do not bother partly cleaning up on
2428 memory allocation failure; that is free_dir's job.
2429 However, free ad if hash_insert fails, to avoid memory leak.
2430 (enter_dir, leave_dir): Accommodate change to FTS by inspecting
2431 fts->fts_options to see which union member to use.
2433 2005-05-20 Eric Blake <ebb9@byu.net> (tiny change)
2435 * chown.c (rpl_chown): Return -1 on failure.
2437 2005-05-20 Jim Meyering <jim@meyering.net>
2439 * fts.c (fts_open): Remove useless but otherwise harmless malloc call.
2440 Spotted by Paul Eggert.
2442 2005-05-19 Jim Meyering <jim@meyering.net>
2444 * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
2445 Use #define rather than a static function, to avoid a warning
2446 when the function was not used.
2448 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
2450 * canonicalize.c: Include canonicalize.h first, to test interface.
2451 Include <stddef.h> unconditionally, since we assume C89 now.
2452 All uses of PTR_INT_TYPE replaced by ptrdiff_t.
2453 * fts.c: Include fts_.h first, to check interface.
2454 Do not include intprops.h; no longer needed.
2455 Include cycle-check.h and hash.h, since fts_.h no longer does.
2456 Remove unnecessary casts of closedir to void.
2457 (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
2458 decide whether to decrement nlinks.
2459 * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
2460 (FTS): Use struct hash_table * instead of Hash_table, so that
2461 we no longer need to include hash.h here.
2463 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
2465 * unlinkdir.c, unlinkdir.h: New files.
2467 2005-05-14 Jim Meyering <jim@meyering.net>
2469 * unlocked-io.h, gethrxtime.c, gethrxtime.h, mountlist.h,
2470 * xtime.h, path-concat.c: Correct cpp indentation.
2472 2005-05-14 Jim Meyering <jim@meyering.net>
2474 Update FSF postal mail address everywhere.
2476 2005-05-09 Paul Eggert <eggert@cs.ucla.edu>
2478 * fts_.h (FTS): Use correct type for fts_compar member.
2479 (FTSENT): New member fts_fts. Remove members fts_ino, fts_dev,
2480 fts_nlink; no longer needed now that fts_statp is always there.
2481 All uses changed to use fts_statp instead.
2482 * fts.c (__P): Remove. All uses rewritten to assume C89 or better.
2483 (fts_open): Don't cast a function value in a possibly-unsafe way.
2484 (fts_compar): New function.
2485 (fts_sort): Use it. But optimize the common case where all
2486 pointers smell the same.
2488 2005-05-08 Paul Eggert <eggert@cs.ucla.edu>
2490 * yesno.c: Include getline.h, not ctype.h.
2491 (yesno): Don't remove leading white space; POSIX doesn't allow it.
2492 Use getline to remove arbitrary restriction on response length.
2494 2005-05-05 Paul Eggert <eggert@cs.ucla.edu>
2496 * makepath.c (make_path): chdir to "//", not "/", if the file name
2497 starts with exactly two slashes. This doesn't solve the problem
2498 in general but it's better than nothing. Problem reported by
2499 Pierre A. Humblet via Eric Blake.
2501 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
2503 * modechange.h (mode_free): Remove; all callers changed to invoke
2505 * modechange.c: Likewise.
2506 xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
2507 (MODE_DONE): New constant.
2508 (struct mode_change): Remove 'next' member.
2509 (make_node_op_equals): New function; like the old one of the
2510 same name, except it allocates an array.
2511 (mode_compile, mode_create_from_ref): Use it.
2512 (mode_compile): Allocate result as an array, not a linked list.
2513 Parse octal string ourself, so that we catch mistakes like "+0".
2514 (mode_adjust): Arg is an array, not a linked list.
2516 * mbswidth.c, regex.c, strtol.c: Sync from gnulib.
2518 2005-04-28 Paul Eggert <eggert@cs.ucla.edu>
2520 * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
2521 [!_LIBC] Include "stat-macros.h" instead.
2523 * file-type.c: Include file-type.h first.
2524 * filetype.h: Don't assume <sys/stat.h> was included first.
2526 * modechange.c: Include stat-macros.h, xalloc.h.
2527 (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
2528 (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
2529 (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
2530 Remove. This is now stat-macros.h's job.
2531 (talloc): Remove. All callers replaced by xalloc, so that
2532 our invokers don't have to worry about reporting memory failures.
2533 (make_node_op_equals): Remove.
2534 (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2536 (struct mode_change): Moved here from modechange.h.
2537 (mode_append_entry): Remove.
2538 (mode_compile): Remove MASKED_OPS arg, since it encouraged
2539 apps to have incorrect behavior. Use simpler algorithm for head
2540 and tail. Don't futz with umask; that's now the job of mode_adjust.
2541 Detect more invalid usages rather than having somewhat-random behavior.
2542 Don't insert an "a=" action, as that leads to incorrect behavior.
2543 (mode_compile, mode_create_from_ref): Return NULL on error instead
2544 of an enum, since now there's only one way to have an error. All
2546 (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
2547 at the correct time. Simplify calculation of "+u" and its ilk.
2548 Don't mishandle "+X".
2549 (mode_free): Remove "register" and localize decls.
2550 * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2551 (struct mode_change): Move to modechange.c; callers don't
2552 need to see this stuff.
2553 (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
2554 (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
2555 (mode_change, mode_adjust): Reflect the new signatures noted above.
2557 2005-04-18 Paul Eggert <eggert@cs.ucla.edu>
2559 * Makefile.am (noinst_LIBRARIES): fetish -> coreutils.
2560 (libcoreutils_a_SOURCES): Renamed from libfetish_a_SOURCES.
2562 (libcoreutils_a_LIBADD): Renamed from libfetish_a_LIBADD.
2564 (libcoreutils_a_DEPENDENCIES): Renamed from libfetish_a_DEPENDENCIES.
2566 * chdir-long.c: fetish->coreutils in comment.
2567 * t-chdir-long: fetish->coreutils in compilation command.
2569 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
2571 * getdate.y (zone): Allow relunit_snumber after tZONE, so
2572 that "UTC +1 second" continues to work. Problem reported
2574 (relunit_snumber): New rule.
2577 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
2579 * getdate.y (universal_time_zone_table): New constant.
2580 (time_zone_table): Remove GMT, UT, UTC entries; they're now in
2581 universal_time_zone_table.
2582 (lookup_zone): Prefer universal_time_zone_table to
2583 local_time_zone_table, so that "GMT" time stamps are allowed in
2584 London during the summer. Problem reported by Ian Abbott.
2586 2005-04-11 Paul Eggert <eggert@cs.ucla.edu>
2588 Add bulletproofing for cases where stdin, stdout, or stderr are closed.
2589 * fcntl-safer.h, open-safer.c: Remove.
2590 * fd-safer.c: New file.
2591 * dup-safer.c: Include unistd-safer.h first, to test interface.
2592 (dup_safer) [!deefined F_DUPD]: Use new fd_safer function instead of
2593 rolling our own code.
2594 * fts.c: Include unistd-safer.h.
2595 (fts_safe_changedir): Use fd_safer.
2596 * getloadavg.c: Include unistd-safer.h.
2597 (getloadavg): Use fd_safer.
2598 * getusershell.c: Include stdio-safer.h.
2599 (getusershell): Use fopen_safer.
2600 * save-cwd.c: Include unistd-safer.h.
2601 (save_cwd): Use fd_safer.
2602 * unistd-safer.h (fd_safer): New decl.
2603 * Makefile.am (libfetish_a_SOURCES): Remove dup-safer.c,
2604 fcntl-safer.h, fopen-safer.c, open-safer.c, stdio-safer.h,
2607 2005-04-09 Jim Meyering <jim@meyering.net>
2609 * fts.c (__attribute__, ATTRIBUTE_UNUSED): Define.
2610 Mark parameter `sp' with ATTRIBUTE_UNUSED.
2612 Avoid warnings from gcc-4.
2613 * canon-host.c (canon_host) [HAVE_GETADDRINFO]: Use memset
2614 rather than `= { 0 };' to initialize local `hint'.
2615 * unicodeio.c (__attribute__, ATTRIBUTE_UNUSED): Define.
2616 (exit_failure_callback, fallback_failure_callback): Mark unused
2617 parameters with ATTRIBUTE_UNUSED.
2619 * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
2620 -Wuninitialized: initialize tm0.tm_year.
2622 * human.c (humblock): Set *options even when returning due to
2623 xstrtoumax conversion failure. Thanks to a used-uninitialized
2626 2005-04-08 Paul Eggert <eggert@cs.ucla.edu>
2628 * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
2629 that might redefine system include files.
2630 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
2631 (my_usleep): Use NULL rather than (void *) 0.
2632 (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
2633 Use siginterrupt to specify that system calls should be interrupted.
2634 (rpl_nanosleep): Move initialization of suspended closer to call of
2637 2005-04-04 Paul Eggert <eggert@cs.ucla.edu>
2639 * getdate.y (parser_control): rels_seen is now a boolean, not a
2640 count, since there's no maximum. All uses changed.
2641 Add member dsts_seen.
2642 (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
2644 (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
2645 Use pc_rels_seen to decide whther a date is absolute.
2647 * getdate.y (number): Don't overwrite year.
2648 (get_date): Initialize pc.year.digits to 0, not 4, to enable above
2651 2005-03-30 Paul Eggert <eggert@cs.ucla.edu>
2653 * readutmp.h (read_utmp): New arg OPTIONS. All uses changed.
2654 * readutmp.c: Likewise. Include signal.h, stdbool.h.
2655 (desirable_utmp_entry): New function.
2656 (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
2657 using x2nrealloc, to simplify logic.
2658 (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
2659 size calculation. Do not assume utmp file is a regular file.
2660 * readutmp.h (UT_PID): Moved here from ../src/who.c.
2661 (READ_UTMP_CHECK_PIDS): New constant.
2663 2005-03-29 Jim Meyering <jim@meyering.net>
2665 * long-options.c (long_options): Use NULL, not `0'.
2667 2005-03-27 Jim Meyering <jim@meyering.net>
2669 * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
2671 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
2673 * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
2674 "one's complement" -> "ones' complement" in comment, as per Knuth.
2675 "value of type" -> "type or expression" in comment.
2676 * mktime.c, strftime.c: Propagate intprops.h comment nits.
2678 2005-03-26 Jim Meyering <jim@meyering.net>
2681 * intprops.h: Add the apostrophe in `(one|two)'s complement'.
2682 Correct typos: s/or/of/.
2684 2005-03-23 Jim Meyering <jim@meyering.net>
2686 * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
2688 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
2690 * Makefile.am (libfetish_a_SOURCES): Remove stat-macros.h, xstrtoul.c,
2691 as they are now done by Autoconf macros.
2693 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
2695 * gettext.h, regex.c, setenv.c, vasprintf.c: Sync from gnulib.
2696 * vasnprintf.c (EOVERFLOW): Define if not already defined.
2697 This merges a change from gnulib.
2699 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
2701 * strftime.c (my_strftime): If the underlying strftime returns 0
2702 (which shouldn't happen), generate nothing instead of returning 0
2703 immediately, so that nstrftime (NULL, ...) doesn't return 0.
2705 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
2707 * strftime.c (my_strftime): Prepend space to format so that we can
2708 reliably distinguish strftime failure from empty output on POSIX
2711 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
2713 * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
2714 TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
2716 * strtol.c: Likewise.
2718 2005-03-14 Jim Meyering <jim@meyering.net>
2720 * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
2721 && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
2722 to be nonzero so that we (and caller) can detect the difference
2723 between a valid zero-length expansion and an error return, even
2724 when the underlying strftime fails before writing anything into
2727 2005-03-11 Jim Meyering <jim@meyering.net>
2729 * getdate.c: Regenerate using bison-2.0.
2731 2005-03-10 Jim Meyering <jim@meyering.net>
2733 * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
2734 so that this module works on systems without fchdir.
2736 * Makefile.am (libfetish_a_SOURCES): Remove xstrtol.c and xstrtol.h.
2738 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
2740 Factor int-properties macros into a single file, except for
2741 glibc-related files.
2742 * intprops.h: New file.
2743 * getloadavg.c: Include it instead of limits.h.
2744 (INT_STRLEN_BOUND): Remove.
2745 * human.c: Include intprops.h.
2746 (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2747 * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2748 * inttostr.h: Include intprops.h instead of limits.h.
2749 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2750 * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2751 for consistency with intprops.h.
2752 (time_t_is_integer, twos_complement_arithmetic): Use them.
2753 * sig2str.h: Include <signal.h>, intprops.h.
2754 (INT_STRLEN_BOUND): Remove.
2755 * strftime.c (TYPE_SIGNED): Remove.
2756 (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2757 * strtol.c: Adjust comments to match intprops.h.
2758 * userspec.c: Include intprops.h.
2759 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2760 * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2761 * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2762 instead of rolling our own expressions.
2763 * xstrtol.c: Include xstrtol.h first, to test interface.
2764 * fts.c: Include intprops.h.
2765 (TYPE_SIGNED): Remove.
2767 2005-03-09 Jim Meyering <jim@meyering.net>
2769 More migration to AC_LIBSOURCES/AC_LIBOBJ.
2770 * Makefile.am (libfetish_a_SOURCES): Remove two more pairs of files:
2771 cycle-check.c, cycle-check.h and argmatch.c, argmatch.h.
2773 * cycle-check.c: Don't include "xalloc.h". It's not used.
2775 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
2777 Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2778 The workaround isn't strictly needed for POSIX conformance, and
2779 it's too much of a pain to configure and maintain. We'll ask
2780 people to fix their kernels instead.
2781 * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2782 (NANOSLEEP_BUG_WORKAROUND): Remove.
2783 (xnanosleep): Remove the workaround.
2785 2005-02-27 Jim Meyering <jim@meyering.net>
2787 * xnanosleep.c (xnanosleep): Work around bug in Linux-2.6.8.1's
2788 nanosleep whereby it fails without setting errno upon being resumed
2789 after being suspended.
2791 2005-02-25 Paul Eggert <eggert@cs.ucla.edu>
2793 * vasnprintf.c (VASNPRINTF) [!USE_SNPRINTF]: Correct the test for
2794 integer overflow again. Actually, neither this nor the 2005-01-23
2795 change fixes any bug on any plausible platform; it's more of a
2798 * config.charset, gettext.h, localcharset.c: Sync from gnulib.
2800 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
2802 * strftime.c: Include <stdbool.h>. Use bool where appropriate,
2804 (my_strftime): Do not mishandle years close to INT_MAX, by doing
2805 the right thing even if adding 1900 would overflow. Similarly
2806 for tm_mon + 1 and tm_yday + 1.
2807 Make %Y always equivalent to %C%y, and similarly for %G and %g.
2808 (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2809 (DO_SIGNED_NUMBER): New macro.
2810 (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2812 2005-02-21 Paul Eggert <eggert@cs.ucla.edu>
2814 * Makefile.am (libfetish_a_SOURCES): Remove xnanosleep.c,
2815 xnanosleep.h; now done by ../m4/xnanosleep.m4 automatically.
2817 2005-02-20 Paul Eggert <eggert@cs.ucla.edu>
2819 * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2820 * timespec.h (gettime): Return void, since it always
2821 succeeds now. All uses changed.
2822 * gettime.c (gettime) Likewise.
2823 [HAVE_NANOTIME]: Prefer nanotime.
2824 Assume gettimeofday succeeds, as POSIX requires.
2825 Assime time () succeeds, since other code already does.
2826 * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2827 (timespec_subtract): Remove.
2828 (NANOSLEEP_BUG_WORKAROUND): New constant.
2829 (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2830 things considerably. Use it only on GNU/Linux hosts, since the
2831 workaround shouldn't be needed elsewhere.
2833 2005-02-20 Neil Conway <neilc@samurai.com>
2835 * xgethostname.c (xgethostname): Check for ENOMEM, which is
2836 returned by OSX/Darwin if the specified buffer is not large
2837 enough for the hostname.
2839 2005-02-20 Jim Meyering <jim@meyering.net>
2842 * Makefile.am (libfetish_a_SOURCES): Remove
2843 linebuffer.[ch] and stripslash.c.
2845 2005-02-11 Jim Meyering <jim@meyering.net>
2847 Remove names of files that are now mentioned in AC_LIBSOURCES
2848 and AC_LIBOBJ uses in inttostr.m4.
2849 * Makefile.am (libfetish_a_SOURCES): Remove imaxtostr.c,
2850 offtostr.c, and umaxtostr.c.
2851 (EXTRA_DIST): Remove inttostr.c and inttostr.h.
2853 2005-02-08 Jim Meyering <jim@meyering.net>
2855 * Makefile.am (libfetish_a_SOURCES): Remove memcasecmp.c
2858 2005-02-07 Jim Meyering <jim@meyering.net>
2860 * Makefile.am (libfetish_a_SOURCES): Remove fts.c, fts_.h, and
2861 getcwd.h now that they're mentioned in AC_LIBSOURCES and AC_LIBOBJ
2862 uses in the corresponding ../m4/*.m4.
2864 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
2866 * memrchr.h: New file.
2867 * chdir-long.c: Include it.
2868 * memrchr.c [!defined _LIBC]: Include it rather than <string.h>.
2869 Don't bother including stddef.h.
2871 2005-02-01 Paul Eggert <eggert@cs.ucla.edu>
2873 * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2875 Include <sys/types.h>, for dev_t.
2876 (ME_DUMMY, ME_REMOTE): Move from here....
2877 * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2878 (ME_DUMMY): Count "subfs" as a dummy. Problem reported by
2880 Include mountlist.h first, to test the interface.
2882 2005-01-29 Jim Meyering <jim@meyering.net>
2884 * Makefile.am (libfetish_a_SOURCES): Remove many files from this
2885 list, now that automake determines their names automatically,
2886 thanks to the new AC_LIBSOURCES and AC_LIBOBJ uses in the
2887 corresponding ../m4/*.m4 files.
2888 (EXTRA_DIST): Add getdate.c here, so that we continue to distribute it.
2890 2005-01-25 Jim Meyering <jim@meyering.net>
2892 * path-concat.c: Don't include assert.h.
2893 (path_concat): Remove assertion that would have triggered
2894 for ABASE starting with more than one slash.
2895 Reported by Andreas Schwab.
2897 * path-concat.c (path_concat): Set *BASE_IN_RESULT
2898 properly when ABASE is an absolute file name.
2899 Correct the description of this function.
2901 Add an assertion and a test driver.
2902 This fixes a bug introduced on 2004-07-02.
2903 Andreas Schwab reported the resulting failure of cp --parents:
2904 http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
2906 2005-01-23 Jim Meyering <jim@meyering.net>
2908 * vasnprintf.c (VASNPRINTF) [!USE_SNPRINTF]: Correct the test for
2911 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
2914 * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
2915 not needed. This removes a dependency on the gettext module.
2916 [defined _LIBC]: Do not include <libintl.h>; not needed.
2918 2005-01-20 Paul Eggert <eggert@cs.ucla.edu>
2920 * save-cwd.c (save_cwd): Remove code to support the case
2921 where fchdir is missing or flaky.
2923 * Makefile.am (libfetish_a_SOURCES): Add version-etc-fsf.c.
2925 2005-01-20 Simon Josefsson <jas@extundo.com>
2927 * version-etc-fsf.c: New file, with version_etc_copyright.
2928 * version-etc.c: Remove version_etc_copyright.
2929 * version-etc.h (version_etc_copyright): Use [] instead of * in
2930 prototype, suggested by Paul Eggert.
2932 2005-01-19 Jim Meyering <jim@meyering.net>
2934 * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
2935 same value as for Solaris 9.
2937 * chdir-long.c (chdir_long): Rewrite to remove limitation on
2938 component length. This included changing the parameter to be
2939 of type `char *' rather than `char const *'.
2940 * chdir-long.h (chdir_long): Update prototype.
2941 * t-chdir-long: A test harness to exercize chdir-long.c's
2942 sample main program.
2944 * openat.c (fdopendir, fstatat): New functions.
2945 * openat.h: Include headers required for use of DIR and struct stat.
2946 [AT_SYMLINK_NOFOLLOW]: Define.
2947 (fdopendir, fstatat): Add prototypes.
2949 2005-01-04 Paul Eggert <eggert@cs.ucla.edu>
2951 * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
2952 definitions to be after all include files, to avoid collisions.
2953 Problem reported by Bob Proulx.
2955 2005-01-04 Bob Proulx <bob@proulx.com>
2957 * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
2958 offsetof() macro construct to avoid compile failure with native HP-UX
2959 11.0 ANSI C compiler.
2961 2005-01-03 Paul Eggert <eggert@cs.ucla.edu>
2963 * utimens.c (futimens): Robustify the previous patch, by checking
2964 for known valid error numbers rather than observed invalid ones.
2966 2005-01-03 Jim Meyering <jim@meyering.net>
2968 * utimens.c (futimens): Account for the fact that futimes
2969 can also fail with errno == ENOSYS in that case.
2970 Patch from Dmitry V. Levin.
2972 2005-01-03 Paul Eggert <eggert@cs.ucla.edu>
2974 * utimens.c (futimens) [HAVE_FUTIMES]: Fall back on utimes if
2975 futimes fails with errno == ENOENT. Problem reported by
2978 2005-01-02 Jim Meyering <jim@meyering.net>
2980 * version-etc.c (version_etc_copyright): Update copyright date.
2982 2004-12-31 Jim Meyering <jim@meyering.net>
2984 * openat.c (rpl_openat): Correct comment.
2985 Call free_cwd, to avoid leaking a file descriptor.
2987 2004-12-23 Paul Eggert <eggert@cs.ucla.edu>
2989 * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
2990 need to extend the stack.
2991 (YYINITDEPTH): New macro, so that the initial stack isn't overly
2994 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
2996 * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
2999 * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
3000 Remove now-obsolete comment about AIX.
3001 * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
3002 (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
3003 (YYMAXDEPTH): New macro.
3005 2004-12-11 Jim Meyering <jim@meyering.net>
3007 * chdir-long.c: Fail via #error if PATH_MAX is not defined, since
3008 this file is now compiled only on systems that define PATH_MAX.
3010 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
3012 * getdate.y (textint): New member "negative".
3013 (time_zone_hhmm): New function.
3014 Expect 14 shift-reduce conflicts, not 13.
3015 (o_colon_minutes): New rule.
3016 (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
3017 (yylex): Set the "negative" member of signed numbers.
3019 2004-12-06 Jim Meyering <jim@meyering.net>
3021 * Makefile.am (libfetish_a_SOURCES): Begin removing .c and .h file
3022 names, as they are added to AC_LIBSOURCES directives in the
3023 corresponding m4/*.m4 files.
3025 2004-12-05 Jim Meyering <jim@meyering.net>
3027 Currently, fpending.m4 punts (by defining PENDING_OUTPUT_N_BYTES
3028 to 1) if it doesn't find a valid expression for the replacement
3029 function. Before this change, that might have gone undetected
3030 for some time. Now, we'll catch it close to the source.
3032 * t-fpending.c: New file. Test the __fpending function.
3033 This ensures that if there is an error in the definition of the
3034 PENDING_OUTPUT_N_BYTES expression, we'll find about it right away;
3035 that value is used only in the rare event that close_stdout's
3036 fclose fails with EBADF.
3037 * Makefile.am (unit-test): New target.
3038 (check): Depend on it.
3039 (noinst_PROGRAMS): Define.
3041 * Makefile.am (unit-test): Depend on t-fpending.
3042 Make the target .PHONY.
3044 2004-12-02 Paul Eggert <eggert@cs.ucla.edu>
3046 * openat.c: Include "openat.h" before other include files.
3047 Include "exitfail.h".
3048 (openat): Remove #undef; no longer needed now that we include openat.h
3050 (rpl_openat): Add comment about mode_t promotion. Simplify
3051 code a bit by moving initializations around. Use exit_failure
3052 rather than EXIT_FAILURE.
3053 * openat.h: Add copyright and authorship notice.
3054 (AT_FDCWD): Use the same value Solaris 9 uses, except of type
3055 'int' not 'unsigned int'.
3057 * save-cwd.c: Include "save-cwd.h" before other include files.
3058 (O_DIRECTORY): Remove; not needed here, since "." must be
3059 a directory. All uses removed.
3060 (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
3061 universal on Suns, and we also need to test for IRIX.
3062 Revamp code to use 'if' rather than '#if'.
3063 Avoid unnecessary comparison of cwd->desc to 0.
3065 2004-12-01 Paul Eggert <eggert@cs.ucla.edu>
3067 * hard-locale.c: Assume <locale.h> exists.
3069 (GLIBC_VERSION): New macro.
3070 (hard_locale): Assume setlocale exists.
3071 Rewrite to avoid #ifdef.
3072 Use strdup rather than malloc + strcpy.
3073 * human.c: Assume <locale.h> exists.
3074 (human_readable): Assume localeconv exists.
3076 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
3078 * getcwd.c (is_ENAMETOOLONG): New macro.
3079 (__getcwd.c): Don't restore errno; glibc doesn't.
3080 [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
3081 first, falling back to our code only if its results look suspicious.
3082 Ensure that the resulting buffer is only as large as necessary.
3084 * readutmp.c: Include readutmp.h first.
3085 Include <errno.h>, since readutmp.h no longer does that.
3086 * readutmp.h: Don't include <errno.h>,
3087 <sys/param.h>, <time.h>; not needed to establish interface.
3088 (errno): Remove decl.
3089 (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
3090 (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
3091 UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
3093 2004-11-30 Jim Meyering <jim@meyering.net>
3095 Change the name of the robust chdir function from chdir to chdir_long.
3096 * save-cwd.c: Include chdir-long.h rather than chdir.h.
3097 (restore_cwd): Use chdir_long, not chdir.
3098 * chdir-long.c: Renamed from chdir.c.
3099 * chdir-long.h: Renamed from chdir.h.
3100 [!defined PATH_MAX]: Define chdir_long to chdir on systems like the Hurd.
3101 * Makefile.am (libfetish_a_SOURCES): Reflect name changes.
3103 * chdir.c (O_DIRECTORY): Define, if necessary.
3104 (memchrcspn): Tiny wrapper around memchr.
3105 (rpl_chdir): Use memchrcspn rather than strcspn.
3107 2004-11-28 Jim Meyering <jim@meyering.net>
3109 * openat.c (rpl_openat): Also accept optional mode parameter.
3110 * openat.h (rpl_openat): Adjust prototype.
3112 * save-cwd.c: Include "chdir.h", so that if save_cwd/getcwd
3113 saves a name longer than PATH_MAX, restore_cwd's chdir can use it.
3115 * Makefile.am (libfetish_a_SOURCES): Add chdir.h and openat.h.
3117 This is a robust version of chdir, in that it can handle directory
3118 names longer than PATH_MAX.
3119 * chdir.c, chdir.h: New file.
3120 * openat.c, openat.h: New files.
3122 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
3124 Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
3125 HP's ANSI C compiler.
3126 * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
3127 Declaring int functions causes warnings on some modern systems and
3128 shouldn't be needed to compile on ancient ones.
3129 * same.c (MIN) [defined MIN]: Don't define, since it's already
3132 * mempcpy.c, mempcpy.h: New files, taken from gnulib.
3133 * Makefile.am: (libfetish_a_SOURCES): Add getcwd.h, mempcpy.h.
3134 * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
3135 with the following changes.
3136 (__set_errno): Parenthesize properly.
3137 Include <stdbool.h>.
3138 (MIN, MAX, MATCHING_INO): New macros.
3139 (__getcwd): Define with prototype, not K&R form.
3140 Use heuristics to allocate default buffer on stack if possible.
3141 If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
3142 behavior, and to avoid the PATH_MAX limit when computing
3144 Use MATCHING_INO to compare inode number to file.
3145 Check for arithmetic overflow in size calculations.
3146 Fix bug in reallocation of dot array that caused getcwd to fail
3147 on directories nested deeper than 75.
3148 Be more careful about saving errno on error.
3149 Do not use realloc; use only free+malloc, as this is a bit
3150 more flexible and avoids a needless copy operation.
3151 Do not inspect st_dev and st_ino for symbolic links; POSIX
3152 doesn't specify the latter.
3153 Check for closedir errors.
3154 Avoid needless casts.
3155 Use "#ifdef weak_alias" around weak_alias, to be like other
3157 The following changes to getcwd.c have effect only when used in
3158 gnulib; they have no effect inside glibc proper.
3159 (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
3160 as alloca isn't used.
3161 (alloca, __alloca): Likewise.
3162 [!_LIBC]: Include "getcwd.h", "mempcpy.h".
3163 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3164 unconditionally, as gnulib assumes C89 or better.
3165 Do not include <sys/param.h>.
3166 (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
3167 no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
3169 (NULL) [!defined NULL]: Remove; we assume C89 or better.
3170 Include <dirent.h> in a way that is compatible with modern Autoconf.
3171 (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
3172 New macros, if not already defined.
3173 Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
3174 Use "_LIBC", not "defined _LIBC", for consistency.
3175 (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
3177 (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
3178 (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *.
3179 * xgetcwd.c: David MacKenzie's old code was removed, so give
3180 credit only to Jim Meyering and adjust the copyright dates.
3181 Do not include <limits.h>, <stdio.h>, <sys/types.h>,
3182 <stdlib.h>, <unistd.h>, "pathmax.h".
3183 Instead, include "xgetcwd.h" (first) and "getcwd.h".
3184 (INITIAL_BUFFER_SIZE): Remove.
3185 (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
3187 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
3189 * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
3190 (futimens): New function, which uses futimes if available.
3191 (futimens, utimens): Support timespec==NULL, with same semantics
3192 as utime and utimens.
3193 * utimens.h (futimens): New decl.
3195 2004-11-23 Sergey Poznyakoff <gray@Mirddin.farlep.net>
3197 * getopt_.h: Re-addition of __getopt_argv_const caused
3198 redefinition warnings. To avoid them, include the defines
3199 in `#if !defined __need_getopt ... #endif'. The only place
3200 where __getopt_argv_const is used is in definitions
3201 of getopt_long and getopt_long_only below, which are as well
3202 protected by `#ifndef __need_getopt'.
3203 [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
3204 __need_getopt after including <stdio.h> and <unistd.h> These
3205 headers might have defined it.
3207 2004-11-23 Jim Meyering <jim@meyering.net>
3209 * closeout.c: Revert last change, since it seems EBADF is always
3212 2004-11-22 Jim Meyering <jim@meyering.net>
3214 * closeout.c (EBADF): Fail with `#error ...' if it's not defined,
3215 asking the user to report the problem.
3217 2004-11-17 Paul Eggert <eggert@cs.ucla.edu>
3219 * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
3220 might fail. Problem reported by Yoann Vandoorselaere.
3221 * calloc.c (rpl_calloc): Defend against buggy calloc implementations
3222 that mishandle size_t overflow.
3224 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
3226 * xgetcwd.c: Include <limits.h>, for PATH_MAX.
3227 (xgetcwd): Set errno correctly when failing.
3228 Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
3229 the failure is actually due to a PATH_MAX problem.
3231 Further getopt changes to make it more likely that glibc will
3232 buy the changes back.
3233 * getopt.c (POSIXLY_CORRECT): New constant.
3234 (getopt): Use it, so to preserve glibc semantic
3235 * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
3236 when compiling for libc.
3237 * getopt_.h (__getopt_argv_const): Bring it back.
3238 (getopt_long, getopt_long_only): Use it.
3240 * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
3241 New arg POSIXLY_CORRECT. All callers changed.
3242 (getopt): Argv is now char * const *, as per standard.
3243 (_getopt_internal_r, _getopt_internal): Argv is now char **,
3244 not char *__getopt_argv_const *.
3245 * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
3246 _getopt_long_only_r): Likewise.
3247 * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
3248 * getopt_int.h (_getopt_internal, _getopt_internal_r,
3249 _getopt_long_r, _getopt_long_only_r): Likewise.
3250 * getopt_.h (__getopt_argv_const): Remove.
3251 (getopt): Argv is now char * const *, as per standard.
3253 * canon-host.c: Include "strdup.h".
3254 (canon_host): Use getaddrinfo if available, so that IPv6 works.
3255 Use strdup instead of malloc/strcpy to duplicate strings.
3257 * getdate.y (tORDINAL): New token.
3258 (day, relunit): Allow it for relative times.
3259 (relative_time_table): Use tORDINAL for ordinals.
3261 2004-11-15 Paul Eggert <eggert@cs.ucla.edu>
3263 * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
3264 (human_space_before_unit): New constant.
3265 * human.c (human_readable): Support it.
3267 2004-11-14 Jim Meyering <jim@meyering.net>
3269 * closeout.c (close_stdout): Don't fail just because stdout was
3270 closed initially, since some programs don't write to stdout in the
3271 normal course of operation (other than --version and --help), and
3272 we don't want this function to make e.g. `cp 1 2 >&-' fail.
3273 But do fail if it was closed and someone has tried to write to it.
3274 E.g., printf foo >&-
3276 * __fpending.c, __fpending.h: Restore these files.
3277 They're useful after all.
3278 * Makefile.am (libfetish_a_SOURCES): Add __fpending.h.
3280 2004-11-11 Paul Eggert <eggert@cs.ucla.edu>
3282 * getopt.c, getopt1.c, getopt_.h, getopt_int.h:
3285 2004-11-10 Paul Eggert <eggert@cs.ucla.edu>
3287 * allocsa.h, mbswidth.c, mktime.c, readlink.c, getdate.y,
3288 quotearg.c, strftime.c: Sync from gnulib.
3290 2004-11-06 Jim Meyering <jim@meyering.net>
3292 * __fpending.c, __fpending.h: Remove files.
3294 * Makefile.am (libfetish_a_SOURCES): Remove __fpending.h, now
3295 that it's no longer used.
3297 Ensure that no close failure goes unreported.
3298 * closeout.c (close_stdout): Always close stdout. I.e., don't
3299 return early when it seems there's nothing to flush.
3300 Don't include __fpending.h.
3302 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
3304 * unsetenv.c: New file, from gnulib. Needed for new getdate.y.
3305 * Makefile.am (libfetish_a_SOURCES): Remove setenv.c.
3306 * xreadlink.c: Sync from gnulib.
3308 2004-11-03 Jim Meyering <jim@meyering.net>
3310 * Makefile.am (libfetish_a_SOURCES): Add setenv.c and setenv.h.
3312 2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
3314 * getdate.y, getpass.c, setenv.h: Sync from gnulib.
3316 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
3318 * getdate.y, getpagesize.h, mktime.c: Sync from gnulib.
3320 2004-10-24 Paul Eggert <eggert@cs.ucla.edu>
3322 * mktime.c (leapyear): Arg is long int, not int.
3323 Change imported from gnulib.
3325 2004-10-17 Paul Eggert <eggert@cs.ucla.edu>
3328 * diacrit.c, diacrit.h: Add copyright notice.
3329 * getpass.c (fflush_unlocked, flockfile, funlockfile)
3330 (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
3333 2004-10-13 Jim Meyering <jim@meyering.net>
3335 * fts.c (fts_read): When about to fail (by returning NULL) due
3336 to a failed fchdir or failed fts_safe_changedir call, set
3337 `sp->fts_cur = p'. Do this by removing the explicit `return NULL;'
3338 statements and setting p->fts_errno so execution falls through
3339 to the common-case code below. Otherwise, after such a failure,
3340 calling fts_close would attempt to free an already-freed buffer.
3341 Reported by Luis Lopez Lopez in http://bugs.debian.org/276352.
3343 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
3347 * xalloc.h (xmemdup): Renamed from xclone.
3348 * xmalloc.c (xmemdup): Likewise.
3349 * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
3350 XFREE): Remove these long-obsolescent macros.
3351 * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
3352 * xstrdup.c: Remove.
3354 * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
3355 getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
3356 md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
3357 regex.c, sha1.c, version-etc.c, yesno.c:
3358 Include "unlocked-io.h" only if USE_UNLOCKED_IO.
3359 * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
3360 the includer's responsibility.
3362 2004-10-03 Paul Eggert <eggert@cs.ucla.edu>
3365 * dirfd.h, getpagesize.h: Add copyright notice.
3366 * vasnprintf.c: (VASNPRINTF): Set errno=EOVERFLOW if the output is
3368 * vasnprintf.h: Doc fix.
3369 * vasprintf.c: Don't include <limits.h>.
3370 (vasprintf): Rely on vasnprintf to set errno=EOVERFLOW.
3372 2004-09-23 Paul Eggert <eggert@cs.ucla.edu>
3374 * modechange.c (mode_compile): Don't decrement a pointer that
3375 points to the start of a string, as the C Standard says the
3376 resulting behavior is undefined.
3378 2004-09-22 Jim Meyering <jim@meyering.net>
3380 * getopt.c: Remove extraneous spaces before TAB.
3381 * getopt_.h: Likewise.
3383 * backupfile.c: Remove trailing blanks.
3384 * euidaccess.c: Likewise.
3386 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
3388 * backupfile.h (enum backuptype): Rename none -> no_backups,
3389 simple -> simple_backups, numbered_existing ->
3390 numbered_existing_backups, numbered -> numbered_backups
3391 to avoid shadowing problems. All uses changed.
3392 * argmatch.c (enum backuptype): Likewise.
3393 * backupfile.c (check_extension, numbered_backup):
3394 Rename locals to avoid shadowing 'basename'.
3395 * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
3398 2004-09-02 Paul Eggert <eggert@cs.ucla.edu>
3400 Port to diet libc. Problem reported by Felix von Leitner in
3401 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00171.html>
3402 * fts.c (fts_stat, fts_open, fts_read): Use "unsigned short int"
3403 rather than the unportable "u_short", and similarly for u_int.
3404 * fts_.h (FTSENT): Likewise.
3406 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
3408 * getopt.c, getopt1.c: Sync from gnulib.
3409 * getopt_.h: Renamed from getopt.h (this syncs from gnulib).
3410 * Makefile.am (libfetish_a_SOURCES): Remove getopt.c, getopt.h,
3411 getopt1.c, getopt_int.h.
3412 (BUILT_SOURCES, EXTRA_DIST, all-local, $(lib_OBJECTS), getopt.h,
3413 MOSTLYCLEANFILES): Add current gnulib snippet for getopt.
3414 * .cppi-disable: Add getopt_.h, getopt_int.h.
3415 * .cvsignore: Add getopt.h.
3417 2004-08-18 Paul Eggert <eggert@cs.ucla.edu>
3419 * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
3420 strings on unbounded length. alloca's performance benefits aren't
3421 that important here.
3423 (parse_with_separator): New function, with most of the internals
3424 of the old parse_user_spec. Allow user to omit both user and group,
3425 for compatibility with FreeBSD.
3426 Clone only the user name, not the entire spec.
3427 Do not set *uid, *gid unless entirely successful.
3428 Avoid memory leak in some failing cases.
3429 Fix regression for USER.GROUP reported by Dmitry V. Levin in
3430 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
3431 (parse_user_spec): Rewrite to use parse_with_separator.
3433 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
3435 * fts.c (O_DIRECTORY): Define to 0 if the system doesn't define.
3437 * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
3439 * obstack.c: Include <inttypes.h> and <stdint.h> if available.
3440 (union fooround): Use uintmax_t, not long int.
3441 The rest is a merge from libc:
3442 [defined _LIBC]: Include <shlib-compat.h>.
3443 (_obstack) [defined _LIBC]: Remove after 2.3.4.
3445 * xgethostname.c: Do not include error.h. (merge from gnulib).
3447 * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
3448 wmemchr or wmemcpy. Problem reported by Robert Dahlem
3449 for Reliant Unix 5.43.
3451 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
3453 * Makefile.am (libfetish_a_SOURCES): Add getpass.h.
3454 * getpass.h: New file.
3455 * .cpp-disable: Add it.
3456 * getpass.c [!_LIBC]: Include it.
3458 * obstack.h (obstack_empty_p):
3459 Don't assume that chunk->contents is suitably aligned.
3460 * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
3461 Likewise. Problem reported by Benno in
3462 <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
3464 * chown.c (rpl_chown): Work even if the file is writeable but not
3465 readable. This could be improved further but it'd take some work.
3466 * fts.c (diropen): New function.
3467 (fts_open, fts_read, fts_children, fts_safe_changedir):
3468 Use it, so that the code works even if the directory
3469 is writeable but not readable. We'd like it to work even if
3470 the directory is merely executable, but I don't know how to do
3473 * xalloc-die.c: New file.
3474 * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
3476 * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
3477 Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
3478 (_, N_, xalloc_die): Move to xalloc-die.c.
3479 * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
3480 so that we needn't mess with xalloc_msg_memory_exhausted.
3482 * sha1.h (sha1_ctx): Renamed from sha_ctx.
3483 (sha1_init_ctx): Renamed from sha_init_ctx.
3484 (sha1_process_block): Renamed from sha_process_block.
3485 (sha1_process_bytes): Renamed from sha_process_bytes.
3486 (sha1_finish_ctx): Renamed from sha_finish_ctx.
3487 (sha1_read_ctx): Renamed from sha_read_ctx.
3488 (sha1_stream): Renamed from sha_stream.
3489 (sha1_buffer): Renamed from sha_buffer.
3492 2004-08-07 Paul Eggert <eggert@cs.ucla.edu>
3494 * canonicalize.h, cycle-check.h, stat-macros.h, strdup.h,
3495 strftime.h, xnanosleep.c: Merge from gnulib.
3497 2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
3499 Merge with gnulib and deal with some minor cleanups resulting.
3501 * .cppi-disable: Change fnmatch.h to fnmatch_.h.
3502 * .cvsignore: Add fnmatch.h, poll.h, stdbool.h, sysexit.h.
3503 Remove safe-lstat.c, safe-lstat.h, safe-stat.c, safe-stat.h.
3505 * backupfile.h, closeout.h, full-write.h, mbswidth.h, xalloc.h:
3506 Add extern "C" wrappers for C++.
3508 * dirname.h (IS_ABSOLUTE_FILE_NAME): Port to DOS.
3510 * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3512 * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3513 (ENOSYS): Define if not defined.
3514 (settime): Fall back on stime if it exists and settimeofday fails.
3515 But don't bother with fallbacks if a method fails with errno == EPERM.
3517 * obstack.h: Add white space.
3519 * printf-parse.c, printf-parse.h, vasnprintf.c: Merge changes from
3520 gnulib, but rewrite to avoid "xsize.h".
3522 2004-08-04 Paul Eggert <eggert@cs.ucla.edu>
3524 * mountlist.c (SIZE_MAX): Define after including files, to avoid
3525 a collision on OpenBSD 3.4.
3527 * fts.c (LONGEST_MODIFIER): New macro.
3528 (PRIuMAX) [!PRI_MACROS_BROKEN && !defined PRIuMAX]: New macro.
3529 (find_matching_ancestor): Use it for dev_t and ino_t.
3531 * getndelim2.c: Sync from gnulib.
3533 * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
3534 sometimes returns a positive errno value even when it succeeds.
3535 (print_errno_message) [!LIBC]: Fall back on strerror if
3538 2004-08-02 Paul Eggert <eggert@cs.ucla.edu>
3540 * canonicalize.c (errno): Remove decl; we now assume C89 or better.
3541 * chown.c (errno): Likewise.
3542 * closeout.c (errno): Likewise.
3543 * dup-safer.c (errno): Likewise.
3544 * dup2.c (errno): Likewise.
3545 * exclude.c (errno): Likewise.
3546 * fopen-safer.c (errno): Likewise.
3547 * ftruncate.c (errno): Likewise.
3548 * full-write.c (errno): Likewise.
3549 * getcwd.c (errno): Likewise.
3550 * lchown.c (errno): Likewise.
3551 * memcoll.c (errno): Likewise.
3552 * nanosleep.c (errno): Likewise.
3553 * putenv.c (errno): Likewise.
3554 * rmdir.c (errno): Likewise.
3555 * same.c (errno): Likewise.
3556 * savedir.c (errno): Likewise.
3557 * setenv.c (errno): Likewise.
3558 * stat.c (errno): Likewise.
3559 * utime.c (errno): Likewise.
3560 * xgetcwd.c (errno): Likewise.
3561 * xmemcoll.c (errno): Likewise.
3562 * xreadlink.c (errno): Likewise.
3563 * xstrtol.c (errno): Likewise.
3564 * canonicalize.h (enum canonicalize_mode_t): Reformat comments to
3566 * fileblocks.c (textutils_fileblocks_unused): Make it a typedef
3567 instead of an int, to save a few bytes in the object file.
3568 * getdate.y (lookup_word): Rewrite to avoid cast.
3569 * getloadavg.c: Include <stdbool.h>.
3570 (getloadavg_initialized): Use bool for booleans.
3571 * hard-locale.c (hard_locale): Return bool, not int.
3572 * hard-locale.h (hard_locale): Likewise. Include <stdbool.h>.
3573 * hash.c (hash_string): Rewrite to avoid cast.
3574 * human.h: Use Autoconf-suggested pattern for inttypes and stdint.
3575 * strtiomax.c: Likewise.
3576 * xstrtol.h: Likewise.
3577 * nanosleep.c: Include stdbool.h.
3578 (rpl_nanosleep): Usee bool for booleans.
3579 * quotearg.c: Include stdbool.h.
3580 (quotearg_buffer_restyled): Use bool for booleans.
3581 * readtokens.c (readtoken): Rewrite to avoid casts.
3582 * same.c (same_name): Return bool, not int.
3583 * same.h (same_name): Likewise. Include <stdbool.h>.
3584 * version-etc.c (version_etc_va): Use size_t for sizes.
3585 * xnanosleep.c: Include limits.h, stdbool.h.
3587 (timespec_subtract, xnanosleep): Use bool for booleans.
3588 * xstrtoimax.c: Just include xstrtol.h rather than rolling our
3589 own include pattern.
3590 * xstrtoumax.c: Likewise.
3591 * xstrtol.c (__xstrtol): Rewrite to avoid casts.
3592 * yesno.c: Include yesno.h first.
3593 (yesno): Return bool, not int.
3594 * yesno.h (yesno): Likewise. Include <stdbool.h>.
3596 * xstrtod.h (xstrtod): Return bool, not int. Invert the
3597 sense of the boolean. All uses changed.
3598 * xstrtod.c (xstrtod): Likewise.
3599 * nanosleep.c: Include stdbool.h. Use bool for booleans.
3601 * xgethostname.c: Don't include <sys/types.h> or "exit.h";
3603 (errno): Remove decl; we now assume C89 or better.
3604 Include unistd.h if available, for gethostname.
3605 (ENAMETOOLONG): Define to 0, not 9999, to avoid colliding with
3606 existing errno values if any.
3607 (gethostname): Remove decl, since unistd.h declares it (or doesn't,
3608 in which case it's an older system and it should just work).
3609 (xgethostname): Don't assume host name length is less than INT_MAX.
3610 Exit if malloc fails, just as the comment says.
3612 * save-cwd.c: Include <stdbool.h>.
3613 (errno): Remove decl; we now assume C89 or better.
3614 (save_cwd): Use bool for booleans.
3615 (save_cwd, restore_cwd): Return -1 on failure, not 1, since we set
3618 * readutmp.h (UT_USER): Parenthesize properly.
3619 (UT_USER_SIZE): New constant.
3620 (read_utmp): Don't assume that the number of users is less than
3622 * readutmp.c (read_utmp): Likewise.
3623 Check for integer overflow in size calculations.
3624 Return -1 (not 1) on failure, since we set errno in that case.
3626 * posixtm.c (posix_time_parse): Don't assume that the length of
3627 the string being parsed is <= UINT_MAX.
3629 * mountlist.h (read_file_system_list): Accept bool flag, not int.
3630 * mountlist.c (read_file_system_list): Likewise.
3631 * mountlist.h: Include <stdbool.h>.
3632 * mountlist.c (errno): Remove decl; we now assume C89 or better.
3633 (xatoi): Remove; replaced by strtoul. Hence device numbers can now
3636 * isdir.c: Remove; no longer needed.
3637 * Makefile.am (libfetish_a_SOURCES): Remove isdir.c.
3639 * fts_.h: Add an FSF copyright notice, since our changes are becoming
3642 * fts_.h: Include stddef.h, for ptrdiff_t.
3643 (FTS.fts_nitems): Now size_t, not int, for hosts that allow more
3644 than INT_MAX entries in a directory.
3645 (FTS_ROOTPARENTLEVEL): Parenthesize properly.
3646 (FTSENT.fts_level): Now ptrdiff_t, not int, to allow recursing more
3647 than INT_MAX levels deep on 64-bit hosts.
3648 (FTSENT.fts_namelen): Now size_t, not u_short, to support hosts like
3649 the Hurd that don't have arbitrary limits on directory entry lengths.
3650 (FTSENT.fts_statp): Now an array, not a pointer, so that we don't
3651 have to play unportable games with pointer arithmetic. Keep it array
3652 for the benefit of user code that assumes it is a pointer.
3653 * fts.c: Include stdint.h if available, as Autoconf suggests.
3654 (ALIGNBYTES, ALIGN): Remove; no longer needed now that fts_statp
3656 (fts_alloc, fts_palloc, fts_sort, fts_load, fts_build):
3657 Use size_t for sizes.
3658 (fts_stat, fts_safe_changedir, fts_debug, fts_read, fts_build,
3660 Use bool when appropriate.
3661 (SIZE_MAX, TYPE_SIGNED): New macros.
3662 (fts_read): Use u_short for instructions.
3663 (fts_build): Use ptrdiff_t for levels. Don't assume file name lengths
3664 fit into int. Don't assume nlink_t is signed.
3665 (find_matching_ancestor): Don't assume dev, ino fit in int.
3666 (fts_stat): Use function prototype; required for bool arg.
3667 (fts_sort): Detect integer overflow in size calculations.
3668 (fts_alloc): Simplify allocation code, now that fts_statp is an array
3671 * fsusage.h: Include <stdbool.h>.
3672 (struct fs_usage): Use uintmax_t for block sizes, so that they're
3673 not limited to INT_MAX.
3674 Use bool for booleans.
3675 * fsusage.c: Use Autoconf-suggested pattern for inttypes and stdint.
3676 Include unistd.h, for lseek.
3678 * fnmatch.c: Include <stdbool.h>.
3679 (errno): Remove decl; we now assume C89 or better.
3680 * fnmatch_loop.c (EXT, FCT): Use bool when appropriate.
3681 (FCT): Use size_t, not unsigned int, for sizes.
3682 (EXT): Use size_t, not int, for sizes.
3684 * stripslash.c (strip_trailing_slashes): Now returns bool.
3685 * dirname.h (strip_trailing_slashes): Likewise.
3686 Include <stdbool.h>.
3687 * dirname.c (dir_name): Use bool when appropriate.
3689 * argmatch.h (argmatch, __xargmatch_internal, argmatch_invalid):
3690 Use ptrdiff_t, not int, when counting arguments, to allow more
3691 than INT_MAX arguments.
3692 * argmatch.c: Likewise. Use bool when appropriate.
3694 2004-08-01 Paul Eggert <eggert@cs.ucla.edu>
3696 * safe-read.c (errno): Remove decl; we now assume C89 or better.
3697 (safe_rw): Don't work around Tru64 bug unless the bug symptoms
3698 manifest themselves. This allows us to do proper reads and writes
3699 on other hosts, e.g., "dd" with a block size greater than 2**31.
3701 * md5.c (UNALIGNED_P): Use size_t; in practice, this is just as
3702 good as uintptr_t in checking for alignments, and has fewer
3703 configuration hassles.
3704 * sha1.c (UNALIGNED_P): Likewise.
3705 * md5.h: Don't include <limits.h>. Include <inttypes.h> if available,
3706 as it defines symbols like UINT32_MAX on Solaris 8.
3707 (md5_uint32): Assume uint32_t exists; Autoconf will define it
3708 otherwise (if the host has a 32-bit unsigned type, anyway).
3709 * memchr.c: Don't include inttypes.h or stdint.h.
3710 (UNALIGNED_P): Remove.
3711 (__memchr): Use size_t, not uintptr_t, to test alignment.
3712 * memrchr.c: Likewise, for __memrchr.
3714 2004-07-30 Paul Eggert <eggert@cs.ucla.edu>
3716 * makepath.h: Include <stdbool.h>.
3717 (make_path, make_dir): Use bool, not int, since we're not setting
3719 Use mode_t for modes, not int. All uses changed.
3720 * makepath.c: Likewise.
3721 (errno): Remove decl; no longer needed since we assume C89.
3723 2004-07-29 Paul Eggert <eggert@cs.ucla.edu>
3725 * modechange.c: Include <stdbool.h>.
3726 (mode_compile): Use bool when appropriate.
3728 * memchr.c (UNALIGNED_P): Use sizeof, not alignof, for better
3729 performance on m68k-linux. Reported by Andreas Schwab in
3730 <http://lists.gnu.org/archive/html/bug-coreutils/2004-07/msg00104.html>.
3731 * memrchr.c (UNALIGNED_P): Likewise.
3733 2004-07-28 Paul Eggert <eggert@cs.ucla.edu>
3735 * userspec.c: Include <stdbool.h>, "inttostr.h".
3736 (V_STRDUP): Don't assume the string's length fits in int.
3737 (ISDIGIT): unsigned -> unsigned int
3738 (is_number): Define only ifdef __DJGPP__; not needed elsewhere.
3739 Use bool instead of int where appropriate.
3740 Do not allow empty strings.
3741 (parse_user_spec): Parse numbers as decimal integers, even if
3742 they have a leading 0. Don't assume uids and gids fit in int.
3744 * memchr.c: Include <stddef.h>, not <stdlib.h> and <sys/types.h>.
3745 (LONG_MAX_32_BITS): Remove.
3746 Include <inttypes.h> and <stdint.h> if available.
3747 (alignof, UNALIGNEDP): New macro, portable to all C89 hosts.
3748 (__memchr): Don't assume unsigned long int is either 4 or 8 bytes;
3749 let it be any number of bytes greater than or equal to 4.
3750 * memrchr.c: Likewise, with __memrchr.
3752 * md5.h: Include <stdint.h> if HAVE_STDINT_H || _LIBC, not
3754 (md5_uint32): Use uint32_t if available. Simplify fallback ifdefs.
3755 * md5.c: Don't include <sys/types.h> or <stdlib.h>; <stddef.h>
3756 suffices with C89 or better.
3757 (alignof): New macro, portable to all C89 hosts.
3758 (UNALIGNED): Use it. Use uintptr_t if available, and assume
3759 everything is unaligned otherwise; this is more portable than
3760 assuming 'unsigned long int' will always work.
3763 * getugroups.c: Include <errno.h>.
3764 (EOVERFLOW): Define if not defined.
3765 (getgroups): Return -1 with errno=EOVERFLOW if an integer overflow
3768 2004-07-27 Paul Eggert <eggert@cs.ucla.edu>
3770 * euidaccess.c [HAVE_LIBGEN_H]: Include <libgen.h>, for
3771 eaccess on Solaris and SVR4-like systems.
3772 (euidaccess): Use HAVE_EACCESS, not HAVE_DECL_EACCESS.
3774 cycle-check integer overflow fixup.
3776 * cycle-check.h: Remove now-inaccurate comment about the files
3777 you need to include first. You don't need to include any files
3778 other than the usual config.h.
3779 Include <inttypes.h> and <stdint.h> if available, for uintmax_t.
3780 Remove 'struct stat;' not needed since we know sys/stat.h has
3781 been included by dev-ino.h.
3782 (struct cycle_check_state): Change chdir_counter to uintmax_t,
3783 not size_t, since it isn't limited by object sizes.
3784 Change magic from long unsigned int to int; that's good enough
3786 * cycle-check.c (is_zero_or_power_of_two): Renamed from
3787 is_power_of_two, to reflect better what it really does.
3788 All uses changed. Arg is now uintmax_t, not unsigned int
3789 (it should have been unsigned long int -- that was a bug).
3790 (cycle_check): Check for integer overflow in cycle count,
3791 and report a cycle if that happens, as it must be a cycle
3794 backupfile.c rewrite to avoid arbitrary limits on lengths of
3795 numeric backup extensions.
3797 * addext.c: Remove; no longer needed.
3798 * Makefile.am (libfetish_a_SOURCES): Remove addext.c.
3799 * backupfile.h (addext): Remove decl.
3800 * backupfile.c: Include "backupfile.h" first.
3801 Include errno.h, stdbool.h, limits.h, unistd.h, xalloc.h.
3802 (CLOSEDIR, INT_STRLEN_BOUND): Remove.
3803 (pathconf) [! (HAVE_PATHCONF && defined _PC_NAME_MAX)]: New macro.
3804 (_POSIX_NAME_MAX) [!defined _POSIX_NAME_MAX]: New macro.
3805 (NAME_MAX_MAXIMUM): New macro. Unlike the old addext.c, we
3806 also look at _XOPEN_NAME_MAX, for better performance on modern
3807 hosts that support only file names of length 255 or more.
3808 (ISDIGIT): unsigned -> unsigned int
3809 (max_backup_version, version_number): Remove.
3810 (check_extension): New function. Similar to the old addext, but
3811 static, assumes that the extension has already been added,
3812 and a bit more careful on DOS hosts.
3813 (numbered_backup): New function. It does what max_backup_version
3814 and version_number used to do, but it doesn't use integer arithmetic
3815 to calculate extensions so it doesn't overflow.
3816 (find_backup_file_name): Rewrite to use these new functions.
3817 This has a new optimization: we needn't call pathconf if the
3818 new numbered backup name has the same length as the old.
3819 Also, use xmalloc rather than malloc, so that the caller
3820 needn't worry about memory exhaustion.
3822 2004-07-25 Paul Eggert <eggert@cs.ucla.edu>
3824 * euidaccess.c [!defined LIBC]: Included group-member.h, stat-macros.h.
3825 (S_IXUSR, S_IXGRP, S_IXOTH, S_IROTH, S_IWOTH, S_IXOTH):
3826 Remove; now done by stat-macros.h.
3827 (NGROUPS_MAX, group_member): Remove; now done by group-member.h.
3828 No need to include <limits.h>.
3829 (errno): Remove decl; we now assume C89 or better.
3830 (access, getuid, getgid, geteuid, getegid, stat) [defined _LIBC]:
3832 (uid, gid, have_ids): Remove these static variables.
3833 They weren't accurate for programs that also invoked setreuid etc.
3834 (euidaccess) [defined EFF_ONLY_OK || defined ACC_SELF ||
3835 HAVE_DECL_EACCSS]: Use builtin substitutes.
3836 [defined _LIBC]: Ignore __libc_enable_secure; it's not a
3837 correct optimization for programs run as root that later
3839 [no builtin substitutes && HAVE_DECL_SETREGID &&
3840 PREFER_NONREENTRANT_EUIDACCESS]:
3841 Use setreuid+setregid to get the correct answer.
3842 [no builtin substitutes && ! (HAVE_DECL_SETREGID &&
3843 PREFER_NONREENTRANT_EUIDACCESS)]:
3844 Don't assume that the stat macros have their historical values,
3845 as POSIX doesn't require this.
3846 [defined TEST]: Include <stdlib.h>; don't include errno.h
3847 twice; include <error.h> rather than "error.h".
3849 2004-07-23 Paul Eggert <eggert@cs.ucla.edu>
3851 * Makefile.am (libfetish_a_SOURCES): Add fcntl-safer.h,
3853 * fcntl-safer.h, open-safer.c: New files.
3855 2004-07-12 Paul Eggert <eggert@cs.ucla.edu>
3857 * c-strtod.c (STRTOD_L): New macro.
3858 (C_STRTOD) [defined LC_ALL_MASK]: Use it, so that the
3859 code is reentrant on platforms that have strtod_l.
3861 * getloadavg.c: Include <errno.h>, <stdio.h>, <stdlib.h> even
3862 if HAVE_GETLOADAVG is defined, so that the test program can work.
3863 (errno): Remove declaration; not needed in C89 or later.
3864 Include "c-strtod.h".
3865 Do not include locale.h or define setlocale; no longer needed.
3867 (INT_STRLEN_BOUND): New macro.
3868 (getloadavg): Use it to compute buffer size.
3869 Don't assume that buffer will be properly terminated by 'read'.
3870 Use c_strtod instead of setlocale.
3871 (main) [defined TEST]: Return int, not void.
3873 2004-07-11 Paul Eggert <eggert@cs.ucla.edu>
3875 * Makefile.am (libfetish_a_SOURCES): Add c-strtold.c.
3876 * c-strtold.c: New file.
3877 * c-strtod.c: Include <config.h> first.
3878 (C_STRTOD, DOUBLE, STRTOD): New macros.
3879 (c_strtod): Use them.
3880 * c-strtod.h (c_strtold): New decl.
3882 2004-07-07 Jim Meyering <jim@meyering.net>
3884 Don't infloop when MAXSYMLINKS is not defined.
3885 Detect symlink loops much earlier (albeit lazily) on systems
3886 with MAXSYMLINKS defined to a large value.
3888 * canonicalize.c: Include "cycle-check.h".
3889 (canonicalize_filename_mode): Don't try to detect loops by counting
3890 symlink-hops. Instead, use the cycle-check module.
3892 * cycle-check.h: Include stdbool.h.
3893 Forward-declare `struct stat'.
3895 * canonicalize.c (canonicalize_filename_mode): Remove do-while(0) loop.
3896 Replace each corresponding `break' stmt with `continue'.
3898 2004-07-06 Jim Meyering <jim@meyering.net>
3900 * canonicalize.c: Include "stat-macros.h".
3901 (canonicalize_filename_mode): Remove #ifdef S_ISLNK, now that
3902 S_ISLNK is guaranteed to be defined (via stat-macros.h).
3904 2004-04-03 Dmitry V. Levin <ldv@altlinux.org>
3906 * Makefile.am (libfetish_a_SOURCES): Add canonicalize.c
3908 * canonicalize.h (canonicalize_mode_t): New type.
3909 * canonicalize.c: Include "file-type.h".
3910 (canonicalize_filename_mode): New function, based on
3911 canonicalize_file_name, supports three canonicalize modes.
3912 (canonicalize_file_name)
3913 [!HAVE_CANONICALIZE_FILE_NAME && !HAVE_RESOLVEPATH]: Use it.
3915 2004-07-05 Jim Meyering <jim@meyering.net>
3917 * path-concat.c (path_concat): Improve comment. From Paul Eggert.
3919 2004-07-02 Paul Eggert <eggert@cs.ucla.edu>
3921 * canonicalize.c (canonicalize_file_name): Assume that path_concat
3923 * path-concat.c (mempcpy): Don't define if a system header defines it.
3924 Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
3925 (longest_relative_suffix): New function.
3926 (path_concat): Use it. Assume first argument is not NULL.
3927 Port to DOS. Omit redundant separators.
3928 Report an error instead of returning NULL.
3929 Use mempcpy instead of memcpy.
3930 (xpath_concat): Remove: not declared or used.
3932 2004-06-30 Paul Eggert <eggert@cs.ucla.edu>
3934 * dirname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
3935 FILESYSTEM_PREFIX_LEN. All uses changed.
3936 * mountlist.h (read_file_system_list): Renamed from
3937 read_filesystem_list. All definitions and uses changed.
3939 2004-06-24 Jim Meyering <jim@meyering.net>
3941 * obstack.h (obstack_base): Fix parentheses. From Paul Eggert.
3943 2004-06-20 Jim Meyering <jim@meyering.net>
3945 * obstack.h (obstack_base): Cast to (void *), per documentation.
3947 * yesno.h: New file.
3948 * yesno.c: Include "yesno.h".
3949 * Makefile.am (libfetish_a_SOURCES): Add yesno.h.
3951 2004-06-19 Jim Meyering <jim@meyering.net>
3953 * filemode.c: Remove all S_IS* and S_IF* definitions.
3954 Instead, just include "stat-macros.h".
3956 * rmdir.c: Likewise.
3957 * makepath.c: Likewise.
3958 * lchown.c: Likewise.
3959 * isdir.c: Likewise.
3960 * canonicalize.c: Likewise.
3962 Add S_IS* definitions from filemode.c.
3963 * stat-macros.h (S_ISCTG): Define to zero if not already defined.
3964 (S_ISOFD): Likewise.
3965 (S_ISOFL): Likewise.
3967 2004-06-11 Paul Eggert <eggert@cs.ucla.edu>
3969 * readutmp.c (extract_trimmed_name): Don't apply strchr to a
3970 non-string; this leads to undefined behavior.
3972 2004-05-18 Paul Eggert <eggert@cs.ucla.edu>
3974 * fts.c (fts_stat, fts_alloc): Always allocate and use a struct
3975 stat, even if the user isn't interested in the results.
3976 This prevents a core dump in cycle_check when FTS_NOSTAT is set.
3977 * lchown.c (lchown): Return EOPNOTSUPP if not supported; this
3978 is what POSIX-2004 specifies.
3979 * lchown.h (EOPNOTSUPP): Define if not defined.
3982 2004-06-06 Jim Meyering <jim@meyering.net>
3984 * getdate.y: Update from gnulib.
3986 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
3988 * xreadlink.c: Include xreadlink.h first, to catch .h file
3989 dependency problems.
3990 (xreadlink): Accept new arg SIZE, for efficiency.
3991 All decls and uses changed.
3992 * xreadlink.h: Include <stddef.h>, for size_t.
3993 * canonicalize.c (canonicalize_file_name): Update use of xreadlink.
3995 2004-06-01 Jim Meyering <jim@meyering.net>
3997 * xmalloc.c: Update from gnulib.
3999 2004-05-30 Jim Meyering <jim@meyering.net>
4001 * alloca_.h: Remove trailing blank.
4003 2004-05-29 Jim Meyering <jim@meyering.net>
4005 * dirname.h (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): Define.
4007 * calloc.c: New file.
4009 2004-05-21 Jim Meyering <jim@meyering.net>
4011 * alloca.c, alloca_.h, fnmatch.c: Update from gnulib.
4012 * localcharset.c, regex.c: Likewise.
4014 2004-05-20 Jim Meyering <jim@meyering.net>
4016 * obstack.c, obstack.h: Update from gnulib.
4018 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
4020 * getline.c, getndelim2.c, getndelim2.h: Sync with gnulib.
4022 2004-05-11 Jim Meyering <jim@meyering.net>
4024 Prior to this change, rm required read access to the current
4025 directory on most systems (ones with the fchdir function).
4027 * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
4028 fails, try write-only, and finally, resort to using xgetcwd.
4030 2004-05-07 Jim Meyering <jim@meyering.net>
4033 * obstack.c (_): Define only if not already defined.
4034 * obstack.h (obstack_finish): Rename local: s/value/__value/.
4036 2004-05-03 Jim Meyering <jim@meyering.net>
4038 * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
4040 2004-05-01 Jim Meyering <jim@meyering.net>
4042 * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
4043 Wrap old code with this conditional.
4044 [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
4045 function that does not dereference symlinks.
4047 2004-04-18 Paul Eggert <eggert@twinsun.com>
4049 * nanosleep.c (suspended): Change its type from int to
4050 sig_atomic_t volatile.
4051 (first_call): Make it private to rpl_nanosleep, and have it
4052 be zero initially as that's a bit faster.
4053 (my_usleep): Round up fractional times instead of truncating them,
4054 as this is the usual meaning for 'sleep'.
4056 2004-04-20 Jim Meyering <jim@meyering.net>
4058 * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
4060 2004-04-18 Jim Meyering <jim@meyering.net>
4062 * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
4063 don't leak memory and do call END_UTMP_ENT.
4065 2004-04-13 Jim Meyering <jim@meyering.net>
4067 * quotearg.c, quotearg.h: Remove trailing blanks.
4069 2004-04-12 Jim Meyering <jim@meyering.net>
4071 * inttostr.h: Update from gnulib.
4073 2004-03-27 Paul Eggert <eggert@twinsun.com>
4075 * utimecmp.c, utimecmp.h: New files.
4076 * Makefile.am (libfetish_a_SOURCES): Add utimecmp.c, utimecmp.h.
4078 2004-04-09 Jim Meyering <jim@meyering.net>
4080 * stat-macros.h: New file, with contents from file-type.h
4081 and coreutils' system.h.
4082 * Makefile.am (libfetish_a_SOURCES): Add stat-macros.h.
4083 * file-type.c: Include "stat-macros.h".
4084 * file-type.h (file_type): Move all macro defiitions to new file,
4087 2004-03-30 Paul Eggert <eggert@twinsun.com>
4089 * cloexec.c, cloexec.h, config.charset, file-type.c, file-type.h:
4090 * getloadavg.c, getndelim2.c, getusershell.c, group-member.c:
4091 * human.c, path-concat.c, printf-args.c, printf-args.h:
4092 * quotearg.c, quotearg.h, setenv.c, strdup.c:
4093 * userspec.c, userspec.h, vasprintf.c: Sync from gnulib.
4095 * allocsa.c, allocsa.h, strdup.h: New files, from gnulib.
4096 * Makefile.am (libfetish_a_SOURCES): Add allocsa.c, allocsa.h,
4099 2004-03-30 Jim Meyering <jim@meyering.net>
4101 * getloadavg.c: Merge changes from emacs (via gnulib).
4103 2004-03-28 Paul Eggert <eggert@twinsun.com>
4105 Fix some gotchas encountered when porting to Solaris 8, using
4106 the Forte 6u2 compiler.
4108 * canonicalize.c [HAVE_UNISTD_H]: Include <unistd.h>,
4109 for resolvepath declaration.
4110 * fts.c: Include dirfd.h, for dirfd.
4112 2004-02-25 Paul Eggert <eggert@twinsun.com>
4114 * human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE.
4116 2004-03-23 Paul Eggert <eggert@twinsun.com>
4118 * readtokens0.c (readtokens0): Return true on success rather
4119 than on failure. All callers changed. This also happens to fix a
4120 portability bug on pre-C99 hosts, where (bool) INTEGER sometimes
4121 returns false even when INTEGER is nonzero.
4123 2004-03-23 Jim Meyering <jim@meyering.net>
4125 * Makefile.am (libfetish_a_SOURCES): Add getopt_int.h.
4126 * getopt_int.h: New file, from gnulib.
4127 * getopt.c, getopt.h, getopt1.c: Sync from gnulib.
4128 * getopt.c, getopt.h: Remove space(s) before TAB.
4130 * mbswidth.c, mbswidth.h: Sync from gnulib.
4132 2004-03-21 Jim Meyering <jim@meyering.net>
4134 * readtokens0.c, readtokens0.h: New files.
4135 * Makefile.am (libfetish_a_SOURCES): Add readtokens0.c and readtokens0.h
4137 * readtokens.c (readtoken): Don't leak 64 bytes when reading
4138 an empty input stream.
4140 * readtokens.c: Include <stdbool.h>.
4141 (readtoken): Use `size_t' rather than int/long.
4142 All callers adjusted.
4143 Use `bool' rather than `int' where appropriate.
4144 Use memset rather than an explicit loop.
4145 Use x2nrealloc rather than xrealloc.
4146 Allow the use of `\0' as a delimiter.
4147 (readtokens): Likewise.
4148 * readtokens.h (readtoken, readtokens): Update prototypes.
4150 2004-02-29 Paul Eggert <eggert@twinsun.com>
4152 * getdate.h: Include stdbool.h, and timespec.h instead of
4153 the usual <time.h> dance.
4154 (get_date): Change signature to support fractional time stamps.
4155 All callers changed.
4156 * getdate.y: Include "getdate.h" first, as we can now
4157 assume C89 and don't need to worry about 'const'.
4158 Similarly, include "unlocked-io.h" near start, not in middle.
4160 (textint.value): Use long int rather than int.
4161 (textint.digits): Use size_t rather than int.
4162 (BILLION, LOG10_BILLION): New constants.
4163 (parser_control): New member rel_ns. Members day_ordinal,
4164 time_zone, month, day, hour, minutes, rel_year, rel_month,
4165 rel_day, rel_hour, rel_minutes, rel_seconds
4166 are now long int, not int. Member seconds is now struct timespec,
4167 not int. New member timespec_seen. Members dates_seen, days_seen,
4168 local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
4170 (%union.intval): Now long int, not int.
4171 New member timespec.
4172 (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
4173 (seconds, signed_seconds, unsigned_seconds): New nonterminals.
4174 (spec): Now is a timespec or an item list.
4175 (timespec, items): New nonterminals.
4176 (time, rel, relunit, number, get_date):
4177 Add support for fractional seconds.
4178 (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
4179 (gmtime, localtime, mktime): Remove decls; not needed with C89.
4180 (to_hour): First arg is now long int, not int.
4181 (to_year): Returns long int, not int.
4182 Don't treat year -70 like 70.
4183 (tm_diff): Returns long int, not int.
4184 (lookup_word): Use bool instead of int when appropriate.
4185 (yylex): Use size_t for count, not int.
4186 Detect overflow when parsing large integer constants.
4187 Add support for fractions.
4188 (get_date): Make pointers 'const' if possible.
4189 Use more-portable code to detect integer overflow.
4190 (main) [TEST]: Adjust to above changes. Test for localtime failure.
4191 Don't use ctime; it's not reliable if the year has >4 digits.
4193 2004-03-15 Jim Meyering <jim@meyering.net>
4195 `date --date="21:04 +0100" +%S' would print the seconds value
4196 from the current time, rather than `00'.
4197 * getdate.y: For a date string like `10:23 +0100',
4198 set the number of seconds to zero. Reported by Marc Haber.
4200 2004-03-04 Jim Meyering <jim@meyering.net>
4202 * cloexec.c (set_cloexec_flag) [ ! (F_GETFD && F_SETFD)]:
4203 Return true, not false.
4205 2004-03-03 Paul Eggert <eggert@twinsun.com>
4207 * cloexec.c: Include "cloexec.h" first, and <unistd.h> before <fcntl.h>.
4208 (set_cloexec_flag): Use bool for booleans. All uses changed.
4209 If F_GETFD returns a negative number (not just -1), report a
4210 failure. Don't use F_SETFD if the flags are already right.
4211 Don't report a failure with F_SETFD unless it returns -1.
4212 * cloexec.h: Include <stdbool.h>.
4213 Adjust signature to use `bool' rather than `int'.
4214 * getloadavg.c (getloadavg): Use `true', not `1'.
4216 2004-03-02 Dmitry V. Levin <ldv@altlinux.org>
4218 * cloexec.c: New file.
4219 The set_cloexec_flag implementation imported from GNU C Library
4221 * cloexec.h: New file.
4222 * getloadavg.c: Include "cloexec.h".
4223 (getloadavg): Use set_cloexec_flag instead of manual fcntl call.
4224 * Makefile.am (libfetish_a_SOURCES): Add cloexec.c, cloexec.h.
4226 2004-02-23 Paul Eggert <eggert@twinsun.com>
4228 * userspec.c: Don't include "posixver.h".
4229 (parse_user_spec): Fall back on USER.GROUP parsing, regardless
4230 of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
4231 compatible extension. Simplify code by removing a boolean int
4232 that was always nonzero if a string was nonnull.
4234 2004-02-05 Jim Meyering <jim@meyering.net>
4236 * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
4237 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
4238 From coreutils' system.h.
4240 2004-01-29 Jim Meyering <jim@meyering.net>
4242 * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
4244 2004-01-21 Paul Eggert <eggert@twinsun.com>
4246 * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
4247 Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
4248 * argmatch.h: Comment fix to match the above.
4249 * long-options.c (parse_long_options): Use prototype
4250 for usage function arg. Pass it EXIT_SUCCESS rather than 0,
4252 * obstack.c (obstack_exit_failure) [!defined _LIBC]:
4253 Now a macro referring to exit_failure, instead of a separate
4254 variable. Include "exitfail.h" to get it.
4255 * xstrtol.h: Include "exitfail.h".
4256 (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
4258 2004-01-21 Jim Meyering <jim@meyering.net>
4260 * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
4261 so as not to conflict with a different-sized __mktime_internal
4262 function in GNU libc.
4264 2004-01-16 Jim Meyering <jim@meyering.net>
4267 * localcharset.c: Test HAVE_DECL_GETC_UNLOCKED,
4268 rather than HAVE_GETC_UNLOCKED.
4270 2003-10-08 Paul Eggert <eggert@twinsun.com>
4274 * unlocked-io.h: Include <stdio.h>, so that the caller
4275 doesn't have to include <stdio.h> before us.
4276 (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4277 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4278 fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4279 putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4280 if not declared, so that we can use getpass.c code from libc without
4282 (flockfile, ftrylockfile, funlockfile): New macros.
4284 2004-01-14 Paul Eggert <eggert@twinsun.com>
4288 * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
4289 with like-named macro in fnmatch.c.
4290 (EXT): Use an internal constant instead.
4292 Merge fnmatch patches from glibc.
4293 * fnmatch.c (mbsinit): Remove define.
4294 Add libc_hidden_ver (__fnmatch, fnmatch).
4295 * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
4296 Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
4298 2003-11-24 Paul Eggert <eggert@twinsun.com>
4302 * alloca.c: Remove dependency on xalloc module.
4303 (xalloc_die): Remove.
4304 (memory_full) [!defined emacs]: New macro.
4305 [!defined emacs]: Don't include xalloc.h.
4306 (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
4307 address arithmetic overflows. Change datatypes a bit to avoid
4310 2004-01-14 Paul Eggert <eggert@twinsun.com>
4312 * posixver.c: Include posixver.h.
4314 2004-01-12 Jim Meyering <jim@meyering.net>
4316 * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
4317 optional configure-time default.
4319 2004-01-10 Jim Meyering <jim@meyering.net>
4321 * version-etc.c (version_etc_copyright): Update copyright date.
4323 2003-12-20 Jim Meyering <jim@meyering.net>
4325 * fts.c [!_LIBC]: Undefine, then define-away __P.
4327 2003-12-19 Jim Meyering <jim@meyering.net>
4329 Rewrite fts to use a hash table or O(1)-mem cycle-detection
4330 code rather than the tree-based tsearch functions.
4331 * fts_.h: Include hash.h and cycle-check.h.
4332 (FTS_TIGHT_CYCLE_CHECK): New value.
4333 (FTS_OPTIONMASK): Adjust to include the new value.
4334 (FTS_NAMEONLY, FTS_STOP): Increase to allow room for new value.
4335 (struct FTS) [active_dir_ht]: New member. Replaces fts_dir_signatures.
4336 (struct FTS) [cycle_state]: New member.
4337 * fts.c: Don't include <search.h>.
4338 [HAVE_INTTYPES_H]: Include <inttypes.h>.
4339 (tdestroy, tfind, tsearch): Remove definitions.
4340 (struct Active_dir): Rename from `known_object'.
4341 (AD_compare, AD_hash): New functions.
4342 (enter_dir, leave_dir): Rewrite to manipulate a hash table
4344 (fts_open): Initialize hash table or cycle_state buffer.
4345 (free_node): Remove function.
4346 (find_matching_ancestor): Renamed/rewritten from look_up_active_dir.
4347 (fts_cross_check): Adapt to use new data structure.
4349 * Makefile.am (libfetish_a_SOURCES): Remove search_.h.
4350 (DISTCLEANFILES): Remove definition.
4352 2003-12-18 Jim Meyering <jim@meyering.net>
4354 Rewrite cycle detection code to work properly.
4355 Add some framework (compiled out by default) to test it.
4356 * fts.c (Dprintf, ENTER_DIR, LEAVE_DIR): Define.
4357 (add_object): Remove function. Rewritten as...
4358 (enter_dir): New function.
4359 (leave_dir, free_node): New functions.
4360 (fts_read): Ensure that we call ENTER_DIR or LEAVE_DIR,
4361 as appropriate, before returning.
4362 (look_up_active_dir, fts_cross_check) [FTS_DEBUG]: New functions.
4363 (fts_stat): Don't perform the cycle check here.
4364 Now it's done via enter_dir.
4366 2003-12-12 Jim Meyering <jim@meyering.net>
4368 * fts_.h (FTS) [fts_dir_signatures]: Add comment.
4370 2003-12-03 Paul Eggert <eggert@twinsun.com>
4372 * getgroups.c (getgroups): xmalloc takes one argument, not two.
4373 Bug reported by Alfred M. Szmidt.
4375 2003-12-02 Jim Meyering <jim@meyering.net>
4377 * Makefile.am (libfetish_a_SOURCES): Reflect sha -> sha1 renaming.
4379 * sha1.c: File renamed from sha.c.
4380 * sha1.h: File renamed from sha.h.
4381 Use SHA1_H, not _SHA_H in #ifndef condition.
4383 * sha.c: Add FSF Copyright.
4384 * sha.h: Correct stale references to MD5 and `16 bytes'.
4385 Patch by Ulrich Drepper.
4387 * sha.h: Add FSF Copyright. Remove reference to Scott Miller,
4388 since this file is now nearly identical to md5.h.
4390 * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These
4391 days, gcc-3.x does better all by itself. Patch from Dean Gaudet:
4392 http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
4394 2003-11-29 Jim Meyering <jim@meyering.net>
4396 * c-strtod.c (c_strtod): Save and restore original LC_NUMERIC setting,
4397 in case it was different from the environment-derived value.
4398 Patch by Paul Eggert.
4399 Include "xalloc.h" for declaration of xstrdup.
4401 2003-11-24 Paul Eggert <eggert@twinsun.com>
4403 Parse floating-point operands and options in the C locale.
4404 POSIX requires this for printf, and we might as well be
4405 consistent elsewhere (tail, sleep, seq).
4407 * Makefile.am (libfetish_a_SOURCES): Add c-strtod.c, c-strtod.h.
4408 * c-strtod.c, c-strtod.h: New files.
4409 * xstrtod.h (xstrtod): Accept an extra arg, specifying the
4410 conversion function.
4411 * xstrtod.c (xstrtod): Likewise. All callers changed to
4412 include c-strtod.h and use c_strtod. Don't include stdlib.h; no
4415 * xnanosleep.c: Don't include xstrtod.h; it's not needed.
4417 2003-11-22 Jim Meyering <jim@meyering.net>
4419 * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
4421 2003-11-21 Jim Meyering <jim@meyering.net>
4423 * xreadlink.c (xreadlink): Correct outdated comment.
4425 2003-11-17 Jim Meyering <jim@meyering.net>
4427 On systems without utime and without a utimes function capable of
4428 dealing with a NULL struct utimbuf* argument, this utime replacement
4429 could -- in unusual circumstances -- leak a file descriptor.
4430 * utime.c: Include <unistd.h> and <errno.h>.
4431 (utime_null): Be sure to close `fd' and to preserve errno.
4432 Reported by Geoff Collyer via Arnold Robbins.
4434 2003-11-13 Jim Meyering <jim@meyering.net>
4436 * xalloc.h, xstrtol.c: Update from gnulib.
4438 2003-11-11 Jim Meyering <jim@meyering.net>
4440 * ftw.c, ftw_.h: Remove files. No longer used.
4442 2003-11-09 Jim Meyering <jim@meyering.net>
4444 * root-dev-ino.c, root-dev-ino.h: New files.
4445 * Makefile.am (libfetish_a_SOURCES): Add root-dev-ino.c root-dev-ino.h.
4447 * dev-ino.h: Include <sys/types.h> and <sys/stat.h>.
4449 2003-11-06 Jim Meyering <jim@meyering.net>
4451 * free.c: New file, from gnulib.
4453 2003-10-31 Paul Eggert <eggert@twinsun.com>
4455 * mountlist.h (struct mount_entry.me_type_malloced): New member.
4456 * mountlist.c (SIZE_MAX): Define if not defined already.
4457 (read_filesystem_list): Set and use me_type_malloced.
4458 Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
4459 whatever the type happens to be), for brevity and consistency.
4460 Check for size calculation overflow on Alphas running OSF/1.
4462 2003-10-31 Jim Meyering <jim@meyering.net>
4464 * hash.c: Include "xalloc.h" for use of xalloc_oversized.
4466 * linebuffer.c: Include <string.h> for declaration of memset.
4468 * alloca.c, linebuffer.c, xmalloc.c, xalloc.h: Update from gnulib.
4469 * exclude.c, getgroups.c, quotearg.c, stdbool_.h: Update from gnulib.
4470 * hash.c, hash-pjw.h: Update from gnulib.
4472 2003-10-25 Jim Meyering <jim@meyering.net>
4474 * hash.c, hash.h: Update from gnulib.
4475 * hash-pjw.c, hash-pjw.h: Likewise.
4476 * obstack.c, obstack.h: Likewise.
4478 2003-10-25 Jim Meyering <meyering@lucent.com>
4480 * fts_.h: Include <features.h> only if _LIBC.
4481 [!_LIBC]: Define-away __THROW, __BEGIN_DECLS, __END_DECLS.
4483 2003-10-19 Jim Meyering <jim@meyering.net>
4485 * vasnprintf.c (vasnprintf): Work around losing snprintf on
4488 2003-09-25 Jim Meyering <jim@meyering.net>
4489 Bruno Haible <bruno@clisp.org>
4491 [Update from gnulib]
4492 This lets translators provide better translations for the
4493 "Written by ..." part of --version output.
4494 * version-etc.h: Include stdarg.h.
4495 (version_etc_copyright): Declare as readonly.
4496 (version_etc): Make this function variadic with a NULL-terminated list
4497 of author name strings.
4498 (version_etc_va): New declaration.
4499 * version-etc.c: Include stdarg.h, stdlib.h.
4500 (version_etc_copyright): Declare as readonly.
4501 (version_etc_va): New function. Provide a different translatable string
4502 for each possible number of authors < 10. Abbreviate when there are 10
4504 (version_etc): Make this function variadic. Call version_etc_va.
4505 Suggestion from Gary V. Vaughan.
4507 * long-options.h (parse_long_options): Change prototype: the authors
4508 string is moved to the end and becomes variadic.
4509 * long-options.c: Include stdarg.h.
4510 (parse_long_options): Make this function variadic, too.
4511 Call version_etc_va, not version_etc.
4513 2003-10-17 Jim Meyering <jim@meyering.net>
4515 * xfts.c, xfts.h: New files.
4516 This factors out code used by du.c, chmod.c, and chown-core.c.
4517 * Makefile.am (libfetish_a_SOURCES): Add xfts.c and xfts.h.
4519 * error.h: Update from gnulib.
4520 * getpass.c: Likewise.
4521 * fnmatch.c: Likewise.
4522 * fnmatch_loop.c: Likewise.
4524 2003-10-16 Jim Meyering <jim@meyering.net>
4526 * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
4528 * getgroups.c: Update from gnulib.
4529 * readutmp.c: Fix indentation, from gnulib.
4530 * exclude.c: Update from gnulib.
4531 * xgethostname.c: Include xgethostname.h.
4532 * xgethostname.h: New file, from gnulib.
4533 * Makefile.am (libfetish_a_SOURCES): Add xgethostname.h.
4535 2003-10-15 Jim Meyering <jim@meyering.net>
4537 * userspec.h: New file.
4538 * userspec.c: Include "userspec.h".
4539 * Makefile.am (libfetish_a_SOURCES): Add userspec.h.
4541 2003-10-14 Paul Eggert <eggert@twinsun.com>
4543 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
4545 * human.c, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoul.c, xstrtoumax.c:
4548 2003-10-13 Paul Eggert <eggert@twinsun.com>
4550 * xalloc.h, xmalloc.c, xstrdup.c: Import latest version from gnulib.
4552 2003-09-29 Paul Eggert <eggert@twinsun.com>
4554 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
4556 2003-10-02 Jim Meyering <jim@meyering.net>
4558 Don't require that the maximum length of a file name
4559 encountered in a traversal fit in an `unsigned short',
4560 and fix some portability bugs (don't depend on gcc).
4562 * fts.c: Include "fts_.h", not <fts.h>.
4563 (ALIGNBYTES) [!(__GNUC__ >= 2)]: Add a definition that works with
4564 compilers that don't have __alignof__.
4565 (MAX): Use a definition that doesn't depend on gcc.
4566 (fts_build): Make `len' and `maxlen' be of type size_t, not int.
4567 Test for overflow in a less type-dependent manner.
4568 Test HAVE_STRUCT_DIRENT_D_TYPE, rather than
4569 defined DT_DIR && defined _DIRENT_HAVE_D_TYPE.
4570 (fts_palloc): Test for overflow in a less type-dependent manner.
4571 (fts_safe_changedir): Use stat, not stat64.
4572 Use fstat, not __fxstat64(_STAT_VER.
4574 * fts_.h [FTS] (fts_pathlen): Change type from int to size_t.
4575 [FTSENT] (fts_pathlen): Change type from u_short to size_t.
4576 (fts_level): Change type from u_short to int.
4578 * Makefile.am (libfetish_a_SOURCES): Add fts.c fts_.h.
4581 2003-09-29 Paul Eggert <eggert@twinsun.com>
4583 * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4584 Fix arg typo in previous patch.
4586 2003-09-28 Jim Meyering <jim@meyering.net>
4588 * error.c: Update from gnulib.
4590 2003-09-19 Jim Meyering <jim@meyering.net>
4592 * version-etc.h: (version_etc): Rename parameter, authors,
4594 * version-etc.c: (version_etc): Likewise.
4595 Combine fprintf and following putc('\n'.
4597 * version-etc.c, version-etc.h: Revert yesterday's changes.
4598 * long-options.c, long-options.h: Likewise.
4600 2003-09-18 Jim Meyering <jim@meyering.net>
4602 This lets translators provide better translations for the
4603 `Written by ...' part of --version output.
4604 * version-etc.c: Include stdarg.h, stdlib.h, string.h, and xalloc.h.
4605 (version_etc): Make this function variadic,
4606 with a NULL-terminated list of author name strings.
4607 (version_etc_va): New function.
4608 Suggestion from Gary V. Vaughan.
4609 * version-etc.h (version_etc_va): Declare it.
4611 * long-options.c: Include stdarg.h.
4612 (parse_long_options): Make this function variadic (authors), too.
4613 Call version_etc_va, not version_etc.
4614 * long-options.h (parse_long_options): Update prototype.
4616 2003-09-16 Paul Eggert <eggert@twinsun.com>
4618 * linebuffer.c (readlinebuffer): Return NULL immediately upon
4619 input error, instead of returning NULL the next time we are called
4620 (and therefore losing track of errno).
4622 2003-09-15 Paul Eggert <eggert@twinsun.com>
4624 * getndelim2.c (getndelim2): Don't trash errno when a read
4625 fails, so that the caller gets the proper errno.
4627 * readutmp.c (read_utmp): Likewise.
4628 Check for fstat error. Close stream and free storage
4631 2003-09-14 Jim Meyering <jim@meyering.net>
4633 * argmatch.c: Update from gnulib.
4635 * Makefile.am (libfetish_a_SOURCES): Add exit.h, strndup.h,
4638 2003-09-13 Jim Meyering <jim@meyering.net>
4640 * setenv.c, strcspn.c, strdup.c, strndup.c, strnlen.c, strpbrk.c:
4641 * strstr.c, strtod.c, strtoimax.c, tempname.c, unicodeio.c, userspec.c:
4642 * vasprintf.h, xgethostname.c, xreadlink.c, xstrdup.c, xstrndup.c:
4643 * xstrndup.h, xstrtod.c, xstrtol.c, yesno.c: Update from gnulib.
4644 * strndup.h: New file, from gnulib.
4645 * exit.h: New file, from GNU gettext, via gnulib.
4647 2003-09-06 Paul Eggert <eggert@twinsun.com>
4649 * time_r.c, time_r.h: New files.
4651 * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
4653 (__localtime_r) [!defined _LIBC]: New macro. Include <time_r.h>.
4654 (__mktime_internal) [!defined _LIBC]: Now extern, not static.
4656 * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
4658 (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
4659 (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
4662 2003-09-13 Jim Meyering <jim@meyering.net>
4664 * strtol.c: Update from gnulib.
4666 2003-09-12 Paul Eggert <eggert@twinsun.com>
4668 * argmatch.c, xgethostname.c, xmalloc.c: Include exit.h.
4669 * obstack.c [!defined _LIBC]: Likewise.
4670 * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4671 * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4672 * exitfail.c: Don't include stdlib.h; no longer needed.
4674 2003-09-12 Paul Eggert <eggert@twinsun.com>
4676 * error.c (error_tail): Assume vprintf.
4678 2003-09-09 Paul Eggert <eggert@twinsun.com>
4682 * getloadavg.c (getloadavg, main): Define via prototypes.
4684 * getopt.h (struct option.name): Assume C89, and use 'const'.
4685 (getopt, etopt_long, getopt_long_only, _getopt_internal)
4686 [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
4688 * getopt.c (const): Remove macro.
4689 Include <string.h> unconditionally.
4690 (my_index): Remove; all uses changed to strchr.
4691 (strlen): Remove decl.
4692 (exchange): Remove forward decl; no longer needed.
4693 (exchange, _getopt_initialize, _getopt_internal, getopt, main):
4694 Define with prototype.
4695 * getopt1.c (const): Remove macro.
4696 (getopt_long, getopt_long_only, main): Define with prototype.
4698 * getugroups.c: Include <string.h> unconditionally.
4700 * getusershell.c: Include <stdlib.h> unconditionally.
4701 (getusershell, setusershell, endusershell, readname, main):
4702 Define with prototypes.
4704 * group-member.c: Include group-member.h first.
4705 Include <stdlib.h> unconditionally.
4707 * hard-locale.c: Include hard-locale.h first.
4708 Include <stdlib.h>, <string.h> unconditionally.
4710 * hash.c (free, malloc): Remove decls.
4711 Include <stdlib.h> unconditionally.
4713 * human.c: Include <stdlib.h>, <string.h> unconditionally.
4714 (getenv): Do not declare.
4716 * idcache.c: Include <string.h> unconditionally.
4718 * long-options.c: Include long-options.h first, to test interface.
4719 Include <stdlib.h> unconditionally.
4721 * makepath.c: Include makepath.h first, to test interface.
4722 Include <stdlib.h> and <string.h> unconditionally.
4724 * linebuffer.c: Include <stdlib.h>.
4725 (free): Remove decl.
4727 * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
4728 rpl_malloc returns void *, not char *.
4729 * realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
4731 * md5.h: Include <limits.h> unconditionally.
4732 (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
4733 (__P): Remove; all uses removed.
4734 * md5.c: Include "md5.h" first.
4735 (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
4736 md5_buffer, md5_process_bytes, md5_process_block):
4737 Define with prototypes.
4738 * sha.h (__P): Remove all uses. (It wasn't defined??)
4739 * sha.c: Include "sha.h" first.
4740 Include <stdlib.h>, <string.h> unconditionally.
4742 * memchr.c (__ptr_t): Remove; all uses changed to void *.
4743 * memcmp.c (__ptr_t): Likewise.
4744 * memrchr.c (__ptr_t): Likewise.
4745 * memchr.c, memcmp.c, memcoll.c, memrchr.c:
4746 Include <string.h> unconditionally.
4747 * memchr.c, memrchr.c: Include <limits.h> unconditionally.
4748 * memchr.c: Include <stdlib.h> unconditionally.
4749 * memchr.c (LONG_MAX): Remove.
4750 * memrchr.c (LONG_MAX): Likewise.
4751 * memchr.c (__memchr): Define via a prototype.
4752 * memrchr.c (__memrchr): Likewise.
4753 * memcmp.c (__P): Remove, and remove all uses.
4754 (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
4755 Remove forward decls; no longer needed.
4756 * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
4757 Use types required by C89 in prototype.
4759 * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
4760 * savedir.c: Likewise.
4761 * mkdir.c (free): Remove decl.
4762 * rmdir.c (rmdir): Define with a prototype.
4763 * savedir.c: Include savedir.h first, to test interface.
4765 * mktime.c (STDC_HEADERS): Remove.
4766 Include <stdlib.h>, <string.h> unconditionally.
4768 * modechange.c: Include <stdlib.h> unconditionally.
4769 (malloc): Remove decl.
4771 * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
4772 (free): Remove decl.
4774 * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
4775 Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
4776 (This type really should be intptr_t, but that's a C99ism.)
4777 (_obstack_memcpy): Remove: all uses changed to memcpy.
4778 Include <string.h> unconditionally.
4779 (struct obstack): Assume __STDC__ for types of members
4780 chunkfun, freefun, extra_arg.
4781 (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
4782 _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
4783 obstack_begin, obstack_specify_allocation,
4784 obstack_specify_allocation_with_arg, obstack_chunkfun,
4785 obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
4786 Remove unprototyped decls and the macros that use them.
4787 * obstack.c (POINTER): Remove. All uses changed to void *.
4788 (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
4789 _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
4790 (defined __STDC__ && __STDC__)]:
4791 Remove nonprototyped code.
4792 Include <stdlib.h> unconditionally.
4793 (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
4794 _obstack_allocated_p, _obstack_free, obstack_free,
4795 _obstack_memory_used, print_and_abort):
4796 Define using prototypes.
4797 (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
4798 obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
4799 obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
4800 obstack_next_free, obstack_object_size, obstack_room) [0]:
4801 Remove unused, unprototyped code.
4803 * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
4805 * physmem.c (physmem_total, physmem_available, main): Define
4808 * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
4809 (main): Define with a prototype.
4811 * posixver.c (getenv): Remove decl.
4813 * putenv.c (malloc): Returns void *, not char *.
4814 Include <string.h> unconditionally.
4815 (strchr, memcpy, NULL): Do not define.
4817 * readtokens.c: Include readtokens.h first, to test interface.
4818 Include <stdlib.h>, <string.h> unconditionally.
4819 (init_tokenbuffer): Define with a prototype.
4821 * regex.c (PARAMS): Remove. All uses removed.
4822 All uses of _RE_ARGS removed, too.
4823 Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4825 (bzero): Assume memset exists.
4826 (memcmp, memcpy, NULL): Remove.
4827 (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
4828 char, or assignments to local vars of type signed char.
4829 (init_syntax_once, PREFIX(extract_number_and_incr),
4830 PREFIX(print_partial_compiled_pattern),
4831 PREFIX(print_compiled_pattern), PREFIX(print_double_string),
4832 convert_mbs_to_wcs, print_fastmap, re_set_syntax,
4833 PREFIX(regex_grow_registers), PREFIX(regex_compile),
4834 PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
4835 PREFIX(insert_op2), PREFIX(at_begline_loc_p),
4836 PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
4837 wcs_compile_range, byte_compile_range, truncate_wchar,
4838 PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
4839 re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
4840 count_mbs_length, wcs_re_match_2_internal,
4841 byte_re_match_2_internal, PREFIX(group_match_null_string_p),
4842 PREFIX(alt_match_null_string_p),
4843 PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
4844 re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
4845 regfree, PREFIX(extract_number)): Define with prototype. Remove
4846 now-unnecessary declaration, if any.
4847 (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
4849 Remove now-unnecessary casts among pointer types.
4850 * regex.h (_RE_ARGS): Remove. All uses removed.
4852 * rename.c: Include <stdlib.h>, <string.h> unconditionally.
4853 (free): Remove decl.
4855 * rpmatch.c: Include <stdlib.h> unconditionally.
4857 * save-cwd.c: Include <stdlib.h> unconditionally.
4858 * xgetcwd.c: Likewise.
4860 * stat.c: Include <stdlib.h>, <string.h> unconditionally.
4861 (free): Remove decl.
4863 The following changes are not K&R related:
4865 * group-member.h: Include <sys/types.h>, so that this file is
4867 * makepath.h: Likewise.
4869 * getusershell.c (readname, default_index, line_size, readname):
4870 Use size_t, not int, for sizes.
4871 (readname): If the size overflows, report an error instead of
4874 2003-09-09 Derek Robert Price <derek@ximbiot.com>
4876 * getndelim2.c: Assume stdlib.h per the C89 spec.
4878 2003-09-08 Paul Eggert <eggert@twinsun.com>
4880 Assume C89 or better; remove K&R cruft.
4881 A few of these changes were first proposed by Derek Robert Price
4882 in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
4884 * addext.c: Include <string.h> unconditionally.
4885 * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
4886 Don't declare getenv or malloc.
4888 * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
4889 (POINTER_TYPE, pointer): Remove; all uses changed to void *.
4891 (find_stack_direction, alloca): Use prototypes.
4893 * atexit.c (atexit): Define using a prototype.
4895 * basename.c, dirname.c, stripslash.c:
4896 Include <string.h> unconditionally.
4898 * bcopy.c: Include <stddef.h>.
4899 (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
4901 * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
4903 * error.h (error, error_at_line, error_print_progname)
4904 [! (defined (__STDC__) && __STDC__)]: Remove decls.
4905 * error.c: Include error.h first, to check interface.
4906 Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4907 (VA_START): Remove; all uses changeed to va_start.
4908 (exit, strerror): Remove decls.
4909 (error_print_progname): Prototype uncondionally.
4910 Don't include <errno.h>; no longer needed.
4911 (private_strerror): Remove.
4912 (error_tail): Always define.
4913 (error, error_at_line): Assume C89 or better; always use prototypes.
4915 * euidaccess.c (main): Define with a prototype.
4917 * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
4919 * exitfail.c: Include <stdlib.h> unconditionally.
4921 * fnmatch_.h (__P): Remove. All uses changed to assume prototypes.
4922 * fnmatch.c: Include fnmatch.h first, to test interface.
4923 Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
4924 (getenv): Remove decl.
4925 (fnmatch): Define using a prototype.
4926 * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
4927 (FCT): Define using a prototype.
4929 * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
4931 * gethostname.c: Include <stddef.h>.
4932 (gethostname): Define with prototype. Length is size_t, not int.
4934 2003-09-08 Paul Eggert <eggert@twinsun.com>
4936 * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
4937 (utime_null): Fix typo: 'st' was sometimes called 'sb'.
4939 2003-09-09 Jim Meyering <jim@meyering.net>
4941 * getversion.c: Remove unused file. Reported by Paul Eggert.
4943 2003-09-03 Paul Eggert <eggert@twinsun.com>
4945 * human.c (human_readable): Fix bug that rounded 10501 to 10k.
4946 Bug reported by Lute Kamstra in
4947 <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
4949 * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
4950 "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of
4951 course with correspondingly smaller numbers for tomorrow and
4952 yesterday. From Tadayoshi Funaba. Originally installed into
4953 sh-utils on 1999-08-07, but the patch was mistakenly reverted by
4954 the next change to that shared file (but this time in fileutils)
4957 2003-08-18 Paul Eggert <eggert@twinsun.com>
4959 * same.c: Include <stdlib.h> and <string.h> unconditionally,
4960 as we're now assuming that part of hosted C89.
4961 (free) [!HAVE_DECL_FREE]: Remove decl; no longer needed.
4962 (same_name): Invoke pathconf on destination, not source, as
4963 that's a bit clearer even if they are the same dir.
4965 2003-08-18 Jim Meyering <jim@meyering.net>
4967 * getopt.h: Remove space before TAB.
4969 2003-08-17 Paul Eggert <eggert@twinsun.com>
4971 * same.c: Include <stdbool.h>, <limits.h>.
4972 (_POSIX_NAME_MAX): Define if not defined.
4974 (same_name): If file names are silently truncated, report
4975 that the file names are the same if they are the same after
4976 the silent truncation.
4978 2003-08-16 Paul Eggert <eggert@twinsun.com>
4981 * Makefile.am (libfetish_a_SOURCES): Remove getndelim2.c,
4982 getndelim2.h, xstrtoimax.c. Add localcharset.h.
4983 (CLEANFILES, SUFFIXES): Initialize to empty.
4984 (EXTRA_DIST): Add getndelim2.c, getndelim2.h.
4985 (install-exec-local): Use $(GLIBC21), not @GLIBC21@.
4986 Do not mkdir libdir if not glibc21.
4987 (charset.alias): @host@ -> $(host).
4988 (SUFFIXES, .sin.sed, CLEANFILES): Reorder rules
4989 to match gnulib module suggestions.
4990 * localcharset.h, readlink.c: New files, from gnulib.
4991 * asnprintf.c, asnprintf.c, asprintf.c, backupfile.h,
4992 canon-host.c, config.charset, dirname.h, euidaccess.c, exclude.c,
4993 fsusage.h, full-write.c, getloadavg.c, getndelim2.h, gettext.h,
4994 group-member.h, hard-locale.h, hash.c, hash.h, hash-pjw.c,
4995 localcharset.c, long-options.h, makepath.h, malloc.c, mbswidth.c,
4996 mbswidth.h, md5.h, memcasecmp.c, memcasecmp.h, memcoll.h,
4997 mkstemp.c, modechange.h, mountlist.h, path-concat.h, pathmax.h,
4998 physmem.h, posixtm.h, printf-args.c, printf-args.h,
4999 printf-parse.c, printf-parse.h, putenv.c, quote.h, readutmp.h,
5000 ref-add.sin, ref-del.sin, safe-read.c, savedir.h, setenv.c,
5001 setenv.h, stdbool_.h, strnlen.c, strpbrk.c, strtoimax.c,
5002 strverscmp.h, tempname.c, unicodeio.c, unicodeio.h,
5003 unistd-safer.h, unlocked-io.h, vasnprintf.c, vasnprintf.h,
5004 vasprintf.c, vasprintf.h, version-etc.h, xgethostname.c,
5005 xmemcoll.c, xstrtoimax.c, xstrtoumax.c: Sync with gnulib.
5007 2003-08-15 Paul Eggert <eggert@twinsun.com>
5009 * physmem.c: Include "physmem.h" before system includes.
5011 2003-08-10 Jim Meyering <jim@meyering.net>
5013 * utimens.c (utimens): Revert most of last change.
5014 Test HAVE_WORKING_UTIMES instead of HAVE_UTIMES.
5016 2003-08-09 Jim Meyering <jim@meyering.net>
5018 * utimens.c (utimens): Test HAVE_UTIME, not HAVE_UTIMES.
5019 Prefer utime, since it works and utimes doesn't on some systems.
5020 FIXME: Revert the above change once we have a working utimes
5021 replacement function.
5023 2003-08-06 Paul Eggert <eggert@twinsun.com>
5025 * Makefile.am (libeftish_a_SOURCES): Add utimens.c, utimens.h.
5026 * utimens.c, utimens.h: New files.
5028 2003-08-09 Jim Meyering <jim@meyering.net>
5030 * unicodeio.c (unicode_to_mb): Change to `Solaris 5.7' in comment.
5031 * putenv.c: Likewise.
5033 * fatal.c, fatal.h: Remove unused files.
5035 * Makefile.am: Use the e.g., `$(FNMATCH_H)' notation for AC_SUBST'd
5036 variable names, rather than @FNMATCH_H@.
5037 Likewise for $(ALLOCA_H).
5038 (fnmatch.h): Use `$@' in the commands, in place of the three copies
5039 of the literal target, `fnmatch.h'.
5040 (alloca.h): Likewise.
5042 2003-08-08 Paul Eggert <eggert@twinsun.com>
5044 * Makefile.am (libfetish_a_SOURCES): Remove fnmatch_.h.
5045 (lib_OBJECTS): New macro, for convenience when cutting and
5046 pasting Makefile.am templates from gnulib.
5047 (EXTRA_DIST): Remove fnmatch_loop.c.
5048 (BUILT_SOURCES): Append $(FNMATCH_H).
5049 * Makefile.am: Import the following changes from gnulib templates
5050 for alloca and fnmatch):
5051 (all-local $(lib_OBJECTS)): New dependencies.
5052 (alloca.h): Use alloca.h-t for temporary.
5053 (EXTRA_DIST): Append fnmatch_.h, fnmatch_loop.c.
5054 (fnmatch.h): New rule.
5055 (MOSTLYCLEANFILES): Add fnmatch.h, fnmatch.h-t.
5056 (DISTCLEANFILES): Remove fnmatch.h
5058 2003-08-08 Jim Meyering <jim@meyering.net>
5060 * mountlist.c (read_filesystem_list) [MOUNTED_GETFSSTAT]:
5061 Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could
5062 hang on OSF/1 5.1 for DIR on both local and remote file systems.
5063 Reported by (and fix confirmed by) Nelson H. F. Beebe.
5065 2003-08-07 Jim Meyering <jim@meyering.net>
5067 * regex.h (RE_SYNTAX_POSIX_AWK): Remove SPACE in SPACE-TAB sequence.
5069 2003-08-05 Paul Eggert <eggert@twinsun.com>
5071 Merge getline from gnulib.
5072 * getline.h, getline.c: Merge from gnulib.
5073 * getndelim2.h, getndelim2.c: New files, from gnulib.
5074 * getdelim2.c, getdelim2.h: Remove.
5075 * Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
5076 getdelim2.h to getndelim2.c and getndelim2.h.
5078 2003-08-04 Paul Eggert <eggert@twinsun.com>
5080 * regex.c, regex.h: Sync with gnulib.
5082 2003-08-03 Paul Eggert <eggert@twinsun.com>
5084 * stdbool_.h (_Bool): Use a #define, not a typedef.
5086 2003-07-31 Paul Eggert <eggert@twinsun.com>
5088 * bumpalloc.h: Remove.
5089 * Makefile.am (libfetish_a_SOURCES): Remove bumpalloc.h.
5091 2003-07-28 Jim Meyering <jim@meyering.net>
5093 * stdbool_.h: Renamed from stdbool.hin.
5094 * Makefile.am: Reflect renaming: stdbool.hin -> stdbool_.h.
5095 * stdbool.hin: Remove file.
5097 2003-07-28 Paul Eggert <eggert@twinsun.com>
5099 * stdbool.hin (_Bool): Make it signed char, instead of
5100 an enum type, so that it's guaranteed to promote to int.
5102 2003-07-23 Jim Meyering <jim@meyering.net>
5104 * xstrndup.h: New file.
5105 * xstrndup.c: New file, factored out of dircolors.c from coreutils.
5106 * Makefile.am (libfetish_a_SOURCES): Add xstrndup.c and xstrndup.h.
5108 2003-07-23 Jim Meyering <jim@meyering.net>
5110 * lstat.c, save-cwd.c, stat.c, utime.c, xgethostname.c: Normalize
5111 naming of Sun operating systems in comments, e.g., SunOS4 -> SunOS 4,
5112 Solaris5.9 -> Solaris 9. From Paul Eggert.
5114 2003-07-22 Paul Eggert <eggert@twinsun.com>
5116 * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
5117 over-parenthesization in macros.
5119 2003-07-18 Paul Eggert <eggert@twinsun.com>
5121 * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
5122 * closeout.c: Likewise. Include "closeout.h" right after config.h,
5123 to test that it can stand by itself. Include "exitfail.h".
5124 Clients should set exit_failure instead.
5125 (EXIT_FAILURE): Remove; no longer needed. Do not include <stdlib.h>.
5127 2003-07-18 Andreas Schwab <schwab@suse.de>
5129 * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
5131 2003-07-17 Paul Eggert <eggert@twinsun.com>
5133 * xalloca.h, xmalloc.c, xmemcoll.c, xmemcoll.h:
5134 Merge with gnulib. Use a single exit_failure variable rather
5135 than a separate one for each module.
5137 2003-07-16 Jim Meyering <jim@meyering.net>
5139 * Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
5140 warning from automake -Wall.
5142 2003-07-14 Jim Meyering <jim@meyering.net>
5144 * save-cwd.h: Add copyright.
5146 2003-07-13 Jim Meyering <jim@meyering.net>
5148 * xgethostname.c: Include <stdlib.h> for declaration of free.
5149 (xgethostname): Return NULL, rather than exiting, upon any
5150 non-malloc/realloc error.
5152 2003-07-12 Jim Meyering <jim@meyering.net>
5154 * Makefile.am (BUILT_SOURCES): Use `BUILT_SOURCES += $(STDBOOL_H)'
5155 rather than `all-local: $(STDBOOL_H)'. The latter didn't force
5156 creation of stdbool.h before most other targets.
5157 Likewise for $(ALLOCA_H).
5159 Don't emit diagnostics. Let callers do that.
5160 * save-cwd.c: Don't include "error.h".
5161 (save_cwd): Don't call error. Ensure that errno is valid
5162 when returning nonzero.
5164 * obstack.h: Update from gnulib.
5166 * makepath.c (make_path): Enclose diagnostic in _(...).
5168 2003-07-10 Jim Meyering <jim@meyering.net>
5170 * userspec.c: Include "posixver.h".
5171 (parse_user_spec): Accept `.' as a separator only
5172 in pre-POSIX-200112 mode.
5174 * Makefile.am (libfetish_a_SOURCES): Add these:
5175 printf-args.h, printf-parse.h, vasprintf.h, vasnprintf.h.
5177 Now that a program (`who') uses asprintf, we need all of these:
5178 * asnprintf.c, asprintf.c, printf-args.c, printf-args.h, printf-parse.c:
5179 * printf-parse.h, vasnprintf.c, vasnprintf.h, vasprintf.c, vasprintf.h:
5180 New files, from gnulib.
5182 * alloca_.h, getpass.c, memrchr.c, obstack.h, posixver.c,
5183 strftime.c, strnlen.c, strverscmp.c: Switch from LGPL to GPL.
5185 2003-07-09 Jim Meyering <jim@meyering.net>
5187 * mktime.c: Update from gnulib.
5188 FIXME: but still need to adjust m4/mktime.c so that this fixed
5189 version is used when needed.
5191 Fix the bug that would make `du /' omit the `/' on the last line.
5192 E.g., `du --exclude '[^/]*' -x /' would print only "4\t\n" for me.
5193 * ftw.c (ftw_dir): Don't clobber the leading `/'.
5194 Reported by Chris Lesniewski as http://bugs.debian.org/200542.
5196 2003-07-04 Jim Meyering <jim@meyering.net>
5199 * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5200 having it depend on HAVE_SYS_TYPES_H.
5202 2003-06-18 Jim Meyering <jim@meyering.net>
5204 * inttostr.h (PARAMS): Remove. All uses removed.
5206 Merge in change from gnulib.
5207 * makepath.c: Remove block of alloca-related code in favor
5208 of an unconditional `#include <alloca.h>'.
5210 * xalloc.h: Include <stddef.h>.
5211 Remove unnecessary parentheses.
5212 Use `1990-2000' notation in Copyright line until Emacs'
5213 copyright-update function learns how to handle a comma-separated
5214 list of years that spans a line boundary.
5216 * Makefile.am (libfetish_a_SOURCES): Add getdelim2.c and getdelim2.h.
5218 * getline.c (getdelim2): Move this function into its own file.
5219 * getdelim2.c: Extracted from getline.c.
5221 * linebuffer.c, linebuffer.h: Update from gnulib.
5223 * getdelim2.c, getdelim2.h: New files.
5224 * getstr.c, getstr.h: Remove files.
5226 * same.h: Update from gnulib.
5227 * xstrtol.h: Update from gnulib.
5229 2003-06-17 Paul Eggert <eggert@twinsun.com>
5231 Assume C89, so PARAMS isn't needed.
5232 * backupfile.h (PARAMS): Remove. All uses removed.
5233 * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5234 group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5235 makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5236 path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5237 save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5238 unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5239 xstrtol.h: Likewise.
5240 * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h, same.h,
5241 * strverscmp.h: Do not include config.h; no longer needed.
5242 Anyway, config.h should always be included before any other file.
5244 2003-06-17 Jim Meyering <jim@meyering.net>
5246 * getline.c: Update from gnulib.
5248 Merge in changes from gnulib.
5249 * hash.c: Include <stdbool.h> unconditionally.
5251 (CHAR_BIT): Don't define.
5253 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
5255 * acl.c: Include <sys/types.h> before <sys/stat.h>.
5256 Required on Ultrix 4.3.
5258 2003-05-20 Derek Price <derek@ximbiot.com>
5260 * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5262 2003-06-10 Jim Meyering <jim@meyering.net>
5264 * getdate.y: Also accept dates of the form May-23-2003.
5265 Suggestion from Karl Berry.
5267 2003-06-09 Jim Meyering <jim@meyering.net>
5269 * gettimeofday.c: Also undefine gmtime.
5270 (rpl_gmtime): New function. Suggestion from Paul Eggert.
5272 2003-06-08 Jim Meyering <jim@meyering.net>
5274 * getline.h: Update from gnulib.
5276 Clean up, as part of merge with emacs version of strftime.c.
5277 * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
5278 Remove function, now that we can rely on a working tzset function.
5279 [!_LIBC]: Ensure that the required autoconf test has been run.
5280 * gettimeofday.c: Also undef tzset.
5281 (rpl_tzset): New function, for use by new macro, gl_FUNC_TZSET_CLOBBER.
5283 2003-06-07 Jim Meyering <jim@meyering.net>
5285 * readtokens.h: Add copyright notice.
5287 Remove definition and uses of __P.
5289 * readtokens.c: Put `Free Software Foundation, Inc.' in place of
5290 my name in the copyright comment.
5291 (init_tokenbuffer): Remove unnecessary parentheses around malloc.
5294 * getdate.y: Include alloca.h unconditionally.
5295 * xmemcoll.h: Include <stddef.h>.
5297 * Makefile.am (MOSTLYCLEANFILES): Add alloca.h and alloca.ht.
5298 (MOSTLYCLEANFILES): Add stdbool.ht.
5300 * human.c: Include <stdio.h>, once again, for declaration of sprintf.
5303 * tempname.c: Include <stddef.h> unconditionally.
5304 Include <inttypes.h> as an alternative to <stdint.h>.
5305 * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
5306 * xstrtol.h: Likewise.
5307 * xstrtoimax.c: Likewise.
5308 * xstrtoumax.c: Likewise.
5311 * strcasecmp.c: Include <stddef.h>, not <sys/types.h>.
5312 * savedir.c: Include <stddef.h>.
5313 (NULL): Don't define, since <stddef.h> does that.
5315 2003-06-06 Jim Meyering <jim@meyering.net>
5318 * rpmatch.c: Include <limits.h> without checking for HAVE_LIMITS_H.
5319 Include <stddefs.h> unconditionally.
5320 (NULL): Don't define, since <stddef.h> does that.
5321 * rename.c: #undef rename before defining rpl_rename.
5322 [HAVE_CONFIG_H]: Guard inclusion of config.h.
5323 * putenv.c: Include <stddef.h> rather than <sys/types.h>,
5324 as we merely need size_t.
5325 * realloc.c: Likewise.
5326 * quote.c: Don't include <stddef.h> or <sys/types.h>; not needed.
5327 * modechange.c: Include <stddef.h>.
5328 (NULL): Don't define, since <stddef.h> does that.
5329 * memcoll.h: Include <stddef.h>, to get size_t.
5330 * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5331 our interface, instead of including <sys/types.h>
5332 (memcoll): Fall back on a simple algorithm using
5333 memcmp if strcoll doesn't work.
5334 * memcasecmp.h: Include <stddef.h>.
5335 * memcasecmp.c: Don't include <sys/types.h>.
5338 * alloca_.h: New file.
5339 * Makefile.am (EXTRA_DIST): Add alloca_.h.
5340 (all-local $(lib_OBJECTS)): Depend on $(ALLOCA_H).
5341 (alloca.h): New rule.
5343 * addext.c: Update from gnulib.
5344 * backupfile.c: Likewise.
5345 * config.charset: Likewise.
5346 * dirname.h: Likewise.
5347 * fsusage.c: Likewise.
5348 * userspec.c: Likewise.
5349 * xreadlink.c: Likewise.
5350 * xstrtol.c: Likewise.
5351 * __fpending.h: Likewise.
5353 * md5.c: Include <string.h> and <stdlib.h> unconditionally.
5354 (memcpy): Remove definition.
5356 * posixtm.c: Include <stdbool.h> unconditionally.
5358 2003-06-05 Jim Meyering <jim@meyering.net>
5361 * mktime.c: Assume freestanding C89 or better.
5362 (HAVE_LIMITS_H): Remove. Assume it's 1.
5363 (__P): Remove; not used.
5364 (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5365 (mktime, not_equal_tm, print_tm, check_result,
5366 main): Use prototypes. Use const * where appropriate.
5367 (main): Fix typo in testing code that uncovered by above changes.
5368 (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5370 2003-06-04 Paul Eggert <eggert@twinsun.com>
5372 Merge human.c etc. from gnulib.
5373 * exclude.c, human.c, human.h: Merge from gnulib.
5374 * cycle-check.c, cycle-check.h, src/system.h:
5375 Include <stdbool.h> unconditionally.
5377 2003-06-02 Jim Meyering <jim@meyering.net>
5379 * stdbool.hin: New file. From gnulib.
5380 * Makefile.am (MOSTLYCLEANFILES): Initialize.
5381 (stdbool.h): New rule.
5382 (all-local $(lib_OBJECTS)): Depend on $(STDBOOL_H)
5383 (MOSTLYCLEANFILES): Add stdbool.h.
5384 (EXTRA_DIST): Add stdbool.h.
5386 2003-05-30 Jim Meyering <jim@meyering.net>
5388 * addext.c: Update from gnulib.
5389 * mktime.c: Likewise.
5391 2003-05-29 Jim Meyering <jim@meyering.net>
5393 Make the %r format directive honor any locale setting.
5394 * strftime.c: (my_strftime) [!defined _NL_CURRENT && HAVE_STRFTIME]:
5395 Use underlying_strftime for %r.
5397 2003-05-15 Jim Meyering <jim@meyering.net>
5399 * getopt.h: Remove a space before a TAB.
5401 2003-05-13 Jim Meyering <jim@meyering.net>
5403 * setenv.c (setenv): Don't apply cast to argument of free.
5404 * putenv.c (rpl_putenv): Likewise.
5405 * alloca.c (alloca): Likewise.
5407 2003-05-12 Jim Meyering <jim@meyering.net>
5409 * ftw.c (ftw_startup): Always call free_cwd after restore_cwd.
5410 Reported by Matti Aarnio as
5411 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=90563.
5412 Forwarded by Tim Waugh.
5414 * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
5415 the space-padded-by-default conversion specifiers, %e, %k, %l.
5417 2003-05-07 Paul Eggert <eggert@twinsun.com>
5419 * xnanosleep.c (timespec_subtract): Don't modify the 2nd arg.
5420 Work even if X-Y overflows when subtracting. Make explicit the
5421 assumption that tv_nsec must be in range.
5422 (clock_get_realtime): Remove. All callers changed to invoke gettime,
5424 (xnanosleep): Check for gettime failure every time.
5426 2003-05-06 Jim Meyering <jim@meyering.net>
5428 * xnanosleep.c (clock_get_realtime): Use gettime.c's gettime function,
5429 rather than an inferior, open-coded version that would fail on
5430 AIX systems due to clock_gettime failing with errno == ENOSYS.
5431 Reported by Jérôme Zago.
5433 2003-05-05 Jim Meyering <jim@meyering.net>
5435 Avoid array overrun.
5436 * ftw.c (nftw_arr): Update to reflect complete list of members.
5438 Reported by Olatunji Oluwabukunmi Ruwase.
5440 Make it less likely that the above can happen again.
5441 * ftw.c (struct dummy): Ensure that at least the number of
5442 initializers matches the number of members in the corresponding enum.
5443 * ftw_.h (enum Ftw_option): Name this previously-anonymous enum.
5444 (enum Ftw_option) [FTW_N_MEMBERS]: New member.
5446 2003-05-04 Jim Meyering <jim@meyering.net>
5448 * setenv.c (__set_errno, LOCK, UNLOCK): Define.
5449 (unsetenv): Update from GNU libc.
5450 Ifdef-out this function, since the only caller
5451 is putenv.c and that file now has its own copy.
5453 This avoids a core dump on systems without GNU putenv,
5454 when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5455 * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5456 (unsetenv): New static function, from GNU libc.
5457 (rpl_putenv): Use it.
5459 2003-05-02 Jim Meyering <jim@meyering.net>
5461 * canonicalize.c (canonicalize_file_name) [!HAVE_RESOLVEPATH]:
5462 A memory-allocation error could result in heap corruption. Fix it
5463 by also updating `dest' when rpath may be changed by xrealloc.
5465 2003-04-15 Jim Meyering <jim@meyering.net>
5467 * getloadavg.c: Remove (or replace-with-TAB(s) to retain alignment)
5468 each sequence of spaces before a TAB character.
5469 * md5.c, getopt.c, getopt.h, obstack.h, strftime.c: Likewise.
5471 2003-04-11 Jim Meyering <jim@meyering.net>
5473 * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5475 * canonicalize.c, exclude.c, getgroups.c, getusershell.c:
5476 * group-member.c, idcache.c, mountlist.c, readtokens.c, readutmp.c:
5477 * bumpalloc.h: Remove anachronistic casts of xmalloc, xrealloc,
5478 and xcalloc return values.
5480 * xalloc.h (PARAMS): Remove definitions and uses.
5481 (XMALLOC, XCALLOC, XREALLOC): Remove unnecessary casts.
5483 * xmalloc.c: Remove use of PARAMS.
5485 2003-04-10 Jim Meyering <jim@meyering.net>
5487 * canonicalize.c (canonicalize_file_name) [HAVE_RESOLVEPATH]: Remove
5488 stray semicolon that caused `readlink --canonical RELATIVE_NAME' to
5489 fail on e.g., Solaris systems. Reported by Bruce Korb.
5490 (canonicalize_file_name): Return NULL immediately if resolvepath fails.
5491 Otherwise, `readlink --canonical /no-such-file' would exhaust
5492 virtual memory on some systems (e.g. Solaris).
5493 (canonicalize_file_name): Always free `extra_buf' before returning.
5494 (canonicalize_file_name): NUL-terminate the result.
5496 2003-04-05 Jim Meyering <jim@meyering.net>
5498 * Makefile.am (DEFS): Use += notation rather than `DEFS = ... @DEFS@'.
5499 Use $(VAR) rather than @VAR@, now that we can rely on automake to
5500 emit a definition for each substituted variable.
5502 2003-03-26 Richard Dawe <rich@phekda.freeserve.co.uk>
5504 * dirname.c [TEST_DIRNAME]: Update build instructions for test.
5505 Add test-cases for DOS filenames. Declare program_name.
5506 (main): Set up program_name.
5508 2003-03-22 Jim Meyering <jim@meyering.net>
5510 * strftime.c (widen): Cast alloca return value to proper type.
5513 (NEW_PATTERN): Cast alloca return value to proper type.
5514 Otherwise, it wouldn't compile with at least /bin/cc on
5515 ymp-cray-unicos9.0.2.X.
5516 Combine two mostly-identical uses of alloca into one.
5517 Thanks to the Cray-Cyber project for access to a Cray Y-MP.
5519 2003-03-19 Jim Meyering <jim@meyering.net>
5521 DJGPP doesn't have S_ISLNK, so provide a replacement.
5522 * ftw.c (S_IFMT): Define, if necessary.
5523 [STAT_MACROS_BROKEN]: Undefine S_ISLNK.
5524 (S_ISLNK): Define, if necessary.
5525 Based on a patch from Rich Dawe.
5527 * exclude.h (PARAMS): Remove definition and uses.
5528 * exclude.c: Remove uses of `PARAMS'.
5530 * fnmatch_.h: Don't define __const.
5531 (fnmatch): Use const, not __const in prototype.
5534 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
5536 * fchdir-stub.c: New file: trivial stub for fchdir.
5538 2003-03-18 Jim Meyering <jim@meyering.net>
5540 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5542 Use mntctl's return value to drive the entry-processing loop, since
5543 we can't rely on the value of the vmt_length member in the last
5544 entry. On some systems doing so could result in exhausting
5545 virtual memory. Based in part on a patch from Mike Jetzer.
5547 * quote.c (quote_n): Fix typo in comment.
5549 2003-03-17 Jim Meyering <jim@meyering.net>
5551 * raise.c (raise): Rename from rpl_raise.
5552 Without that change, systems lacking raise (SunOS 4) would not be
5553 able to link programs using raise. Reported by Volker Borchert.
5555 * ftw.c (FTW_STAT): Rename from `STAT', to avoid conflict
5556 with STAT definition from <sys/dir.h> on AIX 5.1.
5557 Suggestion from Mike Jetzer and Petter Reinholdtsen.
5559 * fchown-stub.c (fchown): Put function type on its own line.
5560 * readlink-stub.c (readlink): Likewise.
5561 * lstat-stub.c (lstat): Likewise.
5563 2003-03-14 Jim Meyering <jim@meyering.net>
5565 * Makefile.am (AUTOMAKE_OPTIONS): Remove definition --
5566 before it pointed to ../src/ansi2knr. Some of these files
5567 have required an ANSI (c89) compiler for a year or two.
5568 (libfetish_a_SOURCES): Remove unused files: c-stack.c, c-stack.h.
5570 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
5572 * stat.c: Include "xalloc.h".
5574 2003-03-13 Paul Eggert <eggert@twinsun.com>
5576 Merge changes from Bison.
5577 * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
5578 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5579 when compiling Bison 1.875's `bitset bset = obstack_alloc
5580 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
5582 2003-01-30 Richard Dawe <rich@phekda.freeserve.co.uk>
5584 * fchown-stub.c: New file: trivial stub for fchown.
5585 * lstat-stub.c: New file: trivial stub for lstat.
5586 * readlink-stub.c: New file: trivial stub for readlink.
5588 2003-03-09 Paul Eggert <eggert@twinsun.com>
5590 * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
5591 Reported by Bruce Becker; see:
5592 http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
5594 2003-03-03 Paul Eggert <eggert@twinsun.com>
5595 Bruno Haible <bruno@clisp.org>
5597 * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
5598 Reported by John Hughes, see
5599 http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
5601 2003-03-09 Jim Meyering <jim@meyering.net>
5603 * ftw.c: Include "save-cwd.h".
5604 (ftw_startup): Avoid use of getcwd, if possible.
5605 Instead, use fopen/fchdir via save_cwd/restore_cwd.
5607 2003-03-08 Jim Meyering <jim@meyering.net>
5609 * xnanosleep.c: Don't use `defined' in a #define directive.
5611 2003-03-07 Jim Meyering <jim@meyering.net>
5613 * Makefile.am (libfetish_a_SOURCES): Remove mmap-stack.h.
5615 * mmap-stack.c, mmap-stack.h: Remove files.
5617 * getcwd.c: #undef getcwd only after *all* included header files.
5618 Declare getcwd unconditionally. The problem was that same.h
5619 included config.h, and that defined getcwd to rpl_getcwd a second
5620 time (after the original #undef), and led to the rpl_getcwd
5621 function calling itself endlessly. This was the cause of at least
5622 the `du' test failures on IRIX 6.5, reported by Nelson Beebe.
5624 * same.h (same_name): Remove unnecessary inclusion of config.h.
5625 It also happened to lead to infinite recursion in getcwd.c.
5626 (PARAMS): Remove definition and use.
5628 2003-03-06 Jim Meyering <jim@meyering.net>
5630 * ftw.c (ftw_startup): Declare `func' parameter to be of type
5631 NFTW_FUNC_T, not void* which may be smaller on 64-bit systems.
5632 Remove now-unnecessary cast.
5633 (FTW_NAME): Cast func argument to type `NFTW_FUNC_T'.
5635 2003-03-05 Jim Meyering <jim@meyering.net>
5637 * physmem.c (ARRAY_SIZE): Define it.
5639 2003-03-04 Jim Meyering <jim@meyering.net>
5641 * makepath.c (CLEANUP_CWD): Call error here, now that restore_cwd
5644 * save-cwd.h (restore_cwd): Update prototype.
5645 * save-cwd.c (restore_cwd): Remove two parameters.
5646 Simplify. Don't call error upon failure. Let callers do that.
5647 (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
5648 when auditing is enabled. But don't bother updating the #if.
5650 * xgetcwd.c (xgetcwd): Improve comment.
5652 * getcwd.c: New file.
5654 2003-02-28 Jim Meyering <jim@meyering.net>
5656 * ftw.c (ftw_startup): Return -1 if alloca fails.
5658 2003-02-28 Jim Meyering <jim@meyering.net>
5660 * fts.c (fts_children): If opening `.' fails, set the fts_child
5661 member to NULL before returning. From NetBSD.
5663 * fts.c (fts_children): If fchdir fails, close file descriptor
5664 before returning. From NetBSD.
5666 2003-02-27 Jim Meyering <jim@meyering.net>
5668 * physmem.c (physmem_total, physmem_available): Add comments.
5671 * physmem.c: Merge in portability changes from gcc/libiberty
5672 to support AIX, Tru64, and Windows. See the ChangeLog there
5673 for credits and details. Thanks to Kaveh Ghazi for helping
5674 to keep these files in sync.
5676 2003-02-24 Jim Meyering <jim@meyering.net>
5678 * fts_.h [__USE_FILE_OFFSET64]: Remove #error directive.
5680 (fts_open): Initialize local, tmp, to pacify gcc.
5682 * fts_.h [struct FTS] (fts_dir_signatures): New, opaque member.
5683 * fts.c: Include <search.h>.
5684 (struct known_object): Define.
5685 (object_compare, add_object, find_object): New functions, like
5687 (fts_open): Initialize new member.
5688 (fts_close): Free memory allocated for new member.
5689 (fts_stat): Detect a cycle in O(logN) time per directory processed.
5691 * fts.c [HAVE_CONFIG_H]: Include <config.h>.
5692 Conditionalize inclusion of <sys/param.h>.
5693 Conditionalize inclusion of <include/sys/stat.h> vs <sys/stat.h>.
5694 Include autoconf-recommended block of dirent/NAMELEN-related
5695 definitions and includes. Use NAMLEN throughout, rather than
5697 [_LIBC] (close, closedir, fchdir, open, opendir): Define.
5698 [_LIBC] (readdir, tdestroy, tfind, tsearch): Define.
5699 Remove `__' prefix from all uses of the above. This will help
5700 to merge *BSD changes.
5701 [!_LIBC] (internal_function): Define.
5702 [! _LIBC && ! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Define lstat.
5703 (__set_errno): Define if not already defined.
5705 * fts.c: (fts_open): If fts_alloc returns NULL, don't dereference it.
5706 (fts_read): If fts_safe_changedir fails because it is not
5707 able to chdir into a subdirectory, then inform the caller.
5709 * fts.c, fts_.h: New files, directly from glibc.
5711 2003-02-23 Jim Meyering <jim@meyering.net>
5713 * fts_.h (struct _ftsent) [fts_level]: Change type from short to int,
5714 so it can handle a root-relative file name longer than 32K bytes.
5715 [fts_pathlen, fts_namelen]: Rearrange members to decrease size of
5716 this struct from 84 to 80 bytes.
5718 2003-02-21 Jim Meyering <jim@meyering.net>
5720 * mmap-stack.h: Undefine HAVE_MMAP_STACK, thus disabling
5721 this code on all systems.
5723 Merge in some changes from GNU libc.
5724 * md5.h (md5_uintptr): Define.
5726 * ftw.c: Include <sys/types.h> before <dirent.h>.
5727 This is required for Apple Darwin 6.3 (MacOS 10.2.3).
5728 Patch by Nelson Beebe.
5730 2003-02-19 Jim Meyering <jim@meyering.net>
5732 * md5.c: Merge in some clean-up and optimization changes from glibc.
5733 * sha.c: Apply those same changes here, too.
5735 2003-02-18 Jim Meyering <jim@meyering.net>
5737 * md5.c (md5_stream) [BLOCKSIZE]: Move definition to top of file.
5738 Ensure that it is a multiple of 64.
5739 Rearrange loop exit tests so as to avoid performing an
5740 additional fread after encountering an error or EOF.
5741 * sha.c (sha_stream): Likewise.
5742 Reported by Michael Bacarella.
5744 * Makefile.am (CLEANFILES): Remove ftw.h and search.h.
5745 (DISTCLEANFILES): Add them here.
5748 * sha.c (sha_stream): Rearrange loop exit tests so as to avoid
5749 performing an additional fread after encountering an error or EOF.
5751 2003-02-17 Jim Meyering <jim@meyering.net>
5753 * mmap-stack.h (RUN_WITH_BIG_STACK_4): Define.
5755 * physmem.c: Undo most of last change.
5756 Use sysmp instead, since it provides a cleaner interface.
5759 2003-02-16 Jim Meyering <jim@meyering.net>
5761 * Makefile.am (libfetish_a_SOURCES): Add mmap-stack.h.
5763 * mmap-stack.c (MAP_ANONYMOUS): Use MAP_ANON, if possible.
5764 Initialize `fd' to -1, so Solaris' mmap works with MAP_ANON.
5766 2003-02-15 Jim Meyering <jim@meyering.net>
5768 * mmap-stack.c, mmap-stack.h: New files.
5769 Let the caller run a function with a larger (mmap'd) stack.
5771 Add Irix6 support to physmem.c.
5772 * physmem.c (irix_sysget): New function.
5773 (IRIX_SYSGET_TOTAL, IRIX_SYSGET_AVAILABLE): New macros.
5774 (physmem_total, physmem_available): Use them.
5775 (main) [DEBUG]: New function.
5777 2003-02-11 Jim Meyering <jim@meyering.net>
5779 * Makefile.am (libfetish_a_SOURCES): Add euidaccess.h.
5780 * euidaccess.c: Include "euidaccess.h".
5781 * euidaccess.h: New file.
5783 2003-02-08 Jim Meyering <jim@meyering.net>
5785 * ftw.c (ftw_startup): Don't shadow outer declaration of save_err.
5786 Merge inconsequential changes from libc.
5788 * ftw.c (ftw_startup): When using FTW_CHDIR, always remember
5789 the current directory, not just when DIR contains a slash.
5790 Reported by Manoj Srivastava via Michael Stone as Debian bug #180228.
5792 2003-02-07 Jim Meyering <jim@meyering.net>
5794 Merge inconsequential changes from libc.
5795 * ftw.c: Include limits.h earlier.
5796 Move PATH_MAX definition `down' a little; add comment.
5797 Rename local, saved_errno to save_err.
5799 2003-02-06 Jim Meyering <jim@meyering.net>
5801 Support for pruning.
5802 * ftw_.h (FTW_DPRE) [enum]: New member and definition.
5803 (struct FTW) [skip]: New member.
5805 * search_.h (__restrict): Define to `restrict' or to nothing.
5807 * fsusage.c: Remove declaration of statfs.
5808 It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5809 Reported by Nelson Beebe.
5811 2003-02-05 Jim Meyering <jim@meyering.net>
5813 Fix a heap-corruption bug that affected Solaris systems.
5814 * ftw.c: Include <limits.h>.
5815 (PATH_MAX): Define to 1024, if not already defined.
5816 (process_entry): Allocate enough space to hold the resulting
5817 file name. Don't presume that 2*dirbufsize is enough.
5818 (ftw_startup): Always use PATH_MAX to compute buffer size, now that
5819 it is guaranteed to be defined.
5820 Nelson Beebe reported that du would sometimes segfault on Solaris.
5822 * ftw.c (process_entry): When using FTW_DEPTH, call `func', the
5823 user-supplied callback, once for the current directory before calling
5824 ftw_dir, in case that part of the hierarchy should be pruned.
5825 `func' does that by setting `data->skip'.
5826 (ftw_startup): Likewise.
5828 2003-02-02 Jim Meyering <jim@meyering.net>
5830 * ftw.c (lstat) [!_LIBC && !LSTAT_FOLLOWS_SLASHED_SYMLINK]:
5831 Define to rpl_lstat.
5833 2003-01-25 Jim Meyering <jim@meyering.net>
5835 * ftw.c (ISSLASH, FILESYSTEM_PREFIX_LEN) [_LIBC]: Define.
5836 (base_name): New function.
5837 (ftw_startup): Don't strip trailing slashes.
5838 Use base_name to find the offset of the basename.
5840 2003-01-25 Jim Meyering <jim@meyering.net>
5842 * ftw.c (object_compare): Compare inode numbers before device numbers.
5843 The former is much more likely to differ for any two given file objects.
5845 2003-01-23 Jim Meyering <jim@meyering.net>
5847 * tsearch.c [HAVE_CONFIG_H]: Include <config.h>.
5848 Add autoconf-recommended block of alloca-related code.
5849 Cast each use of alloca to the required type, (node**).
5851 * ftw.c: Add autoconf-recommended block of alloca-related code.
5852 [!_LIBC] (__getcwd): Define to xgetcwd and declare xgetcwd.
5854 2003-01-22 Jim Meyering <jim@meyering.net>
5856 * ftw.c (find_object): Don't use c99-style struct initializer.
5858 * ftw_.h: Change all uses of __const to const.
5859 * search_.h: Likewise.
5861 * Makefile.am (CLEANFILES): Add generated files: ftw.h search.h.
5863 * ftw.c (process_entry): Handle FTW_DCHP.
5864 (ftw_dir): Handle FTW_DCH.
5866 * ftw_.h [!_LIBC && !__USE_XOPEN_EXTENDED]: Define __USE_XOPEN_EXTENDED
5867 and FTW_H_STANDALONE.
5868 [anon enum] (FTW_DCH, FTW_DCHP): New members.
5869 (FTW_DCH, FTW_DCHP): Define.
5871 * ftw.c: Include autoconf-recommended block of dirent/NAMELEN
5872 related definitions and includes. Use NAMELEN throughout,
5873 rather than _D_EXACT_NAMLEN.
5874 [_LIBC]: Define NAMELEN to _D_EXACT_NAMLEN.
5875 (stpcpy): Declare, if necessary.
5876 (mempcpy): Define, if necessary.
5877 [!_LIBC] (__stpcpy, __mempcpy): Define.
5878 [!_LIBC] (LXSTAT, XSTAT): Define.
5880 2003-01-21 Jim Meyering <jim@meyering.net>
5882 * tsearch.c: New file, from GNU libc.
5883 [! weak_alias]: Define __-prefixed names to publicized ones.
5884 [! defined _LIBC] (weak_alias, internal_function): Define-away.
5885 [defined weak_alias]: Guard each use of weak_alias.
5887 2003-01-20 Jim Meyering <jim@meyering.net>
5889 * canonicalize.c: Include "path-concat.h".
5891 * search_.h: New file, from GNU libc.
5893 * Makefile.am (libfetish_a_SOURCES): Use ftw_.h here, too.
5894 (libfetish_a_SOURCES): Add search_.h.
5895 * ftw_.h: Rename from ftw.h.
5897 * obstack.h (obstack_object_size): Declare temporary, __o,
5898 to be const, in order to avoid warnings.
5899 (obstack_room): Likewise.
5900 (obstack_empty_p): Likewise.
5902 Merge in changes from GNU libc
5903 * error.c: Eliminate many `#ifdef USE_IN_LIBIO' conditionals.
5905 2003-01-19 Ulrich Drepper <drepper@redhat.com>
5908 * strftime.c (my_strftime): Handle very large width
5909 specifications for numeric values correctly. Improve checks for
5912 2003-01-19 Jim Meyering <jim@meyering.net>
5914 * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
5915 (nl_get_alt_digit) [! defined my_strftime]: Define.
5916 (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
5917 _nl_get_alt_digit and _nl_get_walt_digit.
5919 * strftime.c (my_strftime): Merge in locale-related changes from libc.
5920 These changes have no effect outside of _LIBC.
5922 2003-01-14 Jim Meyering <jim@meyering.net>
5924 * same.c (same_name): Declare *_basename locals to be `const'.
5925 Consolidate declarations and initializations of *_base* locals.
5927 2003-01-11 Bruno Haible <bruno@clisp.org>
5929 * same.c (same_name): Reorder tests so as to avoid calling stat()
5930 when a string comparison is sufficient.
5932 2003-01-11 Bruno Haible <bruno@clisp.org>
5934 * readtokens.c (readtoken): Cast character to 'unsigned char', not
5937 2003-01-14 Jim Meyering <jim@meyering.net>
5939 * ftw.c: Merge in Ulrich's and my changes from libc.
5941 2003-01-12 Jim Meyering <jim@meyering.net>
5943 * ftw.c (ftw_startup): Rename local-shadowing local to pacify gcc.
5944 Also work on systems that have `struct direct', using autoconf's
5948 * ftw.h, ftw.c: New files, from glibc/io.
5950 * Makefile.am (libfetish_a_SOURCES): Add ftw.h.
5952 2003-01-11 Jim Meyering <jim@meyering.net>
5954 * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary.
5956 * canonicalize.c: Don't test HAVE_ERRNO_H. It's not necessary.
5957 Don't test HAVE_STDDEF_H. It's not necessary.
5958 Use definition of PTR_INT_TYPE from obstack.h.
5960 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
5962 * canonicalize.c: New file.
5963 The readlink-based implementation imported from GNU C Library.
5964 The resolveip-based implementation imported from src/df.c (show_point).
5965 * canonicalize.h: New file.
5966 * Makefile.am (libfetish_a_SOURCES): Add canonicalize.h.
5968 2003-01-10 Jim Meyering <jim@meyering.net>
5970 * save-cwd.h: Remove uses of PARAMS.
5972 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
5974 * xgetcwd.h: New file.
5975 * Makefile.am (libfetish_a_SOURCES): Add xgetcwd.h.
5976 * save-cwd.c: Include "xgetcwd.h".
5977 * xgetcwd.c: Likewise.
5979 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
5981 * getgroups.c: Don't declare functions declared by xalloc.h.
5982 Include "xalloc.h" instead.
5983 * group-member.c: Likewise.
5984 * idcache.c: Likewise.
5985 * readutmp.c: Likewise.
5987 2003-01-08 Jim Meyering <jim@meyering.net>
5989 * full-write.c: Undefine and define-away `const' after inclusion
5990 of errno.h, not before. Suggestion from Bruno Haible.
5992 2003-01-06 Jim Meyering <jim@meyering.net>
5994 * full-write.c: Rework so that it may serve to define full_read, too.
5995 * full-read.c: Simply #define FULL_READ and include full-write.c.
5997 * Makefile.am (libfetish_a_SOURCES): Add full-read.c and full-read.h.
5998 * full-read.c, full-read.h: New files.
6002 2002-12-10 Paul Eggert <eggert@twinsun.com>
6003 Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
6004 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
6005 Choose values that are less likely to collide with system fnmatch
6007 * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
6008 defined (e.g., a pure POSIX system).
6009 (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
6010 instead of FNM_FILE_NAME, for compatibility with pure POSIX systems.
6014 * utime.c (utime_null): Use SAFE_READ_ERROR.
6015 (utime_null): No need to call ftruncate if the file was nonempty.
6016 * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
6017 * canon-host.c (strdup): Remove unused declaration.
6018 * fsusage.c: Include full_read.h.
6019 (get_fs_usage): Use full_read instead of safe_read.
6020 Patches by Bruno Haible.
6022 2003-01-04 Jim Meyering <jim@meyering.net>
6024 * version-etc.c: Update copyright date.
6026 2002-12-31 Jim Meyering <meyering@lucent.com>
6028 * dev-ino.h: New file.
6029 * cycle-check.c: New file.
6030 * cycle-check.h: New file.
6031 * Makefile.am (libfetish_a_SOURCES): Add cycle-check.c, cycle-check.h,
6034 2002-12-21 Jim Meyering <jim@meyering.net>
6036 * stime.c: Remove file (for real, this time).
6038 2002-12-15 Jim Meyering <jim@meyering.net>
6040 * strftime.h: New file, for declaration of nstrftime.
6041 * Makefile.am (libfetish_a_SOURCES): Add strftime.h.
6043 2002-12-09 Jim Meyering <jim@meyering.net>
6045 * unlocked-io.h: Sync from gnulib.
6047 2002-12-06 Jim Meyering <jim@meyering.net>
6049 * unlocked-io.h: New file, but with proper copyright notice and
6050 attribution. Note: this is *not* the same as the file in gnulib.
6051 This uses #if HAVE_FUNC_UNLOCKED for each `FUNC', rather than
6052 HAVE_DECL_FUNC_UNLOCKED. This usage is consistent with the autoconf
6053 macro in ../m4/jm-glibc-io.m4. Modulo comments, this file still
6054 contains exactly what was generated by gen-uio.
6056 2002-12-04 Paul Eggert <eggert@twinsun.com>
6058 Do not generate unlocked-io.h automatically, since it's easier to
6059 maintain it by hand.
6062 * Makefile.am: Add copyright notice.
6063 (libfetish_a_SOURCES): Add unlocked-io.h.
6064 (BUILT_SOURCES, all-local): Remove unlocked-io.h.
6065 (DISTCLEANFILES, io_functions): Remove macros.
6066 (EXTRA_DIST): Remove gen_uio.
6067 (unlocked-io.h): Remove rule.
6069 2002-12-05 Paul Eggert <eggert@twinsun.com>
6071 * alloca.c [defined emacs]: Include "lisp.h".
6072 (xalloc_die) [defined emacs]: New macro.
6073 (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
6074 [! defined emacs]: Include <xalloc.h>.
6075 (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
6076 (pointer): Typedef to POINTER_TYPE *.
6077 (malloc): Remove decl; we now always use xmalloc.
6078 (alloca): Use old-style definition, since Emacs needs this.
6079 Check for arithmetic overflow when computing combined size.
6081 2002-12-04 Jim Meyering <jim@meyering.net>
6083 Reflect the fact that stat.c and lstat.c are no longer generated.
6084 * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
6085 (DISTCLEANFILES): Likewise.
6086 (EXTRA_DIST): Likewise.
6087 (all_local): Don't depend on stat.c or lstat.c.
6088 (stat.c, lstat.c): Remove rules.
6089 (EXTRA_DIST): Remove xstat.in.
6091 * xstat.in: Remove file. Contents moved into stat.c.
6092 * stat.c: Rework so that it may serve to define rpl_lstat, too.
6093 * lstat.c: Simply #define LSTAT and include stat.c.
6095 * safe-read.c: Rework so that it may serve to define safe_write, too.
6096 * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
6098 2002-12-03 Jim Meyering <jim@meyering.net>
6100 * safe-read.h: Update from gnulib (add comments, include stddef.h).
6102 2002-12-02 Jim Meyering <jim@meyering.net>
6104 * safe-read.c (EINTR): Define.
6105 (safe_read): Rewrite to iterate IFF the read fails with EINTR.
6107 2002-12-01 Jim Meyering <jim@meyering.net>
6109 * safe-read.c: Merge from gnulib.
6110 (safe_read): Also exit the loop when read returns zero.
6111 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
6113 * Makefile.am (libfetish_a_SOURCES): Add safe-write.c and safe-write.h.
6115 * strtoll.c: Update from gnulib (trivial changes).
6116 * strdup.c: Likewise.
6117 * strpbrk.c: Likewise.
6118 * strstr.c: Likewise.
6119 * tempname.c: Likewise.
6120 * obstack.c: Likewise.
6121 * getopt.c: Likewise.
6122 * getopt1.c: Likewise.
6123 * getopt.h: Likewise.
6124 * quote.h: Update from gnulib: add Copyright comment.
6125 * quote.c: Likewise.
6127 2002-11-28 Jim Meyering <jim@meyering.net>
6129 * mktime.c: Merge from gnulib/libc, for a slightly uglier solution.
6131 Merge some more, in preparation for merge back into libc.
6132 * error.c (_): Define only if not already defined.
6133 Move definition to follow all #include directives.
6134 Include unlocked-io.h only if !_LIBC.
6136 Merge in changes from libc.
6137 * error.c [_LIBC]: Include <libio/libioP.h>.
6138 [USE_IN_LIBIO]: Include <libio/iolibio.h>
6139 (fflush): Tweak definition to use INTUSE.
6142 2002-11-23 Jim Meyering <jim@meyering.net>
6144 From gnulib, by Bruno Haible
6145 * closeout.c: Include gettext.h instead of <libintl.h>.
6146 * makepath.c: Likewise.
6147 * rpmatch.c: Likewise.
6148 * userspec.c: Likewise.
6149 * version-etc.c: Likewise.
6150 * xmemcoll.c: Likewise.
6151 * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6153 * mbswidth.h: Update from gnulib.
6154 * mbswidth.c: Likewise.
6155 * localcharset.c: Likewise.
6156 * config.charset: Likewise.
6157 * unicodeio.c: Likewise.
6159 2002-11-22 Paul Eggert <eggert@twinsun.com>
6161 * quotearg.h: Allow multiple inclusion by surrounding with
6162 "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
6163 so that we can be included first.
6164 (PARAMS): Remove; we now assume C89 or later. All uses removed.
6165 * quotearg.c: Include quotearg.h immediately after config.h.
6166 No need to include stddef.h or sys/types.h any more.
6167 Surround local include files with "", not "<>".
6168 Assume HAVE_LIMITS_H unconditionally, as we assume C89.
6169 Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
6170 HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
6171 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
6172 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
6173 (ISPRINT): Remove; no longer needed now that we assume C89.
6175 (clone_quoting_options, quotearg_buffer, quotearg_n_options):
6178 (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
6179 quotearg_char): Use SIZE_MAX rather than
6180 (size_t) -1 when we are talking about "infinity".
6182 (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
6184 2002-11-22 Jim Meyering <jim@meyering.net>
6187 * strstr.c: Don't include <sys/types.h>. It's unnecessary.
6189 2002-11-21 Bruno Haible <bruno@clisp.org>
6191 Remove case insensitive option matching.
6192 * argmatch.h (argcasematch): Remove declaration.
6193 (ARGCASEMATCH): Remove macro.
6194 (__xargmatch_internal): Remove case_sensitive argument.
6195 (XARGMATCH): Update.
6196 (XARGCASEMATCH): Remove macro.
6197 * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
6198 case_sensitive argument.
6199 (argcasematch): Remove function.
6200 (__xargmatch_internal): Remove case_sensitive argument.
6201 (main): Use XARGMATCH instead of XARGCASEMATCH.
6203 * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6205 2002-11-21 Bruno Haible <bruno@clisp.org>
6207 * xmalloc.c: Change compile-time error message. Add comment about
6208 required autoconf version.
6209 * xmalloc.c: Include gettext.h instead of <libintl.h>.
6210 (textdomain): Remove definition.
6212 2002-11-21 Jim Meyering <jim@meyering.net>
6214 * strdup.c (strdup): Merge in changes from gnulib; mainly to
6215 use memcpy rather than strcpy.
6217 * strcspn.c: Update from gnulib.
6219 * sig2str.c (str2signum): Use unsigned, not size_t, for type of index.
6221 * quotearg.c: Use `"'s when including quotearg.h and xalloc.h,
6222 not the `<...>' notation.
6223 Include <errno.h> and declare errno if necessary.
6225 * README: Update from gnulib.
6227 2002-11-20 Paul Eggert <eggert@twinsun.com>
6229 Merge argmatch cleanups from Bison. Assume C89.
6231 * argmatch.c: Include config.h here, not in argmatch.h.
6232 Include stdlib.h, for EXIT_FAILURE.
6233 Always include <string.h>, since we assume C89.
6234 (EXIT_FAILURE): Remove pre-C89 bug workaround.
6235 * argmatch.h: Do not include <config.h> or <sys/types.h>.
6236 Include <stddef.h> instead, since it's all we need for size_t.
6237 (PARAMS): Remove. All uses removed.
6238 (ARRAY_CARDINALITY): Do not bother to #undef.
6239 (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
6240 ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6241 Remove unnecessary parentheses.
6242 (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6243 Insert necessary parentheses.
6244 (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
6245 (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
6247 2002-11-19 Jim Meyering <jim@meyering.net>
6249 Be careful not to clobber errno.
6250 * quotearg.c (quotearg_buffer_restyled): If mbrtowc returns
6251 `(size_t) -1' (at which point it would also set errno to EILSEQ),
6252 then restore errno to its previous value.
6253 Reported by Phillip Jones via Tim Waugh as
6254 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76334.
6256 Avoid a link-time failure on some Linux systems.
6257 * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
6258 (__mon_yday): Declare with the STATIC attribute.
6259 (__mktime_internal): Likewise.
6260 Based on a report from Greg Schafer.
6262 2002-11-14 Jim Meyering <jim@meyering.net>
6264 * long-options.c: Don't include libintl.h, and don't define `_' --
6268 2002-11-10 Jim Meyering <jim@meyering.net>
6270 * raise.c: New file.
6272 2002-11-08 Paul Eggert <eggert@twinsun.com>
6274 * human.c (human_readable): Revamp to avoid warning about unused
6275 variable 'amt'. Unfortunately this means using some gotos.
6277 2002-11-08 Jim Meyering <jim@meyering.net>
6279 * human.c (human_readable): Avoid warnings from gcc -Wshadow.
6281 2002-11-06 Jim Meyering <jim@meyering.net>
6283 * Makefile.am (EXTRA_DIST): Add inttostr.h.
6285 2002-10-07 Paul Eggert <eggert@twinsun.com>
6287 * Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
6289 (EXTRA_DIST): Add inttostr.c.
6290 * inttostr.c, inttostr.h, imaxtostr.c, offtostr.c, umaxtostr.c:
6291 New files, taken from GNU tar.
6293 * human.c, human.h: Rewrite to support locale-specific
6294 notations like thousands separators.
6295 Specify what includer of include.h must include beforehand.
6296 (human_group_digits, human_suppress_point_zero, human_autoscale,
6297 human_base_1024, human_SI, human_B): New enum values.
6298 (human_readable): Rename from human_readable_inexact; put the
6299 options before the sizes. All uses changed. The old human_readable
6300 function has been removed; use inttostr.h instead.
6301 (human_options): Renamed from human_block_size, with new signature
6302 that allows block sizes up to UINTMAX_MAX. All callers changed.
6304 2002-10-13 Jim Meyering <jim@meyering.net>
6306 * xnanosleep.c (initialized): Remove declaration now that it's unused.
6308 2002-10-12 Paul Eggert <eggert@twinsun.com>
6310 * xnanosleep.c: There's no need to futz with the rounding mode,
6311 since the code should work properly even in the default rounding mode.
6312 (<fenv.h>): Do not include.
6313 (#pragma STDC FENV_ACCESS ON): Remove.
6314 (xnanosleep): Don't futz with rounding state.
6316 2002-10-06 Jim Meyering <jim@meyering.net>
6318 * safe-read.c (safe_read): Change type of function
6319 from ssize_t to size_t.
6320 * safe-read.h: Update prototype.
6321 (SAFE_READ_ERROR): Define.
6323 2002-09-28 Jim Meyering <jim@meyering.net>
6325 * makepath.c (make_path): Restore umask *before* creating the final
6328 2002-09-25 Paul Eggert <eggert@twinsun.com>
6330 * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
6331 (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
6332 (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
6333 int. Work more efficiently if X is the same width as uintmax_t.
6334 Do not compare X to -1, to avoid bogus compiler warning.
6335 (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
6336 Don't assume that f_frsize and f_bsize are the same type.
6338 2002-09-25 Jim Meyering <jim@meyering.net>
6340 * fsusage.c: Remove unneeded parentheses around operands of `defined'.
6342 * safe-read.c (safe_read): Make comment more precise:
6343 upon error, it returns -1.
6345 2002-09-22 Jim Meyering <jim@meyering.net>
6347 * makepath.c (make_path): Minor reformatting.
6349 2002-09-14 Paul Eggert <eggert@twinsun.com>
6351 * xnanosleep (xnanosleep): Return -1 on failure, not 1,
6352 for consistency with nanosleep. Check errno after nanosleep
6355 2002-09-11 Jim Meyering <jim@meyering.net>
6357 * xnanosleep.c, xnanosleep.h: New files, factored out of sleep.c.
6358 * Makefile.am (libfetish_a_SOURCES): Add them.
6360 2002-09-04 Jim Meyering <jim@meyering.net>
6362 * addext.c (addext): Add a cast to avoid gcc's warning about
6363 `comparison between signed and unsigned'.
6365 * sig2str.c (str2signum, sig2str): Declare loop index variables to be
6366 of type size_t so that they match type of upper bound, thus avoiding
6367 warning about `comparison between signed and unsigned'.
6369 2002-08-31 Jim Meyering <jim@meyering.net>
6371 * mktime.c: Update from GNU libc.
6372 * obstack.c: Likewise.
6373 * getopt.c: Likewise.
6374 * getopt1.c: Likewise.
6376 2002-08-05 Paul Eggert <eggert@twinsun.com>
6378 Fix some minor time-related bugs with POSIX time arguments.
6379 Some valid time stamps were being rejected (notably -1, and
6380 time stamps before 1900 on 64-bit hosts). And some invalid
6381 time stamps were being accepted, e.g. September 31.
6383 * posixtm.h (posixtime): Return bool instead of time_t, so
6384 that we can return (time_t) -1 successfully.
6385 * posixtm.c: Likewise.
6386 [HAVE_STDBOOL_H]: Include <stdbool.h>.
6387 (bool, false, true) [!HAVE_STDBOOL_H]: New type.
6388 (t): Remove static var.
6389 (year, posix_time_parse): Now takes struct tm * arg to modify, instead
6390 of static var. All uses changed.
6391 (year): Do not reject years before 1900; they can occur with
6393 (posix_time_parse): Do not check for out-of-range components;
6394 that is now the caller's responsibility, since our checks were
6395 only approximations.
6396 (posixtime): Use mktime to check for out-of-range components,
6397 since it knows them exactly.
6398 If mktime returns (time_t) -1, check whether an error actually occurred
6399 by invoking localtime on -1.
6400 (main) [TEST_POSIXTIME]: Check for input data errors, and report
6401 posixtime failures better.
6402 Improve the test data (in comments only).
6404 2002-07-27 Jim Meyering <jim@meyering.net>
6406 * readutmp.h: If we have both utmpx.h and utmp.h, and there exists
6407 the utmp.ut_exit member, but not the utmpx.ut_exit member, then
6408 undefine HAVE_UTMPX_H. For AIX 4.3.3. Doing all this in cpp is
6409 a big kludge; someday we'll put the brains in an autoconf macro.
6410 (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6412 2002-07-20 Jim Meyering <jim@meyering.net>
6414 * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
6415 and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
6417 * gettext.h: Upgrade to gettext-0.11.3.
6419 2002-07-13 Bruno Haible <bruno@clisp.org>
6421 * xstat.in: Include <string.h>.
6422 * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
6425 2002-07-09 Jim Meyering <jim@meyering.net>
6427 * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
6428 ones. At least on GNU/Linux systems, `auto' means something else.
6431 2002-07-01 Jim Meyering <jim@meyering.net>
6433 * c-stack.c: Include sys/time.h.
6434 From Volker Borchert.
6436 2002-06-11 Paul Eggert <eggert@twinsun.com>
6438 * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6439 New macro. Use it uniformly instead of
6440 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6441 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6442 reported by Vin Shelton.
6444 2002-06-22 Jim Meyering <jim@meyering.net>
6446 * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6447 redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6449 2002-06-22 Paul Eggert <eggert@twinsun.com>
6451 * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6452 Do not assume SA_SIGINFO behavior.
6453 Bug reported by Jim Meyering on NetBSD 1.5.2.
6455 2002-06-22 Jim Meyering <jim@meyering.net>
6457 * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6459 * exitfail.c, exitfail.h: Likewise.
6460 * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6462 * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6464 (EXTRA_DIST): Add fnmatch_loop.c.
6465 (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6467 * fnmatch_loop.c: New file, from diffutils-2.8.2.
6468 * fnmatch.c: Update from diffutils-2.8.2.
6469 * fnmatch_.h: New file. From diffutils-2.8.2.
6470 * fnmatch.h: Remove file.
6472 2002-06-18 Paul Eggert <eggert@twinsun.com>
6474 * file-type.h: Report an error if neither S_ISREG nor
6475 S_IFREG is defined, instead of using a test specific to glibc
6476 2.2. This should be safe, since POSIX requires S_ISREG and
6477 Unix Version 7 had S_IFREG. We don't need to check for
6478 <sys/types.h> since we don't use any symbols that it defines.
6480 2002-06-15 Jim Meyering <jim@meyering.net>
6482 * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6483 For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6484 have been included before this file.
6486 2002-06-13 Richard Dawe <richdawe@bigfoot.com>
6488 * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6489 so that each temporary file name is unique and valid in the first
6490 8 characters, for operation under DOS.
6492 2002-06-15 Jim Meyering <jim@meyering.net>
6494 Work even with DJGPP 2.03, which lacks support for symlinks.
6496 * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6498 * lchown.c (S_ISLNK): Likewise.
6500 2002-06-14 Jim Meyering <jim@meyering.net>
6502 * file-type.h: Use the version from diffutils-2.8.2.
6503 * file-type.c: Likewise.
6505 2002-05-27 Jim Meyering <jim@meyering.net>
6507 Fix a problem seen only on nonconforming systems whereby ls.c's
6508 use of localtime, and then of gettimeofday would cause trouble:
6509 the localtime call used to initialize rpl_gettimeofday's save
6510 mechanism would clobber ls's current local time information so
6511 that in any long listing the first file would always be listed
6512 with date 1970-01-01. Analysis by Volker Borchert.
6514 * gettimeofday.c (localtime): Undefine.
6515 (rpl_localtime): New function.
6517 2002-05-22 Jim Meyering <jim@meyering.net>
6519 * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6520 * file-type.h: New file.
6521 * file-type.c (file_type): New file/function. Extracted from diffutils.
6523 2002-04-29 Paul Eggert <eggert@twinsun.com>
6525 * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6527 2002-04-28 Paul Eggert <eggert@twinsun.com>
6529 * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6530 depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
6531 of 127, since 64 is the largest conceivable number for ancient
6533 * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6535 2002-04-28 Jim Meyering <jim@meyering.net>
6537 * sig2str.c (WTERMSIG): Remove definition (unused).
6539 2002-04-28 Paul Eggert <eggert@twinsun.com>
6541 * sig2str.h, sig2str.c: New files.
6542 * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6544 2002-04-24 Jim Meyering <jim@meyering.net>
6546 * gettext.h: New file, from Gettext.
6547 * Makefile.am (INCLUDES): Remove -I../intl.
6548 (libfetish_a_SOURCES): Add gettext.h.
6550 2002-04-16 Jim Meyering <jim@meyering.net>
6552 * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6553 (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6554 (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6556 2002-04-12 Jim Meyering <jim@meyering.net>
6558 * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6560 2002-03-10 Jim Meyering <jim@meyering.net>
6562 * makepath.c (make_path): Remove a comma from a diagnostic.
6563 Suggestion from Santiago Vila.
6565 2002-03-08 Jim Meyering <jim@meyering.net>
6567 * rename.c: Mention that this wrapper is needed also on
6568 mips-dec-ultrix4.4 systems.
6570 2002-03-02 Jim Meyering <jim@meyering.net>
6572 * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6573 not HAVE_CLOCK_SETTIME.
6575 2002-02-27 Paul Eggert <eggert@twinsun.com>
6577 * nanosleep.h: Rename to....
6578 * timespec.h: New name for nanosleep.h. All uses changed.
6580 * gettime.c: New file.
6581 * settime.c: New file.
6584 * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6585 timespec.h. Remove nanosleep.h.
6587 2002-02-25 Paul Eggert <eggert@twinsun.com>
6589 * acl.c, acl.h: New files.
6590 * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6592 2002-02-24 Jim Meyering <jim@meyering.net>
6594 * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6595 prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6596 cause trouble. Reported by Nelson Beebe.
6598 2002-02-23 Paul Eggert <eggert@twinsun.com>
6600 * path-concat.c (xpath_concat): Reorder code to pacify
6601 compilers that don't know that xalloc_die never returns.
6603 2002-02-20 Jim Meyering <jim@meyering.net>
6605 * getdate.c: Regenerate using bison-1.33.
6607 2002-02-15 Paul Eggert <eggert@twinsun.com>
6609 * posixver.c, posixver.h: New files.
6610 * Makefile.am (libfetish_a_SOURCES): Add them.
6612 2002-02-02 Paul Eggert <eggert@twinsun.com>
6613 Bruno Haible <bruno@clisp.org>
6615 * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6616 (fwrite_success_callback): New declaration.
6617 * unicodeio.c (unicode_to_mb): New function, extracted from
6618 print_unicode_char. Call failure callback instead of error.
6619 (fwrite_success_callback): New function.
6620 (exit_failure_callback): New function.
6621 (fallback_failure_callback): New function.
6622 (print_unicode_char): Call unicode_to_mb.
6624 2002-01-26 Jim Meyering <jim@meyering.net>
6626 * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6628 2002-01-22 Jim Meyering <jim@meyering.net>
6630 * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6631 Otherwise, some versions of automake would omit the rule that makes
6632 Makefile from Makefile.in.
6634 2001-01-21 Paul Eggert <eggert@twinsun.com>
6636 * xmemcoll.h, xmemcoll.c: New files.
6637 * Makefile.am (libfetish_a_SOURCES): Add them.
6638 * memcoll.c: Include errno.h, and declare errno if not defined.
6639 (memcoll): Set errno to zero if there is no error.
6641 * quotearg.c (quotearg_buffer_restyled):
6642 Fix bug with quoting buffers containing NUL when backslashing escapes.
6643 This bug was exposed by the other changes in this patch.
6644 (quotearg_n_options): New arg ARGSIZE.
6645 All callers changed.
6646 (quoting_options_from_style): New function.
6647 (quotearg_n_style): Use it.
6648 (quotearg_n_style_mem): New function.
6650 * quotearg.h (quotearg_n_style_mem): New function.
6652 2002-01-16 Jim Meyering <jim@meyering.net>
6654 * getdate.y: Add three semicolons, each just before a closing brace.
6655 Bison (as of version 1.31) no longer papers over that mistake.
6657 2002-02-14 Paul Eggert <eggert@twinsun.com>
6659 * backupfile.c (ISDIGIT): Comment fix.
6660 * getdate.y (ISDIGIT): Likewise.
6661 * posixtm.c (ISDIGIT, year): Likewise.
6662 * strverscmp.c (ISDIGIT): Likewise.
6663 * userspec.c (ISDIGIT): Likewise.
6665 2002-01-05 Jim Meyering <jim@meyering.net>
6667 * version-etc.c (version_etc_copyright): Update copyright year.
6669 2001-01-19 Paul Eggert <eggert@twinsun.com>
6671 * closeout.c (close_stdout_status): If ferror (stdout), do
6672 not silently exit merely because the output buffer happens to
6673 have nothing pending.
6675 2001-12-18 Paul Eggert <eggert@twinsun.com>
6677 See the big note in ../ChangeLog.
6678 * human.c (suffixes): Prefer K to k for 1024.
6679 (generate_suffix_backwards): New function.
6680 (human_readable_inexact): Use it.
6681 * xstrtol.c (__xstrtol): If there is no number but there
6682 is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
6683 Accept 'K' as well as 'k'.
6685 2001-12-15 Jim Meyering <jim@meyering.net>
6687 * regex.h (__restrict_arr): Update from libc.
6689 * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
6690 as `remote' if the name starts with `//'. Suggested by Michael Stone.
6693 2001-12-10 Jim Meyering <jim@meyering.net>
6695 * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
6696 Instead, include "xalloc.h".
6697 (initbuffer): Don't cast xmalloc return value to char*.
6698 (readline): Reword comment.
6699 Don't cast xrealloc return value to char*
6702 2001-12-09 Jim Meyering <jim@meyering.net>
6704 * modechange.c (mode_compile): Add cast to avoid pedantic warning about
6705 `signed and unsigned type in conditional expression'.
6706 * posixtm.c (posix_time_parse): Likewise.
6708 * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
6710 * readtokens.c (readtoken): Declare an index to be of type unsigned
6711 to avoid a pedantic warning.
6713 * getstr.c: Don't include assert.h.
6714 (getstr): Remove warning-evoking assertions.
6715 Return -1 if offset parameter is out of bounds.
6716 Change the type of a local from int to size_t.
6718 * strftime.c (my_strftime_localtime_r): Include this function
6719 definition in the `#if ! HAVE_TM_GMTOFF' block.
6721 * xgethostname.c: Remove declarations of xmalloc and xrealloc.
6722 Include xalloc.h instead.
6724 2001-12-02 Jim Meyering <jim@meyering.net>
6726 * tempname.c: Don't declare getenv, thus reverting the change of
6727 2001-11-18. It's no longer necessary, now that stdlib.h is always
6730 * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
6731 __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld.
6733 2001-11-30 Akim Demaille <akim@epita.fr>
6735 * xstrdup.c: Include xalloc.h, so that xstrdup is declared
6736 before being defined.
6738 2001-11-27 Paul Eggert <eggert@twinsun.com>
6740 * quotearg.h (quotearg_n, quotearg_n_style):
6741 First arg is int, not unsigned.
6742 * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
6743 (SIZE_MAX, UINT_MAX): New macros.
6744 (quotearg_n_options): Abort if N is negative.
6745 Avoid overflow check on hosts where size_t is 64 bits and int
6746 is 32 bits, as overflow is impossible there.
6747 Fix off-by-one typo that caused unnecessary reallocation.
6749 2001-11-27 Jim Meyering <jim@meyering.net>
6751 * tempname.c: Merge with version from libc.
6752 * regex.c: Likewise.
6754 * tempname.c: Include stdlib.h unconditionally. On some old systems
6755 for which STDC_HEADERS is 0, it was not included, resulting in a
6756 warning about an integer-to-pointer conversion problem with getenv.
6757 Reported by Volker Borchert.
6759 2001-11-26 Jim Meyering <jim@meyering.net>
6761 * gtod.h: Remove file.
6762 * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
6763 * gettimeofday.c: Don't include gtod.h.
6764 (GTOD_init): Remove function.
6765 (rpl_gettimeofday): Do its job here instead, rather than aborting.
6766 Suggestion from Volker Borchert.
6768 2001-11-23 Jim Meyering <jim@meyering.net>
6770 * hash.h (struct hash_table): Don't define here. Merely declare it.
6771 * hash.c (struct hash_table): Define it here instead.
6773 2001-11-22 Jim Meyering <jim@meyering.net>
6775 * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
6777 2001-11-18 Paul Eggert <eggert@twinsun.com>
6779 * tempname.c (TMP_MAX): Remove; no longer needed.
6780 (TEMPORARIES): New macro.
6781 (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
6782 removes an artificial limitation (e.g. HP-UX 10.20, where
6785 2001-11-18 Jim Meyering <jim@meyering.net>
6787 * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
6790 * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
6791 files will be created before anything else.
6793 2001-11-17 Jim Meyering <jim@meyering.net>
6795 * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
6796 that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
6797 rather than group writable. Patch by Juan F. Codagnone.
6799 * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
6800 Instead, include "xalloc.h".
6802 * mountlist.c: Include unlocked-io.h after all system headers.
6803 Remove explicit declarations of xmalloc, xrealloc,
6804 and xstrdup. Instead, include "xalloc.h".
6806 * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
6807 * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
6808 * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
6810 * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
6811 Reported by Padraig Brady.
6813 * mkstemp.c: #undef mkstemp.
6815 (rpl_mkstemp): Rename from mkstemp.
6818 2001-11-16 Jim Meyering <jim@meyering.net>
6820 * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
6821 (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
6822 determine the amount of total physical memory, use pstat_getstatic.
6823 HPUX-11 doesn't define _SC_PHYS_PAGES.
6824 (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
6825 If sysconf couldn't be used to determine the amount of available
6826 physical memory, use both pstat_getstatic and pstat_getdynamic.
6827 Based on a patch from Bob Proulx.
6829 2001-11-05 Jim Meyering <jim@meyering.net>
6831 * xstat.in (slash_aware_lstat): Correct a misleading comment.
6833 2001-11-03 Jim Meyering <jim@meyering.net>
6835 * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
6836 in argmatch_to_argument call.
6838 * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
6841 * hash.c (hash_clear): Fix a bug that could lead to an infloop or
6842 e.g., a fault due to an attempt to free a NULL pointer.
6844 2001-11-01 Jim Meyering <jim@meyering.net>
6846 * dirfd.c, dirfd.h: New files.
6847 * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
6849 * hash.c (hash_print) [TESTING]: Clean up.
6851 2001-10-22 Paul Eggert <eggert@twinsun.com>
6853 * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
6854 to avoid a warning if -Wall.
6856 2001-10-21 Paul Eggert <eggert@twinsun.com>
6858 * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
6860 2001-10-21 Jim Meyering <jim@meyering.net>
6862 * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise,
6863 this code would end up calling gettext even in packages built
6865 * getopt.c (_): Likewise.
6866 * regex.c (_): Likewise.
6868 2001-10-20 Paul Eggert <eggert@twinsun.com>
6870 * error.c (strerror_r): Do not declare unless !_LIBC.
6871 Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
6872 Use strerror_r that is only a macro, even if it is not a function.
6873 (strerror): Check for HAVE_DECL_STRERROR before declaring.
6874 (private_strerror): Use prototypes, not old-style function definition.
6875 (print_errno_message): New function.
6876 Support the POSIX 'int'-flavored strerror_r, as well as the traditional
6878 (error_tail, error, error_at_line): Use it.
6880 2001-10-11 Jim Meyering <jim@meyering.net>
6882 * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
6883 and quote_n (1, ... to avoid clobbering a buffer.
6885 2001-10-05 Jim Meyering <jim@meyering.net>
6887 * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
6888 * hash-pjw.c: New file (factored out of fileutils' remove.c).
6889 * hash-pjw.h: New file.
6891 2001-09-30 Jim Meyering <jim@meyering.net>
6893 * mountlist.c [MOUNTED_GETFSSTAT]:
6894 Include <sys/ucred.h>, for Apple Darwin.
6895 Include sys/mount.h and sys/fs_types.h only if available.
6897 (read_filesystem_list): Use FS_TYPE.
6899 2001-09-29 Paul Eggert <eggert@twinsun.com>
6901 * exclude.c (excluded_filename): 0 -> false, since it's
6904 2001-09-28 Paul Eggert <eggert@twinsun.com>
6906 Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
6907 #defines strtoimax. Also treat the other strto* functions
6910 * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
6911 (strtoul): Do not declare if HAVE_DECL_STRTOUL.
6912 (strtoimax, strtoumax): Do not declare if already defined as a macro.
6914 2001-09-26 Jim Meyering <jim@meyering.net>
6916 Most macros in unlocked-io.h had the wrong number of arguments.
6917 * gen-uio: New script.
6918 (USE_UNLOCKED_IO): Define to 1 if not already defined.
6919 * unlocked-io.hin: Remove file.
6920 * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
6921 rather than trying to embed it here.
6922 (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin
6923 Reported by Padraig Brady.
6925 2001-09-25 Volker Borchert <bt@teknon.de>
6927 * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
6929 2001-09-23 Jim Meyering <jim@meyering.net>
6931 * mountlist.c: Remove useless parentheses in #if directives.
6932 (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
6933 the deprecated MOUNTED symbol is no longer defined in mntent.h.
6935 2001-09-22 Jim Meyering <jim@meyering.net>
6937 * localcharset.c: Update from latest gettext.
6938 * config.charset: Likewise.
6940 2001-09-20 Jim Meyering <jim@meyering.net>
6942 * xstrtol.c (strtoimax): Guard declaration with
6943 `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
6944 The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
6945 have their own, conflicting declaration of strtoimax in sys/inttypes.h.
6946 (strtoumax): Likewise, for completeness (it wasn't necessary).
6948 2001-09-06 Paul Eggert <eggert@twinsun.com>
6950 * strtoimax.c (HAVE_LONG_LONG):
6951 Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
6952 (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
6953 to work around bug in IBM C compiler.
6955 2001-09-16 Jim Meyering <jim@meyering.net>
6957 * mkdir.c: New file.
6959 2001-09-04 Paul Eggert <eggert@twinsun.com>
6961 * xgetcwd.c: Revert some of the previous change; intead,
6962 fix the HAVE_GETCWD_NULL code to behave more like the
6963 !HAVE_GETCWD_NULL code used to.
6966 (xgetcwd): Do not return NULL when memory is exhausted; instead,
6969 2001-09-04 Paul Eggert <eggert@twinsun.com>
6971 * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed.
6972 Use ssize_t, not int, to store result of readlink.
6973 Check for ssize_t overflow as well as size_t overflow,
6974 as POSIX says the result of readlink is implementation-defined
6975 when ssize_t overflows.
6976 Remove unnecessary cast to char*.
6977 Use free+malloc instead of realloc, as the storage doesn't need
6978 to be preserved and it's clearer and can be more efficient that way.
6979 (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
6980 * xreadlink.h (xreadlink): Update prototype.
6982 2001-09-03 Paul Eggert <eggert@twinsun.com>
6984 * exclude.c (fnmatch_no_wildcards): Fix confusion between
6985 usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
6986 spotted by Jim Meyering.
6988 2001-09-03 Jim Meyering <jim@meyering.net>
6990 * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
6992 2001-09-03 Paul Eggert <eggert@twinsun.com>
6994 * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
6995 like the HAVE_GETCWD_NULL code.
6996 Include pathmax.h if not HAVE_GETCWD.
6997 Do not include xalloc.h.
6998 (INITIAL_BUFFER_SIZE): New symbol.
6999 Do not use xmalloc / xrealloc, since the caller is responsible for
7000 handling errors. Preserve errno around `free' during failure.
7001 Do not overrun buffer when using getwd.
7003 2001-09-03 Paul Eggert <eggert@twinsun.com>
7005 * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
7006 __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
7008 2001-09-02 Jim Meyering <jim@meyering.net>
7010 * error.c: Update from GNU libc.
7012 2001-09-01 Jim Meyering <jim@meyering.net>
7014 * xreadlink.c: New file.
7015 * xreadlink.h: New file.
7016 * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
7018 * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
7019 doesn't conflict with sparc Solaris 7's definition in
7020 /usr/include/sys/int_types.h.
7022 * exclude.c: Use `""', not `<>' to #include non-system header files.
7023 (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
7024 and strncasecmp as r-values. Unixware didn't have declarations.
7026 2001-08-31 Jim Meyering <jim@meyering.net>
7028 * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
7029 Use an initial, malloc'd, buffer of length 128 rather than
7030 a statically allocated one of length 1024.
7032 2001-08-30 Paul Eggert <eggert@twinsun.com>
7034 * xgetcwd.c: Don't include pathmax.h.
7035 Include stdlib.h and unistd.h if available.
7037 (xmalloc, xstrdup, free): Remove decls.
7038 (xgetcwd): Don't assume sizes fit in unsigned.
7039 Check for overflow when computing sizes.
7040 Simplify reallocation code.
7042 2001-08-28 Paul Eggert <eggert@twinsun.com>
7044 * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
7046 * strtoimax.c: Renamed from strtoxmax.c, removing the
7049 Also, make the following further changes to make this file's
7050 configuration more similar to that of strtol.c:
7051 (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
7052 (strtoumax, uintmax_t, strtoull, strtol): Remove.
7053 (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
7054 (strtoimax): Renamed from strtoumax. All uses of unsigned values
7055 changed to signed values.
7057 And make the following changes as well:
7058 Fix copyright notice, as 1999 was missing.
7059 (verify): New macro.
7060 (strtoimax): Check sizes at compile-time, not run-time.
7061 Prefer strtol to strtoll if both work.
7062 (main): Remove; it was not that useful and was a pain to maintain.
7064 * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
7066 2001-08-30 Paul Eggert <eggert@twinsun.com>
7068 * savedir.c (savedir): Remove size parameter, as POSIX says that
7069 a directory's st_size can have an arbitrary value, so the old
7070 usage could waste an arbitrary amount of memory. All uses
7072 * savedir.h: Update prototype.
7074 2001-08-30 Paul Eggert <eggert@twinsun.com>
7076 * xstrtol.c (strtoimax): New decl.
7078 2001-08-28 Paul Eggert <eggert@twinsun.com>
7080 * xstrtol.h: Add copyright notice.
7081 (_DECLARE_XSTRTOL): Improve quality of diagnostic for
7082 LONGINT_INVALID_SUFFIX_CHAR.
7084 2001-08-30 Paul Eggert <eggert@twinsun.com>
7086 * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
7089 2001-08-30 Paul Eggert <eggert@twinsun.com>
7091 * hash.c: Remove '2001' from copyright notice.
7093 2001-08-30 Paul Eggert <eggert@twinsun.com>
7095 * full-write.h: New file.
7096 * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
7097 * full-write.c: Correct credits, as cccp.c no longer
7098 exists and anyway it was so heavily changed from the old cccp
7099 code as to be unrecognizable. Include full-write.h.
7100 (full_write) Return size_t, with short writes meaning failure.
7101 All callers changed. This fixes a bug with large buffers
7103 * utime.c: Include full-write.h.
7105 2001-08-30 Paul Eggert <eggert@twinsun.com>
7107 Merge 'exclude' changes from tar 1.13.22.
7108 This fixes one or two unlikely storage allocation overflow bugs,
7109 but doesn't change user-visible behavior otherwise.
7111 2001-08-30 Paul Eggert <eggert@twinsun.com>
7113 * exclude.c (bool): Declare, perhaps by including stdbool.h.
7114 (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
7115 (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
7116 Include if available.
7117 (<xalloc.h>): Include
7118 (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
7119 (verify): New macro. Use it to verify that EXCLUDE macros do not
7120 collide with FNM macros.
7121 (struct patopts): New struct.
7122 (struct exclude): Use it, as exclude patterns now come with options.
7123 (new_exclude): Support above changes.
7124 (new_exclude, add_exclude_file):
7125 Initial size must now be a power of two to simplify overflow checking.
7126 (free_exclude, fnmatch_no_wildcards): New function.
7127 (excluded_filename): No longer requires options arg, as the options
7128 are determined by add_exclude. Now returns bool, not int.
7129 (excluded_filename, add_exclude):
7130 Add support for the fancy new exclusion options.
7131 (add_exclude, add_exclude_file): Now takes int options arg.
7132 Check for arithmetic overflow when computing sizes.
7133 (add_exclude_file): xrealloc might modify errno, so don't
7134 realloc until after errno might be used.
7136 * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
7138 (free_exclude): New decl.
7139 (add_exclude, add_exclude_file): Now takes int options arg.
7140 (excluded_filename): No longer requires options arg, as the options
7141 are determined by add_exclude. Now returns bool, not int.
7143 2001-08-30 Paul Eggert <eggert@twinsun.com>
7145 * alloca.c (alloca): Arg is of type size_t, not unsigned.
7147 2001-08-27 Jim Meyering <jim@meyering.net>
7149 * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
7151 * version-etc.c (N_): Remove definition.
7152 Revert most of last change.
7153 Instead, simply don't mark the `Copyright...' string for translation.
7154 Based on advice from Paul Eggert.
7156 * strtoxmax.c: Tweak comment.
7158 2001-08-26 Jim Meyering <jim@meyering.net>
7160 * version-etc.c (version_etc_copyright_fmt): Replace literal year
7161 of copyright with `%s' so translators don't get an untranslated
7163 (COPYRIGHT_YEAR): Define.
7164 (version_etc): Use fprintf rather than fputs.
7165 Suggestion from Ulrich Drepper.
7167 * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
7169 * strtoll.c: New file, from GNU libc.
7170 * xstrtoimax.c: New file.
7172 * xstrtol.h: Add xstrtoimax.
7173 * strtoumax.c: New file. Simply include "strtoumax.c".
7174 * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED.
7176 * strtoumax.c: Factor to work both for unsigned and signed types, ...
7177 * strtoxmax.c: ... then renamed to this.
7179 2001-08-13 Paul Eggert <eggert@twinsun.com>
7181 * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
7182 Port to Solaris 8, where 'sed' requires a space after the 'r'
7183 command, and where sh dislikes "$/". Clean up the spacing a bit.
7184 Redirect output to $tmp just once.
7186 2001-08-12 Paul Eggert <eggert@sic.twinsun.com>
7188 * addext.c (<errno.h>): Include.
7189 (errno): Declare if not defined.
7190 (addext): Work correctly when pathconf returns -1 and leaves
7191 errno alone because there is no limit. Also, work even if
7192 pathconf returns a value greater than SIZE_MAX.
7194 2001-08-12 Jim Meyering <jim@meyering.net>
7196 * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
7197 Simply `return getcwd (NULL, 0);'.
7198 [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
7199 Use 1300 as initial value for length, not PATH_MAX.
7201 * pathmax.h: Clean up cpp syntax.
7203 2001-08-12 Jim Meyering <jim@meyering.net>
7205 * gettimeofday.c: New file.
7207 * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
7209 2001-08-04 Jim Meyering <jim@meyering.net>
7211 * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
7212 to get in sync with glibc.
7214 2001-08-03 Paul Eggert <eggert@twinsun.com>
7216 The following changes are from gettext 0.10.39 as maintained by
7219 * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
7220 Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
7221 with inverted sense. All uses changed.
7223 * mbswidth.c: Don't include <limits.h>.
7224 Include <stdlib.h> and <string.h> unconditionally.
7225 (iswcntrl, mbsinit, ISCNTRL): New macros.
7226 (mbsnwidth): Use K&R style function declarations.
7227 Don't bother checking for MB_LEN_MAX == 1, since the compiler
7228 can optimize it when MB_CUR_MAX == 1.
7229 The width of control characters is zero, not 1.
7231 2001-07-15 Jim Meyering <jim@meyering.net>
7233 * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
7234 (BUILT_SOURCES): Add unlocked-io.h.
7235 (io_functions): Define.
7236 (unlocked-io.h): New rule.
7237 (DISTCLEANFILES): Add unlocked-io.h.
7238 (all-local): Depend on unlocked-io.h, to ensure it is created.
7240 * unlocked-io.hin: New file
7242 * regex.c: Update from glibc.
7244 2001-07-05 Jim Meyering <jim@meyering.net>
7246 * Makefile.am (noinst_HEADERS): Remove definition, per new automake
7248 (libfetish_a_SOURCES): Put all .h files here instead.
7249 Remove a thus-exposed (better checks in automake) duplicate and
7250 two unnecessary .h files.
7252 2001-06-11 Jim Meyering <jim@meyering.net>
7254 * regex.c: Update from GNU libc.
7256 2001-05-27 Jim Meyering <jim@meyering.net>
7258 * readutmp.h (UT_TYPE): Define.
7260 2001-05-24 Jim Meyering <jim@meyering.net>
7262 * argmatch.c: Include "quote.h".
7263 (argmatch_invalid): Remove explicit `' quotes. Instead, use the
7264 quote function. Reported by Göran Uddeborg.
7266 2001-05-20 Alexandre Duret-Lutz <duret_g@epita.fr>
7268 * dirname.c (dir_name): Compute append_dot using path, not newpath
7269 which is not yet declared.
7271 2001-05-11 Paul Eggert <eggert@twinsun.com>
7273 * Makefile.am (libfetish_a_SOURCES):
7274 Add strftime.c, since we now compile it on all hosts.
7276 * strftime.c (my_strftime):
7277 Define to nstrftime if emacs, but only if my_strftime is not defined.
7278 (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
7279 ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
7280 Add one more extra argument: a nanoseconds value.
7283 (my_strftime function): Add %N format.
7284 (emacs_strftimeu): Renamed from emacs_strftime,
7285 with extra ut argument.
7287 2001-05-11 Paul Eggert <eggert@twinsun.com>
7289 dirname code cleanup. base_name now behaves more compatibly
7290 with POSIX basename when given file names that have trailing
7291 slashes, and similarly for dir_name. Add new primitives
7292 base_len and dir_len. Put the directory-name-related decls
7295 * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
7296 * backupfile.c (base_name): Likewise.
7297 * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
7298 * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
7299 * makepath.c (strip_trailing_slashes): Likewise.
7300 * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
7302 * rename.c (strip_trailing_slashes): Likewise.
7303 * same.c (base_name): Likewise.
7304 * stripslash.c (ISSLASH): Likewise.
7306 * addext.c: Include <dirname.h> after size_t is defined.
7307 * backupfile.c: Likewise.
7309 * addext.c (addext): Use base_len to trim redundant
7310 trailing slashes instead of doing it ourselves.
7311 But do not trim the last slash if it is not redundant.
7313 * backupfile.c (find_backup_file_name,
7314 max_backup_version): Use base_len instead of rolling it ourselves.
7315 Handle the case of "" and (on DOS) "C:" correctly.
7317 * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
7318 Include <string.h>, <dirname.h>.
7319 (base_name): Allow file names ending in slashes, other than names
7320 that are all slashes. In this case, return the basename followed
7321 by the slashes. This is more general, and can be used in places
7322 where the original base_name purposely had an assertion failure.
7323 (base_len): New function.
7325 * dirname.c: Include <string.h> instead of <stdlib.h>.
7326 Do not include <assert.h>; no longer needed.
7328 (memrchr): Remove decl.
7329 (dir_name_r): Remove.
7330 (dir_len): Renamed from dirlen. All callers changed.
7331 Rewrite in terms of base_name, for simplicity and consistency.
7332 (dir_name): Never return NULL. All callers changed.
7333 Do not include <stdlib.h> in test program; no longer needed.
7334 return 0; is fine for test program.
7336 * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
7338 (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
7340 * path-concat.c (path_concat): Use base_len to compute
7341 base length, not strlen; this means we cannot rely on memcpy
7344 * same.c (STREQ): Remove.
7345 (same_name): Handle the case where the basename ends in trailing '/'.
7347 * stripslash.c (strip_trailing_slashes): Return nonzero if
7348 a slash was stripped. Do not strip the last slash after a
7351 2001-04-08 Jim Meyering <jim@meyering.net>
7353 * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
7354 recomputed; that's necessary when the offset spans a DST transition.
7355 Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
7357 2001-04-02 Jim Meyering <jim@meyering.net>
7359 * regex.h, regex.c: Update from GNU libc.
7361 2001-03-19 Paul Eggert <eggert@twinsun.com>
7363 * version-etc.c (version_etc_copyright): Update to 2001.
7365 2001-03-16 Paul Eggert <eggert@twinsun.com>
7367 * tempname.c (uint64_t): Define to uintmax_t if
7368 not defined, and if UINT64_MAX is not defined.
7369 Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
7370 Reported by John David Anglin.
7372 2001-03-10 Bruno Haible <haible@clisp.cons.org>
7374 * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
7375 alias if codeset is empty.
7376 * config.charset (BeOS): Use wildcard syntax.
7378 2001-03-13 Jim Meyering <jim@meyering.net>
7380 * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
7381 Don't insert a backslash when concatenating e.g., `C:' and `foo'.
7384 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7386 * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
7388 * unicodeio.c (print_unicode_char): Simplify accordingly.
7390 2001-03-06 Bruno Haible <haible@clisp.cons.org>
7392 * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
7393 support for DOS/DJGPP.
7395 2001-02-28 Paul Eggert <eggert@twinsun.com>
7397 * Makefile.am (libfetish_a_SOURCES):
7398 Add dup-safer.c, fopen-safer.c.
7399 (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
7401 * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
7403 2001-02-25 Paul Eggert <eggert@twinsun.com>
7405 The mkstemp replacement is taken from glibc 2.2.2, with some
7406 portability fixes for use outside glibc, as follows:
7408 * tempname.c (struct_stat64): New macro.
7409 (direxists, __gen_tempname): Use it.
7410 This avoids a portability problem with Solaris 8.
7412 * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7413 (<stddef.h>, <stdint.h>, <string.h>):
7414 Include only if STDC_HEADERS || _LIBC.
7415 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7416 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7417 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7418 (__set_errno): Define this macro if <errno.h> doesn't.
7419 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7420 Define these macros if <stdio.h> doesn't.
7421 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7422 Define these macros if <sys/stat.h>
7423 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7424 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7425 __xstat64): Define if not _LIBC.
7426 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7427 (__gen_tempname): Invoke gettimeofday only if
7428 HAVE_GETTIMEOFDAY || _LIBC;
7429 otherwise, fall back on plain "time".
7430 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7432 * mkstemp.c (__GT_FILE): Define to zero if not defined.
7434 * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7436 2001-02-17 Jim Meyering <jim@meyering.net>
7438 * strtoul.c: Sync from GNU libc. Use double quotes, not <...>
7439 around included file name.
7441 * strnlen.c (__strnlen): Merge in a change from GNU libc.
7443 * strftime.c: Update from GNU libc (the only changes were to comments).
7445 2001-02-13 Bruno Haible <haible@clisp.cons.org>
7447 * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7449 2001-02-17 Paul Eggert <eggert@twinsun.com>
7451 * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7452 Remove workaround macros for hosts that have mbrtowc but not
7453 mbstate_t, as we now insist on proper declarations for both
7454 before using mbrtowc.
7456 2001-02-17 Jim Meyering <jim@meyering.net>
7458 * regex.c: Update from libc.
7460 2001-02-16 Paul Eggert <eggert@twinsun.com>
7462 * alloca.c (malloc): Undef before defining, since stdlib.h
7463 may have defined it. Needed for Encore Umax-3.0.9.16b systems.
7464 Reported by Mark Hounschell via Paul Eggert.
7466 2001-01-30 Bruno Haible <haible@clisp.cons.org>
7468 * config.charset: Update for FreeBSD 4.2.
7470 2001-01-26 Jim Meyering <jim@meyering.net>
7472 * quotearg.c: Include stddef.h.
7473 * quote.c: Include stddef.h.
7474 Reported by Axel Kittenberger.
7476 * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7477 line in double quotes so that it evokes a better diagnostic.
7478 [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7479 Reported by Axel Kittenberger.
7481 2001-01-15 Bruno Haible <haible@clisp.cons.org>
7483 * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7484 to avoid a warning. Add back 'const' to inptr.
7486 2001-01-16 Jim Meyering <jim@meyering.net>
7488 * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7491 2001-01-14 Jim Meyering <jim@meyering.net>
7493 * rename.c: New file. From Volker Borchert.
7494 Include stdlib.h, string.h or strings.h, and xalloc.h.
7495 Use strip_trailing_slashes rather than open-coding it.
7497 2001-01-03 Paul Eggert <eggert@twinsun.com>
7499 * strftime.c: Sync with glibc time/strftime.c 1.81.
7501 2001-01-03 Jim Meyering <jim@meyering.net>
7503 * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7504 local `inptr' to avoid warning with some system declarations of iconv.
7506 2000-12-29 Paul Eggert <eggert@twinsun.com>
7508 * modechange.c: Do not assume that mode_t uses the
7509 traditional octal encoding. E.g. "chmod 1 FOO" should set
7510 the other-execute bit of FOO even if S_IXOTH != 1.
7512 (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7513 WOTH, XOTH, ALLM): New macros.
7514 (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7515 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7517 (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7518 (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7520 No need to use uintmax_t; unsigned long is long enough.
7521 Don't bother to get suffix since we don't use it.
7523 2000-12-24 Jim Meyering <jim@meyering.net>
7525 * hash.c (is_prime): Return explicit boolean values.
7526 (hash_get_first): Return NULL to appease Irix5.6's 89.
7527 Reported by Nelson Beebe.
7529 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7531 * localcharset.c (locale_charset): Add support for Win32.
7533 2000-12-18 Paul Eggert <eggert@twinsun.com>
7535 * physmem.h, physmem.c: New files.
7537 * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7538 (noinst_HEADERS): Add physmem.h.
7540 * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7541 't' for compatibility with Solaris 8 sort.
7543 2000-12-18 Bruno Haible <haible@clisp.cons.org>
7545 * config.charset: Add support for BeOS.
7547 2000-12-16 Jim Meyering <jim@meyering.net>
7549 * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7550 SHELLS_FILE to a file name that's useful on djgpp systems.
7552 (ADDITIONAL_DEFAULT_SHELLS): Define.
7553 (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7554 Based mostly on a patch from Prashant TR.
7556 2000-12-16 Jim Meyering <jim@meyering.net>
7558 This bug had a serious impact on chown: `chown N:M FILE' (for integer
7559 N and M) would have treated it like `chown N:N FILE'.
7561 * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7563 2000-10-31 Bruno Haible <haible@clisp.cons.org>
7565 * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7566 CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7567 to the list of canonical encodings. Rename EUC-CN to GB2312.
7569 2000-12-08 Andreas Schwab <schwab@suse.de>
7571 * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7572 invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7574 2000-12-07 Jim Meyering <jim@meyering.net>
7576 * stripslash.c (ISSLASH): Define.
7577 (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7580 * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7581 (dir_name_r): Declare this function as static.
7582 [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7583 manifest itself on a name containing a mix of slashes and
7585 Make this function work with names starting with a DOS-style
7586 drive letter and colon prefix.
7587 (dir_name): Append `.' if necessary.
7588 Based mostly on patches from Prashant TR and Eli Zaretskii.
7590 * dirname.h (dir_name_r): Remove prototype.
7592 2000-12-05 Jim Meyering <jim@meyering.net>
7594 * dirname.c (dir_name_r): Add `const' in a few local declarations.
7596 2000-12-04 Jim Meyering <jim@meyering.net>
7598 * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7599 Also include memory.h, stdlib.h, unistd.h if appropriate.
7600 Reported by Andreas Jaeger (conflicting declaration of malloc).
7602 2000-12-02 Jim Meyering <jim@meyering.net>
7604 * closeout.h: Make idempotent, to avoid some obscure warnings.
7606 2000-12-01 Paul Eggert <eggert@twinsun.com>
7608 * memrchr.c: Include <config.h> before any system include file.
7610 2000-11-29 Paul Eggert <eggert@twinsun.com>
7612 * dirname.c (dir_name_r): Fix typo: int -> size_t.
7614 2000-11-26 Jim Meyering <jim@meyering.net>
7616 * memcoll.c: Include sys/types.h. From Werner Almesberger.
7618 2000-11-22 Paul Eggert <eggert@twinsun.com>
7620 * strftime.c (my_strftime): Do not invoke mbrlen with a
7621 size of (size_t) -1; it's not portable.
7623 2000-11-17 Akim Demaille <akim@epita.fr>
7625 * obstack.h: Formatting changes.
7626 (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7627 prevent type checking.
7628 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7629 cast the value to (void *): assigning a `foo *' to a `void *'
7631 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7633 2000-11-17 Jim Meyering <jim@meyering.net>
7635 * strstr.c: Update from GNU libc.
7637 2000-11-16 Jim Meyering <jim@meyering.net>
7639 * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7641 2000-11-11 Jim Meyering <jim@meyering.net>
7643 * error.c: Add a couple #includes, merging from GNU libc version.
7645 2000-11-10 Jim Meyering <jim@meyering.net>
7647 * obstack.h: Update from GNU libc.
7648 * obstack.c: Likewise.
7650 2000-11-06 Paul Eggert <eggert@twinsun.com>
7652 * getusershell.c (setusershell): Use rewind rather than
7653 fseek/fseeko, to avoid configuration hassles with fseeko.
7654 Don't bother opening SHELLS_FILE if shellstream is NULL;
7657 2000-11-05 Jim Meyering <jim@meyering.net>
7659 * makepath.h (make_dir): Declare.
7660 * makepath.c (make_dir): Remove `static' attribute.
7663 2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
7665 * hash.c (hash_get_next): Fix a thinko: when ENTRY is the
7666 last one in a bucket, advance to the next bucket.
7668 2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
7670 * fnmatch.c: Do not comment out all the code if we are using
7671 the GNU C library, because in some cases we are replacing buggy
7672 code in the GNU C library itself.
7674 2000-10-30 Paul Eggert <eggert@twinsun.com>
7676 * error.h, getline.h, modechange.h:
7677 Remove "2000" from Copyright line, as the file hasn't been
7678 changed this year other than in the copyright notice.
7680 * xalloc.h: Add "2000" to Copyright line, as this file
7681 was changed this year.
7683 2000-10-30 Paul Eggert <eggert@twinsun.com>
7685 * fnmatch.c (FOLD): Do not assume that characters are unsigned.
7686 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
7687 e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
7689 2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
7691 * regex.h (__restrict_arr): Move definition out of #ifndef block.
7692 Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
7693 doesn't define __restrict_arr.
7695 2000-10-29 Jim Meyering <jim@meyering.net>
7697 * xstat.in: Fix grammar in comment.
7699 2000-10-28 Jim Meyering <jim@meyering.net>
7701 * memchr.c: Update from libc.
7702 Adjust for portability:
7703 [HAVE_STDLIB_H]: Include stdlib.h.
7704 [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
7705 Undef __memchr, too.
7706 [!weak_alias]: Define __memchr to memchr.
7708 * regex.c: Update from libc.
7709 * regex.h: Likewise.
7710 * getopt1.c: Likewise.
7711 * memcmp.c: Likewise.
7713 * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
7714 Avoid using fseek, when possible -- it's broken by design.
7715 Patch by Ulrich Drepper.
7717 2000-10-26 Jim Meyering <jim@meyering.net>
7719 * strftime.c: Update from libc.
7721 2000-10-25 Jim Meyering <jim@meyering.net>
7723 * obstack.c: Update from libc.
7725 2000-10-23 Jim Meyering <jim@meyering.net>
7727 * hard-locale.c (hard_locale): Revert last change -- it was simply
7728 wrong. That set_locale call must not have any side effects.
7731 2000-10-22 Jim Meyering <jim@meyering.net>
7733 * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
7734 [CYCLIC]: Remove now-unused definition.
7736 * save-cwd.c (O_DIRECTORY): Define, if needed.
7737 (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
7738 Suggestion from Ulrich Drepper.
7740 2000-10-21 Jim Meyering <jim@meyering.net>
7742 * dirname.c (dir_name_r): New function, factored out of dir_name.
7743 (dir_name): Use dir_name_r.
7744 * dirname.h (dir_name_r): Declare it.
7746 2000-10-21 Jim Meyering <jim@meyering.net>
7748 * dirname.c (memrchr): Declare if necessary.
7749 (dir_name): Remove the restriction that there be no
7750 trailing slashes. Now, this code skips past them, effectively
7752 [TEST_DIRNAME] (main): New unit tests.
7754 * memrchr.c: New file from GNU libc.
7755 Undef __memrchr, too.
7756 [!weak_alias]: Define __memrchr to memrchr.
7757 Guard weak_alias use with `#ifdef weak_alias'.
7759 2000-10-17 Jim Meyering <jim@meyering.net>
7761 * quote.h (PARAMS): Define and use.
7762 Reported by Akim Demaille.
7764 * getopt.c: Update from libc.
7766 2000-10-16 Jim Meyering <jim@meyering.net>
7768 * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
7771 2000-09-25 Jim Meyering <jim@meyering.net>
7773 * md5.h (rol): Define (from GnuPG).
7775 * sha.c: Give credit (GnuPG) where due.
7776 (M): Use rol rather than open-coding it.
7777 Add a FIXME comment.
7779 2000-09-21 Jim Meyering <jim@meyering.net>
7781 * userspec.c (parse_user_spec): Remove debugging printf I'd added.
7782 Reported by Michael Stone.
7784 2000-09-20 Jim Meyering <jim@meyering.net>
7786 * Makefile.am (libfetish_a_SOURCES): Add sha.c.
7787 (noinst_HEADERS): Add sha.h.
7788 Based on code from Scott G. Miller and from GnuPG.
7790 2000-09-15 Jim Meyering <jim@meyering.net>
7792 * regex.c: Update from libc.
7794 2000-09-10 Jim Meyering <jim@meyering.net>
7796 * getopt.c (_getopt_internal): Update from glibc.
7798 2000-09-09 Jim Meyering <jim@meyering.net>
7800 * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
7801 think it should be used as a general replacement for isascii.
7802 * fnmatch.c: Likewise.
7803 * mbswidth.c: Likewise
7804 * regex.c: Likewise.
7807 * userspec.c: Include sys/param.h and limits.h.
7809 (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7810 (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
7811 (parse_user_spec): Use xstrtoul, not atoi when converting numeric
7812 UID, GID. Check range.
7814 2000-09-06 Jim Meyering <jim@meyering.net>
7816 * getopt.c (_getopt_internal): Update from glibc.
7818 2000-08-30 Jim Meyering <jim@meyering.net>
7820 * strftime.c: Merge in changes from GNU libc.
7822 2000-08-26 Jim Meyering <jim@meyering.net>
7824 * closeout.c: Include "__fpending.h".
7825 (close_stdout_status): Return right away if there's nothing to flush.
7827 * Makefile.am (noinst_HEADERS): Add __fpending.h.
7828 * __fpending.c: New file.
7829 * __fpending.h: New file.
7831 2000-08-07 Paul Eggert <eggert@twinsun.com>
7833 Standardize on "memory exhausted" instead of "Memory exhausted"
7834 or "virtual memory exhausted".
7835 * obstack.c (print_and_abort): Use "memory exhausted", not
7836 "virtual memory exhausted".
7837 * same.c (same_name): Invoke xalloc_die instead of printing
7839 * userspec.c (parse_user_spec): Likewise.
7840 * bumpalloc.h: comment fix
7841 * same.c, userspec.c: Include xalloc.h.
7843 * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
7844 not char *const and pointing to a constant array.
7845 * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
7846 (xrealloc): Comment fix.
7848 * userspec.c (parse_user_spec):
7849 Don't translate a message until just before returning,
7850 to avoid unnecessary translation.
7852 2000-08-07 Jim Meyering <jim@meyering.net>
7854 * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
7855 chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
7856 fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
7857 getgroups.c, gethostname.c, getopt.h, group-member.c,
7858 hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
7859 linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
7860 memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
7861 pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
7862 stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
7863 strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
7864 utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
7865 yesno.c: Back out Copyright date changes for each file with no change
7866 this year. This eases coordination with other programs using the same
7867 source code modules. From Paul Eggert.
7869 2000-08-03 Greg McGary <greg@mcgary.org>
7871 * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
7872 ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
7873 (EXTEND_BUFFER): Use them.
7875 2000-08-01 Jim Meyering <jim@meyering.net>
7877 * dirname.c (ISSLASH): Define.
7878 (BACKSLASH_IS_PATH_SEPARATOR): Define.
7879 (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
7880 both `\' and `/' may be use as path separators.
7881 Based on a patch from Prashant TR.
7883 2000-07-31 Paul Eggert <eggert@twinsun.com>
7885 * quotearg.c (quotearg_n_options): Don't make the initial
7886 slot vector a constant, since it might get modified.
7888 2000-07-31 Jim Meyering <jim@meyering.net>
7890 * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
7891 * obstack.c (print_and_abort): Likewise.
7893 2000-07-30 Paul Eggert <eggert@twinsun.com>
7895 * quotearg.c (quotearg_n_options): Preallocate a slot 0
7896 buffer, so that the caller can always quote one small
7897 component of a "memory exhausted" message in slot 0.
7898 From a suggestion by Jim Meyering.
7900 2000-07-30 Jim Meyering <jim@meyering.net>
7902 * makepath.c (make_path): Quote the other instance, too.
7904 * quotearg.c (N_STATIC_SLOTVECS): Define.
7905 (STATIC_BUF_SIZE): Define.
7906 (quotearg_n_options): Use only statically allocated storage when
7907 N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
7908 than STATIC_BUF_SIZE.
7910 2000-07-29 Jim Meyering <jim@meyering.net>
7912 * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
7913 * dirname.c (dir_name): Likewise.
7915 * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
7917 * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
7918 (dir_name): Assert that there are no trailing slashes.
7920 2000-07-18 Bruno Haible <haible@clisp.cons.org>
7922 * mbswidth.h (mbswidth): Add a flags argument.
7923 (mbswidth): New declaration.
7924 (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
7925 * mbswidth.c (mbswidth): Add a flags argument.
7926 (mbsnwidth): New function.
7928 2000-07-24 Jim Meyering <jim@meyering.net>
7930 * mbswidth.c: Remove useless #else. From Bruno Haible.
7932 2000-07-23 Paul Eggert <eggert@twinsun.com>
7934 * mbswidth.c (_XOPEN_SOURCE):
7935 Don't define; this causes problems on Solaris 7.
7936 (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
7938 2000-07-23 Paul Eggert <eggert@twinsun.com>
7941 Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
7942 so that mbstate_t is always defined.
7944 Do not inspect MB_LEN_MAX, since it's incorrectly defined to
7945 be 1 in at least one GCC installation, and this configuration
7946 error is likely to be common. Ignoring MB_LEN_MAX hurts
7947 performance on hosts that have mbrtowc but have only unibyte
7948 locales, but I assume these hosts are rare.
7950 2000-07-23 Paul Eggert <eggert@twinsun.com>
7952 * quotearg.c: Streamline by invoking multibyte code only if needed.
7953 <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
7954 (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
7955 (quotearg_buffer_restyled): If a unibyte locale, don't bother to
7956 invoke multibyte primitives.
7958 2000-07-23 Jim Meyering <jim@meyering.net>
7960 * basename.c (base_name): Add an assertion.
7962 2000-07-15 Bruno Haible <clisp.cons.org>
7964 * quotearg.c: When the system forces us to redefine mbstate_t,
7965 shadow its mbsinit function.
7967 2000-07-16 Bruno Haible <haible@clisp.cons.org>
7969 * mbswidth.h: New file.
7970 * mbswidth.c: New file.
7971 * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
7972 (noinst_HEADERS): Add mbswidth.h.
7974 2000-07-17 Bruno Haible <haible@clisp.cons.org>
7976 * config.charset: Add support for FreeBSD. Improve support for HP-UX
7979 2000-07-15 Jim Meyering <jim@meyering.net>
7981 * makepath.c: Include quote.h.
7982 (make_path): Convert "`%s'" in format strings to "%s", and wrap each
7983 corresponding argument in a `quote (...)' call.
7984 Give better diagnostics.
7986 * Makefile.am (libfetish_a_SOURCES): Add quote.c.
7987 (noinst_HEADERS): Add quote.h.
7989 * quote.c (quote, quote_n): New file. Two functions taken verbatim
7990 from tar's src/misc.c.
7991 * quote.h: New file. Prototypes for same.
7993 2000-07-10 Paul Eggert <eggert@twinsun.com>
7995 From a suggestion by Bruno Haible.
7996 * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
7997 Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
7998 to decide whether to define the BeOS workaround macro;
7999 this adjusts to the change to AC_MBSTATE_T.
8001 2000-07-13 Paul Eggert <eggert@twinsun.com>
8003 * quotearg.h (enum quoting style): New enum clocale_quoting_style.
8005 * quotearg.c (quoting_style_args, quoting_style_vals,
8006 quotearg_buffer_restyled): Add support for
8007 clocale_quoting_style. Undo previous change to
8008 locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
8009 and "{RIGHT QUOTATION MARK}" msgids.
8011 2000-07-05 Paul Eggert <eggert@twinsun.com>
8013 The old behavior of quoting `like this' doesn't look good with
8014 newer, ISO-style fonts. See:
8015 http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
8017 Instead, quote "like this" by default. Let the translator
8018 tailor the locale-specific quoting behavior by providing
8019 translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
8021 * quotearg.c (N_): New macro.
8022 (gettext_default): New function.
8023 (quotearg_buffer_restyled): Use
8024 gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
8025 gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
8027 2000-07-09 Jim Meyering <jim@meyering.net>
8029 * Most files: Update copyright dates to include 2000.
8031 2000-07-08 Jim Meyering <jim@meyering.net>
8033 * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
8035 (xgethostname): Remove now-unnecessary #ifdef.
8036 Move declaration of `err' into loop where it's used.
8038 2000-07-05 Bruno Haible <haible@clisp.cons.org>
8040 * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
8041 by allocating a larger buffer. Test the gethostname return value for
8042 being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname
8043 returns an error and ENAMETOOLONG isn't defined.
8045 2000-07-05 Paul Eggert <eggert@twinsun.com>
8046 and Bruno Haible <haible@clisp.cons.org>
8048 * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
8050 2000-07-05 Bruno Haible <haible@clisp.cons.org>
8052 * quotearg.c (struct quoting_options): Simplify quote_these_too
8055 2000-07-03 Jim Meyering <jim@meyering.net>
8057 * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
8058 Reported by Bruno Haible.
8060 2000-07-04 Jim Meyering <jim@meyering.net>
8062 * quotearg.c: Make inclusion of <wchar.h> independent of whether
8063 HAVE_MBRTOWC is set. Required at least for irix-5.6, which
8066 2000-07-03 Paul Eggert <eggert@twinsun.com>
8067 and Bruno Haible <haible@clisp.cons.org>
8069 * quotearg.c (mbrtowc):
8070 Assign to *pwc, and return 1 only if result is nonzero.
8071 (iswprint): Use ISPRINT when substituting our own mbrtowc.
8073 2000-07-03 Jim Meyering <jim@meyering.net>
8075 * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
8076 This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
8079 2000-07-02 Jim Meyering <jim@meyering.net>
8081 * quotearg.c (mbstate_t): Don't define here.
8083 2000-07-02 Jim Meyering <jim@meyering.net>
8085 * nanosleep.c (SIGCONT): Define if not already defined.
8087 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8089 * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
8090 per change in ../m4/ls-mntd-fs.m4.
8091 (read_filesystem_list): Ignore symbolic links.
8093 2000-06-29 Jim Meyering <jim@meyering.net>
8095 * same.c: Include <string.h> or <strings.h>, as appropriate,
8096 for declaration of strcmp.
8098 * long-options.c: Include <stdlib.h>, for declaration of exit.
8100 * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
8101 Avoid warning by casting result to `char *' to remove `const'.
8103 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8105 * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
8107 2000-06-26 Paul Eggert <eggert@twinsun.com>
8109 savedir now sets errno on failure and invokes xmalloc to get memory.
8110 Fix a couple of other minor bugs while we're at it.
8112 * savedir.c (<unistd.h>): Do not include; there's no need.
8113 (NAMLEN): Remove macro.
8114 (malloc, realloc): Remove decls.
8116 ("xalloc.h"): Include.
8117 (NAME_SIZE_DEFAULT): New macro.
8118 (savedir): Use xmalloc / xrealloc to allocate memory.
8119 Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
8120 Skip "" directory entries.
8121 Use strlen to calculate directory entry length, since the old method
8122 is rarely used these days and isn't worth supporting.
8123 Don't use a pointer after freeing it.
8124 Check for integer overflow when calculating allocation size.
8125 Use memcpy to copy entries, instead of stpcpy.
8126 Set errno properly when returning NULL.
8127 Check for readdir error.
8129 2000-06-26 Jim Meyering <jim@meyering.net>
8131 * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
8133 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8135 * getusershell.c (xmalloc, xrealloc): Remove functions.
8137 Don't include <stdlib.h>. Don't declare malloc, realloc.
8139 2000-06-23 Bruno Haible <haible@clisp.cons.org>
8141 * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
8143 2000-06-24 Jim Meyering <jim@meyering.net>
8145 * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
8147 2000-06-21 Jim Meyering <jim@meyering.net>
8149 * getpass.c: New file, from Bruno Haible. Required for BeOS.
8151 2000-06-19 Paul Eggert <eggert@twinsun.com>
8153 * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
8154 (mbrtowc, mbstate_t): Define substitutes if
8155 HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
8156 (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
8157 not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
8159 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8161 * xgetcwd.c (xgetcwd): If the required pathname length is smaller
8162 than 1024, return a memory chunk of least possible size, instead
8163 of size PATH_MAX + 2. In the loop, increment the size proportionally.
8164 Use free/xmalloc instead of xrealloc to avoid copying for very long
8167 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8169 * canon-host.c (canon_host): Use malloc and memcpy to copy an
8170 address, not strdup. Include <stdlib.h> and don't declare free().
8172 2000-06-17 Bruno Haible <haible@clisp.cons.org>
8174 * path-concat.c (path_concat): Don't access dir[-1] if dir is
8177 2000-06-21 Jim Meyering <jim@meyering.net>
8179 * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
8180 (noinst_HEADERS): Add getstr.h.
8182 * getline.c (getstr): Move into a separate file.
8183 * getstr.c (getstr): New file, extracted from getline.c, with
8184 the following changes: new parameter, delim2; both delim[12]
8185 parameters have type `int', not `char'. The latter would lose
8186 with 8-bit delimiters.
8187 * getstr.h: New file.
8189 2000-06-19 Jim Meyering <jim@meyering.net>
8191 * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
8193 2000-06-18 Jim Meyering <jim@meyering.net>
8195 * mkdir.c: Remove file, due mainly to copyright incompatibility.
8196 Besides, these days every porting target provides a mkdir function.
8198 * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
8199 (this snippet comes from src/system.h).
8201 2000-06-15 Paul Eggert <eggert@twinsun.com>
8203 * human.c (adjust_value): New function.
8204 (human_readable_inexact): Apply rounding style even when
8205 printing approximate values.
8207 2000-06-14 Paul Eggert <eggert@twinsun.com>
8209 * human.c (human_readable_inexact): Allow an input block
8210 size that is not a multiple of the output block size, and vice versa.
8211 Reported by Piergiorgio Sartor.
8213 2000-06-14 Paul Eggert <eggert@twinsun.com>
8215 * getdate.y (get_date): Apply relative times after time
8216 zone indicator, not before. Reported by Todd A. Jacobs.
8218 2000-06-13 Jim Meyering <jim@meyering.net>
8220 * Makefile.am (all-local): Depend on lstat.c and stat.c.
8222 * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
8224 2000-06-12 Paul Eggert <eggert@twinsun.com>
8226 * xstat.in: Include <stdlib.h> in lstat, to declare "free".
8228 2000-06-04 Paul Eggert <eggert@twinsun.com>
8230 * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
8232 2000-06-04 Jim Meyering <jim@meyering.net>
8234 * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
8235 SunOS 4.1.4 for which gid_t is an unsigned type.
8237 2000-06-03 Jim Meyering <jim@meyering.net>
8239 * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
8241 2000-05-26 Bruno Haible <haible@clisp.cons.org>
8243 * Makefile.am (install-exec-local): On systems with glibc-2.1 or
8244 newer, don't install charset.alias.
8245 * config.charset: Change the Linux/glibc rules so they become empty
8246 on glibc-2.1 or newer.
8248 2000-06-02 Jim Meyering <jim@meyering.net>
8250 * mountlist.c: Back out last change. Instead, do this...
8251 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
8252 member using the same `ignore'-testing code.
8253 * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
8257 2000-05-29 Jim Meyering <jim@meyering.net>
8259 * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
8260 with the `ignore' attribute. Based on a patch from Mark D. Roth.
8262 2000-05-22 Jim Meyering <jim@meyering.net>
8264 * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
8266 2000-05-18 Jim Meyering <jim@meyering.net>
8268 * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
8269 back, too, since it may have been modified by allocate_entry.
8270 (hash_delete): Rewrite to use neither the assignment operator
8271 nor the comma operator in an if-expression.
8273 2000-05-15 Paul Eggert <eggert@twinsun.com>
8276 <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
8277 Remove; no longer needed.
8278 "quotearg.h": Add include.
8279 (file_name): Do not bother to explicitly initialize to NULL; it's less
8280 efficient on some hosts.
8281 (close_stdout_status): Remove test as to whether stdout was already
8282 closed; it breaks for the case "echo x | sort >&-".
8283 Quote file name colons.
8284 Do not assume that _("write error") lacks format strings.
8286 2000-05-15 Jim Meyering <jim@meyering.net>
8288 * version-etc.c (version_etc_copyright): Update the copyright string
8289 used in all --version output.
8291 2000-05-14 Jim Meyering <jim@meyering.net>
8293 * closeout.c (close_stdout_set_file_name): New function.
8294 (close_stdout_status): Use new file-scoped global.
8295 Return right away if fstat says the stdout file descriptor is invalid.
8296 * closeout.h (close_stdout_set_file_name): Declare.
8298 2000-05-10 Jim Meyering <jim@meyering.net>
8300 * closeout.c [default_exit_status]: New file-scoped variable.
8301 (close_stdout_set_status): New function.
8302 * closeout.h (close_stdout_set_status): Declare.
8304 2000-05-08 Jim Meyering <jim@meyering.net>
8306 * long-options.c: Don't include closeout.h.
8307 (parse_long_options): Don't call close_stdout for --version.
8309 2000-05-06 Jim Meyering <jim@meyering.net>
8311 * strnlen.c: Undefine __strnlen and strnlen.
8312 [!weak_alias]: Define __strnlen to strnlen.
8314 * atexit.c: New file, from libiberty.
8316 2000-05-06 Jim Meyering <jim@meyering.net>
8318 * closeout.c (close_stdout_status): Also check for errors on the
8321 2000-05-05 Bruno Haible <haible@clisp.cons.org>
8323 * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
8324 instead of xmalloc, xrealloc, path_concat.
8325 (locale_charset): Treat empty environment variables as absent.
8326 (DIRECTORY_SEPARATOR, ISSLASH): New macros.
8328 2000-05-04 Jim Meyering <jim@meyering.net>
8330 * getopt.c: Update from glibc.
8331 * obstack.c: Likewise.
8332 * obstack.h: Likewise.
8333 * regex.c: Likewise. NB: K&R compiler support is dropped for this file
8335 * regex.h: Likewise.
8336 * strndup.c: Likewise.
8337 * strnlen.c: New file, from glibc.
8339 2000-05-01 Jim Meyering <jim@meyering.net>
8341 * full-write.c (full_write): Remove `FIXME' part of comment.
8343 2000-04-29 Jim Meyering <jim@meyering.net>
8345 * path-concat.c: Declare strdup only if it's not defined.
8346 * canon-host.c: Likewise.
8348 2000-04-28 Jim Meyering <jim@meyering.net>
8350 * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
8351 redefinition warning on some systems (HPUX). Otherwise, regex.h is
8352 included first, then limits.h is included by locale.h by libintl.h.
8353 From John David Anglin.
8355 2000-04-25 Jim Meyering <jim@meyering.net>
8357 * makepath.c (S_IRWXUGO): Define.
8358 (make_path): Always perform explicit chmod if MODE specifies any
8359 of the `special' permission bits. Prompted by a bug report against
8360 install from Mate Wierdl and Joost van Baal.
8362 2000-04-18 Jim Meyering <jim@meyering.net>
8366 * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
8367 getpagesize. For BeOS. Based on a patch from Bruno Haible.
8369 2000-04-17 Jim Meyering <jim@meyering.net>
8371 * strftime.c (my_strftime) [strftime]: Declare strftime here, since
8372 the definition of it to rpl_strftime also defined-away the system's
8375 2000-04-15 Jim Meyering <jim@meyering.net>
8377 Use `C' to denote so-called `contiguous' files, the same way
8379 * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
8380 (ftypelet): Use S_ISCTG.
8381 From Michael Deutschmann.
8383 2000-04-14 Jim Meyering <jim@meyering.net>
8385 * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
8387 2000-04-08 Jim Meyering <jim@meyering.net>
8389 * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
8390 names don't conflict. Reported by Eli Zaretskii.
8392 2000-03-28 Bruno Haible <haible@clisp.cons.org>
8394 * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
8395 bug. Deal with the different error behavior of Irix iconv.
8397 2000-04-07 Jim Meyering <jim@meyering.net>
8399 * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
8400 to work around system header problems on AIX 3.2.5. From Bruno Haible.
8402 2000-04-05 Jim Meyering <jim@meyering.net>
8404 Portability tweaks required for ultrix4.3.
8405 * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8406 * readutmp.c: Include sys/types.h before sys/stat.h.
8407 * canon-host.c: Declare strdup.
8408 * path-concat.c: Likewise.
8409 From John David Anglin.
8411 2000-04-04 Jim Meyering <jim@meyering.net>
8413 Be more DOS 8.3-friendly.
8414 * ref-add.sin: Renamed from ref-add.sed.in.
8415 * ref-del.sin: Renamed from ref-del.sed.in.
8416 * Makefile.am: Reflect renaming.
8417 Reported by Eli Zaretskii.
8419 Use a temporary file name that won't clash with `charset.alias'
8420 in the DOS 8.3 name space.
8421 * Makefile.am (charset_tmp): Define.
8422 (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8423 (uninstall-local): Likewise.
8424 Reported by Eli Zaretskii.
8426 2000-03-29 Paul Eggert <eggert@twinsun.com>
8428 * time/strftime.c (my_strftime): Make sure we call the system
8429 strftime, not ourselves, when invoking the underlying strftime.
8431 2000-03-24 Jim Meyering <jim@meyering.net>
8433 * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8434 (charset_alias): Define.
8435 (install-exec-local): Factor out common code.
8436 (uninstall-local): Split lines longer than 80.
8437 (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8439 (.sed.in.sed): New rule. Don't redirect directly to $@.
8440 (CLEANFILES): Add ref-add.sed and ref-del.sed.
8442 2000-03-19 Bruno Haible <haible@clisp.cons.org>
8444 * config.charset: Output a line containing "Packages using this file".
8445 * ref-add.sed.in, ref-del.sed.in: New files.
8446 * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8447 ref-del.sed): New rules.
8449 2000-03-17 Jim Meyering <jim@meyering.net>
8451 * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8452 Otherwise, include <strings.h>
8454 2000-03-17 Bruno Haible <haible@clisp.cons.org>
8456 * unicodeio.c (utf8_wctomb): New function.
8457 (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8458 format instead of in UCS-4 with platform dependent endianness.
8460 2000-03-07 Paul Eggert <eggert@twinsun.com>
8462 * savedir.c (savedir): Work even if directory size is
8463 negative; this can happen with some screwy NFS configurations.
8465 2000-03-06 Jim Meyering <jim@meyering.net>
8467 * localcharset.c (get_charset_aliases): Don't try to free file_name
8468 if it's NULL (because we ran out of memory). From Bruno Haible.
8470 2000-03-05 Jim Meyering <jim@meyering.net>
8472 * localcharset.c ("path-concat.h"): Include.
8473 (get_charset_aliases): Use path_concat instead of ANSI string
8476 * unicodeio.h (PARAMS): Define.
8477 Use it to guard prototype.
8479 2000-03-04 Jim Meyering <jim@meyering.net>
8481 * Makefile.am (install-exec-local): Create $(libdir) before installing
8483 (uninstall-local): Uncomment this rule so `make distcheck' works
8486 * unicodeio.c (<errno.h>): Include it.
8487 (errno): Declare if not defined.
8489 * localcharset.c: Add Bruno's comment justifying use of volatile.
8491 * config.charset: New version, incorporating remarks from a linux
8492 i18n mailing list. From Bruno Haible.
8494 2000-03-02 Jim Meyering <jim@meyering.net>
8496 * Makefile.am (EXTRA_DIST): Add config.charset.
8498 2000-03-01 Jim Meyering <jim@meyering.net>
8500 * localcharset.c: Guard some #includes with `#if HAVE_...'.
8501 * unicodeio.c: Likewise.
8503 2000-02-02 Bruno Haible <haible@clisp.cons.org>
8505 * config.charset: New file.
8506 * localcharset.c: New file.
8507 * unicodeio.h, unicodeio.c: New files.
8508 * Makefile.am (DEFS): Add -DLIBDIR=...
8509 (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8510 (noinst_HEADERS): Add unicodeio.h.
8511 (all-local, install-exec-local, charset.alias): New targets.
8513 2000-02-28 Paul Eggert <eggert@twinsun.com>
8515 * quotearg.c (ALERT_CHAR): New macro.
8516 (quotearg_buffer_restyled): Use it.
8518 2000-02-27 Jim Meyering <jim@meyering.net>
8520 * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8521 Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8523 * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8524 not `#if STDC_HEADERS'.
8525 Declare malloc if needed.
8527 * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8528 now that autoconf always defines the HAVE_DECL_ symbols.
8529 * human.c: Likewise.
8531 * strtoumax.c: Likewise.
8533 * backupfile.c: Arrange for cpp to fail if the configure-time
8534 declaration check was not run.
8536 * human.c: Likewise.
8538 * strtoumax.c: Likewise.
8540 * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8541 then first look up the entire `.'-containing string as a login name.
8543 2000-02-18 Paul Eggert <eggert@twinsun.com>
8545 * getdate.y: Handle two-digit years with leading zeros correctly.
8546 (textint): New typedef.
8547 (parser_control): Member year changed from int to textint.
8549 (YYSTYPE): Removed; replaced by %union with int and textint members.
8550 (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8551 tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8552 tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8553 (tSNUMBER, tUNUMBER): Now of type <textintval>.
8554 (date, number, to_year): Use width of number in digits, not its value,
8555 to determine whether it's a 2-digit year, or a 2-digit time.
8556 (yylex): Store number of digits of numeric tokens.
8557 Reported by John Kendall.
8559 (parser_control): Changed from struct parser_control to typedef (for
8560 consistency). All uses changed.
8562 (tID): Removed; not used.
8563 (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8565 2000-02-14 Paul Eggert <eggert@twinsun.com>
8567 * getpagesize.h (getpagesize): Port to VMS for Alpha;
8568 adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8570 2000-02-12 Jim Meyering <jim@meyering.net>
8572 * userspec.c (ISDIGIT): Define it.
8573 (isdigit): Remove definition.
8574 (is_number): Use ISDIGIT, not isdigit.
8575 <libintl.h>: Include.
8577 (parse_user_spec): Mark translatable strings.
8579 2000-02-10 Jim Meyering <jim@meyering.net>
8581 With these changes, nanosleep.[ch] are finally enough like the other
8582 lib/* replacement files to compile on a few more losing systems.
8584 * nanosleep.h: Don't include config.h.
8585 Remove prototype from declaration of nanosleep.
8586 (PARAMS): Remove now-unneeded definition.
8587 * nanosleep.c: #undef nanosleep.
8588 (rpl_nanosleep): Rename from nanosleep.
8590 2000-02-03 Jim Meyering <jim@meyering.net>
8592 * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8593 rather than with `#if HAVE_UTMPNAME'.
8595 2000-02-01 Jim Meyering <jim@meyering.net>
8597 * readutmp.h (UT_USER): Add parens. From Andreas Schwab.
8599 2000-01-31 Jim Meyering <jim@meyering.net>
8601 * nanosleep.h (nanosleep): Guard declaration with
8602 `#if ! HAVE_DECL_NANOSLEEP'.
8603 Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8604 the declaration in that vendor's sys/timers.h.
8605 Reported by Christian Krackowizer.
8607 * quotearg.c (ISASCII): Add #undef and move definition to follow
8608 inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8609 (ISPRINT): Likewise.
8610 Reported by Tom Tromey.
8612 2000-01-30 Jim Meyering <jim@meyering.net>
8614 * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8615 uses of ->ut_name. The latter doesn't work with new Linux header files
8616 where only utmpx.ut_user is declared.
8618 * readutmp.h (UT_USER): Define.
8620 2000-01-23 Jim Meyering <jim@meyering.net>
8622 * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8625 2000-01-22 Jim Meyering <jim@meyering.net>
8627 * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8628 [! HAVE_DECL_STRTOULL]: Declare strtoull.
8629 Required for some AIX systems. Reported by Christian Krackowizer.
8630 [TESTING] (main): New function.
8632 1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
8633 * dirname.c (dir_name): Support for DOS-style file names with drive
8636 * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8638 * strverscmp.c (ISDIGIT): Define.
8639 (strverscmp): Use ISDIGIT, not isdigit.
8641 2000-01-17 Paul Eggert <eggert@twinsun.com>
8643 * nanosleep.c (nanosleep):
8644 Don't use SA_INTERRUPT to decide whether to call sigaction, as
8645 POSIX.1 doesn't require SA_INTERRUPT and some systems
8646 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
8647 it's been part of POSIX.1 since day 1 (in 1988).
8649 2000-01-17 Jim Meyering <jim@meyering.net>
8651 * interlock: Remove unused file. Reported by François Pinard.
8653 2000-01-16 Paul Eggert <eggert@twinsun.com>
8655 * quotearg.c (quotearg_buffer_restyled): Do not quote
8656 alert, backslash, formfeed, and vertical tab unnecessarily in
8657 shell quoting style.
8662 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
8663 Software Foundation, Inc.
8665 Copying and distribution of this file, with or without
8666 modification, are permitted provided the copyright notice
8667 and this notice are preserved.