Compare commits

...

2312 Commits

Author SHA1 Message Date
Jim Meyering
51155d32a3 *** empty log message *** 2000-07-01 15:36:44 +00:00
Jim Meyering
7dbb61f30e *** empty log message *** 2000-07-01 14:06:55 +00:00
Jim Meyering
73202c14e6 . 2000-07-01 14:03:02 +00:00
Jim Meyering
a784ac670f . 2000-07-01 13:58:19 +00:00
Jim Meyering
1002386cc5 *** empty log message *** 2000-07-01 13:43:51 +00:00
Jim Meyering
9657d66244 Remove a `FIXME' comment and fix the associated problem. 2000-07-01 13:43:46 +00:00
Jim Meyering
9a4135570b . 2000-07-01 13:35:52 +00:00
Jim Meyering
7d25895457 *** empty log message *** 2000-07-01 13:35:33 +00:00
Jim Meyering
1ce3f3cca5 Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
per change in ../m4/ls-mntd-fs.m4.
(read_filesystem_list): Ignore symbolic links.
2000-07-01 13:35:28 +00:00
Jim Meyering
879717eafa (jm_LIST_MOUNTED_FILESYSTEMS): Rename BeOS specific
macro from MOUNTED_NEXT_DEV to MOUNTED_FS_STAT_DEV.
2000-07-01 13:31:20 +00:00
Jim Meyering
f00cefa62b *** empty log message *** 2000-07-01 11:01:18 +00:00
Jim Meyering
13133639a4 (TESTS_ENVIRONMENT): Define host_triplet for use in the dangling-symlink test. 2000-07-01 11:01:14 +00:00
Jim Meyering
994724bf67 *** empty log message *** 2000-07-01 11:00:10 +00:00
Jim Meyering
95e3f911e2 Warn about the problem, rather
than failing on some very recent (at least 2.3.99) versions of
the Linux kernel.  Suggestion from Ulrich Drepper.
2000-07-01 10:59:56 +00:00
Jim Meyering
f59a68b49a *** empty log message *** 2000-07-01 09:09:37 +00:00
Jim Meyering
f6d2d9b74c *** empty log message *** 2000-07-01 09:05:13 +00:00
Jim Meyering
c52dea43b7 Put double quotes around use of $cross_compiling. 2000-07-01 09:04:56 +00:00
Jim Meyering
1e4dca2dd1 . 2000-07-01 07:13:53 +00:00
Jim Meyering
7a17620c53 *** empty log message *** 2000-06-30 13:25:12 +00:00
Jim Meyering
1ba4b1a996 *** empty log message *** 2000-06-30 13:25:04 +00:00
Jim Meyering
60cea0e8fe *** empty log message *** 2000-06-29 11:30:16 +00:00
Jim Meyering
d1e34222a8 Include <string.h> or <strings.h>, as appropriate, for declaration of strcmp. 2000-06-29 11:29:55 +00:00
Jim Meyering
13f4d23214 *** empty log message *** 2000-06-29 11:24:14 +00:00
Jim Meyering
2aab0b6a6c Include <stdlib.h>, for declaration of exit. 2000-06-29 11:24:09 +00:00
Jim Meyering
d0ffb1b198 *** empty log message *** 2000-06-29 11:16:29 +00:00
Jim Meyering
81d46d192a (find_bracketed_repeat): Add a cast to suppress a warning. 2000-06-29 11:15:52 +00:00
Jim Meyering
4c27ffdf05 *** empty log message *** 2000-06-29 10:39:57 +00:00
Jim Meyering
86956748b1 (enum): Remove comma from end of enumerator list.
From Gerhard Poul <gpoul@gnu.org
2000-06-29 10:39:41 +00:00
Jim Meyering
ded114511b *** empty log message *** 2000-06-29 10:39:00 +00:00
Jim Meyering
13225e0c76 *** empty log message *** 2000-06-29 08:37:00 +00:00
Jim Meyering
a1fd5e91ff (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
Avoid warning by casting result to `char *' to remove `const'.
2000-06-29 08:30:03 +00:00
Jim Meyering
69b3d52b2a *** empty log message *** 2000-06-28 20:30:59 +00:00
Jim Meyering
27a839a3fa Use stdlib.h, not stdio.h. The latter is not included
by quotearg.c, for which we perform this test.  From Bruno Haible.
2000-06-28 20:29:27 +00:00
Jim Meyering
54b2c4933f *** empty log message *** 2000-06-28 14:06:34 +00:00
Jim Meyering
c93836544c Don't copy `out' into /tmp. 2000-06-28 14:06:30 +00:00
Jim Meyering
457fcbb2ca . 2000-06-27 13:23:13 +00:00
Jim Meyering
0865bd05b4 *** empty log message *** 2000-06-27 13:13:13 +00:00
Jim Meyering
b1b5fb67fc (count_entry): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
2000-06-27 13:12:12 +00:00
Jim Meyering
7e2d22e2a6 (copy_dir): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
2000-06-27 13:11:36 +00:00
Jim Meyering
e068bafb72 *** empty log message *** 2000-06-27 13:11:00 +00:00
Jim Meyering
53ec884edb (change_dir_mode): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
2000-06-27 13:10:50 +00:00
Jim Meyering
7aa50cfb3c (change_dir_owner): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
2000-06-27 13:10:24 +00:00
Jim Meyering
db0cd2f7e6 (change_dir_group): Don't set errno before
invoking savedir, and assume that errno is nonzero if savedir fails.
2000-06-27 13:09:57 +00:00
Jim Meyering
3dc875d9bd *** empty log message *** 2000-06-27 11:21:03 +00:00
Jim Meyering
f4e62844cb . 2000-06-27 10:10:13 +00:00
Jim Meyering
738611829c *** empty log message *** 2000-06-27 10:09:54 +00:00
Jim Meyering
4189da9d74 (libfetish_a_SOURCES): Remove readutmp.c. 2000-06-27 10:09:49 +00:00
Jim Meyering
26a158b619 *** empty log message *** 2000-06-27 10:08:15 +00:00
Jim Meyering
f8a79d9a8c (jm_PREREQ_READUTMP): Likewise. If either <utmp.h> or
<utmpx.h> exists, put readutmp.o into LIBOBJS.
2000-06-27 10:08:09 +00:00
Jim Meyering
ae641fdacf (_jm_DECL_HEADERS): Check for utmp.h as well. 2000-06-27 10:01:30 +00:00
Jim Meyering
0a43597bb8 *** empty log message *** 2000-06-27 07:08:52 +00:00
Jim Meyering
211b5731d7 savedir now sets errno on failure and invokes xmalloc to get memory.
Fix a couple of other minor bugs while we're at it.

(<unistd.h>): Do not include; there's no need.
(NAMLEN): Remove macro.
(malloc, realloc): Remove decls.
(stpcpy): Likewise.
("xalloc.h"): Include.
(NAME_SIZE_DEFAULT): New macro.
(savedir): Use xmalloc / xrealloc to allocate memory.
Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
Skip "" directory entries.
Use strlen to calculate directory entry length, since the old method
is rarely used these days and isn't worth supporting.
Don't use a pointer after freeing it.
Check for integer overflow when calculating allocation size.
Use memcpy to copy entries, instead of stpcpy.
Set errno properly when returning NULL.
Check for readdir error.
2000-06-27 07:08:48 +00:00
Jim Meyering
ae34e4466d *** empty log message *** 2000-06-27 06:33:35 +00:00
Jim Meyering
99c1d22a99 (show_dev): Round disk usage percentage up, not to nearest value.
Use integer arithmetic if it's easy.
Fix bug when converting twos-complement negative values to floating point.
2000-06-27 06:33:31 +00:00
Jim Meyering
b07eb28c60 *** empty log message *** 2000-06-26 13:48:40 +00:00
Jim Meyering
b4fd5c459e *** empty log message *** 2000-06-26 13:30:59 +00:00
Jim Meyering
dfaf03f037 *** empty log message *** 2000-06-26 10:55:57 +00:00
Jim Meyering
204a9ee115 [HAVE_STDLIB_H]: Include stdlib.h. 2000-06-26 10:55:18 +00:00
Jim Meyering
43c77218e4 *** empty log message *** 2000-06-26 06:33:22 +00:00
Jim Meyering
9abfcc500a `id -Gn' (invoked by groups) would fail without giving a diagnostic
on malconfigured systems.
(print_user): Give a diagnostic if number->name lookup fails.
(print_group): Likewise.
2000-06-26 06:32:58 +00:00
Jim Meyering
ac4e995ed3 *** empty log message *** 2000-06-25 21:19:41 +00:00
Jim Meyering
d705cb724b (xmalloc, xrealloc): Remove functions.
Include xalloc.h.
Don't include <stdlib.h>.  Don't declare malloc, realloc.
2000-06-25 21:17:32 +00:00
Jim Meyering
e195cd0425 *** empty log message *** 2000-06-25 21:03:05 +00:00
Jim Meyering
0adbb52608 *** empty log message *** 2000-06-25 20:20:28 +00:00
Jim Meyering
c72f18b2c3 (TESTS): Add fail-perm. 2000-06-25 20:20:23 +00:00
Jim Meyering
0a0e82382c *** empty log message *** 2000-06-25 20:19:52 +00:00
Jim Meyering
34591391d1 *** empty log message *** 2000-06-25 20:15:22 +00:00
Jim Meyering
ab50b6880f *** empty log message *** 2000-06-25 15:58:47 +00:00
Jim Meyering
92ead9886c (copy_internal): Don't return return immediately after a
failed copy_dir call -- otherwise, the failure to read a single file
in a source directory would cause the containing destination directory
not to have owner/perms set properly.  Reported by Piotr Kwapulinski.
2000-06-25 15:50:51 +00:00
Jim Meyering
8a900584f1 *** empty log message *** 2000-06-25 15:50:38 +00:00
Jim Meyering
18252dc7fc *** empty log message *** 2000-06-25 15:50:29 +00:00
Jim Meyering
046110aa3f *** empty log message *** 2000-06-25 15:49:21 +00:00
Jim Meyering
a7109e215e *** empty log message *** 2000-06-25 14:15:22 +00:00
Jim Meyering
125499c09f *** empty log message *** 2000-06-25 08:49:02 +00:00
Jim Meyering
ca8a119779 Include stdio.h before wchar.h to work around
Linux header bug when _XOPEN_SOURCE is defined to 500.
2000-06-25 08:48:58 +00:00
Jim Meyering
484752fa80 *** empty log message *** 2000-06-25 06:54:36 +00:00
Jim Meyering
a9fad38c18 (print_unicode_char): Work around ansi2knr deficiency. 2000-06-25 06:54:32 +00:00
Jim Meyering
0d67b070d4 *** empty log message *** 2000-06-24 21:05:11 +00:00
Jim Meyering
402a8fdd9b If the compile-test says
strerror_r doesn't work, then resort to a `run'-test that works on
BeOS and segfaults on DEC Unix.
2000-06-24 21:04:44 +00:00
Jim Meyering
d488baf54a check for decl unconditionally 2000-06-24 14:03:10 +00:00
Jim Meyering
806c3e7fb8 . 2000-06-24 12:25:39 +00:00
Jim Meyering
102a04f2aa . 2000-06-24 12:21:52 +00:00
Jim Meyering
c66b857850 *** empty log message *** 2000-06-24 12:05:18 +00:00
Jim Meyering
f89094c7de Revive this file -- to try out an experimental
version of AC_FUNC_STRERROR_R that may work even on BeOS, a system
for which strerror does return char*, but which lacks a conveniently
accessible declaration of the function.
2000-06-24 12:05:08 +00:00
Jim Meyering
790705a7c1 *** empty log message *** 2000-06-24 12:01:29 +00:00
Jim Meyering
5061035e88 [!HAVE_DECL_STRERROR_R]: Declare strerror_r. 2000-06-24 12:01:03 +00:00
Jim Meyering
a2d975a44d Lots of minor rewording and grammar correction.
From Brian Youmans.
2000-06-24 11:53:51 +00:00
Jim Meyering
4604a7892b *** empty log message *** 2000-06-24 11:52:38 +00:00
Jim Meyering
4434e513bc *** empty log message *** 2000-06-24 07:38:05 +00:00
Jim Meyering
39f35a55d3 tweak copyright 2000-06-24 07:37:55 +00:00
Jim Meyering
a6e6a1e05b (sysv_sum_file): Avoid overflowing 32-bit accumulator
on files larger than 256 MB.
2000-06-24 07:37:44 +00:00
Jim Meyering
1cc0f0d268 . 2000-06-24 07:36:54 +00:00
Jim Meyering
a674a3c010 *** empty log message *** 2000-06-24 07:36:14 +00:00
Jim Meyering
fad24ae80d *** empty log message *** 2000-06-24 07:18:29 +00:00
Jim Meyering
d7ad628832 *** empty log message *** 2000-06-24 07:13:07 +00:00
Jim Meyering
dc53d8e807 *** empty log message *** 2000-06-24 07:12:56 +00:00
Jim Meyering
fff7bfc374 . 2000-06-23 21:09:12 +00:00
Jim Meyering
957ec50ac0 *** empty log message *** 2000-06-23 21:06:45 +00:00
Jim Meyering
fef29da8fb Include <wctype.h> after <wchar.h>,
for Solaris 2.5.
(mbrtowc, mbstate_t): Define substitutes if
HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
(iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
2000-06-23 21:05:50 +00:00
Jim Meyering
284905fbb9 *** empty log message *** 2000-06-23 21:03:06 +00:00
Jim Meyering
266d043345 *** empty log message *** 2000-06-23 21:02:23 +00:00
Jim Meyering
a78edc50b8 (jm_PREREQ_QUOTEARG): Use AC_MBSTATE_T_OBJECT. Add check for iswprint. 2000-06-23 21:02:15 +00:00
Jim Meyering
f2d46d3970 New file, defining AC_MBSTATE_T_OBJECT. 2000-06-23 21:00:53 +00:00
Jim Meyering
085cdb43ed *** empty log message *** 2000-06-23 14:03:02 +00:00
Jim Meyering
6273f25d7d *** empty log message *** 2000-06-23 13:50:42 +00:00
Jim Meyering
1a5bab10b7 Add missing AC_MSG_RESULT.
Reported by Bruno Haible.
2000-06-23 13:49:17 +00:00
Jim Meyering
4e56a001c6 s/AC_MSG_CHECKING/AC_CHECKING/.
Suggestion from Bruno Haible.
2000-06-23 13:43:41 +00:00
Jim Meyering
cd64b836fc *** empty log message *** 2000-06-22 17:10:56 +00:00
Jim Meyering
62e3f1f1ef (main): Correct a comment. 2000-06-22 17:10:51 +00:00
Jim Meyering
1407c2894a *** empty log message *** 2000-06-21 20:23:21 +00:00
Jim Meyering
5e3ab81b7a (AC_REPLACE_FUNCS): Add getpass. 2000-06-21 20:23:14 +00:00
Jim Meyering
c514878446 ansideclify 2000-06-21 20:21:03 +00:00
Jim Meyering
9f0aa11144 New file, from Bruno Haible. Required for BeOS. 2000-06-21 20:20:27 +00:00
Jim Meyering
50f86c9fe7 *** empty log message *** 2000-06-21 20:16:10 +00:00
Jim Meyering
978bf5f750 (xgetcwd): If the required pathname length is smaller
than 1024, return a memory chunk of least possible size, instead
of size PATH_MAX + 2. In the loop, increment the size proportionally.
Use free/xmalloc instead of xrealloc to avoid copying for very long paths.
2000-06-21 20:16:03 +00:00
Jim Meyering
0c3c6ef55e *** empty log message *** 2000-06-21 14:47:04 +00:00
Jim Meyering
0ce8428a9d *** empty log message *** 2000-06-21 13:00:54 +00:00
Jim Meyering
fc71e28b65 (canon_host): Use malloc and memcpy to copy an
address, not strdup.  Include <stdlib.h> and don't declare free().
2000-06-21 13:00:49 +00:00
Jim Meyering
d32395693a *** empty log message *** 2000-06-21 12:56:40 +00:00
Jim Meyering
bb6ebcc333 (path_concat): Don't access dir[-1] if dir is the empty string. 2000-06-21 12:56:33 +00:00
Jim Meyering
08cd18bc45 include getstr.h 2000-06-21 09:56:42 +00:00
Jim Meyering
c60941056f *** empty log message *** 2000-06-21 09:21:52 +00:00
Jim Meyering
ddcbe0decc (libfetish_a_SOURCES): Add getstr.c.
(noinst_HEADERS): Add getstr.h.
2000-06-21 09:21:22 +00:00
Jim Meyering
6b01706633 (getstr): Remove private (and out of date) version of this function.
(cut_fields): Adjust caller to use the just-extended one in ../lib.
2000-06-21 09:20:40 +00:00
Jim Meyering
791fddaac0 *** empty log message *** 2000-06-21 09:20:23 +00:00
Jim Meyering
468b38dfad *** empty log message *** 2000-06-21 09:16:21 +00:00
Jim Meyering
912179f001 (getstr): Move into a separate file. 2000-06-21 09:12:30 +00:00
Jim Meyering
b41ca587a1 copyright date 2000-06-21 09:10:32 +00:00
Jim Meyering
671fdfa887 *** empty log message *** 2000-06-21 09:09:57 +00:00
Jim Meyering
b865bd0619 New file, extracted from getline.c, with the following
changes: new parameter, delim2; both delim[12] parameters have type
`int', not `char'.  The latter would lose with 8-bit delimiters.
2000-06-21 09:09:22 +00:00
Jim Meyering
7b6e7a7341 *** empty log message *** 2000-06-21 09:02:48 +00:00
Jim Meyering
75d9e7ca5c New test for that. 2000-06-21 09:02:42 +00:00
Jim Meyering
e1e0683c82 (valid_options): Don't segfault on `stty erase -'. 2000-06-21 07:29:03 +00:00
Jim Meyering
4be8db746e *** empty log message *** 2000-06-21 07:28:13 +00:00
Jim Meyering
20deee54fc *** empty log message *** 2000-06-20 06:55:04 +00:00
Jim Meyering
2ed1f74efe *** empty log message *** 2000-06-20 06:46:41 +00:00
Jim Meyering
b1c4d0148a (main): Fix off-by-argc test, so +N-style options are recognized once again.
Reported by Geoff Keunning.
Fix typo in diagnostic: s/compare/skip/.
2000-06-20 06:46:28 +00:00
Jim Meyering
700b4bde5e *** empty log message *** 2000-06-20 06:44:21 +00:00
Jim Meyering
759740c7e2 *** empty log message *** 2000-06-19 09:50:25 +00:00
Jim Meyering
6574dd60d9 (AC_REPLACE_FUNCS): Remove mkdir. 2000-06-19 09:50:20 +00:00
Jim Meyering
f4bfd0cb38 . 2000-06-19 09:48:46 +00:00
Jim Meyering
243036c5fb [HAVE_NLIST_H] (NLIST_STRUCT): Define. 2000-06-19 07:25:01 +00:00
Jim Meyering
5debbcc139 revert last change 2000-06-19 07:19:41 +00:00
Jim Meyering
5b728e9bad *** empty log message *** 2000-06-19 06:55:11 +00:00
Jim Meyering
a49d66ffdf . 2000-06-19 06:51:58 +00:00
Jim Meyering
fa168b1e06 *** empty log message *** 2000-06-18 18:17:03 +00:00
Jim Meyering
570ad2486a Include memory.h, string.h, and/or strings.h as needed.
(this snippet comes from src/system.h).
2000-06-18 18:16:54 +00:00
Jim Meyering
1b63505cf9 *** empty log message *** 2000-06-18 18:08:15 +00:00
Jim Meyering
5a14292fa3 (jm_AC_FUNC_LINK_FOLLOWS_SYMLINK): Change the
`checking whether...' message to be consistent with that of the
lstat test.
2000-06-18 18:07:51 +00:00
Jim Meyering
47f6723289 . 2000-06-18 17:47:39 +00:00
Jim Meyering
890e86b6f9 s/NLIST_STRUCT/HAVE_NLIST_H/. Remove big
multi-platform `#ifndef NLIST_STRUCT' block.
2000-06-18 06:17:54 +00:00
Jim Meyering
24c39da8d3 *** empty log message *** 2000-06-17 19:24:59 +00:00
Jim Meyering
4d8f97fea7 Don't fail (just exit 77) if strip doesn't work.
Add canonical trap/mkdir/cd, plus exit portability cruft.
2000-06-17 19:24:39 +00:00
Jim Meyering
a6ef8dfbab . 2000-06-17 18:47:21 +00:00
Jim Meyering
cb06271257 . 2000-06-17 18:46:57 +00:00
Jim Meyering
bb03de1c1d . 2000-06-17 18:46:16 +00:00
Jim Meyering
005d0a41ea *** empty log message *** 2000-06-17 18:35:44 +00:00
Jim Meyering
b657cf747d s/AM_FUNC_GETLOADAVG/AC_FUNC_GETLOADAVG/ 2000-06-17 18:34:33 +00:00
Jim Meyering
89f447ce9f (AM_FUNC_GETLOADAVG): Replace with AC_FUNC_GETLOADAVG
from autoconf, and tweak the latter to accept an optional argument.
2000-06-17 18:33:50 +00:00
Jim Meyering
e6588db39b *** empty log message *** 2000-06-17 18:31:59 +00:00
Jim Meyering
ad0f6161db (jm_GLIBC21): Define GLIBC21 for Makefiles, not for C. 2000-06-17 18:31:51 +00:00
Jim Meyering
eea83d97cb *** empty log message *** 2000-06-16 12:51:33 +00:00
Jim Meyering
ff5aea354f (adjust_value): New function.
(human_readable_inexact): Apply rounding style even when
printing approximate values.
2000-06-16 12:51:28 +00:00
Jim Meyering
a6b9441450 (print_size): Round disk usage up. 2000-06-16 12:50:27 +00:00
Jim Meyering
78362b9aa4 (print_dir, gobble_file, print_long_format, print_file_name_and_frills):
Round disk usage up.
2000-06-16 12:49:52 +00:00
Jim Meyering
f570d032b4 (df_readable): New arg for rounding style.
Round negative numbers correctly.
(show_dev): Round disk usage up and disk free space down.
2000-06-16 12:49:20 +00:00
Jim Meyering
0e2ebc67e2 *** empty log message *** 2000-06-16 12:48:22 +00:00
Jim Meyering
2795faa36f (copy_reg): Give a slightly better diagnostic. 2000-06-16 12:47:36 +00:00
Jim Meyering
90d6a55246 *** empty log message *** 2000-06-15 19:46:54 +00:00
Jim Meyering
998ec04ca6 . 2000-06-15 13:21:12 +00:00
Jim Meyering
bbf6278831 *** empty log message *** 2000-06-15 12:50:53 +00:00
Jim Meyering
c659fb7125 *** empty log message *** 2000-06-15 12:47:46 +00:00
Jim Meyering
cbb9845165 *** empty log message *** 2000-06-15 12:43:28 +00:00
Jim Meyering
59845523f3 *** empty log message *** 2000-06-15 12:21:20 +00:00
Jim Meyering
fbc3c192c1 (human_readable_inexact): Allow an input block
size that is not a multiple of the output block size, and vice versa.
2000-06-15 12:21:10 +00:00
Jim Meyering
862fc25f11 *** empty log message *** 2000-06-15 12:11:18 +00:00
Jim Meyering
8591cce725 tweak comment 2000-06-15 12:11:14 +00:00
Jim Meyering
e18cb636a8 Add tests for getdate.y fix. 2000-06-15 12:10:15 +00:00
Jim Meyering
474a9f7a56 *** empty log message *** 2000-06-15 07:58:06 +00:00
Jim Meyering
b7aa5f3206 (get_date): Apply relative times after time zone indicator, not before. 2000-06-15 07:57:58 +00:00
Jim Meyering
c787140255 *** empty log message *** 2000-06-14 19:44:39 +00:00
Jim Meyering
94c7b9bcfc *** empty log message *** 2000-06-14 17:06:40 +00:00
Jim Meyering
b8264a299d (framework_failure): Initialize this instead of test_failure. 2000-06-14 16:53:36 +00:00
Jim Meyering
26ceb4bc22 *** empty log message *** 2000-06-14 07:43:46 +00:00
Jim Meyering
80530f9ebf . 2000-06-13 09:19:08 +00:00
Jim Meyering
ab6ddc13f2 (all-local): Depend on lstat.c and stat.c. 2000-06-13 09:18:30 +00:00
Jim Meyering
e784cd8520 *** empty log message *** 2000-06-13 09:08:50 +00:00
Jim Meyering
54e57758aa [!HAVE_DECL_FREE]: Declare free in lstat.c. 2000-06-13 09:08:47 +00:00
Jim Meyering
787e2d6289 *** empty log message *** 2000-06-13 09:06:10 +00:00
Jim Meyering
b198a20555 Include <stdlib.h> in lstat, to declare "free". 2000-06-13 09:05:16 +00:00
Jim Meyering
54ab4a172f *** empty log message *** 2000-06-12 08:42:18 +00:00
Jim Meyering
1af3ad04de Clean up.
Be careful to remove temp directory upon interrupt.
2000-06-12 08:42:08 +00:00
Jim Meyering
0eaacfd00a remove RM 2000-06-12 08:34:00 +00:00
Jim Meyering
5c063f91ff . 2000-06-12 08:20:46 +00:00
Jim Meyering
bf6f52d7f5 . 2000-06-12 08:19:36 +00:00
Jim Meyering
132f9c716e *** empty log message *** 2000-06-12 08:13:10 +00:00
Jim Meyering
b89b71f63e . 2000-06-12 07:42:01 +00:00
Jim Meyering
675538e965 *** empty log message *** 2000-06-12 06:59:30 +00:00
Jim Meyering
14e29d814e *** empty log message *** 2000-06-12 06:10:28 +00:00
Jim Meyering
5bdf244d0d (TESTS): Add diag. 2000-06-12 06:10:23 +00:00
Jim Meyering
3e9e02727b (main): Give the correct diagnostic when using the
--target-dir=DIR option, but no arguments.
Patch from Michael Stone.  Reported by herbert@gondor.apana.org.au.
2000-06-12 06:09:32 +00:00
Jim Meyering
9af1ed39b5 *** empty log message *** 2000-06-12 06:07:42 +00:00
Jim Meyering
32dd0d64b9 *** empty log message *** 2000-06-12 06:01:06 +00:00
Jim Meyering
66fcd6e2eb *** empty log message *** 2000-06-12 05:51:16 +00:00
Jim Meyering
d4f4a5c5f1 *** empty log message *** 2000-06-09 23:59:51 +00:00
Jim Meyering
9a684a5b1f *** empty log message *** 2000-06-09 23:28:57 +00:00
Jim Meyering
9fea42bfd6 . 2000-06-09 23:28:54 +00:00
Jim Meyering
e29c5e38f8 Typo-fixes and some clean-up from Brian Youmans. 2000-06-09 22:59:04 +00:00
Jim Meyering
3c1a0b9db7 tweak references after Brian's changes 2000-06-08 20:17:59 +00:00
Jim Meyering
14a2802aba A few typos and minor formatting fixes. 2000-06-08 17:01:51 +00:00
Jim Meyering
736995d606 (Multiple Changes): Fix typo. 2000-06-08 16:56:30 +00:00
Jim Meyering
5cce6821e1 *** empty log message *** 2000-06-06 21:42:04 +00:00
Jim Meyering
ced45c88d4 . 2000-06-06 21:40:56 +00:00
Jim Meyering
b810bd54a0 *** empty log message *** 2000-06-06 20:30:59 +00:00
Jim Meyering
179f99492b (AC_SYS_LARGEFILE_FLAGS,
AC_SYS_LARGEFILE_SPACE_APPEND): Remove.
(AC_SYS_LARGEFILE_TEST_INCLUDES): New macro.
(AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from
CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY.
All uses changed.
Instead of inspecting the output of getconf, try to compile the
test program without and with the macro definition.
(AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check
for getconf.  Instead, check for the needed flags by compiling
test programs.
2000-06-06 20:30:34 +00:00
Jim Meyering
a605579011 (alpha_subdir): Factor out `gnu/fetish'. 2000-06-06 20:09:35 +00:00
Jim Meyering
0c0c2d5f40 *** empty log message *** 2000-06-04 21:58:42 +00:00
Jim Meyering
55babc7fe1 *** empty log message *** 2000-06-04 13:28:45 +00:00
Jim Meyering
1f07d34ed2 Include <config.h> if HAVE_CONFIG_H. 2000-06-04 13:20:20 +00:00
Jim Meyering
8e2e012dc9 . 2000-06-04 08:13:25 +00:00
Jim Meyering
3962d775bf Put kludge in if-then...fi block. 2000-06-04 07:30:07 +00:00
Jim Meyering
1faa6a399a *** empty log message *** 2000-06-04 06:53:32 +00:00
Jim Meyering
98a1d5e72a (show_point) [HAVE_REALPATH && !HAVE_RESOLVEPATH]:
Cast undeclared `realpath' to char* to avoid warning.
2000-06-04 06:51:46 +00:00
Jim Meyering
985cf06296 (getugroups): Cast -1 to gid_t, for systems like
SunOS4.1.4 for which gid_t is an unsigned type.
2000-06-04 06:47:31 +00:00
Jim Meyering
377d7cdb85 *** empty log message *** 2000-06-04 06:41:13 +00:00
Jim Meyering
86c8226819 move vmp decl back out to the scope where it belongs 2000-06-03 22:09:03 +00:00
Jim Meyering
e5f1a12c6b *** empty log message *** 2000-06-03 21:47:48 +00:00
Jim Meyering
c588f96c37 [!HAVE_DECL_MEMCHR]: Declare memchr. 2000-06-03 21:47:37 +00:00
Jim Meyering
51cee2cf8d *** empty log message *** 2000-06-03 12:41:19 +00:00
Jim Meyering
b0619089c9 (jm_PREREQ_HUMAN): Use []-quoted list in AC_CHECK_DECLS,
now that autoconf requires that.
2000-06-03 12:40:56 +00:00
Jim Meyering
e78fd6ee39 *** empty log message *** 2000-06-03 12:22:37 +00:00
Jim Meyering
2e8629e442 Add a kludge to make autoheader emit the required
#undefs.  E.g., #undef HAVE_DECL_FERROR_UNLOCKED.
Use []-quoted list in AC_CHECK_DECLS, now that autoconf requires that.
2000-06-03 12:22:33 +00:00
Jim Meyering
111cdb39c3 . 2000-06-03 08:34:45 +00:00
Jim Meyering
1b306b070e (install-exec-local): On systems with glibc-2.1 or
newer, don't install charset.alias.
2000-06-03 08:34:34 +00:00
Jim Meyering
70ac95bbb2 Change the Linux/glibc rules so they become empty on glibc-2.1 or newer. 2000-06-03 08:34:18 +00:00
Jim Meyering
43585ddb5e *** empty log message *** 2000-06-03 08:33:04 +00:00
Jim Meyering
410cb32814 Add comment to AC_DEFINE_UNQUOTED use. 2000-06-03 08:29:33 +00:00
Jim Meyering
ea146bfd07 . 2000-06-03 08:26:05 +00:00
Jim Meyering
534576fad0 Use jm_GLIBC21. 2000-06-03 08:25:33 +00:00
Jim Meyering
6f7ac74eb3 New file. From Bruno Haible. 2000-06-03 08:23:54 +00:00
Jim Meyering
f6639dbe36 *** empty log message *** 2000-06-03 08:19:42 +00:00
Jim Meyering
f29147b4a1 *** empty log message *** 2000-06-03 08:18:18 +00:00
Jim Meyering
757e85d993 *** empty log message *** 2000-06-03 08:15:24 +00:00
Jim Meyering
b662dfc657 Allow -v as synonym for --verbose, to be consistent with other fileutils. 2000-06-03 08:11:08 +00:00
Jim Meyering
8cb9b753c5 Allow -v as synonym for --verbose, to be consistent with other fileutils. 2000-06-03 08:10:37 +00:00
Jim Meyering
2d5e52c70d (usage): Document that -v is a synonym for --verbose. 2000-06-03 08:09:53 +00:00
Jim Meyering
4eb4f8c624 *** empty log message *** 2000-06-02 21:49:50 +00:00
Jim Meyering
59ee5c9f35 *** empty log message *** 2000-06-02 11:54:35 +00:00
Jim Meyering
209099c9d9 Back out last change. Instead, do this...
(read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
member using the same `ignore'-testing code.
2000-06-02 11:20:47 +00:00
Jim Meyering
8f245c6f2c (ME_DUMMY): Add `autofs' to the list of ignored fs_type strings.
From Mark D. Roth.
2000-06-02 11:20:30 +00:00
Jim Meyering
8208033b86 *** empty log message *** 2000-05-29 21:06:20 +00:00
Jim Meyering
afa54698c9 Adapt to fit new semantics of `cp -d'. 2000-05-29 21:05:22 +00:00
Jim Meyering
a4791b30ea *** empty log message *** 2000-05-29 21:05:13 +00:00
Jim Meyering
f06a2374fd Allow `cp -d -u' to copy one symlink onto another that's identical.
(copy_internal): Change the || to ^ in the big sameness
test, so copying one symlink onto another, identical one doesn't fail here.
If the symlink call fails, don't report the failure if the destination
already exists and is a symlink pointing to the proper name.
2000-05-29 21:05:07 +00:00
Jim Meyering
ff9eb12809 . 2000-05-29 20:44:25 +00:00
Jim Meyering
472729831e (TESTS): Add slink-2-slink. 2000-05-29 20:44:03 +00:00
Jim Meyering
4fc0af40aa *** empty log message *** 2000-05-29 20:41:10 +00:00
Jim Meyering
11c6d21d52 (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
with the `ignore' attribute.  Based on a patch from Mark D. Roth.
2000-05-29 16:23:45 +00:00
Jim Meyering
ab2c79328e *** empty log message *** 2000-05-29 16:23:04 +00:00
Jim Meyering
40acdda1b3 . 2000-05-29 16:22:03 +00:00
Jim Meyering
ad435461eb *** empty log message *** 2000-05-29 16:20:07 +00:00
Jim Meyering
8b59f3a9e5 *** empty log message *** 2000-05-29 15:43:12 +00:00
Jim Meyering
1a0017092d . 2000-05-28 21:29:14 +00:00
Jim Meyering
769aaffc24 bump serial number 2000-05-28 21:28:05 +00:00
Jim Meyering
2981d74992 (AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Rename from
jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK.
2000-05-28 21:27:04 +00:00
Jim Meyering
5ccb8ddd83 *** empty log message *** 2000-05-28 21:24:54 +00:00
Jim Meyering
6aff8653fe (AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Rename from
jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK.
2000-05-28 21:24:42 +00:00
Jim Meyering
42cfd00757 . 2000-05-28 21:21:42 +00:00
Jim Meyering
3cec0fda7b *** empty log message *** 2000-05-28 17:36:36 +00:00
Jim Meyering
4957557813 s/jm_FUNC_STRERROR_R/AC_FUNC_STRERROR_R/. 2000-05-28 16:49:22 +00:00
Jim Meyering
619bbd4ce6 . 2000-05-28 16:48:25 +00:00
Jim Meyering
15a9b83bdd . 2000-05-27 21:26:50 +00:00
Jim Meyering
d73513786d Arrange to call close_stdout upon exit.
Don't close stdout explicitly.
(usage): Add missing backslash at end of line.
(write_header): Remove now-unused COMMENT parameter.
Update all callers.
2000-05-27 21:17:39 +00:00
Jim Meyering
8ccf29f7fe Arrange to call close_stdout upon exit.
Don't close stdout explicitly.  Replace uses of global constant,
output_desc, with uses of STDOUT_FILENO.
2000-05-27 21:14:26 +00:00
Jim Meyering
c8afcbe2e7 *** empty log message *** 2000-05-26 21:39:19 +00:00
Jim Meyering
37cbfc8c6b Use $cross_compiling', not $ac_cv_prog_cc_cross'. 2000-05-26 21:39:16 +00:00
Jim Meyering
40b91250bc *** empty log message *** 2000-05-25 07:14:22 +00:00
Jim Meyering
87da84ba81 (close_stdout_wrapper): Don't dereference NULL pointer.
From Bob Proulx.
2000-05-25 07:14:13 +00:00
Jim Meyering
8b45419759 *** empty log message *** 2000-05-24 07:50:18 +00:00
Jim Meyering
9ca281e5b3 Use []-quoted list in AC_CHECK_MEMBERS, now that autoconf requires that. 2000-05-24 07:50:05 +00:00
Jim Meyering
d2586a214a Use []-quoted list in AC_CHECK_MEMBERS, now that autoconf requires that. 2000-05-24 07:49:38 +00:00
Jim Meyering
429093f9ad (jm_LIB_CHECK): Use []-quoted list in
AC_CHECK_MEMBERS, now that autoconf requires that.
2000-05-24 07:49:09 +00:00
Jim Meyering
35aaf0b09d (jm_PREREQ_READUTMP): Use []-quoted list in
AC_CHECK_MEMBERS, now that autoconf requires that.
2000-05-24 07:48:04 +00:00
Jim Meyering
3ed09573d7 (jm_CHECK_DECLS): Use []-quoted list in AC_CHECK_DECLS,
now that autoconf requires that.
2000-05-24 07:46:55 +00:00
Jim Meyering
449fa131d6 (head_file): Use STDIN_FILENO in place of `0'.
(main): Likewise.
2000-05-24 07:10:12 +00:00
Jim Meyering
0de83d1d81 *** empty log message *** 2000-05-23 21:14:40 +00:00
Jim Meyering
2aeb21d67a Add traps to clean up.
Correct broken running-as-root test.
2000-05-23 21:14:33 +00:00
Jim Meyering
dfdfbc22b3 Exit 77 when run as root. Reported by Andreas Schwab. 2000-05-23 21:13:28 +00:00
Jim Meyering
5f3b8f3038 . 2000-05-23 08:42:18 +00:00
Jim Meyering
f29de82520 . 2000-05-22 22:08:15 +00:00
Jim Meyering
1117d0586a *** empty log message *** 2000-05-22 22:07:29 +00:00
Jim Meyering
36595ef3f7 Require jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK. 2000-05-22 08:35:36 +00:00
Jim Meyering
b8c130d091 Remove old, now-unnecessary `#ifdef __MSDOS__' block. 2000-05-22 06:24:50 +00:00
Jim Meyering
b5431fdfdf *** empty log message *** 2000-05-21 07:14:41 +00:00
Jim Meyering
24f2bd8c9f Arrange to call close_stdout upon exit. Don't close stdout explicitly. 2000-05-20 22:06:38 +00:00
Jim Meyering
ac81803363 Arrange to call close_stdout upon exit. Don't close stdout explicitly. 2000-05-20 22:04:40 +00:00
Jim Meyering
b2c7c6055d Arrange to call close_stdout upon exit. Don't close stdout explicitly. 2000-05-20 22:04:16 +00:00
Jim Meyering
c75dc9689e Arrange to call close_stdout upon exit. Don't close stdout explicitly. 2000-05-20 22:03:55 +00:00
Jim Meyering
02f7878928 Arrange to call close_stdout upon exit. Don't close stdout explicitly.
(but set exit status and file name, too)
2000-05-20 22:03:12 +00:00
Jim Meyering
a311f0eac5 . 2000-05-20 21:48:55 +00:00
Jim Meyering
482aa7fc64 *** empty log message *** 2000-05-20 15:49:03 +00:00
Jim Meyering
8985201718 *** empty log message *** 2000-05-20 15:46:52 +00:00
Jim Meyering
7de6407b72 *** empty log message *** 2000-05-20 15:45:10 +00:00
Jim Meyering
579105347d *** empty log message *** 2000-05-20 15:43:44 +00:00
Jim Meyering
039c76fc63 *** empty log message *** 2000-05-20 15:39:13 +00:00
Jim Meyering
8f8938e366 add format args to match new %lu directives 2000-05-20 15:37:26 +00:00
Jim Meyering
15ecc0f435 tweak warning diagnostic 2000-05-20 12:41:13 +00:00
Jim Meyering
b34c9d22e4 *** empty log message *** 2000-05-20 09:46:19 +00:00
Jim Meyering
97b943feb3 (jm_PREREQ_HUMAN): New macro.
(jm_PREREQ): Use it.
2000-05-20 09:46:14 +00:00
Jim Meyering
836e28186c (TESTS): Add i-2. 2000-05-20 09:45:08 +00:00
Jim Meyering
91d525cd50 *** empty log message *** 2000-05-20 09:44:46 +00:00
Jim Meyering
586b7bf510 *** empty log message *** 2000-05-20 09:44:20 +00:00
Jim Meyering
d0cc040dd8 *** empty log message *** 2000-05-20 09:43:40 +00:00
Jim Meyering
358c9c706a *** empty log message *** 2000-05-20 09:35:13 +00:00
Jim Meyering
dd19256dcd . 2000-05-20 09:31:14 +00:00
Jim Meyering
8fad3eb9e0 . 2000-05-20 09:30:01 +00:00
Jim Meyering
1adc899668 . 2000-05-20 09:24:29 +00:00
Jim Meyering
de4a1fe053 *** empty log message *** 2000-05-20 09:23:48 +00:00
Jim Meyering
5c34a06b45 (struct File_spec) [have_device, st_dev]: New members 2000-05-20 09:23:41 +00:00
Jim Meyering
f5fb72e12c Save device number as well as inode number for each directory.
(struct active_dir_ent) [st_dev]: New member.
[st_ino]: Rename from `inum'.
(make_active_dir_ent) [device]: New parameter.
(hash_compare_active_dir_ents): Compare using SAME_INODE macro.
(fspec_init_common): New function, factored out.
(fspec_init_file): Initialize have_device member.
(fspec_get_full_mode): Remove parameter.  Update caller.
Set have_device and st_dev members.
2000-05-20 09:23:27 +00:00
Jim Meyering
8fd90d4b2b add RUN_EXPENSIVE_TESTS junk 2000-05-20 09:09:18 +00:00
Jim Meyering
d402b210ea don't use $test 2000-05-20 08:52:03 +00:00
Jim Meyering
619ffb2bff fail if final rm fails 2000-05-20 08:48:39 +00:00
Jim Meyering
abd2b295f2 Clean up. 2000-05-20 08:42:44 +00:00
Jim Meyering
396069fce5 reorder so as not to use `head -c N' 2000-05-20 08:11:51 +00:00
Jim Meyering
a5c0da5365 (LC_ALL): Set it unconditionally. 2000-05-19 22:37:45 +00:00
Jim Meyering
bc009f5b5f warn the user it will take a while 2000-05-19 07:12:09 +00:00
Jim Meyering
5c136d939e put hash at the end of the list 2000-05-19 07:10:09 +00:00
Jim Meyering
b55a5cc86c (rm): Combine adjacent fputc and fprintf. 2000-05-18 21:10:55 +00:00
Jim Meyering
4d453f5691 remove some parens from some cpp lines 2000-05-18 14:56:42 +00:00
Jim Meyering
9d67112156 (remove_dir): Detect (and fail upon) attempt to subvert a running `rm -r'.
Reported by Morten Welinder.
2000-05-18 14:49:34 +00:00
Jim Meyering
c880f6f9e0 . 2000-05-18 14:28:09 +00:00
Jim Meyering
8469888ca2 *** empty log message *** 2000-05-18 14:26:19 +00:00
Jim Meyering
83616b114e (TESTS): Add hash. 2000-05-18 14:26:00 +00:00
Jim Meyering
f01f28a92a *** empty log message *** 2000-05-18 14:24:58 +00:00
Jim Meyering
ba798c5998 *** empty log message *** 2000-05-18 11:12:39 +00:00
Jim Meyering
aa78add2de (hash_rehash): Fix a nasty bug: copy the free entry list
back, too, since it may have been modified by allocate_entry.
(hash_delete): Rewrite not to use both(!) the assignment operator
and the comma operator in an if-expression.
2000-05-18 11:06:39 +00:00
Jim Meyering
3cf14979b7 *** empty log message *** 2000-05-17 12:21:02 +00:00
Jim Meyering
1ca5f870b6 tweak comment 2000-05-17 12:19:39 +00:00
Jim Meyering
1cd58148cd *** empty log message *** 2000-05-16 14:42:22 +00:00
Jim Meyering
a4f0b7b42e <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
Remove; no longer needed.
"quotearg.h": Add include.
(file_name): Do not bother to explicitly initialize to NULL; it's less
efficient on some hosts.
(close_stdout_status): Remove test as to whether stdout was already
closed; it breaks for the case "echo x | sort >&-".
Quote file name colons.
Do not assume that _("write error") lacks format strings.
2000-05-16 14:36:55 +00:00
Jim Meyering
71f60a998c *** empty log message *** 2000-05-15 20:42:08 +00:00
Jim Meyering
f13c5ee9ce (do_link): Use complete strings in diagnostics so they
are easier to translate.  Reported by Michel Robitaille.
(main): Drop support for the case in which S_ISLNK wasn't defined.
It was broken in any case.
2000-05-15 20:41:52 +00:00
Jim Meyering
6385fbd99a *** empty log message *** 2000-05-15 10:22:01 +00:00
Jim Meyering
73417841eb (close_stdout_set_file_name): Declare. 2000-05-15 10:21:56 +00:00
Jim Meyering
dba50eec49 (close_stdout_set_file_name): New function.
(close_stdout_status): Use new file-scoped global.
Return right away if fstat says the stdout file descriptor is invalid.
2000-05-15 10:21:25 +00:00
Jim Meyering
3400cc7f78 . 2000-05-15 08:00:19 +00:00
Jim Meyering
3c5405d298 *** empty log message *** 2000-05-15 07:18:44 +00:00
Jim Meyering
be72ac078c Set LC_ALL to `C' to avoid failure when the
current locale is not C (POSIX).  From Matthew Clarke.
2000-05-15 07:18:38 +00:00
Jim Meyering
6d38725e21 *** empty log message *** 2000-05-15 07:18:17 +00:00
Jim Meyering
4e5d2ac6d2 *** empty log message *** 2000-05-15 07:11:30 +00:00
Jim Meyering
cbd2839f1d (version_etc_copyright): Update the copyright string
that goes into all --version output.
2000-05-15 07:11:16 +00:00
Jim Meyering
a3ac01b48d (test_vector): Skip the %c test on SunOS4 systems.
Suggested by Paul Eggert.  Reported by Volker Borchert.
2000-05-15 07:08:38 +00:00
Jim Meyering
00df9725bb *** empty log message *** 2000-05-13 06:51:51 +00:00
Jim Meyering
81b16373ae Arrange to call close_stdout only upon exit. 2000-05-13 06:49:53 +00:00
Jim Meyering
47827e2ec2 Include closeout.h.
(usage): Don't call close_stdout here.
(close_stdout_wrapper): New, kludgey, function and file-scoped global.
(main): Register it with atexit.
2000-05-13 06:46:55 +00:00
Jim Meyering
68c6a5d828 *** empty log message *** 2000-05-12 22:39:10 +00:00
Jim Meyering
30c412049f Detect and report write failure of --help/--version. 2000-05-12 22:38:58 +00:00
Jim Meyering
f2d53500ae *** empty log message *** 2000-05-12 20:40:47 +00:00
Jim Meyering
fc64ba37d4 (copy_internal): Fix force and interactive tests. 2000-05-12 20:40:39 +00:00
Jim Meyering
a5c02a198b Unlike for mv, -i doesn't cancel the effect of -f
and -f doesn't cancel the effect of -i.
(main) ['f']: Don't reset `x.interactive'.
['i']: Don't reset `x.force'.
2000-05-12 20:39:34 +00:00
Jim Meyering
12bf65f915 Interpret as decimal, even if number starts with 0. 2000-05-12 20:31:39 +00:00
Jim Meyering
48ebc7d0b7 *** empty log message *** 2000-05-12 20:30:28 +00:00
Jim Meyering
b0fd0aa567 (string_to_integer): Restrict base to 10. 2000-05-12 20:30:22 +00:00
Jim Meyering
a1eab797d0 test new option 2000-05-12 08:56:03 +00:00
Jim Meyering
7f0b022e0d *** empty log message *** 2000-05-12 08:55:43 +00:00
Jim Meyering
1224b48d7f New option: --first-only
(anonymous enum) [CONVERT_FIRST_ONLY_OPTION]: Define.
(long_options): Add `first-only'.
(main): Handle new option.
2000-05-12 08:55:13 +00:00
Jim Meyering
3b8a52ccbe *** empty log message *** 2000-05-11 09:19:40 +00:00
Jim Meyering
605768d957 make the new tests a little smaller 2000-05-11 08:30:09 +00:00
Jim Meyering
45dcf53e6e New tests. 2000-05-11 08:28:51 +00:00
Jim Meyering
3f0c7988cf *** empty log message *** 2000-05-11 08:24:49 +00:00
Jim Meyering
51dbb91fdd *** empty log message *** 2000-05-11 07:24:35 +00:00
Jim Meyering
9590fbf43c (usage): Don't call close_stdout_status directly,
since that didn't cover --version output.
(main): Instead, call close_stdout_set_status and arrange to
call close_stdout via atexit.
2000-05-11 07:24:05 +00:00
Jim Meyering
5a3d9df9a1 (usage): Don't call close_stdout_status directly,
since that didn't cover --version output.
(main): Instead, call close_stdout_set_status and arrange to
call close_stdout via atexit.
2000-05-11 07:23:42 +00:00
Jim Meyering
70e5178bde (usage): Don't call close_stdout directly, since that
didn't cover --version output.
(main):  Arrange to call close_stdout via atexit, instead.
2000-05-11 07:21:33 +00:00
Jim Meyering
c693c5940b . 2000-05-11 07:17:36 +00:00
Jim Meyering
8c8e4286b5 append in subshell so we don't see this diagnostic:
./remove: t-shred.11626/file: Permission denied
2000-05-10 22:33:06 +00:00
Jim Meyering
ce8cf50e0a . 2000-05-10 16:40:30 +00:00
Jim Meyering
4071f9dcd5 (close_stdout_set_status): Declare. 2000-05-10 16:39:53 +00:00
Jim Meyering
ebd41d46d8 [default_exit_status]: New file-scoped variable.
(close_stdout_set_status): New function.
2000-05-10 16:39:35 +00:00
Jim Meyering
a210d7d35c Include sys/types.h in shred.c before including
sys/stat.h or system.h.  From John David Anglin.
2000-05-09 20:27:54 +00:00
Jim Meyering
b9c210715c back out last change -- the two should be separate 2000-05-09 20:27:11 +00:00
Jim Meyering
101160bdf9 *** empty log message *** 2000-05-09 20:26:04 +00:00
Jim Meyering
5c4406f731 Include sys/types.h in shred.c before including
sys/stat.h or system.h.  From John David Anglin.
2000-05-09 20:25:58 +00:00
Jim Meyering
721557bb21 *** empty log message *** 2000-05-09 12:37:47 +00:00
Jim Meyering
d7f56af947 *** empty log message *** 2000-05-09 11:00:13 +00:00
Jim Meyering
17bd8fb7fa *** empty log message *** 2000-05-09 06:32:31 +00:00
Jim Meyering
babf9bb7ac (case_GETOPT_VERSION_CHAR): Don't call close_stdout. 2000-05-09 06:32:24 +00:00
Jim Meyering
28ee33a9d8 *** empty log message *** 2000-05-09 05:50:09 +00:00
Jim Meyering
e90fed0bf7 renamed to libintl.m4 2000-05-09 05:44:51 +00:00
Jim Meyering
41a1348544 renamed from gettext.m4 2000-05-09 05:44:51 +00:00
Jim Meyering
2f925e9403 *** empty log message *** 2000-05-08 16:54:55 +00:00
Jim Meyering
1068a0005a Don't use touch in root test. Instead, append to
the test file, since now touch operates even on files which deny owner
write access.
2000-05-08 16:53:36 +00:00
Jim Meyering
cf197bb14a *** empty log message *** 2000-05-08 12:16:11 +00:00
Jim Meyering
34b63c88da *** empty log message *** 2000-05-08 12:01:46 +00:00
Jim Meyering
2fd73df635 . 2000-05-08 11:59:34 +00:00
Jim Meyering
31f5c39ace . 2000-05-08 10:10:26 +00:00
Jim Meyering
aa1ddd2e7d Don't include closeout.h.
(parse_long_options): Don't call close_stdout for --version.
2000-05-08 10:09:28 +00:00
Jim Meyering
fca7b20092 . 2000-05-07 21:11:59 +00:00
Jim Meyering
a90650cd3a *** empty log message *** 2000-05-07 21:03:19 +00:00
Jim Meyering
03faf39b22 Use UTC0, not just UTC, required for alphaev56-dec-osf4.0f. 2000-05-07 21:02:56 +00:00
Jim Meyering
acd3390874 *** empty log message *** 2000-05-07 15:02:30 +00:00
Jim Meyering
c263f45884 . 2000-05-07 15:00:48 +00:00
Jim Meyering
a41b145094 *** empty log message *** 2000-05-07 15:00:20 +00:00
Jim Meyering
661f74698e Include "closeout.h".
(usage): Call close_stdout just before exit.
2000-05-07 15:00:12 +00:00
Jim Meyering
c6b0fefde1 Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:57:52 +00:00
Jim Meyering
2d4fd1ab6e Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:57:24 +00:00
Jim Meyering
c4d7de4d1c (usage): Call close_stdout_status. 2000-05-07 14:57:03 +00:00
Jim Meyering
7942b60d47 Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:56:12 +00:00
Jim Meyering
c6bd79ad34 Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:55:15 +00:00
Jim Meyering
52150ef51d Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:54:43 +00:00
Jim Meyering
071e5e3b25 Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:53:15 +00:00
Jim Meyering
21f7f8fb60 Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:52:54 +00:00
Jim Meyering
1a898f0449 Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:52:16 +00:00
Jim Meyering
ab241ac3be Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:51:49 +00:00
Jim Meyering
d3683509b3 Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:51:07 +00:00
Jim Meyering
ddb8aa8b9f (usage): Call close_stdout_status. 2000-05-07 14:50:39 +00:00
Jim Meyering
73ed5ed51e Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:49:06 +00:00
Jim Meyering
a3d40a9447 Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:48:25 +00:00
Jim Meyering
309c1c3e47 Include "closeout.h".
(usage): Call close_stdout just before exit.
2000-05-07 14:47:44 +00:00
Jim Meyering
72bdac7271 Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:46:33 +00:00
Jim Meyering
f1013a1535 Include "closeout.h".
(main): Call atexit with close_stdout.
Remove explicit close_stdout.
2000-05-07 14:46:11 +00:00
Jim Meyering
e1133c7a28 Include "closeout.h".
(usage): Call close_stdout just before exit.
2000-05-07 14:41:19 +00:00
Jim Meyering
011b92f1c9 *** empty log message *** 2000-05-07 07:17:22 +00:00
Jim Meyering
5aa90a9946 ($Test::env{'rfc822-1'}): Add TZ=UTC. 2000-05-07 07:17:17 +00:00
Jim Meyering
c610f47650 . 2000-05-06 15:51:29 +00:00
Jim Meyering
d9e1e1dbd2 *** empty log message *** 2000-05-06 15:51:15 +00:00
Jim Meyering
b700e5cdfe *** empty log message *** 2000-05-06 15:45:33 +00:00
Jim Meyering
a83332dcd2 Undefine __strnlen and strnlen.
[!weak_alias]: Define __strnlen to strnlen.
2000-05-06 15:45:30 +00:00
Jim Meyering
20d55109b5 *** empty log message *** 2000-05-06 14:38:04 +00:00
Jim Meyering
95fad10ba3 (AC_REPLACE_FUNCS): Add strnlen. 2000-05-06 14:37:59 +00:00
Jim Meyering
e580f2a576 *** empty log message *** 2000-05-06 14:36:00 +00:00
Jim Meyering
0a63562cfa AC_REPLACE_FUNCS(atexit). 2000-05-06 14:35:16 +00:00
Jim Meyering
55b7281ec2 *** empty log message *** 2000-05-06 14:33:56 +00:00
Jim Meyering
b00705596d remove ifdef 2000-05-06 14:33:46 +00:00
Jim Meyering
6507fa63ce New file, from libiberty. 2000-05-06 14:33:22 +00:00
Jim Meyering
e074cde09b *** empty log message *** 2000-05-06 14:31:38 +00:00
Jim Meyering
9b6eb98d41 (EEXIST): Remove now-unused definition.
(ENOTEMPTY): Likewise.
(errno_rmdir_non_empty): Rewrite to use RMDIR_ERRNO_NOT_EMPTY,
which is determined by the autoconf test in m4/rmdir-errno.m4..
2000-05-06 14:31:32 +00:00
Jim Meyering
72efca1195 *** empty log message *** 2000-05-06 14:25:40 +00:00
Jim Meyering
884af44da8 (fetish_FUNC_RMDIR_NOTEMPTY): New macro and file. 2000-05-06 14:25:18 +00:00
Jim Meyering
c2a761780e Require fetish_FUNC_RMDIR_NOTEMPTY. 2000-05-06 14:25:07 +00:00
Jim Meyering
2c1ae1f436 . 2000-05-06 14:14:14 +00:00
Jim Meyering
ed0f130ea1 *** empty log message *** 2000-05-06 14:03:27 +00:00
Jim Meyering
a23b2bb948 (jm_FUNC_NANOSLEEP): Save and restore LIBS around
AC_SEARCH_LIBS call for nanosleep.
(LIB_NANOSLEEP): Set and AC_SUBST.
2000-05-06 14:03:19 +00:00
Jim Meyering
669034433d *** empty log message *** 2000-05-06 14:01:46 +00:00
Jim Meyering
97df7c4729 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to
be 500, instead of _GNU_SOURCE to be 1, to work around glibc
2.1.3 bug.  This avoids a clash when files like regex.c define
_GNU_SOURCE.
2000-05-06 14:01:39 +00:00
Jim Meyering
6206ee75ea *** empty log message *** 2000-05-06 13:47:44 +00:00
Jim Meyering
6b54234726 (get_charset_aliases): Use malloc, realloc and memcpy
instead of xmalloc, xrealloc, path_concat.
(locale_charset): Treat empty environment variables as absent.
(DIRECTORY_SEPARATOR, ISSLASH): New macros.
2000-05-06 13:47:38 +00:00
Jim Meyering
c141f3a34e (main): Warn about arguments, don't fail.
(usage): Call close_stdout_status from here as well as from main.
2000-05-06 13:18:00 +00:00
Jim Meyering
3140984fab Include "closeout.h".
(main): Call close_stdout.
2000-05-05 21:55:32 +00:00
Jim Meyering
19c397acdc Include "closeout.h".
(main): Call close_stdout.
2000-05-05 21:53:41 +00:00
Jim Meyering
80b5341cb8 Include "closeout.h".
(main): Call close_stdout.
2000-05-05 21:52:22 +00:00
Jim Meyering
f2fde491db Include "closeout.h".
(main): Call close_stdout.
2000-05-05 21:51:02 +00:00
Jim Meyering
e1c98ab3fb Include "closeout.h".
(main): Call close_stdout.
2000-05-05 21:49:44 +00:00
Jim Meyering
be9e62c6e0 *** empty log message *** 2000-05-05 21:42:20 +00:00
Jim Meyering
df9a764cbd *** empty log message *** 2000-05-05 21:41:53 +00:00
Jim Meyering
3684b16708 Exit nonzero upon write failure.
Include "closeout.h".
(main): Call close_stdout.
Reported by Ian Jackson via Michael Stone.
2000-05-05 21:41:29 +00:00
Jim Meyering
7dad7fd5c6 *** empty log message *** 2000-05-05 21:41:11 +00:00
Jim Meyering
856071f1da *** empty log message *** 2000-05-05 21:41:03 +00:00
Jim Meyering
ff1e216579 *** empty log message *** 2000-05-05 16:33:33 +00:00
Jim Meyering
554b19b9d1 (jm_MACROS): Save and restore LIBS around AC_SEARCH_LIBS call for clock_gettime.
(LIB_CLOCK_GETTIME): Set and AC_SUBST.
2000-05-05 16:33:26 +00:00
Jim Meyering
98e69d378e *** empty log message *** 2000-05-05 16:10:41 +00:00
Jim Meyering
00c483746f remove commented-out m4_default clause 2000-05-05 16:10:22 +00:00
Jim Meyering
7d4bd8f671 Update from autoconf. 2000-05-05 16:10:03 +00:00
Jim Meyering
46b48d2e0e *** empty log message *** 2000-05-05 15:05:09 +00:00
Jim Meyering
87a766e71a *** empty log message *** 2000-05-05 11:39:31 +00:00
Jim Meyering
5d65fd5e99 su doesn't work on Solaris2.6.
When checking for struct spwd.sp_pwdp, also include
<shadow.h>.  Reported by Dragos Harabor.
2000-05-05 11:39:25 +00:00
Jim Meyering
6a4a7cfe00 *** empty log message *** 2000-05-05 11:38:34 +00:00
Jim Meyering
2961a41dc3 (my-distcheck): Remove spurious blank line.
Remove $(DEPDIR) *after* making distclean, not before.
2000-05-04 09:33:34 +00:00
Jim Meyering
a0f78c6a82 *** empty log message *** 2000-05-04 07:19:34 +00:00
Jim Meyering
3e5e4aa3ac update from glibc -- solely white space changes 2000-05-04 07:19:24 +00:00
Jim Meyering
f4d3d21b14 *** empty log message *** 2000-05-04 07:13:40 +00:00
Jim Meyering
6a0899b4b6 filter through cppi 2000-05-04 07:12:59 +00:00
Jim Meyering
3d21ae4853 Update from glibc. 2000-05-04 07:12:43 +00:00
Jim Meyering
6405a85879 *** empty log message *** 2000-05-04 07:06:49 +00:00
Jim Meyering
91aee8ad4d Update from glibc. 2000-05-04 07:06:42 +00:00
Jim Meyering
3c13ac6c36 Update from glibc. 2000-05-04 06:41:26 +00:00
Jim Meyering
0605601f99 *** empty log message *** 2000-05-04 06:36:10 +00:00
Jim Meyering
c8fa96131e update from glibc 2000-05-04 06:35:49 +00:00
Jim Meyering
cea745beaa New file, from glibc. 2000-05-04 06:34:23 +00:00
Jim Meyering
647d5e6a70 *** empty log message *** 2000-05-04 05:35:04 +00:00
Jim Meyering
b53fe736bc Update from glibc. 2000-05-04 05:34:55 +00:00
Jim Meyering
f7fcc8c622 *** empty log message *** 2000-05-03 11:12:54 +00:00
Jim Meyering
be579a52e7 During ls, set LANGUAGE (for GNU gettext)
and LC_ALL (for systems which look at LC_MESSAGES).
2000-05-03 11:10:32 +00:00
Jim Meyering
c2262fcd90 use rm, not $RM 2000-05-03 11:09:07 +00:00
Jim Meyering
93e3e3a5a8 Define LC_ALL instead of LANG, in case the user has
LC_CTYPE or LC_ALL set. Define it and LANGUAGE before the first "sort" call.
2000-05-03 11:07:51 +00:00
Jim Meyering
92d235c21a Remove declaration of strndup. 2000-05-03 08:40:33 +00:00
Jim Meyering
900011c7de *** empty log message *** 2000-05-03 08:39:29 +00:00
Jim Meyering
0cb358268d *** empty log message *** 2000-05-03 08:37:57 +00:00
Jim Meyering
e6d69926e6 (!HAVE_DECL_STRNDUP): Declare strndup. 2000-05-03 08:37:40 +00:00
Jim Meyering
7e3bd1d897 *** empty log message *** 2000-05-03 08:37:11 +00:00
Jim Meyering
cd8042a77c (AC_CHECK_DECLS): Add strndup. 2000-05-03 08:37:03 +00:00
Jim Meyering
44bdb2f05a *** empty log message *** 2000-05-03 08:30:24 +00:00
Jim Meyering
38a059bf64 (AC_SYS_LARGEFILE): Define _GNU_SOURCE if
this is needed to make ftello visible (e.g. glibc 2.1.3).  Use
compile-time test, rather than inspecting host and OS, to
decide whether to define _LARGEFILE_SOURCE.
2000-05-03 08:30:18 +00:00
Jim Meyering
950eba9ba0 . 2000-05-02 14:07:39 +00:00
Jim Meyering
5fdc4f4666 *** empty log message *** 2000-05-02 06:57:00 +00:00
Jim Meyering
4c69db64f2 don't hard-code `rm' 2000-05-02 06:56:31 +00:00
Jim Meyering
acd9c429c0 (usage): Add the answer to `How do I remove a file named -f?' 2000-05-02 06:55:49 +00:00
Jim Meyering
e0263e15f1 *** empty log message *** 2000-05-01 14:59:21 +00:00
Jim Meyering
cb58624cef (full_write): Remove `FIXME' part of comment. 2000-05-01 14:40:08 +00:00
Jim Meyering
c488f85c66 *** empty log message *** 2000-05-01 14:15:17 +00:00
Jim Meyering
aa435d9982 *** empty log message *** 2000-05-01 14:10:38 +00:00
Jim Meyering
624dd54796 (change_attributes): Don't remove the destination file upon failure. 2000-05-01 14:09:19 +00:00
Jim Meyering
ef34c8704c [checked in with intention to back out...]
(change_attributes): Unlink the destination file
if either of the chown or the chmod calls fails.  Don't even attempt
the chmod if the chown fails.
Suggestion from Marc Olzheim.
2000-05-01 13:55:09 +00:00
Jim Meyering
b0d42f0a5c . 2000-05-01 11:40:52 +00:00
Jim Meyering
3491fe9797 *** empty log message *** 2000-05-01 08:36:29 +00:00
Jim Meyering
951abbe274 Use AC_MSG_CHECKING instead of obsolete AC_CHECKING. 2000-05-01 08:36:13 +00:00
Jim Meyering
392dd7af09 fix typos 2000-05-01 08:32:35 +00:00
Jim Meyering
9561e02b6a *** empty log message *** 2000-05-01 08:29:38 +00:00
Jim Meyering
e6bf5ecaf8 (jm_LIST_MOUNTED_FILESYSTEMS): Add BeOS support.
Based on a patch from Bruno Haible.
2000-05-01 08:29:28 +00:00
Jim Meyering
e511c84abe (read_filesystem_list): Add BeOS support. 2000-05-01 08:03:33 +00:00
Jim Meyering
cc5b8b2e79 (jm_LIST_MOUNTED_FILESYSTEMS): Add BeOS support. 2000-05-01 07:58:34 +00:00
Jim Meyering
56b16d84df *** empty log message *** 2000-04-30 21:48:27 +00:00
Jim Meyering
034fbbd8ac (O_NOCTTY): Define if not defined already.
(touch): Add O_NOCTTY to the flags passed to open.
2000-04-30 21:48:23 +00:00
Jim Meyering
a65db32955 . 2000-04-30 16:25:54 +00:00
Jim Meyering
72d2131b0e . 2000-04-30 16:25:30 +00:00
Jim Meyering
2edc7371bc *** empty log message *** 2000-04-30 16:25:24 +00:00
Jim Meyering
5e7a7d23f5 . 2000-04-30 16:24:00 +00:00
Jim Meyering
d0e30069c0 *** empty log message *** 2000-04-30 16:20:57 +00:00
Jim Meyering
9a7f0b1542 tweak comment 2000-04-30 16:19:57 +00:00
Jim Meyering
9a909400ba Detect and terminate upon write failure. 2000-04-30 16:19:06 +00:00
Jim Meyering
9e60f6cc06 alphabetize 2000-04-30 11:19:35 +00:00
Jim Meyering
721b2cb881 *** empty log message *** 2000-04-29 10:18:29 +00:00
Jim Meyering
b958bd6f2b [LSTAT_FOLLOWS_SLASHED_SYMLINK] (lstat): Define to rpl_lstat. 2000-04-29 10:17:42 +00:00
Jim Meyering
8e3be9e25c use an all-symbolic mode string 2000-04-29 09:37:44 +00:00
Jim Meyering
d6254a86bf *** empty log message *** 2000-04-29 09:25:58 +00:00
Jim Meyering
cf251ff75b Declare strdup only if it's not defined. 2000-04-29 09:25:09 +00:00
Jim Meyering
f79c0f977e *** empty log message *** 2000-04-29 08:44:40 +00:00
Jim Meyering
16d019fb86 *** empty log message *** 2000-04-29 08:44:11 +00:00
Jim Meyering
8d8135769a *** empty log message *** 2000-04-28 16:50:24 +00:00
Jim Meyering
8b37ad9c5b [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
redefinition warning on some systems (HPUX).  Otherwise, regex.h is
included first, then limits.h is included by locale.h by libintl.h.
From John David Anglin.
2000-04-28 16:49:38 +00:00
Jim Meyering
c249f854de *** empty log message *** 2000-04-27 12:27:08 +00:00
Jim Meyering
4954d34c14 (pop_dir): Remove through_symlink arg; use null cwd
for that purpose instead.
(count_entry): Also save the directory if we're saving more
than one level.
Fix file descriptor and memory leak when chdir fails.
2000-04-27 12:23:59 +00:00
Jim Meyering
e9c9e0f9e5 . 2000-04-27 12:19:38 +00:00
Jim Meyering
01a1964a1c *** empty log message *** 2000-04-27 12:17:43 +00:00
Jim Meyering
063bdf481b *** empty log message *** 2000-04-27 12:15:23 +00:00
Jim Meyering
cc9a042dfd . 2000-04-27 12:13:20 +00:00
Jim Meyering
a105fb3c17 *** empty log message *** 2000-04-27 12:13:11 +00:00
Jim Meyering
c0e74f9b48 *** empty log message *** 2000-04-27 12:12:42 +00:00
Jim Meyering
f5e968f6cd fix typo 2000-04-27 12:10:38 +00:00
Jim Meyering
fa3bb4033b *** empty log message *** 2000-04-27 12:09:44 +00:00
Jim Meyering
455d9ad4ed Use mkdir, not $MKDIR. 2000-04-27 12:08:59 +00:00
Jim Meyering
375abb3590 (TESTS_ENVIRONMENT): Set PATH, not MKDIR. 2000-04-27 12:08:19 +00:00
Jim Meyering
a3e7716e04 *** empty log message *** 2000-04-27 08:31:18 +00:00
Jim Meyering
c500f8c996 *** empty log message *** 2000-04-27 06:47:05 +00:00
Jim Meyering
a3029aba6b tweak comment 2000-04-27 06:46:13 +00:00
Jim Meyering
56b185d9b3 *** empty log message *** 2000-04-27 06:44:20 +00:00
Jim Meyering
5bb0a21123 *** empty log message *** 2000-04-27 06:36:05 +00:00
Jim Meyering
8a6dd8bf13 *** empty log message *** 2000-04-27 06:34:07 +00:00
Jim Meyering
758eab108f *** empty log message *** 2000-04-27 06:30:59 +00:00
Jim Meyering
862b31c48a (TESTS): Add special-1. 2000-04-27 06:30:26 +00:00
Jim Meyering
30eb4cf648 *** empty log message *** 2000-04-26 21:59:34 +00:00
Jim Meyering
29f4f9a5ac *** empty log message *** 2000-04-26 21:59:01 +00:00
Jim Meyering
d3057155d5 *** empty log message *** 2000-04-26 12:55:48 +00:00
Jim Meyering
8735a6823f *** empty log message *** 2000-04-26 12:54:26 +00:00
Jim Meyering
d89bb4e01a *** empty log message *** 2000-04-26 12:52:54 +00:00
Jim Meyering
0cd61ad840 *** empty log message *** 2000-04-26 12:43:19 +00:00
Jim Meyering
5aeb94aeb4 Rename global: s/path_mode/create_parents/.
(main): No longer perform explicit chmod when creating
parent directories, since make_path now does the chmod.
2000-04-26 12:43:12 +00:00
Jim Meyering
2f4177fa6b . 2000-04-26 12:36:49 +00:00
Jim Meyering
eddd846acb (S_IRWXUGO): Define.
(make_path): Always perform explicit chmod if MODE specifies any
of the `special' permission bits.
2000-04-26 12:36:43 +00:00
Jim Meyering
84013f9573 *** empty log message *** 2000-04-19 15:36:15 +00:00
Jim Meyering
98f5206a61 [__BEOS__]: Ignore O_BINARY and O_TEXT. 2000-04-19 15:36:05 +00:00
Jim Meyering
58be6ceff4 *** empty log message *** 2000-04-18 17:28:34 +00:00
Jim Meyering
97a6cf3999 add comment 2000-04-18 13:41:26 +00:00
Jim Meyering
40f30dc54b *** empty log message *** 2000-04-18 13:40:29 +00:00
Jim Meyering
833f309376 [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define getpagesize.
For BeOS.  Based on a patch from Bruno Haible.
2000-04-18 13:40:25 +00:00
Jim Meyering
72b3b743fe *** empty log message *** 2000-04-18 13:35:22 +00:00
Jim Meyering
0952a8a7bc (jm_PREREQ_GETPAGESIZE): New macro.
(jm_PREREQ): Use it.
2000-04-18 13:35:18 +00:00
Jim Meyering
be7efadaf2 *** empty log message *** 2000-04-17 11:39:36 +00:00
Jim Meyering
d2caf6a98c (my_strftime) [strftime]: Declare strftime here, since the definition
of it to rpl_strftime also defined-away the system's declaration.
2000-04-17 11:39:26 +00:00
Jim Meyering
c2981f6507 . 2000-04-17 11:26:33 +00:00
Jim Meyering
14aece6661 *** empty log message *** 2000-04-17 09:56:02 +00:00
Jim Meyering
eddd7f971f Get it right :-)
(jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Emit the
actual #define via AH_VERBATIM.  Don't need separate AC_DEFINE.
Suggestion from Akim Demaille.
2000-04-17 09:55:53 +00:00
Jim Meyering
df85b33ee3 Accept new option: --from=CURRENT_OWNER:CURRENT_GROUP.
(enum) [FROM_OPTION]: New member.
(long_options): New getopt spec.
(change_file_owner): Add old_user, old_group parameters.  Use them.
(change_dir_owner): Likewise.
(usage): Describe.
(main): New case.
2000-04-17 08:19:52 +00:00
Jim Meyering
d37e7835f9 Don't remove support for --max-consecutive-size-changes just yet... 2000-04-17 06:49:07 +00:00
Jim Meyering
d6df2d8561 *** empty log message *** 2000-04-16 16:28:46 +00:00
Jim Meyering
db01eaed39 (tail invocation): Remove description. 2000-04-16 16:03:44 +00:00
Jim Meyering
a423a1374f Remove option: --max-consecutive-size-changes=N.
Doesn't seem useful.
(usage): Remove description.
2000-04-16 16:03:34 +00:00
Jim Meyering
56dc5651a4 *** empty log message *** 2000-04-16 13:51:27 +00:00
Jim Meyering
c559eefb84 New option: --strip-trailing-slashes.
(enum) [STRIP_TRAILING_SLASHES_OPTION]: New member.
(remove_trailing_slashes): New global.
(long_opts): New getopt spec.
(usage): Describe.
(do_copy): Strip trailing slashes on SOURCE names only if the new
option has been specified.
(main): New case.
2000-04-16 13:51:22 +00:00
Jim Meyering
517e8a6bc2 (TESTS): Add symlink-slash. 2000-04-16 13:49:22 +00:00
Jim Meyering
88a6b99b8d *** empty log message *** 2000-04-16 13:48:38 +00:00
Jim Meyering
125de05913 add comment 2000-04-16 12:16:03 +00:00
Jim Meyering
496e09185a . 2000-04-15 22:04:06 +00:00
Jim Meyering
757de7fe90 *** empty log message *** 2000-04-15 21:58:37 +00:00
Jim Meyering
bb53ccc5e9 Use C' to denote so-called contiguous' files, the same way that tar does.
* filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
(ftypelet): Use S_ISCTG.
2000-04-15 21:54:46 +00:00
Jim Meyering
9fc7c63a5a *** empty log message *** 2000-04-15 21:48:58 +00:00
Jim Meyering
10acebe2cb tweak copyright date 2000-04-14 16:12:16 +00:00
Jim Meyering
d02b8ea082 *** empty log message *** 2000-04-14 15:42:02 +00:00
Jim Meyering
a71d7cdd14 (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Use the one-arg form
of AC_DEFINE.  Otherwise, the #ifndef in AH_VERBATIM gets clobbered.
2000-04-14 15:41:06 +00:00
Jim Meyering
2e469b088b Shorten #ifdef HAVE_...' to #if HAVE_...' and
remove unnecessary uses of `defined' (aesthetics).
2000-04-14 12:41:05 +00:00
Jim Meyering
d5066f22eb *** empty log message *** 2000-04-13 08:37:57 +00:00
Jim Meyering
9ac210f6a7 . 2000-04-13 08:34:47 +00:00
Jim Meyering
a3c2775889 . 2000-04-13 08:16:13 +00:00
Jim Meyering
7ae95c0ff8 *** empty log message *** 2000-04-13 08:15:07 +00:00
Jim Meyering
12ec89c0e3 (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Use new AH_VERBATIM
to insert required #ifndef into config.h.in.
Suggestion from Akim Demaille.
2000-04-13 08:15:01 +00:00
Jim Meyering
6157486144 *** empty log message *** 2000-04-12 16:03:53 +00:00
Jim Meyering
4add54834d (AM_FUNC_GETLOADAVG): Use AC_CHECK_HEADERS, not
`AC_CHECK_HEADER' to check for locale.h.  Thanks to a report from
Christian Krackowizer.
2000-04-12 16:03:20 +00:00
Jim Meyering
f03b3e48ea (usage): Tweak --help output. Suggestions from Karl Berry. 2000-04-12 09:50:20 +00:00
Jim Meyering
50a68130a3 *** empty log message *** 2000-04-12 06:21:06 +00:00
Jim Meyering
088ab165c7 *** empty log message *** 2000-04-12 06:19:55 +00:00
Jim Meyering
b08487e513 (_GNU_SOURCE): Define.
(AC_SYS_LARGEFILE): Require.
(AM_C_PROTOTYPES): Require.
2000-04-12 06:19:45 +00:00
Jim Meyering
29d6a0aa75 *** empty log message *** 2000-04-11 09:27:38 +00:00
Jim Meyering
85846c1ba1 use bc in example, not dc 2000-04-10 09:20:49 +00:00
Jim Meyering
42b1404b54 . 2000-04-10 07:09:24 +00:00
Jim Meyering
9516237211 *** empty log message *** 2000-04-09 18:15:46 +00:00
Jim Meyering
b518fdab61 *** empty log message *** 2000-04-09 09:14:05 +00:00
Jim Meyering
290fd86565 Include constants.texi.
(tail invocation): Use `@value's instead of referring to the
output of `tail --help'.
2000-04-09 09:13:42 +00:00
Jim Meyering
b6d1fca450 (usage): Clarify descriptions of the --max-* options.
From Karl Berry.
2000-04-09 09:10:36 +00:00
Jim Meyering
844f0224f0 *** empty log message *** 2000-04-09 07:41:18 +00:00
Jim Meyering
e3d82c6734 *** empty log message *** 2000-04-09 07:35:39 +00:00
Jim Meyering
d219e87e72 . 2000-04-09 07:33:52 +00:00
Jim Meyering
545a2cbc66 *** empty log message *** 2000-04-09 07:33:30 +00:00
Jim Meyering
e6701bae6d Use the "C" locale when using --rfc-822 (-R), as
required by rfc822.  Before, in the de_DE locale, date would
print the German weekday and month abbreviations.
2000-04-09 07:33:25 +00:00
Jim Meyering
0145667581 Add test for rfc822 format and foreign locale settings. 2000-04-08 21:45:25 +00:00
Jim Meyering
a641eab06a *** empty log message *** 2000-04-08 19:36:46 +00:00
Jim Meyering
7beb8ac8aa *** empty log message *** 2000-04-08 19:35:38 +00:00
Jim Meyering
8debb843b6 (factor): Use a better example 2000-04-08 19:28:49 +00:00
Jim Meyering
c908124639 Document the ln=target directive. 2000-04-08 19:04:00 +00:00
Jim Meyering
5c7059a33a Add support for "ln=target" in the LS_COLORS variable,
to colorize links as for the file/directory pointed to.
2000-04-08 19:03:29 +00:00
Jim Meyering
6c60fb0a7a *** empty log message *** 2000-04-08 06:46:32 +00:00
Jim Meyering
650ea2e0b4 Document that while the --backup option takes an
optional argument, the -b option accepts none.
(main): Use `backup type' in call to xget_version, not the
now-deprecated `--version-control'.
2000-04-08 06:46:20 +00:00
Jim Meyering
ca59fb27c2 Document that while the --backup option takes an
optional argument, the -b option accepts none.
(main): Use `backup type' in call to xget_version, not the
now-deprecated `--version-control'.
2000-04-08 06:45:48 +00:00
Jim Meyering
19aa1f8a25 . 2000-04-08 06:44:35 +00:00
Jim Meyering
4cfab8f932 *** empty log message *** 2000-04-08 06:34:06 +00:00
Jim Meyering
edcc5eb997 (charset.alias): Use t-$@, not $@-t so the DOS 8.3
names don't conflict.  Reported by Eli Zaretskii.
2000-04-08 06:34:02 +00:00
Jim Meyering
437a783072 . 2000-04-08 06:31:38 +00:00
Jim Meyering
9a16820c87 *** empty log message *** 2000-04-07 09:41:51 +00:00
Jim Meyering
6b0a7a91d4 (print_unicode_char): Avoid triggering Solaris iconv bug.
Deal with the different error behaviour of Irix iconv.
2000-04-07 09:41:38 +00:00
Jim Meyering
4259b70042 Move inclusion of errno.h so it follows that of sys/types.h,
to work around system header problems on AIX 3.2.5.  From Bruno Haible.
2000-04-07 09:24:18 +00:00
Jim Meyering
5cb8c8c0a0 . 2000-04-07 08:45:27 +00:00
Jim Meyering
043d1c865c add a node for hostid 2000-04-06 19:27:04 +00:00
Jim Meyering
9394a8280f . 2000-04-06 13:39:07 +00:00
Jim Meyering
c846dbf402 *** empty log message *** 2000-04-06 06:56:05 +00:00
Jim Meyering
826dcda9c4 (AC_SYS_LARGEFILE_FLAGS): Don't use -n32 on
IRIX if the installer said otherwise.
2000-04-06 06:55:14 +00:00
Jim Meyering
31ecd03e51 fix two typos. Duh 2000-04-05 15:22:04 +00:00
Jim Meyering
0fcc2606dd *** empty log message *** 2000-04-05 15:16:27 +00:00
Jim Meyering
bea19ce09c [!HAVE_UTMPX_H] (headers): Include <utmp.h>.
(jm_CHECK_DECLS): Add getutent to the list of functions.
(_jm_DECL_HEADERS): Add utmpx.h.
2000-04-05 15:14:28 +00:00
Jim Meyering
4208ee3490 Declare strdup. 2000-04-05 15:08:11 +00:00
Jim Meyering
f7cfce8952 [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent. 2000-04-05 15:05:54 +00:00
Jim Meyering
ff9b9b202c Include sys/types.h before sys/stat.h.
Required for ultrix4.3.
2000-04-05 15:00:11 +00:00
Jim Meyering
594b06988b (canon_host): Declare strdup. Required for ultrix4.3. 2000-04-05 14:57:36 +00:00
Jim Meyering
faf92299a0 *** empty log message *** 2000-04-05 14:57:07 +00:00
Jim Meyering
98dd4a3867 . 2000-04-05 12:44:02 +00:00
Jim Meyering
8661f4d615 *** empty log message *** 2000-04-05 12:25:13 +00:00
Jim Meyering
7354c6077f Back out the 2000-04-02 change.
Instead of that change, simply undefine putenv in the test program.
2000-04-05 12:13:59 +00:00
Jim Meyering
48c6dffe80 Back out the 2000-04-02 change. 2000-04-05 11:50:48 +00:00
Jim Meyering
cc7186a919 *** empty log message *** 2000-04-04 20:18:42 +00:00
Jim Meyering
5c1001fdc5 *** empty log message *** 2000-04-04 20:15:42 +00:00
Jim Meyering
6803a71d89 *** empty log message *** 2000-04-04 20:14:16 +00:00
Jim Meyering
534deab287 *** empty log message *** 2000-04-04 12:58:57 +00:00
Jim Meyering
b9db9921b8 Be more DOS 8.3-friendly.
* ref-add.sin: Renamed from ref-add.sed.in.
* ref-del.sin: Renamed from ref-del.sed.in.
* Makefile.am: Reflect renaming.
2000-04-04 12:58:49 +00:00
Jim Meyering
c36284c505 renamed to ref-del.sin 2000-04-04 12:50:59 +00:00
Jim Meyering
a1eb481256 renamed from ref-del.sed.in 2000-04-04 12:50:59 +00:00
Jim Meyering
26bcc7757c renamed to ref-add.sin 2000-04-04 12:50:44 +00:00
Jim Meyering
6dd8936868 renamed from ref-add.sed.in 2000-04-04 12:50:44 +00:00
Jim Meyering
32ff553652 Use a temporary file name that won't clash with `charset.alias'
in the DOS 8.3 name space.

(charset_tmp): Define.
(install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
(uninstall-local): Likewise.
Reported by Eli Zaretskii.
2000-04-04 12:47:19 +00:00
Jim Meyering
7fc37fe5ec Split a long line and tweak for font-lock mode. 2000-04-04 07:59:24 +00:00
Jim Meyering
655b4e6409 *** empty log message *** 2000-04-04 07:59:08 +00:00
Jim Meyering
0fe3b0fe41 Split a long line and tweak for font-lock mode. 2000-04-04 07:58:21 +00:00
Jim Meyering
92f6a5cd8e Split a long line and tweak for font-lock mode. 2000-04-04 07:55:37 +00:00
Jim Meyering
dfddef17ac *** empty log message *** 2000-04-03 19:35:28 +00:00
Jim Meyering
d10be8f4db Fix typo in comment. 2000-04-03 19:35:24 +00:00
Jim Meyering
1461770971 . 2000-04-03 12:56:15 +00:00
Jim Meyering
1f665cff54 *** empty log message *** 2000-04-03 12:18:37 +00:00
Jim Meyering
e287f40259 *** empty log message *** 2000-04-03 08:06:02 +00:00
Jim Meyering
af404ff8ce *** empty log message *** 2000-04-03 07:48:11 +00:00
Jim Meyering
1ce828da28 (AC_CHECK_HEADERS): Add langinfo.h (moved here from
textutils/configure.in).  Suggestion from Paul Eggert.
(AC_CHECK_FUNCS): Add nl_langinfo.  (also from textutils/configure.in)
2000-04-03 07:48:06 +00:00
Jim Meyering
073977f69f (AC_CHECK_HEADERS): Remove langinfo.h -- put it in codeset instead.
(AC_CHECK_FUNCS): Likewise for nl_langinfo.
2000-04-03 07:46:51 +00:00
Jim Meyering
5ca6863e97 Include <langinfo.h> if it exists.
(DATE_FMT_LANGINFO): New macro.
(show_date): Use it to get the locale-specific default format for
"date" if it exists.
2000-04-03 07:38:41 +00:00
Jim Meyering
afe1e8e126 *** empty log message *** 2000-04-03 07:32:07 +00:00
Jim Meyering
5641f6257f (_jm_STRFTIME_PREREQS): Check for strftime,
since strftime.c uses HAVE_STRFTIME to decide whether to use
the underlying strftime.
2000-04-03 07:31:59 +00:00
Jim Meyering
ce3986e75a *** empty log message *** 2000-04-03 07:26:43 +00:00
Jim Meyering
f4d87ce11c (AC_CHECK_FUNCS): Add nl_langinfo. (also from textutils/configure.in) 2000-04-03 07:26:38 +00:00
Jim Meyering
8ecf5893e6 *** empty log message *** 2000-04-03 07:25:23 +00:00
Jim Meyering
321402c5a8 *** empty log message *** 2000-04-03 07:20:44 +00:00
Jim Meyering
3ce4615d65 (AC_CHECK_HEADERS): Add langinfo.h (moved here from textutils/configure.in). 2000-04-03 07:20:38 +00:00
Jim Meyering
0d5a8f6bb7 *** empty log message *** 2000-04-03 07:10:21 +00:00
Jim Meyering
dda6851673 (my_strftime): Make sure we call the system
strftime, not ourselves, when invoking the underlying strftime.
2000-04-03 07:09:38 +00:00
Jim Meyering
3feb52cde7 *** empty log message *** 2000-04-03 06:24:31 +00:00
Jim Meyering
096f314e1d (jm_FUNC_GNU_STRFTIME): Set TZ environment
variable in the shell rather than using putenv, which isn't
portable.  This avoids the configure-time inter-test dependency
on the potentially-renamed putenv function.
2000-04-03 06:24:20 +00:00
Jim Meyering
f22bce320b *** empty log message *** 2000-04-02 21:00:30 +00:00
Jim Meyering
527fd8d7d2 (jm_CHECK_ALL_TYPES): Include <sys/stat.h>
before checking struct stat.st_blksize, so that
HAVE_STRUCT_STAT_ST_BLKSIZE is defined correctly.
2000-04-02 21:00:24 +00:00
Jim Meyering
f016b20824 *** empty log message *** 2000-03-25 21:18:57 +00:00
Jim Meyering
251caade33 . 2000-03-25 18:33:17 +00:00
Jim Meyering
7d06f9cd1e back out last change 2000-03-25 18:26:47 +00:00
Jim Meyering
e23fcf2db0 *** empty log message *** 2000-03-24 09:07:18 +00:00
Jim Meyering
b217f05541 (jm_MACROS): Invoke `AC_CONFIG_AUX_DIR(.)' to work
around bug that made cvs-automake complain it couldn't find lib/depcomp.
2000-03-24 09:07:12 +00:00
Jim Meyering
8c0a8b888f . 2000-03-24 08:50:13 +00:00
Jim Meyering
b896219d87 . 2000-03-24 06:40:29 +00:00
Jim Meyering
eb42da51bb Output a line containing "Packages using this file". 2000-03-24 06:40:23 +00:00
Jim Meyering
d808469d48 *** empty log message *** 2000-03-24 06:39:31 +00:00
Jim Meyering
a0fc5566dd *** empty log message *** 2000-03-24 06:39:01 +00:00
Jim Meyering
e0ca9372fc (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
(charset_alias): Define.
(install-exec-local): Factor out common code.
(uninstall-local): Split lines longer than 80.
(ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
(SUFFIXES): Define.
(.sed.in.sed): New rule.  Don't redirect directly to $@.
(CLEANFILES): Add ref-add.sed and ref-del.sed.
2000-03-24 05:54:46 +00:00
Jim Meyering
a8bc6aee1c (install-exec-local, uninstall-local, ref-add.sed, ref-del.sed): New rules.
From Bruno.
2000-03-24 05:46:01 +00:00
Jim Meyering
355fad3e85 *** empty log message *** 2000-03-22 21:46:50 +00:00
Jim Meyering
b1a90bfff4 tiny tweak 2000-03-19 19:01:23 +00:00
Jim Meyering
100cfd502c *** empty log message *** 2000-03-19 19:00:17 +00:00
Jim Meyering
fc6d3b5995 a little more chroot help 2000-03-19 18:59:24 +00:00
Jim Meyering
5cb40b6726 add simple chroot example 2000-03-19 17:57:16 +00:00
Jim Meyering
784f0940b8 *** empty log message *** 2000-03-19 17:44:47 +00:00
Jim Meyering
3cb1bf80e0 *** empty log message *** 2000-03-19 17:44:23 +00:00
Jim Meyering
137c01c9a8 fix typos (dates not the same) 2000-03-19 17:43:30 +00:00
Jim Meyering
4433751d7a fix typos from
ceder@lysator.liu.se (Per Cederqvist)
2000-03-19 17:43:01 +00:00
Jim Meyering
a13954f7a6 *** empty log message *** 2000-03-19 16:25:47 +00:00
Jim Meyering
98b6b3780b *** empty log message *** 2000-03-18 16:55:05 +00:00
Jim Meyering
11f11947b5 (print_uptime): Use `buf' only if fgets succeeds. 2000-03-18 16:54:18 +00:00
Jim Meyering
01c42af175 . 2000-03-17 21:26:31 +00:00
Jim Meyering
00a6ef7e2e (<string.h>): Include only #if HAVE_STRING_H.
Otherwise, include <strings.h>
2000-03-17 19:34:16 +00:00
Jim Meyering
03bc0dd04d (utf8_wctomb): New function.
(print_unicode_char): Pass the Unicode character to iconv in UTF-8
format instead of in UCS-4 with platform dependent endianness.
2000-03-17 19:32:27 +00:00
Jim Meyering
4587e728aa *** empty log message *** 2000-03-17 15:23:06 +00:00
Jim Meyering
40847a559f *** empty log message *** 2000-03-12 20:09:53 +00:00
Jim Meyering
4c1d48cbfc *** empty log message *** 2000-03-12 20:08:01 +00:00
Jim Meyering
2b195e22bd *** empty log message *** 2000-03-12 20:07:39 +00:00
Jim Meyering
eb31b32e80 Merge from textutils.
(O_BINARY, O_TEXT): Define if necessary.
(SET_BINARY, SET_BINARY2): Define.
(DEV_BSIZE): Define to BBSIZE if appropriate.
2000-03-12 20:07:17 +00:00
Jim Meyering
83a446e62a *** empty log message *** 2000-03-12 20:04:35 +00:00
Jim Meyering
fb190362cc describe seq gotcha re FP arith 2000-03-12 17:54:52 +00:00
Jim Meyering
d21d0a4c04 *** empty log message *** 2000-03-12 17:31:57 +00:00
Jim Meyering
5e62fc320b (usage): Correct --help output. 2000-03-12 17:31:52 +00:00
Jim Meyering
7386ed8bd1 *** empty log message *** 2000-03-12 17:31:33 +00:00
Jim Meyering
ff9b51c885 . 2000-03-12 06:39:40 +00:00
Jim Meyering
85f656db4c . 2000-03-11 22:06:31 +00:00
Jim Meyering
63229c0a0d . 2000-03-11 16:30:59 +00:00
Jim Meyering
10cec9669d *** empty log message *** 2000-03-11 16:18:05 +00:00
Jim Meyering
9370e7d2a8 Set the default TZ value to UTC0, not UTC.
The latter didn't have any effect on alphaev56-dec-osf4.0f.
2000-03-11 16:17:25 +00:00
Jim Meyering
3b89449b19 *** empty log message *** 2000-03-11 11:21:41 +00:00
Jim Meyering
010641f8b7 Make the message more like that in the similar touch and shred tests. 2000-03-10 11:56:25 +00:00
Jim Meyering
527dcb236a *** empty log message *** 2000-03-10 11:53:29 +00:00
Jim Meyering
55746a425e Accommodate SunOS-NFS-mounting-OpenBSD mkfifo
bug and `exit 77' if the fifo cannot be created.
Report and suggestion from Volker Borchert.
2000-03-10 11:53:22 +00:00
Jim Meyering
41d063607c *** empty log message *** 2000-03-10 11:40:29 +00:00
Jim Meyering
113a192da5 *** empty log message *** 2000-03-10 09:09:34 +00:00
Jim Meyering
293d7ffa73 *** empty log message *** 2000-03-10 09:09:08 +00:00
Jim Meyering
a63b8f03f4 Look for getspnam in -lgen, too. 2000-03-10 09:08:53 +00:00
Jim Meyering
ff1b77a70a *** empty log message *** 2000-03-08 14:50:11 +00:00
Jim Meyering
7157c29ee8 (savedir): Work even if directory size is
negative; this can happen with some screwy NFS configurations.
2000-03-08 14:50:05 +00:00
Jim Meyering
45b3b0a96d . 2000-03-08 10:41:04 +00:00
Jim Meyering
b65f84bf94 tweak indentation 2000-03-07 20:06:03 +00:00
Jim Meyering
9ebf9199a4 (get_charset_aliases): Don't try to free file_name
if it's NULL (because we ran out of memory).  From Bruno Haible.
2000-03-06 11:19:23 +00:00
Jim Meyering
a688ad3b57 *** empty log message *** 2000-03-06 06:21:08 +00:00
Jim Meyering
57bb2e656e (struct buffer.newline_free): New member.
(initbuf, findlines): Set it.
(fillbuf): Do not double the size of a full buffer to append a newline
unless the buffer is known to be newline free.
2000-03-06 06:20:59 +00:00
Jim Meyering
12ad88f5c1 *** empty log message *** 2000-03-05 10:39:50 +00:00
Jim Meyering
8f717f92aa *** empty log message *** 2000-03-05 10:39:33 +00:00
Jim Meyering
fac78c4d0c *** empty log message *** 2000-03-05 10:37:53 +00:00
Jim Meyering
0d672bf048 *** empty log message *** 2000-03-05 10:27:29 +00:00
Jim Meyering
b7d59be6a4 ("path-concat.h"): Include.
(get_charset_aliases): Use path_concat instead of ANSI string
concatenation.
2000-03-05 10:27:22 +00:00
Jim Meyering
7206cd3b01 *** empty log message *** 2000-03-05 10:22:03 +00:00
Jim Meyering
aca3853e18 (PARAMS): Define.
Use it to guard prototype.
2000-03-05 10:21:58 +00:00
Jim Meyering
93be9a66d7 . 2000-03-05 06:53:08 +00:00
Jim Meyering
edaeb62db6 *** empty log message *** 2000-03-05 06:52:33 +00:00
Jim Meyering
e89ea03496 . 2000-03-04 21:14:51 +00:00
Jim Meyering
cd740223b3 (uninstall-local): Uncomment this rule so `make distcheck' works once again. 2000-03-04 21:10:21 +00:00
Jim Meyering
a82d3db454 *** empty log message *** 2000-03-04 20:15:07 +00:00
Jim Meyering
cea52734ee (install-exec-local): Create $(libdir) before installing into it. 2000-03-04 20:15:03 +00:00
Jim Meyering
b52c000d3b *** empty log message *** 2000-03-04 18:17:12 +00:00
Jim Meyering
31d214cd3a *** empty log message *** 2000-03-04 18:16:39 +00:00
Jim Meyering
54d12f7edd Once we encounter a file that is not of IS_TAILABLE_FILE_TYPE,
marke it as such and ignore it forever after.
(struct File_spec): New member.
(recheck): Initialize new member.
(tail_file): Likewise.
(tail_forever): Skip the file if it's marked as ignorable.
2000-03-04 18:16:21 +00:00
Jim Meyering
f600c4d144 *** empty log message *** 2000-03-04 14:31:34 +00:00
Jim Meyering
049ca98c74 Don't get failed assertion for `tail -f directory'.
Revert most of 1999-10-20 change.  Instead, ...
(IS_TAILABLE_FILE_TYPE): Define to produce similar result.
(recheck): Use it here.
(tail_file): Use it here.
2000-03-04 14:31:29 +00:00
Jim Meyering
7b2d50e3af . 2000-03-04 12:53:49 +00:00
Jim Meyering
e099a4b5ed . 2000-03-04 12:53:29 +00:00
Jim Meyering
29d3ba4a7b Include "unicodeio.h".
(usage): Mention \u and \U directives. \x outputs a byte, not a
character.
(print_esc): Implement \u and \U.
2000-03-04 12:52:35 +00:00
Jim Meyering
28334dafe4 (<errno.h>): Include it.
(errno): Declare if not defined.
2000-03-04 12:35:47 +00:00
Jim Meyering
45758bf193 . 2000-03-04 12:23:14 +00:00
Jim Meyering
8cad33941c . 2000-03-04 12:22:47 +00:00
Jim Meyering
fd6c956d13 *** empty log message *** 2000-03-04 12:22:45 +00:00
Jim Meyering
bb72a58753 *** empty log message *** 2000-03-04 12:22:14 +00:00
Jim Meyering
be7c99efe2 *** empty log message *** 2000-03-04 12:19:57 +00:00
Jim Meyering
1999eb9197 copyright 2000-03-04 12:14:57 +00:00
Jim Meyering
8221bfd7cc *** empty log message *** 2000-03-04 08:11:22 +00:00
Jim Meyering
1a8f8ca40c (jm_CHECK_ALL_TYPES): Require AC_C_VOLATILE, for lib/localcharset.c. 2000-03-04 08:11:18 +00:00
Jim Meyering
634dad84ba Add Bruno's comment justifying use of volatile. 2000-03-04 07:57:35 +00:00
Jim Meyering
871812bcec New version, incorporating remarks from a linux
i18n mailing list.  From Bruno Haible.
2000-03-04 07:53:33 +00:00
Jim Meyering
14b2e25723 *** empty log message *** 2000-03-03 21:48:23 +00:00
Jim Meyering
2f8ecdbb34 *** empty log message *** 2000-03-03 21:48:02 +00:00
Jim Meyering
26963dfc15 Make it so stty's rprnt attribute works on HPUX 10.20.
[CREPRINT && !CRPRNT] (CRPRNT): Define.
(control_info): Recognize HPUX's CREPRINT.
2000-03-03 21:47:59 +00:00
Jim Meyering
449de5e30c . 2000-03-03 12:28:28 +00:00
Jim Meyering
aa077d5438 *** empty log message *** 2000-03-03 12:24:11 +00:00
Jim Meyering
1a371e5119 Make sure re_compile_pattern accepts patterns like `{1'. 2000-03-03 12:23:47 +00:00
Jim Meyering
c1fcde2307 *** empty log message *** 2000-03-03 12:21:32 +00:00
Jim Meyering
e219c94cdf *** empty log message *** 2000-03-03 08:25:29 +00:00
Jim Meyering
fdd07a7508 . 2000-03-03 08:25:13 +00:00
Jim Meyering
2c43f8c612 (fillbuf): Move declaration of local, cc, into scope of
`while' loop where it's used.
2000-03-03 08:24:16 +00:00
Jim Meyering
8e1e6d357a Big performance improvement when sorting many small files,
building on a suggestion by Charles Randall.

(fillbuf): Skip memmove if it would be a no-op,
as many memmove implementations are slow in that case.
Don't examine leftover bytes for eolchar, since they may be left
over from a previous file, and we want to read from this file.

(sort): At end of file, if there is more input and buffer room,
concatenate the next input file.
2000-03-03 08:18:48 +00:00
Jim Meyering
8b8685ef31 *** empty log message *** 2000-03-03 08:12:51 +00:00
Jim Meyering
326489aecd *** empty log message *** 2000-03-03 08:05:27 +00:00
Jim Meyering
d2b51acd38 (EXTRA_DIST): Add config.charset. 2000-03-02 15:28:23 +00:00
Jim Meyering
b9a2465910 wrap lines and reformat @examples a little to avoid
`Overfull \hbox ... too wide' warnings
2000-03-02 12:33:06 +00:00
Jim Meyering
c82129a317 make example narrower to avoid `Overfull \hbox ... too wide' warning 2000-03-02 12:30:39 +00:00
Jim Meyering
68773fe3f1 *** empty log message *** 2000-03-02 12:24:21 +00:00
Jim Meyering
b1307f5aff (printf invocation): Describe new unicode syntax.
From Bruno Haible.
2000-03-02 12:24:00 +00:00
Jim Meyering
3af9591bb8 *** empty log message *** 2000-03-02 09:44:56 +00:00
Jim Meyering
169f13cd05 Require AC_HEADER_TIME before the cache check so
the messages come out on separate lines.
2000-03-02 09:44:43 +00:00
Jim Meyering
18341ac6a9 *** empty log message *** 2000-03-02 09:09:08 +00:00
Jim Meyering
b79b91615f . 2000-03-02 09:09:02 +00:00
Jim Meyering
cae99570f4 (jm_FUNC_GLIBC_UNLOCKED_IO): Use AC_CHECK_DECLS, rather than jm_CHECK_DECLARATIONS. 2000-03-02 09:08:32 +00:00
Jim Meyering
00ede118ac *** empty log message *** 2000-03-02 09:05:33 +00:00
Jim Meyering
62bef312ad (AC_CHECK_DECLS): Add getlogin, ttyname, and geteuid. 2000-03-02 09:05:28 +00:00
Jim Meyering
e1bf326a99 (getlogin, ttyname, geteuid): Declare them here, if needed. 2000-03-02 09:04:06 +00:00
Jim Meyering
ddfcfb0da3 . 2000-03-02 07:38:57 +00:00
Jim Meyering
5624900715 (show_point): Ignore shortcuts based on path
prefixes that are loop file system mount points, since they
yield undesirable output.
2000-03-02 07:30:36 +00:00
Jim Meyering
de85b5f902 (DEFS): Add -DLIBDIR=...
(libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
(noinst_HEADERS): Add unicodeio.h.
(all-local, install-exec-local, charset.alias): New targets.
2000-03-01 13:26:04 +00:00
Jim Meyering
d38bf8ccf7 *** empty log message *** 2000-03-01 13:23:53 +00:00
Jim Meyering
b451be06d5 *** empty log message *** 2000-03-01 13:23:47 +00:00
Jim Meyering
8d1e103424 New file from Bruno. 2000-03-01 13:23:41 +00:00
Jim Meyering
77ec117299 New file from Bruno.
filter through cppi
2000-03-01 13:22:57 +00:00
Jim Meyering
ce4a63537c New file from Bruno.
One portability tweak:
guard inclusion of stddef.h.
2000-03-01 13:22:35 +00:00
Jim Meyering
578156186d Guard some #includes with `#if HAVE_...'. 2000-03-01 13:21:23 +00:00
Jim Meyering
e2915cc17d new file, from Bruno 2000-03-01 13:11:05 +00:00
Jim Meyering
edd988b3cc Describe eq-wid-2 failure conditions. 2000-03-01 12:53:37 +00:00
Jim Meyering
296fe5d782 . 2000-03-01 12:51:07 +00:00
Jim Meyering
13b113c1f3 *** empty log message *** 2000-03-01 12:50:28 +00:00
Jim Meyering
883cd6c62d . 2000-03-01 12:49:12 +00:00
Jim Meyering
172290c201 (get_width_format): Fix portability problem with -0' vs. 0'. 2000-03-01 12:31:16 +00:00
Jim Meyering
1679d72fee . 2000-03-01 12:29:00 +00:00
Jim Meyering
317732f3d9 . 2000-03-01 12:27:54 +00:00
Jim Meyering
fc1d2abff1 (decode_switches): Remove `e' from getopt_long's list of
option characters.  Reported by John Summerfield.
2000-02-29 15:22:16 +00:00
Jim Meyering
8078034c5b *** empty log message *** 2000-02-29 07:32:27 +00:00
Jim Meyering
747c6d4b60 (make_blank): Add an explicit cast to `unsigned char *'
to placate HPUX's C compiler.  Reported by Bob Proulx.
2000-02-29 07:32:23 +00:00
Jim Meyering
d29f838428 split a long line 2000-02-29 06:34:25 +00:00
Jim Meyering
464232e6bb *** empty log message *** 2000-02-28 20:45:33 +00:00
Jim Meyering
76d10c457c (ALERT_CHAR): New macro.
(quotearg_buffer_restyled): Use it.
2000-02-28 20:45:28 +00:00
Jim Meyering
6631abaa8b *** empty log message *** 2000-02-28 07:23:06 +00:00
Jim Meyering
4507236cbe Use ginstall, not install. 2000-02-28 07:23:00 +00:00
Jim Meyering
2b8209bca8 . 2000-02-27 19:05:50 +00:00
Jim Meyering
a98c656b54 *** empty log message *** 2000-02-27 18:53:50 +00:00
Jim Meyering
e43759db0c Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'. 2000-02-27 18:50:31 +00:00
Jim Meyering
507d0aa278 Fix typo in decl of strtoul: s/long long/long/.
Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
2000-02-27 18:49:10 +00:00
Jim Meyering
86845e9bfe Fix typo in decl of strtoul: s/long long/long/. 2000-02-27 18:45:29 +00:00
Jim Meyering
633c0745b9 *** empty log message *** 2000-02-27 18:04:10 +00:00
Jim Meyering
5bea77e1af Guard inclusion of stdlib.h with #if HAVE_STDLIB_H', not #if STDC_HEADERS'.
Declare malloc if needed.
2000-02-27 18:04:00 +00:00
Jim Meyering
4fef810c37 use double quotes, not single quotes around syntax-error-evoking string 2000-02-27 17:54:25 +00:00
Jim Meyering
7717354351 *** empty log message *** 2000-02-27 17:53:36 +00:00
Jim Meyering
07ab5fec9a Add getenv to the list. 2000-02-27 17:53:31 +00:00
Jim Meyering
8cf07d2253 *** empty log message *** 2000-02-27 17:42:26 +00:00
Jim Meyering
aadde40206 Use #if !HAVE_DECL...' instead of #ifndef HAVE_DECL..'
now that autoconf always defines the HAVE_DECL_ symbols.

Arrange for cpp to fail if the configure-time
declaration check was not run.
2000-02-27 17:41:20 +00:00
Jim Meyering
aee6c49887 Arrange for cpp to fail if the configure-time
declaration check was not run.
2000-02-27 17:40:53 +00:00
Jim Meyering
8041fd5301 Use #if !HAVE_DECL...' instead of #ifndef HAVE_DECL..'
now that autoconf always defines the HAVE_DECL_ symbols.

Arrange for cpp to fail if the configure-time
declaration check was not run.
2000-02-27 17:40:24 +00:00
Jim Meyering
7a80c0cacc Use #if !HAVE_DECL...' instead of #ifndef HAVE_DECL..'
now that autoconf always defines the HAVE_DECL_ symbols.

Arrange for cpp to fail if the configure-time
declaration check was not run.
2000-02-27 17:39:52 +00:00
Jim Meyering
c2f3af37bb Use #if !HAVE_DECL...' instead of #ifndef HAVE_DECL...'
now that autoconf always defines the HAVE_DECL_ symbols.
2000-02-27 17:26:39 +00:00
Jim Meyering
fe56d629d1 . 2000-02-27 15:43:43 +00:00
Jim Meyering
6c5f00186d *** empty log message *** 2000-02-27 15:06:19 +00:00
Jim Meyering
27acd938a1 *** empty log message *** 2000-02-27 15:01:34 +00:00
Jim Meyering
dda6c3fdc4 (install_file_to_path): Always use install_file_in_file.
Based on a patch from Adam Klein via Michael Stone.
2000-02-27 15:01:21 +00:00
Jim Meyering
9d343b0852 *** empty log message *** 2000-02-27 15:00:31 +00:00
Jim Meyering
36aea8162f *** empty log message *** 2000-02-27 14:52:45 +00:00
Jim Meyering
fb0afad994 *** empty log message *** 2000-02-27 14:39:48 +00:00
Jim Meyering
847ee5a3bd (TESTS): Add create-leading. 2000-02-27 14:39:19 +00:00
Jim Meyering
649349a300 *** empty log message *** 2000-02-27 14:35:07 +00:00
Jim Meyering
759591ae51 *** empty log message *** 2000-02-27 14:27:13 +00:00
Jim Meyering
bb8bb211a1 Put cedilla on `c' in author's name. 2000-02-27 13:58:12 +00:00
Jim Meyering
47322c2a8e (TESTS_ENVIRONMENT): Add PATH. Remove cruft. 2000-02-27 13:18:24 +00:00
Jim Meyering
e86141f400 Clean up. 2000-02-27 13:17:12 +00:00
Jim Meyering
8ebde9b0bb *** empty log message *** 2000-02-27 11:29:13 +00:00
Jim Meyering
47eed28390 *** empty log message *** 2000-02-27 11:28:47 +00:00
Jim Meyering
72bd5150fd *** empty log message *** 2000-02-27 11:27:38 +00:00
Jim Meyering
a8223df329 . 2000-02-27 11:26:07 +00:00
Jim Meyering
7c0e2db49b . 2000-02-27 11:23:22 +00:00
Jim Meyering
1f6347114a *** empty log message *** 2000-02-27 11:23:11 +00:00
Jim Meyering
9c1810823d *** empty log message *** 2000-02-27 11:19:40 +00:00
Jim Meyering
f25e10f24d (parse_user_spec): If there is no :' but there is a .',
then first look up the entire `.'-containing string as a login name.
2000-02-27 11:13:16 +00:00
Jim Meyering
9bb4588551 *** empty log message *** 2000-02-26 22:19:54 +00:00
Jim Meyering
678d98c083 . 2000-02-26 21:34:58 +00:00
Jim Meyering
b0952dd045 Don't make the success of the test depend on the
order in which directory entries are processed.
Reported by Andreas Schwab.
2000-02-26 21:34:41 +00:00
Jim Meyering
20552b01be whoops. Add commas in parenthesized list of functions in call
to AC_CHECK_DECLS.
2000-02-26 21:28:10 +00:00
Jim Meyering
1b136ab2e9 *** empty log message *** 2000-02-23 15:24:57 +00:00
Jim Meyering
d682521386 Now that we have the new AC_CHECK_DECLS, use it in place of my hack. 2000-02-23 15:24:51 +00:00
Jim Meyering
fb50c4895a Handle two-digit years with leading zeros correctly.
(textint): New typedef.
(parser_control): Member year changed from int to textint.
All uses changed.
(YYSTYPE): Removed; replaced by %union with int and textint members.
(tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
(tSNUMBER, tUNUMBER): Now of type <textintval>.
(date, number, to_year): Use width of number in digits, not its value,
to determine whether it's a 2-digit year, or a 2-digit time.
(yylex): Store number of digits of numeric tokens.
Reported by John Kendall.

(parser_control): Changed from struct parser_control to typedef (for
consistency).  All uses changed.

(tID): Removed; not used.
(yylex): Return '?' for unknown identifiers, rather than (unused) tID.
2000-02-22 20:16:07 +00:00
Jim Meyering
29e2ec8676 *** empty log message *** 2000-02-22 20:14:57 +00:00
Jim Meyering
f8845967cf *** empty log message *** 2000-02-22 20:14:37 +00:00
Jim Meyering
a849cac5b5 fix typo 2000-02-22 20:13:38 +00:00
Jim Meyering
d63f6d17dd (datevtime-1): New test. 2000-02-22 20:12:08 +00:00
Jim Meyering
979ea98a3e *** empty log message *** 2000-02-15 21:04:09 +00:00
Jim Meyering
4dbf0a39a6 *** empty log message *** 2000-02-15 13:18:05 +00:00
Jim Meyering
6a7e32b137 (pop_dir): New function.
(count_entry): Factor out common code (pop_dir), and call the new
function instead.
Move declaration of global, `stat_buf' into this function.
(du_files): Don't stat `.' or call save_cwd, since count_entry
never returns with a changed working directory.
2000-02-15 13:17:36 +00:00
Jim Meyering
63444750ac *** empty log message *** 2000-02-15 13:08:08 +00:00
Jim Meyering
4c1158bac0 merge fileutils, textutils, sh-utils 2000-02-15 13:06:07 +00:00
Jim Meyering
43b2179550 *** empty log message *** 2000-02-15 07:58:20 +00:00
Jim Meyering
ec940f653c . 2000-02-14 23:27:25 +00:00
Jim Meyering
7c270275fe adapted from changes to grep getpagesize.h
by Martin P.J. Zinser <zinser@decus.de>.
2000-02-14 20:15:32 +00:00
Jim Meyering
09ce6f34a1 *** empty log message *** 2000-02-13 09:07:08 +00:00
Jim Meyering
999a14a6a5 . 2000-02-13 08:47:09 +00:00
Jim Meyering
64a7649926 *** empty log message *** 2000-02-13 08:24:10 +00:00
Jim Meyering
0d96fcf423 (run_tests): Discard stderr.
Reverse diff args, so `expected' is last, as in mk-script.
2000-02-13 08:23:58 +00:00
Jim Meyering
658207b433 . 2000-02-12 17:08:06 +00:00
Jim Meyering
1f1f9fe885 . 2000-02-12 17:07:21 +00:00
Jim Meyering
40e6e7a44e *** empty log message *** 2000-02-12 17:06:52 +00:00
Jim Meyering
77dfc82293 (run_tests): Invoke `diff' when differences are found. 2000-02-12 17:06:04 +00:00
Jim Meyering
5813e98ace *** empty log message *** 2000-02-12 10:42:19 +00:00
Jim Meyering
b8cf92fee6 *** empty log message *** 2000-02-12 10:41:48 +00:00
Jim Meyering
31ef40d60b <libintl.h>: Include.
(_ and N_): Define.
(parse_user_spec): Mark translatable strings.
2000-02-12 10:41:37 +00:00
Jim Meyering
66a4b0e7a3 add FIXME comments for use of atoi 2000-02-12 10:11:54 +00:00
Jim Meyering
3d9c2a6c35 (ISDIGIT): Define it.
(isdigit): Remove definition.
(is_number): Use ISDIGIT, not isdigit.
2000-02-12 10:10:40 +00:00
Jim Meyering
282fa27b51 *** empty log message *** 2000-02-12 08:58:36 +00:00
Jim Meyering
04d0388df4 (usage): Mention only :', and not .' as the separator. 2000-02-12 08:57:50 +00:00
Jim Meyering
d89210720b (main): Count the stat'able arguments.
Print the header line only if there is at least one valid argument.
Reported by Andy Longton <alongton@metamark.com>
2000-02-11 10:08:28 +00:00
Jim Meyering
1347ab3fa2 *** empty log message *** 2000-02-11 10:08:00 +00:00
Jim Meyering
35d44548fb Invoke `diff' when differences are found. 2000-02-10 17:45:12 +00:00
Jim Meyering
269c31af34 *** empty log message *** 2000-02-10 09:38:52 +00:00
Jim Meyering
afc2960851 #undef nanosleep.
(rpl_nanosleep): Rename from nanosleep.
2000-02-10 09:38:43 +00:00
Jim Meyering
d9aece69b3 Don't include config.h.
Remove prototype from declaration of nanosleep.
(PARAMS): Remove now-unneeded definition.
2000-02-10 09:38:31 +00:00
Jim Meyering
d31f3e34a6 *** empty log message *** 2000-02-10 09:34:03 +00:00
Jim Meyering
260ff68425 (jm_FUNC_NANOSLEEP): Rename replacement function from
gnu_nanosleep to rpl_nanosleep.
2000-02-10 09:33:52 +00:00
Jim Meyering
ddee3f420c *** empty log message *** 2000-02-09 19:41:28 +00:00
Jim Meyering
8b7a023ff1 Exit 77 if we can't set up the framework (Volker Borchert reported
that this test would fail because mknod failed when run on SunOS4.1.4
using NFS-mounted disk from an OpenBSD system).
2000-02-09 19:41:15 +00:00
Jim Meyering
31c3ae1545 (framework_failure): Use $null and $dir in place of literals in `here' script. 2000-02-09 19:36:13 +00:00
Jim Meyering
55e5a84fed *** empty log message *** 2000-02-09 12:00:16 +00:00
Jim Meyering
35d017aa1d *** empty log message *** 2000-02-09 11:58:17 +00:00
Jim Meyering
99c95d35e9 *** empty log message *** 2000-02-09 11:58:05 +00:00
Jim Meyering
40a4ab97fe (jm_LIB_CHECK): Fix typo: check for sp_pwdp in
struct spwd, rather than in struct passwd.  Reported by G. Queri.
2000-02-09 11:57:55 +00:00
Jim Meyering
03062f0904 *** empty log message *** 2000-02-09 11:57:15 +00:00
Jim Meyering
d6181296dd (correct_password): Correct HAVE_STRUCT_* name in #if guard
to go along with corrected autoconf test:  Reported by G Queri.
2000-02-09 11:57:01 +00:00
Jim Meyering
e2cc35f086 bump serial number 2000-02-08 15:37:44 +00:00
Jim Meyering
5e3d1430e3 *** empty log message *** 2000-02-08 15:33:45 +00:00
Jim Meyering
9951c9f723 *** empty log message *** 2000-02-08 15:33:32 +00:00
Jim Meyering
2781381e83 (AM_FUNC_GETLOADAVG): Remove now-unnecessary use of changequote. 2000-02-08 15:32:39 +00:00
Jim Meyering
035e61e595 bump #serial to 108 2000-02-08 15:30:47 +00:00
Jim Meyering
345ed2f0c4 (AM_GNU_GETTEXT): Quote square brackets with [' and ]'
and remove uses of `changequote'.
2000-02-08 15:29:26 +00:00
Jim Meyering
c52336c440 (AC_SYS_LARGEFILE_FLAGS): Quote square brackets with [' and ]'
and remove uses of `changequote'.
2000-02-08 15:21:11 +00:00
Jim Meyering
9936c270a7 (jm_AC_FUNC_MEMCMP): Remove now-unnecessary use of changequote.
Add `int' for main.
2000-02-08 15:16:42 +00:00
Jim Meyering
0c0a8f7180 (jm_FUNC_READDIR): Remove now-unnecessary uses of changequote. 2000-02-08 15:11:36 +00:00
Jim Meyering
dfd37e9e59 (jm_INCLUDED_REGEX): Remove now-unnecessary uses of changequote. 2000-02-08 15:08:26 +00:00
Jim Meyering
58d3cbbc5c (jm_FUNC_GNU_STRFTIME): Remove now-unnecessary uses of changequote. 2000-02-08 15:07:10 +00:00
Jim Meyering
6b239bb039 *** empty log message *** 2000-02-05 15:54:27 +00:00
Jim Meyering
2e18b62d99 *** empty log message *** 2000-02-05 09:54:33 +00:00
Jim Meyering
7392a5fd49 . 2000-02-05 09:53:35 +00:00
Jim Meyering
e413127dd4 *** empty log message *** 2000-02-05 09:49:06 +00:00
Jim Meyering
fa183ca836 . 2000-02-05 09:48:31 +00:00
Jim Meyering
ab4923e01e *** empty log message *** 2000-02-05 09:25:45 +00:00
Jim Meyering
2ffef0cd25 *** empty log message *** 2000-02-05 09:17:15 +00:00
Jim Meyering
80862b8fb4 *** empty log message *** 2000-02-05 08:49:08 +00:00
Jim Meyering
6cf7855da7 Use UT_USER in place of hard-coded `->ut_name' here, too. 2000-02-05 08:48:55 +00:00
Jim Meyering
5d716e440a bump serial number 2000-02-05 08:16:53 +00:00
Jim Meyering
05073cdf67 *** empty log message *** 2000-02-05 08:16:26 +00:00
Jim Meyering
a6ac5e555f (jm_CHECK_ALL_TYPES): Require most macros.
Remove explicit use of AC_HEADER_TIME.  It is required by
jm_CHECK_TYPE_STRUCT_TIMESPEC.  Using AC_HEADER_TIME and
`AC_REQUIRE'ing jm_CHECK_TYPE_STRUCT_TIMESPEC provoked a but
in autoconf whereby the expansion of the latter ended up preceding
the expansion of its prerequisite, AC_HEADER_TIME.
Reported by Volker Borchert.
2000-02-05 08:16:13 +00:00
Jim Meyering
5c67c91bb1 . 2000-02-05 08:10:05 +00:00
Jim Meyering
70bf2ee07d *** empty log message *** 2000-02-05 06:07:46 +00:00
Jim Meyering
e40b2aea74 (copy_internal): Don't allow mv to move a directory onto
a non-directory.  Reported by Brian Kimball via Michael Stone.
2000-02-05 06:02:23 +00:00
Jim Meyering
980db8d94b *** empty log message *** 2000-02-05 06:01:34 +00:00
Jim Meyering
3f4d9d2baf *** empty log message *** 2000-02-03 16:52:01 +00:00
Jim Meyering
2e35cf88d4 *** empty log message *** 2000-02-03 16:51:37 +00:00
Jim Meyering
3b85a5c102 Remove MV/RM-setting code, now that those vars aren't used. 2000-02-03 16:48:37 +00:00
Jim Meyering
03885c59b5 (TESTS): Add dir-file. 2000-02-03 16:47:05 +00:00
Jim Meyering
47fe4e2b81 *** empty log message *** 2000-02-03 16:46:16 +00:00
Jim Meyering
afed58448d *** empty log message *** 2000-02-03 16:44:05 +00:00
Jim Meyering
83b7332303 *** empty log message *** 2000-02-03 16:40:42 +00:00
Jim Meyering
b1a7c1d3f6 *** empty log message *** 2000-02-03 12:21:15 +00:00
Jim Meyering
07730c119b (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
rather than with `#if HAVE_UTMPNAME'.
2000-02-03 12:20:59 +00:00
Jim Meyering
ce286ec9da *** empty log message *** 2000-02-03 12:19:41 +00:00
Jim Meyering
40f2b94df5 (jm_PREREQ_READUTMP): Check for utmpxname. 2000-02-03 12:19:05 +00:00
Jim Meyering
e03663fafd (O_NDELAY): Define to 0 if not defined.
(O_NONBLOCK): Define to O_NDELAY if not defined.
(touch): Open with O_NONBLOCK, so one can touch a fifo without hanging.
Reported by Eric G. Miller via Michael Stone.
2000-02-03 12:16:47 +00:00
Jim Meyering
6d94f760a2 *** empty log message *** 2000-02-02 22:17:51 +00:00
Jim Meyering
10ababf6b2 (jm_PREREQ_ADDEXT): Fix typo that resulted in no
definition of HAVE_PATHCONF: s/AC_CHECK_FUNC/AC_CHECK_FUNCS/.
2000-02-02 22:17:35 +00:00
Jim Meyering
faae41a3ef tell user that we're about to sleep 2000-02-02 14:04:40 +00:00
Jim Meyering
177daedd5e sheesh 2000-02-02 14:03:56 +00:00
Jim Meyering
aeedb315dd *** empty log message *** 2000-02-02 14:00:14 +00:00
Jim Meyering
93d0c6c472 *** empty log message *** 2000-02-02 13:59:43 +00:00
Jim Meyering
7138e43074 (TESTS): Add fifo. 2000-02-02 13:59:30 +00:00
Jim Meyering
84b2bdcb3a (UT_USER): Add parens. From Andreas Schwab. 2000-02-01 16:23:30 +00:00
Jim Meyering
787ee99d38 *** empty log message *** 2000-02-01 13:29:57 +00:00
Jim Meyering
b8293a0364 *** empty log message *** 2000-02-01 12:05:41 +00:00
Jim Meyering
5e8af70e24 *** empty log message *** 2000-02-01 10:52:32 +00:00
Jim Meyering
d8c942fdef change ." to .\" 2000-02-01 10:34:35 +00:00
Jim Meyering
715f1c67f9 *** empty log message *** 2000-01-31 22:42:59 +00:00
Jim Meyering
ffb0e90647 *** empty log message *** 2000-01-31 22:42:34 +00:00
Jim Meyering
cf4a419332 (jm_CHECK_DECLS): Add nanosleep to the list of
functions.  Add the time.h and sys/time.h headers along with the
AC_REQUIRE'ment of AC_HEADER_TIME.
2000-01-31 22:39:54 +00:00
Jim Meyering
490bf3d6e9 (nanosleep): Guard declaration with `#if ! HAVE_DECL_NANOSLEEP'. 2000-01-31 22:38:04 +00:00
Jim Meyering
6ce0ab6d40 *** empty log message *** 2000-01-31 19:38:05 +00:00
Jim Meyering
70ac08368a fix typo. sheesh 2000-01-31 08:42:45 +00:00
Jim Meyering
26310e4984 *** empty log message *** 2000-01-31 08:38:18 +00:00
Jim Meyering
6b43446a33 Use UT_USER in place of hard-coded `->ut_name' here, too. 2000-01-31 08:38:07 +00:00
Jim Meyering
c3a1a2a912 *** empty log message *** 2000-01-31 08:36:51 +00:00
Jim Meyering
348f0efabe *** empty log message *** 2000-01-31 08:27:58 +00:00
Jim Meyering
5b2acd8d30 (ISASCII): Add #undef and move definition to follow
inclusion of wctype.h to work around solaris2.6 namespace pollution.
(ISPRINT): Likewise.
2000-01-31 08:27:51 +00:00
Jim Meyering
488aef7301 *** empty log message *** 2000-01-30 22:24:11 +00:00
Jim Meyering
be1784cf31 (correct_password): Guard with `HAVE_GETSPNAM && HAVE_STRUCT_PASSWD_SP_PWDP',
rather than just `#ifdef HAVE_SHADOW_H'.
2000-01-30 22:23:58 +00:00
Jim Meyering
c453666c3a use double parens on AC_CHECK_MEMBERS 2000-01-30 21:19:00 +00:00
Jim Meyering
cbe550de62 (writable-files): Check $(xd-delta), too. 2000-01-30 21:10:24 +00:00
Jim Meyering
333d061276 *** empty log message *** 2000-01-30 20:56:57 +00:00
Jim Meyering
b0be1bfab9 do it right 2000-01-30 18:33:17 +00:00
Jim Meyering
c58c8f5fcf (writable-files): New target.
(my-distcheck): Depend on it.
(alpha): Likewise.
2000-01-30 18:27:51 +00:00
Jim Meyering
9733e004ef *** empty log message *** 2000-01-30 16:48:25 +00:00
Jim Meyering
fd3817b9dc Clean up some kludgy old shadow password tests. 2000-01-30 16:48:19 +00:00
Jim Meyering
744efcce69 (utmp_includes): Define.
Check for ut_user and ut_name members in both struct utmpx
and struct utmp.
2000-01-30 16:47:31 +00:00
Jim Meyering
3d64706c7e redo it on per-header basis 2000-01-30 16:45:17 +00:00
Jim Meyering
774786b0cd *** empty log message *** 2000-01-30 16:41:30 +00:00
Jim Meyering
22cb099f3c (extract_trimmed_name): Use UT_USER instead of hard-coding
uses of ->ut_name.  The latter doesn't work with new Linux header files
where only utmpx.ut_user is declared.
2000-01-30 16:41:25 +00:00
Jim Meyering
b737ed325a (UT_USER): Define. Accessor macro for the member named ut_user or ut_name. 2000-01-30 16:39:08 +00:00
Jim Meyering
fedbe363a9 *** empty log message *** 2000-01-30 15:02:56 +00:00
Jim Meyering
5df431d118 *** empty log message *** 2000-01-30 15:01:02 +00:00
Jim Meyering
b43184c5e5 (my-distcheck): Depend on po-check, so I'll be warned
about any required changes at `make distcheck' time rather than at
`make alpha' time.
2000-01-30 15:00:57 +00:00
Jim Meyering
ab365a8297 *** empty log message *** 2000-01-30 12:21:37 +00:00
Jim Meyering
f573721b82 *** empty log message *** 2000-01-30 12:17:37 +00:00
Jim Meyering
1c1efebc1d *** empty log message *** 2000-01-30 12:17:07 +00:00
Jim Meyering
be27aed1ec . 2000-01-30 12:13:26 +00:00
Jim Meyering
cf16d34a4d . 2000-01-30 12:12:36 +00:00
Jim Meyering
8d6ec015de *** empty log message *** 2000-01-30 12:12:00 +00:00
Jim Meyering
5c4b305870 *** empty log message *** 2000-01-30 12:09:42 +00:00
Jim Meyering
62ec3fd688 (ST_NBLOCKS): Use st_size only for regular files and
for directories.  From H. J. Lu.
2000-01-30 12:09:30 +00:00
Jim Meyering
eda468af14 *** empty log message *** 2000-01-30 12:08:36 +00:00
Jim Meyering
8775803a9d (main): Exit with nonzero status if ftruncate fails. 2000-01-30 12:01:39 +00:00
Jim Meyering
8c6fe7ba06 *** empty log message *** 2000-01-30 12:00:14 +00:00
Jim Meyering
2e962bb26f *** empty log message *** 2000-01-30 11:59:50 +00:00
Jim Meyering
3f8032ddc9 *** empty log message *** 2000-01-30 11:57:08 +00:00
Jim Meyering
7a4fca9d77 whoops: s/jm_MACROS/jm_LIB_CHECK/ 2000-01-29 17:05:03 +00:00
Jim Meyering
c1aaa6492f *** empty log message *** 2000-01-29 17:00:03 +00:00
Jim Meyering
f8f48d0023 . 2000-01-29 16:59:09 +00:00
Jim Meyering
e446ebf6c3 New file containing library-related checks from
fileutils and sh-utils (textutils had none).
2000-01-29 14:11:35 +00:00
Jim Meyering
273d5d4925 *** empty log message *** 2000-01-29 14:10:51 +00:00
Jim Meyering
bd8333c63d *** empty log message *** 2000-01-29 11:07:24 +00:00
Jim Meyering
d176b68faa add lots of seq examples 2000-01-29 11:06:42 +00:00
Jim Meyering
f6b673d543 patch from Bruno demonstrating how to use seq to produce integer
output or output in non-decimal
2000-01-29 10:09:40 +00:00
Jim Meyering
bb84498a89 back out bruno's %d, %u, etc. changes 2000-01-29 10:06:12 +00:00
Jim Meyering
90eddc5478 *** empty log message *** 2000-01-29 10:05:42 +00:00
Jim Meyering
e3fa0cb53b Back out most of the 2000-01-21 and 01-22 changes.
[Instead, merely give examples showing how to accomplish the same
task with fewer limitations using existing tools. ]
Suggestion from Bruno Haible.
(valid_format): Rename from check_format.
2000-01-29 10:05:35 +00:00
Jim Meyering
62205d8c7e Back out the 2000-01-21 change.
Remove associated tests and add two equal-width ones.
2000-01-29 09:57:31 +00:00
Jim Meyering
6cac32ec7f *** empty log message *** 2000-01-29 09:56:32 +00:00
Jim Meyering
4db6224838 Set COLUMNS envvar, just to be safe. 2000-01-29 09:50:49 +00:00
Jim Meyering
ba088349be (screen_columns): Change #if-0 (test code, mistakenly committed in last delta)
back to #ifdef TIOCGWINSZ.
2000-01-29 09:50:14 +00:00
Jim Meyering
bbcd510bc5 *** empty log message *** 2000-01-28 22:04:47 +00:00
Jim Meyering
489f1925be Change format of warning message to look more like that
from the missing script.  Suggestion from Franois Pinard.
2000-01-28 22:04:41 +00:00
Jim Meyering
d813adbf1f *** empty log message *** 2000-01-28 08:32:14 +00:00
Jim Meyering
13707ac76a (wrapf): Emit a newline only if 0 < current_col.
(screen_columns): Use xstrtol, not atoi.
If get_win_size fails and $COLUMNS == 0, then return 80, not `0'.
2000-01-28 08:32:01 +00:00
Jim Meyering
b631b5c3ac (detect_loop): Update incomplete comment.
From Mark Kettenis.
2000-01-26 21:47:06 +00:00
Jim Meyering
06b0be15bb *** empty log message *** 2000-01-25 12:07:14 +00:00
Jim Meyering
1f18465289 Change expected output for cycle-1 and cycle-2 tests. 2000-01-25 12:07:02 +00:00
Jim Meyering
a8b0898ba5 tsort now works more like the traditional UNIX tsort. Before it would
exit when it found a loop.  Now it continues and outputs all items.

(exit_status): New variable.
(loop): New varibale.
(count_items, scan_zeroes): Change return type to int.
(detect_loop): Complete rewrite to correctly implement detection
of loops.  Also change return type to int.
(recurse_tree): Stop if ACTION returns non-zero.  This involves
changing the return type of this function and ACTION to int.
(walk_tree): Change return type of ACTION to int.
(tsort): Continue sort after a loop has been detected (and
broken).  Set exit_status to 1 if a loop was detected.
(main): Use exit_status to determine exit code.
2000-01-25 12:03:15 +00:00
Jim Meyering
9a2ff5e31c *** empty log message *** 2000-01-25 12:02:16 +00:00
Jim Meyering
03caa431a0 *** empty log message *** 2000-01-25 07:26:20 +00:00
Jim Meyering
231f8fc887 Require AC_HEADER_TIME, and include sys/time.h as well
as time.h in the compile check.
2000-01-25 07:26:14 +00:00
Jim Meyering
15ee939c3c bump serial 2000-01-25 07:25:49 +00:00
Jim Meyering
893fdf84e8 Fix typo in cross-compiling case: s/yes/no/. 2000-01-25 07:25:38 +00:00
Jim Meyering
f57f26e36a Require AC_HEADER_TIME rather than simply using it. 2000-01-25 07:21:57 +00:00
Jim Meyering
7d31261496 . 2000-01-25 07:20:58 +00:00
Jim Meyering
b67de020d9 *** empty log message *** 2000-01-24 13:58:45 +00:00
Jim Meyering
06eee4e253 (usage): Describe behavior when LINK_NAME is omitted.
From Michael Stone.
2000-01-24 13:58:38 +00:00
Jim Meyering
efa9563f3d (main): Don't expect array index `n_files - 1' to evaluate
to `-1' for unsigned int n_files == 0.  Doing so lead to a segfault on
alpha.  From Michael Stone.
2000-01-24 13:48:12 +00:00
Jim Meyering
ae5c430364 *** empty log message *** 2000-01-23 16:25:35 +00:00
Jim Meyering
fe3a834b9f Move df-related tests here from fileutils/configure.in 2000-01-23 16:23:50 +00:00
Jim Meyering
d32cf4d872 . 2000-01-23 16:20:48 +00:00
Jim Meyering
9e30aaca79 *** empty log message *** 2000-01-23 16:20:34 +00:00
Jim Meyering
26c96331b2 s/list_mounted_fs/ac_list_mounted_fs/
(jm_LIST_MOUNTED_FILESYSTEMS): Take two parameters.
2000-01-23 16:20:21 +00:00
Jim Meyering
81df043fdd (jm_FILE_SYSTEM_USAGE): Take two parameters. 2000-01-23 14:49:09 +00:00
Jim Meyering
d495aaf3e7 s/space/ac_fsusage_space/. 2000-01-23 14:12:45 +00:00
Jim Meyering
3705d57846 Extracted from fileutils/configure.in. 2000-01-23 14:08:35 +00:00
Jim Meyering
d5eb5821c6 . 2000-01-23 14:01:32 +00:00
Jim Meyering
48efd1644d (jm_CHECK_ALL_TYPES): Require AC_HEADER_MAJOR and AC_HEADER_DIRENT. 2000-01-23 10:55:10 +00:00
Jim Meyering
a9d4aadb5e *** empty log message *** 2000-01-23 10:55:00 +00:00
Jim Meyering
ce0262560b *** empty log message *** 2000-01-23 10:35:49 +00:00
Jim Meyering
505805856e (jm_FUNC_FTRUNCATE): AC_REQUIRE it. 2000-01-23 10:34:42 +00:00
Jim Meyering
aef5ff97f7 *** empty log message *** 2000-01-23 10:34:04 +00:00
Jim Meyering
7d7c104722 *** empty log message *** 2000-01-23 10:23:26 +00:00
Jim Meyering
d0a520d367 (AC_SUBST(DF_PROG)): Moved from fileutils/configure.in. 2000-01-23 10:23:23 +00:00
Jim Meyering
4d5960cf1f *** empty log message *** 2000-01-23 10:19:30 +00:00
Jim Meyering
5adc8fd591 (AM_FUNC_STRTOD): Added (from textutils', sh-utils' configure.in).
(AC_SUBST(POW_LIBM)): Likewise.
2000-01-23 10:19:26 +00:00
Jim Meyering
47b4e7f1aa *** empty log message *** 2000-01-23 10:18:15 +00:00
Jim Meyering
46980c56e0 (AC_CHECK_FUNCS): Merge all checks from fileutils, textutils, sh-utils. 2000-01-23 10:13:25 +00:00
Jim Meyering
86f00ce878 *** empty log message *** 2000-01-23 10:09:22 +00:00
Jim Meyering
2c702c93fe *** empty log message *** 2000-01-23 09:53:53 +00:00
Jim Meyering
c91b47d64f (libfetish_a_SOURCES): Remove explicit mention of obstack.c. 2000-01-23 09:53:48 +00:00
Jim Meyering
9e4428a605 (AM_FUNC_OBSTACK): Add (from fileutils/configure.in). 2000-01-23 09:52:35 +00:00
Jim Meyering
b76b69c8a2 *** empty log message *** 2000-01-23 09:52:02 +00:00
Jim Meyering
4f0cb8adcb *** empty log message *** 2000-01-23 09:31:09 +00:00
Jim Meyering
cbe1109277 (OPTIONAL_BIN_PROGS, OPTIONAL_BIN_ZCRIPTS, MAN):
AC_SUBST these here, rather than just in sh-util/configure.in, so
that the now-shared-by-fileutils-and-textutils lib/Makefile.am are
all the same.
2000-01-23 09:31:06 +00:00
Jim Meyering
08e09e9ab4 version-control: never 2000-01-23 09:19:33 +00:00
Jim Meyering
f3f4a60164 . 2000-01-23 09:08:39 +00:00
Jim Meyering
dce8ba11dd . 2000-01-22 22:55:11 +00:00
Jim Meyering
45d534215a (keycompare): Use global, hard_LC_COLLATE in place of
local that is sometimes undeclared.
2000-01-22 22:54:51 +00:00
Jim Meyering
1a50efcd03 *** empty log message *** 2000-01-22 22:43:37 +00:00
Jim Meyering
86a839108c [! HAVE_DECL_STRTOUL]: Declare strtoul.
[! HAVE_DECL_STRTOULL]: Declare strtoull.
Required for some AIX systems.  Reported by Christian Krackowizer.
[TESTING] (main): New function.
2000-01-22 22:43:31 +00:00
Jim Meyering
aebba9cd1d [! HAVE_DECL_STRTOUL]: Declare strtoul.
[! HAVE_DECL_STRTOULL]: Declare strtoull.
Required for some AIX systems.  Reported by Christian Krackowizer.
2000-01-22 22:41:02 +00:00
Jim Meyering
42e962a284 *** empty log message *** 2000-01-22 22:26:17 +00:00
Jim Meyering
0de00b9e6a Call AC_PROG_CC_STDC just before AC_C_CONST. 2000-01-22 22:25:25 +00:00
Jim Meyering
f23d5119d8 *** empty log message *** 2000-01-22 22:21:32 +00:00
Jim Meyering
0d9735fbb4 *** empty log message *** 2000-01-22 22:20:08 +00:00
Jim Meyering
0b7e06d203 [HAVE_WCTYPE_H]: Include <wctype.h>. 2000-01-22 22:19:48 +00:00
Jim Meyering
968d5b2bbf (jm_PREREQ_QUOTEARG): Add wctype.h. 2000-01-22 22:19:12 +00:00
Jim Meyering
abab15deb9 *** empty log message *** 2000-01-22 22:08:50 +00:00
Jim Meyering
570080ef25 Merge the three lists of headers. 2000-01-22 22:08:08 +00:00
Jim Meyering
595bfc8a83 *** empty log message *** 2000-01-22 22:05:13 +00:00
Jim Meyering
dfb0540bb1 (AC_CHECK_HEADERS): Add checks from textutils' configure.in 2000-01-22 22:04:33 +00:00
Jim Meyering
c099a14fac *** empty log message *** 2000-01-22 22:03:12 +00:00
Jim Meyering
c219eb2daf (AC_CHECK_HEADERS): Add checks from sh-utils' configure.in 2000-01-22 22:03:01 +00:00
Jim Meyering
c9c2cdda8b *** empty log message *** 2000-01-22 22:00:31 +00:00
Jim Meyering
58da7aa5b3 (AC_CHECK_HEADERS): Add checks from fileutils' configure.in 2000-01-22 22:00:17 +00:00
Jim Meyering
7bce838dab *** empty log message *** 2000-01-22 21:52:02 +00:00
Jim Meyering
24c45a756e (jm_PREREQ_ADDEXT): New macro. Parts moved here from fileutils' configure.in. 2000-01-22 21:51:57 +00:00
Jim Meyering
d4db66a0fb *** empty log message *** 2000-01-22 21:29:10 +00:00
Jim Meyering
09f1b5f940 (dir_name): Support for DOS-style file names with drive letters. 2000-01-22 21:29:02 +00:00
Jim Meyering
a2e435c395 tack on the one from fileutils/lib 2000-01-22 18:03:21 +00:00
Jim Meyering
e1cc8122af . 2000-01-22 14:27:13 +00:00
Jim Meyering
8ce9f19835 Remove kludgy `test -z $ac_...AC_CHECK_HEADERS(...)' code.
Moved tests into their own function (_jm_DECL_HEADERS) in check-decl.m4.
2000-01-22 14:24:50 +00:00
Jim Meyering
f5ff12fcbc (_jm_DECL_HEADERS): Define new function.
(jm_CHECK_DECLARATIONS): Require it.
2000-01-22 14:22:42 +00:00
Jim Meyering
c7bd32731e Revert to using #if HAVE_STDLIB_H
to guard inclusion of <stdlib.h>.
2000-01-22 14:07:23 +00:00
Jim Meyering
0f9105c7be Guard inclusion of <stdlib.h> with `#if STDC_HEADERS',
not `#if HAVE_STDLIB_H'.  The former wasn't defined.
Use #if rather than #ifdef.

Add HAVE_DECL_STRTOUL and HAVE_DECL_STRTOULL.
(jm_CHECK_DECLARATIONS): Add strtoul strtoull.
2000-01-22 13:53:10 +00:00
Jim Meyering
c4a0e46616 *** empty log message *** 2000-01-22 13:15:39 +00:00
Jim Meyering
a33ca24833 *** empty log message *** 2000-01-22 13:14:17 +00:00
Jim Meyering
465e3422e8 (seq --format): Mention that integer formats are accepted, too. 2000-01-22 13:13:45 +00:00
Jim Meyering
1a8bedfeb7 *** empty log message *** 2000-01-22 13:07:25 +00:00
Jim Meyering
88e049caf5 *** empty log message *** 2000-01-22 13:06:59 +00:00
Jim Meyering
8ecfdb48a9 *** empty log message *** 2000-01-22 12:37:01 +00:00
Jim Meyering
c88a1e4466 Topologically sort the functions and remove fwd declarations. 2000-01-22 12:36:35 +00:00
Jim Meyering
4186d5762f (enum Format_type): Declare.
(format_type): New global to take place of intconv.
(DO_printf): New macro.
(main): Use it.
2000-01-22 11:14:22 +00:00
Jim Meyering
c951e3f2c9 Add new tests for the new functionality. 2000-01-22 11:10:40 +00:00
Jim Meyering
e48c320244 Add support for octal and hexadecimal output.
(intconv): New variable.
(usage): Update.
(main): Call scan_arg instead of scan_double_arg. Call check_format
before scan_arg.
(scan_int_arg, scan_arg): New functions.
(check_format): Add intconv argument. Accept %d, %u, %o, %x, %X.
(print_numbers): If intconv is true, pass an int argument to printf.
2000-01-22 10:09:29 +00:00
Jim Meyering
625a560403 . 2000-01-22 09:44:23 +00:00
Jim Meyering
f3a2399998 *** empty log message *** 2000-01-22 09:43:37 +00:00
Jim Meyering
fc32116042 (ISDIGIT): Define.
(strverscmp): Use ISDIGIT, not isdigit.
2000-01-22 09:43:23 +00:00
Jim Meyering
1a779705e8 . 2000-01-22 09:42:33 +00:00
Jim Meyering
6df5aa20d7 (o-rep-1, o-rep-2): New tests. 2000-01-22 09:42:14 +00:00
Jim Meyering
d29115d80f ("xstrtol.h"): Include.
(Filter): Rename from PFL.
(non_neg_strtol): Remove function.
(find_bracketed_repeat): Use xstrtoul instead of non_neg_strtol.
(squeeze_filter, set_initialize, main): Use size_t and ssize_t in
place of long and int in several decls.
(read_and_delete, read_and_xlate): Likewise, and remove assertion.
2000-01-22 09:31:19 +00:00
Jim Meyering
89d8c4e859 *** empty log message *** 2000-01-21 15:08:14 +00:00
Jim Meyering
4ba6864c31 Correct copying notice to use GPL, per author's request.
(AUTHORS): Add djm.
2000-01-21 15:08:08 +00:00
Jim Meyering
dc6a5317bc Correct copying notice to use GPL, per author's request. 2000-01-21 15:07:53 +00:00
Jim Meyering
98379bfc4f *** empty log message *** 2000-01-21 14:39:07 +00:00
Jim Meyering
cfa079e41d *** empty log message *** 2000-01-21 07:33:33 +00:00
Jim Meyering
553fe00983 (PFI): Return long', not int'.
(PFL): Rename from PFI now that it returns long.
(squeeze_filter): Declare as `long': i, nr, out_len.
2000-01-21 07:33:25 +00:00
Jim Meyering
c4acbcc996 Tweak sort performance.
(hard_LC_CTYPE): Remove.
(keylist): Renamed from keyhead.  Now a pointer, not a
mostly-unused struct.  All uses changed.
(findlines, keycompare, CMP_WITH_IGNORE, compare, checkfp, mergefps,
sort): Tune and use a more consistent style for reallocation.
(keycompare, main): Don't worry about LC_CTYPE;
it's buggy with multibyte chars anyway.
(compare): Invoke alloca (0) after each call to keycompare,
not just the ones that return nonzero.  This avoids a memory
leak on architectures without builtin alloca that occurs
sometimes when a file contains all duplicate lines.
2000-01-19 22:43:33 +00:00
Jim Meyering
e8611c5714 *** empty log message *** 2000-01-19 20:41:06 +00:00
Jim Meyering
9393315a06 (jm_FUNC_NANOSLEEP): Include <sys/time.h>, too.
Use AC_HEADER_TIME.  Volker Borchert reported that OpenBSD-2.3/sparc
defines `struct timespec' in <sys/time.h>
2000-01-19 20:40:51 +00:00
Jim Meyering
7990f92f15 *** empty log message *** 2000-01-19 14:01:03 +00:00
Jim Meyering
2435963a1f *** empty log message *** 2000-01-19 13:57:51 +00:00
Jim Meyering
469d21a9d3 Remove uses of changequote altogether. 2000-01-19 13:57:42 +00:00
Jim Meyering
ddcb373abc . 2000-01-19 08:17:47 +00:00
Jim Meyering
e0a66a6600 . 2000-01-19 08:17:16 +00:00
Jim Meyering
d448da43d6 . 2000-01-19 07:56:52 +00:00
Jim Meyering
870858ccad (interrupt_handler, main):
Don't use SA_INTERRUPT to decide whether to call sigaction, as
POSIX.1 doesn't require SA_INTERRUPT and some systems
(e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
it's been part of POSIX.1 since day 1 (in 1988).
2000-01-18 07:37:57 +00:00
Jim Meyering
fa25e451f9 *** empty log message *** 2000-01-18 07:37:17 +00:00
Jim Meyering
3e115cf2b5 (sighandler, main):
Don't use SA_INTERRUPT to decide whether to call sigaction, as
POSIX.1 doesn't require SA_INTERRUPT and some systems
(e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
it's been part of POSIX.1 since day 1 (in 1988).
2000-01-18 07:36:53 +00:00
Jim Meyering
41a7e7c193 *** empty log message *** 2000-01-18 07:28:59 +00:00
Jim Meyering
8024f33e45 (interrupt_handler):
Don't use SA_INTERRUPT to decide whether to call sigaction, as
POSIX.1 doesn't require SA_INTERRUPT and some systems
(e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
it's been part of POSIX.1 since day 1 (in 1988).
(install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION,
to decide whether to call sigaction; this fixes an old typo.
2000-01-18 07:28:47 +00:00
Jim Meyering
1fe0bff2f4 *** empty log message *** 2000-01-18 07:26:07 +00:00
Jim Meyering
c829e00d78 (nanosleep):
Don't use SA_INTERRUPT to decide whether to call sigaction, as
POSIX.1 doesn't require SA_INTERRUPT and some systems
(e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
it's been part of POSIX.1 since day 1 (in 1988).
2000-01-18 07:25:53 +00:00
Jim Meyering
95b4ba5e0d *** empty log message *** 2000-01-17 22:37:32 +00:00
Jim Meyering
f106184dd2 . 2000-01-17 22:36:01 +00:00
Jim Meyering
93a834533b *** empty log message *** 2000-01-17 10:00:37 +00:00
Jim Meyering
2c3cad16b2 fix typo 2000-01-17 10:00:30 +00:00
Jim Meyering
7f54d0b6b7 Revert this change (they're not the same):
Use new AC_C_PROTOTYPES instead of AM_C_PROTOTYPES.
2000-01-17 10:00:19 +00:00
Jim Meyering
751d1a1888 *** empty log message *** 2000-01-17 08:03:25 +00:00
Jim Meyering
47be9d6b2f revert last change, now that quotearg.c is fixed 2000-01-17 08:03:12 +00:00
Jim Meyering
4d034357da (quotearg_buffer_restyled): Do not quote
alert, backslash, formfeed, and vertical tab unnecessarily in
shell quoting style.
2000-01-17 08:01:40 +00:00
Jim Meyering
ea51a6cbaa *** empty log message *** 2000-01-17 08:01:30 +00:00
Jim Meyering
065c2a2cda *** empty log message *** 2000-01-16 22:15:50 +00:00
Jim Meyering
e9296ad49f Sync with sh-utils/lib/Makefile.am. 2000-01-16 22:15:32 +00:00
Jim Meyering
588bb7b9e2 *** empty log message *** 2000-01-16 20:42:46 +00:00
Jim Meyering
53000596a9 (usage): Correct error in %V description.
From Wolfram Kleff.
2000-01-16 20:41:29 +00:00
Jim Meyering
ccd763bee2 alphabetize a little 2000-01-16 20:15:58 +00:00
Jim Meyering
0c4d4d0081 *** empty log message *** 2000-01-16 17:01:26 +00:00
Jim Meyering
ac9b999873 . 2000-01-16 17:00:22 +00:00
Jim Meyering
7a8e14b287 Remove these for now (they're with related code in sh-utils' configure.in)
AM_SYS_POSIX_TERMIOS
  jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
2000-01-16 16:48:57 +00:00
Jim Meyering
38b49a265f Require AM_FUNC_GETLOADAVG, jm_SYS_PROC_UPTIME, AM_SYS_POSIX_TERMIOS, and
jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL.
2000-01-16 16:42:24 +00:00
Jim Meyering
fb6ad846b4 Require jm_FUNC_GROUP_MEMBER, jm_FUNC_PUTENV,
AM_FUNC_ERROR_AT_LINE, jm_FUNC_GNU_STRFTIME, jm_FUNC_MKTIME,
jm_FUNC_GETGROUPS AC_FUNC_VPRINTF, and AC_FUNC_ALLOCA.
2000-01-16 16:39:20 +00:00
Jim Meyering
67cf2e1e2e *** empty log message *** 2000-01-16 16:36:58 +00:00
Jim Meyering
2b47bcaca6 . 2000-01-16 13:09:25 +00:00
Jim Meyering
11d24c8713 . 2000-01-16 13:08:07 +00:00
Jim Meyering
7c99efe376 *** empty log message *** 2000-01-16 12:59:09 +00:00
Jim Meyering
6bcc673201 Use changequote(<<,>>)', rather than changequote(, )'
because the latter didn't work.
2000-01-16 12:59:00 +00:00
Jim Meyering
337515e1ed *** empty log message *** 2000-01-16 12:47:42 +00:00
Jim Meyering
fda148fb1b Adapt to work with recently updated quotearg.c. 2000-01-16 12:47:34 +00:00
Jim Meyering
e7d71e0725 . 2000-01-16 12:40:26 +00:00
Jim Meyering
110b79479d Use new AC_C_PROTOTYPES instead of AM_C_PROTOTYPES. 2000-01-16 12:39:31 +00:00
Jim Meyering
e64e8130b1 *** empty log message *** 2000-01-16 12:36:53 +00:00
Jim Meyering
5fae922bab Sync with the version from emacs-20.5.
(<string.h>): Include if HAVE_STRING_H.
(<stdlib.h>): Include if HAVE_STDLIB_H.
(alloca): Abort if malloc fails.
2000-01-16 12:35:49 +00:00
Jim Meyering
840aee01de . 2000-01-15 16:09:56 +00:00
Jim Meyering
dfc6a234b0 . 2000-01-15 15:58:54 +00:00
Jim Meyering
b07aaa6cd0 sheesh: fix it right this time: gethostname getusershell 2000-01-15 13:57:04 +00:00
Jim Meyering
9e8497dd61 Fix typo
s/stpbrk/strpbrk
2000-01-15 12:13:13 +00:00
Jim Meyering
6a483c24a8 (AC_REPLACE_FUNCS):
Add these: euidaccess memcmp mkdir rmdir rpmatch strndup strverscmp.
2000-01-15 12:07:53 +00:00
Jim Meyering
590f2decc5 *** empty log message *** 2000-01-15 12:06:03 +00:00
Jim Meyering
489dafa7bc (AC_REPLACE_FUNCS): Add strpbrk. 2000-01-15 12:02:58 +00:00
Jim Meyering
8ee46f4bf8 *** empty log message *** 2000-01-15 12:00:16 +00:00
Jim Meyering
b6040be40a (AC_REPLACE_FUNCS):
Add these, too: stime strcspn stpcpy strstr strtol strtoul.
2000-01-15 11:59:15 +00:00
Jim Meyering
116bfa584d *** empty log message *** 2000-01-15 11:57:46 +00:00
Jim Meyering
c3f357adf5 Quote multibyte characters correctly.
(ISGRAPH): Remove.
(ISPRINT): New macro.
(<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
(isprint, mbrtowc, mbsinit, mbstate_t): New macros,
defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
(quotearg_buffer_restyled): New function, with most of the old
quotearg_buffer's contents.
Major rewrite to support multibyte characters.
(quotearg_buffer): Now just calls quotearg_buffer_restyled.
2000-01-15 11:57:11 +00:00
Jim Meyering
78992ab94f fix typo in last change 2000-01-15 11:48:10 +00:00
Jim Meyering
48bbfe2e71 (AC_REPLACE_FUNCS): Add memcpy and memset. 2000-01-15 11:47:12 +00:00
Jim Meyering
f02fa3aa3e *** empty log message *** 2000-01-15 11:45:52 +00:00
Jim Meyering
616361c4f6 *** empty log message *** 2000-01-15 11:44:11 +00:00
Jim Meyering
48e3ed52ee (AC_REPLACE_FUNCS): Add gethostname and getusershell 2000-01-15 11:41:08 +00:00
Jim Meyering
46d6db5426 *** empty log message *** 2000-01-15 11:14:42 +00:00
Jim Meyering
4841119c1a (TAB_STOP_SENTINEL): Define.
(unexpand): Use it instead of INT_MAX.
Declare column and pending to be `unsigned'.
Increment pending and column counters only if column is smaller
than TAB_STOP_SENTINEL.
2000-01-15 11:13:44 +00:00
Jim Meyering
8c0c6b0468 *** empty log message *** 2000-01-15 10:24:53 +00:00
Jim Meyering
5159046f88 *** empty log message *** 2000-01-15 10:24:10 +00:00
Jim Meyering
0d5f220029 *** empty log message *** 2000-01-15 09:51:23 +00:00
Jim Meyering
afd24c5869 *** empty log message *** 2000-01-15 09:08:07 +00:00
Jim Meyering
9bb0428a59 tweak comment 2000-01-15 07:07:41 +00:00
Jim Meyering
cf0a18b69d *** empty log message *** 2000-01-14 10:32:13 +00:00
Jim Meyering
6c7d8fd5b5 *** empty log message *** 2000-01-14 10:31:48 +00:00
Jim Meyering
3eb8c1fea4 *** empty log message *** 2000-01-14 07:05:58 +00:00
Jim Meyering
3ee8530a1e *** empty log message *** 2000-01-13 23:04:41 +00:00
Jim Meyering
66cbf09569 remove md5sum residue 2000-01-13 23:03:08 +00:00
Jim Meyering
3152cf6f82 *** empty log message *** 2000-01-13 23:02:32 +00:00
Jim Meyering
0567a5d9c8 *** empty log message *** 2000-01-13 23:01:14 +00:00
Jim Meyering
a69a2d6856 (fillbuf): Avoid quadratic behavior with long lines.
Also, stop worrying about ancient memchr bug (misbehavior when
size is zero), since other code doesn't worry either.
2000-01-13 07:34:44 +00:00
Jim Meyering
35ed98cc06 *** empty log message *** 2000-01-12 14:00:50 +00:00
Jim Meyering
ff626bd3c0 Make the warning that this shred test may not
be run as root more prominent.  Suggestion from Volker Borchert.
2000-01-12 14:00:22 +00:00
Jim Meyering
b52f383a7f *** empty log message *** 2000-01-12 08:17:41 +00:00
Jim Meyering
b14089f76b (jm_PREREQ_READUTMP): New macro.
(jm_PREREQ): Use it.
2000-01-12 08:17:30 +00:00
Jim Meyering
3df9479ab4 *** empty log message *** 2000-01-12 08:07:29 +00:00
Jim Meyering
bbe32e1637 (jm_PREREQ_CANON_HOST): Move code from su/configure.in. 2000-01-12 08:06:27 +00:00
Jim Meyering
79732f800d (jm_PREREQ_CANON_HOST): New macro.
(jm_PREREQ): Use it.
2000-01-12 07:58:22 +00:00
Jim Meyering
c186123316 *** empty log message *** 2000-01-12 07:27:34 +00:00
Jim Meyering
e50dab4ad9 *** empty log message *** 2000-01-12 06:58:30 +00:00
Jim Meyering
5d0f90dff7 *** empty log message *** 2000-01-12 06:56:54 +00:00
Jim Meyering
f3b0ab5eba (jm_PREREQ_QUOTEARG): New macro.
(jm_PREREQ): Use it.
2000-01-12 06:53:32 +00:00
Jim Meyering
551ab8474b (mode_compile): Use uintmax_t, not unsigned
long, to parse numeric modes.  Check for any unknown bits, not
just unknown bits left of the leftmost known bit.
2000-01-12 06:49:59 +00:00
Jim Meyering
12d6e4b1cd Update copyright notice. 2000-01-12 06:46:46 +00:00
Jim Meyering
a5ab3d9aac Sync with latest FSF version (fixing a minor Y2k problem). 2000-01-12 06:41:36 +00:00
Jim Meyering
fbe7dca27f Port to autoconf 2.13. 2000-01-12 06:40:10 +00:00
Jim Meyering
0d47b4be52 Sync to the slightly more general version of GNU tar. 2000-01-12 06:37:30 +00:00
Jim Meyering
59457bee16 (count_entry): Adjust to new calling convention for excluded_filename.
(main): Likewise, for add_exclude_file.
2000-01-12 06:36:56 +00:00
Jim Meyering
a3b2c5389c *** empty log message *** 2000-01-11 14:06:07 +00:00
Jim Meyering
1c4c285999 (memcpy): Protoize. 2000-01-11 14:05:28 +00:00
Jim Meyering
1b84791bc8 s/fu/fetish/ 2000-01-11 08:43:16 +00:00
Jim Meyering
126e14b161 (hash_initialize): Fix typo in comment. 2000-01-11 07:48:23 +00:00
Jim Meyering
80fd95a91d . 2000-01-11 07:28:22 +00:00
Jim Meyering
ca974b3755 *** empty log message *** 2000-01-10 12:52:18 +00:00
Jim Meyering
9f5307f1d3 *** empty log message *** 2000-01-10 11:53:22 +00:00
Jim Meyering
97085c8df7 *** empty log message *** 2000-01-10 11:53:16 +00:00
Jim Meyering
de1cb33196 *** empty log message *** 2000-01-10 11:36:05 +00:00
Jim Meyering
741c7303a5 (alpha): Use scp, not ncftp. 2000-01-10 11:35:44 +00:00
Jim Meyering
f23b3eb47a *** empty log message *** 2000-01-10 09:37:50 +00:00
Jim Meyering
f488edddf7 . 2000-01-10 09:21:14 +00:00
Jim Meyering
60dabf5cd1 . 2000-01-10 09:20:49 +00:00
Jim Meyering
44381ed288 *** empty log message *** 2000-01-10 08:11:56 +00:00
Jim Meyering
4717bb93f2 (announcement): Include URLs for xdelta files. 2000-01-10 08:11:41 +00:00
Jim Meyering
9442b6050b *** empty log message *** 2000-01-10 07:31:52 +00:00
Jim Meyering
6adb0e4d56 *** empty log message *** 2000-01-10 07:31:31 +00:00
Jim Meyering
6f06aad852 (noinst_HEADERS): Add nanosleep.h. 2000-01-10 07:31:14 +00:00
Jim Meyering
baf8720297 *** empty log message *** 2000-01-10 07:27:52 +00:00
Jim Meyering
94966b9515 *** empty log message *** 2000-01-09 16:21:39 +00:00
Jim Meyering
55d80ad41a *** empty log message *** 2000-01-09 16:20:44 +00:00
Jim Meyering
7b9c964fde *** empty log message *** 2000-01-09 16:17:52 +00:00
Jim Meyering
c4b800d7b6 *** empty log message *** 2000-01-09 16:17:26 +00:00
Jim Meyering
913e134b2d *** empty log message *** 2000-01-09 08:26:42 +00:00
Jim Meyering
5f2d0e3d6c *** empty log message *** 2000-01-09 08:26:15 +00:00
Jim Meyering
58cba22668 (do_link): Produce the same sort of one-line output for
`--backup --verbose' as cp, mv, install.  Before this, the backup
file name wasn't printed at all.
2000-01-09 08:23:51 +00:00
Jim Meyering
efe3229edb This affects cp, install, and mv.
(copy_internal): When making backup files in verbose
mode, print the backup file name on the same line as the rest of the
information, e.g., `a -> b (backup: b.~13~)' rather than on a line
by itself.
2000-01-09 08:20:45 +00:00
Jim Meyering
1279be6f8a *** empty log message *** 2000-01-08 18:03:08 +00:00
Jim Meyering
c852bc40d3 *** empty log message *** 2000-01-08 18:02:47 +00:00
Jim Meyering
e02fd60260 (PAGES_OPTION, COLUMNS_OPTION): Define these and use them instead of
`CHAR_MAX + n'.
2000-01-08 18:02:42 +00:00
Jim Meyering
299882b8a4 (OUTPUT_DELIMITER_OPTION): Define this and use it instead of `CHAR_MAX + n'. 2000-01-08 18:02:09 +00:00
Jim Meyering
fee7991cbc remove stray define before _LIBC 2000-01-08 17:53:35 +00:00
Jim Meyering
d486a2e744 *** empty log message *** 2000-01-08 17:53:21 +00:00
Jim Meyering
6752f5570a *** empty log message *** 2000-01-08 17:23:22 +00:00
Jim Meyering
00c9ad3937 . 2000-01-08 16:48:29 +00:00
Jim Meyering
9a0a8e29b0 *** empty log message *** 2000-01-08 16:46:20 +00:00
Jim Meyering
e5f283604b (TESTS_ENVIRONMENT): Add pwd/ prefix
to exported PATH value (though not strictly necessary, here).
2000-01-08 16:46:11 +00:00
Jim Meyering
1650a9459a *** empty log message *** 2000-01-08 16:44:27 +00:00
Jim Meyering
58edea6508 (error): Use __strerror_r's return value only if HAVE_WORKING_STRERROR_R.
(error_at_line): Likewise.
2000-01-08 16:44:19 +00:00
Jim Meyering
d15ab2c1be (null_AM_MAKEFLAGS): Define.
(my-distcheck): Use it to avoid distributing out of date files
whose derivation would require a maintainer tool.
2000-01-08 16:38:13 +00:00
Jim Meyering
cabbdf7bbf . 2000-01-08 16:35:26 +00:00
Jim Meyering
92999d559c . 2000-01-08 16:34:24 +00:00
Jim Meyering
625ce6a036 . 2000-01-08 16:32:02 +00:00
Jim Meyering
dfbeb59dc0 *** empty log message *** 2000-01-08 16:31:29 +00:00
Jim Meyering
b8342a9a20 (jm_FUNC_STRERROR_R): New file/macro. 2000-01-08 16:30:49 +00:00
Jim Meyering
2170503967 (jm_FUNC_STRERROR_R): Require it. 2000-01-08 16:25:57 +00:00
Jim Meyering
5693e5c586 Sync with the GNU C library. 2000-01-07 14:29:26 +00:00
Jim Meyering
b830d441bb . 2000-01-07 12:27:31 +00:00
Jim Meyering
923a32a0a8 tweak comment 2000-01-07 09:18:15 +00:00
Jim Meyering
a86b522044 *** empty log message *** 2000-01-07 08:56:48 +00:00
Jim Meyering
11eebed20f (TESTS_ENVIRONMENT): Add pwd/ prefix to exported PATH value (though not strictly necessary, here). 2000-01-07 08:56:38 +00:00
Jim Meyering
9bcff27f18 *** empty log message *** 2000-01-07 08:26:13 +00:00
Jim Meyering
858254d559 (TESTS_ENVIRONMENT): Add pwd/ prefix
to exported PATH value (though not strictly necessary, here).
2000-01-07 08:25:47 +00:00
Jim Meyering
f90f8cea87 (TESTS_ENVIRONMENT): Add pwd/ prefix
to exported PATH value (though not strictly necessary, here).
2000-01-07 08:25:26 +00:00
Jim Meyering
30a1c917c7 (TESTS_ENVIRONMENT): Add pwd/ prefix
to exported PATH value (though not strictly necessary, here).
2000-01-07 08:24:38 +00:00
Jim Meyering
36a3a59284 (TESTS_ENVIRONMENT): Add pwd/ prefix
to exported PATH value (though not strictly necessary, here).
2000-01-07 08:24:16 +00:00
Jim Meyering
aac32d403c add copyright/no-warranty comment 2000-01-07 07:33:19 +00:00
Jim Meyering
8606b093e4 *** empty log message *** 2000-01-07 07:31:03 +00:00
Jim Meyering
4e4c0e24d5 tweak copyright line 2000-01-07 07:03:01 +00:00
Jim Meyering
76bc7db5e2 (strpbrk): Ansideclify.
Use `#if' instead of `#ifdef' for `HAVE_CONFIG_H'.
2000-01-07 07:01:45 +00:00
Jim Meyering
fd3e041f5b Use #if' instead of #ifdef' for `HAVE_CONFIG_H'.
Capitalize all macro parameters.
(memcasecmp): Ansideclify.
Don't cast away `const'ness of parameters.
Suggestions from Franois Pinard.
2000-01-07 06:59:36 +00:00
Jim Meyering
ce2bd26821 . 2000-01-06 23:13:49 +00:00
Jim Meyering
1b470586fd . 2000-01-06 23:11:55 +00:00
Jim Meyering
198bd22923 . 2000-01-06 23:10:51 +00:00
Jim Meyering
8c5a80b069 . 2000-01-06 23:10:22 +00:00
Jim Meyering
a2e08f3047 *** empty log message *** 2000-01-06 22:58:02 +00:00
Jim Meyering
eff6393e39 Import version 1.020. 2000-01-06 22:49:01 +00:00
Jim Meyering
bbe0894eb2 . 2000-01-06 22:40:59 +00:00
Jim Meyering
c2d329d6c8 *** empty log message *** 2000-01-06 21:39:58 +00:00
Jim Meyering
136a8efd10 Use jm_CHECK_TYPE_STRUCT_UTIMBUF, renamed from jm_STRUCT_UTIMBUF. 2000-01-06 21:39:28 +00:00
Jim Meyering
567dae8b9c *** empty log message *** 2000-01-06 21:32:03 +00:00
Jim Meyering
f8c6ea241d Sync with the GNU C Library. 2000-01-06 21:31:48 +00:00
Jim Meyering
6784d83a62 Add #pragma STDC FENV_ACCESS ON if C99. 2000-01-06 21:01:06 +00:00
Jim Meyering
2f8c0d5542 Sync tm_diff with the GNU C Library.
(TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN.  All uses changed.
(tm_diff): Renamed from difftm.  All uses changed.
Replace body with that taken from GNU C Library 2.1.3pre1.
(get_date): Prefer tm_gmtoff to tm_diff if available.
2000-01-06 18:25:03 +00:00
Jim Meyering
1150e89832 *** empty log message *** 2000-01-06 18:24:51 +00:00
Jim Meyering
dd282c588b . 2000-01-06 17:13:39 +00:00
Jim Meyering
8301c1310b *** empty log message *** 2000-01-06 16:01:57 +00:00
Jim Meyering
8c0752d9be Tell the user just before sleeping for 7 seconds. 2000-01-06 16:01:43 +00:00
Jim Meyering
d9b2187a8c *** empty log message *** 2000-01-06 15:59:06 +00:00
Jim Meyering
d50599ae1a *** empty log message *** 2000-01-06 15:58:55 +00:00
Jim Meyering
6cb491d9df (TESTS): Remove fflush. It didn't
test the losing behavior, and left a stray tail process to boot.
2000-01-06 15:58:47 +00:00
Jim Meyering
21b43e0fe9 add blank line 2000-01-06 08:35:45 +00:00
Jim Meyering
2315cbdeaa (apply_suffix): Comment. 2000-01-06 08:35:21 +00:00
Jim Meyering
eee26242bb fix typo in comment 2000-01-06 08:29:10 +00:00
Jim Meyering
757861331e Minor code cleanup.
(clock_get_realtime): Return argument, for convenience.
(main): Use this to simplify main sleep loop.
2000-01-06 08:28:39 +00:00
Jim Meyering
e1cc2ace3c *** empty log message *** 2000-01-05 14:08:05 +00:00
Jim Meyering
f8d2a3f723 *** empty log message *** 2000-01-05 12:19:48 +00:00
Jim Meyering
3a673ed728 . 2000-01-05 12:19:04 +00:00
Jim Meyering
fd0797a4e4 Include nanosleep.h.
(AUTHORS): Add Paul Eggert.
2000-01-05 12:17:59 +00:00
Jim Meyering
3b979cf095 Add #pragma STDC FENV_ACCESS ON if C99.
(<fenv.h>): Include if available.
(main): Always round floating-point interval calculations upwards,
as we must sleep for at least the specified time.
Do the right thing with NaNs.
2000-01-05 12:17:19 +00:00
Jim Meyering
7f1c659ce3 whoops. fix typos 2000-01-05 12:06:39 +00:00
Jim Meyering
ec266f43d5 Include nanosleep.h.
Don't include time.h or sys/time.h here.
2000-01-05 12:03:53 +00:00
Jim Meyering
1885aeaaa4 *** empty log message *** 2000-01-05 12:03:06 +00:00
Jim Meyering
a2bee2bc6f (savedir): Don't store past the end of an array if
name_size is zero and the directory is empty.
2000-01-04 22:54:54 +00:00
Jim Meyering
1e01103713 *** empty log message *** 2000-01-04 17:18:15 +00:00
Jim Meyering
ce17dc2e94 Reflect s/jm_STRUCT_/jm_CHECK_TYPE_STRUCT_/ renamings. 2000-01-04 17:18:05 +00:00
Jim Meyering
6ed0893953 bump serial # 2000-01-04 17:16:48 +00:00
Jim Meyering
483ed4cbfd *** empty log message *** 2000-01-04 17:16:34 +00:00
Jim Meyering
b75698cf72 (jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Rename from jm_STRUCT_DIRENT_D_TYPE. 2000-01-04 17:16:26 +00:00
Jim Meyering
c26299c3d2 (jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Rename from jm_STRUCT_DIRENT_D_INO. 2000-01-04 17:15:32 +00:00
Jim Meyering
82ca413ae4 (jm_CHECK_TYPE_STRUCT_UTIMBUF): Rename from jm_STRUCT_UTIMBUF. 2000-01-04 17:13:58 +00:00
Jim Meyering
0d30a49178 (jm_CHECK_TYPE_STRUCT_TIMESPEC): Require it. 2000-01-04 17:12:45 +00:00
Jim Meyering
cdff473cd3 *** empty log message *** 2000-01-04 17:12:12 +00:00
Jim Meyering
9a74f64d12 . 2000-01-04 15:11:03 +00:00
Jim Meyering
8714cce36a (PREV_VERSION): Tweak so it handles e.g., 2.0a -> 2.0.
(alpha): Create xdelta diffs.
2000-01-04 13:20:15 +00:00
Jim Meyering
1a7010a87f (PREV_VERSION): Tweak so it handles e.g., 2.0a -> 2.0. 2000-01-04 12:24:49 +00:00
Jim Meyering
556a7ac657 *** empty log message *** 2000-01-03 19:59:04 +00:00
Jim Meyering
eed8a2f5e1 tweak comment 2000-01-03 19:58:56 +00:00
Jim Meyering
2ff3485a8d (jm_FUNC_NANOSLEEP): Search for nanosleep in -lrt
(for Solaris 7) and in -lposix4 (for Solaris 2.5.1).
2000-01-03 19:58:09 +00:00
Jim Meyering
3206a63225 *** empty log message *** 2000-01-02 16:00:44 +00:00
Jim Meyering
ef4c445a55 . 2000-01-02 15:59:32 +00:00
Jim Meyering
20ca1d8601 *** empty log message *** 2000-01-02 15:57:02 +00:00
Jim Meyering
60ff88e110 *** empty log message *** 2000-01-02 09:59:01 +00:00
Jim Meyering
6e5a32d58f Escape `$' in $3 of dnl comment. I no longer remember if this is necessary. 2000-01-02 09:58:53 +00:00
Jim Meyering
5f55b410a6 *** empty log message *** 2000-01-02 09:53:03 +00:00
Jim Meyering
27f7343bf6 *** empty log message *** 2000-01-02 09:52:32 +00:00
Jim Meyering
141036e2ea sleep accepts arbitrary floating point numbers. 2000-01-02 09:50:15 +00:00
Jim Meyering
34c324d786 update usage 2000-01-02 09:31:15 +00:00
Jim Meyering
9df5f7720b *** empty log message *** 2000-01-02 09:13:17 +00:00
Jim Meyering
f2de5d5212 *** empty log message *** 2000-01-02 09:12:55 +00:00
Jim Meyering
c5ed5e05ea . 2000-01-02 09:11:55 +00:00
Jim Meyering
7092835d3b *** empty log message *** 2000-01-02 08:57:49 +00:00
Jim Meyering
af6d4ad6ca Remove non-POSIX warning about trailing-slashed symlink-to-directory. 2000-01-02 08:53:30 +00:00
Jim Meyering
70cc369588 New option: --strip-trailing-slashes. 2000-01-02 08:51:39 +00:00
Jim Meyering
b3faf79a75 *** empty log message *** 2000-01-02 08:45:43 +00:00
Jim Meyering
50de4d0751 *** empty log message *** 2000-01-02 07:41:02 +00:00
Jim Meyering
60f3f576c7 (#pragma alloca): Add if _AIX is defined.
(path-concat.h): Include.
(show_point): If HAVE_REALPATH or HAVE_RESOLVEPATH is defined,
find the real absolute path for PATH, and use that to find the
mount point.

(show_point): Prefer non-dummy entries in shortcuts, too.
Disable bogus mount dirs instead of restatting them each time.
2000-01-02 07:40:24 +00:00
Jim Meyering
05fcf7df27 (my_strftime): Some old compilers object to
'\a', so don't bother optimizing for it.
2000-01-02 07:09:54 +00:00
Jim Meyering
d5d6d965ed *** empty log message *** 2000-01-01 20:00:28 +00:00
Jim Meyering
d9fd3ba617 . 2000-01-01 19:56:56 +00:00
Jim Meyering
8c3df2e678 *** empty log message *** 2000-01-01 09:43:40 +00:00
Jim Meyering
847d050688 *** empty log message *** 1999-12-30 09:09:38 +00:00
Jim Meyering
18f381afea *** empty log message *** 1999-12-30 09:09:03 +00:00
Jim Meyering
1128d1dffb *** empty log message *** 1999-12-30 09:07:31 +00:00
Jim Meyering
1d54f66fd0 (remove_parents, main): Don't pass errno to error
when printing "removing directory" message.  Failure of rmdir is
handled elsewhere.
1999-12-30 09:07:13 +00:00
Jim Meyering
84226463b1 . 1999-12-27 16:31:56 +00:00
Jim Meyering
b32cecce88 . 1999-12-27 16:30:45 +00:00
Jim Meyering
99c51ad97e minor var. renamings 1999-12-27 16:30:20 +00:00
Jim Meyering
4c746d7a4c tweak --help 1999-12-27 15:57:26 +00:00
Jim Meyering
dc33452012 *** empty log message *** 1999-12-27 14:17:39 +00:00
Jim Meyering
f71e656070 *** empty log message *** 1999-12-26 10:19:40 +00:00
Jim Meyering
34c6851c4a *** empty log message *** 1999-12-26 10:16:18 +00:00
Jim Meyering
b1dee02eb1 *** empty log message *** 1999-12-26 10:03:46 +00:00
Jim Meyering
0335111c76 (jm_FUNC_NANOSLEEP): New file/macro. 1999-12-26 10:02:31 +00:00
Jim Meyering
2dc33d421e *** empty log message *** 1999-12-26 09:40:16 +00:00
Jim Meyering
0ac76a646b *** empty log message *** 1999-12-25 22:15:23 +00:00
Jim Meyering
64003d937b Use < rather than >.
(main): Normalize ts_stop.
1999-12-25 20:00:21 +00:00
Jim Meyering
936a26728a . 1999-12-23 15:28:02 +00:00
Jim Meyering
5f22e8234b *** empty log message *** 1999-12-23 15:09:17 +00:00
Jim Meyering
0ecbb73025 (USE_CLOCK_GETTIME): Define.
[USE_CLOCK_GETTIME]: Include sys/time.h.
(timespec_subtract): New function.
(clock_get_realtime): New function.
(sighandler): Remove function.
(main): Reimplement again, using nanosleep and clock_gettime.
1999-12-23 14:34:38 +00:00
Jim Meyering
fc7ceba21b *** empty log message *** 1999-12-23 14:25:17 +00:00
Jim Meyering
c5494ca49a *** empty log message *** 1999-12-23 11:56:32 +00:00
Jim Meyering
c94e214238 Check for clock_gettime (moved from fileutils/configure.in)
Check for gettimeofday.
1999-12-23 11:55:58 +00:00
Jim Meyering
5db04594ae *** empty log message *** 1999-12-23 11:54:36 +00:00
Jim Meyering
eb19369c84 *** empty log message *** 1999-12-23 09:56:01 +00:00
Jim Meyering
1c49904e91 *** empty log message *** 1999-12-23 09:51:50 +00:00
Jim Meyering
d134d00bb4 . 1999-12-23 09:50:31 +00:00
Jim Meyering
9cd6962a4a . 1999-12-23 09:49:59 +00:00
Jim Meyering
21039f0b39 *** empty log message *** 1999-12-23 09:34:57 +00:00
Jim Meyering
ff9eed5ff5 (usage): Correct typos.
List new --target-directory=... usage.
Reported by Gran Uddeborg
1999-12-23 09:34:48 +00:00
Jim Meyering
176efa5092 (usage): List new --target-directory=... usage. 1999-12-23 09:34:25 +00:00
Jim Meyering
1206a834dd rewrite expression (equivalently) at request of Paul Eggert 1999-12-22 20:49:19 +00:00
Jim Meyering
bda1bae801 *** empty log message *** 1999-12-22 16:51:48 +00:00
Jim Meyering
67e3d46292 *** empty log message *** 1999-12-22 16:32:24 +00:00
Jim Meyering
3551f63a62 (ceil_percent): Remove.
(show_dev): Avoid overflow problems when calculating percent.
Do not display negative percents.
1999-12-22 16:32:07 +00:00
Jim Meyering
38d48aa7e9 *** empty log message *** 1999-12-22 14:30:45 +00:00
Jim Meyering
94aebe4774 Use $file, not $tmp/file. Exit 77 if run as root. 1999-12-22 14:30:23 +00:00
Jim Meyering
759da836f6 *** empty log message *** 1999-12-22 11:18:06 +00:00
Jim Meyering
222389a6d0 *** empty log message *** 1999-12-22 11:15:26 +00:00
Jim Meyering
621a5a5d61 (regress-1): New test for the above. 1999-12-22 11:15:15 +00:00
Jim Meyering
1796cbe0c6 *** empty log message *** 1999-12-22 11:14:30 +00:00
Jim Meyering
aa07786952 (get_date): Fix typo in time_t overflow test.
From Michael Stone.
1999-12-22 11:14:05 +00:00
Jim Meyering
771ec09cd4 . 1999-12-20 10:42:32 +00:00
Jim Meyering
f9dd65cfc8 Remove kludge, now that I'm using the fixed autoconf-2.14a-1999-12-20. 1999-12-20 10:37:27 +00:00
Jim Meyering
372ce8d3ce *** empty log message *** 1999-12-20 10:11:28 +00:00
Jim Meyering
7769c416ef tweak comment 1999-12-19 15:51:32 +00:00
Jim Meyering
c077ecf83c tweak comment 1999-12-19 15:21:19 +00:00
Jim Meyering
50075bf532 *** empty log message *** 1999-12-19 10:49:15 +00:00
Jim Meyering
b04f00f3d4 (lstat.c): Adapt rule to handle new parts of xstat.in.
(lstat.c): Likewise.
1999-12-19 10:46:19 +00:00
Jim Meyering
036b3bdae7 (slash_aware_lstat): New function.
(rpl_@xstat@): Use it.
1999-12-19 10:45:50 +00:00
Jim Meyering
f802f28675 *** empty log message *** 1999-12-19 10:43:18 +00:00
Jim Meyering
4a1f449cbe *** empty log message *** 1999-12-19 10:42:51 +00:00
Jim Meyering
0d9e008da2 . 1999-12-19 10:25:06 +00:00
Jim Meyering
7902c47089 *** empty log message *** 1999-12-19 10:23:58 +00:00
Jim Meyering
566fb840b3 *** empty log message *** 1999-12-19 10:23:47 +00:00
Jim Meyering
3d58863d57 [! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Use lstat wrapper.
[Notice the new test in m4/lstat-slash.m4. ]
(main): Back out change from 1999-02-19 that made ls remove
trailing slashes from command line arguments to accommodate early
versions of Linux.  Now, `ls symlink-to-dir/' acts like
`ls symlink-to-dir/.' thus following the symbolic link, as POSIX says
it should.  Suggestion from Bruno Haible and Andreas Schwab.
1999-12-19 10:23:26 +00:00
Jim Meyering
a595998975 . 1999-12-19 10:22:47 +00:00
Jim Meyering
c8707dcc2f . 1999-12-19 10:21:51 +00:00
Jim Meyering
4d8a95eff3 (TESTS): Add symlink-slash. 1999-12-19 10:21:34 +00:00
Jim Meyering
fa468393ae remove unused test= stmt 1999-12-19 09:41:08 +00:00
Jim Meyering
dd1a7723a6 *** empty log message *** 1999-12-19 09:37:22 +00:00
Jim Meyering
0c578407e0 bump serial number 1999-12-19 09:37:06 +00:00
Jim Meyering
bce84b024a Use the new macro: jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK. 1999-12-19 09:36:55 +00:00
Jim Meyering
a260bc04c8 *** empty log message *** 1999-12-19 09:34:29 +00:00
Jim Meyering
68a35b96ce *** empty log message *** 1999-12-19 09:33:18 +00:00
Jim Meyering
a9afc5a7d0 *** empty log message *** 1999-12-18 23:00:58 +00:00
Jim Meyering
96c183f34f *** empty log message *** 1999-12-18 22:41:36 +00:00
Jim Meyering
b9aa56bec4 *** empty log message *** 1999-12-18 16:04:47 +00:00
Jim Meyering
04aa739146 (wipename): When repeatedly renaming a file, making the name shorter
and shorter, skip to the next shorter length length if a rename fails (e.g. due to
permission denied).  Otherwise, this loop would iterate for so long that shred would
appear to be stuck in an infinite loop for any but the shortest file names.
1999-12-18 16:00:49 +00:00
Jim Meyering
ac31ad442b *** empty log message *** 1999-12-18 11:48:43 +00:00
Jim Meyering
a47deedda7 (print_entry): Correct do_lookup test so that who
prints whatever host information it has, even without --lookup.
1999-12-18 11:48:37 +00:00
Jim Meyering
a9c3d9197f *** empty log message *** 1999-12-15 10:15:36 +00:00
Jim Meyering
4d90b0efc9 (decode_switches): If -c or -u is specified and not -l (or any other
option that implies -l), and no sort-type was specified,
then sort by the ctime (-c) or atime (-u).  Part of this change reverts
the 1998-01-10 delta.
(usage): Update to reflect this change.
Reported by Paul Slootman via Michael Stone.
1999-12-15 08:38:54 +00:00
Jim Meyering
c8ad493e6b . 1999-12-14 09:00:08 +00:00
Jim Meyering
99aa95f945 *** empty log message *** 1999-12-13 22:37:15 +00:00
Jim Meyering
927b1d42fb *** empty log message *** 1999-12-13 15:08:21 +00:00
Jim Meyering
b5123778b7 *** empty log message *** 1999-12-13 15:04:27 +00:00
Jim Meyering
5c2322aacc *** empty log message *** 1999-12-13 15:03:51 +00:00
Jim Meyering
0c7c8c2992 *** empty log message *** 1999-12-13 07:33:13 +00:00
Jim Meyering
c8d452098b (make_path): Consistently use error to output
the verbose, `created directory ...' messages.
Reported by Bernhard Rosenkraenzer.
1999-12-13 07:30:57 +00:00
Jim Meyering
3182653495 *** empty log message *** 1999-12-13 07:29:13 +00:00
Jim Meyering
7efcffd2e6 *** empty log message *** 1999-12-13 06:45:13 +00:00
Jim Meyering
63324e5e7e Move 120+ lines of stat.h-related macros from system.h (not shared)
to sys2.h, which is shared between fileutils, sh-utils, textutils.
* src/system.h: Move them from here...
* src/sys2.h: ... to here.
1999-12-12 21:49:25 +00:00
Jim Meyering
488028199d (S_IRUSR, S_IRGRP, S_IWGRP, S_IROTH, S_IWOTH): Define
if not defined.  This was necessary on a NeXT Turbostation running
Mach 3.3.  Reported by Nelson H. F. Beebe.
1999-12-12 21:45:34 +00:00
Jim Meyering
c71815ac7b *** empty log message *** 1999-12-12 20:26:48 +00:00
Jim Meyering
6ff905699a . 1999-12-10 16:30:28 +00:00
Jim Meyering
d3d701080b . 1999-12-10 16:29:54 +00:00
Jim Meyering
c6025b9d1e . 1999-12-10 15:22:55 +00:00
Jim Meyering
b026aa85d0 (_jm_STRFTIME_PREREQS): Use 3-arg form of AC_DEFINE for HAVE_TM_GMTOFF. 1999-12-10 14:35:38 +00:00
Jim Meyering
4c0b11a8e7 *** empty log message *** 1999-12-09 16:53:41 +00:00
Jim Meyering
5ac2b8e39b . 1999-12-09 16:42:00 +00:00
Jim Meyering
5214179c29 . 1999-12-09 16:38:32 +00:00
Jim Meyering
e8ff25dd70 *** empty log message *** 1999-12-09 15:55:11 +00:00
Jim Meyering
fc8e7363d2 Require that File::Compare be available, too.
Too many systems seem to lack it.
1999-12-09 15:54:59 +00:00
Jim Meyering
022194de49 Add checks for most of the cpp macros tested in GNU's strftime.c.
Prompted by a patch from Paul Eggert.
1999-12-09 15:54:20 +00:00
Jim Meyering
eb06f705a1 Use 1>&2 rather than `1<&-'.
Suggestion from Volker Borchert.
1999-12-09 15:52:49 +00:00
Jim Meyering
aeabe74421 (IGNORE_FAIL_ON_NON_EMPTY_OPTION): Likewise. 1999-12-09 15:52:09 +00:00
Jim Meyering
46b6c26e4f (BLOCK_SIZE_OPTION, EXCLUDE_OPTION, MAX_DEPTH_OPTION):
Define these and use them instead of `CHAR_MAX + n'.
1999-12-09 15:46:39 +00:00
Jim Meyering
919f2ce3da (BLOCK_SIZE_OPTION, SYNC_OPTION, NO_SYNC_OPTION): Define
these and use them instead of `CHAR_MAX + n'.
1999-12-09 15:43:41 +00:00
Jim Meyering
6cbabe63d4 (anonymous enum): Define TIME_OPTION, and ...
(longopts): ...use it here instead of `CHAR_MAX + 1'.
(main): Likewise.
1999-12-09 15:39:38 +00:00
Jim Meyering
1aa50fd72e (enum): Remove useless CHAR_MAX + 2 1999-12-09 15:35:41 +00:00
Jim Meyering
6845fc7c96 Test more of the framework (touch's -a and -m
options) before running the actual ls test.
1999-12-08 17:05:59 +00:00
Jim Meyering
84339c827f s/test_failure/framework_failure/g 1999-12-08 16:50:22 +00:00
Jim Meyering
be3748ddad (TESTS): Add fflush. 1999-12-05 23:31:34 +00:00
Jim Meyering
392a965229 Remove ftp.enst.fr. 1999-12-05 22:59:30 +00:00
Jim Meyering
5cb18377bc *** empty log message *** 1999-12-05 22:36:11 +00:00
Jim Meyering
93c2c18a80 (main): Flush stdout before switching to unbuffered mode
and calling tail_forever.  Required only on Solaris2.7 -- on other
systems, using setvbuf to switch to unbufferd mode does the flush.
1999-12-05 22:36:02 +00:00
Jim Meyering
dd002c22fd *** empty log message *** 1999-12-05 16:45:27 +00:00
Jim Meyering
f447e97462 . 1999-12-05 16:39:39 +00:00
Jim Meyering
3abc240e82 *** empty log message *** 1999-12-05 15:14:18 +00:00
Jim Meyering
ff8f4dde22 *** empty log message *** 1999-12-05 15:13:40 +00:00
Jim Meyering
f880990daf Revert the previous change.
(copy_internal): In move mode, if the rename attempt
fails, then unlink any existing destination file.  This makes a
cross-device `mv' more consistent with the intra-device behavior.
This change is required by POSIX to make a cross-device move act with
semantics similar to those of the rename syscall.  For example now
`mv' can move a file onto a symlink to itself when that symlink
is on a separate partition.  With fileutils-4.0j, it would fail with
a diagnostic saying they were the same file.
Reported by Bruno Haible.
1999-12-05 15:13:21 +00:00
Jim Meyering
7306126ef0 *** empty log message *** 1999-12-04 17:46:39 +00:00
Jim Meyering
305e2306be . 1999-12-04 17:46:06 +00:00
Jim Meyering
2b10e67d59 (TESTS): Add to-symlink. 1999-12-04 17:45:45 +00:00
Jim Meyering
dc74b3a1e7 Make sure that the copying code used in an inter-partition
move unlinks a destination symlink before opening it.
1999-12-04 17:44:59 +00:00
Jim Meyering
2f21a269fe *** empty log message *** 1999-12-04 17:34:39 +00:00
Jim Meyering
69408d229e *** empty log message *** 1999-12-04 17:34:05 +00:00
Jim Meyering
f05badd230 (trap): Be careful to close $actual before
removing the containing directory.  Otherwise, on some systems rmdir
fails to remove the containing directory.
1999-12-04 17:33:49 +00:00
Jim Meyering
6763fa97d2 *** empty log message *** 1999-12-04 17:31:29 +00:00
Jim Meyering
b1b10e1e40 List --full-time dates upon failure. 1999-12-04 17:31:23 +00:00
Jim Meyering
5810f4bee5 . 1999-12-04 17:30:24 +00:00
Jim Meyering
91b5e686d5 Adapt to reflect this change in behavior.
Make sure the VERSION_CONTROL envvar is not set.
Run diff if comparison fails.
1999-12-04 17:30:16 +00:00
Jim Meyering
8c096b86ef Use mv, ls, rm, not $MV, $LS, $RM. 1999-12-04 17:24:19 +00:00
Jim Meyering
698fd02798 (copy_internal): Be consistent with intra-device behavior
and *do* allow `mv' to move a file onto a symlink to itself when that
symlink is on a separate partition.  With fileutils-4.0j, it would
fail with a diagnostic saying they were the same file.
Reported by Bruno Haible.
1999-12-04 17:21:47 +00:00
Jim Meyering
28bac510d9 *** empty log message *** 1999-12-04 17:21:06 +00:00
Jim Meyering
2413369d22 *** empty log message *** 1999-12-04 17:05:27 +00:00
Jim Meyering
091109470c Give the right diagnostic when failing to create a file in an
unwritable directory.

(touch): Record errno upon failed errno and use that
saved value if a subsequent fstat, stat or utime call fails.
Reported by Wichert Akkerman via Michael Stone.
1999-12-04 17:03:43 +00:00
Jim Meyering
9481a7bd36 *** empty log message *** 1999-12-04 16:56:07 +00:00
Jim Meyering
2be3dc067a (check_symlink_color): New variable.
(main): Set it if we need to check for dangling symlinks when
displaying colors.
(gobble_file): Check check_symlink_color instead of print_with_color.
1999-12-04 16:55:27 +00:00
Jim Meyering
c4542a7e8c (usage): Shorten help for --show-control-chars. 1999-11-30 21:09:35 +00:00
Jim Meyering
6c9e0d702a *** empty log message *** 1999-11-30 16:09:58 +00:00
Jim Meyering
062906c83a Don't include math.h or float.h.
Don't use DBL_MAX.
Use TIME_T_MAX instead.
1999-11-28 19:59:18 +00:00
Jim Meyering
2c3fa56cef *** empty log message *** 1999-11-28 19:57:54 +00:00
Jim Meyering
346edb7361 *** empty log message *** 1999-11-28 19:56:38 +00:00
Jim Meyering
b9c91d0570 don't include assert.h 1999-11-28 14:04:12 +00:00
Jim Meyering
e20a9b89d2 Round more carefully so we never call nanosleep with more than 999,999,999
nanoseconds.
Comment out assertion because it uses on EINTR.
1999-11-28 14:03:43 +00:00
Jim Meyering
0baa523154 Rewrite to use nanosleep (hence, timer stops when sleep is suspended)
and to remove gettimeofday/signal cruft.
Improve overflow checking.
1999-11-28 13:35:00 +00:00
Jim Meyering
d5f7b2a2db *** empty log message *** 1999-11-28 08:08:51 +00:00
Jim Meyering
4c05896b20 better error checking
add FIXME comments for non-portable constructs
1999-11-28 08:00:58 +00:00
Jim Meyering
ec974f5c39 remove another printf stmt 1999-11-27 20:03:05 +00:00
Jim Meyering
15d2e7a86b remove printf stmts 1999-11-27 20:02:38 +00:00
Jim Meyering
069610a0f0 fix typos 1999-11-27 20:01:22 +00:00
Jim Meyering
5617251659 Rewrite to allow fractional seconds and to handle SIGCONT.
(main): Rewrite.
(sighandler): New function.
(apply_suffix): New function.
(timeval_subtract): New function.
1999-11-27 20:00:54 +00:00
Jim Meyering
398516f242 (usage): Add elipses to show that sleep allows more than one argument. 1999-11-27 17:10:15 +00:00
Jim Meyering
8e1452ffea remove brackets around required sleep argument 1999-11-27 17:04:29 +00:00
Jim Meyering
6b36a017db (argdecode): Move definition to precede use.
Remove prototype.
1999-11-27 15:02:27 +00:00
Jim Meyering
30d2b031ab *** empty log message *** 1999-11-27 10:15:46 +00:00
Jim Meyering
f72f631fa0 Don't set/use MV, etc. 1999-11-27 10:14:53 +00:00
Jim Meyering
d10b18f2b9 *** empty log message *** 1999-11-27 10:14:24 +00:00
Jim Meyering
511cd5b6ae Don't set/use MV, etc. 1999-11-27 10:14:04 +00:00
Jim Meyering
09282a24f6 Don't set/use RM and MV. 1999-11-27 10:11:25 +00:00
Jim Meyering
f36a801a9a Don't set/use LS MV MKDIR MKNOD RM TOUCH 1999-11-27 10:10:02 +00:00
Jim Meyering
1e219d6b71 Don't set/use DF or MKDIR. 1999-11-27 10:08:55 +00:00
Jim Meyering
2e0f5a2bac *** empty log message *** 1999-11-27 10:05:25 +00:00
Jim Meyering
9234f12d32 (TESTS): Add partition-perm. 1999-11-27 10:05:11 +00:00
Jim Meyering
bd2102efa4 *** empty log message *** 1999-11-27 09:01:22 +00:00
Jim Meyering
6550d040a5 *** empty log message *** 1999-11-27 09:01:05 +00:00
Jim Meyering
afdd1c5ca2 *** empty log message *** 1999-11-26 16:50:33 +00:00
Jim Meyering
7af339b126 (df_readable): Now returns char const *, not char *.
New arg NEGATIVE.
(ceil_percent): Now returns double, not int.
Be more careful about adding 1 to a wild value.
(show_dev): Don't filter out wild sizes from the underlying operating
system; instead, show them to the user as faithfully as possible.
1999-11-26 16:50:24 +00:00
Jim Meyering
0d6c850979 . 1999-11-26 07:31:42 +00:00
Jim Meyering
a6db3e776e *** empty log message *** 1999-11-23 12:57:38 +00:00
Jim Meyering
f5c9c07779 (Calendar date item): Correction regarding 0..68/
69-99 split for 1900 vs 2000.  From Peter Moulder.
1999-11-23 12:57:10 +00:00
Jim Meyering
05de2104b9 *** empty log message *** 1999-11-23 12:56:30 +00:00
Jim Meyering
22c0d963f1 . 1999-11-22 15:05:52 +00:00
Jim Meyering
6cfbe9468a . 1999-11-22 14:10:07 +00:00
Jim Meyering
630d0d3f8d (DISTCLEANFILES): Add lstat.c and stat.c. 1999-11-22 14:09:58 +00:00
Jim Meyering
d3af459dac *** empty log message *** 1999-11-22 13:21:48 +00:00
Jim Meyering
b9cbaa7073 . 1999-11-22 13:14:19 +00:00
Jim Meyering
6c95094270 *** empty log message *** 1999-11-22 11:35:12 +00:00
Jim Meyering
65c46d231a *** empty log message *** 1999-11-22 11:23:35 +00:00
Jim Meyering
c401c7f12c *** empty log message *** 1999-11-22 11:23:08 +00:00
Jim Meyering
5a7847d20f . 1999-11-22 09:16:27 +00:00
Jim Meyering
94129d72a5 *** empty log message *** 1999-11-22 09:15:42 +00:00
Jim Meyering
e0e3f4ba72 . 1999-11-22 09:13:32 +00:00
Jim Meyering
61511d8bcb *** empty log message *** 1999-11-22 09:13:15 +00:00
Jim Meyering
7eba3be340 (recheck): Handle a race condition (including <dev,inode>
reuse) that would lead to a failed assertion.
Reported by Ken Pizzini.
(tail_forever): Record errno before using it in call to `error'
which might change it.
(tail_file): Likewise.
1999-11-22 09:07:58 +00:00
Jim Meyering
971da27132 comment out echo stmts 1999-11-22 09:03:57 +00:00
Jim Meyering
eff0f7cd2e (TESTS): remove infloop-1 1999-11-22 09:03:12 +00:00
Jim Meyering
b609a36366 *** empty log message *** 1999-11-22 08:56:52 +00:00
Jim Meyering
e4dbcfc604 *** empty log message *** 1999-11-22 08:56:39 +00:00
Jim Meyering
8a34174fb2 *** empty log message *** 1999-11-22 08:55:00 +00:00
Jim Meyering
f22a30f1e5 *** empty log message *** 1999-11-22 08:54:09 +00:00
Jim Meyering
4917680b1a (TESTS): Add `assert'. 1999-11-22 08:40:50 +00:00
Jim Meyering
3bd2800a3c *** empty log message *** 1999-11-20 12:16:11 +00:00
Jim Meyering
783c48e864 (errno_rmdir_non_empty): New function to encapsulate errno comparison.
(remove_parents): Use it.
(main): Use it.
1999-11-20 12:15:46 +00:00
Jim Meyering
07632c3ed9 *** empty log message *** 1999-11-20 11:18:54 +00:00
Jim Meyering
808aa68e9c *** empty log message *** 1999-11-20 10:46:39 +00:00
Jim Meyering
8c4882550e Run `diff -u' if the test fails. 1999-11-20 10:46:06 +00:00
Jim Meyering
4a602cec80 *** empty log message *** 1999-11-20 10:39:29 +00:00
Jim Meyering
6fdf590d36 Use ls' and touch', not $LS and $TOUCH. 1999-11-20 10:39:19 +00:00
Jim Meyering
5cbce55a86 (TESTS_ENVIRONMENT): Specify PATH, etc. 1999-11-20 10:38:38 +00:00
Jim Meyering
9eda37263f *** empty log message *** 1999-11-20 09:51:31 +00:00
Jim Meyering
57bb960867 Declare lstat; needed on e.g. SunOS4.
Reported by Tom Tromey.
1999-11-20 09:50:58 +00:00
Jim Meyering
320be1758d *** empty log message *** 1999-11-19 17:02:38 +00:00
Jim Meyering
115758e03b *** empty log message *** 1999-11-19 17:02:31 +00:00
Jim Meyering
24e8e8409d (strstr): Include config.h.
Add a `;' between shloop label and `}'.
1999-11-19 17:02:01 +00:00
Jim Meyering
102caacbef *** empty log message *** 1999-11-19 11:49:53 +00:00
Jim Meyering
cfe7b86608 (AC_SYS_LARGEFILE_FLAGS): Work around a
problem with the QNX 4.25 shell, which doesn't propagate exit
status of failed commands inside shell assignments.
1999-11-19 11:49:44 +00:00
Jim Meyering
7ec33cd342 *** empty log message *** 1999-11-19 11:12:07 +00:00
Jim Meyering
2e05e2b7fa *** empty log message *** 1999-11-17 22:05:01 +00:00
Jim Meyering
cc9b514f5d *** empty log message *** 1999-11-17 14:04:44 +00:00
Jim Meyering
c49e7f4f22 Use new AC_CONFIG_LINKS in place of AC_LINK_FILES. 1999-11-17 14:04:32 +00:00
Jim Meyering
f98d307bbb *** empty log message *** 1999-11-17 08:22:49 +00:00
Jim Meyering
06c06bd6f7 (S_IRWXUGO): Define if necessary.
(main): Use chmod to set the permissions if bits other than those
of S_IRWXUGO were requested.  Reported by Sami Farin.
1999-11-17 08:18:38 +00:00
Jim Meyering
8c63b56030 *** empty log message *** 1999-11-17 08:18:22 +00:00
Jim Meyering
29e829a66a *** empty log message *** 1999-11-15 22:26:57 +00:00
Jim Meyering
2f50c6930d (touch): Simplify code a tad, using fd == -1 instead
of separate valid_fd variable.
1999-11-14 20:44:56 +00:00
Jim Meyering
a3fc960f32 . 1999-11-13 23:21:01 +00:00
Jim Meyering
91ac2fec34 # Also test the combination of --no-create and -a. 1999-11-13 23:20:14 +00:00
Jim Meyering
55fa0c6a12 . 1999-11-13 23:19:08 +00:00
Jim Meyering
6bffd08ba5 *** empty log message *** 1999-11-13 14:55:01 +00:00
Jim Meyering
0e09235c9f (touch): Don't fail just because we couldn't open
an existing file.  This makes it so that touching a read-only
file now works.  Also clean up and simplify.
Based on a patch from Chip Salzenberg.
1999-11-13 14:47:21 +00:00
Jim Meyering
6b85baa502 *** empty log message *** 1999-11-13 14:46:21 +00:00
Jim Meyering
d46a35bbff *** empty log message *** 1999-11-13 13:28:39 +00:00
Jim Meyering
97523193b7 (TESTS): Add no-rights. 1999-11-13 13:27:25 +00:00
Jim Meyering
4f06def5c0 new test for touch -c fix 1999-11-13 13:24:54 +00:00
Jim Meyering
0ce2109a88 import latest 1999-11-13 10:13:16 +00:00
Jim Meyering
557af8f47e *** empty log message *** 1999-11-12 10:56:23 +00:00
Jim Meyering
987955f7c5 *** empty log message *** 1999-11-12 10:54:21 +00:00
Jim Meyering
c5187c959c (print_nth_dir): Write one fewer byte so we don't print a trailing slash.
(rm): Fix bugs in (and test, this time) the very-rarely-used code
to warn about directory cycles.
1999-11-12 10:50:01 +00:00
Jim Meyering
7872d7c932 Adjust comments to reflect that lots of code has moved to remove.c. 1999-11-12 10:42:13 +00:00
Jim Meyering
f1c24743b8 *** empty log message *** 1999-11-12 08:10:02 +00:00
Jim Meyering
7cff7275f8 *** empty log message *** 1999-11-12 08:05:20 +00:00
Jim Meyering
286e9d9766 *** empty log message *** 1999-11-11 15:08:34 +00:00
Jim Meyering
acf8442f02 *** empty log message *** 1999-11-11 13:46:40 +00:00
Jim Meyering
b6a764d8c6 Add a test for this fix. 1999-11-11 13:46:19 +00:00
Jim Meyering
07d20c7e44 . 1999-11-11 13:20:24 +00:00
Jim Meyering
1b6c640f46 (copy_internal): Treat src and dest as the `same' in
`mv src symlink-to-src' when src and dest are on different partitions.
Otherwise, that `mv' command would silently remove `src'.
Reported by Michael Stone.
1999-11-11 13:19:36 +00:00
Jim Meyering
101ae141c6 *** empty log message *** 1999-11-11 12:12:23 +00:00
Jim Meyering
375c13c679 re-comment debugging diff stmt 1999-11-11 11:41:18 +00:00
Jim Meyering
cbdf71ab00 (make_path): Fix long-latent bug (note others
just like it were fixed in 1998-01-02).
A user (FIXME, who?) reported that using `install -d -g foo 1/2`
only sets the group on the intermediate directory, not the final
component.  From Michael Stone.
1999-11-11 11:00:50 +00:00
Jim Meyering
05e6e5583e remove unnecessary trailing semicolons 1999-11-11 07:50:59 +00:00
Jim Meyering
c4d7026cf9 import 1.019 1999-11-10 06:14:12 +00:00
Jim Meyering
baee6fd135 *** empty log message *** 1999-11-09 20:41:33 +00:00
Jim Meyering
59339ab7e5 (NEW): Undefine to avoid warning about redefinition.
(NEW): Redefine in terms of XMALLOC.
1999-11-09 20:41:18 +00:00
Jim Meyering
f5225442f8 (XMALLOC): Correct misnamed macro parameter name: s/N_bytes/N_items/.
(XCALLOC): Likewise.
(XREALLOC): Likewise.
1999-11-09 20:34:17 +00:00
Jim Meyering
1b5e676e38 add `' around link(2) 1999-11-08 09:25:08 +00:00
Jim Meyering
cf6ad5dcca Fix harmless-for-now typo: s/,/dnl/.
From Akim.
1999-11-08 09:23:43 +00:00
Jim Meyering
bb928b7ac4 effectively require AC_CHECK_HEADERS(unistd.h) 1999-11-08 09:18:27 +00:00
Jim Meyering
8851d83616 *** empty log message *** 1999-11-07 21:06:17 +00:00
Jim Meyering
41c5f76c2f (default_block_size): New function.
(humblock): Use it if no block size is specified.
(human_block_size): If the specified block size is zero, report an
error if report_errors is nonzero; otherwise use the default.
1999-11-07 21:06:02 +00:00
Jim Meyering
0b23ffc1bf *** empty log message *** 1999-11-07 20:34:11 +00:00
Jim Meyering
e2e5b7324e Add several more TERM types.
Add .bz2 suffix.
Add .png for real this time.
Change the image types colors to be visible in a black-on-white xterm.
1999-11-07 20:34:03 +00:00
Jim Meyering
f706863aa6 *** empty log message *** 1999-11-07 20:25:21 +00:00
Jim Meyering
c1e927ff6d *** empty log message *** 1999-11-07 20:23:48 +00:00
Jim Meyering
717d76cf4b (xstat): New global.
(main): Define it.
(change_file_group): Use it.  Before this change, when running chgrp
on a symlink without --dereference (-h) and when the requested group
is the same as the group for the *symlink*, chgrp would do nothing.
Now it changes the group of the file referenced through the symlink.
Reported by Martin Mitchell.
1999-11-07 20:18:11 +00:00
Jim Meyering
8bc2ecda80 *** empty log message *** 1999-11-07 20:17:18 +00:00
Jim Meyering
5907ad7277 Define and use REFERENCE_FILE_OPTION and
DEREFERENCE_OPTION in place of bare `CHAR_MAX + N'.
1999-11-07 20:02:19 +00:00
Jim Meyering
1645ace5e7 Use REFERENCE_FILE_OPTION instead of bare `CHAR_MAX + 1'. 1999-11-07 20:00:54 +00:00
Jim Meyering
0af22e4bb2 *** empty log message *** 1999-11-07 15:41:37 +00:00
Jim Meyering
7b165ea504 Add `, 1, [FIXME]' to each use of AC_DEFINE. 1999-11-07 15:40:29 +00:00
Jim Meyering
a21ac71b0a . 1999-11-07 11:52:07 +00:00
Jim Meyering
66964546be *** empty log message *** 1999-11-07 11:46:24 +00:00
Jim Meyering
51ca1e585c Fix a typo: s/||/&&/. 1999-11-07 11:46:20 +00:00
Jim Meyering
bf43e9b11e Add hard-link-to-symlink test. 1999-11-07 11:44:22 +00:00
Jim Meyering
b2e1221012 variable name change
move framework_failure to bottom
1999-11-07 11:13:04 +00:00
Jim Meyering
224fff6a3a (do_link): Warn that making a hard link to a symbolic link is not portable. 1999-11-07 11:07:53 +00:00
Jim Meyering
7876eafaa1 Remove entire #if LINK_FOLLOWS_SYMLINKS block. 1999-11-07 11:04:00 +00:00
Jim Meyering
8040d4c680 Add comment prior to removing #if LINK_FOLLOWS_SYMLINKS block 1999-11-07 11:03:20 +00:00
Jim Meyering
6e8ec1114f Allow hard links to symlinks on systems that support it.
(STAT_LIKE_LINK): Define.
(do_link): Use STAT_LIKE_LINK, rather than bare `stat', and perform
the extra lstat only on systems where LINK_FOLLOWS_SYMLINKS.
1999-11-07 10:50:11 +00:00
Jim Meyering
6cdbe93585 *** empty log message *** 1999-11-07 10:49:07 +00:00
Jim Meyering
36daa470f4 Use --b=simple, not the now-deprecated `-V simple'. 1999-11-07 10:47:52 +00:00
Jim Meyering
5f9feb9aae define LINK_FOLLOWS_SYMLINKS 1999-11-07 10:35:53 +00:00
Jim Meyering
6702048c64 . 1999-11-07 10:33:47 +00:00
Jim Meyering
9f5b324ec5 . 1999-11-07 10:33:22 +00:00
Jim Meyering
c13a28cc35 *** empty log message *** 1999-11-07 10:33:11 +00:00
Jim Meyering
de9a877716 add missing \n\ 1999-11-07 09:23:06 +00:00
Jim Meyering
1df7091e3b *** empty log message *** 1999-11-07 09:22:18 +00:00
Jim Meyering
30fc70c376 *** empty log message *** 1999-11-07 09:20:04 +00:00
Jim Meyering
65851e8c38 *** empty log message *** 1999-11-07 08:46:34 +00:00
Jim Meyering
3db1aef04e (remove_parents): Use the correct test
(same as in main) in handling --ignore-fail-on-non-empty.
From Michael Stone.
1999-11-07 08:38:50 +00:00
Jim Meyering
691513e7f3 . 1999-11-07 08:15:37 +00:00
Jim Meyering
a8871677d1 whoops, add quotes in last change 1999-11-06 21:58:42 +00:00
Jim Meyering
44dbec6a60 remove backticks from comments 1999-11-06 21:58:19 +00:00
Jim Meyering
0d3ddaa85c *** empty log message *** 1999-11-06 21:31:09 +00:00
Jim Meyering
637aa0759b (jm_MACROS): Use jm_AC_FUNC_LINK_FOLLOWS_SYMLINK here. 1999-11-06 21:30:47 +00:00
Jim Meyering
e2c0a043f7 (jm_AC_FUNC_LINK_FOLLOWS_SYMLINK): New file/macro. 1999-11-06 21:30:16 +00:00
Jim Meyering
81718d1a58 (do_link): Fix typo (in which the function name `symlink'
was tested instead of the variable `symbolic_link') that could make
ln perform an unneeded `stat' call.
1999-11-06 16:21:18 +00:00
Jim Meyering
9dc239aca7 *** empty log message *** 1999-11-06 09:55:32 +00:00
Jim Meyering
ea525f532f (long_options): Correct typo (s/'F'/'p'/) so that `-p'
works as the short form of --file-type, per the documentation.
From Michael Stone.
1999-11-06 09:55:13 +00:00
Jim Meyering
476de46ee5 *** empty log message *** 1999-11-06 09:54:46 +00:00
Jim Meyering
571d42e74b . 1999-11-06 09:04:58 +00:00
Jim Meyering
68e5120531 . 1999-11-06 09:04:22 +00:00
Jim Meyering
6b32b53027 Use HAVE_STRUCT_STAT_ST_BLOCKS, not deprecated HAVE_ST_BLOCKS. 1999-11-05 09:55:24 +00:00
Jim Meyering
8a25562446 Use `AC_CHECK_MEMBERS((struct stat.st_blksize))' instead of deprecated
AC_STRUCT_ST_BLKSIZE.
1999-11-05 09:48:53 +00:00
Jim Meyering
764e739e01 remove stray `x's 1999-11-05 09:34:41 +00:00
Jim Meyering
a5bfc49347 *** empty log message *** 1999-11-05 09:27:20 +00:00
Jim Meyering
386d762885 (jm_CHECK_ALL_TYPES): Move some tests from configure.in
of textutils, fileutils, and sh-utils into this one (shared between
those packages) file.
1999-11-05 09:27:14 +00:00
Jim Meyering
9df0229009 *** empty log message *** 1999-11-05 07:59:48 +00:00
Jim Meyering
2d81adfab6 (SORTALLOC): New macro.
(sortalloc, mergealloc, LINEALLOC): Use it.
(sortalloc, mergealloc, linelength): Now const.
(sortalloc): Increase from 0.5 to 8 MB.
(mergealloc): Increase from 16 to 256 kB.
(LINEALLOC): Increase from 0.25 to 4 MB.
1999-11-05 07:59:40 +00:00
Jim Meyering
ac0c37fd78 . 1999-11-04 23:14:45 +00:00
Jim Meyering
65b35a9e36 Do not consider newline to be part of a line when comparing lines
in `sort' and `comm'.  POSIX.2 requires that we consider newline,
but this is a bug in the spec and the bug will likely be fixed.
1999-11-04 23:13:40 +00:00
Jim Meyering
67ec190a99 (memcoll): The two arguments cannot be
adjacent any more, so remove the alloca/copy workaround for
that case.
1999-11-04 23:13:12 +00:00
Jim Meyering
4b47f20e6a (readline): Do not leave room for an extra
byte after the newline; it's no longer needed.
1999-11-04 23:12:42 +00:00
Jim Meyering
53d2086432 Do not consider newline to be part of a line when comparing lines
in `sort' and `comm'.  POSIX.2 requires that we consider newline,
but this is a bug in the spec and the bug will likely be fixed.

Update tests `use-nl' and `11d' to reflect this change.
1999-11-04 23:12:13 +00:00
Jim Meyering
cec217ed93 (begfield, limfield, findlines, keycompare, compare):
Do not consider newline to be part of a line when comparing lines
in `sort' and `comm'.  POSIX.2 requires that we consider newline,
but this is a bug in the spec and the bug will likely be fixed.
1999-11-04 23:11:34 +00:00
Jim Meyering
0b7aeab254 (compare_files):
Do not consider newline to be part of a line when comparing lines
in `sort' and `comm'.  POSIX.2 requires that we consider newline,
but this is a bug in the spec and the bug will likely be fixed.
1999-11-04 23:11:03 +00:00
Jim Meyering
b4e46d54f9 *** empty log message *** 1999-11-03 17:24:39 +00:00
Jim Meyering
62dac2622f Remove file. No longer needed since the new version of
AC_CHECK_TYPE checks includes unistd.h.
1999-11-03 17:24:33 +00:00
Jim Meyering
76f864a015 Use straight `AC_CHECK_TYPE(ssize_t, int)'.
Suggestion from Akim Demaille.
1999-11-03 17:24:03 +00:00
Jim Meyering
dcc7e653c9 *** empty log message *** 1999-11-03 13:07:04 +00:00
Jim Meyering
1c04247f53 Fix so that `tail -fn 2 file' works again.
(anonymous enum) [LONG_FOLLOW_OPTION]: Define.
(long_options): Use LONG_FOLLOW_OPTION here, instead of 'f'.
(main): Remove the `::' after the `f' in getopt_long string.
Add `case LONG_FOLLOW_OPTION' after `case 'f':'.
Based on a patch from Tim Waugh.
1999-11-03 13:06:50 +00:00
Jim Meyering
fcbef3a982 *** empty log message *** 1999-11-03 13:05:43 +00:00
Jim Meyering
23d439f22b (anonymous enum) [RETRY_OPTION]: Define.
[MAX_UNCHANGED_STATS_OPTION]: Likewise.
[MAX_CONSECUTIVE_SIZE_CHANGES_OPTION]: Likewise.
[PID_OPTION]: Likewise.
(long_options): Use *_OPTION instead of CHAR_MAX + N.
(main): Likewise.
1999-11-03 12:26:24 +00:00
Jim Meyering
ff220fd012 add comma 1999-11-03 12:20:11 +00:00
Jim Meyering
670f9b2f8a (recheck): Don't refuse to tail a non-regular, non-pipe.
(tail_file): Likewise.
1999-11-03 12:13:39 +00:00
Jim Meyering
789f74708c include summary in [NAME] section 1999-11-02 14:07:36 +00:00
Jim Meyering
da60713a1d include summary in [NAME] section 1999-11-02 13:58:56 +00:00
Jim Meyering
57808ffdb5 include summary in [NAME] section 1999-11-02 13:51:42 +00:00
Jim Meyering
8c3db8987e remove copyright 1999-11-02 13:49:10 +00:00
Jim Meyering
373ced3924 version 1.018 1999-11-02 13:08:05 +00:00
Jim Meyering
f726258818 *** empty log message *** 1999-11-02 07:20:28 +00:00
Jim Meyering
84e957d300 (usage): Warn about mixing use of `-r' with FIFOs and
other special files like /dev/zero.
1999-11-01 16:00:40 +00:00
Jim Meyering
80871da192 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES). 1999-11-01 09:53:41 +00:00
Jim Meyering
dd1e7763d3 *** empty log message *** 1999-11-01 09:53:13 +00:00
Jim Meyering
dab2c2f26f update a comment from alpha.gnu.org:/home/gd/gnu/lib/getdate.y 1999-10-31 15:49:05 +00:00
Jim Meyering
4aa83de94e . 1999-10-31 11:43:22 +00:00
Jim Meyering
67a257993d (my-distcheck): Remove $(DEPDIR) to work around automake bug. 1999-10-31 11:43:05 +00:00
Jim Meyering
d45f587081 . 1999-10-31 11:40:06 +00:00
Jim Meyering
8d3deedb8d . 1999-10-31 11:38:40 +00:00
Jim Meyering
85f411e680 *** empty log message *** 1999-10-31 10:42:31 +00:00
Jim Meyering
362c45be17 Convert --backup to take an optional argument.
Deprecate --version-control (-V) in comments.
(usage): Remove mention of --version-control.
(main): Make -V warn then fall through into --backup case.
[--backup case]: Handle optional arg.
1999-10-31 10:42:12 +00:00
Jim Meyering
60b24ab5af tweak usage 1999-10-31 10:36:54 +00:00
Jim Meyering
95c67325f7 . 1999-10-31 10:35:47 +00:00
Jim Meyering
e16e6e2362 *** empty log message *** 1999-10-31 07:43:07 +00:00
Jim Meyering
7179f4a0af *** empty log message *** 1999-10-31 07:32:05 +00:00
Jim Meyering
7570ff1a15 *** empty log message *** 1999-10-30 16:27:10 +00:00
Jim Meyering
ca1b49d35f Remove file, since the fix made it into the experimental version of autoconf. 1999-10-30 16:27:04 +00:00
Jim Meyering
61ef65be66 indent more prettily 1999-10-30 16:20:29 +00:00
Jim Meyering
5398f98139 remove stray comma 1999-10-30 16:20:05 +00:00
Jim Meyering
143c0051a7 *** empty log message *** 1999-10-30 11:28:41 +00:00
Jim Meyering
c81b144d58 . 1999-10-30 11:24:34 +00:00
Jim Meyering
b9912b209f . 1999-10-30 11:24:14 +00:00
Jim Meyering
5f234e2759 *** empty log message *** 1999-10-30 08:11:41 +00:00
Jim Meyering
70dbbd4077 Require 2.14a. Remove backslash before backtick in m4-quoted string. 1999-10-30 08:11:32 +00:00
Jim Meyering
cd2e512366 *** empty log message *** 1999-10-30 08:10:40 +00:00
Jim Meyering
b8dc0dccca Require 2.14a. Remove backslash before backtick in m4-quoted string. 1999-10-30 08:09:10 +00:00
Jim Meyering
979fe5dc9a Use new AC_TYPE_SSIZE_T instead of my hacked AC_CHECK_TYPE.
Require 2.14a.  Remove backslash before backtick in m4-quoted string.
1999-10-30 08:08:57 +00:00
Jim Meyering
ec5d352d55 Remove file, since the fix made it into the experimental
version of autoconf.
1999-10-30 07:58:08 +00:00
Jim Meyering
d34f5765a8 New file, requires experimental version of autoconf. 1999-10-30 07:53:04 +00:00
Jim Meyering
3c4c9446a6 Remove file, now that latest version of AC_CHECK_TYPE
takes a third arg to specify additional #includes.
1999-10-30 07:52:40 +00:00
Jim Meyering
063d10ae6c (usage): Tweak --backup description 1999-10-30 07:04:01 +00:00
Jim Meyering
ac1e8485b3 . 1999-10-30 07:03:18 +00:00
Jim Meyering
f62bbb9cb9 *** empty log message *** 1999-10-30 06:32:42 +00:00
Jim Meyering
d437084b93 Convert --backup to take an optional argument.
Deprecate --version-control (-V) in comments.
(usage): Remove mention of --version-control.
(main): Make -V warn then fall through into --backup case.
[--backup case]: Handle optional arg.
1999-10-30 06:30:56 +00:00
Jim Meyering
9ddb95e93c (do_copy): Constify `dest', and cast-away the new
const in assignment to new_dest.
1999-10-24 21:28:37 +00:00
Jim Meyering
e3bd3c1c39 add missing program_name arg to match new usage %s 1999-10-24 21:26:51 +00:00
Jim Meyering
ff4e97cf78 . 1999-10-24 17:00:35 +00:00
Jim Meyering
6d1aa48746 label use of -V/--versin-control as a warning 1999-10-23 15:32:01 +00:00
Jim Meyering
02ba1920dd . 1999-10-23 13:31:09 +00:00
Jim Meyering
fb829c2cd1 import version 1.015 1999-10-23 13:30:28 +00:00
Jim Meyering
0a4ef2236d *** empty log message *** 1999-10-23 13:25:05 +00:00
Jim Meyering
40c66374f4 *** empty log message *** 1999-10-23 13:18:34 +00:00
Jim Meyering
0ec36fda44 *** empty log message *** 1999-10-23 13:18:10 +00:00
Jim Meyering
84142eaa26 (TESTS): Add dangling-symlink. 1999-10-23 13:16:50 +00:00
Jim Meyering
9d8529baea *** empty log message *** 1999-10-23 11:46:48 +00:00
Jim Meyering
a579a9f85b (full_write): Remove unused decl.
(open_maybe_create): Remove.
(touch): Don't record whether the file was created; this isn't
possible to do reliably and portably without race conditions.
If the file was created and if amtime_now is nonzero, this
change means we'll have to do another utime system call, but
that's no more harmful than the previous version of this code.
1999-10-23 11:46:03 +00:00
Jim Meyering
767a68f512 *** empty log message *** 1999-10-17 21:33:49 +00:00
Jim Meyering
f8c3b33277 Remove use of mv's now-deprecated
-V option.  Use --b=simple instead of -b -V simple.
1999-10-17 21:33:38 +00:00
Jim Meyering
77def80003 Convert --backup to take an optional argument.
Deprecate --version-control (-V) in comments.
(usage): Remove mention of --version-control.
(main): Make -V warn then fall through into --backup case.
[--backup case]: Handle optional arg.
1999-10-17 21:31:45 +00:00
Jim Meyering
96018007df *** empty log message *** 1999-10-17 21:31:04 +00:00
Jim Meyering
23d74f24e4 use x, y, not a, b. 1999-10-17 21:29:15 +00:00
Jim Meyering
23d5af772e adapt to work for mv, too 1999-10-17 21:24:26 +00:00
Jim Meyering
8bbc2e2937 change a message and add usage(1) to another. 1999-10-17 16:26:30 +00:00
Jim Meyering
5d694e4cc3 *** empty log message *** 1999-10-17 10:04:10 +00:00
Jim Meyering
f893b3807d Accept new option: --target-directory=DIR
(TARGET_DIRECTORY_OPTION): Define.
(SPARSE_OPTION): Define.
(usage): Describe it.
(do_copy): Change meanings/names of first two parameters: use `n_files'
in place of `argc - optind', and `file' instead of `argv + optind'.
Add parameter, target_directory.
(main): Pass new arg, target_directory.
1999-10-17 10:01:30 +00:00
Jim Meyering
a374a307c5 don't compute isdir() of -- or an option string 1999-10-17 07:39:20 +00:00
Jim Meyering
b221905959 remove last `,' in enum 1999-10-17 07:25:34 +00:00
Jim Meyering
ff2333c835 (TESTS): Add cp-mv-backup. 1999-10-16 14:52:40 +00:00
Jim Meyering
bd4945f89c *** empty log message *** 1999-10-16 14:51:45 +00:00
Jim Meyering
bda7fb978e Remove use of cp's now-deprecated --version-control option. 1999-10-16 14:50:26 +00:00
Jim Meyering
535a5f905f *** empty log message *** 1999-10-16 14:48:25 +00:00
Jim Meyering
34306581ac Convert --backup to take an optional argument.
Deprecate --version-control (-V) in comments.
(usage): Remove mention of --version-control.
(main): Make -V warn then fall through into --backup case.
[--backup case]: Handle optional arg.
1999-10-16 14:48:16 +00:00
Jim Meyering
d25861b4da Remove use of cp's now-deprecated -V option.
Use --b=simple instead of -b -V simple.
1999-10-16 14:44:17 +00:00
Jim Meyering
c9e90c55fa *** empty log message *** 1999-10-16 13:49:28 +00:00
Jim Meyering
07feb846a6 *** empty log message *** 1999-10-16 13:39:50 +00:00
Jim Meyering
0470b5dce9 *** empty log message *** 1999-10-16 13:13:39 +00:00
Jim Meyering
449c9c39cc *** empty log message *** 1999-10-11 14:04:32 +00:00
Jim Meyering
17c213ed3f update from GNU lib C 1999-10-11 12:39:14 +00:00
Jim Meyering
42da57def9 *** empty log message *** 1999-10-11 12:39:09 +00:00
Jim Meyering
eef13be7f9 *** empty log message *** 1999-10-11 12:38:55 +00:00
Jim Meyering
3bea9c2f51 *** empty log message *** 1999-10-09 13:22:57 +00:00
Jim Meyering
2de1a014ef Accept new option: --target-directory=DIR
(TARGET_DIRECTORY_OPTION): Define.
(usage): Describe it.
(main): Implement it.
Make code clearer:  use new variable `n_files' in place of
`argc - optind'.  Use `file' instead of `argv + optind'.
1999-10-09 13:22:08 +00:00
Jim Meyering
764768f318 *** empty log message *** 1999-10-07 12:46:15 +00:00
Jim Meyering
290848dd2b Don't require autoconf-2.14.1. 1999-10-04 07:51:44 +00:00
Jim Meyering
1ac0c21d89 *** empty log message *** 1999-10-04 07:51:26 +00:00
Jim Meyering
17754acc90 (__attribute__): Wrap with #ifndef __attribute__. 1999-10-04 06:04:19 +00:00
Jim Meyering
0226382b34 (__attribute__): Define to empty if GCC claims to
be before 2.8; this is needed for OPENStep 4.2 cc.  Also,
define to empty if strict ANSI.
1999-10-04 06:02:41 +00:00
Jim Meyering
1ca4f162fa (__attribute__): Define to empty if GCC claims to
be before 2.8; this is needed for OPENStep 4.2 cc.  Also,
define to empty if strict ANSI.
1999-10-04 05:59:37 +00:00
Jim Meyering
84928ec02d (TARGET_DIRECTORY_OPTION): Define.
(usage): Describe it.
(main): Implement it.
Remove unused variable, stdin_tty.
Make code clearer:  use new variable `n_files' in place of
`argc - optind'.  Use `file' instead of `argv + optind'.
1999-10-03 16:59:07 +00:00
Jim Meyering
46f2e4efeb another example for tr -- illustrating problems with `-' in ranges.. 1999-10-02 11:46:53 +00:00
Jim Meyering
6c4caf0dbf *** empty log message *** 1999-10-02 11:42:26 +00:00
Jim Meyering
1003235282 . 1999-10-02 11:12:34 +00:00
Jim Meyering
fb4889bcd9 . 1999-10-02 11:12:06 +00:00
Jim Meyering
155695ed60 *** empty log message *** 1999-09-29 14:44:36 +00:00
Jim Meyering
d5c47e9163 (AC_SYS_LARGEFILE_FLAGS): Work around GCC 2.95.1 bug with HP-UX 10.20. 1999-09-29 14:44:31 +00:00
Jim Meyering
ea0df9b67d Do s/#ifdef HAVE_/#if HAVE_/ -- solely for aesthetics.
Do the same for other config.h macros like CLOSEDIR_VOID and MAJOR_*.
1999-09-28 16:22:54 +00:00
Jim Meyering
98ba27811d Do s/#ifdef HAVE_/#if HAVE_/ -- solely for aesthetics. 1999-09-28 16:22:38 +00:00
Jim Meyering
a66e71a1d2 *** empty log message *** 1999-09-28 15:27:13 +00:00
Jim Meyering
4a03ccc044 (__attribute__): Protect against redefinition. 1999-09-28 15:26:45 +00:00
Jim Meyering
57d52e5170 *** empty log message *** 1999-09-28 14:48:53 +00:00
Jim Meyering
a7047bf647 (error_at_line): Use strerror portably here, too,
just as was done in error.
1999-09-28 14:48:43 +00:00
Jim Meyering
6f3516dc97 . 1999-09-26 22:36:11 +00:00
Jim Meyering
057f710a76 (xalloc_die): Rename from xalloc_fail and update callers.
Use explicit exit to help avoid warnings.
1999-09-26 19:05:39 +00:00
Jim Meyering
168676d418 small correction from Akim 1999-09-26 19:01:12 +00:00
Jim Meyering
825a182517 *** empty log message *** 1999-09-26 18:53:01 +00:00
Jim Meyering
34cc9acdd9 (DIRECTORY_SEPARATOR): Define.
(ISSLASH): Define.
(path_concat): Allow parameter DIR to be NULL.
(xpath_concat): New function.
From Akim Demaille.
1999-09-26 18:52:51 +00:00
Jim Meyering
0f97cac340 (__attribute__): Define.
(ATTRIBUTE_NORETURN): Define.
(xalloc_fail_func): Add noreturn attribute.
(xalloc_die): Declare.
(NEW): Define as yet unused macro.
(XFREE): Likewise
(CCLONE): Likewise.
(CLONE): Likewise.
From Akim Demaille.
1999-09-26 18:42:56 +00:00
Jim Meyering
6710abd4ae (base_name): Add prototype. From Akim Demaille. 1999-09-26 18:37:02 +00:00
Jim Meyering
566b0c41e3 . 1999-09-24 07:42:42 +00:00
Jim Meyering
72a5a4b5af . 1999-09-24 07:35:42 +00:00
Jim Meyering
e105d08552 *** empty log message *** 1999-09-19 16:48:43 +00:00
Jim Meyering
2e5a37a44e *** empty log message *** 1999-09-19 16:47:58 +00:00
Jim Meyering
8e0c33f8ea [STAT_MACROS_BROKEN] (S_ISLNK): Undefine.
(S_ISLNK): Define if necessary.
This is necessary on a NEC SX-4 with SUPER-UX 9.1.
1999-09-19 16:46:50 +00:00
Jim Meyering
16155b0807 *** empty log message *** 1999-09-19 16:45:24 +00:00
Jim Meyering
1648386aa0 (siginfo_handler): Mark parameter with ATTRIBUTE_UNUSED.
Change lots of count and index variables to be of unsigned type.
(dd_copy): Add new unsigned variable, n_bytes_read, in place of
many uses of `nread'.
1999-09-19 16:23:17 +00:00
Jim Meyering
7447e09e2a *** empty log message *** 1999-09-19 16:22:23 +00:00
Jim Meyering
96949ef7f5 (__attribute__): Define.
(ATTRIBUTE_NORETURN): Remove #else clause.
(ATTRIBUTE_UNUSED): Define.
1999-09-19 16:21:26 +00:00
Jim Meyering
44b1bde148 Remove useless parens in #if directive 1999-09-19 08:09:50 +00:00
Jim Meyering
1e5c8f23ce . 1999-09-18 21:18:37 +00:00
Jim Meyering
f1029324fe . 1999-09-18 21:17:29 +00:00
Jim Meyering
c1eb26af14 *** empty log message *** 1999-09-17 21:45:53 +00:00
Jim Meyering
93eaa3c661 (AC_REPLACE_FUNCS): Add strdup.
Paul Nevai reported a link failure on a NeXT CUBE with NeXTSTEP 3.3
due to missing strdup (against sh-utils-2.0).
1999-09-17 21:45:48 +00:00
Jim Meyering
67aaf0afa6 (usage): Remove misleading sentence in --help output.
From Karl Heuer.
1999-09-09 19:56:10 +00:00
Jim Meyering
fc02691130 Remove declaration of xstrdup. 1999-09-08 08:39:49 +00:00
Jim Meyering
29f710b0e5 *** empty log message *** 1999-09-05 06:56:59 +00:00
Jim Meyering
6c26ef5e0d (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
Use EINVAL instead.
1999-09-05 06:56:50 +00:00
Jim Meyering
a8d1ef1616 tweak comment 1999-09-04 20:27:03 +00:00
Jim Meyering
8bde83a334 *** empty log message *** 1999-09-02 21:34:33 +00:00
Jim Meyering
85e0053136 Remove xstrdup declaration. 1999-09-02 21:34:04 +00:00
Jim Meyering
b10b8369dd Remove xstrdup declaration. 1999-09-02 21:33:23 +00:00
Jim Meyering
1aab3474a1 Remove xstrdup declaration. 1999-09-02 21:33:00 +00:00
Jim Meyering
42a837c531 *** empty log message *** 1999-09-02 21:31:37 +00:00
Jim Meyering
d1b4719534 Remove xstrdup declaration. 1999-09-02 21:31:19 +00:00
Jim Meyering
81fde1922f (xalloc_fail_func): Use `PARAMS'.
(xstrdup): Add protoype.
1999-09-02 21:23:01 +00:00
Jim Meyering
7d2b2cc3f9 import version 1.013 1999-09-02 10:40:44 +00:00
Jim Meyering
967bd9f5f0 Remove declaration of xstrdup. 1999-09-01 13:28:21 +00:00
Jim Meyering
f2a32f6e5b (version_etc_copyright): Declare it. 1999-09-01 13:16:46 +00:00
Jim Meyering
8e064c4377 (version_etc_copyright): Default copyright string.
(version_etc): Use it.
1999-09-01 13:15:11 +00:00
Jim Meyering
5790705b19 (xalloc_fail_func): Use `PARAMS'. 1999-09-01 13:09:19 +00:00
Jim Meyering
fa36ee7ea2 *** empty log message *** 1999-08-31 20:46:40 +00:00
Jim Meyering
8a29209450 Add .rpm, .png, and .fli.
From Andres Soolo.
1999-08-31 20:46:18 +00:00
Jim Meyering
82669abc1a *** empty log message *** 1999-08-30 15:05:34 +00:00
Jim Meyering
794af09007 . 1999-08-30 14:59:37 +00:00
Jim Meyering
128307fa88 . 1999-08-30 14:59:08 +00:00
Jim Meyering
84f4450da4 *** empty log message *** 1999-08-30 14:44:10 +00:00
Jim Meyering
038e5f009e (longopts): Restore accidentally-removed entry for `--portability' long option. 1999-08-30 14:43:52 +00:00
Jim Meyering
4ab0a2a4c6 (usage): Correct --help message. 1999-08-30 14:41:05 +00:00
Jim Meyering
4b20f454fe split a long line. 1999-08-30 14:39:05 +00:00
Jim Meyering
33bebae5ae (usage): Correct --help message. 1999-08-30 14:38:00 +00:00
Jim Meyering
ccff4ede2b (usage): Correct --help message. 1999-08-30 14:37:40 +00:00
Jim Meyering
6f48cb1924 (usage): Correct --help message. 1999-08-30 14:36:26 +00:00
Jim Meyering
98ecd5b300 (usage): Correct --help message. 1999-08-30 14:36:06 +00:00
Jim Meyering
57e5f5a5b5 (usage): Correct --help message. 1999-08-30 14:35:45 +00:00
Jim Meyering
2a0b67dc3b (usage): Correct --help message. 1999-08-30 14:35:20 +00:00
Jim Meyering
805034d054 . 1999-08-30 14:34:09 +00:00
Jim Meyering
c180c51c79 . 1999-08-30 14:33:39 +00:00
Jim Meyering
e044763e67 . 1999-08-30 14:31:16 +00:00
Jim Meyering
b8da6c90b6 . 1999-08-30 14:30:28 +00:00
Jim Meyering
269630005b . 1999-08-29 21:13:46 +00:00
Jim Meyering
902d5e299d *** empty log message *** 1999-08-29 21:10:22 +00:00
Jim Meyering
75789c4643 (main): Call exit explicitly to avoid warning from gcc.
Include "xstrtol.h".
(isinteger): Remove function and prototype.
(main): Use xstrtol in place of atoi.  Remove associated FIXME comments.
1999-08-29 21:09:34 +00:00
Jim Meyering
678cbc835e (isinteger): Move definition to precede use. Remove prototype. 1999-08-29 20:49:07 +00:00
Jim Meyering
de8d09d22d (main): Call exit explicitly to avoid warning from gcc. 1999-08-29 20:47:17 +00:00
Jim Meyering
b266f1a207 (main): Call exit explicitly to avoid warning from gcc. 1999-08-29 20:45:50 +00:00
Jim Meyering
a61888be78 *** empty log message *** 1999-08-29 20:42:42 +00:00
Jim Meyering
a3bafb3263 *** empty log message *** 1999-08-29 20:40:15 +00:00
Jim Meyering
937c7d8bab Require jm_BISON. 1999-08-29 20:40:00 +00:00
Jim Meyering
b7af6cd62a *** empty log message *** 1999-08-29 20:37:25 +00:00
Jim Meyering
09b7fb4252 *** empty log message *** 1999-08-29 20:35:16 +00:00
Jim Meyering
f9ab8e8b03 *** empty log message *** 1999-08-29 20:05:07 +00:00
Jim Meyering
fb9a0d3dff *** empty log message *** 1999-08-29 19:54:09 +00:00
Jim Meyering
d45400c9a9 (relative_time_table): Change type' of THIS' from
tMINUTE_UNIT to tUNUMBER.  From Urs Thuermann.
1999-08-29 14:55:24 +00:00
Jim Meyering
81eda26beb *** empty log message *** 1999-08-29 14:49:06 +00:00
Jim Meyering
1a9b70d7a8 *** empty log message *** 1999-08-29 14:46:35 +00:00
Jim Meyering
70c01e7963 (test_vector): Add a test for the Risks-reported problem with `Nov 11 1996'. 1999-08-29 14:46:25 +00:00
Jim Meyering
bd4a3f044d *** empty log message *** 1999-08-29 14:37:40 +00:00
Jim Meyering
13bc9dcc35 (test_vector): Add tests for use of `this'. 1999-08-29 14:36:48 +00:00
Jim Meyering
6b840273e0 (get_date): Rename latter local `tm' to probe_tm. 1999-08-29 12:55:35 +00:00
Jim Meyering
9f92dfbf90 (get_date): Rename outermost local probe' to quarter'. 1999-08-29 12:28:56 +00:00
Jim Meyering
26656272e8 Add copyright notice.
(number): Handle `Nov 11 1996' example; see Risks Digest 20.55
http://catless.ncl.ac.uk/Risks/20.55.html#subj18
(1999-08-27)

(<stdio.h>): Include only if testing.
(ISUPPER): Remove.
(ISLOWER, PC): New macros.
(<string.h>): Include if HAVE_STRING_H, not USG.
(bcopy): Remove.
(yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
bison.
(EPOCH_YEAR): Renamed from EPOCH.
(table): Renamed from TABLE.
(meridian): Now an anonymous enum.
(struct parser_control): New type.
(YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
(yyInput, ..., yyRelYear): Migrated into struct parser_control.
(%pure_parser): Added, so that the parser is pure.
(%union): Removed; the type is now just plain int.
All %type directives removed.
(tLOCAL_ZONE): New %token.
(month_day_table): Renamed from MonthDayTable.
(gmtime, localtime, mktime, time): Declare only if not defined.
(meridian_table): New table.
(dst_table): New table.
(units_table): renamed from UnitsTable.
(relative_time_table): Renamed from OtherTable.
(time_zone_table): Renamed from TimezoneTable.  Modernized data.
(military_table): Renamed from MilitaryTable.
(to_hour): Renamed from ToHour.
(to_year): Renamed from ToYear.
(lookup_zone): New function.
(LookupWord): Renamed from lookup_word.
Use lookup_zone for time zones.
(yylex): Now reentrant.  All callers changed.
(get_date): Add support for local time zone abbreviations.
Make it reentrant.
1999-08-29 07:29:51 +00:00
Jim Meyering
948cf23537 *** empty log message *** 1999-08-25 15:41:52 +00:00
Jim Meyering
2395e90973 *** empty log message *** 1999-08-22 16:28:45 +00:00
Jim Meyering
bb6f5c5913 *** empty log message *** 1999-08-22 16:28:26 +00:00
Jim Meyering
d1b7514e91 *** empty log message *** 1999-08-22 16:23:28 +00:00
Jim Meyering
53e173cca6 (detect_loop): There's no loop if k->top is NULL. 1999-08-22 16:10:24 +00:00
Jim Meyering
5157fd957e Add a few more tests. 1999-08-22 16:09:29 +00:00
Jim Meyering
d39e2c5127 *** empty log message *** 1999-08-22 15:58:28 +00:00
Jim Meyering
80e8a30f39 *** empty log message *** 1999-08-22 15:58:06 +00:00
Jim Meyering
83d003e558 Rewrite to use Fetish.pm-based framework. 1999-08-22 15:55:41 +00:00
Jim Meyering
9715e45a87 *** empty log message *** 1999-08-22 15:54:35 +00:00
Jim Meyering
5d3b030798 . 1999-08-22 15:53:59 +00:00
Jim Meyering
19a165cc9c tweak comment 1999-08-22 11:34:56 +00:00
Jim Meyering
7a7ef5ff5b (check_file): Explain why we have separate if' and else'
blocks when the code in the else block could handle both cases.
1999-08-22 11:31:08 +00:00
Jim Meyering
2638bf642c *** empty log message *** 1999-08-22 11:17:47 +00:00
Jim Meyering
9503681d86 (check_file): Generate each line of output earlier,
when possible.  It is possible when using none of these options:
--count, -repeated, --all-repeated, --unique.
Based on a patch from Ian Turner.

(check_file): Move declarations of local variables into the scopes where used.
(min): Remove macro definition.
(different): Use MIN, not min.
(SWAP_LINES): New macro.
(check_file): Use it here.
1999-08-22 11:17:42 +00:00
Jim Meyering
7d8102bec2 . 1999-08-22 11:04:23 +00:00
Jim Meyering
b980775bb6 *** empty log message *** 1999-08-22 11:03:57 +00:00
Jim Meyering
b96c6c60eb *** empty log message *** 1999-08-22 11:03:32 +00:00
Jim Meyering
7de78927ed Escape backslashes so tr's manual comes out right.
Reported by Andreas Schwab.
1999-08-22 11:02:39 +00:00
Jim Meyering
7a44e716a4 *** empty log message *** 1999-08-22 10:58:31 +00:00
Jim Meyering
95b8288176 (ATTRIBUTE_NORETURN): Define. 1999-08-22 10:57:51 +00:00
Jim Meyering
5a2d528081 Use ATTRIBUTE_NORETURN instead of NO_RETURN_ATTRIBUTE. 1999-08-22 10:57:40 +00:00
Jim Meyering
8ab42dc273 *** empty log message *** 1999-08-22 10:53:37 +00:00
Jim Meyering
705cf20084 (run_shell): Declare with noreturn attribute.
Use an explicit exit(1) rather than doing that through error.
1999-08-22 10:53:13 +00:00
Jim Meyering
fc08f1058a *** empty log message *** 1999-08-22 10:22:06 +00:00
Jim Meyering
a343e68e00 (main): Rename locals i and j.
Use IF_LINT macro instead of #ifdef lint...
1999-08-22 10:21:36 +00:00
Jim Meyering
e8e722d58e *** empty log message *** 1999-08-22 10:19:56 +00:00
Jim Meyering
8313e867b2 (validate_path): Use IF_LINT macro instead of #ifdef lint. 1999-08-22 10:19:35 +00:00
Jim Meyering
4dac9be014 (batch_convert): Use IF_LINT macro instead of #ifdef lint. 1999-08-22 10:19:15 +00:00
Jim Meyering
46554e300b (dump): Use IF_LINT macro instead of #ifdef lint...
(main): Likewise.
1999-08-22 09:51:20 +00:00
Jim Meyering
8b5ed0399d (paste_parallel): Use IF_LINT macro instead of #ifdef lint... 1999-08-22 09:50:56 +00:00
Jim Meyering
e11d70c362 (read_line): Use IF_LINT macro instead of #ifdef lint... 1999-08-22 09:50:31 +00:00
Jim Meyering
005c36b178 (checkfp): Use IF_LINT macro instead of #ifdef lint...
(mergefps): Likewise.
1999-08-22 09:50:05 +00:00
Jim Meyering
0e3b9af25b (usage): Correct bug-reporting email address.
(tsort): Remove trailing `\n' in error format.
1999-08-22 09:45:52 +00:00
Jim Meyering
1ec1017a23 (IF_LINT): Define new macro. 1999-08-22 09:43:48 +00:00
Jim Meyering
bab0581788 (md5_check): Remove trailing `\n' in error format. 1999-08-22 09:43:25 +00:00
Jim Meyering
e23b334713 (SWAP_LINES): New macro.
(check_file): Use it here.

[really remove min macro, this time]
1999-08-22 08:57:37 +00:00
Jim Meyering
475a58337a (writeline): Constify a char*. 1999-08-22 08:48:45 +00:00
Jim Meyering
1195909f5d (cksum): Constify a char*. 1999-08-22 08:48:06 +00:00
Jim Meyering
0c44307f3b *** empty log message *** 1999-08-22 08:47:00 +00:00
Jim Meyering
138cf56fdb (parse_integer): Add `const' to char* parameter and
add a separate `suffix' variable.
1999-08-22 08:46:33 +00:00
Jim Meyering
a711e8e132 (check_file): Move declarations of local variables
into the scopes where they're used.
(min): Remove macro definition.
(different): Use MIN, not min.
1999-08-22 08:16:34 +00:00
Jim Meyering
e32013660e *** empty log message *** 1999-08-21 20:26:25 +00:00
Jim Meyering
b4e8324ac2 (usage): Remove the ` [-v]' from the Usage: line. 1999-08-21 20:26:18 +00:00
Jim Meyering
03455da71a import latest 1999-08-20 10:05:46 +00:00
Jim Meyering
c82037714e *** empty log message *** 1999-08-20 09:02:39 +00:00
Jim Meyering
6faeb61968 *** empty log message *** 1999-08-20 08:58:40 +00:00
Jim Meyering
82288821f0 (usage): Tweak --help output to make it more consistent with that of chgrp. 1999-08-20 08:58:34 +00:00
Jim Meyering
28c95e39c1 (usage): Tweak --help output to make it more consistent with that of chown. 1999-08-20 08:58:21 +00:00
Jim Meyering
47ac7c933a paste --delimiters: add missing `=' 1999-08-18 16:21:16 +00:00
Jim Meyering
4ba5bee1a0 stty --file: add missing `=' 1999-08-18 16:20:03 +00:00
Jim Meyering
f063d2f7a2 *** empty log message *** 1999-08-18 07:41:39 +00:00
Jim Meyering
ee81e2f472 (AC_SYS_LARGEFILE): Fix typo: missing comma
in value for _FILE_OFFSET_BITS, which broke ports to HP-UX 10.20.
1999-08-18 07:41:27 +00:00
Jim Meyering
c1e29b69ba *** empty log message *** 1999-08-17 10:17:42 +00:00
Jim Meyering
13955cb7c1 source input-tty instead of open-coding it 1999-08-17 10:15:50 +00:00
Jim Meyering
e95aecb85e (EXTRA_DIST): Add input-tty. 1999-08-17 10:14:23 +00:00
Jim Meyering
b66c78c236 *** empty log message *** 1999-08-17 10:13:27 +00:00
Jim Meyering
b1d6d67405 *** empty log message *** 1999-08-17 08:03:49 +00:00
Jim Meyering
086c4578e3 . 1999-08-17 08:00:19 +00:00
Jim Meyering
99d5294ab1 *** empty log message *** 1999-08-17 07:59:12 +00:00
Jim Meyering
f99e33733b . 1999-08-17 07:46:10 +00:00
Jim Meyering
4d22e13282 This change is nearly identical to the chown.c change of 1998-05-24
Accept new option, --dereference.
--no-dereference is now the default. Include lchown.h.
(enum Change_status) [CH_NOT_APPLIED]: New member.
(change_symlinks): Enable this by default, now.
(describe_change): Handle new case.
(change_file_group): Add new parameter: cmdline_arg.  Update callers.
Reorganize to reflect changed semantics.
(LCHOWN): Remove definitions.
From Bruno Haible.
1999-08-16 21:21:39 +00:00
Jim Meyering
18607df151 (groupname): Declare to be `const'.
(change_dir_owner): Declare statp parameter to be `const'.
(usage): Make the output be more consistent with that from chgrp.
1999-08-16 21:20:44 +00:00
Jim Meyering
1b4fc0d733 factor examples 1999-08-15 18:43:54 +00:00
Jim Meyering
1cea2b41a4 *** empty log message *** 1999-08-15 12:57:21 +00:00
Jim Meyering
a2267a42f8 --pid vs djgpp 1999-08-15 12:56:33 +00:00
Jim Meyering
7228350401 (ENOSYS): Define to a bogus value if not already defined.
(parse_options): Warn if --pid=PID is used and kill()
returns ENOSYS (e.g. when compiled with DJGPP).
1999-08-15 12:56:00 +00:00
Jim Meyering
22cdfc8955 . 1999-08-14 15:37:41 +00:00
Jim Meyering
cb47f7bef7 *** empty log message *** 1999-08-14 12:42:56 +00:00
Jim Meyering
7fda0e1065 Fail-77 if stdin is not a tty. 1999-08-14 12:42:03 +00:00
Jim Meyering
b91360e484 *** empty log message *** 1999-08-14 12:41:34 +00:00
Jim Meyering
4b797e9d5c *** empty log message *** 1999-08-13 08:51:42 +00:00
Jim Meyering
9b5e17f134 *** empty log message *** 1999-08-13 08:02:03 +00:00
Jim Meyering
bee39b77d9 . 1999-08-13 07:57:15 +00:00
Jim Meyering
18eb7260a1 *** empty log message *** 1999-08-12 15:16:12 +00:00
Jim Meyering
531ced1819 Document how to ignore newline during sort 1999-08-12 15:16:04 +00:00
Jim Meyering
b6ee833da0 *** empty log message *** 1999-08-12 15:15:49 +00:00
Jim Meyering
cfd67ae18c *** empty log message *** 1999-08-10 11:02:10 +00:00
Jim Meyering
a26a44baba (usage): Add ls --quoting-style=locale. 1999-08-10 11:00:58 +00:00
Jim Meyering
843d60096e (ARGMATCH_QUOTING_STYLE):
Change from escape_quoting_style to locale_quoting_style.
(argmatch_invalid): Use new quotearg_style primitive for simplicity.
Also, use ARGMATCH_QUOTING_STYLE to quote, instead of quoting ourselves.
1999-08-10 11:00:12 +00:00
Jim Meyering
bcfbd6fab1 (locale_quoting_style): New enum value.
(quotearg_n_style, quotearg_style): New decls.
1999-08-10 10:58:01 +00:00
Jim Meyering
84dc18f1db Include <libintl.h> if ENABLE_NLS.
(_): New macro.
(quoting_style_args, quoting_style_v, quotearg_buffer): Add support
for locale_quoting_style, using _("`") and _("'") for open and close
quote symbols.
Do not quote spaces in escape_quoting_style.
(quotearg_n_style, quotearg_style): New functions.
1999-08-10 10:50:18 +00:00
Jim Meyering
10c7ee785a *** empty log message *** 1999-08-08 20:01:58 +00:00
Jim Meyering
6591e754b2 (usage): Clarify description of --time=WORD. 1999-08-08 20:01:50 +00:00
Jim Meyering
05c804e18f . 1999-08-08 10:18:36 +00:00
Jim Meyering
89e470b8e2 fix typo 1999-08-08 10:16:53 +00:00
Jim Meyering
e26558d720 *** empty log message *** 1999-08-08 10:15:15 +00:00
Jim Meyering
8fd9cfdd3c (count_entry): Remove cast of savedir arg. 1999-08-08 10:15:06 +00:00
Jim Meyering
ca2cd27d3c (copy_dir): Remove cast of savedir arg. 1999-08-08 10:14:45 +00:00
Jim Meyering
8b2c09a944 (change_dir_owner): Remove cast of savedir arg. 1999-08-08 10:14:26 +00:00
Jim Meyering
41a7bbf8e0 (change_dir_mode): Remove cast of savedir arg. 1999-08-08 10:14:01 +00:00
Jim Meyering
08ae72e3a4 (change_dir_group): Remove cast of savedir arg. 1999-08-08 10:13:44 +00:00
Jim Meyering
c127e62803 update prototype 1999-08-08 10:12:55 +00:00
Jim Meyering
0bb442899e (savedir): Change type of name_size parameter to off_t. 1999-08-08 10:12:43 +00:00
Jim Meyering
412590b094 *** empty log message *** 1999-08-08 10:10:20 +00:00
Jim Meyering
6fcaba3a1e *** empty log message *** 1999-08-07 12:16:35 +00:00
Jim Meyering
f5f7082712 *** empty log message *** 1999-08-07 10:46:11 +00:00
Jim Meyering
20c6afc39f *** empty log message *** 1999-08-07 10:45:36 +00:00
Jim Meyering
16fa90f7d0 (po-check): New rule.
(alpha): Make it.
1999-08-07 10:41:00 +00:00
Jim Meyering
aeb6ea6c01 . 1999-08-07 09:59:51 +00:00
Jim Meyering
e1eebd3966 *** empty log message *** 1999-08-07 09:54:55 +00:00
Jim Meyering
e03ffca770 *** empty log message *** 1999-08-07 09:53:59 +00:00
Jim Meyering
2f19e00c90 *** empty log message *** 1999-08-07 09:50:41 +00:00
Jim Meyering
12fbee444c (OtherTable[]): Use tDAY_UNIT for `tomorrow,'
`yesterday,' `today,' and `now' rather than tMINUTE_UNIT.  Of course
with correspondingly smaller numbers for tomorrow and yesterday.
This change does not change the way the code works, since the
grammar rules for the two symbols are analogous.
1999-08-07 09:50:34 +00:00
Jim Meyering
0abcbb7b3d *** empty log message *** 1999-08-07 09:49:50 +00:00
Jim Meyering
b5f2d23a1c *** empty log message *** 1999-08-07 08:25:34 +00:00
Jim Meyering
2d4a921699 *** empty log message *** 1999-08-06 19:24:05 +00:00
Jim Meyering
66f0de09e8 . 1999-08-06 19:23:33 +00:00
Jim Meyering
fed1e6eceb *** empty log message *** 1999-08-06 19:22:43 +00:00
Jim Meyering
505ee4c31c (Follow_mode): Remove comma at end of enumerator list.
Reported by Kaveh Ghazi.
1999-08-06 19:21:05 +00:00
Jim Meyering
dda679e516 *** empty log message *** 1999-08-06 10:22:22 +00:00
Jim Meyering
7cdcf3b47a Honor --help and --version once again, though now
only if POSIXLY_CORRECT is set.
1999-08-06 10:14:52 +00:00
Jim Meyering
e4024a94f8 Include file name in `write error' diagnostics.
(write_bytes): Add output_file parameter and use it.  Update callers.
(mergefps): Likewise.
(merge): Likewise.
(sort): Likewise.
Reported by John Summerfield.
1999-08-06 00:07:59 +00:00
Jim Meyering
a07027bbda *** empty log message *** 1999-08-05 14:45:13 +00:00
Jim Meyering
cf8234804d *** empty log message *** 1999-08-05 14:40:59 +00:00
Jim Meyering
fad7082c96 *** empty log message *** 1999-08-05 12:58:13 +00:00
Jim Meyering
59b21e3f05 *** empty log message *** 1999-08-05 11:19:54 +00:00
Jim Meyering
c0c398ba95 Rename test file from conftestdata to conftest.data
to avoid conflicts with `conftest' on 8+3 filesystems.
Suggestion from Eli Zaretskii.
1999-08-05 11:18:39 +00:00
Jim Meyering
f8b8ef6242 . 1999-08-04 11:37:54 +00:00
Jim Meyering
707f9870ba *** empty log message *** 1999-08-04 11:14:55 +00:00
Jim Meyering
26fe14166f *** empty log message *** 1999-08-04 08:16:05 +00:00
Jim Meyering
1259760b63 *** empty log message *** 1999-08-04 08:14:37 +00:00
Jim Meyering
9f315fd6f8 *** empty log message *** 1999-08-04 08:14:25 +00:00
Jim Meyering
c6c4932d6c *** empty log message *** 1999-08-04 08:13:33 +00:00
Jim Meyering
7a3247e23b (AM_FUNC_GETLINE): Run this test.
(AC_CHECK_FUNCS): Check for getdelim.
1999-08-04 08:10:17 +00:00
Jim Meyering
a6fcc4893f *** empty log message *** 1999-08-04 08:05:17 +00:00
Jim Meyering
4ff62130e9 *** empty log message *** 1999-08-04 08:04:34 +00:00
Jim Meyering
c8d4c53bff *** empty log message *** 1999-08-04 08:03:56 +00:00
Jim Meyering
4606c57a5c *** empty log message *** 1999-08-03 07:47:06 +00:00
Jim Meyering
231c74cf2b *** empty log message *** 1999-08-03 07:46:46 +00:00
Jim Meyering
3cc8a10875 (tail_forever): When following by name and calling recheck
because of exceeding max_n_consecutive_size_changes_between_opens,
`continue' so we don't fall through and (assuming the file finally grew)
get the erroneous `file truncated' message.
1999-08-03 07:43:42 +00:00
Jim Meyering
dd7bb02a99 *** empty log message *** 1999-08-02 08:34:49 +00:00
Jim Meyering
0856c30182 Add a comment. 1999-08-02 08:34:39 +00:00
Jim Meyering
ef315fa054 *** empty log message *** 1999-08-01 11:02:38 +00:00
Jim Meyering
1a1a070926 (usage): Correct description of %S; (00..60, not 00..61).
From Ken Pizzini.
1999-08-01 11:02:28 +00:00
Jim Meyering
113874c5f5 *** empty log message *** 1999-08-01 10:17:31 +00:00
Jim Meyering
58954a525e . 1999-08-01 10:13:13 +00:00
Jim Meyering
f0f1719546 . 1999-08-01 10:09:46 +00:00
Jim Meyering
47aa3de9f4 *** empty log message *** 1999-08-01 10:09:24 +00:00
Jim Meyering
be9c42975f . 1999-08-01 10:01:27 +00:00
Jim Meyering
20b936fbd2 *** empty log message *** 1999-08-01 09:59:51 +00:00
Jim Meyering
75e8fc40f8 (AC_FUNC_MKTIME): Undefine to avoid syntax errors from m4. 1999-08-01 09:59:45 +00:00
Jim Meyering
9624b35110 *** empty log message *** 1999-08-01 09:54:45 +00:00
Jim Meyering
10a0ecfe61 *** empty log message *** 1999-08-01 09:44:42 +00:00
Jim Meyering
b1d0c95b4b *** empty log message *** 1999-08-01 09:33:53 +00:00
Jim Meyering
961afa7d2f *** empty log message *** 1999-08-01 09:33:49 +00:00
Jim Meyering
2ce235df9c *** empty log message *** 1999-08-01 09:32:29 +00:00
Jim Meyering
07432a0f9d New file, which is a preview of what should appear
in the next public autoconf release.
1999-08-01 09:22:38 +00:00
Jim Meyering
8dc0dbec88 *** empty log message *** 1999-08-01 09:05:29 +00:00
Jim Meyering
270f765604 (jm_AC_PREREQ_XSTRTOUMAX): Check whether
<inttypes.h> defines strtoumax as a macro (and not as a
function).
1999-08-01 09:05:17 +00:00
Jim Meyering
d1ea838331 New file. It contains the old contents of
lfs.m4, except that all names with prefix AC_LFS have been
changed to use the prefix AC_SYS_LARGEFILE instead, to be
compatible with future autoconf versions.  Also, some minor m4
quoting problems have been fixed.
1999-08-01 08:59:46 +00:00
Jim Meyering
d3172d80ef (jm_AC_TYPE_UNSIGNED_LONG_LONG): Make sure
that we can shift, multiply and divide unsigned long long
values; Ultrix cc can't do it.
1999-08-01 08:47:11 +00:00
Jim Meyering
c36cde4138 *** empty log message *** 1999-08-01 07:59:08 +00:00
Jim Meyering
71f2c2f9ec (AM_WITH_NLS): Remove unnecessary lines.
Fix typo: $nls_cv_header_intl was misspelled as $nsl_cv_header_intl.
(AM_GNU_GETTEXT): Fix problem with brackets and m4 quoting,
and simplify the shell code.
1999-08-01 07:58:44 +00:00
Jim Meyering
ed0c88b7f7 (quotearg_buffer):
Don't quote spaces if C quoting style.
1999-08-01 07:44:39 +00:00
Jim Meyering
fabd45e6c6 *** empty log message *** 1999-07-31 17:47:36 +00:00
Jim Meyering
08aa2e4bde fix up true/false docs to include a couple sentences from Christy's truefalse package 1999-07-31 17:45:35 +00:00
Jim Meyering
5d4eefe8d8 . 1999-07-31 17:44:02 +00:00
Jim Meyering
fc6aa385f9 *** empty log message *** 1999-07-31 16:11:31 +00:00
Jim Meyering
13cfe05e30 *** empty log message *** 1999-07-31 16:10:52 +00:00
Jim Meyering
e7a73d59e6 *** empty log message *** 1999-07-31 16:09:35 +00:00
Jim Meyering
20e7435ae7 *** empty log message *** 1999-07-31 16:04:23 +00:00
Jim Meyering
555250c779 *** empty log message *** 1999-07-31 09:21:38 +00:00
Jim Meyering
ca47081c5b (tail_forever): Don't call kill if pid is 0.
Detect when `writer_is_dead' also when the writer is some other user.
From Karl Heuer.

(parse_options): Warn if --pid=PID is used without -f.
1999-07-31 09:21:32 +00:00
Jim Meyering
5e8ad5a577 *** empty log message *** 1999-07-31 09:03:43 +00:00
Jim Meyering
b19705597b . 1999-07-30 21:18:37 +00:00
Jim Meyering
e46de77883 . 1999-07-30 21:15:01 +00:00
Jim Meyering
a65fa10c4b *** empty log message *** 1999-07-30 21:13:19 +00:00
Jim Meyering
6e38ee2da0 Include signal.h for kill prototype. 1999-07-30 21:13:05 +00:00
Jim Meyering
b1476fec95 *** empty log message *** 1999-07-30 21:10:59 +00:00
Jim Meyering
48cb109a87 *** empty log message *** 1999-07-30 21:04:18 +00:00
Jim Meyering
f18a0a4331 *** empty log message *** 1999-07-30 21:03:35 +00:00
Jim Meyering
9200ad37c9 document tail's new option: --pid=PID 1999-07-30 21:02:54 +00:00
Jim Meyering
6b51b6027d *** empty log message *** 1999-07-30 20:43:10 +00:00
Jim Meyering
4d70e59a85 New option: --pid=PID.
(pid): New global.
(long_options): Add `pid'.
(usage): Describe it.
(tail_forever): Implement it.
(parse_options): Handle the new option and required arg.
Suggestion and pseudo-code from Karl Heuer.
1999-07-30 20:42:39 +00:00
Jim Meyering
d883ecee8a *** empty log message *** 1999-07-30 19:33:57 +00:00
Jim Meyering
3be49c9564 *** empty log message *** 1999-07-30 19:31:03 +00:00
Jim Meyering
898a08f344 (PID_T_MAX): Define. 1999-07-30 19:29:53 +00:00
Jim Meyering
a765a451e6 Include <sys/types.h> now that linebuffer.h uses
size_t.  This is required on at least SunOS4.  From Kaveh Ghazi.
1999-07-30 19:29:27 +00:00
Jim Meyering
e246ae8765 (usage): Explain about default wrt --hide-control-chars and
--show-control-chars.  Reported by Germano Leichsenring.
1999-07-30 16:01:44 +00:00
Jim Meyering
57f1b329c9 *** empty log message *** 1999-07-30 16:01:26 +00:00
Jim Meyering
998eae92d1 *** empty log message *** 1999-07-28 05:48:55 +00:00
Jim Meyering
eb8c7c7924 (dd_copy): Free the right obuf. 1999-07-27 14:36:36 +00:00
Jim Meyering
bf94a704bc more comments 1999-07-26 09:17:56 +00:00
Jim Meyering
e3a15bed3c add comment 1999-07-26 09:03:15 +00:00
Jim Meyering
4dd5a9b806 (struct File_spec) [n_stat_calls]: Remove unused member. 1999-07-26 09:01:27 +00:00
Jim Meyering
8ddf290477 (tee): Convert from open/fds to using fopen/streams for
output, in preparation for addition of new compression option.
1999-07-26 07:11:27 +00:00
Jim Meyering
a197ef9f3c *** empty log message *** 1999-07-26 06:52:28 +00:00
Jim Meyering
a2d3645e9c (usage): Remove `NEWS'-style paragraph (sorry to have let that in, translators). 1999-07-25 09:30:35 +00:00
Jim Meyering
edc46711dd *** empty log message *** 1999-07-25 08:47:36 +00:00
Jim Meyering
06db9a8db3 *** empty log message *** 1999-07-25 08:27:24 +00:00
Jim Meyering
096564b06c . 1999-07-25 08:10:14 +00:00
Jim Meyering
0476aba87e . 1999-07-24 21:16:37 +00:00
Jim Meyering
8082ce8f53 add to comment 1999-07-24 09:40:23 +00:00
Jim Meyering
7b5a5af07f (PTR_ALIGN, ROUND_UP_OFFSET): New macros.
(dd_copy): Use those to page-align both the input and output buffers.
1999-07-24 09:36:29 +00:00
Jim Meyering
c4731cc3f0 (options): Avoid Solaris' broken /usr/ucb/tr by
removing offending use of tr altogether and removing hyphens with sed.
Reported by Kaveh Ghazi.
1999-07-21 15:56:15 +00:00
Jim Meyering
a19cffba7e *** empty log message *** 1999-07-21 15:08:41 +00:00
Jim Meyering
f9fce0782d *** empty log message *** 1999-07-21 15:07:58 +00:00
Jim Meyering
1aa01e7b7b *** empty log message *** 1999-07-21 14:55:19 +00:00
Jim Meyering
8478414c5d update comments 1999-07-20 18:52:05 +00:00
Jim Meyering
bca7546dcd (translate_040_to_space) [MOUNTED_GETMNTENT1]: New function.
(read_filesystem_list) [MOUNTED_GETMNTENT1]: Use it.
1999-07-20 18:41:58 +00:00
Jim Meyering
c7582bc4ab *** empty log message *** 1999-07-20 17:08:37 +00:00
Jim Meyering
0cae6713e7 *** empty log message *** 1999-07-20 17:06:53 +00:00
Jim Meyering
9c2d071799 (AC_REPLACE_FUNCS): Add memmove. 1999-07-20 17:06:50 +00:00
Jim Meyering
35c14d81cf wc vs. POSIXLY_CORRECT 1999-07-20 08:03:49 +00:00
Jim Meyering
7387f60b85 (posixly_correct): Declare global.
(write_counts): Use it to select printf formats.
(main): Set posixly_correct from the POSIXLY_CORRECT envvar.
From Peter Moulder.
1999-07-20 07:56:59 +00:00
Jim Meyering
8e369dfcaa remove @key uses, rewrite --sep-string, small cleanups 1999-07-18 13:58:57 +00:00
Jim Meyering
196c0a27f0 . 1999-07-18 13:33:04 +00:00
Jim Meyering
bc1d502816 . 1999-07-18 11:21:58 +00:00
Jim Meyering
9ea7513f11 (noinst_HEADERS): Add getpagesize.h. 1999-07-15 16:16:24 +00:00
Jim Meyering
e7328f4f56 . 1999-07-15 16:15:17 +00:00
Jim Meyering
2a0577baa1 *** empty log message *** 1999-07-15 16:14:56 +00:00
Jim Meyering
6dc48e999d Revert the 1999-02-15 change. 1999-07-15 16:14:13 +00:00
Jim Meyering
f382570992 Revert the 1999-02-15 change and
add --text for individual tests.  Reported by Eli Zaretskii.
1999-07-15 16:13:47 +00:00
Jim Meyering
1e99421584 *** empty log message *** 1999-07-15 16:07:34 +00:00
Jim Meyering
a06c23be9b Document new tail options. 1999-07-15 16:07:15 +00:00
Jim Meyering
d3defdfba8 *** empty log message *** 1999-07-15 12:10:44 +00:00
Jim Meyering
5db7818497 Include getpagesize.h.
(ROUND_UP_TO_MODULUS): Define.
(dd_copy): Page-align the input buffer.
Based on a patch from Scott Lurndal.
1999-07-15 12:06:18 +00:00
Jim Meyering
1950561a91 . 1999-07-15 09:31:44 +00:00
Jim Meyering
13b5f7bc46 *** empty log message *** 1999-07-15 09:31:34 +00:00
Jim Meyering
5c5d74ef09 *** empty log message *** 1999-07-15 09:28:43 +00:00
Jim Meyering
dd408ec740 *** empty log message *** 1999-07-15 09:11:24 +00:00
Jim Meyering
474e7801ff (AC_CHECK_FUNCS): Check for getpagesize. 1999-07-15 09:11:13 +00:00
Jim Meyering
6970bbc17b (get_fs_usage) [STATFS_TRUNCATES_BLOCK_COUNTS]:
Work around SunOS botch also when block size is different from 1k.
1999-07-15 07:50:06 +00:00
Jim Meyering
db26cba77c *** empty log message *** 1999-07-15 07:49:28 +00:00
Jim Meyering
f1052fb45f *** empty log message *** 1999-07-12 20:07:37 +00:00
Jim Meyering
fae10f70e0 (mempcpy): Define only if not already defined.
Reported by Collin Rogowski.
1999-07-12 08:37:31 +00:00
Jim Meyering
f484303d9e *** empty log message *** 1999-07-12 08:37:21 +00:00
Jim Meyering
3f622f08e5 (recheck): Use assert instead of unnecessary close_fd.
Remove a couple unnecessary FIXME comments.
1999-07-11 09:05:31 +00:00
Jim Meyering
8287d3c4c4 *** empty log message *** 1999-07-10 16:40:33 +00:00
Jim Meyering
8b86e4459b cpp indent and split a long line 1999-07-10 16:40:16 +00:00
Jim Meyering
c44e7a8352 use a space, not TAB after #define 1999-07-10 16:36:56 +00:00
Jim Meyering
d11ec4a80f cpp indent 1999-07-10 16:36:11 +00:00
Jim Meyering
54651dc73c (struct File_spec) [tailable]: Rename from `missing' and
document.  Change all uses and locals like was_missing to was_tailable.
Invert expressions as appropriate.
(reopen_inaccessible_files): Rename from allow_missing.
(sleep_interval): Describe.
(--allow-missing): Deprecate.
(--retry): New option, equivalent to --allow-missing.
(usage): Document name vs. descriptor differences.
Refer to manual for descriptions of --max-unchanged-stats=N
and --max-consecutive-size-changes=N.
(valid_file_spec): New function.
(recheck): Assert valid_file_spec.
Remove dead else-if block (suggestion from Eli Zaretskii).
Adjust stmts that set f->tailable -- unlike for `missing', tailable
doesn't depend on errno == ENOENT.
(parse_options): Give a warning if --retry is used when not following
by name.
1999-07-10 12:24:10 +00:00
Jim Meyering
ae1e1e5e19 (struct File_spec): New member, errnum.
(recheck): Record the new value of errno in f->errnum.  Don't
output an error message unless the new value of errno differs from
the old one.  Output a message if previously-inaccessible file
becomes accessible.
(tail_forever): Always recheck files whose fd is negative.  If the
file cannot be fstat'ed, record the errno value in f[i].errnum.
(tail_file): If the file cannot be open, record the errno value in
f->errnum.  If it can be opened, initialize f->errnum to zero.  If
it's a non-regular non-fifo file, initialize f->errnum to -1.
1999-07-10 09:56:37 +00:00
Jim Meyering
647e6ab644 *** empty log message *** 1999-07-10 08:44:58 +00:00
Jim Meyering
41e1351fca Import version 1.012. 1999-07-10 08:44:49 +00:00
Jim Meyering
1b5283ca7a *** empty log message *** 1999-07-10 07:37:39 +00:00
Jim Meyering
dd7e9b194e *** empty log message *** 1999-07-10 07:34:52 +00:00
Jim Meyering
40c0f14648 Import version 1.011. 1999-07-10 07:28:05 +00:00
Jim Meyering
7f44579325 . 1999-07-10 07:17:02 +00:00
Jim Meyering
171778bed3 *** empty log message *** 1999-07-09 12:51:18 +00:00
Jim Meyering
e7f7f3da11 reinclude memcoll.h (mistakenly removed by me) 1999-07-04 10:41:26 +00:00
Jim Meyering
1ccaa26ea4 *** empty log message *** 1999-07-04 10:40:15 +00:00
Jim Meyering
376c3fe740 [!defined strtoumax]: Declare strtoumax. 1999-07-04 10:40:04 +00:00
Jim Meyering
08da7047d0 . 1999-07-04 10:38:37 +00:00
Jim Meyering
0aa86039dd *** empty log message *** 1999-07-04 10:33:50 +00:00
Jim Meyering
bfd09e35cc (readline): Leave room for an extra byte
after the newline; comm needs this for memcoll.
1999-07-04 10:31:01 +00:00
Jim Meyering
115372366e Add support for LC_COLLATE locale.
Include hard-locale.h, linebuffer.h, memcoll.h.
(struct line): New member `buf', replacing `beg' and `lim'.
All uses changed.
(hard_LC_COLLATE): New var.
(main): Initialize it.
(get_line): Use readline to read the line,
instead of doing it by hand.
That way, we get a buffer that we can pass to memcoll.
(keycmp): Use memcoll to compare lines if hard_LC_COLLATE is nonzero.
1999-07-04 10:28:08 +00:00
Jim Meyering
d67adf2b8c Include hard-locale.h, memcoll.h.
(hard_LC_COLLATE, hard_LC_CTYPE, hard_LC_TIME): New variables,
replacing `need_locale'.
(memcoll): Move to lib/memcoll.c.
(keycompare): No need to alloc (0), since our caller now does it.
(compare): alloca (0) before returning.
(my_setlocale): Remove; hard_locale now dows this.
(main): Invoke setlocale, bindtextdomain, and textdomain before
invoking anything that might print an error.
Use hard_locale to determine which locales are hard.
1999-07-04 10:23:19 +00:00
Jim Meyering
3ad83e6ad0 Include hard-locale.h, memcoll.h.
(hard_LC_COLLATE): New variable.
(compare_files): Use memcoll to compare if hard_LC_COLLATE.
(main): Initialize hard_LC_COLLATE from locale.
1999-07-04 10:22:25 +00:00
Jim Meyering
ad72fa61c8 Document locale-specific mode for comm. 1999-07-04 10:21:39 +00:00
Jim Meyering
c3ee42e3b0 *** empty log message *** 1999-07-04 10:16:28 +00:00
Jim Meyering
ca3b34f491 (proc_text, check_section, main):
Use size_t, not int, for lengths.
Lines now contain trailing newline.
Adapt for readline changes.
1999-07-04 10:15:45 +00:00
Jim Meyering
cdcf38b40f (find_field, different): Use size_t, not int, for lengths.
(writeline): Lines now contain trailing newline.
(check_file): Use size_t, not int, for lengths.
1999-07-04 10:14:03 +00:00
Jim Meyering
3423927cfa (writeline): Lines now contain trailing newline. 1999-07-04 10:09:44 +00:00
Jim Meyering
fac400a428 [struct linebuffer] (size): Declare to be of type size_t, not long.
[struct linebuffer] (length): Likewise.
1999-07-04 10:08:56 +00:00
Jim Meyering
894e9948f4 (readline): Append trailing newline to line. 1999-07-04 10:06:42 +00:00
Jim Meyering
ed1684742a (memrchr): Ifdef out this unused function. 1999-07-04 10:03:05 +00:00
Jim Meyering
468dd2822c *** empty log message *** 1999-07-04 09:51:09 +00:00
Jim Meyering
90f1e86e58 *** empty log message *** 1999-07-04 09:46:14 +00:00
Jim Meyering
bfbd79ca59 New test case for Paul's 1999-06-03 fix. 1999-07-04 09:46:07 +00:00
Jim Meyering
fb71ae4c86 (xfields): Only <blank>s separate fields, not <space>s. 1999-07-04 09:40:46 +00:00
Jim Meyering
5b09432a60 . 1999-07-04 09:37:57 +00:00
Jim Meyering
3ba3797506 Use lower case characters in sc{} context.
Reported by Eli Zaretskii.
1999-07-04 09:05:08 +00:00
Jim Meyering
a64b525ff4 *** empty log message *** 1999-07-04 08:48:02 +00:00
Jim Meyering
56533a5671 (enum human_inexact_style): New enum.
(human_readable_inexact): New decl.
1999-07-04 08:47:49 +00:00
Jim Meyering
8999870c56 (human_readable): New function.
(human_readable_inexact): Renamed from human_readable, with new arg
INEXACT_STYLE.  Add support for ceiling and floor.
1999-07-04 08:47:28 +00:00
Jim Meyering
40540367af (print_header): Conform to POSIX if posix_format).
(df_readable): Take ceiling if posix_format.
(ceil_percent): New function.
(show_dev): Take ceiling of percent if posix_format.
Align with POSIX-conforming header if posix_format.
1999-07-04 08:47:08 +00:00
Jim Meyering
0806bbf608 *** empty log message *** 1999-07-04 08:35:05 +00:00
Jim Meyering
589cf443b9 (__strtol): Remove decl; it doesn't work if __strtol
expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
(strtol, strtoul): New decls (for pre-ANSI hosts), to replace
the above decl.
1999-07-04 08:34:31 +00:00
Jim Meyering
0430c3c938 . 1999-05-27 13:08:29 +00:00
Jim Meyering
db358e3feb *** empty log message *** 1999-05-27 13:08:19 +00:00
Jim Meyering
032571f565 Fix non-portable use of `tr' that caused this test
to fail when run with a SysV-style tr.  Based on a patch from Kaveh Ghazi.
1999-05-25 16:43:57 +00:00
Jim Meyering
b38198f365 (Squeezing): Remove misleading square brackets
from SET1 in the one-word-per-line example.
1999-05-25 16:38:19 +00:00
Jim Meyering
0e39b529b6 (copy_internal): Don't apply the umask in move_mode.
Otherwise, `mv' would not preserve the permissions when copying
between partitions.  Reported by David Godfrey
1999-05-23 23:23:55 +00:00
Jim Meyering
3957028d28 *** empty log message *** 1999-05-23 23:07:26 +00:00
Jim Meyering
97c9216e92 . 1999-05-23 21:06:36 +00:00
Jim Meyering
f914ebb255 *** empty log message *** 1999-05-23 20:46:23 +00:00
Jim Meyering
3fed986eee *** empty log message *** 1999-05-23 20:45:34 +00:00
Jim Meyering
5cd334b32e . 1999-05-23 20:44:48 +00:00
Jim Meyering
a54b71f493 *** empty log message *** 1999-05-23 20:43:11 +00:00
Jim Meyering
08f55c4b7c Correct erroneous expected output from the `cp -f foo foo' tests. 1999-05-23 20:42:25 +00:00
Jim Meyering
994746ffe9 (libfu_a_SOURCES): Add same.c.
(noinst_HEADERS): Add same.h.
1999-05-23 20:40:59 +00:00
Jim Meyering
645015312e Remove today's earlier misguided attempts.
Add a single condition to the existing sameness test.
1999-05-23 20:37:16 +00:00
Jim Meyering
642d250781 Include same.h.
(copy_internal): Qualify SAME_INODE test with (link-count == 1
|| same_name(...)).
1999-05-23 19:45:33 +00:00
Jim Meyering
00fbb65ec1 *** empty log message *** 1999-05-23 19:43:10 +00:00
Jim Meyering
0e96b5d2e7 New file (function extracted from ln.c). 1999-05-23 19:42:59 +00:00
Jim Meyering
2a8c9424f0 (same_name): Remove function.
<same.h>: Include this instead.
<dirname.h>: No longer include this.
1999-05-23 19:41:19 +00:00
Jim Meyering
96074cef79 *** empty log message *** 1999-05-23 19:38:53 +00:00
Jim Meyering
27893412b2 white-space tweak 1999-05-23 19:27:36 +00:00
Jim Meyering
ff08632036 white-space tweak 1999-05-23 19:27:07 +00:00
Jim Meyering
0868b5794a (copy_internal): Make it so `mv -f FILE FILE' does not remove FILE.
Based on a patch from Chris Yeo.
1999-05-23 14:52:32 +00:00
Jim Meyering
46945ad760 *** empty log message *** 1999-05-23 14:49:14 +00:00
Jim Meyering
78d7d7b746 *** empty log message *** 1999-05-23 13:36:37 +00:00
Jim Meyering
77cf4d48dd (TESTS): Add force.
(TESTS_ENVIRONMENT): Change PATH to be absolute.
1999-05-23 13:36:14 +00:00
Jim Meyering
e7eeacebbc *** empty log message *** 1999-05-23 04:19:10 +00:00
Jim Meyering
dee24e9fac *** empty log message *** 1999-05-23 04:01:55 +00:00
Jim Meyering
65ffd691ee *** empty log message *** 1999-05-23 03:59:08 +00:00
Jim Meyering
80ef68e006 *** empty log message *** 1999-05-22 22:10:34 +00:00
Jim Meyering
b5b54d2fed *** empty log message *** 1999-05-22 22:02:54 +00:00
Jim Meyering
1f2dc06993 *** empty log message *** 1999-05-22 22:02:00 +00:00
Jim Meyering
2b477f5dc4 (AC_REPLACE_FUNCS): Add memchr. 1999-05-22 22:00:42 +00:00
Jim Meyering
39d0a166c5 *** empty log message *** 1999-05-22 16:56:40 +00:00
Jim Meyering
dae50ead45 *** empty log message *** 1999-05-22 12:53:07 +00:00
Jim Meyering
be6aea6fb9 Document locale-specific changes to `sort',
as well as the new, POSIX-compliant definition of line comparison,
and -g's more careful treatment of NaNs, infinities and zeros.
1999-05-22 12:52:41 +00:00
Jim Meyering
9e48e223db (general_numcompare): Put exceptional cases
first, not last, to be consistent with -M.
1999-05-22 12:52:14 +00:00
Jim Meyering
59b22bd058 *** empty log message *** 1999-05-22 04:30:36 +00:00
Jim Meyering
77d5a18a9b *** empty log message *** 1999-05-22 04:29:30 +00:00
Jim Meyering
4539e57b3c . 1999-05-22 04:24:10 +00:00
Jim Meyering
668807df85 . 1999-05-22 02:53:08 +00:00
Jim Meyering
b66bd5f56c *** empty log message *** 1999-05-22 02:48:22 +00:00
Jim Meyering
7bac5533d7 (strtod): Declare if STDC_HEADERS is not defined.
(general_numcompare): Use strtod, not xstrtod.
Do not consider partial conversions to be errors.
Put -infinity at the start, and +infinity at the end;
follow +infinity with NaNs (sorted by bit pattern),
and finally by conversion errors.
1999-05-22 02:47:45 +00:00
Jim Meyering
28c635adb2 (use-nl): New test from Paul Eggert. 1999-05-22 02:41:39 +00:00
Jim Meyering
125ce0f85c tweak comment 1999-05-22 02:37:47 +00:00
Jim Meyering
157c31573e (11d): Reverse lines in expected output to reflect latest change. 1999-05-22 02:37:10 +00:00
Jim Meyering
67fbe7e2a0 remove trailing newline 1999-05-21 20:47:18 +00:00
Jim Meyering
c734236a6f *** empty log message *** 1999-05-21 20:24:39 +00:00
Jim Meyering
d6261d35c9 Treat the trailing newline as part of the line, as required by POSIX.2.
(struct line, findlines, compare, checkfp, mergefps, sort):
A line now includes its trailing newline.
(findlines): Do not replace newline with NUL.
(memcoll, keycompare): Work even if the data to be compared are
adjacent strings; this is possible now that lines contain the
trailing newline.
(fillbuf): Always have an unused byte at the end of the	buffer,
since memcoll and keycompare want to modify a byte after the last line.
(sortalloc, mergealloc): Increase by 1, for trailing byte.
1999-05-21 20:24:19 +00:00
Jim Meyering
db0d476b12 *** empty log message *** 1999-05-21 19:53:05 +00:00
Jim Meyering
07add9a796 . 1999-05-20 20:12:17 +00:00
Jim Meyering
46e594f9bc [AC_SEARCH_LIBS]: Quote name in undefine.
Add a colon after each `then' in case $4 is empty.
1999-05-20 20:12:12 +00:00
Jim Meyering
6501594508 . 1999-05-20 20:10:17 +00:00
Jim Meyering
d60127857c . 1999-05-20 16:51:40 +00:00
Jim Meyering
0a4ebdb1d3 *** empty log message *** 1999-05-20 16:51:29 +00:00
Jim Meyering
559f32b40d Add test case from Paul Eggert. 1999-05-20 16:48:56 +00:00
Jim Meyering
bffbff4ff2 *** empty log message *** 1999-05-20 16:29:51 +00:00
Jim Meyering
d30365509d (keycompare): Ignore any length difference if the
localized comparison says the strings are equal.
1999-05-20 16:29:38 +00:00
Jim Meyering
9a27ea2eb2 (memcoll, keycompare, compare): Handle NUL
characters properly when comparing with LC_COLLATE semantics.
(NLS_MEMCMP): Remove.
(memcoll): Renamed from strncoll.
Take separate lengths for each string.
This function is now invoked only when need_locale.
(keycompare): Don't copy strings when ignore and translate
are both NULL.
1999-05-20 16:09:12 +00:00
Jim Meyering
61b2bceab7 (MONTHTAB_CONST): Renamed from NLS_CONST; the use
is also changed.  Define to const also if !HAVE_NL_LANGINFO.

(usage): `,' -> `;' (English typo).
1999-05-20 03:52:15 +00:00
Jim Meyering
0f5bb7dd4e add the comment to go with last change 1999-05-20 03:49:25 +00:00
Jim Meyering
a0766fb80f (get_date): Let mktime deduce tm_isdst if we
have an absolute timestamp, or if the relative timestamp
mentions days, months, or years.
1999-05-20 03:47:24 +00:00
Jim Meyering
867c8b0e85 . 1999-05-19 14:31:53 +00:00
Jim Meyering
98270d63fb (main): When stdout is in binary mode, make sure all
input files are also read in binary mode.
1999-05-18 14:13:33 +00:00
Jim Meyering
d9076a130e *** empty log message *** 1999-05-17 13:10:53 +00:00
Jim Meyering
8d5798a538 *** empty log message *** 1999-05-17 13:10:31 +00:00
Jim Meyering
1ee4fffc88 (human_readable): Allow from_block_size to be zero. 1999-05-17 13:03:46 +00:00
Jim Meyering
4fd5e02337 . 1999-05-16 19:13:59 +00:00
Jim Meyering
92462cca2a . 1999-05-16 19:11:16 +00:00
Jim Meyering
a162f70539 *** empty log message *** 1999-05-16 19:09:25 +00:00
Jim Meyering
cbdd9172f9 . 1999-05-16 16:54:01 +00:00
Jim Meyering
bc48b59612 *** empty log message *** 1999-05-16 16:53:02 +00:00
Jim Meyering
901dc5cba9 *** empty log message *** 1999-05-16 16:43:22 +00:00
Jim Meyering
108ff5810f Don't autodetect the locale of numbers and
months, as this conflicts with POSIX.2 and is tricky to boot.

(FLOATING_COMMA, NLS_STRNCMP, NLS_MAX_GROUPS,
NLS_ONE_CHARACTER_STRING): Remove macros no longer used.

(nls_grouping, nls_fraction_found, nls_month_found, nos_monthtab,
nls_months_collide, nls_keyhead, us_monthtab): Remove variables no
longer used.

(struct nls_keyfield): Remove types no longer used.

(strncoll_s2_readonly, nls_set_fraction, look_for_fraction,
nls_month_is_either_locale, nls_numeric_format): Remove functions no
longer used.

(monthtab): Now has the role that us_monthtab had, but it's const only
if ENABLE_NLS is not defined.

(C_DECIMAL_POINT): Renamed from FLOATING_POINT.  All uses changed.
(MONTHS_PER_YEAR): Renamed from NLS_NUM_MONTHS.  All uses changed.
(struct_month_cmp): Renamed from nls_sort_month_comp.  All uses changed.
Use strcmp, not strcoll, since the user doesn't care about collating
here.

(inittables): Read locale data into monthtab, rather than modifying a
separate month table and futzing with indirection.  Do not worry about
colliding months, since we no longer autodetect month locale.

(fraccompare): Don't set no-longer-used variable nls_fraction_found.

(getmonth): Use strncmp to compare months, since user doesn't care
about collating here.  Fix bug where code incorrectly assumed that
strlen (monthtab[lo].name) == strlen (monthtab[ix].name).

(keycompare, main): Don't autodetect month locale.

(compare): Don't use NLS_MEMCP in code that can't be executed if
need_locale is false, as NLS_MEMCP is equivalent to memcmp in that
case.

(sort, insertkey, main): Don't autodetect numeric locale.
1999-05-16 16:18:46 +00:00
Jim Meyering
4b11c1f734 *** empty log message *** 1999-05-16 15:50:56 +00:00
Jim Meyering
3cf365bf7e *** empty log message *** 1999-05-16 15:50:04 +00:00
Jim Meyering
f2a1097c92 . 1999-05-16 15:48:43 +00:00
Jim Meyering
3d2009b52d New file to override autoconf's AC_SEARCH_LIBS. 1999-05-16 15:48:11 +00:00
Jim Meyering
73a206d970 . 1999-05-15 06:13:00 +00:00
Jim Meyering
dad89f8b93 . 1999-05-15 05:46:45 +00:00
Jim Meyering
23d3bb9416 (usage): Whoops. 1999-05-15 05:46:12 +00:00
Jim Meyering
cd0c914437 *** empty log message *** 1999-05-15 05:42:55 +00:00
Jim Meyering
dace9c7477 . 1999-05-15 05:30:51 +00:00
Jim Meyering
1acf1ddd65 (trailing-sp): New test for this fix. 1999-05-15 05:28:51 +00:00
Jim Meyering
771bc6ea9d (xfields): Don't interpret a trailing blank as a
delimiter when e.g. -t: was specified.  From Tim Smithers.
1999-05-15 05:28:16 +00:00
Jim Meyering
634a39aad5 (getugroups): Don't dereference a null pointer when
running `id USER' for some USER that is listed on the RHS in /etc/group.
From Sander van Malssen.
Add some curly braces, use STREQ, reverse the sense of a test
and use `continue' to save a level of nesting.
1999-05-15 04:50:26 +00:00
Jim Meyering
7af9c3c085 *** empty log message *** 1999-05-15 04:11:13 +00:00
Jim Meyering
d8c0345769 *** empty log message *** 1999-05-15 04:08:29 +00:00
Jim Meyering
0a25564c1c (open_maybe_create): Handle Solaris' failure mode when
FILE is a directory.  Reported by Vin Shelton.
1999-05-15 04:06:51 +00:00
Jim Meyering
7565800a11 (main): When asking for info on an explicit file name,
just warn rather than failing if the table of mounted filesystems
cannot be read.
1999-05-15 01:53:21 +00:00
Jim Meyering
2d97b1c61b (version_etc): Put version info and author names
on the first two lines respectively rather than putting the three
lines of copyright info between them.
1999-05-14 17:11:03 +00:00
Jim Meyering
1fdc84d5a2 *** empty log message *** 1999-05-14 16:59:46 +00:00
Jim Meyering
c93ac403ed Include <string.h> or <strings.h> for strlen prototype. 1999-05-13 20:48:44 +00:00
Jim Meyering
4c9f46a4a1 [__GLIBC__ >= 2]: #if-out prototypes. 1999-05-13 20:44:45 +00:00
Jim Meyering
59d16049d8 (pop_dir): Cast length to `int' to avoid a warning on
64-bit systems.  From Ulrich Drepper.
1999-05-13 20:42:45 +00:00
Jim Meyering
5a83986f79 (main): Put `u' for -u in getopt_long's string argument.
Remove the `R'.
1999-05-12 16:50:54 +00:00
Jim Meyering
150ca569b5 *** empty log message *** 1999-05-12 16:01:29 +00:00
Jim Meyering
048a38dc54 Use `%%' place-holder that Makefile.am rule expects. 1999-05-12 15:54:52 +00:00
Jim Meyering
ece1dc4e51 (usage): Split the --help message into two pieces so that
neither is longer than 2048.  For Irix4's cc.  Reported by Kaveh Ghazi.
1999-05-12 14:58:30 +00:00
Jim Meyering
c1a461273d (usage): Split --help message into two pieces so that
Split the --help message into two pieces so that neither is longer
than 2048.  For Irix4's cc.  Reported by Kaveh Ghazi.
1999-05-12 02:13:45 +00:00
Jim Meyering
da36bbf417 *** empty log message *** 1999-05-12 02:10:38 +00:00
Jim Meyering
74e5374045 *** empty log message *** 1999-05-11 16:30:03 +00:00
Jim Meyering
f039432d03 Fix typos in config.h comments. 1999-05-11 16:29:56 +00:00
Jim Meyering
5af7e261fa Fix typos in config.h comments. 1999-05-11 16:29:33 +00:00
Jim Meyering
ce1d9075d7 *** empty log message *** 1999-05-10 17:25:27 +00:00
Jim Meyering
c23f5758dc (AUTHORS): Reflect reality: add Kaveh. 1999-05-10 15:12:24 +00:00
Jim Meyering
af735060cb Expand each `&' character in the gecos field.
(count_ampersands): New function.
(create_fullname): New function.
(print_entry): Use create_fullname here.
(print_long_entry): Use it here, too.
From Kaveh Ghazi.
1999-05-10 14:17:09 +00:00
Jim Meyering
0ff57399ed *** empty log message *** 1999-05-10 05:24:38 +00:00
Jim Meyering
447527eeb5 Reflect renaming: AM_FUNC_MKTIME -> AC_FUNC_MKTIME. 1999-05-10 05:18:30 +00:00
Jim Meyering
d845b9a5a3 Require 2.14.1, since we use newly-renamed AC_FUNC_MKTIME. 1999-05-10 05:17:38 +00:00
Jim Meyering
f1b3fb4f3b Update from libc. 1999-05-10 04:24:49 +00:00
Jim Meyering
94323ee2a7 uncomment final rm 1999-05-09 15:59:27 +00:00
Jim Meyering
c250ac3ddc *** empty log message *** 1999-05-09 15:56:27 +00:00
Jim Meyering
badacafb98 *** empty log message *** 1999-05-09 15:13:41 +00:00
Jim Meyering
d0672fcf74 *** empty log message *** 1999-05-09 15:13:09 +00:00
Jim Meyering
91e23a4607 *** empty log message *** 1999-05-09 15:11:52 +00:00
Jim Meyering
60d62033fb *** empty log message *** 1999-05-09 15:10:33 +00:00
Jim Meyering
d02a83cba4 *** empty log message *** 1999-05-09 15:10:10 +00:00
Jim Meyering
359c6f7e38 (alpha): Put the announcement in /tmp/announce-$(distdir) 1999-05-09 15:10:02 +00:00
Jim Meyering
1554d14ce1 . 1999-05-09 15:04:17 +00:00
Jim Meyering
11f093839f *** empty log message *** 1999-05-09 15:03:58 +00:00
Jim Meyering
d1520cea68 whoops -- revert last change 1999-05-09 15:03:52 +00:00
Jim Meyering
9cc8d1f6a9 (Makefile.in): Depend on Makefile.maint. 1999-05-09 15:02:44 +00:00
Jim Meyering
48d1df6825 . 1999-05-09 15:02:16 +00:00
Jim Meyering
3a7457ae6c . 1999-05-09 15:01:52 +00:00
Jim Meyering
fe76db396c (neg-nls): New test. 1999-05-09 15:01:40 +00:00
Jim Meyering
dd992130c6 (fraccompare, numcompare): Merge the NLS and
non-NLS versions into a single function.

(decimal_point): Now char, since we no longer convert to unsigned char.
(th_sep): Now int, since we use a value out of char range to denote
the absence of a thousands separator.
(IS_THOUSANDS_SEP): New macro.
(USE_NEW_FRAC_COMPARE): Remove.
(nls_set_fraction): Arg is now char, not unsigned char.
Set th_sep to CHAR_MAX + 1 if there is no thousands separator.
(numcompare): Don't convert to unsigned char unless necessary.
(main): Turn off decimal points and thousand separators if they
are multibyte characters, as we don't support that yet.
1999-05-09 03:27:24 +00:00
Jim Meyering
02d760e232 * src/system.h (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM,
and all the *_MIN and *_MAX symbols): Remove definitions.
* src/sys2.h: Put the definitions here instead (this file is shared
between all three *utils packages, while system.h is not).
1999-05-08 23:29:47 +00:00
Jim Meyering
4905751e2f * src/system.h (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM,
and all the *_MIN and *_MAX symbols): Remove definitions.
* src/sys2.h: Put the definitions here instead (this file is shared
between all three *utils packages, while system.h is not).
1999-05-08 23:28:42 +00:00
Jim Meyering
d103085de3 (handle_line_error): Use %s, not %d, now that human_readable
converts it to a string.
1999-05-07 19:15:37 +00:00
Jim Meyering
9bc1a80b4e *** empty log message *** 1999-05-07 19:00:44 +00:00
Jim Meyering
99ed77dea6 import latest 1999-05-07 18:54:34 +00:00
Jim Meyering
bda57be904 *** empty log message *** 1999-05-07 18:53:01 +00:00
Jim Meyering
07053344dc . 1999-05-07 18:52:35 +00:00
Jim Meyering
f31052628d *** empty log message *** 1999-05-07 18:49:09 +00:00
Jim Meyering
8e03e30c05 clean up 1999-05-07 18:48:45 +00:00
Jim Meyering
0ef3c5d7fc (TESTS_ENVIRONMENT): Remove individual
upper-case program names.  Add a definition of PATH.
(TESTS): Add dir-1.
1999-05-07 18:47:50 +00:00
Jim Meyering
a06a563ea4 (touch): Only do the fstat if we need to.
Resort to calling stat for directories, but only when necessary.
(usage): Mention --no-create.
1999-05-07 18:44:20 +00:00
Jim Meyering
9250d1a34f (main): Use better wording in diagnostic: `cannot
create directory' rather than `cannot make directory'.  The former
also matches the one in makepath.c.
1999-05-07 18:40:11 +00:00
Jim Meyering
a8d7df994f (apply_translations): Use TOUPPER, not toupper. 1999-05-07 18:36:54 +00:00
Jim Meyering
b10e58db1b (numcompare): Handle comparison of two negative
numbers correctly in the ENABLE_NLS case.
1999-05-06 21:51:06 +00:00
Jim Meyering
a440742330 (make_dir): When reporting a mkdir failure and the
target cannot be `stat'ed, use the errno from the failed mkdir call,
not the one from the stat call.  Before this change, running
`mkdir -p /no-dir/no-dir' as an unprivileged user would wrongly
elicit `No such file or directory' instead of `Permission denied'.
1999-05-06 02:10:34 +00:00
Jim Meyering
f466b6448a *** empty log message *** 1999-05-05 13:34:29 +00:00
Jim Meyering
9f8bc128f0 (read_utmp): Use the new definitions. 1999-05-05 13:34:18 +00:00
Jim Meyering
b0cc976ab9 Add definitions to help read utmpx on systems with utmpname.
(UTMP_NAME_FUNCTION): Define.
(SET_UTMP_ENT): Likewise.
(GET_UTMP_ENT): Likewise.
(END_UTMP_ENT): Likewise.
1999-05-05 13:34:02 +00:00
Jim Meyering
632b63d59c *** empty log message *** 1999-05-05 13:26:22 +00:00
Jim Meyering
1db78f41bf (show_date): Change an automatic aggregate initializer
to be a static one.  For SunOS4's cc.
1999-05-05 13:26:06 +00:00
Jim Meyering
7c48860ed8 *** empty log message *** 1999-05-05 13:21:55 +00:00
Jim Meyering
1b0901bb9e (TYPE_SIGNED, TYPE_MAXIMUM, TYPE_MINIMUM): Define.
(ULONG_LONG_MAX, LONG_LONG_MAX, LONG_LONG_MIN): Define if not defined.
Based on a patch from Kaveh Ghazi.
1999-05-05 13:21:29 +00:00
Jim Meyering
76a9b4dc10 *** empty log message *** 1999-05-05 13:16:42 +00:00
Jim Meyering
19d33cea2b (USE_ACL): Define this only #if
(HAVE_SYS_ACL_H && HAVE_ACL && defined GETACLCNT).
Use `USE_ACL' in place of `HAVE_ACL' everywhere else.  From Kaveh Ghazi.
1999-05-05 13:12:28 +00:00
Jim Meyering
c4ddb7f83a Include makepath.h libintl.h, not after it.
Otherwise, we'd get the wrong definition of PARAMS from libintl.h.
(The method of defining PARAMS in libintl.h doesn't check PROTOTYPES,
which is necessary on Irix4 since cc doesn't define __STDC__.)
From Kaveh Ghazi.
1999-05-05 03:05:11 +00:00
Jim Meyering
431db6c847 add missing backslash-before-newline in usage message 1999-05-05 01:56:45 +00:00
Jim Meyering
207d6b3cda add missing backslash-before-newline in usage message 1999-05-05 01:55:39 +00:00
Jim Meyering
bbefeb160b *** empty log message *** 1999-05-04 21:13:54 +00:00
Jim Meyering
89d0895332 (AC_LFS): -n32, -o32, and -n64 should be in CFLAGS,
not CPPFLAGS, so that linking works correctly in IRIX.
1999-05-04 21:13:47 +00:00
Jim Meyering
cb5153fefa (usage): Break the usage message into 3 pieces instead of
only 2.  The strings had grown to be longer than 2048, which evokes
errors when compiling with Irix4's cc.
1999-05-04 18:46:06 +00:00
Jim Meyering
b08eca15fd (search_item): Use 1' instead of +1'. The latter
elicits a syntax error from SunOS4's cc.  From Kaveh Ghazi.
1999-05-04 14:31:27 +00:00
Jim Meyering
6f922edf2d <ctype.h>: Don't include.
[!STDC_HEADERS]: Remove definitions of ctype macros.
Convert e.g., isspace to ISSPACE to use definitions from sys2.h.
Reported by Kaveh Ghazi.
1999-05-03 18:01:49 +00:00
Jim Meyering
85514c7e0b (TOLOWER): Define.
(TOUPPER): Define.
1999-05-03 17:59:43 +00:00
Jim Meyering
e060631c35 (TOLOWER): Remove definition. 1999-05-03 17:55:53 +00:00
Jim Meyering
cac31ff114 *** empty log message *** 1999-05-03 03:58:40 +00:00
Jim Meyering
f0e23dcff9 *** empty log message *** 1999-05-03 03:56:46 +00:00
Jim Meyering
b3faad27ed . 1999-05-03 02:46:54 +00:00
Jim Meyering
38121144b2 . 1999-05-03 02:45:51 +00:00
Jim Meyering
73bc7f0777 (main): Give a better diagnostic when we fail to set the hostname. 1999-05-03 02:45:37 +00:00
Jim Meyering
99571c629e (main): Manually handle `--', since we no longer call getopt. 1999-05-03 02:42:49 +00:00
Jim Meyering
4f40ac7422 (read_utmp): Ignore the return value from utmpname. 1999-05-03 02:38:50 +00:00
Jim Meyering
1610efe2fd Define several tag-related make variables.
(cvs-dist): Use the make variables instead of shell ones.
(announcement): Automatically generate diffs for all ChangeLog files,
not just the top level one.
1999-05-01 04:33:45 +00:00
Jim Meyering
1c70e83474 *** empty log message *** 1999-05-01 04:15:43 +00:00
Jim Meyering
9a06759937 *** empty log message *** 1999-05-01 04:15:09 +00:00
Jim Meyering
6161d60dde *** empty log message *** 1999-05-01 04:13:56 +00:00
Jim Meyering
e3cd439763 (AC_REPLACE_FUNCS): Add dup2. 1999-05-01 04:13:45 +00:00
Jim Meyering
5e1ffee4d6 (main): Manually handle `--', since we no longer
call getopt.  Reported by Joseph S. Myers.
1999-05-01 02:29:17 +00:00
Jim Meyering
910287474f (main): Manually handle `--', since we no longer
call getopt.  Reported by Joseph S. Myers.
1999-05-01 02:28:54 +00:00
Jim Meyering
6faa50c135 (decode_switches): Use STDIN_FILENO, STDOUT_FILENO instead of 0, 1. 1999-05-01 02:08:30 +00:00
Jim Meyering
9fca49f67c Always use STDIN_FILENO for input and STDOUT_FILENO
for output, to avoid confusion with closed input and output fds.
(input_fd, output_fd): Remove; all uses changed to STDIN_FILENO
and STDOUT_FILENO.
(open_fd): New function.
(main): Use it, instead of open, to ensure that file descriptors
don't get confused.

(skip): Don't fstat the input file; the result is no longer used.
1999-05-01 02:05:56 +00:00
Jim Meyering
8a3c0671e0 *** empty log message *** 1999-05-01 00:13:13 +00:00
Jim Meyering
2f7eb5cdf5 (usage): Document the differences between the
obsolescent, +POS1[-POS2] form, and the POSIX -k option.
1999-05-01 00:12:26 +00:00
Jim Meyering
8fb3745a09 add emphasis that sort's -k M,N is inclusive 1999-04-30 22:35:54 +00:00
Jim Meyering
aaba44e639 *** empty log message *** 1999-04-30 20:59:49 +00:00
Jim Meyering
1cd88b2b5e *** empty log message *** 1999-04-30 16:48:09 +00:00
Jim Meyering
60695039c0 *** empty log message *** 1999-04-30 16:03:53 +00:00
Jim Meyering
806520fdc0 Update to reflect this change by reversing
the order of arguments so the symlink is the source, not the
destination (otherwise, the mv command would now succeed).
1999-04-30 16:03:46 +00:00
Jim Meyering
25a8d1f1e9 (copy_internal): Move the one-file-system test so that
it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block.
Prior to this change, `cp --one-file-system' would traverse a file-
system boundary if the destination directory existed.
From thospel@mail.dma.be.
1999-04-30 15:40:34 +00:00
Jim Meyering
f0e50d53d5 *** empty log message *** 1999-04-30 15:24:47 +00:00
Jim Meyering
40d99818ef (copy_internal): Don't make `mv foo symlink-to-foo' fail.
That is, even though source and destination are `the same,' don't fail
if the destination is a symlink.  From Peter Samuelson.
1999-04-30 15:15:02 +00:00
Jim Meyering
0d6a1583c6 *** empty log message *** 1999-04-26 15:07:44 +00:00
Jim Meyering
6f48de44ae *** empty log message *** 1999-04-26 13:31:57 +00:00
Jim Meyering
9622d45140 (main): If you can't open an output file (with seek=...) read-write,
then open it for write and report an error if we can't seek.
1999-04-26 13:31:49 +00:00
Jim Meyering
890a087101 . 1999-04-26 13:25:28 +00:00
Jim Meyering
bc2e8cb6ce (utime_null): Don't pass 0666 to open; it's not needed and isn't
guaranteed to be portable.
1999-04-26 13:25:08 +00:00
Jim Meyering
22cce6dadc (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.
Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 13:22:23 +00:00
Jim Meyering
82893aff55 (make_node_op_equals, mode_compile, mode_create_from_ref, mode_adjust):
Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
modechange.h now includes sys/types.h.
Include xstrtol.h.
(isodigit, oatoi): Remove.
(S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP,
S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXU, S_IRWXG,
S_IRWXO): Define if not defined.
(CHMOD_MODE_BITS): New macro.
(mode_compile): Convert from octal with xstrtoul, not our own routine.
1999-04-26 13:19:37 +00:00
Jim Meyering
c262673191 Don't assume traditional Unix mode numbering. 1999-04-26 13:14:36 +00:00
Jim Meyering
d8071546b1 Include <config.h>, <sys/types.h> for mode_t.
(struct mode_change): Members affected and value are now mode_t instead
of unsigned short.
1999-04-26 13:13:59 +00:00
Jim Meyering
d1e59e17e7 <config.h>, <sys/types.h>: Include for mode_t.
(mode_string): Now takes mode_t.
1999-04-26 13:13:36 +00:00
Jim Meyering
9afd1dd692 (make_path): Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
(S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IRWXU): Define if not defined.
1999-04-26 13:13:00 +00:00
Jim Meyering
c1e3742914 (setst, ftypelet, mode_string): Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
(S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH): Define if not defined.
<config.h>, <sys/types.h>: Include for mode_t.
(mode_string): Now takes mode_t.
1999-04-26 13:10:11 +00:00
Jim Meyering
157b3ef61f (main): Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 13:03:49 +00:00
Jim Meyering
73e540ea1b (do_copy, cp_option_init, main): Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 13:03:11 +00:00
Jim Meyering
12dd796d8a (struct cp_options.umask_kill): Use mode_t, not unsigned int. 1999-04-26 12:55:36 +00:00
Jim Meyering
d1c7f62ba8 (copy_reg, copy_internal): Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 12:54:51 +00:00
Jim Meyering
5d76644c3e (describe_change, change_file_mode): Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 12:51:43 +00:00
Jim Meyering
750e5969ff (main): Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 12:49:59 +00:00
Jim Meyering
6fc1cc1b6a (isodigit): Remove unused macro.
(mode, cp_option_init, DIR_MODE): Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 12:49:16 +00:00
Jim Meyering
9e37b40aa1 (S_ISUID, S_ISGID, S_ISVTX, S_IRWXU, S_IRWXG, S_IRWXO):
Define if not defined.
(CHMOD_MODE_BITS): New macro.
1999-04-26 12:48:12 +00:00
Jim Meyering
ebb207dc5a (open_maybe_create): Don't pass 0666 to open; it's not needed and isn't
guaranteed to be portable.
1999-04-26 12:47:33 +00:00
Jim Meyering
d0eeabbc32 Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 12:20:54 +00:00
Jim Meyering
259838277b Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 12:20:26 +00:00
Jim Meyering
0b6ee7158e Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 12:19:37 +00:00
Jim Meyering
3baa7fa854 (main): Revert last change.
Instead, loop on `optind < argc' to protect use of argv[optind].
1999-04-26 02:19:51 +00:00
Jim Meyering
0d13ededce revert last change 1999-04-26 02:18:09 +00:00
Jim Meyering
a3a4a31c22 . 1999-04-26 00:40:42 +00:00
Jim Meyering
bf73dd5297 (main): Handle the case in which seq is given no args. 1999-04-26 00:39:47 +00:00
Jim Meyering
6002b5a2ed *** empty log message *** 1999-04-25 19:20:40 +00:00
Jim Meyering
1c9a7ba541 <inttypes.h>: Include it here instead.
<config.h>: Include it here too.
1999-04-25 19:20:18 +00:00
Jim Meyering
e3a368948e Don't include inttypes.h here. 1999-04-25 19:18:55 +00:00
Jim Meyering
12bf2f8f8b [NDEBUG]: Remove definition. 1999-04-25 19:18:20 +00:00
Jim Meyering
d12ba36443 *** empty log message *** 1999-04-25 12:11:52 +00:00
490 changed files with 32124 additions and 26511 deletions

View File

@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

View File

@@ -11,33 +11,57 @@ maintainer-check:
$(MAKE) distcheck
$(MAKE) my-distcheck
prev-version := $(shell echo $(VERSION)|tr a-z Xa-y)
tag-package = $(shell echo "$(PACKAGE)" | tr a-z A-Z)
tag-this-version = $(subst .,_,$(VERSION))
tag-prev-version = $(subst .,_,$(prev-version))
this-cvs-tag = $(tag-package)-$(tag-this-version)
prev-cvs-tag = $(tag-package)-$(tag-prev-version)
# Verify that all source files using _() are listed in po/POTFILES.in.
po-check:
grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1
grep -E -l '\b_\(' lib/*.c src/*.c | sort > $@-2
diff -u $@-1 $@-2
rm -f $@-1 $@-2
# Tag before making distribution. Also, don't make a distribution if
# checks fail. Also, make sure the NEWS file is up-to-date.
# FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
cvs-dist: maintainer-check
pkg=`echo "$(PACKAGE)" | tr a-z A-Z`; \
ver=`echo "$(VERSION)" | sed 's/\./_/g'`; \
tag="$$pkg-$$ver"; \
echo tag=$$tag; \
if cvs -n log -h README| grep -e $$tag: > /dev/null; then \
echo $(this-cvs-tag); \
if cvs -n log -h README| grep -e $(this-cvs-tag): > /dev/null; then \
echo "VERSION not new; not tagging" 1>&2; \
exit 1; \
fi; \
cvs update po; \
cvs tag -c $$tag
cvs tag -c $(this-cvs-tag)
$(MAKE) dist
# Use this to make sure we don't run these programs when building
# from a virgin tgz file, below.
null_AM_MAKEFLAGS = \
ACLOCAL=false \
AUTOCONF=false \
AUTOMAKE=false \
AUTOHEADER=false \
MAKEINFO=false
t=./=test
my-distcheck:
my-distcheck: writable-files po-check
-rm -rf $(t)
mkdir $(t)
GZIP=$(GZIP) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
# Removing $(DEPDIR) like this is a gross kludge to work around a bug
# in automake. Remove that line once it's fixed.
cd $(t)/$(distdir) \
&& ./configure --disable-nls \
&& $(MAKE) CFLAGS='-Wformat -Werror' \
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
&& $(MAKE) dvi \
&& $(MAKE) check \
&& $(MAKE) distclean
&& $(MAKE) distclean \
&& rm -rf $(DEPDIR)
cd $(t) && mv $(distdir) $(distdir).old \
&& $(AMTAR) -zxf ../$(distdir).tar.gz
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
@@ -48,24 +72,21 @@ my-distcheck:
THIS_VERSION_REGEXP = $(subst .,\.,$(VERSION))
# FIXME: this works only for Gnits-style test releases.
PREV_VERSION := $(shell echo $(VERSION)|tr a-z Xa-y)
PREV_VERSION := $(shell echo $(VERSION)|tr b-z a-y|sed 's/a$$//')
PREV_VERSION_REGEXP := $(shell echo $(PREV_VERSION)|sed 's/\./\\./g')
v = Version
a_host=alpha.gnu.org
b_host=tug.org
c_host=ftp.enst.fr
a_host = alpha.gnu.org
b_host = tug.org
a_url_dir=gnu/fetish
b_url_dir=gnu/fetish
c_url_dir=pub/gnu/gnits/fetish
alpha_subdir = gnu/fetish
a_url_dir = $(alpha_subdir)
b_url_dir = $(alpha_subdir)
a_real_dir=/fs/share/ftp/gnu/fetish
b_real_dir=/home/ftp/pub/gnu/fetish
c_real_dir=/pub/gnu/gnits/fetish
a_real_dir = /fs/share/ftp/$(alpha_subdir)
b_real_dir = /home/ftp/pub/$(alpha_subdir)
url_dir_list = $(foreach x,a b c,ftp://$($(x)_host)/$($(x)_url_dir))
real_dir_list = $(foreach x,a b c,ftp://$($(x)_host)$($(x)_real_dir))
url_dir_list = $(foreach x,a b,ftp://$($(x)_host)/$($(x)_url_dir))
md5 = $(shell md5sum < $(distdir).tar.gz|sed 's/ -//')
@@ -78,6 +99,10 @@ rel-check:
echo "$(md5) -" > $$md5_tmp; \
md5sum -c $$md5_tmp < $$tarz
release-archive-dir = ../release
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
announcement: NEWS ChangeLog $(distdir).tar.gz
@( \
echo Subject: $(distdir) released; \
@@ -88,6 +113,12 @@ announcement: NEWS ChangeLog $(distdir).tar.gz
echo " $$url/$(distdir).tar.gz"; \
done; \
echo; \
echo And here are xdelta-style diffs; \
echo; \
for url in $(url_dir_list); do \
echo " $$url/$(xd-delta)"; \
done; \
echo; \
echo "$(md5) $(distdir).tar.gz"; \
echo; \
echo NEWS:; \
@@ -95,19 +126,35 @@ announcement: NEWS ChangeLog $(distdir).tar.gz
| grep -v '^\['; \
echo; \
echo ChangeLog entries:; \
sed -n "1,/$v $(PREV_VERSION_REGEXP)/p" \
ChangeLog; \
find . -name ChangeLog \
| xargs cvs diff -up -r$(prev-cvs-tag) -rHEAD \
| sed -n 's/^+//p' \
| perl -ne 'm!^\+\+ (\./)?! or print,next;' \
-e 'print "\n"."*"x70 ."\n"; s///; print; print "*"x70 ."\n"'; \
)
alpha:
writable-files:
for file in $(distdir).tar.gz $(xd-delta) \
../release/$(distdir).tar.gz ../release/$(xd-delta); do \
test -e $$file || continue; \
test -w $$file \
|| { echo ERROR: $$file is not writable; fail=1; }; \
done; \
test "$$fail" && exit 1 || :
alpha: writable-files po-check
$(MAKE) cvs-dist
$(MAKE) -s announcement > /tmp/announcement
$(MAKE) -s announcement > /tmp/announce-$(distdir)
ln $(distdir).tar.gz ../release
chmod a-w $(distdir).tar.gz
cd $(release-archive-dir) \
&& xdelta delta -9 $(prev-tgz) $(distdir).tar.gz $(xd-delta) || :
ln $(release-archive-dir)/$(xd-delta) .
chmod a-w $(release-archive-dir)/$(xd-delta)
@echo =====================================
@for url in $(real_dir_list); do \
echo "ncftp -u $$url/"; \
done
@echo '# put $(distdir).tar.gz'
@echo =====================================
@echo 'scp $(xd-delta) $(distdir).tar.gz \'
@echo ' $(b_host):$(b_real_dir)'
@echo '# send the /tmp/announcement e-mail'
@echo =====================================
@echo =====================================

339
THANKS
View File

@@ -1,80 +1,265 @@
This is just a start at listing e-mail addresses of contributors.
The rest of the addresses are still in the ChangeLog.
Achim Blumensath: blume@corona.oche.de
aldomel: aldomel@ix.netcom.com
Alen Muzinic: zveki@fly.cc.fer.hr
Akim Demaille: demaille@inf.enst.fr
Alain Magloire: alain@qnx.com
Alexey Solovyov: alekso@math.uu.se
Andreas Jaeger: jaeger@gnu.org
Andreas Schwab: schwab@issan.informatik.uni-dortmund.de
Andrew Dalke: dalke@bioreason.com
Andrew Tridgell: tridge@samba.org
Andries Brouwer: Andries.Brouwer@cwi.nl
Arne Henrik Juul: arnej@imf.unit.no
Bauke Jan Douma: bjdouma@xs4all.nl
Bengt Martensson: bengt@mathematik.uni-Bremen.de
Bernd Leibing: bernd.leibing@rz.uni-ulm.de
Bjorn Helgaas: helgaas@rsn.hp.com
Bob McCracken: kerouac@ravenet.com
Brendan O'Dea: bod@compusol.com.au
Charles Karney: karney@pppl.gov
Christian von Roques: roques@pond.sub.org
Colin Plumb: colin@nyx.net
Dirk Lattermann: dlatt@t-online.de
Don Parsons: dparsons@synapse.kent.edu
Eirik Fuller: eirik@netcom.com
Eli Zaretskii: eliz@is.elta.co.il
Emile LeBlanc: leblanc@math.toronto.edu
François Pinard: pinard@iro.umontreal.ca
Galen Hazelwood: galenh@micron.net
Göran Uddeborg: goeran@uddeborg.pp.se
Greg McGary: gkm@eng.ascend.com
Hugh Daniel: hugh@xanadu.com
James: james@albion.glarp.com
James Antill: jmanti%essex.ac.uk@seralph21.essex.ac.uk
James Tanis: jtt@soscorp.com
Jamie Lokier: jamie@imbolc.ucc.ie
Janos Farkas: chexum@shadow.banki.hu
Jesse Thilo: jgt2@eecs.lehigh.edu
Joakim Rosqvist: dvljrt@cs.umu.se
Johan Danielsson: joda@pdc.kth.se
John Bley: jbb6@acpub.duke.edu
John Gatewood Ham: zappaman@alphabox.compsci.buu.ac.th
John Gotts: jgotts@umich.edu
jvogel: jvogel@linkny.com
Karl Heuer: kwzh@gnu.org
Kjetil Torgrim Homme: kjetilho@ifi.uio.no
Larry McVoy: lm@sgi.com
Lars Hecking: lhecking@nmrc.ucc.ie
Lorne Baker: lbaker@nitro.avint.net
Marcus Daniels: marcus@sysc.pdx.edu
Mark A. Thomas: thommark@access.digex.net
Mark Harris: mark@monitor.designacc.com
Mark Kettenis: kettenis@phys.uva.nl
Marty Leisner: leisner@sdsp.mc.xerox.com
Masami Takikawa: takikawm@CS.ORST.EDU
Matthew S. Levine: mslevine@theory.lcs.mit.edu
Matthew Swift: swift@alum.mit.edu
Matthias Urlichs: smurf@noris.de
Michiel Bacchiani: bacchian@raven.bu.edu
Miles Bader: miles@gnu.ai.mit.edu
Noel Cragg: noel@red-bean.com
Olav Morkrid: olav@funcom.com
Per Kristian Hove: perhov@math.ntnu.no
Peter Eriksson: peter@ifm.liu.se
Paul Eggert: eggert@twinsun.com
Philippe De Muyter: phdm@macqel.be
Rainer Orth: ro@TechFak.Uni-Bielefeld.DE
Ross Ridge: rridge@calum.csclub.uwaterloo.ca
Santiago Vila Doncel: sanvila@unex.es
Stuart Kemp: skemp@peter.bmc.com
Thomas Bushnell, n/BSG: thomas@gnu.ai.mit.edu
Torbjorn Lindgren: tl@funcom.no
Tony Leneis: tony@plaza.ds.adp.com
Ulrich Drepper: drepper@cygnus.com
Volker Borchert: bt@teknon.de
Michael Veksler: mveksler@techunix.technion.ac.il
Wayne Stewart: wstewa@atl.com
William Bader: william@nscs.fast.net
Achim Blumensath blume@corona.oche.de
Adam Klein aklein@debian.org
Akim Demaille demaille@inf.enst.fr
Alain Magloire alain@qnx.com
Alberto Accomazzi alberto@cfa0.harvard.edu
aldomel aldomel@ix.netcom.com
Alen Muzinic zveki@fly.cc.fer.hr
Alexey Solovyov alekso@math.uu.se
Andre Novaes Cunha Andre.Cunha@br.global-one.net
Andreas Jaeger jaeger@gnu.org
Andreas Luik luik@isa.de
Andreas Schwab schwab@suse.de
Andreas Stolcke stolcke@ICSI.Berkeley.EDU
Andres Soolo andres@soolo.matti.ee
Andrew Burgess aab@cichlid.com
Andrew Dalke dalke@bioreason.com
Andrew Tridgell tridge@samba.org
Andries Brouwer Andries.Brouwer@cwi.nl
Andy Longton alongton@metamark.com
Ariel Faigon ariel@cthulhu.engr.sgi.com
Arne H. Juul arnej@solan.unit.no
Arne Henrik Juul arnej@imf.unit.no
Arthur Pool pool@commerce.uq.edu.au
Austin Donnelly Austin.Donnelly@cl.cam.ac.uk
Bauke Jan Douma bjdouma@xs4all.nl
Bengt Martensson bengt@mathematik.uni-Bremen.de
Bernd Leibing bernd.leibing@rz.uni-ulm.de
Bernhard Rosenkraenzer bero@redhat.de
Bill Peters peters@gaffel.as.arizona.edu
Bjorn Helgaas helgaas@rsn.hp.com
Bob McCracken kerouac@ravenet.com
Bob Proulx rwp@fc.hp.com
Brendan O'Dea bod@compusol.com.au
Brian Kimball bfk@footbag.org
Brian Youmans 3diff@gnu.org
Bruno Haible haible@clisp.cons.org
Carl Johnson carlj@cjlinux.home.org
Carl Lowenstein cdl@mpl.UCSD.EDU
Carlos Canau Carlos.Canau@relay.puug.pt
Charles Karney karney@pppl.gov
Charles Randall crandall@matchlogic.com
Chip Salzenberg chip@valinux.com
Chris Yeo cyeo@biking.org
Christi Alice Scarborough christi@chiark.greenend.org.uk
Christian Krackowizer kra1@technodat.co.at
Christian von Roques roques@pond.sub.org
Chuck Hedrick hedrick@klinzhai.rutgers.edu
Clark Morgan cmorgan@aracnet.com
Colin Plumb colin@nyx.net
Collin Rogowski collin@rogowski.de
Dan Hagerty hag@gnu.ai.it.edu
Daniel Bergstrom noa@melody.se
David Dyck dcd@tc.fluke.COM
David Godfrey dave@delta.demon.co.uk
Dennis Henriksen opus@flamingo.osrl.dk
Derek Clegg dclegg@next.com
Dick Streefland dick_streefland@tasking.com
Dirk Lattermann dlatt@t-online.de
Dirk-Jan Faber djfaber@snow.nl
Don Parsons dparsons@synapse.kent.edu
Donni Erpel donald@appc11.gsi.de
Doug McLaren dougmc@comco.com
Dragos Harabor dharabor@us.oracle.com
Ed Avis epa98@doc.ic.ac.uk
Edzer Pebesma Edzer.Pebesma@rivm.nl
Eirik Fuller eirik@netcom.com
Eivind eivindt@multinet.no
Eli Zaretskii eliz@is.elta.co.il
Emile LeBlanc leblanc@math.toronto.edu
Eric Backus ericb@lsid.hp.com
Eric G. Miller egm2@jps.net
Erik Bennett bennett@cvo.oneworld.com
Erik Corry erik@kroete2.freinet.de
Felix Lee flee@teleport.com
Fletcher Mattox fletcher@cs.utexas.edu
Florin Iucha fiucha@hsys.mic.ro
Frank T Lofaro ftlofaro@snooks.Egr.UNLV.EDU
François Pinard pinard@iro.umontreal.ca
Fred Fish fnf@ninemoons.com
Gabor Z. Papp gzp@gzp.org.hu
Galen Hazelwood galenh@micron.net
Gary Anderson ganderson@clark.net
Gaël Quéri gqueri@mail.dotcom.fr
Geoff Kuenning geoff@cs.hmc.edu
Geoff Odhner geoff@franklin.com
Gerhard Poul gpoul@gnu.org
Germano Leichsenring germano@jedi.cs.kobe-u.ac.jp
GOTO Masanori gotom@debian.or.jp
Greg McGary gkm@gnu.org
Greg Troxel gdt@bbn.com
Greg Wooledge gawooledge@sherwin.com
Gregory Leblanc gleblanc@cu-portland.edu
Göran Uddeborg goeran@uddeborg.pp.se
H. J. Lu hjl@valinux.com
Hans Verkuil hans@wyst.hobby.nl
Harry Liu rliu@lek.ugcs.caltech.edu
Herbert Xu herbert@gondor.apana.org.au
Holger Berger hberger@ess.nec.de
Hugh Daniel hugh@xanadu.com
Ian Jackson ijackson@chiark.greenend.org.uk
Ian Lance Taylor ian@cygnus.com
Ian Turner vectro@pipeline.com
James james@albion.glarp.com
James Antill jmanti%essex.ac.uk@seralph21.essex.ac.uk
James Sneeringer jvs@ocslink.com
James Tanis jtt@soscorp.com
James Youngman james+usenet@free-lunch.demon.co.uk
Jamie Lokier jamie@imbolc.ucc.ie
Janos Farkas chexum@shadow.banki.hu
Jarkko Hietaniemi jhi@epsilon.hut.fi
Jeff Moore jbm@mordor.com
Jeff Sheinberg jeffsh@erols.com
Jens Schmidt jms@jsds.hamburg.com
Jerome Abela abela@hsc.fr
Jesse Thilo jgt2@eecs.lehigh.edu
Jie Xu xuj@iag.net
Jim Blandy jimb@cyclic.com
Jim Dennis jimd@starshine.org
Joakim Rosqvist dvljrt@cs.umu.se
Jochen Hein jochen@jochen.org
Joe Orton joe@orton.demon.co.uk
Johan Danielsson joda@pdc.kth.se
John Bley jbb6@acpub.duke.edu
John David Anglin dave.anglin@nrc.ca
John Gatewood Ham zappaman@alphabox.compsci.buu.ac.th
John Gotts jgotts@umich.edu
John Kendall kendall@capps.com
John Kodis kodis@acm.org
John Murphy jam@philabs.research.philips.com
John Roll john@panic.harvard.edu
John Salmon johns@mullet.anu.edu.au
John Summerfield summer@OS2.ami.com.au
Joost van Baal joostvb@xs4all.nl
Joseph S. Myers jsm28@cam.ac.uk
jvogel jvogel@linkny.com
Jürgen Fluk louis@dachau.marco.de
Kai-Uwe Rommel rommel@informatik.tu-muenchen.de
Kalle Olavi Niemitalo tosi@stekt.oulu.fi
Kamal Paul Nigam Kamal_Paul_Nigam@gs35.sp.cs.cmu.edu
Karl Heuer kwzh@gnu.org
Karsten Thygesen karthy@kom.auc.dk
Kaveh R. Ghazi ghazi@caip.rutgers.edu
Keith Owens kaos@audio.apana.org.au
Ken Pizzini kenp@halcyon.com
Kjetil Torgrim Homme kjetilho@ifi.uio.no
Kristoffer Rose kris@diku.dk
Larry McVoy lm@sgi.com
Lars Hecking lhecking@nmrc.ucc.ie
Lehti Rami rammer@cs.tut.fi
Leonard N. Zubkoff lnz@dandelion.com
Lorne Baker lbaker@nitro.avint.net
Manas Garg manas@cygsoft.com
Manfred Hollstein manfred@s-direktnet.de
Marc Boucher marc@mbsi.ca
Marc Olzheim marcolz@stack.nl
Marco Franzen Marco.Franzen@Thyron.com
Marcus Daniels marcus@ee.pdx.edu
Mark A. Thomas thommark@access.digex.net
Mark D. Roth roth@uiuc.edu
Mark Harris mark@monitor.designacc.com
Mark Hewitt mhewitt@armature.com
Mark Kettenis kettenis@phys.uva.nl
Mark W. Eichin eichin@cygnus.com
Markus Demleitner msdemlei@auriga.ari.uni-heidelberg.de
Martin martin@dresden.nacamar.de
Martin Hippe martin.hippe@schlund.de
Martin Mitchell martin@debian.org
Martin P.J. Zinser zinser@decus.de
Marty Leisner leisner@sdsp.mc.xerox.com
Masami Takikawa takikawm@CS.ORST.EDU
Mate Wierdl mw@moni.msci.memphis.edu
Matej Vela mvela@public.srce.hr
Matthew Braun matthew@ans.net
Matthew Clarke Matthew_Clarke@mindlink.bc.ca
Matthew S. Levine mslevine@theory.lcs.mit.edu
Matthew Swift swift@alum.mit.edu
Matthias Urlichs smurf@noris.de
Meelis Roos mroos@tartu.cyber.ee
Michael ??? michael@roka.net
Michael Deutschmann michael@talamasca.ocis.net
Michael Hasselberg mikelh@zonta.ping.de
Michael Stone mstone@debian.org
Michael Stutz stutz@dsl.org
Michael Veksler mveksler@techunix.technion.ac.il
Michel Robitaille robitail@IRO.UMontreal.CA
Michiel Bacchiani bacchian@raven.bu.edu
Miles Bader miles@gnu.ai.mit.edu
Minh Tran-Le tranle@intellicorp.com
Morten Welinder terra@diku.dk
Nelson H. F. Beebe beebe@math.utah.edu
Niklas Edmundsson nikke@acc.umu.se
Noah Friedman friedman@splode.com
Noel Cragg noel@red-bean.com
Olav Morkrid olav@funcom.com
Paul Eggert eggert@twinsun.com
Paul Nevai nevai@ops.mps.ohio-state.edu
Paul Sauer paul@alexa.com
Paul Slootman paul@debian.org
Per Cederqvist ceder@lysator.liu.se
Per Kristian Hove perhov@math.ntnu.no
Peter Eriksson peter@ifm.liu.se
Peter Moulder reiter@netspace.net.au
Peter Samuelson psamuels@sampo.creighton.edu
Peter Seebach seebs@taniemarie.solon.com
Phil Richards phil.richards@vf.vodafone.co.uk
Philippe De Muyter phdm@macqel.be
Philippe Schnoebelen Philippe.Schnoebelen@imag.fr
Piergiorgio Sartor sartor@sony.de
Piotr Kwapulinski kwap@univ.gda.pl
Maciej Kwapulinski pikpok@univ.gda.pl
Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Ralf W. Stephan stephan@tmt.de
Ralph Loader loader@maths.ox.ac.uk
Raul Miller moth@magenta.com
Richard Braakman dark@xs4all.nl
Richard J. Rauenzahn rrauenza@hairball.cup.hp.com
Richard Sharman rsharman@magmacom.com
Rick Sladkey jrs@world.std.com
Rik Faith faith@cs.unc.edu
Risto Kankkunen kankkune@lingsoft.fi
Robert H. de Vries robert@and.nl
Rogier Wolff R.E.Wolff@BitWizard.nl
Ronald F. Guilmette rfg@netcom.com
Ross Alexander r.alexander@auckland.ac.nz
Ross Paterson rap@doc.ic.ac.uk
Ross Ridge rridge@calum.csclub.uwaterloo.ca
Sami Farin sfarin@ratol.fi
Samuli Karkkainen Samuli.Karkkainen@hut.fi
Sander van Malssen svm@kozmix.ow.nl
Santiago Vila Doncel sanvila@unex.es
Savochkin Andrey Vladimirovich saw@msu.ru
Scott Lurndal slurn@griffin.engr.sgi.com
Stephen Gildea gildea@x.org
Steve McConnel steve@acadcomp.sil.org
Stuart Kemp skemp@peter.bmc.com
Tadayoshi Funaba tadf@kt.rim.or.jp
Theodore Ts'o tytso@rsts-11.mit.edu
Thomas Bushnell thomas@gnu.ai.mit.edu
Thomas Quinot thomas@Cuivre.FR.EU.ORG
Tim Smithers mouse@dmouse.com.au
Tim Waugh twaugh@redhat
Todd A. Jacobs tjacobs@codegnome.org
Tom Quinn trq@dionysos.thphys.ox.ac.uk
Ton Hospel thospel@mail.dma.be
Tony Leneis tony@plaza.ds.adp.com
Tony Robinson ajr@eng.cam.ac.uk
Torbjorn Granlund tege@nada.kth.se
Torbjorn Lindgren tl@funcom.no
Torsten Landschoff torsten@pclab.ifg.uni-kiel.de
Ulrich Drepper drepper@gnu.org
Urs Thuermann urs@isnogud.escape.de
Vin Shelton acs@alumni.princeton.edu
Volker Borchert bt@teknon.de
Wayne Stewart wstewa@atl.com
Wichert Akkerman wichert@cistron.nl
Will Edgington wedgingt@acm.org
William Bader william@nscs.fast.net
William Dowling will@franklin.com
William Lewis wiml@omnigroup.com
Wolfram Kleff kleff@cs.uni-bonn.de
Zvi Har'El rl@math.technion.ac.il
Ørn E. Hansen oehansen@daimi.aau.dk

View File

@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -57,18 +55,26 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
FESETROUND_LIBM = @FESETROUND_LIBM@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
GLIBC21 = @GLIBC21@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@@ -79,20 +85,31 @@ INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
KMEM_GROUP = @KMEM_GROUP@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIB_CRYPT = @LIB_CRYPT@
LIB_NANOSLEEP = @LIB_NANOSLEEP@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MVDIR_PROG = @MVDIR_PROG@
NEED_SETGID = @NEED_SETGID@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
PERL = @PERL@
POFILES = @POFILES@
POSUB = @POSUB@
POW_LIBM = @POW_LIBM@
RANLIB = @RANLIB@
SQRT_LIBM = @SQRT_LIBM@
U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
YACC = @YACC@
install_sh = @install_sh@
l = @l@
@@ -109,6 +126,7 @@ EXTRA_DIST = perm.texi getdate.texi
# and those names all map to one 14-byte name (<package>.info-) on some crufty
# old systems.
MAKEINFO = makeinfo --no-split
subdir = doc
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
@@ -130,7 +148,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -214,7 +232,7 @@ install-info-am: $(INFO_DEPS)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
d=$(srcdir); \
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
@@ -235,8 +253,8 @@ uninstall-info:
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file"; \
install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \
install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file; \
done; \
else :; fi
@$(NORMAL_UNINSTALL)
@@ -252,9 +270,8 @@ dist-info: $(INFO_DEPS)
list='$(INFO_DEPS)'; \
for base in $$list; do \
d=$(srcdir); \
for file in `cd $$d && eval echo $$base*`; do \
for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done; \
done
@@ -265,7 +282,7 @@ mostlyclean-aminfo:
fileutils.kys fileutils.ps fileutils.log fileutils.pg \
fileutils.toc fileutils.tp fileutils.tps fileutils.vr \
fileutils.vrs fileutils.op fileutils.tr fileutils.cv \
fileutils.cn
fileutils.cn fileutils.cm fileutils.ov
clean-aminfo:
@@ -284,25 +301,18 @@ TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = doc
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits doc/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
info-am: $(INFO_DEPS)
info: info-am
@@ -340,6 +350,7 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-rm -f Makefile.in
mostlyclean-am: mostlyclean-vti mostlyclean-aminfo mostlyclean-generic
mostlyclean: mostlyclean-am

View File

@@ -44,11 +44,11 @@ midnight, 1 January 1970 UCT.
@menu
* General date syntax:: Common rules.
* Calendar date item:: 19 Dec 1994.
* Time of day item:: 9:20pm.
* Time zone item:: EST, DST, BST, UTC, ...
* Day of week item:: Monday and others.
* Relative item in date strings:: next tuesday, 2 years ago.
* Calendar date items:: 19 Dec 1994.
* Time of day items:: 9:20pm.
* Time zone items:: EST, DST, BST, UTC, ...
* Day of week items:: Monday and others.
* Relative items in date strings:: next tuesday, 2 years ago.
* Pure numbers in date strings:: 19931219, 1440.
* Authors of getdate:: Bellovin, Salz, Berets, et al.
@end menu
@@ -103,8 +103,8 @@ nested. Hyphens not followed by a digit are currently ignored. Leading
zeros on numbers are ignored.
@node Calendar date item
@section Calendar date item
@node Calendar date items
@section Calendar date items
@cindex calendar date item
@@ -113,13 +113,14 @@ specified differently, depending on whether the month is specified
numerically or literally. All these strings specify the same calendar date:
@example
1970-09-17 # ISO 8601.
70-9-17 # This century assumed by default.
70-09-17 # Leading zeros are ignored.
9/17/72 # Common U.S. writing.
1972-09-24 # ISO 8601.
72-9-24 # Assume 19xx for 69 through 99,
# 20xx for 00 through 68.
72-09-24 # Leading zeros are ignored.
9/24/72 # Common U.S. writing.
24 September 1972
24 Sept 72 # September has a special abbreviation.
24 Sep 72 # Three-letter abbreviations always allowed.
24 Sept 72 # September has a special abbreviation.
24 Sep 72 # Three-letter abbreviations always allowed.
Sep 24, 1972
24-sep-72
24sep72
@@ -129,8 +130,8 @@ The year can also be omitted. In this case, the last specified year is
used, or the current year if none. For example:
@example
9/17
sep 17
9/24
sep 24
@end example
Here are the rules.
@@ -141,8 +142,9 @@ For numeric months, the ISO 8601 format
@samp{@var{year}-@var{month}-@var{day}} is allowed, where @var{year} is
any positive number, @var{month} is a number between 01 and 12, and
@var{day} is a number between 01 and 31. A leading zero must be present
if a number is less than ten. If @var{year} is less than 100, then 1900
is added to it to force a date in this century. The construct
if a number is less than ten. If @var{year} is 68 or smaller, then 2000
is added to it; otherwise, if @var{year} is less than 100,
then 1900 is added to it. The construct
@samp{@var{month}/@var{day}/@var{year}}, popular in the United States,
is accepted. Also @samp{@var{month}/@var{day}}, omitting the year.
@@ -172,8 +174,8 @@ Or, omitting the year:
@end example
@node Time of day item
@section Time of day item
@node Time of day items
@section Time of day items
@cindex time of day item
@@ -222,8 +224,8 @@ Either @samp{am}/@samp{pm} or a time zone correction may be specified,
but not both.
@node Time zone item
@section Time zone item
@node Time zone items
@section Time zone items
@cindex time zone item
@@ -342,8 +344,8 @@ may be specified.
@end table
@node Day of week item
@section Day of week item
@node Day of week items
@section Day of week items
@cindex day of week item
@@ -369,8 +371,8 @@ the day that @var{day} by itself would represent.
A comma following a day of the week item is ignored.
@node Relative item in date strings
@section Relative item in date strings
@node Relative items in date strings
@section Relative items in date strings
@cindex relative items in date strings
@cindex displacement of dates
@@ -422,12 +424,12 @@ one day in the past (equivalent to @samp{day ago}).
The strings @samp{now} or @samp{today} are relative items corresponding
to zero-valued time displacement, these strings come from the fact
a zero-valued time displacement represents the current time when not
otherwise change by previous items. They may be used to stress other
otherwise changed by previous items. They may be used to stress other
items, like in @samp{12:00 today}. The string @samp{this} also has
the meaning of a zero-valued time displacement, but is preferred in
date strings like @samp{this thursday}.
When a relative item makes the resulting date to cross the boundary
When a relative item causes the resulting date to cross the boundary
between DST and non-DST (or vice-versa), the hour is adjusted according
to the local time.
@@ -437,11 +439,11 @@ to the local time.
@cindex pure numbers in date strings
The precise intepretation of a pure decimal number is dependent of
The precise intepretation of a pure decimal number depends
the context in the date string.
If the decimal number is of the form @var{yyyy}@var{mm}@var{dd} and no
other calendar date item (@pxref{Calendar date item}) appears before it
other calendar date item (@pxref{Calendar date items}) appears before it
in the date string, then @var{yyyy} is read as the year, @var{mm} as the
month number and @var{dd} as the day of the month, for the specified
calendar date.

View File

@@ -342,7 +342,7 @@ og+rX-w
gives users other than the owner of the file read permission and, if
it is a directory or if someone already had execute permission
to it, gives them execute permission; and it also denies them write
permission to it file. It does not affect the permission that the
permission to the file. It does not affect the permission that the
owner of the file has for it. The above mode is equivalent to
the two modes:
@@ -430,7 +430,7 @@ the file to all users.
@cindex numeric modes
@cindex file permissions, numeric
@cindex octal numbers for file modes
File permissions are stored internally as 16 bit integers. As an
File permissions are stored internally as integers. As an
alternative to giving a symbolic mode, you can give an octal (base 8)
number that corresponds to the internal representation of the new mode.
This number is always interpreted in octal; you do not have to add a
@@ -440,12 +440,13 @@ A numeric mode is usually shorter than the corresponding symbolic
mode, but it is limited in that it can not take into account a file's
previous permissions; it can only set them absolutely.
The permissions granted to the user, to other users in the file's group,
On most systems, the permissions granted to the user,
to other users in the file's group,
and to other users not in the file's group are each stored as three
bits, which are represented as one octal digit. The three special
permissions are also each stored as one bit, and they are as a group
represented as another octal digit. Here is how the bits are arranged
in the 16 bit integer, starting with the lowest valued bit:
represented as another octal digit. Here is how the bits are arranged,
starting with the lowest valued bit:
@example
Value in Corresponding

View File

@@ -34,6 +34,7 @@ START-INFO-DIR-ENTRY
* factor: (sh-utils)factor invocation. Print prime factors
* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
* groups: (sh-utils)groups invocation. Print group names a user is in.
* hostid: (sh-utils)hostid invocation. Print numeric host identifier.
* hostname: (sh-utils)hostname invocation. Print or set system name.
* id: (sh-utils)id invocation. Print real/effective uid/gid.
* logname: (sh-utils)logname invocation. Print current login name.
@@ -320,6 +321,21 @@ the @var{format} string.
and @samp{\xhhh} as a hexadecimal number (if @var{hhh} is 1 to 3 hex
digits) specifying a character to print.
@kindex \uhhhh
@kindex \Uhhhhhhhh
@code{printf} interprets two character syntaxes introduced in ISO C 99:
@samp{\u} for 16-bit Unicode characters, specified as 4 hex digits
@var{hhhh}, and @samp{\U} for 32-bit Unicode characters, specified as 8 hex
digits @var{hhhhhhhh}. @code{printf} outputs the Unicode characters
according to the LC_CTYPE part of the current locale, i.e. depending
on the values of the environment variables @code{LC_ALL}, @code{LC_CTYPE},
@code{LANG}.
The processing of @samp{\u} and @samp{\U} requires a full-featured
@code{iconv} facility. It is activated on systems with glibc 2.2 (or newer),
or when @code{libiconv} is installed prior to the sh-utils. Otherwise the
use of @samp{\u} and @samp{\U} will give an error message.
@kindex \c
An additional escape, @samp{\c}, causes @code{printf} to produce no
further output.
@@ -327,6 +343,41 @@ further output.
The only options are a lone @samp{--help} or
@samp{--version}. @xref{Common options}.
The Unicode character syntaxes are useful for writing strings in a locale
independent way. For example, a string containing the Euro currency symbol
@example
$ /usr/local/bin/printf '\u20AC 14.95'
@end example
will be output correctly in all locales supporting the Euro symbol
(ISO-8859-15, UTF-8, and others). Similarly, a Chinese string
@example
$ /usr/local/bin/printf '\u4e2d\u6587'
@end example
will be output correctly in all chinese locales (GB2312, BIG5, UTF-8, etc).
Note that in these examples, the full pathname of @code{printf} has been
given, to distinguish it from the GNU @code{bash} builtin function
@code{printf}.
For larger strings, you don't need to look up the hexadecimal code values of
each character one by one. ASCII characters mixed with \u escape sequences
is also known as the JAVA source file encoding. You can use GNU recode 3.5c
(or newer) to convert strings to this encoding. Here is how to convert a
piece of text into a shell script which will output this text in a locale-
independent way:
@smallexample
$ LC_CTYPE=zh_CN.big5 /usr/local/bin/printf \
'\u4e2d\u6587\n' > sample.txt
$ recode BIG5..JAVA < sample.txt \
| sed -e "s|^|/usr/local/bin/printf '|" -e "s|$|\\\\n'|" \
> sample.sh
@end smallexample
@node yes invocation
@section @code{yes}: Print a string until interrupted
@@ -366,15 +417,21 @@ pipeline.
@section @code{false}: Do nothing, unsuccessfully
@pindex false
@cindex exit status of @code{true}
@cindex do nothing, unsuccessfully
@cindex failure exit status
@cindex exit status of @code{false}
@code{false} does nothing except return an exit status of 1, meaning
@dfn{failure}. It can be used as a place holder in shell scripts
where an unsuccessful command is needed.
Any arguments are ignored, except for a lone @samp{--help} or
@samp{--version} (@pxref{Common options}).
@code{false} ignores @emph{all} command line arguments, even @samp{--help}
and @samp{--version}, since to do otherwise would change expected
behavior that some programmers may be relying on.
This version of @code{false} is implemented as a C program, and is thus
more secure and faster than a shell script implementation, and may safely
be used as a dummy shell for the purpose of disabling accounts.
@node true invocation
@@ -384,15 +441,20 @@ Any arguments are ignored, except for a lone @samp{--help} or
@cindex do nothing, successfully
@cindex no-op
@cindex successful exit
@cindex exit status of @code{true}
@code{true} does nothing except return an exit status of 0, meaning
@dfn{success}. It can be used as a place holder in shell scripts
where a successful command is needed, although the shell built-in
command @code{:} (colon) may be faster.
command @code{:} (colon) does the same thing faster.
Any arguments are ignored, except for a lone @samp{--help} or
@samp{--version} (@pxref{Common options}).
@code{true} ignores @emph{all} command line arguments, even @samp{--help}
and @samp{--version}, since to do otherwise would change expected
behavior that some programmers may be relying on.
This version of @code{true} is implemented as a C program, and is thus
more secure and faster than a shell script implementation, and may safely
be used as a dummy shell for the purpose of disabling accounts.
@node test invocation
@@ -695,7 +757,7 @@ True if either @var{expr1} or @var{expr2} is true.
@code{expr} evaluates an expression and writes the result on standard
output. Each token of the expression must be a separate argument.
Operands are either numbers or strings. @code{expr} coerces
Operands are either numbers or strings. @code{expr} converts
anything appearing in an operand position to an integer or a string
depending on the operation being applied to it.
@@ -741,7 +803,7 @@ the next sections).
@cindex pattern matching
@cindex regular expression matching
@cindex matching patterns
Perform pattern matching. The arguments are coerced to strings and the
Perform pattern matching. The arguments are converted to strings and the
second is considered to be a (basic, a la GNU @code{grep}) regular
expression, with a @code{^} implicitly prepended. The first argument is
then matched against this regular expression.
@@ -822,7 +884,7 @@ the connectives (next section) have higher.
@kindex -
@cindex addition
@cindex subtraction
Addition and subtraction. Both arguments are coerced to numbers;
Addition and subtraction. Both arguments are converted to numbers;
an error occurs if this cannot be done.
@item * / %
@@ -832,7 +894,7 @@ an error occurs if this cannot be done.
@cindex multiplication
@cindex division
@cindex remainder
Multiplication, division, remainder. Both arguments are coerced to
Multiplication, division, remainder. Both arguments are converted to
numbers; an error occurs if this cannot be done.
@end table
@@ -874,9 +936,9 @@ Return its first argument if neither argument is null or 0, otherwise
@kindex >=
@cindex comparison operators
Compare the arguments and return 1 if the relation is true, 0 otherwise.
@code{==} is a synonym for @code{=}. @code{expr} first tries to coerce
@code{==} is a synonym for @code{=}. @code{expr} first tries to convert
both arguments to numbers and do a numeric comparison; if either
coercion fails, it does a lexicographic comparison.
conversion fails, it does a lexicographic comparison.
@end table
@@ -1165,7 +1227,7 @@ Print all current settings in human-readable form. This option may not
be used in combination with any line settings.
@item -F @var{device}
@itemx --file @var{device}
@itemx --file=@var{device}
@opindex -F
@opindex --file
Set the line opened by the filename specified in @var{device} instead of
@@ -1558,9 +1620,10 @@ values.
Same as:
@c This is too long to write inline.
@example
cread -ignbrk brkint -inlcr -igncr icrnl -ixoff -iuclc -ixany
imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel
nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl
cread -ignbrk brkint -inlcr -igncr icrnl -ixoff
-iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr
-onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0 isig icanon iexten echo echoe echok -echonl
-noflsh -xcase -tostop -echoprt echoctl echoke
@end example
@noindent and also sets all special characters to their default values.
@@ -1576,9 +1639,9 @@ May be negated. If negated, same as @code{raw}.
@opindex raw
Same as:
@example
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr
-icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon
-xcase min 1 time 0
-ignbrk -brkint -ignpar -parmrk -inpck -istrip
-inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany
-imaxbel -opost -isig -icanon -xcase min 1 time 0
@end example
@noindent May be negated. If negated, same as @code{cooked}.
@@ -1722,7 +1785,7 @@ the time value has expired, when @code{-icanon} is set.
@item time @var{n}
@opindex time
Set the number of tenths of a second before reads time out if the min
Set the number of tenths of a second before reads time out if the minimum
number of characters have not been read, when @code{-icanon} is set.
@item ispeed @var{n}
@@ -1748,7 +1811,7 @@ Tell the kernel that the terminal has @var{n} columns. Non-POSIX.
@vindex LINES
@vindex COLUMNS
Print the number of rows and columns that the kernel thinks the
terminal has. (Systems that don't support rows and cols in the kernel
terminal has. (Systems that don't support rows and columns in the kernel
typically use the environment variables @env{LINES} and @env{COLUMNS}
instead; however, GNU @code{stty} does not know anything about them.)
Non-POSIX.
@@ -1763,6 +1826,8 @@ Print the terminal speed.
@item @var{n}
@cindex baud rate, setting
@c FIXME: Is this still true that the baud rate can't be set
@c higher than 38400?
Set the input and output speeds to @var{n}. @var{n} can be one
of: 0 50 75 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600
19200 38400 @code{exta} @code{extb}. @code{exta} is the same as
@@ -2120,6 +2185,7 @@ information.
* date invocation:: Print or set system date and time.
* uname invocation:: Print system information.
* hostname invocation:: Print or set system name.
* hostid invocation:: Print numeric host identifier.
@end menu
@@ -2534,7 +2600,7 @@ date --date='1970-01-01 00:00:01 UTC +5 hours' +%s
@end example
Suppose you had @emph{not} specified time zone information in the example above.
Then, date would have used your computer's idea of the time zone when
Then, @code{date} would have used your computer's idea of the time zone when
interpreting the string. Here's what you would get if you were in
Greenwich, England:
@@ -2654,7 +2720,6 @@ Print the operating system version.
@end table
@node hostname invocation
@section @code{hostname}: Print or set system name
@@ -2677,6 +2742,29 @@ The only options are @samp{--help} and @samp{--version}. @xref{Common
options}.
@node hostid invocation
@section @code{hostid}: Print numeric host identifier.
@pindex hostid
@cindex printing the host identifier
@code{hostid} prints the numeric identifier of the current host
in hexadecimal. This command accepts no arguments.
The only options are @samp{--help} and @samp{--version}.
@xref{Common options}.
For example, here's what it prints on one system I use:
@example
$ hostid
1bac013d
@end example
On that system, the 32-bit quantity happens to be closely
related to the system's Internet address, but that isn't always
the case.
@node Modified command invocation
@chapter Modified command invocation
@@ -2723,6 +2811,34 @@ variable or @code{/bin/sh} if not set, invoked with the @samp{-i} option.
The only options are @samp{--help} and @samp{--version}. @xref{Common
options}.
Here are a few tips to help avoid common problems in using chroot.
To start with a simple example, make @var{command} refer to a statically
linked binary. If you were to use a dynamically linked executable, then
you'd have to arrange to have the shared libraries in the right place under
your new root directory.
For example, if you create a statically linked `ls' executable,
and put it in /tmp/empty, you can run this command as root:
@example
$ chroot /tmp/empty /ls -Rl /
@end example
Then you'll see output like this:
@example
/:
total 1023
-rwxr-xr-x 1 0 0 1041745 Aug 16 11:17 ls
@end example
If you want to use a dynamically linked executable, say @code{bash},
then first run @samp{ldd bash} to see what shared objects it needs.
Then, in addition to copying the actual binary, also copy the listed
files to the required positions under your intended new root directory.
Finally, if the executable requires any other files (e.g., data, state,
device files), copy them into place, too.
@node env invocation
@section @code{env}: Run a command in a modified environment
@@ -3030,7 +3146,7 @@ the values of the command line arguments.
Synopsis:
@example
sleep [@var{number}[smhd]]@dots{}
sleep @var{number}[smhd]@dots{}
@end example
@cindex time units
@@ -3048,6 +3164,10 @@ hours
days
@end table
Historical implementations of @code{sleep} have required that
@var{number} be an integer. However, GNU @code{sleep} accepts
arbitrary floating point numbers.
The only options are @samp{--help} and @samp{--version}. @xref{Common
options}.
@@ -3083,6 +3203,24 @@ numbers from standard input, delimited by newlines, tabs, or spaces.
The only options are @samp{--help} and @samp{--version}. @xref{Common
options}.
The algorithm it uses is not very sophisticated, so for some inputs
@code{factor} runs for a long time. The hardest numbers to factor are
the products of large primes. Factoring the product of the two largest 32-bit
prime numbers takes over 10 minutes of CPU time on a 400MHz Pentium II.
@example
$ p=`echo '4294967279 * 4294967291'|bc`
$ factor $p
18446743979220271189: 4294967279 4294967291
@end example
In contrast, @code{factor} factors the largest 64-bit number in just
over a tenth of a second:
@example
$ factor `echo '2^64-1'|bc`
18446744073709551615: 3 5 17 257 641 65537 6700417
@end example
@node seq invocation
@section @code{seq}: Print numeric sequences
@@ -3094,13 +3232,13 @@ options}.
@code{seq} prints a sequence of numbers to standard output. Synopses:
@example
seq [@var{option}]@dots{} [@var{first} [@var{step}]] @var{last}@dots{}
seq [@var{option}]@dots{} [@var{first} [@var{increment}]] @var{last}@dots{}
@end example
@code{seq} prints the numbers from @var{first} to @var{last} by
@var{step}. By default, @var{first} and @var{step} are both 1, and each
number is printed on its own line. All numbers can be reals, not just
integers.
@var{increment}. By default, @var{first} and @var{increment} are both 1,
and each number is printed on its own line. All numbers can be reals,
not just integers.
The program accepts the following options. Also see @ref{Common options}.
@@ -3111,8 +3249,8 @@ The program accepts the following options. Also see @ref{Common options}.
@opindex --format=@var{format}
@cindex formatting of numbers in @code{seq}
Print all numbers using @var{format}; default @samp{%g}.
@var{format} must contain exactly one of the standarding float output
formats @samp{%e}, @samp{%f}, or @samp{%g}.
@var{format} must contain exactly one of the floating point
output formats @samp{%e}, @samp{%f}, or @samp{%g}.
@item -s @var{string}
@itemx --separator=@var{string}
@@ -3127,6 +3265,95 @@ Print all numbers with the same width, by padding with leading zeroes.
@end table
If you want to use @code{seq} to print sequences of large integer values,
don't use the default @samp{%g} format since it can result in
loss of precision:
@example
$ seq 1000000 1000001
1e+06
1e+06
@end example
Instead, you can use the format, @samp{%1.f},
to print large decimal numbers with no exponent and no decimal point.
@example
$ seq --format=%1.f 1000000 1000001
1000000
1000001
@end example
If you want hexadecimal output, you can use @code{printf}
to perform the conversion:
@example
$ printf %x'\n' `seq -f %1.f 1048575 1024 1050623`
fffff
1003ff
1007ff
@end example
For very long lists of numbers, use xargs to avoid
system limitations on the length of an argument list:
@example
$ seq -f %1.f 1000000 | xargs printf %x'\n' |tail -3
f423e
f423f
f4240
@end example
To generate octal output, use the printf @code{%o} format instead
of @code{%x}. Note however that using printf works only for numbers
smaller than @code{2^32}:
@example
$ printf "%x\n" `seq -f %1.f 4294967295 4294967296`
ffffffff
bash: printf: 4294967296: Numerical result out of range
@end example
On most systems, seq can produce whole-number output for values up to
@code{2^53}, so here's a more general approach to base conversion that
also happens to be more robust for such large numbers. It works by
using @code{bc} and setting its output radix variable, @var{obase},
to @samp{16} in this case to produce hexadecimal output.
@example
$ (echo obase=16; seq -f %1.f 4294967295 4294967296)|bc
FFFFFFFF
100000000
@end example
Be careful when using @code{seq} with a fractional @var{increment},
otherwise you may see surprising results. Most people would expect to
see @code{0.3} printed as the last number in this example:
@example
$ seq -s' ' 0 .1 .3
0 0.1 0.2
@end example
But doesn't happen on most systems because @code{seq} is implemented using
binary floating point arithmetic (via the C @code{double} type) -- which
means some decimal numbers like @code{.1} cannot be represented exactly.
That in turn means some nonintuitive conditions like @code{.1 * 3 > .3}
will end up being true.
To work around that in the above example, use a slightly larger number as
the @var{last} value:
@example
$ seq -s' ' 0 .1 .31
0 0.1 0.2 0.3
@end example
In general, when using an @var{increment} with a fractional part, where
(@var{last} - @var{first}) / @var{increment} is (mathematically) a whole
number, specify a slightly larger (or smaller, if @var{increment} is negative)
value for @var{last} to ensure that @var{last} is the final value printed
by seq.
@node Index
@unnumbered Index

View File

@@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{1999-04-22.19}%
\def\texinfoversion{1999-09-25.10}
%
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
% Free Software Foundation, Inc.
@@ -29,15 +29,15 @@
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
% ftp://ftp.gnu.org/pub/gnu/texinfo.tex
% ftp://ftp.gnu.org/gnu/texinfo.tex
% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
% ftp://tug.org/tex/texinfo.tex
% ftp://ctan.org/macros/texinfo/texinfo.tex
% (and all CTAN mirrors, finger ctan@ctan.org for a list).
% ftp://texinfo.org/tex/texinfo.tex
% ftp://us.ctan.org/macros/texinfo/texinfo.tex
% (and all CTAN mirrors, finger ctan@us.ctan.org for a list).
% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
% The texinfo.tex in any given Texinfo distribution could well be out
% of date, so if that's what you're using, please check.
% There is a small home page for Texinfo at http://texinfo.org/.
% Texinfo has a small home page at http://texinfo.org/.
%
% Send bug reports to bug-texinfo@gnu.org. Please include including a
% complete document in each bug report with which we can reproduce the
@@ -86,14 +86,6 @@
% For @tex, we can use \tabalign.
\let\+ = \relax
% Get ready for pdf.
\newif\ifpdf
\ifx\pdfoutput\undefined\else
\input pdfcolor
\pdfoutput=1
\pdftrue
\fi
\message{Basics,}
\chardef\other=12
@@ -251,7 +243,7 @@
\unvbox\footlinebox
\fi
%
\ifpdf\pdfmkdest{\the\pageno}\fi
\ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
%
\ifcropmarks
\egroup % end of \vbox\bgroup
@@ -607,36 +599,42 @@ where each line of input produces a line of output.}
%}}
\def\needx#1{%
% Go into vertical mode, so we don't make a big box in the middle of a
% Ensure vertical mode, so we don't make a big box in the middle of a
% paragraph.
\par
%
% Don't add any leading before our big empty box, but allow a page
% break, since the best break might be right here.
\allowbreak
\nointerlineskip
\vtop to #1\mil{\vfil}%
%
% TeX does not even consider page breaks if a penalty added to the
% main vertical list is 10000 or more. But in order to see if the
% empty box we just added fits on the page, we must make it consider
% page breaks. On the other hand, we don't want to actually break the
% page after the empty box. So we use a penalty of 9999.
%
% There is an extremely small chance that TeX will actually break the
% page at this \penalty, if there are no other feasible breakpoints in
% sight. (If the user is using lots of big @group commands, which
% almost-but-not-quite fill up a page, TeX will have a hard time doing
% good page breaking, for example.) However, I could not construct an
% example where a page broke at this \penalty; if it happens in a real
% document, then we can reconsider our strategy.
\penalty9999
%
% Back up by the size of the box, whether we did a page break or not.
\kern -#1\mil
%
% Do not allow a page break right after this kern.
\nobreak
% If the @need value is less than one line space, it's useless.
\dimen0 = #1\mil
\dimen2 = \ht\strutbox
\advance\dimen2 by \dp\strutbox
\ifdim\dimen0 > \dimen2
%
% Do a \strut just to make the height of this box be normal, so the
% normal leading is inserted relative to the preceding line.
% And a page break here is fine.
\vtop to #1\mil{\strut\vfil}%
%
% TeX does not even consider page breaks if a penalty added to the
% main vertical list is 10000 or more. But in order to see if the
% empty box we just added fits on the page, we must make it consider
% page breaks. On the other hand, we don't want to actually break the
% page after the empty box. So we use a penalty of 9999.
%
% There is an extremely small chance that TeX will actually break the
% page at this \penalty, if there are no other feasible breakpoints in
% sight. (If the user is using lots of big @group commands, which
% almost-but-not-quite fill up a page, TeX will have a hard time doing
% good page breaking, for example.) However, I could not construct an
% example where a page broke at this \penalty; if it happens in a real
% document, then we can reconsider our strategy.
\penalty9999
%
% Back up by the size of the box, whether we did a page break or not.
\kern -#1\mil
%
% Do not allow a page break right after this kern.
\nobreak
\fi
}
% @br forces paragraph break
@@ -852,123 +850,175 @@ where each line of input produces a line of output.}
\message{pdf,}
% adobe `portable' document format
\newcount\tempnum
\newcount\lnkcount
\newtoks\filename
\newcount\filenamelength
\newcount\pgn
\newtoks\toksA
\newtoks\toksB
\newtoks\toksC
\newtoks\toksD
\newbox\boxA
\newcount\countA
\newif\ifpdf
\newif\ifpdfmakepagedest
\ifpdf
\def\pdfmkdest#1{\pdfdest name{#1@} xyz}
\def\pdfmkpgn#1{#1@}
% Adding outlines to PDF; macros for calculating structure of outlines
% come from Petr Olsak
\def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
\else \csname#1\endcsname \fi}
\def\advancenumber#1{\tempnum=\expnumber{#1}\relax
\advance\tempnum by1
\expandafter\xdef\csname#1\endcsname{\the\tempnum}}
\def\pdfmakeoutlines{{%
\openin 1 \jobname.toc
\ifeof 1\else\bgroup
\closein 1
\def\code##1{##1}
\def\file##1{##1}
\def\TeX##1{TeX}
\def\tt{}
\def\char{char}
\def\samp##1{##1}
\def\kbd##1{##1}
\def\key##1{##1}
\def\rawbackslashxx{\string\\}
\def\chapentry ##1##2##3{}
\def\unnumbchapentry ##1##2{}
\def\secentry ##1##2##3##4{\advancenumber{chap##2}}
\def\unnumbsecentry ##1##2{}
\def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
\def\unnumbsubsecentry ##1##2{}
\def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
\def\unnumbsubsubsecentry ##1##2{}
\input \jobname.toc
\def\chapentry ##1##2##3{%
\pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
\def\unnumbchapentry ##1##2{%
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
\def\secentry ##1##2##3##4{%
\pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
\def\unnumbsecentry ##1##2{%
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
\def\subsecentry ##1##2##3##4##5{%
\pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
\def\unnumbsubsecentry ##1##2{%
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
\def\subsubsecentry ##1##2##3##4##5##6{%
\pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
\def\unnumbsubsubsecentry ##1##2{%
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
\input \jobname.toc
\egroup\fi
}}
\pdfmakeoutlines
\def\makelinks #1,{%
\def\params{#1}\def\E{END}%
\ifx\params\E
\let\nextmakelinks=\relax
\else
\let\nextmakelinks=\makelinks
\ifnum\lnkcount>0,\fi
\picknum{#1}%
\Blue\pdfannotlink attr{/Border [0 0 0]}
goto name{\pdfmkpgn{\the\pgn}}%
#1%
\advance\lnkcount by 1%
\Black\pdfendlink
\fi
\nextmakelinks
}
\def\picknum#1{\expandafter\pn#1}
\def\pn#1{%
\def\p{#1}%
\ifx\p\lbrace
\let\nextpn=\ppn
\else
\let\nextpn=\ppnn
\def\first{#1}
\fi
\nextpn
}
\def\ppn#1{\pgn=#1\gobble}
\def\ppnn{\pgn=\first}
\def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
\def\skipspaces#1{\def\PP{#1}\def\D{|}%
\ifx\PP\D\let\nextsp\relax
\else\let\nextsp\skipspaces
\ifx\p\space\else\addtokens{\filename}{\PP}%
\advance\filenamelength by 1
\fi
\fi
\nextsp}
\def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
\def\pdflink#1{%
\leavevmode\Red
\begingroup
\normalturnoffactive\def\@{@}%
\pdfannotlink
attr{/Border [0 0 0]}%
user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
\endgroup
}
\ifx\pdfoutput\undefined
\pdffalse
\let\pdfmkdest = \gobble
\let\pdfurl = \gobble
\let\endlink = \relax
\let\linkcolor = \relax
\let\pdfmakeoutlines = \relax
\else
\let\pdflink = \gobble
\fi % end \ifpdf
\pdftrue
\pdfoutput = 1
\input pdfcolor
\def\dopdfimage#1#2#3{%
\def\imagewidth{#2}%
\def\imageheight{#3}%
\ifnum\pdftexversion < 14
\pdfimage
\else
\pdfximage
\fi
\ifx\empty\imagewidth\else width \imagewidth \fi
\ifx\empty\imageheight\else height \imageheight \fi
{#1.pdf}%
\ifnum\pdftexversion < 14 \else
\pdfrefximage \pdflastximage
\fi}
\def\pdfmkdest#1{\pdfdest name{#1@} xyz}
\def\pdfmkpgn#1{#1@}
\let\linkcolor = \Cyan
\def\endlink{\Black\pdfendlink}
% Adding outlines to PDF; macros for calculating structure of outlines
% come from Petr Olsak
\def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
\else \csname#1\endcsname \fi}
\def\advancenumber#1{\tempnum=\expnumber{#1}\relax
\advance\tempnum by1
\expandafter\xdef\csname#1\endcsname{\the\tempnum}}
\def\pdfmakeoutlines{{%
\openin 1 \jobname.toc
\ifeof 1\else\bgroup
\closein 1
\indexnofonts
\def\tt{}
% thanh's hack / proper braces in bookmarks
\edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
\edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
%
\def\chapentry ##1##2##3{}
\def\unnumbchapentry ##1##2{}
\def\secentry ##1##2##3##4{\advancenumber{chap##2}}
\def\unnumbsecentry ##1##2{}
\def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
\def\unnumbsubsecentry ##1##2{}
\def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
\def\unnumbsubsubsecentry ##1##2{}
\input \jobname.toc
\def\chapentry ##1##2##3{%
\pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
\def\unnumbchapentry ##1##2{%
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
\def\secentry ##1##2##3##4{%
\pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
\def\unnumbsecentry ##1##2{%
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
\def\subsecentry ##1##2##3##4##5{%
\pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
\def\unnumbsubsecentry ##1##2{%
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
\def\subsubsecentry ##1##2##3##4##5##6{%
\pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
\def\unnumbsubsubsecentry ##1##2{%
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
\input \jobname.toc
\egroup\fi
}}
\def\makelinks #1,{%
\def\params{#1}\def\E{END}%
\ifx\params\E
\let\nextmakelinks=\relax
\else
\let\nextmakelinks=\makelinks
\ifnum\lnkcount>0,\fi
\picknum{#1}%
\startlink attr{/Border [0 0 0]}
goto name{\pdfmkpgn{\the\pgn}}%
\linkcolor #1%
\advance\lnkcount by 1%
\endlink
\fi
\nextmakelinks
}
\def\picknum#1{\expandafter\pn#1}
\def\pn#1{%
\def\p{#1}%
\ifx\p\lbrace
\let\nextpn=\ppn
\else
\let\nextpn=\ppnn
\def\first{#1}
\fi
\nextpn
}
\def\ppn#1{\pgn=#1\gobble}
\def\ppnn{\pgn=\first}
\def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
\def\skipspaces#1{\def\PP{#1}\def\D{|}%
\ifx\PP\D\let\nextsp\relax
\else\let\nextsp\skipspaces
\ifx\p\space\else\addtokens{\filename}{\PP}%
\advance\filenamelength by 1
\fi
\fi
\nextsp}
\def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
\ifnum\pdftexversion < 14
\let \startlink \pdfannotlink
\else
\let \startlink \pdfstartlink
\fi
\def\pdfurl#1{%
\begingroup
\normalturnoffactive\def\@{@}%
\leavevmode\Red
\startlink attr{/Border [0 0 0]}%
user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
% #1
\endgroup}
\def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
\def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
\def\maketoks{%
\expandafter\poptoks\the\toksA|ENDTOKS|
\ifx\first0\adn0
\else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
\else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
\else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
\else
\ifnum0=\countA\else\makelink\fi
\ifx\first.\let\next=\done\else
\let\next=\maketoks
\addtokens{\toksB}{\the\toksD}
\ifx\first,\addtokens{\toksB}{\space}\fi
\fi
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
\next}
\def\makelink{\addtokens{\toksB}%
{\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
\def\pdflink#1{%
\startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
\linkcolor #1\endlink}
\def\mkpgn#1{#1@}
\def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
\fi % \ifx\pdfoutput
\message{fonts,}
% Font-change commands.
@@ -1039,23 +1089,17 @@ where each line of input produces a line of output.}
\setfont\deftt\ttshape{10}{\magstep1}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
% Fonts for indices and small examples (9pt).
% We actually use the slanted font rather than the italic,
% because texinfo normally uses the slanted fonts for that.
% Do not make many font distinctions in general in the index, since they
% aren't very useful.
\setfont\ninett\ttshape{9}{1000}
\setfont\ninettsl\ttslshape{10}{900}
\setfont\indrm\rmshape{9}{1000}
\setfont\indit\itshape{9}{1000}
\setfont\indsl\slshape{9}{1000}
\let\indtt=\ninett
\let\indttsl=\ninettsl
\let\indsf=\indrm
\let\indbf=\indrm
\setfont\indsc\scshape{10}{900}
\font\indi=cmmi9
\font\indsy=cmsy9
% Fonts for indices, footnotes, small examples (9pt).
\setfont\smallrm\rmshape{9}{1000}
\setfont\smalltt\ttshape{9}{1000}
\setfont\smallbf\bfshape{10}{900}
\setfont\smallit\itshape{9}{1000}
\setfont\smallsl\slshape{9}{1000}
\setfont\smallsf\sfshape{9}{1000}
\setfont\smallsc\scshape{10}{900}
\setfont\smallttsl\ttslshape{10}{900}
\font\smalli=cmmi9
\font\smallsy=cmsy9
% Fonts for title page:
\setfont\titlerm\rmbshape{12}{\magstep3}
@@ -1169,11 +1213,12 @@ where each line of input produces a line of output.}
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
\resetmathfonts \setleading{15pt}}
\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
\def\indexfonts{%
\let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
\let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
\let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
\resetmathfonts \setleading{12pt}}
\def\smallfonts{%
\let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
\let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
\let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
\let\tenttsl=\smallttsl
\resetmathfonts \setleading{11pt}}
% Set up the default fonts, so we can use them for creating boxes.
%
@@ -1222,9 +1267,9 @@ where each line of input produces a line of output.}
}
\let\ttfont=\t
\def\samp#1{`\tclose{#1}'\null}
\setfont\smallrm\rmshape{8}{1000}
\font\smallsy=cmsy9
\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
\setfont\keyrm\rmshape{8}{1000}
\font\keysy=cmsy9
\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
\raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
\vbox{\hrule\kern-0.4pt
\hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
@@ -1335,8 +1380,9 @@ where each line of input produces a line of output.}
% a hypertex \special here.
%
\def\uref#1{\douref #1,,,\finish}
\def\douref#1,#2,#3,#4\finish{%
\pdflink{#1}%
\def\douref#1,#2,#3,#4\finish{\begingroup
\unsepspaces
\pdfurl{#1}%
\setbox0 = \hbox{\ignorespaces #3}%
\ifdim\wd0 > 0pt
\unhbox0 % third arg given, show only that
@@ -1344,19 +1390,16 @@ where each line of input produces a line of output.}
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0 > 0pt
\ifpdf
\unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
\else
\unhbox0 % PDF: 2nd arg given, show only it
\else
\unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
\fi
\else
\code{#1}% only url given, so show it
\fi
\fi
%
\ifpdf
\Black\pdfendlink
\fi
}
\endlink
\endgroup}
% rms does not like angle brackets --karl, 17may97.
% So now @email is just like @uref, unless we are pdf.
@@ -1364,12 +1407,13 @@ where each line of input produces a line of output.}
%\def\email#1{\angleleft{\tt #1}\angleright}
\ifpdf
\def\email#1{\doemail#1,,\finish}
\def\doemail#1,#2,#3\finish{%
\pdflink{mailto:#1}%
\def\doemail#1,#2,#3\finish{\begingroup
\unsepspaces
\pdfurl{mailto:#1}%
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
\Black\pdfendlink
}
\endlink
\endgroup}
\else
\let\email=\uref
\fi
@@ -1491,6 +1535,8 @@ where each line of input produces a line of output.}
\global\let\shortcontents = \relax
\fi
%
\ifpdf \pdfmakepagedesttrue \fi
%
\HEADINGSon
}
@@ -2141,15 +2187,18 @@ where each line of input produces a line of output.}
% If so, do nothing. If not, give it an appropriate dimension based on
% current baselineskip.
\ifdim\multitablelinespace=0pt
\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
\global\advance\multitablelinespace by-\ht0
%% strut to put in table in case some entry doesn't have descenders,
%% to keep lines equally spaced
\let\multistrut = \strut
\else
%% FIXME: what is \box0 supposed to be?
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
width0pt\relax} \fi
%% Test to see if parskip is larger than space between lines of
%% table. If not, do nothing.
%% If so, set to same dimension as multitablelinespace.
\else
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
width0pt\relax} \fi
\ifdim\multitableparskip>\multitablelinespace
\global\multitableparskip=\multitablelinespace
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
@@ -2212,6 +2261,7 @@ width0pt\relax} \fi
\let\deftypefn = \relax
\let\deftypefun = \relax
\let\deftypeivar = \relax
\let\deftypeop = \relax
\let\deftypevar = \relax
\let\deftypevr = \relax
\let\defun = \relax
@@ -2355,14 +2405,13 @@ width0pt\relax} \fi
% stuff compared to the main input.
%
\nullfont
\let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
\let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
\let\tensf = \nullfont
% Similarly for index fonts (mostly for their use in
% smallexample)
\let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
\let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
\let\indsf = \nullfont
\let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
\let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
\let\tensf=\nullfont
% Similarly for index fonts (mostly for their use in smallexample).
\let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
\let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
\let\smallsf=\nullfont
%
% Don't complain when characters are missing from the fonts.
\tracinglostchars = 0
@@ -2626,7 +2675,7 @@ width0pt\relax} \fi
\def\@{@}% will be @@ when we switch to @ as escape char.
% Need these in case \tex is in effect and \{ is a \delimiter again.
% But can't use \lbracecmd and \rbracecmd because texindex assumes
% braces and backslashes are used only as delimiters.
% braces and backslashes are used only as delimiters.
\let\{ = \mylbrace
\let\} = \myrbrace
\def\_{{\realbackslash _}}%
@@ -2739,6 +2788,7 @@ width0pt\relax} \fi
\let\url=\indexdummyfont
\let\uref=\indexdummyfont
\let\env=\indexdummyfont
\let\acronym=\indexdummyfont
\let\command=\indexdummyfont
\let\option=\indexdummyfont
\let\file=\indexdummyfont
@@ -2892,7 +2942,7 @@ width0pt\relax} \fi
\def\doprintindex#1{\begingroup
\dobreak \chapheadingskip{10000}%
%
\indexfonts \rm
\smallfonts \rm
\tolerance = 9500
\indexbreaks
%
@@ -3019,7 +3069,11 @@ width0pt\relax} \fi
% The `\ ' here is removed by the implicit \unskip that TeX does as
% part of (the primitive) \par. Without it, a spurious underfull
% \hbox ensues.
\ #2% The page number ends the paragraph.
\ifpdf
\pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
\else
\ #2% The page number ends the paragraph.
\fi
\fi%
\par
\endgroup}
@@ -3187,7 +3241,43 @@ width0pt\relax} \fi
% This counter is funny since it counts through charcodes of letters A, B, ...
\newcount\appendixno \appendixno = `\@
\def\appendixletter{\char\appendixno}
% \def\appendixletter{\char\the\appendixno}
% We do the following for the sake of pdftex, which needs the actual
% letter in the expansion, not just typeset.
\def\appendixletter{%
\ifnum\appendixno=`A A%
\else\ifnum\appendixno=`B B%
\else\ifnum\appendixno=`C C%
\else\ifnum\appendixno=`D D%
\else\ifnum\appendixno=`E E%
\else\ifnum\appendixno=`F F%
\else\ifnum\appendixno=`G G%
\else\ifnum\appendixno=`H H%
\else\ifnum\appendixno=`I I%
\else\ifnum\appendixno=`J J%
\else\ifnum\appendixno=`K K%
\else\ifnum\appendixno=`L L%
\else\ifnum\appendixno=`M M%
\else\ifnum\appendixno=`N N%
\else\ifnum\appendixno=`O O%
\else\ifnum\appendixno=`P P%
\else\ifnum\appendixno=`Q Q%
\else\ifnum\appendixno=`R R%
\else\ifnum\appendixno=`S S%
\else\ifnum\appendixno=`T T%
\else\ifnum\appendixno=`U U%
\else\ifnum\appendixno=`V V%
\else\ifnum\appendixno=`W W%
\else\ifnum\appendixno=`X X%
\else\ifnum\appendixno=`Y Y%
\else\ifnum\appendixno=`Z Z%
% The \the is necessary, despite appearances, because \appendixletter is
% expanded while writing the .toc file. \char\appendixno is not
% expandable, thus it is written literally, thus all appendixes come out
% with the same letter (or @) in the toc without it.
\else\char\the\appendixno
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
% Each @chapter defines this as the name of the chapter.
% page headings and footings can use it. @section does likewise.
@@ -3721,6 +3811,7 @@ width0pt\relax} \fi
\fi
\vfill \eject
\contentsalignmacro % in case @setchapternewpage odd is in effect
\pdfmakeoutlines
\endgroup
\lastnegativepageno = \pageno
\pageno = \savepageno
@@ -3771,7 +3862,7 @@ width0pt\relax} \fi
% See comments in \dochapentry re vbox and related settings
\def\shortchapentry#1#2#3{%
\tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
\tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
}
% Typeset the label for a chapter or appendix for the short contents.
@@ -3779,10 +3870,14 @@ width0pt\relax} \fi
% We could simplify the code here by writing out an \appendixentry
% command in the toc file for appendices, instead of using \chapentry
% for both, but it doesn't seem worth it.
\setbox0 = \hbox{\shortcontrm \putwordAppendix }
\newdimen\shortappendixwidth \shortappendixwidth = \wd0
%
\newdimen\shortappendixwidth
%
\def\shortchaplabel#1{%
% Compute width of word "Appendix", may change with language.
\setbox0 = \hbox{\shortcontrm \putwordAppendix}%
\shortappendixwidth = \wd0
%
% We typeset #1 in a box of constant width, regardless of the text of
% #1, so the chapter titles will come out aligned.
\setbox0 = \hbox{#1}%
@@ -3797,7 +3892,7 @@ width0pt\relax} \fi
}
\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
% Sections.
\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
@@ -3824,24 +3919,24 @@ width0pt\relax} \fi
\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
\begingroup
\chapentryfonts
\tocentry{#1}{\dopageno{#2}}%
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup
\nobreak\vskip .25\baselineskip plus.1\baselineskip
}
\def\dosecentry#1#2{\begingroup
\secentryfonts \leftskip=\tocindent
\tocentry{#1}{\dopageno{#2}}%
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsecentry#1#2{\begingroup
\subsecentryfonts \leftskip=2\tocindent
\tocentry{#1}{\dopageno{#2}}%
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsubsecentry#1#2{\begingroup
\subsubsecentryfonts \leftskip=3\tocindent
\tocentry{#1}{\dopageno{#2}}%
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
% Final typesetting of a toc entry; we use the same \entry macro as for
@@ -4119,7 +4214,7 @@ width0pt\relax} \fi
\def\smalllispx{\begingroup
\def\Esmalllisp{\nonfillfinish\endgroup}%
\def\Esmallexample{\nonfillfinish\endgroup}%
\indexfonts
\smallfonts
\lisp
}
@@ -4135,7 +4230,7 @@ width0pt\relax} \fi
%
\def\smalldisplayx{\begingroup
\def\Esmalldisplay{\nonfillfinish\endgroup}%
\indexfonts \rm
\smallfonts \rm
\display
}
@@ -4152,7 +4247,7 @@ width0pt\relax} \fi
%
\def\smallformatx{\begingroup
\def\Esmallformat{\nonfillfinish\endgroup}%
\indexfonts \rm
\smallfonts \rm
\format
}
@@ -4322,23 +4417,39 @@ width0pt\relax} \fi
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
% @deftypemethod has an extra argument that nothing else does. Sigh.
% Used for @deftypemethod and @deftypeivar.
% #1 is the \E... control sequence to end the definition (which we define).
% #2 is the \...x control sequence for consecutive fns (which we define).
% #3 is the control sequence to call to resume processing.
% #4, delimited by the space, is the class name.
% #4, delimited by a space, is the class name.
% #5 is the method's return type.
%
\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
\parindent=0in
\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
\medbreak
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
\parindent=0in
\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
% Used for @deftypeop. The change from \deftypemethparsebody is an
% extra argument at the beginning which is the `category', instead of it
% being the hardwired string `Method' or `Instance Variable'. We have
% to account for this both in the \...x definition and in parsing the
% input at hand. Thus also need a control sequence (passed as #5) for
% the \E... definition to assign the category name to.
%
\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
\medbreak
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 ##2 ##3 {%
\def#4{##1}%
\begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
\parindent=0in
\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
\medbreak %
@@ -4554,13 +4665,29 @@ width0pt\relax} \fi
\def\defop #1 {\def\defoptype{#1}%
\defopparsebody\Edefop\defopx\defopheader\defoptype}
%
\def\defopheader #1#2#3{%
\def\defopheader#1#2#3{%
\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
\defunargs {#3}\endgroup %
}
% @deftypemethod CLASS RETURN-TYPE METHOD ARG...
% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
%
\def\deftypeop #1 {\def\deftypeopcategory{#1}%
\deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
\deftypeopcategory}
%
% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
\def\deftypeopheader#1#2#3#4{%
\dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
\begingroup
\defname{\defheaderxcond#2\relax$$$#3}
{\deftypeopcategory\ \putwordon\ \code{#1}}%
\deftypefunargs{#4}%
\endgroup
}
% @deftypemethod CLASS TYPE METHOD ARG...
%
\def\deftypemethod{%
\deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
@@ -4709,6 +4836,7 @@ width0pt\relax} \fi
\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
\def\defunx#1 {\errmessage{@defunx in invalid context}}
@@ -4996,7 +5124,14 @@ width0pt\relax} \fi
% @alias.
\def\alias#1=#2{\gdef#1{#2}}
% We need some trickery to remove the optional spaces around the equal
% sign. Just make them active and then expand them all to nothing.
\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
\def\aliasxxx #1{\aliasyyy#1\relax}
\def\aliasyyy #1=#2\relax{\ignoreactivespaces
\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
\expandafter\noexpand\csname#2\endcsname}%
\expandafter\endgroup\next}
\message{cross references,}
@@ -5044,20 +5179,10 @@ width0pt\relax} \fi
% @anchor{NAME} -- define xref target at arbitrary point.
%
{ \catcode`\@ = 11
% From latex.ltx, to make @anchor truely invisible.
\newdimen\@savsk
\newcount\@savsf
\gdef\@bsphack{\relax
\ifhmode \@savsk\lastskip \@savsf\spacefactor \fi
}
\gdef\@esphack{\relax
\ifhmode \spacefactor\@savsf
\ifdim\@savsk>\z@ \ignorespaces \fi
\fi
}
\gdef\anchor#1{\@bsphack \setref{#1}{Ynothing}\@esphack}
}
\newcount\savesfregister
\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
@@ -5067,7 +5192,7 @@ width0pt\relax} \fi
%
\def\setref#1#2{{%
\indexdummies
\ifpdf \pdfmkdest{#1}\fi
\pdfmkdest{#1}%
\dosetq{#1-title}{Ytitle}%
\dosetq{#1-pg}{Ypagenumber}%
\dosetq{#1-snt}{#2}%
@@ -5082,6 +5207,7 @@ width0pt\relax} \fi
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
\def\ref#1{\xrefX[#1,,,,,,,]}
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
\unsepspaces
\def\printedmanual{\ignorespaces #5}%
\def\printednodename{\ignorespaces #3}%
\setbox1=\hbox{\printedmanual}%
@@ -5119,13 +5245,13 @@ width0pt\relax} \fi
\leavevmode
\getfilename{#4}%
\ifnum\filenamelength>0
\pdfannotlink attr{/Border [0 0 0]}%
\startlink attr{/Border [0 0 0]}%
goto file{\the\filename.pdf} name{#1@}%
\else
\pdfannotlink attr{/Border [0 0 0]}%
\startlink attr{/Border [0 0 0]}%
goto name{#1@}%
\fi
\BlueGreen
\linkcolor
\fi
%
\ifdim \wd1 > 0pt
@@ -5147,7 +5273,7 @@ width0pt\relax} \fi
% page 3
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
\fi
\ifpdf \Black\pdfendlink \fi
\endlink
\endgroup}
% \dosetq is the interface for calls from other macros
@@ -5384,6 +5510,8 @@ width0pt\relax} \fi
\xspaceskip\z@skip
\parindent\defaultparindent
%
\smallfonts \rm
%
% Hang the footnote text off the number.
\hang
\textindent{\thisfootno}%
@@ -5398,7 +5526,7 @@ width0pt\relax} \fi
\else\let\next\f@t\fi \next}
\def\f@@t{\bgroup\aftergroup\@foot\let\next}
\def\f@t#1{#1\@foot}
\def\@foot{\strut\egroup}
\def\@foot{\strut\par\egroup}
}%end \catcode `\@=11
@@ -5493,7 +5621,9 @@ width0pt\relax} \fi
% #2 is (optional) width, #3 is (optional) height.
% #4 is just the usual extra ignored arg for parsing this stuff.
\def\imagexxx#1,#2,#3,#4\finish{%
\ifx\pdfoutput\undefined
\ifpdf
\centerline{\dopdfimage{#1}{#2}{#3}}%
\else
% \epsfbox itself resets \epsf?size at each figure.
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
@@ -5514,8 +5644,6 @@ width0pt\relax} \fi
\epsfbox{#1.eps}%
\fi
\endgroup
\else
\centerline{\pdfimage #1.pdf}%
\fi
}
@@ -5859,6 +5987,6 @@ should work if nowhere else does.}
@c eval: (add-hook 'write-file-hooks 'time-stamp)
@c page-delimiter: "^\\\\message"
@c time-stamp-start: "def\\\\texinfoversion{"
@c time-stamp-format: "%:y-%02m-%02d.%H"
@c time-stamp-format: "%:y-%02m-%02d.%02H"
@c time-stamp-end: "}"
@c End:

File diff suppressed because it is too large Load Diff

10
lib/.cppi-disable Normal file
View File

@@ -0,0 +1,10 @@
error.h
fnmatch.h
getopt.h
getopt.c
getopt1.c
md5.h
obstack.h
regex.h
regex.c
getpagesize.h

View File

@@ -1,8 +1,11 @@
.deps
Makefile
charset.alias
getdate.c
getdate.tab.c
lstat.c
ref-add.sed
ref-del.sed
safe-lstat.c
safe-lstat.h
safe-stat.c

View File

@@ -19,3 +19,201 @@ n
p (he->h_addrtype)
n
q
r a:b
b main
r a:b
n
s
n
p separator
n
l 128
c
q
r meyering:store
p *username
p *username[separator - name]
p separator - name
p username[separator - name]
r ''
l
q
r ''
l
q
r meyering
b main
r meyering
n
r
n
s
n
p u
n
n
q
r ''
r meyering
up
l
q
b main
b a.out 1
r a.out 1
n
s
fin
s
n
p uid
p gid
p euid
p egid
n
p mode
p path
fin
r -v -c 10 -n 20 -x 80 < in-2
up
up
p &dummy
p *ovp
p *(int*)*ovp
p ((struct item*)*ovp)->key
p old_vec@10
r -v -c 10 -n 20 -x 80 < in-3
p *(int*)*ovp
up
dow
p *(int*)*ovp
up
p *(int*)*ovp
i loca
dow
p key
p dummy
p &dummy
up
p old_vec
p *ovp
p ovp
p ovp - old_vec
p *old_vec@10
p *old_vec@13
b hash_insert_item
r
b hash_insert_item_at
r
n
p fail
p *(ht->vec)@13
p *(ht->ht_vec)@13
p ((struct item*)(ht->ht_vec)[10])->key
b hash_delete_item
b hash_delete_item_at
c
n
p slot
p item
n
n
p *(ht->ht_vec)@13
p &dummy
p dummy
n
s
n
n
p *(ht->ht_vec)@13
n
p new_size
n
p *old_vec@13
p old_vec@13
n
p *old_vec@13
n
p *old_vec@13
n
l
n
p ovp - old_vec
n
p ovp - old_vec
n
p ovp - old_vec
p *old_vec@13
p &dummy
q
r 444444444444 44444444444
b human_readable
r
n
q
b main
r 444444444444 44444444444
n
p a
p b
r 34343434 3434343434
c
r
n
n
p a
p b
r 343434343 343434343
c
q
b posixtime
r
n
s
n
p len
n
p pair
p len
n
b year
y
c
c
p n
up
p len
q
complete b user
complete b user
complete b pars
b parse_user_spec
r a.b
n
n
p u
n
p u
n
r -r .aa > k
pwd
q
b main
r
b get_date
c
n
p tm
n
p tm
n
p pc
n
p tm
n
p tm
n
p delta
n
p Start
q

575
lib/ChangeLog Normal file
View File

@@ -0,0 +1,575 @@
2000-06-17 Bruno Haible <haible@clisp.cons.org>
* mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
per change in ../m4/ls-mntd-fs.m4.
(read_filesystem_list): Ignore symbolic links.
2000-06-29 Jim Meyering <meyering@lucent.com>
* same.c: Include <string.h> or <strings.h>, as appropriate,
for declaration of strcmp.
* long-options.c: Include <stdlib.h>, for declaration of exit.
* mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
Avoid warning by casting result to `char *' to remove `const'.
2000-06-17 Bruno Haible <haible@clisp.cons.org>
* Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
2000-06-26 Paul Eggert <eggert@twinsun.com>
savedir now sets errno on failure and invokes xmalloc to get memory.
Fix a couple of other minor bugs while we're at it.
* savedir.c (<unistd.h>): Do not include; there's no need.
(NAMLEN): Remove macro.
(malloc, realloc): Remove decls.
(stpcpy): Likewise.
("xalloc.h"): Include.
(NAME_SIZE_DEFAULT): New macro.
(savedir): Use xmalloc / xrealloc to allocate memory.
Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
Skip "" directory entries.
Use strlen to calculate directory entry length, since the old method
is rarely used these days and isn't worth supporting.
Don't use a pointer after freeing it.
Check for integer overflow when calculating allocation size.
Use memcpy to copy entries, instead of stpcpy.
Set errno properly when returning NULL.
Check for readdir error.
2000-06-26 Jim Meyering <meyering@lucent.com>
* posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
2000-06-17 Bruno Haible <haible@clisp.cons.org>
* getusershell.c (xmalloc, xrealloc): Remove functions.
Include xalloc.h.
Don't include <stdlib.h>. Don't declare malloc, realloc.
2000-06-23 Bruno Haible <haible@clisp.cons.org>
* unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
2000-06-24 Jim Meyering <meyering@lucent.com>
* error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
2000-06-21 Jim Meyering <meyering@lucent.com>
* getpass.c: New file, from Bruno Haible. Required for BeOS.
2000-06-19 Paul Eggert <eggert@twinsun.com>
* quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
(mbrtowc, mbstate_t): Define substitutes if
HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
(iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
2000-06-17 Bruno Haible <haible@clisp.cons.org>
* xgetcwd.c (xgetcwd): If the required pathname length is smaller
than 1024, return a memory chunk of least possible size, instead
of size PATH_MAX + 2. In the loop, increment the size proportionally.
Use free/xmalloc instead of xrealloc to avoid copying for very long
paths.
2000-06-17 Bruno Haible <haible@clisp.cons.org>
* canon-host.c (canon_host): Use malloc and memcpy to copy an
address, not strdup. Include <stdlib.h> and don't declare free().
2000-06-17 Bruno Haible <haible@clisp.cons.org>
* path-concat.c (path_concat): Don't access dir[-1] if dir is
the empty string.
2000-06-21 Jim Meyering <meyering@lucent.com>
* Makefile.am (libfetish_a_SOURCES): Add getstr.c.
(noinst_HEADERS): Add getstr.h.
* getline.c (getstr): Move into a separate file.
* getstr.c (getstr): New file, extracted from getline.c, with
the following changes: new parameter, delim2; both delim[12]
parameters have type `int', not `char'. The latter would lose
with 8-bit delimiters.
* getstr.h: New file.
2000-06-19 Jim Meyering <meyering@lucent.com>
* getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
2000-06-18 Jim Meyering <meyering@lucent.com>
* mkdir.c: Remove file, due mainly to copyright incompatibility.
Besides, these days every porting target provides a mkdir function.
* strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
(this snippet comes from src/system.h).
2000-06-15 Paul Eggert <eggert@twinsun.com>
* human.c (adjust_value): New function.
(human_readable_inexact): Apply rounding style even when
printing approximate values.
2000-06-14 Paul Eggert <eggert@twinsun.com>
* human.c (human_readable_inexact): Allow an input block
size that is not a multiple of the output block size, and vice versa.
Reported by Piergiorgio Sartor.
2000-06-14 Paul Eggert <eggert@twinsun.com>
* getdate.y (get_date): Apply relative times after time
zone indicator, not before. Reported by Todd A. Jacobs.
2000-06-13 Jim Meyering <meyering@lucent.com>
* Makefile.am (all-local): Depend on lstat.c and stat.c.
* xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
2000-06-12 Paul Eggert <eggert@twinsun.com>
* xstat.in: Include <stdlib.h> in lstat, to declare "free".
2000-06-04 Paul Eggert <eggert@twinsun.com>
* strnlen.c: Include <config.h> if HAVE_CONFIG_H.
2000-06-04 Jim Meyering <meyering@lucent.com>
* getugroups.c (getugroups): Cast -1 to gid_t, for systems like
SunOS4.1.4 for which gid_t is an unsigned type.
2000-06-03 Jim Meyering <meyering@lucent.com>
* strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
2000-05-26 Bruno Haible <haible@clisp.cons.org>
* Makefile.am (install-exec-local): On systems with glibc-2.1 or
newer, don't install charset.alias.
* config.charset: Change the Linux/glibc rules so they become empty
on glibc-2.1 or newer.
2000-06-02 Jim Meyering <meyering@lucent.com>
* mountlist.c: Back out last change. Instead, do this...
* mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
member using the same `ignore'-testing code.
* mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
fs_type strings.
From Mark D. Roth.
2000-05-29 Jim Meyering <meyering@lucent.com>
* mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
with the `ignore' attribute. Based on a patch from Mark D. Roth.
2000-05-22 Jim Meyering <meyering@lucent.com>
* makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
2000-05-18 Jim Meyering <meyering@lucent.com>
* hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
back, too, since it may have been modified by allocate_entry.
(hash_delete): Rewrite to use neither the assignment operator
nor the comma operator in an if-expression.
2000-05-15 Paul Eggert <eggert@twinsun.com>
* closeout.c:
<sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
Remove; no longer needed.
"quotearg.h": Add include.
(file_name): Do not bother to explicitly initialize to NULL; it's less
efficient on some hosts.
(close_stdout_status): Remove test as to whether stdout was already
closed; it breaks for the case "echo x | sort >&-".
Quote file name colons.
Do not assume that _("write error") lacks format strings.
2000-05-15 Jim Meyering <meyering@lucent.com>
* version-etc.c (version_etc_copyright): Update the copyright string
used in all --version output.
2000-05-14 Jim Meyering <meyering@lucent.com>
* closeout.c (close_stdout_set_file_name): New function.
(close_stdout_status): Use new file-scoped global.
Return right away if fstat says the stdout file descriptor is invalid.
* closeout.h (close_stdout_set_file_name): Declare.
2000-05-10 Jim Meyering <meyering@lucent.com>
* closeout.c [default_exit_status]: New file-scoped variable.
(close_stdout_set_status): New function.
* closeout.h (close_stdout_set_status): Declare.
2000-05-08 Jim Meyering <meyering@lucent.com>
* long-options.c: Don't include closeout.h.
(parse_long_options): Don't call close_stdout for --version.
2000-05-06 Jim Meyering <meyering@lucent.com>
* strnlen.c: Undefine __strnlen and strnlen.
[!weak_alias]: Define __strnlen to strnlen.
* atexit.c: New file, from libiberty.
2000-05-06 Jim Meyering <meyering@lucent.com>
* closeout.c (close_stdout_status): Also check for errors on the
stderr stream.
2000-05-05 Bruno Haible <haible@clisp.cons.org>
* localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
instead of xmalloc, xrealloc, path_concat.
(locale_charset): Treat empty environment variables as absent.
(DIRECTORY_SEPARATOR, ISSLASH): New macros.
2000-05-04 Jim Meyering <meyering@lucent.com>
* getopt.c: Update from glibc.
* obstack.c: Likewise.
* obstack.h: Likewise.
* regex.c: Likewise. NB: K&R compiler support is dropped for this file
* regex.h: Likewise.
* strndup.c: Likewise.
* strnlen.c: New file, from glibc.
2000-05-01 Jim Meyering <meyering@lucent.com>
* full-write.c (full_write): Remove `FIXME' part of comment.
2000-04-29 Jim Meyering <meyering@lucent.com>
* path-concat.c: Declare strdup only if it's not defined.
* canon-host.c: Likewise.
2000-04-28 Jim Meyering <meyering@lucent.com>
* rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
redefinition warning on some systems (HPUX). Otherwise, regex.h is
included first, then limits.h is included by locale.h by libintl.h.
From John David Anglin.
2000-04-25 Jim Meyering <meyering@lucent.com>
* makepath.c (S_IRWXUGO): Define.
(make_path): Always perform explicit chmod if MODE specifies any
of the `special' permission bits. Prompted by a bug report against
install from Mate Wierdl and Joost van Baal.
2000-04-18 Jim Meyering <meyering@lucent.com>
* README: New file.
* getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
getpagesize. For BeOS. Based on a patch from Bruno Haible.
2000-04-17 Jim Meyering <meyering@lucent.com>
* strftime.c (my_strftime) [strftime]: Declare strftime here, since
the definition of it to rpl_strftime also defined-away the system's
declaration.
2000-04-15 Jim Meyering <meyering@lucent.com>
Use `C' to denote so-called `contiguous' files, the same way
that tar does.
* filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
(ftypelet): Use S_ISCTG.
From Michael Deutschmann.
2000-04-14 Jim Meyering <meyering@lucent.com>
* strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
2000-04-08 Jim Meyering <meyering@lucent.com>
* Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
names don't conflict. Reported by Eli Zaretskii.
2000-03-28 Bruno Haible <haible@clisp.cons.org>
* unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
bug. Deal with the different error behavior of Irix iconv.
2000-04-07 Jim Meyering <meyering@lucent.com>
* putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
to work around system header problems on AIX 3.2.5. From Bruno Haible.
2000-04-05 Jim Meyering <meyering@lucent.com>
Portability tweaks required for ultrix4.3.
* readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
* readutmp.c: Include sys/types.h before sys/stat.h.
* canon-host.c: Declare strdup.
* path-concat.c: Likewise.
From John David Anglin.
2000-04-04 Jim Meyering <meyering@lucent.com>
Be more DOS 8.3-friendly.
* ref-add.sin: Renamed from ref-add.sed.in.
* ref-del.sin: Renamed from ref-del.sed.in.
* Makefile.am: Reflect renaming.
Reported by Eli Zaretskii.
Use a temporary file name that won't clash with `charset.alias'
in the DOS 8.3 name space.
* Makefile.am (charset_tmp): Define.
(install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
(uninstall-local): Likewise.
Reported by Eli Zaretskii.
2000-03-29 Paul Eggert <eggert@twinsun.com>
* time/strftime.c (my_strftime): Make sure we call the system
strftime, not ourselves, when invoking the underlying strftime.
2000-03-24 Jim Meyering <meyering@lucent.com>
* Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
(charset_alias): Define.
(install-exec-local): Factor out common code.
(uninstall-local): Split lines longer than 80.
(ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
(SUFFIXES): Define.
(.sed.in.sed): New rule. Don't redirect directly to $@.
(CLEANFILES): Add ref-add.sed and ref-del.sed.
2000-03-19 Bruno Haible <haible@clisp.cons.org>
* config.charset: Output a line containing "Packages using this file".
* ref-add.sed.in, ref-del.sed.in: New files.
* Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
ref-del.sed): New rules.
2000-03-17 Jim Meyering <meyering@lucent.com>
* unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
Otherwise, include <strings.h>
2000-03-17 Bruno Haible <haible@clisp.cons.org>
* unicodeio.c (utf8_wctomb): New function.
(print_unicode_char): Pass the Unicode character to iconv in UTF-8
format instead of in UCS-4 with platform dependent endianness.
2000-03-07 Paul Eggert <eggert@twinsun.com>
* savedir.c (savedir): Work even if directory size is
negative; this can happen with some screwy NFS configurations.
2000-03-06 Jim Meyering <meyering@lucent.com>
* localcharset.c (get_charset_aliases): Don't try to free file_name
if it's NULL (because we ran out of memory). From Bruno Haible.
2000-03-05 Jim Meyering <meyering@lucent.com>
* localcharset.c ("path-concat.h"): Include.
(get_charset_aliases): Use path_concat instead of ANSI string
concatenation.
* unicodeio.h (PARAMS): Define.
Use it to guard prototype.
2000-03-04 Jim Meyering <meyering@lucent.com>
* Makefile.am (install-exec-local): Create $(libdir) before installing
into it.
(uninstall-local): Uncomment this rule so `make distcheck' works
once again.
* unicodeio.c (<errno.h>): Include it.
(errno): Declare if not defined.
* localcharset.c: Add Bruno's comment justifying use of volatile.
* config.charset: New version, incorporating remarks from a linux
i18n mailing list. From Bruno Haible.
2000-03-02 Jim Meyering <meyering@lucent.com>
* Makefile.am (EXTRA_DIST): Add config.charset.
2000-03-01 Jim Meyering <meyering@lucent.com>
* localcharset.c: Guard some #includes with `#if HAVE_...'.
* unicodeio.c: Likewise.
2000-02-02 Bruno Haible <haible@clisp.cons.org>
* config.charset: New file.
* localcharset.c: New file.
* unicodeio.h, unicodeio.c: New files.
* Makefile.am (DEFS): Add -DLIBDIR=...
(libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
(noinst_HEADERS): Add unicodeio.h.
(all-local, install-exec-local, charset.alias): New targets.
2000-02-28 Paul Eggert <eggert@twinsun.com>
* quotearg.c (ALERT_CHAR): New macro.
(quotearg_buffer_restyled): Use it.
2000-02-27 Jim Meyering <meyering@lucent.com>
* strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
* backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
not `#if STDC_HEADERS'.
Declare malloc if needed.
* backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
now that autoconf always defines the HAVE_DECL_ symbols.
* human.c: Likewise.
* same.c: Likewise.
* strtoumax.c: Likewise.
* backupfile.c: Arrange for cpp to fail if the configure-time
declaration check was not run.
* hash.c: Likewise.
* human.c: Likewise.
* same.c: Likewise.
* strtoumax.c: Likewise.
* userspec.c (parse_user_spec): If there is no `:' but there is a `.',
then first look up the entire `.'-containing string as a login name.
2000-02-18 Paul Eggert <eggert@twinsun.com>
* getdate.y: Handle two-digit years with leading zeros correctly.
(textint): New typedef.
(parser_control): Member year changed from int to textint.
All uses changed.
(YYSTYPE): Removed; replaced by %union with int and textint members.
(tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
(tSNUMBER, tUNUMBER): Now of type <textintval>.
(date, number, to_year): Use width of number in digits, not its value,
to determine whether it's a 2-digit year, or a 2-digit time.
(yylex): Store number of digits of numeric tokens.
Reported by John Kendall.
(parser_control): Changed from struct parser_control to typedef (for
consistency). All uses changed.
(tID): Removed; not used.
(yylex): Return '?' for unknown identifiers, rather than (unused) tID.
2000-02-14 Paul Eggert <eggert@twinsun.com>
* getpagesize.h (getpagesize): Port to VMS for Alpha;
adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
2000-02-12 Jim Meyering <meyering@lucent.com>
* userspec.c (ISDIGIT): Define it.
(isdigit): Remove definition.
(is_number): Use ISDIGIT, not isdigit.
<libintl.h>: Include.
(_ and N_): Define.
(parse_user_spec): Mark translatable strings.
2000-02-10 Jim Meyering <meyering@lucent.com>
With these changes, nanosleep.[ch] are finally enough like the other
lib/* replacement files to compile on a few more losing systems.
* nanosleep.h: Don't include config.h.
Remove prototype from declaration of nanosleep.
(PARAMS): Remove now-unneeded definition.
* nanosleep.c: #undef nanosleep.
(rpl_nanosleep): Rename from nanosleep.
2000-02-03 Jim Meyering <meyering@lucent.com>
* readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
rather than with `#if HAVE_UTMPNAME'.
2000-02-01 Jim Meyering <meyering@lucent.com>
* readutmp.h (UT_USER): Add parens. From Andreas Schwab.
2000-01-31 Jim Meyering <meyering@lucent.com>
* nanosleep.h (nanosleep): Guard declaration with
`#if ! HAVE_DECL_NANOSLEEP'.
Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
the declaration in that vendor's sys/timers.h.
Reported by Christian Krackowizer.
* quotearg.c (ISASCII): Add #undef and move definition to follow
inclusion of wctype.h to work around solaris2.6 namespace pollution.
(ISPRINT): Likewise.
Reported by Tom Tromey.
2000-01-30 Jim Meyering <meyering@lucent.com>
* readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
uses of ->ut_name. The latter doesn't work with new Linux header files
where only utmpx.ut_user is declared.
* readutmp.h (UT_USER): Define.
2000-01-23 Jim Meyering <meyering@lucent.com>
* Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
obstack.c.
2000-01-22 Jim Meyering <meyering@lucent.com>
* strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
[! HAVE_DECL_STRTOULL]: Declare strtoull.
Required for some AIX systems. Reported by Christian Krackowizer.
[TESTING] (main): New function.
1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
* dirname.c (dir_name): Support for DOS-style file names with drive
letters.
* quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
* strverscmp.c (ISDIGIT): Define.
(strverscmp): Use ISDIGIT, not isdigit.
2000-01-17 Paul Eggert <eggert@twinsun.com>
* nanosleep.c (nanosleep):
Don't use SA_INTERRUPT to decide whether to call sigaction, as
POSIX.1 doesn't require SA_INTERRUPT and some systems
(e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
it's been part of POSIX.1 since day 1 (in 1988).
2000-01-17 Jim Meyering <meyering@lucent.com>
* interlock: Remove unused file. Reported by François Pinard.
2000-01-16 Paul Eggert <eggert@twinsun.com>
* quotearg.c (quotearg_buffer_restyled): Do not quote
alert, backslash, formfeed, and vertical tab unnecessarily in
shell quoting style.
Local Variables:
version-control: never
End:

View File

@@ -2,36 +2,103 @@
AUTOMAKE_OPTIONS = ../src/ansi2knr
noinst_LIBRARIES = libfu.a
noinst_LIBRARIES = libfetish.a
INCLUDES = -I.. -I$(srcdir) -I../intl
DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
libfu_a_SOURCES = getdate.y posixtm.c getopt.c getopt1.c \
addext.c argmatch.c backupfile.c basename.c \
closeout.c dirname.c exclude.c filemode.c \
full-write.c human.c idcache.c \
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
quotearg.c safe-read.c save-cwd.c savedir.c stripslash.c userspec.c \
version-etc.c xgetcwd.c xmalloc.c xstrdup.c \
xstrtol.c xstrtoul.c xstrtoumax.c yesno.c
libfetish_a_SOURCES = \
getdate.y posixtm.c addext.c argmatch.c backupfile.c basename.c \
canon-host.c closeout.c diacrit.c dirname.c exclude.c filemode.c \
full-write.c getopt.c getopt1.c getstr.c getugroups.c hard-locale.c hash.c \
human.c idcache.c isdir.c linebuffer.c localcharset.c long-options.c \
makepath.c md5.c memcasecmp.c memcoll.c modechange.c path-concat.c \
quotearg.c readtokens.c safe-read.c same.c save-cwd.c \
savedir.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
xgethostname.c xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c \
xstrtoumax.c yesno.c
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
dirname.h error.h exclude.h filemode.h fnmatch.h fsusage.h \
getdate.h getline.h getopt.h group-member.h human.h lchown.h long-options.h \
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
posixtm.h quotearg.h regex.h safe-read.h save-cwd.h savedir.h strverscmp.h \
version-etc.h xalloc.h xstrtol.h
noinst_HEADERS = \
argmatch.h backupfile.h bumpalloc.h closeout.h diacrit.h dirname.h error.h \
exclude.h filemode.h fnmatch.h fsusage.h getdate.h getline.h getopt.h \
getstr.h getpagesize.h group-member.h hard-locale.h hash.h human.h lchown.h \
linebuffer.h long-options.h md5.h memcasecmp.h memcoll.h \
makepath.h modechange.h mountlist.h nanosleep.h obstack.h \
path-concat.h pathmax.h posixtm.h quotearg.h readtokens.h \
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h \
strverscmp.h unicodeio.h version-etc.h xalloc.h xstrtod.h xstrtol.h
BUILT_SOURCES = getdate.c lstat.c stat.c
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
DISTCLEANFILES = lstat.c stat.c
EXTRA_DIST = xstat.in
EXTRA_DIST = xstat.in config.charset ref-add.sin ref-del.sin
lstat.c: xstat.in
sed -e '/@IGNORE@/d' -e 's/@xstat@/lstat/g' $(srcdir)/xstat.in > $@-t
sed \
-e '/@IGNORE@/d' \
-e 's/@xstat@/lstat/g' \
-e '/_LSTAT_ONLY@/d' \
-e '/@BEGIN_STAT_ONLY@/,/@END_STAT_ONLY@/d' \
$(srcdir)/xstat.in > $@-t
mv $@-t $@
stat.c: xstat.in
sed -e '/@IGNORE@/d' -e 's/@xstat@/stat/g' $(srcdir)/xstat.in > $@-t
sed \
-e '/@IGNORE@/d' \
-e 's/@xstat@/stat/g' \
-e '/_STAT_ONLY@/d' \
-e '/@BEGIN_LSTAT_ONLY@/,/@END_LSTAT_ONLY@/d' \
$(srcdir)/xstat.in > $@-t
mv $@-t $@
# The following is needed in order to install a simple file in $(libdir)
# which is shared with other installed packages. We use a list of referencing
# packages so that "make uninstall" will remove the file if and only if it
# is not used by another installed package.
# On systems with glibc-2.1 or newer, the file is redundant, therefore we
# avoid installing it.
all-local: charset.alias ref-add.sed ref-del.sed lstat.c stat.c
charset_alias = $(DESTDIR)$(libdir)/charset.alias
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
install-exec-local: all-local
$(mkinstalldirs) $(DESTDIR)$(libdir)
if test -f $(charset_alias); then \
sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
rm -f $(charset_tmp) ; \
else \
if test @GLIBC21@ = no; then \
sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
rm -f $(charset_tmp) ; \
fi ; \
fi
uninstall-local: all-local
if test -f $(charset_alias); then \
sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
if grep '^# Packages using this file: $$' $(charset_tmp) \
> /dev/null; then \
rm -f $(charset_alias); \
else \
$(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
fi; \
rm -f $(charset_tmp); \
fi
charset.alias: config.charset
$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
mv t-$@ $@
SUFFIXES = .sed .sin
.sin.sed:
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > $@-t
mv $@-t $@
CLEANFILES = charset.alias ref-add.sed ref-del.sed

View File

@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -57,18 +55,26 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
FESETROUND_LIBM = @FESETROUND_LIBM@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
GLIBC21 = @GLIBC21@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@@ -79,124 +85,174 @@ INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
KMEM_GROUP = @KMEM_GROUP@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIB_CRYPT = @LIB_CRYPT@
LIB_NANOSLEEP = @LIB_NANOSLEEP@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MVDIR_PROG = @MVDIR_PROG@
NEED_SETGID = @NEED_SETGID@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
PERL = @PERL@
POFILES = @POFILES@
POSUB = @POSUB@
POW_LIBM = @POW_LIBM@
RANLIB = @RANLIB@
SQRT_LIBM = @SQRT_LIBM@
U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
YACC = @YACC@
install_sh = @install_sh@
l = @l@
AUTOMAKE_OPTIONS = ../src/ansi2knr
noinst_LIBRARIES = libfu.a
noinst_LIBRARIES = libfetish.a
INCLUDES = -I.. -I$(srcdir) -I../intl
DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
libfu_a_SOURCES = getdate.y posixtm.c getopt.c getopt1.c \
addext.c argmatch.c backupfile.c basename.c \
closeout.c dirname.c exclude.c filemode.c \
full-write.c human.c idcache.c \
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
quotearg.c safe-read.c save-cwd.c savedir.c stripslash.c userspec.c \
version-etc.c xgetcwd.c xmalloc.c xstrdup.c \
xstrtol.c xstrtoul.c xstrtoumax.c yesno.c
libfetish_a_SOURCES = \
getdate.y posixtm.c addext.c argmatch.c backupfile.c basename.c \
canon-host.c closeout.c diacrit.c dirname.c exclude.c filemode.c \
full-write.c getopt.c getopt1.c getstr.c getugroups.c hard-locale.c hash.c \
human.c idcache.c isdir.c linebuffer.c localcharset.c long-options.c \
makepath.c md5.c memcasecmp.c memcoll.c modechange.c path-concat.c \
quotearg.c readtokens.c safe-read.c same.c save-cwd.c \
savedir.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
xgethostname.c xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c \
xstrtoumax.c yesno.c
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
dirname.h error.h exclude.h filemode.h fnmatch.h fsusage.h \
getdate.h getline.h getopt.h group-member.h human.h lchown.h long-options.h \
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
posixtm.h quotearg.h regex.h safe-read.h save-cwd.h savedir.h strverscmp.h \
version-etc.h xalloc.h xstrtol.h
noinst_HEADERS = \
argmatch.h backupfile.h bumpalloc.h closeout.h diacrit.h dirname.h error.h \
exclude.h filemode.h fnmatch.h fsusage.h getdate.h getline.h getopt.h \
getstr.h getpagesize.h group-member.h hard-locale.h hash.h human.h lchown.h \
linebuffer.h long-options.h md5.h memcasecmp.h memcoll.h \
makepath.h modechange.h mountlist.h nanosleep.h obstack.h \
path-concat.h pathmax.h posixtm.h quotearg.h readtokens.h \
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h \
strverscmp.h unicodeio.h version-etc.h xalloc.h xstrtod.h xstrtol.h
BUILT_SOURCES = getdate.c lstat.c stat.c
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
DISTCLEANFILES = lstat.c stat.c
EXTRA_DIST = xstat.in
EXTRA_DIST = xstat.in config.charset ref-add.sin ref-del.sin
charset_alias = $(DESTDIR)$(libdir)/charset.alias
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
SUFFIXES = .sed .sin
CLEANFILES = charset.alias ref-add.sed ref-del.sed
subdir = lib
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
ANSI2KNR = ../src/ansi2knr
am_libfu_a_OBJECTS = getdate$U.o posixtm$U.o getopt$U.o getopt1$U.o \
addext$U.o argmatch$U.o backupfile$U.o basename$U.o closeout$U.o \
dirname$U.o exclude$U.o filemode$U.o full-write$U.o human$U.o \
idcache$U.o isdir$U.o long-options$U.o makepath$U.o modechange$U.o \
hash$U.o path-concat$U.o quotearg$U.o safe-read$U.o save-cwd$U.o \
savedir$U.o stripslash$U.o userspec$U.o version-etc$U.o xgetcwd$U.o \
xmalloc$U.o xstrdup$U.o xstrtol$U.o xstrtoul$U.o xstrtoumax$U.o \
yesno$U.o
libfu_a_OBJECTS = $(am_libfu_a_OBJECTS)
libfetish_a_AR = $(AR) cru
am_libfetish_a_OBJECTS = getdate$U.o posixtm$U.o addext$U.o \
argmatch$U.o backupfile$U.o basename$U.o canon-host$U.o closeout$U.o \
diacrit$U.o dirname$U.o exclude$U.o filemode$U.o full-write$U.o \
getopt$U.o getopt1$U.o getstr$U.o getugroups$U.o hard-locale$U.o \
hash$U.o human$U.o idcache$U.o isdir$U.o linebuffer$U.o \
localcharset$U.o long-options$U.o makepath$U.o md5$U.o memcasecmp$U.o \
memcoll$U.o modechange$U.o path-concat$U.o quotearg$U.o readtokens$U.o \
safe-read$U.o same$U.o save-cwd$U.o savedir$U.o stripslash$U.o \
unicodeio$U.o userspec$U.o version-etc$U.o xgetcwd$U.o xgethostname$U.o \
xmalloc$U.o xstrdup$U.o xstrtod$U.o xstrtol$U.o xstrtoul$U.o \
xstrtoumax$U.o yesno$U.o
libfetish_a_OBJECTS = $(am_libfetish_a_OBJECTS)
AR = ar
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CFLAGS = @CFLAGS@
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libfu_a_SOURCES)
DIST_SOURCES = $(libfetish_a_SOURCES)
HEADERS = $(noinst_HEADERS)
DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in TODO alloca.c \
chown.c error.c error.h euidaccess.c fileblocks.c fnmatch.c fsusage.c \
ftruncate.c getdate.c getgroups.c getline.c group-member.c lchown.c \
lstat.c malloc.c memcmp.c memcpy.c memset.c mkdir.c mktime.c \
mountlist.c obstack.c obstack.h realloc.c regex.c rename.c rmdir.c \
rpmatch.c stat.c stpcpy.c strcasecmp.c strdup.c strftime.c \
strncasecmp.c strndup.c strstr.c strtol.c strtoul.c strtoull.c \
strtoumax.c strverscmp.c utime.c
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = @AMDEP@ $(DEPDIR)/addext$U.Po $(DEPDIR)/alloca.Po \
$(DEPDIR)/argmatch$U.Po $(DEPDIR)/atexit.Po $(DEPDIR)/backupfile$U.Po \
$(DEPDIR)/basename$U.Po $(DEPDIR)/canon-host$U.Po $(DEPDIR)/chown.Po \
$(DEPDIR)/closeout$U.Po $(DEPDIR)/diacrit$U.Po $(DEPDIR)/dirname$U.Po \
$(DEPDIR)/dup2.Po $(DEPDIR)/error.Po $(DEPDIR)/euidaccess.Po \
$(DEPDIR)/exclude$U.Po $(DEPDIR)/fileblocks.Po $(DEPDIR)/filemode$U.Po \
$(DEPDIR)/fnmatch.Po $(DEPDIR)/fsusage.Po $(DEPDIR)/ftruncate.Po \
$(DEPDIR)/full-write$U.Po $(DEPDIR)/getdate$U.Po $(DEPDIR)/getgroups.Po \
$(DEPDIR)/gethostname.Po $(DEPDIR)/getline.Po $(DEPDIR)/getloadavg.Po \
$(DEPDIR)/getopt$U.Po $(DEPDIR)/getopt1$U.Po $(DEPDIR)/getpass.Po \
$(DEPDIR)/getstr$U.Po $(DEPDIR)/getugroups$U.Po \
$(DEPDIR)/getusershell.Po $(DEPDIR)/group-member.Po \
$(DEPDIR)/hard-locale$U.Po $(DEPDIR)/hash$U.Po $(DEPDIR)/human$U.Po \
$(DEPDIR)/idcache$U.Po $(DEPDIR)/isdir$U.Po $(DEPDIR)/lchown.Po \
$(DEPDIR)/linebuffer$U.Po $(DEPDIR)/localcharset$U.Po \
$(DEPDIR)/long-options$U.Po $(DEPDIR)/lstat.Po $(DEPDIR)/makepath$U.Po \
$(DEPDIR)/malloc.Po $(DEPDIR)/md5$U.Po $(DEPDIR)/memcasecmp$U.Po \
$(DEPDIR)/memchr.Po $(DEPDIR)/memcmp.Po $(DEPDIR)/memcoll$U.Po \
$(DEPDIR)/memcpy.Po $(DEPDIR)/memmove.Po $(DEPDIR)/memset.Po \
$(DEPDIR)/mktime.Po $(DEPDIR)/modechange$U.Po $(DEPDIR)/mountlist.Po \
$(DEPDIR)/nanosleep.Po $(DEPDIR)/obstack.Po $(DEPDIR)/path-concat$U.Po \
$(DEPDIR)/posixtm$U.Po $(DEPDIR)/putenv.Po $(DEPDIR)/quotearg$U.Po \
$(DEPDIR)/readtokens$U.Po $(DEPDIR)/readutmp.Po $(DEPDIR)/realloc.Po \
$(DEPDIR)/regex.Po $(DEPDIR)/rmdir.Po $(DEPDIR)/rpmatch.Po \
$(DEPDIR)/safe-read$U.Po $(DEPDIR)/same$U.Po $(DEPDIR)/save-cwd$U.Po \
$(DEPDIR)/savedir$U.Po $(DEPDIR)/stat.Po $(DEPDIR)/stime.Po \
$(DEPDIR)/stpcpy.Po $(DEPDIR)/strcasecmp.Po $(DEPDIR)/strcspn.Po \
$(DEPDIR)/strdup.Po $(DEPDIR)/strftime.Po $(DEPDIR)/stripslash$U.Po \
$(DEPDIR)/strncasecmp.Po $(DEPDIR)/strndup.Po $(DEPDIR)/strnlen.Po \
$(DEPDIR)/strpbrk.Po $(DEPDIR)/strstr.Po $(DEPDIR)/strtod.Po \
$(DEPDIR)/strtol.Po $(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po \
$(DEPDIR)/strtoumax.Po $(DEPDIR)/strverscmp.Po $(DEPDIR)/unicodeio$U.Po \
$(DEPDIR)/userspec$U.Po $(DEPDIR)/utime.Po $(DEPDIR)/version-etc$U.Po \
$(DEPDIR)/xgetcwd$U.Po $(DEPDIR)/xgethostname$U.Po \
$(DEPDIR)/xmalloc$U.Po $(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtod$U.Po \
$(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoul$U.Po \
$(DEPDIR)/xstrtoumax$U.Po $(DEPDIR)/yesno$U.Po
DIST_COMMON = README $(noinst_HEADERS) ChangeLog Makefile.am \
Makefile.in TODO alloca.c atexit.c chown.c dup2.c error.c error.h \
euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c getdate.c \
getgroups.c gethostname.c getline.c getloadavg.c getpass.c \
getusershell.c group-member.c lchown.c malloc.c memchr.c memcmp.c \
memcpy.c memmove.c memset.c mktime.c mountlist.c nanosleep.c obstack.c \
obstack.h putenv.c readutmp.c realloc.c regex.c rmdir.c rpmatch.c \
stime.c stpcpy.c strcasecmp.c strcspn.c strdup.c strftime.c \
strncasecmp.c strndup.c strnlen.c strpbrk.c strstr.c strtod.c strtol.c \
strtoul.c strtoull.c strtoumax.c strverscmp.c utime.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
DEP_FILES = .deps/addext.P .deps/alloca.P .deps/argmatch.P \
.deps/backupfile.P .deps/basename.P .deps/chown.P .deps/closeout.P \
.deps/dirname.P .deps/error.P .deps/euidaccess.P .deps/exclude.P \
.deps/fileblocks.P .deps/filemode.P .deps/fnmatch.P .deps/fsusage.P \
.deps/ftruncate.P .deps/full-write.P .deps/getdate.P .deps/getgroups.P \
.deps/getline.P .deps/getopt.P .deps/getopt1.P .deps/group-member.P \
.deps/hash.P .deps/human.P .deps/idcache.P .deps/isdir.P .deps/lchown.P \
.deps/long-options.P .deps/lstat.P .deps/makepath.P .deps/malloc.P \
.deps/memcmp.P .deps/memcpy.P .deps/memset.P .deps/mkdir.P \
.deps/mktime.P .deps/modechange.P .deps/mountlist.P .deps/obstack.P \
.deps/path-concat.P .deps/posixtm.P .deps/quotearg.P .deps/realloc.P \
.deps/regex.P .deps/rename.P .deps/rmdir.P .deps/rpmatch.P \
.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stat.P \
.deps/stpcpy.P .deps/strcasecmp.P .deps/strdup.P .deps/strftime.P \
.deps/stripslash.P .deps/strncasecmp.P .deps/strndup.P .deps/strstr.P \
.deps/strtol.P .deps/strtoul.P .deps/strtoull.P .deps/strtoumax.P \
.deps/strverscmp.P .deps/userspec.P .deps/utime.P .deps/version-etc.P \
.deps/xgetcwd.P .deps/xmalloc.P .deps/xstrdup.P .deps/xstrtol.P \
.deps/xstrtoul.P .deps/xstrtoumax.P .deps/yesno.P
SOURCES = $(libfu_a_SOURCES)
OBJECTS = $(am_libfu_a_OBJECTS)
SOURCES = $(libfetish_a_SOURCES)
OBJECTS = $(am_libfetish_a_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o .y
.SUFFIXES: .c .o .sed .sin .y
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -234,65 +290,35 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
getdate$U.o:
posixtm$U.o:
getopt$U.o:
getopt1$U.o:
addext$U.o:
argmatch$U.o:
backupfile$U.o:
basename$U.o:
closeout$U.o:
dirname$U.o:
exclude$U.o:
filemode$U.o:
full-write$U.o:
human$U.o:
idcache$U.o:
isdir$U.o:
long-options$U.o:
makepath$U.o:
modechange$U.o:
hash$U.o:
path-concat$U.o:
quotearg$U.o:
safe-read$U.o:
save-cwd$U.o:
savedir$U.o:
stripslash$U.o:
userspec$U.o:
version-etc$U.o:
xgetcwd$U.o:
xmalloc$U.o:
xstrdup$U.o:
xstrtol$U.o:
xstrtoul$U.o:
xstrtoumax$U.o:
yesno$U.o:
libfu.a: $(libfu_a_OBJECTS) $(libfu_a_DEPENDENCIES)
-rm -f libfu.a
$(AR) cru libfu.a $(libfu_a_OBJECTS) $(libfu_a_LIBADD)
$(RANLIB) libfu.a
getdate.o:
lstat.o:
stat.o:
libfetish.a: $(libfetish_a_OBJECTS) $(libfetish_a_DEPENDENCIES)
-rm -f libfetish.a
$(libfetish_a_AR) libfetish.a $(libfetish_a_OBJECTS) $(libfetish_a_LIBADD)
$(RANLIB) libfetish.a
addext_.c: addext.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > addext_.c
alloca_.c: alloca.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c
argmatch_.c: argmatch.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > argmatch_.c
atexit_.c: atexit.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/atexit.c; then echo $(srcdir)/atexit.c; else echo atexit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > atexit_.c
backupfile_.c: backupfile.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/backupfile.c; then echo $(srcdir)/backupfile.c; else echo backupfile.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > backupfile_.c
basename_.c: basename.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > basename_.c
canon-host_.c: canon-host.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/canon-host.c; then echo $(srcdir)/canon-host.c; else echo canon-host.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > canon-host_.c
chown_.c: chown.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/chown.c; then echo $(srcdir)/chown.c; else echo chown.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > chown_.c
closeout_.c: closeout.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > closeout_.c
diacrit_.c: diacrit.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/diacrit.c; then echo $(srcdir)/diacrit.c; else echo diacrit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > diacrit_.c
dirname_.c: dirname.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dirname_.c
dup2_.c: dup2.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dup2.c; then echo $(srcdir)/dup2.c; else echo dup2.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dup2_.c
error_.c: error.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > error_.c
euidaccess_.c: euidaccess.c $(ANSI2KNR)
@@ -315,14 +341,28 @@ getdate_.c: getdate.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getdate.c; then echo $(srcdir)/getdate.c; else echo getdate.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getdate_.c
getgroups_.c: getgroups.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getgroups.c; then echo $(srcdir)/getgroups.c; else echo getgroups.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getgroups_.c
gethostname_.c: gethostname.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gethostname.c; then echo $(srcdir)/gethostname.c; else echo gethostname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gethostname_.c
getline_.c: getline.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getline.c; then echo $(srcdir)/getline.c; else echo getline.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getline_.c
getloadavg_.c: getloadavg.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getloadavg.c; then echo $(srcdir)/getloadavg.c; else echo getloadavg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getloadavg_.c
getopt_.c: getopt.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt_.c
getopt1_.c: getopt1.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt1_.c
getpass_.c: getpass.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getpass.c; then echo $(srcdir)/getpass.c; else echo getpass.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getpass_.c
getstr_.c: getstr.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getstr.c; then echo $(srcdir)/getstr.c; else echo getstr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getstr_.c
getugroups_.c: getugroups.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getugroups.c; then echo $(srcdir)/getugroups.c; else echo getugroups.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getugroups_.c
getusershell_.c: getusershell.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getusershell.c; then echo $(srcdir)/getusershell.c; else echo getusershell.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getusershell_.c
group-member_.c: group-member.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/group-member.c; then echo $(srcdir)/group-member.c; else echo group-member.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > group-member_.c
hard-locale_.c: hard-locale.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hard-locale.c; then echo $(srcdir)/hard-locale.c; else echo hard-locale.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > hard-locale_.c
hash_.c: hash.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > hash_.c
human_.c: human.c $(ANSI2KNR)
@@ -333,6 +373,10 @@ isdir_.c: isdir.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > isdir_.c
lchown_.c: lchown.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lchown.c; then echo $(srcdir)/lchown.c; else echo lchown.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lchown_.c
linebuffer_.c: linebuffer.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/linebuffer.c; then echo $(srcdir)/linebuffer.c; else echo linebuffer.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > linebuffer_.c
localcharset_.c: localcharset.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/localcharset.c; then echo $(srcdir)/localcharset.c; else echo localcharset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > localcharset_.c
long-options_.c: long-options.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/long-options.c; then echo $(srcdir)/long-options.c; else echo long-options.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > long-options_.c
lstat_.c: lstat.c $(ANSI2KNR)
@@ -341,50 +385,70 @@ makepath_.c: makepath.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/makepath.c; then echo $(srcdir)/makepath.c; else echo makepath.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > makepath_.c
malloc_.c: malloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c
md5_.c: md5.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/md5.c; then echo $(srcdir)/md5.c; else echo md5.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > md5_.c
memcasecmp_.c: memcasecmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcasecmp.c; then echo $(srcdir)/memcasecmp.c; else echo memcasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcasecmp_.c
memchr_.c: memchr.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memchr.c; then echo $(srcdir)/memchr.c; else echo memchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memchr_.c
memcmp_.c: memcmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcmp_.c
memcoll_.c: memcoll.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcoll.c; then echo $(srcdir)/memcoll.c; else echo memcoll.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcoll_.c
memcpy_.c: memcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
memmove_.c: memmove.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memmove.c; then echo $(srcdir)/memmove.c; else echo memmove.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memmove_.c
memset_.c: memset.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
mkdir_.c: mkdir.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mkdir.c; then echo $(srcdir)/mkdir.c; else echo mkdir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mkdir_.c
mktime_.c: mktime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mktime_.c
modechange_.c: modechange.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > modechange_.c
mountlist_.c: mountlist.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mountlist.c; then echo $(srcdir)/mountlist.c; else echo mountlist.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mountlist_.c
nanosleep_.c: nanosleep.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/nanosleep.c; then echo $(srcdir)/nanosleep.c; else echo nanosleep.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > nanosleep_.c
obstack_.c: obstack.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > obstack_.c
path-concat_.c: path-concat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > path-concat_.c
posixtm_.c: posixtm.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > posixtm_.c
putenv_.c: putenv.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/putenv.c; then echo $(srcdir)/putenv.c; else echo putenv.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > putenv_.c
quotearg_.c: quotearg.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > quotearg_.c
readtokens_.c: readtokens.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/readtokens.c; then echo $(srcdir)/readtokens.c; else echo readtokens.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > readtokens_.c
readutmp_.c: readutmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/readutmp.c; then echo $(srcdir)/readutmp.c; else echo readutmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > readutmp_.c
realloc_.c: realloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
regex_.c: regex.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c
rename_.c: rename.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rename.c; then echo $(srcdir)/rename.c; else echo rename.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > rename_.c
rmdir_.c: rmdir.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rmdir.c; then echo $(srcdir)/rmdir.c; else echo rmdir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > rmdir_.c
rpmatch_.c: rpmatch.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rpmatch.c; then echo $(srcdir)/rpmatch.c; else echo rpmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > rpmatch_.c
safe-read_.c: safe-read.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/safe-read.c; then echo $(srcdir)/safe-read.c; else echo safe-read.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > safe-read_.c
same_.c: same.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/same.c; then echo $(srcdir)/same.c; else echo same.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > same_.c
save-cwd_.c: save-cwd.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > save-cwd_.c
savedir_.c: savedir.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > savedir_.c
stat_.c: stat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
stime_.c: stime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stime.c; then echo $(srcdir)/stime.c; else echo stime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stime_.c
stpcpy_.c: stpcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c
strcasecmp_.c: strcasecmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strcasecmp_.c
strcspn_.c: strcspn.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strcspn.c; then echo $(srcdir)/strcspn.c; else echo strcspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strcspn_.c
strdup_.c: strdup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strdup_.c
strftime_.c: strftime.c $(ANSI2KNR)
@@ -395,8 +459,14 @@ strncasecmp_.c: strncasecmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strncasecmp.c; then echo $(srcdir)/strncasecmp.c; else echo strncasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strncasecmp_.c
strndup_.c: strndup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strndup_.c
strnlen_.c: strnlen.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strnlen.c; then echo $(srcdir)/strnlen.c; else echo strnlen.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strnlen_.c
strpbrk_.c: strpbrk.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strpbrk.c; then echo $(srcdir)/strpbrk.c; else echo strpbrk.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strpbrk_.c
strstr_.c: strstr.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strstr_.c
strtod_.c: strtod.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtod.c; then echo $(srcdir)/strtod.c; else echo strtod.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtod_.c
strtol_.c: strtol.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtol_.c
strtoul_.c: strtoul.c $(ANSI2KNR)
@@ -407,6 +477,8 @@ strtoumax_.c: strtoumax.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
strverscmp_.c: strverscmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strverscmp.c; then echo $(srcdir)/strverscmp.c; else echo strverscmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strverscmp_.c
unicodeio_.c: unicodeio.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/unicodeio.c; then echo $(srcdir)/unicodeio.c; else echo unicodeio.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > unicodeio_.c
userspec_.c: userspec.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > userspec_.c
utime_.c: utime.c $(ANSI2KNR)
@@ -415,10 +487,14 @@ version-etc_.c: version-etc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/version-etc.c; then echo $(srcdir)/version-etc.c; else echo version-etc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > version-etc_.c
xgetcwd_.c: xgetcwd.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xgetcwd_.c
xgethostname_.c: xgethostname.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xgethostname.c; then echo $(srcdir)/xgethostname.c; else echo xgethostname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xgethostname_.c
xmalloc_.c: xmalloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xmalloc_.c
xstrdup_.c: xstrdup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrdup_.c
xstrtod_.c: xstrtod.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtod.c; then echo $(srcdir)/xstrtod.c; else echo xstrtod.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtod_.c
xstrtol_.c: xstrtol.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtol_.c
xstrtoul_.c: xstrtoul.c $(ANSI2KNR)
@@ -427,19 +503,25 @@ xstrtoumax_.c: xstrtoumax.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoumax.c; then echo $(srcdir)/xstrtoumax.c; else echo xstrtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoumax_.c
yesno_.c: yesno.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > yesno_.c
addext_.o alloca_.o argmatch_.o backupfile_.o basename_.o chown_.o \
closeout_.o dirname_.o error_.o euidaccess_.o exclude_.o fileblocks_.o \
filemode_.o fnmatch_.o fsusage_.o ftruncate_.o full-write_.o getdate_.o \
getgroups_.o getline_.o getopt_.o getopt1_.o group-member_.o hash_.o \
human_.o idcache_.o isdir_.o lchown_.o long-options_.o lstat_.o \
makepath_.o malloc_.o memcmp_.o memcpy_.o memset_.o mkdir_.o mktime_.o \
modechange_.o mountlist_.o obstack_.o path-concat_.o posixtm_.o \
quotearg_.o realloc_.o regex_.o rename_.o rmdir_.o rpmatch_.o \
safe-read_.o save-cwd_.o savedir_.o stat_.o stpcpy_.o strcasecmp_.o \
strdup_.o strftime_.o stripslash_.o strncasecmp_.o strndup_.o strstr_.o \
strtol_.o strtoul_.o strtoull_.o strtoumax_.o strverscmp_.o userspec_.o \
utime_.o version-etc_.o xgetcwd_.o xmalloc_.o xstrdup_.o xstrtol_.o \
xstrtoul_.o xstrtoumax_.o yesno_.o : $(ANSI2KNR)
addext_.o alloca_.o argmatch_.o atexit_.o backupfile_.o basename_.o \
canon-host_.o chown_.o closeout_.o diacrit_.o dirname_.o dup2_.o \
error_.o euidaccess_.o exclude_.o fileblocks_.o filemode_.o fnmatch_.o \
fsusage_.o ftruncate_.o full-write_.o getdate_.o getgroups_.o \
gethostname_.o getline_.o getloadavg_.o getopt_.o getopt1_.o getpass_.o \
getstr_.o getugroups_.o getusershell_.o group-member_.o hard-locale_.o \
hash_.o human_.o idcache_.o isdir_.o lchown_.o linebuffer_.o \
localcharset_.o long-options_.o lstat_.o makepath_.o malloc_.o md5_.o \
memcasecmp_.o memchr_.o memcmp_.o memcoll_.o memcpy_.o memmove_.o \
memset_.o mktime_.o modechange_.o mountlist_.o nanosleep_.o obstack_.o \
path-concat_.o posixtm_.o putenv_.o quotearg_.o readtokens_.o \
readutmp_.o realloc_.o regex_.o rmdir_.o rpmatch_.o safe-read_.o \
same_.o save-cwd_.o savedir_.o stat_.o stime_.o stpcpy_.o strcasecmp_.o \
strcspn_.o strdup_.o strftime_.o stripslash_.o strncasecmp_.o \
strndup_.o strnlen_.o strpbrk_.o strstr_.o strtod_.o strtol_.o \
strtoul_.o strtoull_.o strtoumax_.o strverscmp_.o unicodeio_.o \
userspec_.o utime_.o version-etc_.o xgetcwd_.o xgethostname_.o \
xmalloc_.o xstrdup_.o xstrtod_.o xstrtol_.o xstrtoul_.o xstrtoumax_.o \
yesno_.o : $(ANSI2KNR)
.y.c:
$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c
if test -f y.tab.h; then \
@@ -449,23 +531,27 @@ xstrtoul_.o xstrtoumax_.o yesno_.o : $(ANSI2KNR)
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
mkid -fID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -476,59 +562,143 @@ distclean-tags:
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = lib
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits lib/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
@AMDEP@include $(DEPDIR)/addext$U.Po
@AMDEP@include $(DEPDIR)/alloca.Po
@AMDEP@include $(DEPDIR)/argmatch$U.Po
@AMDEP@include $(DEPDIR)/atexit.Po
@AMDEP@include $(DEPDIR)/backupfile$U.Po
@AMDEP@include $(DEPDIR)/basename$U.Po
@AMDEP@include $(DEPDIR)/canon-host$U.Po
@AMDEP@include $(DEPDIR)/chown.Po
@AMDEP@include $(DEPDIR)/closeout$U.Po
@AMDEP@include $(DEPDIR)/diacrit$U.Po
@AMDEP@include $(DEPDIR)/dirname$U.Po
@AMDEP@include $(DEPDIR)/dup2.Po
@AMDEP@include $(DEPDIR)/error.Po
@AMDEP@include $(DEPDIR)/euidaccess.Po
@AMDEP@include $(DEPDIR)/exclude$U.Po
@AMDEP@include $(DEPDIR)/fileblocks.Po
@AMDEP@include $(DEPDIR)/filemode$U.Po
@AMDEP@include $(DEPDIR)/fnmatch.Po
@AMDEP@include $(DEPDIR)/fsusage.Po
@AMDEP@include $(DEPDIR)/ftruncate.Po
@AMDEP@include $(DEPDIR)/full-write$U.Po
@AMDEP@include $(DEPDIR)/getdate$U.Po
@AMDEP@include $(DEPDIR)/getgroups.Po
@AMDEP@include $(DEPDIR)/gethostname.Po
@AMDEP@include $(DEPDIR)/getline.Po
@AMDEP@include $(DEPDIR)/getloadavg.Po
@AMDEP@include $(DEPDIR)/getopt$U.Po
@AMDEP@include $(DEPDIR)/getopt1$U.Po
@AMDEP@include $(DEPDIR)/getpass.Po
@AMDEP@include $(DEPDIR)/getstr$U.Po
@AMDEP@include $(DEPDIR)/getugroups$U.Po
@AMDEP@include $(DEPDIR)/getusershell.Po
@AMDEP@include $(DEPDIR)/group-member.Po
@AMDEP@include $(DEPDIR)/hard-locale$U.Po
@AMDEP@include $(DEPDIR)/hash$U.Po
@AMDEP@include $(DEPDIR)/human$U.Po
@AMDEP@include $(DEPDIR)/idcache$U.Po
@AMDEP@include $(DEPDIR)/isdir$U.Po
@AMDEP@include $(DEPDIR)/lchown.Po
@AMDEP@include $(DEPDIR)/linebuffer$U.Po
@AMDEP@include $(DEPDIR)/localcharset$U.Po
@AMDEP@include $(DEPDIR)/long-options$U.Po
@AMDEP@include $(DEPDIR)/lstat.Po
@AMDEP@include $(DEPDIR)/makepath$U.Po
@AMDEP@include $(DEPDIR)/malloc.Po
@AMDEP@include $(DEPDIR)/md5$U.Po
@AMDEP@include $(DEPDIR)/memcasecmp$U.Po
@AMDEP@include $(DEPDIR)/memchr.Po
@AMDEP@include $(DEPDIR)/memcmp.Po
@AMDEP@include $(DEPDIR)/memcoll$U.Po
@AMDEP@include $(DEPDIR)/memcpy.Po
@AMDEP@include $(DEPDIR)/memmove.Po
@AMDEP@include $(DEPDIR)/memset.Po
@AMDEP@include $(DEPDIR)/mktime.Po
@AMDEP@include $(DEPDIR)/modechange$U.Po
@AMDEP@include $(DEPDIR)/mountlist.Po
@AMDEP@include $(DEPDIR)/nanosleep.Po
@AMDEP@include $(DEPDIR)/obstack.Po
@AMDEP@include $(DEPDIR)/path-concat$U.Po
@AMDEP@include $(DEPDIR)/posixtm$U.Po
@AMDEP@include $(DEPDIR)/putenv.Po
@AMDEP@include $(DEPDIR)/quotearg$U.Po
@AMDEP@include $(DEPDIR)/readtokens$U.Po
@AMDEP@include $(DEPDIR)/readutmp.Po
@AMDEP@include $(DEPDIR)/realloc.Po
@AMDEP@include $(DEPDIR)/regex.Po
@AMDEP@include $(DEPDIR)/rmdir.Po
@AMDEP@include $(DEPDIR)/rpmatch.Po
@AMDEP@include $(DEPDIR)/safe-read$U.Po
@AMDEP@include $(DEPDIR)/same$U.Po
@AMDEP@include $(DEPDIR)/save-cwd$U.Po
@AMDEP@include $(DEPDIR)/savedir$U.Po
@AMDEP@include $(DEPDIR)/stat.Po
@AMDEP@include $(DEPDIR)/stime.Po
@AMDEP@include $(DEPDIR)/stpcpy.Po
@AMDEP@include $(DEPDIR)/strcasecmp.Po
@AMDEP@include $(DEPDIR)/strcspn.Po
@AMDEP@include $(DEPDIR)/strdup.Po
@AMDEP@include $(DEPDIR)/strftime.Po
@AMDEP@include $(DEPDIR)/stripslash$U.Po
@AMDEP@include $(DEPDIR)/strncasecmp.Po
@AMDEP@include $(DEPDIR)/strndup.Po
@AMDEP@include $(DEPDIR)/strnlen.Po
@AMDEP@include $(DEPDIR)/strpbrk.Po
@AMDEP@include $(DEPDIR)/strstr.Po
@AMDEP@include $(DEPDIR)/strtod.Po
@AMDEP@include $(DEPDIR)/strtol.Po
@AMDEP@include $(DEPDIR)/strtoul.Po
@AMDEP@include $(DEPDIR)/strtoull.Po
@AMDEP@include $(DEPDIR)/strtoumax.Po
@AMDEP@include $(DEPDIR)/strverscmp.Po
@AMDEP@include $(DEPDIR)/unicodeio$U.Po
@AMDEP@include $(DEPDIR)/userspec$U.Po
@AMDEP@include $(DEPDIR)/utime.Po
@AMDEP@include $(DEPDIR)/version-etc$U.Po
@AMDEP@include $(DEPDIR)/xgetcwd$U.Po
@AMDEP@include $(DEPDIR)/xgethostname$U.Po
@AMDEP@include $(DEPDIR)/xmalloc$U.Po
@AMDEP@include $(DEPDIR)/xstrdup$U.Po
@AMDEP@include $(DEPDIR)/xstrtod$U.Po
@AMDEP@include $(DEPDIR)/xstrtol$U.Po
@AMDEP@include $(DEPDIR)/xstrtoul$U.Po
@AMDEP@include $(DEPDIR)/xstrtoumax$U.Po
@AMDEP@include $(DEPDIR)/yesno$U.Po
mostlyclean-depend:
clean-depend:
distclean-depend:
-rm -rf .deps
-rm -rf $(DEPDIR)
maintainer-clean-depend:
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*D)/$(*F).pp -c $<
@-cp .deps/$(*D)/$(*F).pp .deps/$(*D)/$(*F).P; \
tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*D)/$(*F).P; \
rm .deps/$(*D)/$(*F).pp
@AMDEP@CCDEPMODE = @CCDEPMODE@
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*D)/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*D)/$(*F).pp > .deps/$(*D)/$(*F).P; \
tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*D)/$(*F).P; \
rm -f .deps/$(*D)/$(*F).pp
.c.o:
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
info-am:
info: info-am
dvi-am:
@@ -537,7 +707,7 @@ check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec-am: install-exec-local
install-exec: install-exec-am
install-data-am:
@@ -546,9 +716,9 @@ install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall-am: uninstall-local
uninstall: uninstall-am
all-am: Makefile $(LIBRARIES) $(HEADERS)
all-am: Makefile $(LIBRARIES) $(HEADERS) all-local
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
@@ -558,13 +728,16 @@ installdirs:
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
-test -z "getdate.c$(BUILT_SOURCES)" || rm -f getdate.c $(BUILT_SOURCES)
-rm -f Makefile.in
-test -z "getdate.c$(BUILT_SOURCES)$(MAINTAINERCLEANFILES)" || rm -f getdate.c $(BUILT_SOURCES) $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-kr mostlyclean-tags mostlyclean-depend \
mostlyclean-generic
@@ -596,20 +769,72 @@ clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
maintainer-clean-tags mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend distdir info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-local install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-local uninstall-am uninstall all-local all-redirect all-am \
all install-strip installdirs mostlyclean-generic distclean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
lstat.c: xstat.in
sed -e '/@IGNORE@/d' -e 's/@xstat@/lstat/g' $(srcdir)/xstat.in > $@-t
sed \
-e '/@IGNORE@/d' \
-e 's/@xstat@/lstat/g' \
-e '/_LSTAT_ONLY@/d' \
-e '/@BEGIN_STAT_ONLY@/,/@END_STAT_ONLY@/d' \
$(srcdir)/xstat.in > $@-t
mv $@-t $@
stat.c: xstat.in
sed -e '/@IGNORE@/d' -e 's/@xstat@/stat/g' $(srcdir)/xstat.in > $@-t
sed \
-e '/@IGNORE@/d' \
-e 's/@xstat@/stat/g' \
-e '/_STAT_ONLY@/d' \
-e '/@BEGIN_LSTAT_ONLY@/,/@END_LSTAT_ONLY@/d' \
$(srcdir)/xstat.in > $@-t
mv $@-t $@
# The following is needed in order to install a simple file in $(libdir)
# which is shared with other installed packages. We use a list of referencing
# packages so that "make uninstall" will remove the file if and only if it
# is not used by another installed package.
# On systems with glibc-2.1 or newer, the file is redundant, therefore we
# avoid installing it.
all-local: charset.alias ref-add.sed ref-del.sed lstat.c stat.c
install-exec-local: all-local
$(mkinstalldirs) $(DESTDIR)$(libdir)
if test -f $(charset_alias); then \
sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
rm -f $(charset_tmp) ; \
else \
if test @GLIBC21@ = no; then \
sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
rm -f $(charset_tmp) ; \
fi ; \
fi
uninstall-local: all-local
if test -f $(charset_alias); then \
sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
if grep '^# Packages using this file: $$' $(charset_tmp) \
> /dev/null; then \
rm -f $(charset_alias); \
else \
$(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
fi; \
rm -f $(charset_tmp); \
fi
charset.alias: config.charset
$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
mv t-$@ $@
.sin.sed:
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > $@-t
mv $@-t $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.

6
lib/README Normal file
View File

@@ -0,0 +1,6 @@
The files in this directory are shared between the fileutils, sh-utils,
and textutils packages. Not all files are used by each package.
The autoconf tests required for these files are in ../m4.
The library name, fetish, is a permutation of the first two
letters of each of the package names: FIleutils, TExtutils, SH-utils.

View File

@@ -25,6 +25,13 @@
# include <config.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef emacs
# include "blockinput.h"
#endif
@@ -210,6 +217,9 @@ alloca (unsigned size)
register pointer new = malloc (sizeof (header) + size);
/* Address of header. */
if (new == 0)
abort();
((header *) new)->h.next = last_alloca_header;
((header *) new)->h.deep = depth;

View File

@@ -43,7 +43,7 @@
by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use
literal_quoting_style. */
#ifndef ARGMATCH_QUOTING_STYLE
# define ARGMATCH_QUOTING_STYLE escape_quoting_style
# define ARGMATCH_QUOTING_STYLE locale_quoting_style
#endif
/* The following test is to work around the gross typo in
@@ -155,21 +155,11 @@ argcasematch (const char *arg, const char *const *arglist,
void
argmatch_invalid (const char *context, const char *value, int problem)
{
enum quoting_style saved_quoting_style;
char const *format;
char const *format = (problem == -1
? _("invalid argument %s for `%s'")
: _("ambiguous argument %s for `%s'"));
/* Make sure to have a good quoting style to report errors.
literal is insane here. */
saved_quoting_style = get_quoting_style (NULL);
set_quoting_style (NULL, ARGMATCH_QUOTING_STYLE);
format = (problem == -1
? _("invalid argument `%s' for `%s'")
: _("ambiguous argument `%s' for `%s'"));
error (0, 0, format, quotearg (value), context);
set_quoting_style (NULL, saved_quoting_style);
error (0, 0, format, quotearg_style (ARGMATCH_QUOTING_STYLE, value), context);
}
/* List the valid arguments for argmatch.

14
lib/atexit.c Normal file
View File

@@ -0,0 +1,14 @@
/* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
/* This function is in the public domain. --Mike Stump. */
#include "config.h"
int
atexit(f)
void (*f)();
{
/* If the system doesn't provide a definition for atexit, use on_exit
if the system provides that. */
on_exit (f, 0);
return 0;
}

View File

@@ -1,5 +1,5 @@
/* backupfile.c -- make Emacs style backup file names
Copyright (C) 1990-1997, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1990-1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -58,16 +58,24 @@
# define CLOSEDIR(d) closedir (d)
#endif
#if STDC_HEADERS
#if HAVE_STDLIB_H
# include <stdlib.h>
#else
char *malloc ();
#endif
#ifndef HAVE_DECL_GETENV
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_GETENV
char *getenv ();
#endif
#ifndef HAVE_DECL_MALLOC
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_MALLOC
char *malloc ();
#endif
char *base_name PARAMS ((char const *));
#if HAVE_DIRENT_H || HAVE_NDIR_H || HAVE_SYS_DIR_H || HAVE_SYS_NDIR_H

View File

@@ -23,10 +23,20 @@
# define FILESYSTEM_PREFIX_LEN(Filename) 0
#endif
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
#ifndef ISSLASH
# define ISSLASH(C) ((C) == '/')
#endif
char *base_name PARAMS ((char const *name));
/* In general, we can't use the builtin `basename' function if available,
since it has different meanings in different environments.
In some environments the builtin `basename' modifies its argument.

View File

@@ -1,6 +1,6 @@
/* Host name canonicalization
Copyright (C) 1995, 1999 Free Software Foundation, Inc.
Copyright (C) 1995, 1999, 2000 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -26,6 +26,9 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
@@ -43,7 +46,9 @@
# include <arpa/inet.h>
#endif
void free ();
#ifndef strdup
char *strdup ();
#endif
/* Returns the canonical hostname associated with HOST (allocated in a static
buffer), or 0 if it can't be determined. */
@@ -77,11 +82,12 @@ canon_host (const char *host)
directly to gethostbyaddr because on some systems he->h_addr
is located in a static library buffer that is reused in the
gethostbyaddr call. Make a copy and use that instead. */
char *h_addr_copy = strdup (he->h_addr);
char *h_addr_copy = (char *) malloc (he->h_length);
if (h_addr_copy == NULL)
he = NULL;
else
{
memcpy (h_addr_copy, he->h_addr, he->h_length);
he = gethostbyaddr (h_addr_copy, he->h_length, he->h_addrtype);
free (h_addr_copy);
}

View File

@@ -1,5 +1,5 @@
/* closeout.c - close standard output
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,14 +33,36 @@
# define EXIT_FAILURE 1
#endif
#include <stdio.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#include <stdio.h>
#include "closeout.h"
#include "error.h"
#include "quotearg.h"
static int default_exit_status = EXIT_FAILURE;
static const char *file_name;
/* Set the value to be used for the exit status when close_stdout is called.
This is useful when it is not convenient to call close_stdout_status,
e.g., when close_stdout is called via atexit. */
void
close_stdout_set_status (int status)
{
default_exit_status = status;
}
/* Set the file name to be reported in the event an error is detected
by close_stdout_status. */
void
close_stdout_set_file_name (const char *file)
{
file_name = file;
}
/* Close standard output, exiting with status STATUS on failure.
If a program writes *anything* to stdout, that program should `fflush'
@@ -67,15 +89,24 @@ extern int errno;
void
close_stdout_status (int status)
{
if (ferror (stdout))
error (status, 0, _("write error"));
int e = ferror (stdout) ? 0 : -1;
if (fclose (stdout) != 0)
error (status, errno, _("write error"));
e = errno;
if (0 <= e)
{
char const *write_error = _("write error");
if (file_name)
error (status, e, "%s: %s", quotearg_colon (file_name), write_error);
else
error (status, e, "%s", write_error);
}
}
/* Close standard output, exiting with status EXIT_FAILURE on failure. */
void
close_stdout (void)
{
close_stdout_status (EXIT_FAILURE);
close_stdout_status (default_exit_status);
}

View File

@@ -6,5 +6,7 @@
# endif
#endif
void close_stdout_set_status PARAMS ((int status));
void close_stdout_set_file_name PARAMS ((const char *file));
void close_stdout PARAMS ((void));
void close_stdout_status PARAMS ((int status));

186
lib/config.charset Executable file
View File

@@ -0,0 +1,186 @@
#! /bin/sh
# Output a system dependent table of character encoding aliases.
#
# Copyright (C) 2000 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
# The table consists of lines of the form
# ALIAS CANONICAL
#
# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
# ALIAS is compared in a case sensitive way.
#
# CANONICAL is the GNU canonical name for this character encoding.
# It must be an encoding supported by libiconv. Support by GNU libc is
# also desirable. CANONICAL is case insensitive. Usually an upper case
# MIME charset name is preferred.
# The current list of GNU canonical charset names is as follows.
#
# name used by which systems a MIME name?
# ASCII, ANSI_X3.4-1968 glibc solaris
# ISO-8859-1 glibc aix hpux irix osf solaris yes
# ISO-8859-2 glibc aix hpux irix solaris yes
# ISO-8859-4 solaris yes
# ISO-8859-5 glibc aix hpux irix solaris yes
# ISO-8859-6 aix hpux solaris yes
# ISO-8859-7 glibc aix hpux irix osf solaris yes
# ISO-8859-8 glibc aix hpux solaris yes
# ISO-8859-9 glibc aix hpux irix osf solaris yes
# ISO-8859-13 glibc
# ISO-8859-15 aix solaris
# KOI8-R glibc solaris yes
# KOI8-U glibc yes
# CP850 aix osf
# CP856 aix
# CP922 aix
# CP932 aix
# CP943 aix
# CP1046 aix
# CP1124 aix
# CP1129 aix
# CP1252 aix
# EUC-CN aix hpux solaris
# EUC-JP aix hpux solaris yes
# EUC-KR aix hpux solaris yes
# EUC-TW aix hpux solaris
# BIG5 aix hpux solaris yes
# GBK aix
# SJIS hpux solaris
# TIS-620 aix hpux solaris
# HP-ROMAN8 hpux
# HP-ARABIC8 hpux
# HP-GREEK8 hpux
# HP-HEBREW8 hpux
# HP-TURKISH8 hpux
# HP-KANA8 hpux
# UTF-8 glibc aix hpux solaris yes
#
# Note: Names which are not marked as being a MIME name should not be used in
# Internet protocols for information interchange (mail, news, etc.).
#
# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
# must understand both names and treat them as equivalent.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
host="$1"
os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
echo "# This file contains a table of character encoding aliases,"
echo "# suitable for operating system '${os}'."
echo "# It was automatically generated from config.charset."
# List of references, updated during installation:
echo "# Packages using this file: "
case "$os" in
linux* | *-gnu*)
# With glibc-2.1 or newer, we don't need any canonicalization,
# because glibc has iconv and both glibc and libiconv support all
# GNU canonical names directly. Therefore, the Makefile does not
# need to install the alias file at all.
# The following applies only to glibc-2.0.x and older libcs.
echo "ISO_646.IRV:1983 ASCII"
;;
aix*)
echo "ISO8859-1 ISO-8859-1"
echo "ISO8859-2 ISO-8859-2"
echo "ISO8859-5 ISO-8859-5"
echo "ISO8859-6 ISO-8859-6"
echo "ISO8859-7 ISO-8859-7"
echo "ISO8859-8 ISO-8859-8"
echo "ISO8859-9 ISO-8859-9"
echo "ISO8859-15 ISO-8859-15"
echo "IBM-850 CP850"
echo "IBM-856 CP856"
echo "IBM-921 ISO-8859-13"
echo "IBM-922 CP922"
echo "IBM-932 CP932"
echo "IBM-943 CP943"
echo "IBM-1046 CP1046"
echo "IBM-1124 CP1124"
echo "IBM-1129 CP1129"
echo "IBM-1252 CP1252"
echo "IBM-eucCN EUC-CN"
echo "IBM-eucJP EUC-JP"
echo "IBM-eucKR EUC-KR"
echo "IBM-eucTW EUC-TW"
echo "big5 BIG5"
echo "GBK GBK"
echo "TIS-620 TIS-620"
echo "UTF-8 UTF-8"
;;
hpux*)
echo "iso88591 ISO-8859-1"
echo "iso88592 ISO-8859-2"
echo "iso88595 ISO-8859-5"
echo "iso88596 ISO-8859-6"
echo "iso88597 ISO-8859-7"
echo "iso88598 ISO-8859-8"
echo "iso88599 ISO-8859-9"
echo "roman8 HP-ROMAN8"
echo "arabic8 HP-ARABIC8"
echo "greek8 HP-GREEK8"
echo "hebrew8 HP-HEBREW8"
echo "turkish8 HP-TURKISH8"
echo "kana8 HP-KANA8"
echo "tis620 TIS-620"
echo "big5 BIG5"
echo "eucJP EUC-JP"
echo "eucKR EUC-KR"
echo "eucTW EUC-TW"
echo "hp15CN EUC-CN"
#echo "ccdc ?" # what is this?
echo "SJIS SJIS"
echo "utf8 UTF-8"
;;
irix*)
echo "ISO8859-1 ISO-8859-1"
echo "ISO8859-2 ISO-8859-2"
echo "ISO8859-5 ISO-8859-5"
echo "ISO8859-7 ISO-8859-7"
echo "ISO8859-9 ISO-8859-9"
;;
osf*)
echo "ISO8859-1 ISO-8859-1"
echo "ISO8859-7 ISO-8859-7"
echo "ISO8859-9 ISO-8859-9"
echo "cp850 CP850"
;;
solaris*)
echo "646 ASCII"
echo "ISO8859-1 ISO-8859-1"
echo "ISO8859-2 ISO-8859-2"
echo "ISO8859-4 ISO-8859-4"
echo "ISO8859-5 ISO-8859-5"
echo "ISO8859-6 ISO-8859-6"
echo "ISO8859-7 ISO-8859-7"
echo "ISO8859-8 ISO-8859-8"
echo "ISO8859-9 ISO-8859-9"
echo "ISO8859-15 ISO-8859-15"
echo "koi8-r KOI8-R"
echo "BIG5 BIG5"
echo "gb2312 EUC-CN"
echo "cns11643 EUC-TW"
echo "5601 EUC-KR"
echo "eucJP EUC-JP"
echo "PCK SJIS"
echo "TIS620.2533 TIS-620"
#echo "sun_eu_greek ?" # what is this?
echo "UTF-8 UTF-8"
;;
esac

View File

@@ -57,8 +57,17 @@ dir_name (const char *path)
else
{
/* Remove any trailing slashes from the result. */
#ifdef MSDOS
char *lim = (path[0] >= 'A' && path[0] <= 'z' && path[1] == ':')
? path + 2 : path;
/* If canonicalized "d:/path", leave alone the root case "d:/". */
while (slash > lim && *slash == '/')
--slash;
#else
while (slash > path && *slash == '/')
--slash;
#endif
length = slash - path + 1;
}

66
lib/dup2.c Normal file
View File

@@ -0,0 +1,66 @@
/* Duplicate an open file descriptor to a specified file descriptor.
Copyright 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* written by Paul Eggert */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#if HAVE_FCNTL_H
# include <fcntl.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifndef F_DUPFD
static int
dupfd (int fd, int desired_fd)
{
int duplicated_fd = dup (fd);
if (duplicated_fd < 0 || duplicated_fd == desired_fd)
return duplicated_fd;
else
{
int r = dupfd (fd, desired_fd);
int e = errno;
close (duplicated_fd);
errno = e;
return r;
}
}
#endif
int
dup2 (int fd, int desired_fd)
{
if (fd == desired_fd)
return fd;
close (desired_fd);
#ifdef F_DUPFD
return fcntl (fd, F_DUPFD, desired_fd);
#else
return dupfd (fd, desired_fd);
#endif
}

View File

@@ -1,5 +1,5 @@
/* Error handler for noninteractive utilities
Copyright (C) 1990,91,92,93,94,95,96,97,98 Free Software Foundation, Inc.
Copyright (C) 1990-2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
@@ -49,6 +49,13 @@ void exit ();
#include "error.h"
#ifndef HAVE_DECL_STRERROR_R
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_STRERROR_R
char *strerror_r ();
#endif
#ifndef _
# define _(String) String
#endif
@@ -150,12 +157,16 @@ error (status, errnum, message, va_alist)
++error_message_count;
if (errnum)
{
#if defined HAVE_STRERROR_R || defined _LIBC
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
# if HAVE_WORKING_STRERROR_R || _LIBC
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
# else
/* Don't use __strerror_r's return value because on some systems
(at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */
__strerror_r (errnum, errbuf, sizeof errbuf);
fprintf (stderr, ": %s", errbuf);
# endif
#else
fprintf (stderr, ": %s", strerror (errnum));
#endif
@@ -228,9 +239,16 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
++error_message_count;
if (errnum)
{
#if defined HAVE_STRERROR_R || defined _LIBC
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
# if HAVE_WORKING_STRERROR_R || _LIBC
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
# else
/* Don't use __strerror_r's return value because on some systems
(at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */
__strerror_r (errnum, errbuf, sizeof errbuf);
fprintf (stderr, ": %s", errbuf);
# endif
#else
fprintf (stderr, ": %s", strerror (errnum));
#endif

View File

@@ -1,5 +1,5 @@
/* Declaration for error-reporting function
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.

View File

@@ -1,5 +1,5 @@
/* euidaccess -- check if effective user id can access file
Copyright (C) 1990, 1991, 1995, 1998 Free Software Foundation, Inc.
Copyright (C) 1990, 1991, 1995, 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -66,6 +66,9 @@ gid_t getegid ();
#ifndef errno
extern int errno;
#endif
#ifndef __set_errno
# define __set_errno(val) errno = (val)
#endif
#if defined(EACCES) && !defined(EACCESS)
# define EACCESS EACCES
@@ -93,6 +96,7 @@ extern int errno;
#ifdef _LIBC
# define group_member __group_member
# define euidaccess __euidaccess
#else
@@ -102,15 +106,6 @@ static uid_t uid;
/* The user's real group id. */
static gid_t gid;
/* The user's effective user id. */
static uid_t euid;
/* The user's effective group id. */
static gid_t egid;
/* Nonzero if UID, GID, EUID, and EGID have valid values. */
static int have_ids = 0;
# if HAVE_GETGROUPS
int group_member ();
# else
@@ -119,6 +114,15 @@ int group_member ();
#endif
/* The user's effective user id. */
static uid_t euid;
/* The user's effective group id. */
static gid_t egid;
/* Nonzero if UID, GID, EUID, and EGID have valid values. */
static int have_ids;
/* Return 0 if the user has permission of type MODE on file PATH;
otherwise, return -1 and set `errno' to EACCESS.
@@ -133,8 +137,9 @@ euidaccess (const char *path, int mode)
int granted;
#ifdef _LIBC
uid_t uid = getuid (), euid = geteuid ();
gid_t gid = getgid (), egid = getegid ();
if (! __libc_enable_secure)
/* If we are not set-uid or set-gid, access does the same. */
return __access (path, mode);
#else
if (have_ids == 0)
{
@@ -144,11 +149,11 @@ euidaccess (const char *path, int mode)
euid = geteuid ();
egid = getegid ();
}
#endif
if (uid == euid && gid == egid)
/* If we are not set-uid or set-gid, access does the same. */
return access (path, mode);
#endif
if (stat (path, &stats))
return -1;
@@ -161,6 +166,16 @@ euidaccess (const char *path, int mode)
if (mode == F_OK)
return 0; /* The file exists. */
#ifdef _LIBC
/* Now we need the IDs. */
if (have_ids == 0)
{
have_ids = 1;
euid = __geteuid ();
egid = __getegid ();
}
#endif
/* The super-user can read and write any file, and execute any file
that anyone can execute. */
if (euid == 0 && ((mode & X_OK) == 0
@@ -175,6 +190,40 @@ euidaccess (const char *path, int mode)
granted = (stats.st_mode & mode);
if (granted == mode)
return 0;
errno = EACCESS;
__set_errno (EACCESS);
return -1;
}
#undef euidaccess
#ifdef weak_alias
weak_alias (__euidaccess, euidaccess)
#endif
#ifdef TEST
# include <stdio.h>
# include <errno.h>
# include "error.h"
char *program_name;
int
main (argc, argv)
int argc;
char **argv;
{
char *file;
int mode;
int err;
program_name = argv[0];
if (argc < 3)
abort ();
file = argv[1];
mode = atoi (argv[2]);
err = euidaccess (file, mode);
printf ("%d\n", err);
if (err != 0)
error (0, errno, "%s", file);
exit (0);
}
#endif

View File

@@ -1,5 +1,5 @@
/* exclude.c -- exclude file names
Copyright 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
Copyright 1992, 1993, 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -54,14 +54,14 @@ new_exclude (void)
}
int
excluded_filename (struct exclude const *ex, char const *f)
excluded_filename (struct exclude const *ex, char const *f, int options)
{
char const * const *exclude = ex->exclude;
int exclude_count = ex->exclude_count;
int i;
for (i = 0; i < exclude_count; i++)
if (fnmatch (exclude[i], f, 0) == 0)
if (fnmatch (exclude[i], f, options) == 0)
return 1;
return 0;
@@ -79,7 +79,8 @@ add_exclude (struct exclude *ex, char const *pattern)
}
int
add_exclude_file (struct exclude *ex, char const *filename, char line_end)
add_exclude_file (void (*add_func) PARAMS ((struct exclude *, char const *)),
struct exclude *ex, char const *filename, char line_end)
{
int use_stdin = filename[0] == '-' && !filename[1];
FILE *in;
@@ -118,7 +119,7 @@ add_exclude_file (struct exclude *ex, char const *filename, char line_end)
if (p < lim ? *p == line_end : buf < p && p[-1])
{
*p = '\0';
add_exclude (ex, pattern);
(*add_func) (ex, pattern);
pattern = p + 1;
}

View File

@@ -1,5 +1,5 @@
/* exclude.h -- declarations for excluding file names
Copyright 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
Copyright 1992, 1993, 1994, 1997, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,5 +30,6 @@ struct exclude;
struct exclude *new_exclude PARAMS ((void));
void add_exclude PARAMS ((struct exclude *, char const *));
int add_exclude_file PARAMS ((struct exclude *, char const *, char));
int excluded_filename PARAMS ((struct exclude const *, char const *));
int add_exclude_file PARAMS ((void (*) (struct exclude *, char const *),
struct exclude *, char const *, char));
int excluded_filename PARAMS ((struct exclude const *, char const *, int));

70
lib/fatal.c Normal file
View File

@@ -0,0 +1,70 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/* FIXME: define EXIT_FAILURE */
#include <stdio.h>
#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
# if __STDC__
# include <stdarg.h>
# define VA_START(args, lastarg) va_start(args, lastarg)
# else
# include <varargs.h>
# define VA_START(args, lastarg) va_start(args)
# endif
#else
# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
#endif
#if STDC_HEADERS || _LIBC
# include <stdlib.h>
# include <string.h>
#else
void exit ();
#endif
#ifdef _LIBC
# define program_name program_invocation_name
#else /* not _LIBC */
/* The calling program should define program_name and set it to the
name of the executing program. */
extern char *program_name;
#endif
#include "fatal.h"
/* Like error, but always exit with EXIT_FAILURE. */
void
#if defined VA_START && __STDC__
fatal (int errnum, const char *message, ...)
#else
fatal (errnum, message, va_alist)
int errnum;
char *message;
va_dcl
#endif
{
#ifdef VA_START
va_list args;
#endif
if (error_print_progname)
(*error_print_progname) ();
else
{
fflush (stdout);
fprintf (stderr, "%s: ", program_name);
}
#ifdef VA_START
VA_START (args, message);
error (EXIT_FAILURE, errnum, message, args);
va_end (args);
#else
error (EXIT_FAILURE, errnum, message, a1, a2, a3, a4, a5, a6, a7, a8);
#endif
}

68
lib/fatal.h Normal file
View File

@@ -0,0 +1,68 @@
#include "error.h"
/* FIXME: this is all from ansidecl. better to simply swipe
that file from egcs/include and include it from here. */
/* Using MACRO(x,y) in cpp #if conditionals does not work with some
older preprocessors. Thus we can't define something like this:
#define HAVE_GCC_VERSION(MAJOR, MINOR) \
(__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
and then test "#if HAVE_GCC_VERSION(2,7)".
So instead we use the macro below and test it against specific values. */
/* This macro simplifies testing whether we are using gcc, and if it
is of a particular minimum version. (Both major & minor numbers are
significant.) This macro will evaluate to 0 if we are not using
gcc at all. */
#ifndef GCC_VERSION
# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#endif /* GCC_VERSION */
/* Define macros for some gcc attributes. This permits us to use the
macros freely, and know that they will come into play for the
version of gcc in which they are supported. */
#if (GCC_VERSION < 2007)
# define __attribute__(x)
#endif
/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
#ifndef ATTRIBUTE_MALLOC
# if (GCC_VERSION >= 2096)
# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
# else
# define ATTRIBUTE_MALLOC
# endif /* GNUC >= 2.96 */
#endif /* ATTRIBUTE_MALLOC */
/* Attributes on labels were valid as of gcc 2.93. */
#ifndef ATTRIBUTE_UNUSED_LABEL
# if (GCC_VERSION >= 2093)
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
# else
# define ATTRIBUTE_UNUSED_LABEL
# endif /* GNUC >= 2.93 */
#endif /* ATTRIBUTE_UNUSED_LABEL */
#ifndef ATTRIBUTE_UNUSED
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif /* ATTRIBUTE_UNUSED */
#ifndef ATTRIBUTE_NORETURN
# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
#endif /* ATTRIBUTE_NORETURN */
#ifndef ATTRIBUTE_PRINTF
# define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
# define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
# define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
# define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
# define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
# define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
#endif /* ATTRIBUTE_PRINTF */
extern void fatal (int errnum, const char *format, ...)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_2;

View File

@@ -1,5 +1,5 @@
/* Convert file size to number of blocks on System V-like machines.
Copyright (C) 1990, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1990, 1997, 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
# include <sys/param.h>
#endif
#if !HAVE_ST_BLOCKS && !defined _POSIX_SOURCE && defined BSIZE
#if !HAVE_STRUCT_STAT_ST_BLOCKS && !defined _POSIX_SOURCE && defined BSIZE
# if HAVE_UNISTD_H
# include <unistd.h>

View File

@@ -1,5 +1,5 @@
/* filemode.c -- make a string describing file modes
Copyright (C) 1985, 1990, 1993, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1985, 1990, 1993, 1998-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
@@ -48,6 +48,25 @@
# endif
#endif
#if !S_IRGRP
# define S_IRGRP (S_IRUSR >> 3)
#endif
#if !S_IWGRP
# define S_IWGRP (S_IWUSR >> 3)
#endif
#if !S_IXGRP
# define S_IXGRP (S_IXUSR >> 3)
#endif
#if !S_IROTH
# define S_IROTH (S_IRUSR >> 6)
#endif
#if !S_IWOTH
# define S_IWOTH (S_IWUSR >> 6)
#endif
#if !S_IXOTH
# define S_IXOTH (S_IXUSR >> 6)
#endif
#ifdef STAT_MACROS_BROKEN
# undef S_ISBLK
# undef S_ISCHR
@@ -61,54 +80,48 @@
# undef S_ISSOCK
#endif /* STAT_MACROS_BROKEN. */
#if !defined(S_ISBLK) && defined(S_IFBLK)
#if !defined S_ISBLK && defined S_IFBLK
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#endif
#if !defined(S_ISCHR) && defined(S_IFCHR)
#if !defined S_ISCHR && defined S_IFCHR
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
#if !defined S_ISDIR && defined S_IFDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
#if !defined(S_ISREG) && defined(S_IFREG)
#if !defined S_ISREG && defined S_IFREG
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
#if !defined(S_ISFIFO) && defined(S_IFIFO)
#if !defined S_ISFIFO && defined S_IFIFO
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
#endif
#if !defined(S_ISLNK) && defined(S_IFLNK)
#if !defined S_ISLNK && defined S_IFLNK
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#endif
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
#if !defined S_ISSOCK && defined S_IFSOCK
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
#endif
#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
#if !defined S_ISMPB && defined S_IFMPB /* V7 */
# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
#endif
#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
#if !defined S_ISNWK && defined S_IFNWK /* HP/UX */
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
#endif
#if !defined(S_ISDOOR) && defined(S_IFDOOR) /* Solaris 2.5 and up */
#if !defined S_ISDOOR && defined S_IFDOOR /* Solaris 2.5 and up */
# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR)
#endif
#if !defined S_ISCTG && defined S_IFCTG /* MassComp */
# define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG)
#endif
/* Look at read, write, and execute bits in BITS and set
flags in CHARS accordingly. */
static void
rwx (short unsigned int bits, char *chars)
{
chars[0] = (bits & S_IRUSR) ? 'r' : '-';
chars[1] = (bits & S_IWUSR) ? 'w' : '-';
chars[2] = (bits & S_IXUSR) ? 'x' : '-';
}
/* Set the 's' and 't' flags in file attributes string CHARS,
according to the file mode BITS. */
static void
setst (short unsigned int bits, char *chars)
setst (mode_t bits, char *chars)
{
#ifdef S_ISUID
if (bits & S_ISUID)
@@ -148,16 +161,18 @@ setst (short unsigned int bits, char *chars)
'D' for doors
'b' for block special files
'c' for character special files
'n' for network special files
'm' for multiplexor files
'M' for an off-line (regular) file
'l' for symbolic links
's' for sockets
'p' for fifos
'C' for contigous data files
'-' for regular files
'?' for any other file type. */
static char
ftypelet (long int bits)
ftypelet (mode_t bits)
{
#ifdef S_ISBLK
if (S_ISBLK (bits))
@@ -193,6 +208,10 @@ ftypelet (long int bits)
if (S_ISDOOR (bits))
return 'D';
#endif
#ifdef S_ISCTG
if (S_ISCTG (bits))
return 'C';
#endif
/* The following two tests are for Cray DMF (Data Migration
Facility), which is a HSM file system. A migrated file has a
@@ -216,12 +235,18 @@ ftypelet (long int bits)
is given as an argument. */
void
mode_string (short unsigned int mode, char *str)
mode_string (mode_t mode, char *str)
{
str[0] = ftypelet ((long) mode);
rwx ((mode & 0700) << 0, &str[1]);
rwx ((mode & 0070) << 3, &str[4]);
rwx ((mode & 0007) << 6, &str[7]);
str[0] = ftypelet (mode);
str[1] = mode & S_IRUSR ? 'r' : '-';
str[2] = mode & S_IWUSR ? 'w' : '-';
str[3] = mode & S_IXUSR ? 'x' : '-';
str[4] = mode & S_IRGRP ? 'r' : '-';
str[5] = mode & S_IWGRP ? 'w' : '-';
str[6] = mode & S_IXGRP ? 'x' : '-';
str[7] = mode & S_IROTH ? 'r' : '-';
str[8] = mode & S_IWOTH ? 'w' : '-';
str[9] = mode & S_IXOTH ? 'x' : '-';
setst (mode, str);
}

View File

@@ -1,9 +1,19 @@
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
#ifndef FILEMODE_H_
void mode_string PARAMS ((short unsigned int mode, char *str));
# if HAVE_CONFIG_H
# include <config.h>
# endif
# include <sys/types.h>
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
void mode_string PARAMS ((mode_t mode, char *str));
#endif

View File

@@ -1,5 +1,5 @@
/* fsusage.c -- return space usage of mounted filesystems
Copyright (C) 1991, 1992, 1996, 1998 Free Software Foundation, Inc.
Copyright (C) 1991, 1992, 1996, 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -184,7 +184,7 @@ get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp)
truncation, presumably without botching the 4.1.1 case, in which
the values are not truncated. The correct counts are stored in
undocumented spare fields. */
if (fsd.f_blocks == 0x1fffff && fsd.f_spare[0] > 0)
if (fsd.f_blocks == 0x7fffffff / fsd.f_bsize && fsd.f_spare[0] > 0)
{
fsd.f_blocks = fsd.f_spare[0];
fsd.f_bfree = fsd.f_spare[1];

View File

@@ -1,5 +1,5 @@
/* full-write.c -- an interface to write that retries after interrupts
Copyright (C) 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1993, 1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -45,10 +45,11 @@ full_write (int desc, const char *ptr, size_t len)
while (len > 0)
{
int written = write (desc, ptr, len);
/* FIXME: write on my slackware Linux 1.2.13 returns zero when
/* write on an old Slackware Linux 1.2.13 returns zero when
I try to write more data than there is room on a floppy disk.
This puts dd into an infinite loop. Reproduce with
dd if=/dev/zero of=/dev/fd0. */
dd if=/dev/zero of=/dev/fd0. If you have this problem,
consider upgrading to a newer kernel. */
if (written < 0)
{
#ifdef EINTR

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
/* getline.c -- Replacement for GNU C library function getline
Copyright (C) 1993, 1996, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1993, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -39,105 +39,19 @@ getline (char **lineptr, size_t *n, FILE *stream)
return getdelim (lineptr, n, '\n', stream);
}
#else /* ! have getdelim */
# define NDEBUG
# include <assert.h>
# if STDC_HEADERS
# include <stdlib.h>
# else
char *malloc (), *realloc ();
# endif
/* Always add at least this many bytes when extending the buffer. */
# define MIN_CHUNK 64
/* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR
+ OFFSET (and null-terminate it). *LINEPTR is a pointer returned from
malloc (or NULL), pointing to *N characters of space. It is realloc'd
as necessary. Return the number of characters read (not including the
null terminator), or -1 on error or EOF. */
int
getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset)
{
int nchars_avail; /* Allocated but unused chars in *LINEPTR. */
char *read_pos; /* Where we're reading into *LINEPTR. */
int ret;
if (!lineptr || !n || !stream)
return -1;
if (!*lineptr)
{
*n = MIN_CHUNK;
*lineptr = malloc (*n);
if (!*lineptr)
return -1;
}
nchars_avail = *n - offset;
read_pos = *lineptr + offset;
for (;;)
{
register int c = getc (stream);
/* We always want at least one char left in the buffer, since we
always (unless we get an error while reading the first char)
NUL-terminate the line buffer. */
assert(*n - nchars_avail == read_pos - *lineptr);
if (nchars_avail < 2)
{
if (*n > MIN_CHUNK)
*n *= 2;
else
*n += MIN_CHUNK;
nchars_avail = *n + *lineptr - read_pos;
*lineptr = realloc (*lineptr, *n);
if (!*lineptr)
return -1;
read_pos = *n - nchars_avail + *lineptr;
assert(*n - nchars_avail == read_pos - *lineptr);
}
if (c == EOF || ferror (stream))
{
/* Return partial line, if any. */
if (read_pos == *lineptr)
return -1;
else
break;
}
*read_pos++ = c;
nchars_avail--;
if (c == terminator)
/* Return the line. */
break;
}
/* Done - NUL terminate and return the number of chars read. */
*read_pos = '\0';
ret = read_pos - (*lineptr + offset);
return ret;
}
# include "getstr.h"
int
getline (char **lineptr, size_t *n, FILE *stream)
{
return getstr (lineptr, n, stream, '\n', 0);
return getstr (lineptr, n, stream, '\n', 0, 0);
}
int
getdelim (char **lineptr, size_t *n, int delimiter, FILE *stream)
{
return getstr (lineptr, n, stream, delimiter, 0);
return getstr (lineptr, n, stream, delimiter, 0, 0);
}
#endif

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1995, 1997, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,10 +27,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# endif
# endif
# if __GLIBC__ < 2
int
getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream));
int
getdelim PARAMS ((char **_lineptr, size_t *_n, int _delimiter, FILE *_stream));
# endif
#endif /* not GETLINE_H_ */

View File

@@ -308,6 +308,12 @@ extern int errno;
# define LDAV_CVT(n) (((double) (n)) / FSCALE)
# endif
# ifndef NLIST_STRUCT
# if HAVE_NLIST_H
# define NLIST_STRUCT
# endif
# endif
/* VAX C can't handle multi-line #ifs, or lines longer that 256 characters. */
# ifndef NLIST_STRUCT

View File

@@ -1,25 +1,23 @@
/* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it!
NOTE: The canonical source of this file is maintained with the GNU
C Library. Bugs can be reported to bug-glibc@gnu.org.
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
The GNU C Library is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
@@ -29,13 +27,13 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if !defined __STDC__ || !__STDC__
#else
# if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
# ifndef const
# define const
# ifndef const
# define const
# endif
# endif
#endif
@@ -109,7 +107,7 @@
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
char *optarg = NULL;
char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
@@ -130,7 +128,7 @@ int optind = 1;
causes problems with re-calling getopt as programs generally don't
know that. */
int __getopt_initialized = 0;
int __getopt_initialized;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
@@ -517,6 +515,13 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
int *longind;
int long_only;
{
int print_errors = opterr;
if (optstring[0] == ':')
print_errors = 0;
if (argc < 1)
return -1;
optarg = NULL;
if (optind == 0 || !__getopt_initialized)
@@ -673,7 +678,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (ambig && !exact)
{
if (opterr)
if (print_errors)
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
@@ -694,7 +699,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optarg = nameend + 1;
else
{
if (opterr)
if (print_errors)
{
if (argv[optind - 1][1] == '-')
/* --option */
@@ -720,7 +725,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optarg = argv[optind++];
else
{
if (opterr)
if (print_errors)
fprintf (stderr,
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
@@ -747,7 +752,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (!long_only || argv[optind][1] == '-'
|| my_index (optstring, *nextchar) == NULL)
{
if (opterr)
if (print_errors)
{
if (argv[optind][1] == '-')
/* --option */
@@ -777,7 +782,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (temp == NULL || c == ':')
{
if (opterr)
if (print_errors)
{
if (posixly_correct)
/* 1003.2 specifies the format of this message. */
@@ -811,7 +816,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
}
else if (optind == argc)
{
if (opterr)
if (print_errors)
{
/* 1003.2 specifies the format of this message. */
fprintf (stderr, _("%s: option requires an argument -- %c\n"),
@@ -860,7 +865,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
}
if (ambig && !exact)
{
if (opterr)
if (print_errors)
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
@@ -878,7 +883,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optarg = nameend + 1;
else
{
if (opterr)
if (print_errors)
fprintf (stderr, _("\
%s: option `-W %s' doesn't allow an argument\n"),
argv[0], pfound->name);
@@ -893,7 +898,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optarg = argv[optind++];
else
{
if (opterr)
if (print_errors)
fprintf (stderr,
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
@@ -940,12 +945,12 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
}
else if (optind == argc)
{
if (opterr)
if (print_errors)
{
/* 1003.2 specifies the format of this message. */
fprintf (stderr,
_("%s: option requires an argument -- %c\n"),
argv[0], c);
_("%s: option requires an argument -- %c\n"),
argv[0], c);
}
optopt = c;
if (optstring[0] == ':')

View File

@@ -1,21 +1,21 @@
/* Declarations for getopt.
Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
This file is part of the GNU C Library.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#ifndef _GETOPT_H

View File

@@ -1,29 +1,26 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
Free Software Foundation, Inc.
This file is part of the GNU C Library.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
The GNU C Library is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "getopt.h"
#else
#if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
@@ -31,6 +28,9 @@
#define const
#endif
#endif
#endif
#include "getopt.h"
#include <stdio.h>

49
lib/getpagesize.h Normal file
View File

@@ -0,0 +1,49 @@
/* Emulate getpagesize on systems that lack it. */
#ifndef HAVE_GETPAGESIZE
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#if !defined getpagesize && defined _SC_PAGESIZE
# if !(defined VMS && __VMS_VER < 70000000)
# define getpagesize() sysconf (_SC_PAGESIZE)
# endif
#endif
#if !defined getpagesize && defined VMS
# ifdef __ALPHA
# define getpagesize() 8192
# else
# define getpagesize() 512
# endif
#endif
/* This is for BeOS. */
#if !defined getpagesize && HAVE_OS_H
# include <OS.h>
# if defined B_PAGE_SIZE
# define getpagesize() B_PAGE_SIZE
# endif
#endif
#ifndef getpagesize
# include <sys/param.h>
# ifdef EXEC_PAGESIZE
# define getpagesize() EXEC_PAGESIZE
# else
# ifdef NBPG
# ifndef CLSIZE
# define CLSIZE 1
# endif
# define getpagesize() (NBPG * CLSIZE)
# else
# ifdef NBPC
# define getpagesize() NBPC
# endif
# endif
# endif
#endif
#endif /* not HAVE_GETPAGESIZE */

101
lib/getpass.c Normal file
View File

@@ -0,0 +1,101 @@
/* Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include "getline.h"
/* It is desirable to use this bit on systems that have it.
The only bit of terminal state we want to twiddle is echoing, which is
done in software; there is no need to change the state of the terminal
hardware. */
#ifndef TCSASOFT
# define TCSASOFT 0
#endif
char *
getpass (const char *prompt)
{
FILE *in, *out;
struct termios s, t;
int tty_changed;
static char *buf;
static size_t bufsize;
ssize_t nread;
/* Try to write to and read from the terminal if we can.
If we can't open the terminal, use stderr and stdin. */
in = fopen ("/dev/tty", "w+");
if (in == NULL)
{
in = stdin;
out = stderr;
}
else
out = in;
/* Turn echoing off if it is on now. */
if (tcgetattr (fileno (in), &t) == 0)
{
/* Save the old one. */
s = t;
/* Tricky, tricky. */
t.c_lflag &= ~(ECHO|ISIG);
tty_changed = (tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &t) == 0);
}
else
tty_changed = 0;
/* Write the prompt. */
fputs (prompt, out);
fflush (out);
/* Read the password. */
nread = getline (&buf, &bufsize, in);
if (buf != NULL)
{
if (nread < 0)
buf[0] = '\0';
else if (buf[nread - 1] == '\n')
{
/* Remove the newline. */
buf[nread - 1] = '\0';
if (tty_changed)
/* Write the newline that was not echoed. */
putc ('\n', out);
}
}
/* Restore the original setting. */
if (tty_changed)
(void) tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &s);
if (in != stdin)
/* We opened the terminal; now close it. */
fclose (in);
return buf;
}

114
lib/getstr.c Normal file
View File

@@ -0,0 +1,114 @@
/* getstr.c -- core function for GNU C library getline replacement function
Copyright (C) 1993, 1996-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#include <assert.h>
#if STDC_HEADERS
# include <stdlib.h>
#else
char *malloc (), *realloc ();
#endif
/* Always add at least this many bytes when extending the buffer. */
#define MIN_CHUNK 64
/* Read up to (and including) a delimiter DELIM1 from STREAM into *LINEPTR
+ OFFSET (and NUL-terminate it). If DELIM2 is non-zero, then read up
and including the first occurrence of DELIM1 or DELIM2. *LINEPTR is
a pointer returned from malloc (or NULL), pointing to *N characters of
space. It is realloc'd as necessary. Return the number of characters
read (not including the NUL terminator), or -1 on error or EOF. */
int
getstr (char **lineptr, size_t *n, FILE *stream, int delim1, int delim2,
size_t offset)
{
int nchars_avail; /* Allocated but unused chars in *LINEPTR. */
char *read_pos; /* Where we're reading into *LINEPTR. */
int ret;
if (!lineptr || !n || !stream)
return -1;
if (!*lineptr)
{
*n = MIN_CHUNK;
*lineptr = malloc (*n);
if (!*lineptr)
return -1;
}
nchars_avail = *n - offset;
read_pos = *lineptr + offset;
for (;;)
{
register int c = getc (stream);
/* We always want at least one char left in the buffer, since we
always (unless we get an error while reading the first char)
NUL-terminate the line buffer. */
assert(*n - nchars_avail == read_pos - *lineptr);
if (nchars_avail < 2)
{
if (*n > MIN_CHUNK)
*n *= 2;
else
*n += MIN_CHUNK;
nchars_avail = *n + *lineptr - read_pos;
*lineptr = realloc (*lineptr, *n);
if (!*lineptr)
return -1;
read_pos = *n - nchars_avail + *lineptr;
assert(*n - nchars_avail == read_pos - *lineptr);
}
if (c == EOF || ferror (stream))
{
/* Return partial line, if any. */
if (read_pos == *lineptr)
return -1;
else
break;
}
*read_pos++ = c;
nchars_avail--;
if (c == delim1 || (delim2 && c == delim2))
/* Return the line. */
break;
}
/* Done - NUL terminate and return the number of chars read. */
*read_pos = '\0';
ret = read_pos - (*lineptr + offset);
return ret;
}

19
lib/getstr.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef GETSTR_H_
# define GETSTR_H_ 1
# include <stdio.h>
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
int
getstr PARAMS ((char **lineptr, size_t *n, FILE *stream,
int delim1, int delim2,
size_t offset));
#endif

View File

@@ -1,5 +1,5 @@
/* getugroups.c -- return a list of the groups a user is in
Copyright (C) 1990, 1991, 1998, 1999 Free Software Foundation.
Copyright (C) 1990, 1991, 1998, 1999, 2000 Free Software Foundation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,6 +41,8 @@ struct group *getgrent ();
# include <strings.h>
#endif
#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
/* Like `getgroups', but for user USERNAME instead of for the current
process. Store at most MAXCOUNT group IDs in the GROUPLIST array.
If GID is not -1, store it first (if possible). GID should be the
@@ -55,7 +57,7 @@ getugroups (int maxcount, GETGROUPS_T *grouplist, char *username, gid_t gid)
register char **cp;
register int count = 0;
if (gid != -1)
if (gid != (gid_t) -1)
{
if (maxcount != 0)
grouplist[count] = gid;
@@ -64,14 +66,17 @@ getugroups (int maxcount, GETGROUPS_T *grouplist, char *username, gid_t gid)
setgrent ();
while ((grp = getgrent ()) != 0)
for (cp = grp->gr_mem; *cp; ++cp)
if (!strcmp (username, *cp))
{
for (cp = grp->gr_mem; *cp; ++cp)
{
int n;
if ( ! STREQ (username, *cp))
continue;
/* See if this group number is already on the list. */
for (n = 0; n < count; ++n)
if (grouplist[n] == grp->gr_gid)
if (grouplist && grouplist[n] == grp->gr_gid)
break;
/* If it's a new group number, then try to add it to the list. */
@@ -89,6 +94,8 @@ getugroups (int maxcount, GETGROUPS_T *grouplist, char *username, gid_t gid)
count++;
}
}
}
endgrent ();
return count;
}

View File

@@ -1,5 +1,5 @@
/* getusershell.c -- Return names of valid user shells.
Copyright (C) 1991, 1997 Free Software Foundation, Inc.
Copyright (C) 1991, 1997, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <ctype.h>
#include "xalloc.h"
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define IN_CTYPE_DOMAIN(c) 1
@@ -37,15 +38,6 @@
#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
#ifdef STDC_HEADERS
# include <stdlib.h>
#else
char *malloc ();
char *realloc ();
#endif
char *xstrdup ();
static int readname ();
/* List of shells to use if the shells file is missing. */
@@ -126,39 +118,6 @@ endusershell ()
}
}
/* Allocate N bytes of memory dynamically, with error checking. */
static char *
xmalloc (n)
unsigned n;
{
char *p;
p = malloc (n);
if (p == 0)
{
fprintf (stderr, "virtual memory exhausted\n");
exit (1);
}
return p;
}
/* Reallocate space P to size N, with error checking. */
static char *
xrealloc (p, n)
char *p;
unsigned n;
{
p = realloc (p, n);
if (p == 0)
{
fprintf (stderr, "virtual memory exhausted\n");
exit (1);
}
return p;
}
/* Read a line from STREAM, removing any newline at the end.
Place the result in *NAME, which is malloc'd
and/or realloc'd as necessary and can start out NULL,

85
lib/hard-locale.c Normal file
View File

@@ -0,0 +1,85 @@
/* hard-locale.c -- Determine whether a locale is hard.
Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#ifndef __GNUC__
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
# pragma alloca
# else
# ifdef _WIN32
# include <malloc.h>
# include <io.h>
# else
# ifndef alloca
char *alloca ();
# endif
# endif
# endif
# endif
#endif
#if HAVE_LOCALE_H
# include <locale.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#endif
/* Return nonzero if the current CATEGORY locale is hard, i.e. if you
can't get away with assuming traditional C or POSIX behavior. */
int
hard_locale (int category)
{
#if ! (defined ENABLE_NLS && HAVE_SETLOCALE)
return 0;
#else
int hard = 1;
char const *p = setlocale (category, 0);
if (p)
{
# if defined __GLIBC__ && __GLIBC__ >= 2
if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)
hard = 0;
# else
char *locale = alloca (strlen (p) + 1);
strcpy (locale, p);
/* Temporarily set the locale to the "C" and "POSIX" locales to
find their names, so that we can determine whether one or the
other is the caller's locale. */
if (((p = setlocale (category, "C")) && strcmp (p, locale) == 0)
|| ((p = setlocale (category, "POSIX")) && strcmp (p, locale) == 0))
hard = 0;
/* Restore the caller's locale. */
setlocale (category, locale);
# endif
}
return hard;
#endif
}

18
lib/hard-locale.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef HARD_LOCALE_H_
# define HARD_LOCALE_H_ 1
# if HAVE_CONFIG_H
# include <config.h>
# endif
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
int hard_locale PARAMS ((int));
#endif /* HARD_LOCALE_H_ */

View File

@@ -1,5 +1,5 @@
/* hash - hashing table processing.
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
Written by Jim Meyering, 1992.
This program is free software; you can redistribute it and/or modify
@@ -35,9 +35,16 @@ typedef enum {false = 0, true = 1} bool;
#include <stdio.h>
#include <assert.h>
#ifndef HAVE_DECL_FREE
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_FREE
void free ();
#endif
#ifndef HAVE_DECL_MALLOC
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_MALLOC
char *malloc ();
#endif
@@ -445,8 +452,8 @@ hash_reset_tuning (Hash_tuning *tuning)
/* For the given hash TABLE, check the user supplied tuning structure for
reasonable values, and return true if there is no gross error with it.
Otherwise, definitvely reset the TUNING field to some acceptable default in
the hash table (that is, the user loses the right of further modifying
Otherwise, definitively reset the TUNING field to some acceptable default
in the hash table (that is, the user loses the right of further modifying
tuning arguments), and return false. */
static bool
@@ -468,15 +475,14 @@ check_tuning (Hash_table *table)
return false;
}
/* Allocate and return a new hash table, or NULL upon failure. The
initial number of buckets is automatically selected so as to _guarantee_ that
you may insert at least CANDIDATE different user entries before any growth
of the hash table size occurs. So, if have a reasonably tight a-priori
upper bound on the
number of entries you intend to insert in the hash table, you may save some
table memory and insertion time, by specifying it here. If the
IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE argument
has its meaning changed to the wanted number of buckets.
/* Allocate and return a new hash table, or NULL upon failure. The initial
number of buckets is automatically selected so as to _guarantee_ that you
may insert at least CANDIDATE different user entries before any growth of
the hash table size occurs. So, if have a reasonably tight a-priori upper
bound on the number of entries you intend to insert in the hash table, you
may save some table memory and insertion time, by specifying it here. If
the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE
argument has its meaning changed to the wanted number of buckets.
TUNING points to a structure of user-supplied values, in case some fine
tuning is wanted over the default behavior of the hasher. If TUNING is
@@ -717,7 +723,7 @@ hash_find_entry (Hash_table *table, const void *entry,
if (bucket->data == NULL)
return NULL;
/* Check if then entry is found as the bucket head. */
/* See if the entry is the first in the bucket. */
if ((*table->comparator) (entry, bucket->data))
{
void *data = bucket->data;
@@ -769,8 +775,8 @@ hash_find_entry (Hash_table *table, const void *entry,
/* For an already existing hash table, change the number of buckets through
specifying CANDIDATE. The contents of the hash table are preserved. The
new number of buckets is automatically selected so as to _guarantee_ that the
table may receive at least CANDIDATE different user entries, including
new number of buckets is automatically selected so as to _guarantee_ that
the table may receive at least CANDIDATE different user entries, including
those already in the table, before any other growth of the hash table size
occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the
exact number of buckets desired. */
@@ -848,6 +854,7 @@ hash_rehash (Hash_table *table, unsigned candidate)
table->bucket_limit = new_table->bucket_limit;
table->n_buckets = new_table->n_buckets;
table->n_buckets_used = new_table->n_buckets_used;
table->free_entry_list = new_table->free_entry_list;
/* table->n_entries already holds its value. */
#if USE_OBSTACK
table->entry_stack = new_table->entry_stack;
@@ -937,7 +944,8 @@ hash_delete (Hash_table *table, const void *entry)
void *data;
struct hash_entry *bucket;
if (data = hash_find_entry (table, entry, &bucket, true), !data)
data = hash_find_entry (table, entry, &bucket, true);
if (!data)
return NULL;
table->n_entries--;

View File

@@ -1,5 +1,5 @@
/* human.c -- print human readable file size
Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,10 +23,6 @@
# include <config.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#include <sys/types.h>
#include <stdio.h>
@@ -34,6 +30,12 @@
# include <limits.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
@@ -42,6 +44,9 @@
#endif
#ifndef HAVE_DECL_GETENV
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_GETENV
char *getenv ();
#endif
@@ -71,14 +76,42 @@ static const char suffixes[] =
'Y' /* Yotta */
};
/* If INEXACT_STYLE is not human_round_to_even, and if easily
possible, adjust VALUE according to the style. */
static double
adjust_value (enum human_inexact_style inexact_style, double value)
{
/* Do not use the floor or ceil functions, as that would mean
linking with the standard math library, which is a porting pain.
So leave the value alone if it is too large to easily round. */
if (inexact_style != human_round_to_even && value < (uintmax_t) -1)
{
uintmax_t u = value;
value = u + (inexact_style == human_ceiling && u != value);
}
return value;
}
/* Like human_readable_inexact, except always round to even. */
char *
human_readable (uintmax_t n, char *buf,
int from_block_size, int output_block_size)
{
return human_readable_inexact (n, buf, from_block_size, output_block_size,
human_round_to_even);
}
/* Convert N to a human readable format in BUF.
N is expressed in units of FROM_BLOCK_SIZE. FROM_BLOCK_SIZE must
be positive.
be nonnegative.
If OUTPUT_BLOCK_SIZE is positive, use units of OUTPUT_BLOCK_SIZE in
the output number. OUTPUT_BLOCK_SIZE must be a multiple of
FROM_BLOCK_SIZE or vice versa.
OUTPUT_BLOCK_SIZE must be nonzero. If it is positive, use units of
OUTPUT_BLOCK_SIZE in the output number.
Use INEXACT_STYLE to determine whether to take the ceiling or floor
of any result that cannot be expressed exactly.
If OUTPUT_BLOCK_SIZE is negative, use a format like "127k" if
possible, using powers of -OUTPUT_BLOCK_SIZE; otherwise, use
@@ -93,13 +126,14 @@ static const char suffixes[] =
than -OUTPUT_BLOCK_SIZE aren't modified. */
char *
human_readable (uintmax_t n, char *buf,
int from_block_size, int output_block_size)
human_readable_inexact (uintmax_t n, char *buf,
int from_block_size, int output_block_size,
enum human_inexact_style inexact_style)
{
uintmax_t amt;
int base;
int to_block_size;
int tenths;
int tenths = 0;
int power;
char *p;
@@ -107,7 +141,7 @@ human_readable (uintmax_t n, char *buf,
1 means AMT.TENTHS < adjusted N < AMT.TENTHS + 0.05;
2 means adjusted N == AMT.TENTHS + 0.05;
3 means AMT.TENTHS + 0.05 < adjusted N < AMT.TENTHS + 0.1. */
int rounding;
int rounding = 0;
if (output_block_size < 0)
{
@@ -130,56 +164,58 @@ human_readable (uintmax_t n, char *buf,
/* Adjust AMT out of FROM_BLOCK_SIZE units and into TO_BLOCK_SIZE units. */
if (to_block_size <= from_block_size)
{
int multiplier = from_block_size / to_block_size;
amt = n * multiplier;
tenths = rounding = 0;
{
int multiplier;
int divisor;
int r2;
int r10;
if (to_block_size <= from_block_size
? (from_block_size % to_block_size != 0
|| (multiplier = from_block_size / to_block_size,
(amt = n * multiplier) / multiplier != n))
: (from_block_size == 0
|| to_block_size % from_block_size != 0
|| (divisor = to_block_size / from_block_size,
r10 = (n % divisor) * 10,
r2 = (r10 % divisor) * 2,
amt = n / divisor,
tenths = r10 / divisor,
rounding = r2 < divisor ? 0 < r2 : 2 + (divisor < r2),
0)))
{
/* Either the result cannot be computed easily using uintmax_t,
or from_block_size is zero. Fall back on floating point.
FIXME: This can yield answers that are slightly off. */
if (amt / multiplier != n)
{
/* Overflow occurred during multiplication. We should use
multiple precision arithmetic here, but we'll be lazy and
resort to floating point. This can yield answers that
are slightly off. In practice it is quite rare to
overflow uintmax_t, so this is good enough for now. */
double damt = n * (from_block_size / (double) to_block_size);
double damt = n * (double) multiplier;
if (! base)
sprintf (buf, "%.0f", adjust_value (inexact_style, damt));
else
{
double e = 1;
power = 0;
if (! base)
sprintf (buf, "%.0f", damt);
else
{
double e = 1;
power = 0;
do
{
e *= base;
power++;
}
while (e * base <= damt && power < sizeof suffixes - 1);
do
{
e *= base;
power++;
}
while (e * base <= damt && power < sizeof suffixes - 1);
damt /= e;
damt /= e;
sprintf (buf, "%.1f%c", damt, suffixes[power]);
if (4 < strlen (buf))
sprintf (buf, "%.0f%c", damt, suffixes[power]);
}
return buf;
}
}
else
{
int divisor = to_block_size / from_block_size;
int r10 = (n % divisor) * 10;
int r2 = (r10 % divisor) * 2;
amt = n / divisor;
tenths = r10 / divisor;
rounding = r2 < divisor ? 0 < r2 : 2 + (divisor < r2);
}
sprintf (buf, "%.1f%c", adjust_value (inexact_style, damt),
suffixes[power]);
if (4 < strlen (buf))
sprintf (buf, "%.0f%c",
adjust_value (inexact_style, damt * 10) / 10,
suffixes[power]);
}
return buf;
}
}
/* Use power of BASE notation if adjusted AMT is large enough. */
@@ -204,24 +240,33 @@ human_readable (uintmax_t n, char *buf,
if (amt < 10)
{
tenths += 2 < rounding + (tenths & 1);
if (tenths == 10)
if (2 * (1 - (int) inexact_style)
< rounding + (tenths & (inexact_style == human_round_to_even)))
{
amt++;
tenths = 0;
tenths++;
rounding = 0;
if (tenths == 10)
{
amt++;
tenths = 0;
}
}
if (amt < 10)
{
*--p = '0' + tenths;
*--p = '.';
tenths = 0;
tenths = rounding = 0;
}
}
}
if (5 < tenths + (2 < rounding + (amt & 1)))
if (inexact_style == human_ceiling
? 0 < tenths + rounding
: inexact_style == human_round_to_even
? 5 < tenths + (2 < rounding + (amt & 1))
: /* inexact_style == human_floor */ 0)
{
amt++;
@@ -251,13 +296,19 @@ human_readable (uintmax_t n, char *buf,
static char const *const block_size_args[] = { "human-readable", "si", 0 };
static int const block_size_types[] = { -1024, -1000 };
static int
default_block_size (void)
{
return getenv ("POSIXLY_CORRECT") ? 512 : DEFAULT_BLOCK_SIZE;
}
static strtol_error
humblock (char const *spec, int *block_size)
{
int i;
if (! spec && ! (spec = getenv ("BLOCK_SIZE")))
*block_size = getenv ("POSIXLY_CORRECT") ? 512 : DEFAULT_BLOCK_SIZE;
*block_size = default_block_size ();
else if (0 <= (i = ARGMATCH (spec, block_size_args, block_size_types)))
*block_size = block_size_types[i];
else
@@ -281,6 +332,11 @@ void
human_block_size (char const *spec, int report_errors, int *block_size)
{
strtol_error e = humblock (spec, block_size);
if (*block_size == 0)
{
*block_size = default_block_size ();
e = LONGINT_INVALID;
}
if (e != LONGINT_OK && report_errors)
STRTOL_FATAL_ERROR (spec, _("block size"), e);
}

View File

@@ -1,6 +1,14 @@
#ifndef HUMAN_H_
# define HUMAN_H_ 1
# if HAVE_CONFIG_H
# include <config.h>
# endif
# if HAVE_INTTYPES_H
# include <inttypes.h>
# endif
/* A conservative bound on the maximum length of a human-readable string.
The output can be the product of the largest uintmax_t and the largest int,
so add their sizes before converting to a bound on digits. */
@@ -15,7 +23,16 @@
# endif
# endif
enum human_inexact_style
{
human_floor = -1,
human_round_to_even = 0,
human_ceiling = 1
};
char *human_readable PARAMS ((uintmax_t, char *, int, int));
char *human_readable_inexact PARAMS ((uintmax_t, char *, int, int,
enum human_inexact_style));
void human_block_size PARAMS ((char const *, int, int *));

View File

@@ -1,46 +0,0 @@
#! /bin/sh
# interlock - wrap program invocation in lock to allow
# parallel builds to work.
# Written by Tom Tromey <tromey@cygnus.com>, Aug 10 1996
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Usage:
# interlock lock-dir-name program args-to-program...
dirname="$1"
program="$2"
shift
shift
while (mkdir $dirname > /dev/null 2>&1 && exit 1 || exit 0); do
# Wait a bit.
sleep 1
done
# Race condition here: if interrupted after the loop but before this
# trap, the lock can be left around.
trap "rmdir $dirname > /dev/null 2>&1" 1 2 3 15
# We have the lock, so run the program.
$program ${1+"$@"}
ret=$?
# Release the lock.
rmdir $dirname > /dev/null 2>&1
exit $ret

View File

@@ -27,6 +27,13 @@ extern int errno;
#endif
#include "lchown.h"
#ifdef STAT_MACROS_BROKEN
# undef S_ISLNK
#endif
#if !defined(S_ISLNK) && defined(S_IFLNK)
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#endif
/* Declare chown to avoid a warning. Don't include unistd.h,
because it may have a conflicting prototype for lchown. */
int chown ();

View File

@@ -4,6 +4,6 @@
# define ENOSYS ENOTSUP
# else
/* Some systems don't have ENOTSUP either. */
# define ENOSYS ENOMSG
# define ENOSYS EINVAL
# endif
#endif

View File

@@ -1,5 +1,5 @@
/* linebuffer.c -- read arbitrarily long lines
Copyright (C) 1986, 1991, 1998 Free Software Foundation, Inc.
Copyright (C) 1986, 1991, 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
#endif
#include <stdio.h>
#include <sys/types.h>
#include "linebuffer.h"
char *xmalloc ();
@@ -39,9 +40,9 @@ initbuffer (struct linebuffer *linebuffer)
}
/* Read an arbitrarily long line of text from STREAM into LINEBUFFER.
Remove any newline. Does not null terminate.
Return zero upon error or upon end of file.
Otherwise, return LINEBUFFER. */
Keep the newline; append a newline if it's the last line of a file
that ends in a non-newline character. Do not null terminate.
Return LINEBUFFER, except at end of file return 0. */
struct linebuffer *
readline (struct linebuffer *linebuffer, FILE *stream)
@@ -52,33 +53,32 @@ readline (struct linebuffer *linebuffer, FILE *stream)
char *end = buffer + linebuffer->size; /* Sentinel. */
if (feof (stream) || ferror (stream))
{
linebuffer->length = 0;
return 0;
}
return 0;
while (1)
do
{
c = getc (stream);
if (c == EOF)
{
if (p == buffer)
return 0;
if (p[-1] == '\n')
break;
c = '\n';
}
if (p == end)
{
linebuffer->size *= 2;
buffer = (char *) xrealloc (buffer, linebuffer->size);
p += buffer - linebuffer->buffer;
p = p - linebuffer->buffer + buffer;
linebuffer->buffer = buffer;
end = buffer + linebuffer->size;
}
if (c == EOF || c == '\n')
break;
*p++ = c;
}
while (c != '\n');
if (feof (stream) && p == buffer)
{
linebuffer->length = 0;
return 0;
}
linebuffer->length = p - linebuffer->buffer;
linebuffer->length = p - buffer;
return linebuffer;
}

View File

@@ -1,5 +1,5 @@
/* linebuffer.h -- declarations for reading arbitrarily long lines
Copyright (C) 1986, 1991, 1998 Free Software Foundation, Inc.
Copyright (C) 1986, 1991, 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,8 +22,8 @@
struct linebuffer
{
long size; /* Allocated. */
long length; /* Used. */
size_t size; /* Allocated. */
size_t length; /* Used. */
char *buffer;
};
@@ -39,7 +39,8 @@ struct linebuffer
void initbuffer PARAMS ((struct linebuffer *linebuffer));
/* Read an arbitrarily long line of text from STREAM into LINEBUFFER.
Remove any newline. Does not null terminate.
Keep the newline; append a newline if it's the last line of a file
that ends in a non-newline character. Do not null terminate.
Return LINEBUFFER, except at end of file return 0. */
struct linebuffer *readline PARAMS ((struct linebuffer *linebuffer,
FILE *stream));

228
lib/localcharset.c Normal file
View File

@@ -0,0 +1,228 @@
/* Determine a canonical name for the current locale's character encoding.
Copyright (C) 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
/* Written by Bruno Haible <haible@clisp.cons.org>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_STDDEF_H
# include <stddef.h>
#endif
#include <stdio.h>
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#if HAVE_LANGINFO_CODESET
# include <langinfo.h>
#else
# if HAVE_SETLOCALE
# include <locale.h>
# endif
#endif
#ifndef DIRECTORY_SEPARATOR
# define DIRECTORY_SEPARATOR '/'
#endif
#ifndef ISSLASH
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
#endif
/* The following static variable is declared 'volatile' to avoid a
possible multithread problem in the function get_charset_aliases. If we
are running in a threaded environment, and if two threads initialize
'charset_aliases' simultaneously, both will produce the same value,
and everything will be ok if the two assignments to 'charset_aliases'
are atomic. But I don't know what will happen if the two assignments mix. */
/* Pointer to the contents of the charset.alias file, if it has already been
read, else NULL. Its format is:
ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
static char * volatile charset_aliases;
/* Return a pointer to the contents of the charset.alias file. */
static const char *
get_charset_aliases ()
{
char *cp;
cp = charset_aliases;
if (cp == NULL)
{
FILE *fp;
const char *dir = LIBDIR;
const char *base = "charset.alias";
char *file_name;
/* Concatenate dir and base into freshly allocated file_name. */
{
size_t dir_len = strlen (dir);
size_t base_len = strlen (base);
int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
if (file_name != NULL)
{
memcpy (file_name, dir, dir_len);
if (add_slash)
file_name[dir_len] = DIRECTORY_SEPARATOR;
memcpy (file_name + dir_len + add_slash, base, base_len + 1);
}
}
if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
/* Out of memory or file not found, treat it as empty. */
cp = "";
else
{
/* Parse the file's contents. */
int c;
char buf1[50+1];
char buf2[50+1];
char *res_ptr = NULL;
size_t res_size = 0;
size_t l1, l2;
for (;;)
{
c = getc (fp);
if (c == EOF)
break;
if (c == '\n' || c == ' ' || c == '\t')
continue;
if (c == '#')
{
/* Skip comment, to end of line. */
do
c = getc (fp);
while (!(c == EOF || c == '\n'));
if (c == EOF)
break;
continue;
}
ungetc (c, fp);
if (fscanf(fp, "%50s %50s", buf1, buf2) < 2)
break;
l1 = strlen (buf1);
l2 = strlen (buf2);
if (res_size == 0)
{
res_size = l1 + 1 + l2 + 1;
res_ptr = malloc (res_size + 1);
}
else
{
res_size += l1 + 1 + l2 + 1;
res_ptr = realloc (res_ptr, res_size + 1);
}
if (res_ptr == NULL)
{
/* Out of memory. */
res_size = 0;
break;
}
strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
strcpy (res_ptr + res_size - (l2 + 1), buf2);
}
fclose (fp);
if (res_size == 0)
cp = "";
else
{
*(res_ptr + res_size) = '\0';
cp = res_ptr;
}
}
charset_aliases = cp;
if (file_name != NULL)
free (file_name);
}
return cp;
}
/* Determine the current locale's character encoding, and canonicalize it
into one of the canonical names listed in config.charset.
The result must not be freed; it is statically allocated.
If the canonical name cannot be determined, the result is a non-canonical
name or NULL. */
#ifdef STATIC
STATIC
#endif
const char *
locale_charset ()
{
const char *codeset;
const char *aliases;
#if HAVE_LANGINFO_CODESET
/* Most systems support nl_langinfo (CODESET) nowadays. */
codeset = nl_langinfo (CODESET);
#else
/* On old systems which lack it, use setlocale and getenv. */
const char *locale = NULL;
# if HAVE_SETLOCALE
locale = setlocale (LC_CTYPE, NULL);
# endif
if (locale == NULL || locale[0] == '\0')
{
locale = getenv ("LC_ALL");
if (locale == NULL || locale[0] == '\0')
{
locale = getenv ("LC_CTYPE");
if (locale == NULL || locale[0] == '\0')
locale = getenv ("LANG");
}
}
/* On some old systems, one used to set locale = "iso8859_1". On others,
you set it to "language_COUNTRY.charset". In any case, we resolve it
through the charset.alias file. */
codeset = locale;
#endif
if (codeset != NULL && codeset[0] != '\0')
{
/* Resolve alias. */
for (aliases = get_charset_aliases ();
*aliases != '\0';
aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
if (!strcmp (codeset, aliases))
{
codeset = aliases + strlen (aliases) + 1;
break;
}
}
return codeset;
}

View File

@@ -1,5 +1,5 @@
/* Utility to accept --help and --version options as unobtrusively as possible.
Copyright (C) 1993, 1994, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1993, 1994, 1998, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,7 +23,10 @@
#include <stdio.h>
#include <getopt.h>
#include "closeout.h"
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include "long-options.h"
#include "version-etc.h"
@@ -71,8 +74,6 @@ parse_long_options (int argc,
case 'v':
version_etc (stdout, command_name, package, version, authors);
close_stdout (); /* FIXME: output failure exit status
should be settable via an arg. */
exit (0);
default:

View File

@@ -1,5 +1,5 @@
/* makepath.c -- Ensure that a directory path exists.
Copyright (C) 1990, 1997, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1990, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -50,6 +50,10 @@ char *alloca ();
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
#ifndef S_IRWXUGO
# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
#endif
#if STDC_HEADERS
# include <stdlib.h>
#endif
@@ -71,16 +75,34 @@ extern int errno;
# endif
#endif
#ifndef S_ISUID
# define S_ISUID 04000
#endif
#ifndef S_ISGID
# define S_ISGID 02000
#endif
#ifndef S_ISVTX
# define S_ISVTX 01000
#endif
#ifndef S_IRUSR
# define S_IRUSR 0200
#endif
#ifndef S_IWUSR
# define S_IWUSR 0200
#endif
#ifndef S_IXUSR
# define S_IXUSR 0100
#endif
#ifndef S_IRWXU
# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
#endif
#define WX_USR (S_IWUSR | S_IXUSR)
/* Include this before libintl.h so we get our definition of PARAMS. */
#include "makepath.h"
#if HAVE_LOCALE_H
# include <locale.h>
#endif
@@ -92,13 +114,7 @@ extern int errno;
# define _(Text) Text
#endif
#ifdef __MSDOS__
typedef int uid_t;
typedef int gid_t;
#endif
#include "save-cwd.h"
#include "makepath.h"
#include "error.h"
void strip_trailing_slashes ();
@@ -145,6 +161,7 @@ make_dir (const char *dir, const char *dirpath, mode_t mode, int *created_dir_p)
if (!created_dir)
{
struct stat stats;
int saved_errno = errno;
/* The mkdir and stat calls below may appear to be reversed.
They are not. It is important to call mkdir first and then to
@@ -156,7 +173,7 @@ make_dir (const char *dir, const char *dirpath, mode_t mode, int *created_dir_p)
if (stat (dir, &stats))
{
error (0, errno, _("cannot create directory `%s'"), dirpath);
error (0, saved_errno, _("cannot create directory `%s'"), dirpath);
fail = 1;
}
else if (!S_ISDIR (stats.st_mode))
@@ -223,7 +240,7 @@ make_path (const char *argpath,
char *dirpath;
/* Temporarily relax umask in case it's overly restrictive. */
int oldmask = umask (0);
mode_t oldmask = umask (0);
/* Make a copy of ARGPATH that we can scribble NULs on. */
dirpath = (char *) alloca (strlen (argpath) + 1);
@@ -235,9 +252,9 @@ make_path (const char *argpath,
their owners, we need to fix their permissions after making them. */
if (((parent_mode & WX_USR) != WX_USR)
|| ((owner != (uid_t) -1 || group != (gid_t) -1)
&& (parent_mode & 07000) != 0))
&& (parent_mode & (S_ISUID | S_ISGID | S_ISVTX)) != 0))
{
tmp_mode = 0700;
tmp_mode = S_IRWXU;
re_protect = 1;
}
else
@@ -290,7 +307,7 @@ make_path (const char *argpath,
if (newly_created_dir)
{
if (verbose_fmt_string)
fprintf (stderr, verbose_fmt_string, dirpath);
error (0, 0, verbose_fmt_string, dirpath);
if ((owner != (uid_t) -1 || group != (gid_t) -1)
&& chown (basename_dir, owner, group)
@@ -351,7 +368,7 @@ make_path (const char *argpath,
if (verbose_fmt_string != NULL)
error (0, 0, verbose_fmt_string, dirpath);
if (owner != (uid_t) -1 && group != (gid_t) -1)
if (owner != (uid_t) -1 || group != (gid_t) -1)
{
if (chown (basename_dir, owner, group)
#ifdef AFS
@@ -362,12 +379,18 @@ make_path (const char *argpath,
error (0, errno, _("cannot chown %s"), dirpath);
retval = 1;
}
/* chown may have turned off some permission bits we wanted. */
if ((mode & 07000) != 0 && chmod (basename_dir, mode))
{
error (0, errno, _("cannot chmod %s"), dirpath);
retval = 1;
}
}
/* The above chown may have turned off some permission bits in MODE.
Another reason we may have to use chmod here is that mkdir(2) is
required to honor only the file permission bits. In particular,
it need not honor the `special' bits, so if MODE includes any
special bits, set them here. */
if ((mode & ~S_IRWXUGO)
&& chmod (basename_dir, mode))
{
error (0, errno, _("cannot chmod %s"), dirpath);
retval = 1;
}
CLEANUP_CWD;

View File

@@ -1,6 +1,6 @@
/* md5.h - Declaration of functions and data types used for MD5 sum
computing library functions.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -118,7 +118,7 @@ extern void md5_process_bytes __P ((const void *buffer, size_t len,
endian byte order, so that a byte-wise output yields to the wanted
ASCII representation of the message digest.
IMPORTANT: On some systems it is required that RESBUF is correctly
IMPORTANT: On some systems it is required that RESBUF be correctly
aligned for a 32 bits value. */
extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf));

View File

@@ -1,5 +1,5 @@
/* Case-insensitive buffer comparator.
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,9 +15,9 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Jim Meyering (meyering@na-net.ornl.gov) */
/* Written by Jim Meyering. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
@@ -25,16 +25,16 @@
#include <ctype.h>
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define IN_CTYPE_DOMAIN(c) 1
# define IN_CTYPE_DOMAIN(Char) 1
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
# define IN_CTYPE_DOMAIN(Char) isascii(Char)
#endif
#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
#define ISLOWER(Char) (IN_CTYPE_DOMAIN (Char) && islower (Char))
#if _LIBC || STDC_HEADERS
# define TOUPPER(c) toupper (c)
# define TOUPPER(Char) toupper (Char)
#else
# define TOUPPER(c) (ISLOWER (c) ? toupper (c) : (c))
# define TOUPPER(Char) (ISLOWER (Char) ? toupper (Char) : (Char))
#endif
#include "memcasecmp.h"
@@ -44,14 +44,11 @@
join -i works with sort -f. */
int
memcasecmp (vs1, vs2, n)
const void *vs1;
const void *vs2;
size_t n;
memcasecmp (const void *vs1, const void *vs2, size_t n)
{
unsigned int i;
unsigned char *s1 = (unsigned char *) vs1;
unsigned char *s2 = (unsigned char *) vs2;
unsigned char const *s1 = (unsigned char const *) vs1;
unsigned char const *s2 = (unsigned char const *) vs2;
for (i = 0; i < n; i++)
{
unsigned char u1 = *s1++;

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1993, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1993, 1997, 1999 Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
with help from Dan Sahlin (dan@sics.se) and
commentary by Jim Blandy (jimb@ai.mit.edu);
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif
#undef __ptr_t
@@ -45,7 +45,7 @@ USA. */
#define LONG_MAX_32_BITS 2147483647
#ifndef LONG_MAX
#define LONG_MAX LONG_MAX_32_BITS
# define LONG_MAX LONG_MAX_32_BITS
#endif
#include <sys/types.h>

71
lib/memcoll.c Normal file
View File

@@ -0,0 +1,71 @@
/* Locale-specific memory comparison.
Copyright 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Contributed by Paul Eggert <eggert@twinsun.com>. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#endif
/* Compare S1 (with length S1LEN) and S2 (with length S2LEN) according
to the LC_COLLATE locale. S1 and S2 do not overlap, and are not
adjacent. Temporarily modify the bytes after S1 and S2, but
restore their original contents before returning. */
int
memcoll (char *s1, size_t s1len, char *s2, size_t s2len)
{
int diff;
char n1 = s1[s1len];
char n2 = s2[s2len];
s1[s1len++] = '\0';
s2[s2len++] = '\0';
while (! (diff = strcoll (s1, s2)))
{
/* strcoll found no difference, but perhaps it was fooled by NUL
characters in the data. Work around this problem by advancing
past the NUL chars. */
size_t size1 = strlen (s1) + 1;
size_t size2 = strlen (s2) + 1;
s1 += size1;
s2 += size2;
s1len -= size1;
s2len -= size2;
if (s1len == 0)
{
if (s2len != 0)
diff = -1;
break;
}
else if (s2len == 0)
{
diff = 1;
break;
}
}
s1[s1len - 1] = n1;
s2[s2len - 1] = n2;
return diff;
}

18
lib/memcoll.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef MEMCOLL_H_
# define MEMCOLL_H_ 1
# if HAVE_CONFIG_H
# include <config.h>
# endif
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
int memcoll PARAMS ((char *, size_t, char *, size_t));
#endif /* MEMCOLL_H_ */

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1995, 1997, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,10 +25,7 @@
Return DESTADDR. */
char *
memcpy (destaddr, srcaddr, len)
char *destaddr;
const char *srcaddr;
int len;
memcpy (char *destaddr, const char *srcaddr, int len)
{
char *dest = destaddr;

View File

@@ -1,96 +0,0 @@
/* BSD compatible make directory function for System V
Copyright (C) 1988, 1990, 1998 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#if STAT_MACROS_BROKEN
# undef S_ISDIR
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
/* mkdir adapted from GNU tar. */
/* Make directory DPATH, with permission mode DMODE.
Written by Robert Rother, Mariah Corporation, August 1985
(sdcsvax!rmr or rmr@uscd). If you want it, it's yours.
Severely hacked over by John Gilmore to make a 4.2BSD compatible
subroutine. 11Mar86; hoptoad!gnu
Modified by rmtodd@uokmax 6-28-87 -- when making an already existing dir,
subroutine didn't return EEXIST. It does now. */
int
mkdir (const char *dpath, int dmode)
{
pid_t cpid;
int status;
struct stat statbuf;
if (stat (dpath, &statbuf) == 0)
{
errno = EEXIST; /* stat worked, so it already exists. */
return -1;
}
/* If stat fails for a reason other than non-existence, return error. */
if (errno != ENOENT)
return -1;
cpid = fork ();
switch (cpid)
{
case -1: /* Cannot fork. */
return -1; /* errno is already set. */
case 0: /* Child process. */
/* Cheap hack to set mode of new directory. Since this child
process is going away anyway, we zap its umask.
This won't suffice to set SUID, SGID, etc. on this
directory, so the parent process calls chmod afterward. */
status = umask (0); /* Get current umask. */
umask (status | (0777 & ~dmode)); /* Set for mkdir. */
execl ("/bin/mkdir", "mkdir", dpath, (char *) 0);
_exit (1);
default: /* Parent process. */
/* Wait for kid to finish. */
while (wait (&status) != cpid)
/* Do nothing. */ ;
if (status)
{
/* /bin/mkdir failed. */
errno = EIO;
return -1;
}
return chmod (dpath, dmode);
}
}

View File

@@ -1,5 +1,5 @@
/* modechange.c -- file mode manipulation
Copyright (C) 1989, 1990, 1997, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1989, 1990, 1997-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,9 +28,9 @@
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include "modechange.h"
#include <sys/stat.h>
#include "xstrtol.h"
#if STDC_HEADERS
# include <stdlib.h>
@@ -50,34 +50,65 @@ char *malloc ();
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
#ifndef S_ISUID
# define S_ISUID 04000
#endif
#ifndef S_ISGID
# define S_ISGID 04000
#endif
#ifndef S_ISVTX
# define S_ISVTX 01000
#endif
#ifndef S_IRUSR
# define S_IRUSR 0400
#endif
#ifndef S_IWUSR
# define S_IWUSR 0200
#endif
#ifndef S_IXUSR
# define S_IXUSR 0100
#endif
#ifndef S_IRGRP
# define S_IRGRP 0040
#endif
#ifndef S_IWGRP
# define S_IWGRP 0020
#endif
#ifndef S_IXGRP
# define S_IXGRP 0010
#endif
#ifndef S_IROTH
# define S_IROTH 0004
#endif
#ifndef S_IWOTH
# define S_IWOTH 0002
#endif
#ifndef S_IXOTH
# define S_IXOTH 0001
#endif
#ifndef S_IRWXU
# define S_IRWXU 0700
#endif
#ifndef S_IRWXG
# define S_IRWXG 0070
#endif
#ifndef S_IRWXO
# define S_IRWXO 0007
#endif
/* All the mode bits that can be affected by chmod. */
#define CHMOD_MODE_BITS \
(S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
/* Return newly allocated memory to hold one element of type TYPE. */
#define talloc(type) ((type *) malloc (sizeof (type)))
#define isodigit(c) ((c) >= '0' && (c) <= '7')
/* Return a positive integer containing the value of the ASCII
octal number S. If S is not an octal number, return -1. */
static int
oatoi (const char *s)
{
register int i;
if (*s == 0)
return -1;
for (i = 0; isodigit (*s); ++s)
i = i * 8 + *s - '0';
if (*s)
return -1;
return i;
}
/* Create a mode_change entry with the specified `=ddd'-style
mode change operation, where NEW_MODE is `ddd'. Return the
new entry, or NULL upon failure. */
static struct mode_change *
make_node_op_equals (int new_mode)
make_node_op_equals (mode_t new_mode)
{
struct mode_change *p;
p = talloc (struct mode_change);
@@ -87,7 +118,7 @@ make_node_op_equals (int new_mode)
p->op = '=';
p->flags = 0;
p->value = new_mode;
p->affected = 07777; /* Affect all permissions. */
p->affected = CHMOD_MODE_BITS; /* Affect all permissions. */
return p;
}
@@ -126,21 +157,21 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
{
struct mode_change *head; /* First element of the linked list. */
struct mode_change *tail; /* An element of the linked list. */
int i; /* General purpose temporary. */
int umask_value; /* The umask value (surprise). */
uintmax_t mode_value; /* The mode value, if octal. */
char *string_end; /* Pointer to end of parsed value. */
mode_t umask_value; /* The umask value (surprise). */
head = NULL;
#ifdef lint
tail = NULL;
#endif
i = oatoi (mode_string);
if (i >= 0)
if (xstrtoumax (mode_string, &string_end, 8, &mode_value, "") == LONGINT_OK)
{
struct mode_change *p;
if (i > 07777)
if (mode_value != (mode_value & CHMOD_MODE_BITS))
return MODE_INVALID;
p = make_node_op_equals (i);
p = make_node_op_equals ((mode_t) mode_value);
if (p == NULL)
return MODE_MEMORY_EXHAUSTED;
mode_append_entry (&head, &tail, p);
@@ -155,9 +186,9 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
do
{
/* Which bits in the mode are operated on. */
unsigned short affected_bits = 0;
mode_t affected_bits = 0;
/* `affected_bits' modified by umask. */
unsigned short affected_masked;
mode_t affected_masked;
/* Operators to actually use umask on. */
unsigned ops_to_mask = 0;
@@ -170,16 +201,16 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
switch (*mode_string)
{
case 'u':
affected_bits |= 04700;
affected_bits |= S_ISUID | S_IRWXU;
break;
case 'g':
affected_bits |= 02070;
affected_bits |= S_ISGID | S_IRWXG;
break;
case 'o':
affected_bits |= 01007;
affected_bits |= S_ISVTX | S_IRWXO;
break;
case 'a':
affected_bits |= 07777;
affected_bits |= CHMOD_MODE_BITS;
break;
default:
goto no_more_affected;
@@ -193,7 +224,7 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
else
{
who_specified_p = 0;
affected_bits = 07777;
affected_bits = CHMOD_MODE_BITS;
ops_to_mask = masked_ops;
}
@@ -238,31 +269,34 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
switch (*mode_string)
{
case 'r':
change->value |= 00444 & affected_masked;
change->value |= ((S_IRUSR | S_IRGRP | S_IROTH)
& affected_masked);
break;
case 'w':
change->value |= 00222 & affected_masked;
change->value |= ((S_IWUSR | S_IWGRP | S_IWOTH)
& affected_masked);
break;
case 'X':
change->flags |= MODE_X_IF_ANY_X;
/* Fall through. */
case 'x':
change->value |= 00111 & affected_masked;
change->value |= ((S_IXUSR | S_IXGRP | S_IXOTH)
& affected_masked);
break;
case 's':
/* Set the setuid/gid bits if `u' or `g' is selected. */
change->value |= 06000 & affected_masked;
change->value |= (S_ISUID | S_ISGID) & affected_masked;
break;
case 't':
/* Set the "save text image" bit if `o' is selected. */
change->value |= 01000 & affected_masked;
change->value |= S_ISVTX & affected_masked;
break;
case 'u':
/* Set the affected bits to the value of the `u' bits
on the same file. */
if (change->value)
goto invalid;
change->value = 00700;
change->value = S_IRWXU;
change->flags |= MODE_COPY_EXISTING;
break;
case 'g':
@@ -270,7 +304,7 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
on the same file. */
if (change->value)
goto invalid;
change->value = 00070;
change->value = S_IRWXG;
change->flags |= MODE_COPY_EXISTING;
break;
case 'o':
@@ -278,7 +312,7 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
on the same file. */
if (change->value)
goto invalid;
change->value = 00007;
change->value = S_IRWXO;
change->flags |= MODE_COPY_EXISTING;
break;
default:
@@ -313,7 +347,7 @@ mode_create_from_ref (const char *ref_file)
change->op = '=';
change->flags = 0;
change->affected = 07777;
change->affected = CHMOD_MODE_BITS;
change->value = ref_stats.st_mode;
change->next = NULL;
@@ -325,13 +359,13 @@ mode_create_from_ref (const char *ref_file)
change affects it even if no execute bits were set in OLDMODE.
The returned value has the S_IFMT bits cleared. */
unsigned short
mode_adjust (unsigned int oldmode, const struct mode_change *changes)
mode_t
mode_adjust (mode_t oldmode, const struct mode_change *changes)
{
unsigned short newmode; /* The adjusted mode and one operand. */
unsigned short value; /* The other operand. */
mode_t newmode; /* The adjusted mode and one operand. */
mode_t value; /* The other operand. */
newmode = oldmode & 07777;
newmode = oldmode & CHMOD_MODE_BITS;
for (; changes; changes = changes->next)
{
@@ -341,15 +375,21 @@ mode_adjust (unsigned int oldmode, const struct mode_change *changes)
the mask `changes->value'. */
value = newmode & changes->value;
if (changes->value & 00700)
if (changes->value & S_IRWXU)
/* Copy `u' permissions onto `g' and `o'. */
value |= (value >> 3) | (value >> 6);
else if (changes->value & 00070)
value |= ((value & S_IRUSR ? S_IRGRP | S_IROTH : 0)
| (value & S_IWUSR ? S_IWGRP | S_IROTH : 0)
| (value & S_IXUSR ? S_IXGRP | S_IXOTH : 0));
else if (changes->value & S_IRWXG)
/* Copy `g' permissions onto `u' and `o'. */
value |= (value << 3) | (value >> 3);
value |= ((value & S_IRGRP ? S_IRUSR | S_IROTH : 0)
| (value & S_IWGRP ? S_IWUSR | S_IROTH : 0)
| (value & S_IXGRP ? S_IXUSR | S_IXOTH : 0));
else
/* Copy `o' permissions onto `u' and `g'. */
value |= (value << 3) | (value << 6);
value |= ((value & S_IROTH ? S_IRUSR | S_IRGRP : 0)
| (value & S_IWOTH ? S_IWUSR | S_IRGRP : 0)
| (value & S_IXOTH ? S_IXUSR | S_IXGRP : 0));
/* In order to change only `u', `g', or `o' permissions,
or some combination thereof, clear unselected bits.
@@ -365,8 +405,9 @@ mode_adjust (unsigned int oldmode, const struct mode_change *changes)
directory and no execute bits are already set. */
if ((changes->flags & MODE_X_IF_ANY_X)
&& !S_ISDIR (oldmode)
&& (newmode & 00111) == 0)
value &= ~00111; /* Clear the execute bits. */
&& (newmode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)
/* Clear the execute bits. */
value &= ~ (S_IXUSR | S_IXGRP | S_IXOTH);
}
switch (changes->op)

View File

@@ -20,6 +20,12 @@
#if ! defined MODECHANGE_H_
# define MODECHANGE_H_
# if HAVE_CONFIG_H
# include <config.h>
# endif
# include <sys/types.h>
/* Affect the execute bits only if at least one execute bit is set already,
or if the file is a directory. */
# define MODE_X_IF_ANY_X 01
@@ -33,8 +39,8 @@ struct mode_change
{
char op; /* One of "=+-". */
char flags; /* Special operations. */
unsigned short affected; /* Set for u/g/o/s/s/t, if to be affected. */
unsigned short value; /* Bits to add/remove. */
mode_t affected; /* Set for u/g/o/s/s/t, if to be affected. */
mode_t value; /* Bits to add/remove. */
struct mode_change *next; /* Link to next change in list. */
};
@@ -59,7 +65,7 @@ struct mode_change
struct mode_change *mode_compile PARAMS ((const char *, unsigned));
struct mode_change *mode_create_from_ref PARAMS ((const char *));
unsigned short mode_adjust PARAMS ((unsigned, const struct mode_change *));
mode_t mode_adjust PARAMS ((mode_t, const struct mode_change *));
void mode_free PARAMS ((struct mode_change *));
#endif

View File

@@ -1,5 +1,5 @@
/* mountlist.c -- return a list of mounted filesystems
Copyright (C) 1991, 1992, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1991, 1992, 1997-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,7 +40,6 @@ char *strstr ();
char *xmalloc ();
char *xrealloc ();
char *xstrdup ();
void error ();
#include <errno.h>
#ifndef errno
@@ -85,6 +84,11 @@ extern int errno;
# include <sys/fs_types.h>
#endif
#ifdef MOUNTED_FS_STAT_DEV /* BeOS. */
# include <fs_info.h>
# include <dirent.h>
#endif
#ifdef MOUNTED_FREAD /* SVR2. */
# include <mnttab.h>
#endif
@@ -256,7 +260,7 @@ static char *
fsp_to_string (const struct statfs *fsp)
{
# if defined HAVE_F_FSTYPENAME_IN_STATFS
return fsp->f_fstypename;
return (char *) (fsp->f_fstypename);
# else
return fstype_to_string (fsp->f_type);
# endif
@@ -413,6 +417,111 @@ read_filesystem_list (int need_fs_type)
}
#endif /* MOUNTED_GETMNT. */
#if defined (MOUNTED_FS_STAT_DEV) /* BeOS */
{
/* The next_dev() and fs_stat_dev() system calls give the list of
all filesystems, including the information returned by statvfs()
(fs type, total blocks, free blocks etc.), but without the mount
point. But on BeOS all filesystems except / are mounted in the
rootfs, directly under /.
The directory name of the mount point is often, but not always,
identical to the volume name of the device.
We therefore get the list of subdirectories of /, and the list
of all filesystems, and match the two lists. */
DIR *dirp;
struct rootdir_entry
{
char *name;
dev_t dev;
ino_t ino;
struct rootdir_entry *next;
};
struct rootdir_entry *rootdir_list;
struct rootdir_entry **rootdir_tail;
int32 pos;
dev_t dev;
fs_info fi;
/* All volumes are mounted in the rootfs, directly under /. */
rootdir_list = NULL;
rootdir_tail = &rootdir_list;
dirp = opendir ("/");
if (dirp)
{
struct dirent *d;
while ((d = readdir (dirp)) != NULL)
{
char *name;
struct stat statbuf;
if (strcmp (d->d_name, "..") == 0)
continue;
if (strcmp (d->d_name, ".") == 0)
name = xstrdup ("/");
else
{
name = xmalloc (1 + strlen (d->d_name) + 1);
name[0] = '/';
strcpy (name + 1, d->d_name);
}
if (lstat (name, &statbuf) >= 0 && S_ISDIR (statbuf.st_mode))
{
struct rootdir_entry *re;
re = (struct rootdir_entry *) xmalloc (sizeof (struct rootdir_entry));
re->name = name;
re->dev = statbuf.st_dev;
re->ino = statbuf.st_ino;
/* Add to the linked list. */
*rootdir_tail = re;
rootdir_tail = &re->next;
}
else
free (name);
}
closedir (dirp);
}
*rootdir_tail = NULL;
for (pos = 0; (dev = next_dev (&pos)) >= 0; )
if (fs_stat_dev (dev, &fi) >= 0)
{
/* Note: fi.dev == dev. */
struct rootdir_entry *re;
for (re = rootdir_list; re; re = re->next)
if (re->dev == fi.dev && re->ino == fi.root)
break;
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
me->me_devname = xstrdup (fi.device_name[0] != '\0' ? fi.device_name : fi.fsh_name);
me->me_mountdir = xstrdup (re != NULL ? re->name : fi.fsh_name);
me->me_type = xstrdup (fi.fsh_name);
me->me_dev = fi.dev;
me->me_dummy = 0;
me->me_remote = (fi.flags & B_FS_IS_SHARED) != 0;
/* Add to the linked list. */
*mtail = me;
mtail = &me->me_next;
}
*mtail = NULL;
while (rootdir_list != NULL)
{
struct rootdir_entry *re = rootdir_list;
rootdir_list = re->next;
free (re->name);
free (re);
}
}
#endif /* MOUNTED_FS_STAT_DEV */
#if defined (MOUNTED_GETFSSTAT) /* __alpha running OSF_1 */
{
int numsys, counter, bufsize;
@@ -615,6 +724,8 @@ read_filesystem_list (int need_fs_type)
for (thisent = entries; thisent < entries + bufsize;
thisent += vmp->vmt_length)
{
char *options, *ignore;
vmp = (struct vmount *) thisent;
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
if (vmp->vmt_flags & MNT_REMOTE)
@@ -638,7 +749,12 @@ read_filesystem_list (int need_fs_type)
}
me->me_mountdir = xstrdup (thisent + vmp->vmt_data[VMT_STUB].vmt_off);
me->me_type = xstrdup (fstype_to_string (vmp->vmt_gfstype));
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
options = thisent + vmp->vmt_data[VMT_ARGS].vmt_off;
ignore = strstr (options, "ignore");
me->me_dummy = (ignore
&& (ignore == options || ignore[-1] == ',')
&& (ignore[sizeof "ignore" - 1] == ','
|| ignore[sizeof "ignore" - 1] == '\0'));
me->me_dev = (dev_t) -1; /* vmt_fsid might be the info we want. */
/* Add to the linked list. */

View File

@@ -1,5 +1,5 @@
/* mountlist.h -- declarations for list of mounted filesystems
Copyright (C) 1991, 1992, 1998 Free Software Foundation, Inc.
Copyright (C) 1991, 1992, 1998, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -39,7 +39,10 @@ struct mount_entry *read_filesystem_list PARAMS ((int need_fs_type));
#ifndef ME_DUMMY
# define ME_DUMMY(fs_name, fs_type) \
(!strcmp (fs_type, "auto") || !strcmp (fs_type, "ignore"))
(!strcmp (fs_type, "auto") \
|| !strcmp (fs_type, "autofs") \
/* for Irix 6.5 */ \
|| !strcmp (fs_type, "ignore"))
#endif
#ifndef ME_REMOTE

107
lib/nanosleep.c Normal file
View File

@@ -0,0 +1,107 @@
/* Provide a replacement for the POSIX nanosleep function.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* written by Jim Meyering */
#include <config.h>
/* Undefine nanosleep here so any prototype is not redefined to be a
prototype for rpl_nanosleep. (they'd conflict e.g., on alpha-dec-osf3.2) */
#undef nanosleep
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "nanosleep.h"
static int suspended;
int first_call = 1;
/* Handle SIGCONT. */
static void
sighandler (int sig)
{
suspended = 1;
}
/* FIXME: comment */
static void
my_usleep (const struct timespec *ts_delay)
{
struct timeval tv_delay;
tv_delay.tv_sec = ts_delay->tv_sec;
tv_delay.tv_usec = ts_delay->tv_nsec / 1000;
select (0, (void *) 0, (void *) 0, (void *) 0, &tv_delay);
}
/* FIXME: comment */
int
rpl_nanosleep (const struct timespec *requested_delay,
struct timespec *remaining_delay)
{
#ifdef SA_NOCLDSTOP
struct sigaction oldact, newact;
#endif
suspended = 0;
/* set up sig handler */
if (first_call)
{
#ifdef SA_NOCLDSTOP
newact.sa_handler = sighandler;
sigemptyset (&newact.sa_mask);
newact.sa_flags = 0;
sigaction (SIGCONT, NULL, &oldact);
if (oldact.sa_handler != SIG_IGN)
sigaction (SIGCONT, &newact, NULL);
#else
if (signal (SIGCONT, SIG_IGN) != SIG_IGN)
signal (SIGCONT, sighandler);
#endif
first_call = 0;
}
my_usleep (requested_delay);
if (suspended)
{
/* Calculate time remaining. */
/* FIXME: the code in sleep doesn't use this, so there's no
rush to implement it. */
errno = EINTR;
}
/* FIXME: Restore sig handler? */
return suspended;
}

49
lib/nanosleep.h Normal file
View File

@@ -0,0 +1,49 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if ! defined NANOSLEEP_H
# define NANOSLEEP_H
/* You must include config.h before including this file. */
# include <sys/types.h>
# if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
# else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
# endif
# if ! HAVE_STRUCT_TIMESPEC
/* Some systems don't define this struct, e.g., AIX 4.1, Ultrix 4.3. */
struct timespec
{
time_t tv_sec;
long tv_nsec;
};
# endif
# if ! HAVE_DECL_NANOSLEEP
/* Don't specify a prototype here. Some systems (e.g., OSF) declare
nanosleep with a conflicting one (const-less first parameter). */
int nanosleep ();
# endif
#endif

View File

@@ -1,5 +1,5 @@
/* obstack.c - subroutines used implicitly by object stack macros
Copyright (C) 1988,89,90,91,92,93,94,96 Free Software Foundation, Inc.
Copyright (C) 1988-1994,96,97,98,99 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
@@ -19,6 +19,10 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "obstack.h"
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
@@ -37,60 +41,62 @@
#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#include <gnu-versions.h>
#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
#define ELIDE_CODE
#endif
# include <gnu-versions.h>
# if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
# define ELIDE_CODE
# endif
#endif
#ifndef ELIDE_CODE
#if defined (__STDC__) && __STDC__
#define POINTER void *
#else
#define POINTER char *
#endif
# if defined (__STDC__) && __STDC__
# define POINTER void *
# else
# define POINTER char *
# endif
/* Determine default alignment. */
struct fooalign {char x; double d;};
#define DEFAULT_ALIGNMENT \
# define DEFAULT_ALIGNMENT \
((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0))
/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
But in fact it might be less smart and round addresses to as much as
DEFAULT_ROUNDING. So we prepare for it to do that. */
union fooround {long x; double d;};
#define DEFAULT_ROUNDING (sizeof (union fooround))
# define DEFAULT_ROUNDING (sizeof (union fooround))
/* When we copy a long block of data, this is the unit to do it with.
On some machines, copying successive ints does not work;
in such a case, redefine COPYING_UNIT to `long' (if that works)
or `char' as a last resort. */
#ifndef COPYING_UNIT
#define COPYING_UNIT int
#endif
# ifndef COPYING_UNIT
# define COPYING_UNIT int
# endif
/* The functions allocating more room by calling `obstack_chunk_alloc'
jump to the handler pointed to by `obstack_alloc_failed_handler'.
This variable by default points to the internal function
This can be set to a user defined function which should either
abort gracefully or use longjump - but shouldn't return. This
variable by default points to the internal function
`print_and_abort'. */
#if defined (__STDC__) && __STDC__
# if defined (__STDC__) && __STDC__
static void print_and_abort (void);
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
#else
# else
static void print_and_abort ();
void (*obstack_alloc_failed_handler) () = print_and_abort;
#endif
# endif
/* Exit value used when `print_and_abort' is used. */
#if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif
# if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
# include <stdlib.h>
# endif
# ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
# endif
int obstack_exit_failure = EXIT_FAILURE;
/* The non-GNU-C macros copy the obstack into this global variable
@@ -104,33 +110,33 @@ struct obstack *_obstack;
For free, do not use ?:, since some compilers, like the MIPS compilers,
do not allow (expr) ? void : void. */
#if defined (__STDC__) && __STDC__
#define CALL_CHUNKFUN(h, size) \
# if defined (__STDC__) && __STDC__
# define CALL_CHUNKFUN(h, size) \
(((h) -> use_extra_arg) \
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
: (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
#define CALL_FREEFUN(h, old_chunk) \
# define CALL_FREEFUN(h, old_chunk) \
do { \
if ((h) -> use_extra_arg) \
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
else \
(*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
} while (0)
#else
#define CALL_CHUNKFUN(h, size) \
# else
# define CALL_CHUNKFUN(h, size) \
(((h) -> use_extra_arg) \
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
: (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size)))
#define CALL_FREEFUN(h, old_chunk) \
# define CALL_FREEFUN(h, old_chunk) \
do { \
if ((h) -> use_extra_arg) \
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
else \
(*(void (*) ()) (h)->freefun) ((old_chunk)); \
} while (0)
#endif
# endif
/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
@@ -138,27 +144,26 @@ struct obstack *_obstack;
CHUNKFUN is the function to use to allocate chunks,
and FREEFUN the function to free them.
Return nonzero if successful, zero if out of memory.
To recover from an out of memory error,
free up some memory, then call this again. */
Return nonzero if successful, calls obstack_alloc_failed_handler if
allocation fails. */
int
_obstack_begin (h, size, alignment, chunkfun, freefun)
struct obstack *h;
int size;
int alignment;
#if defined (__STDC__) && __STDC__
# if defined (__STDC__) && __STDC__
POINTER (*chunkfun) (long);
void (*freefun) (void *);
#else
# else
POINTER (*chunkfun) ();
void (*freefun) ();
#endif
# endif
{
register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0)
alignment = DEFAULT_ALIGNMENT;
alignment = (int) DEFAULT_ALIGNMENT;
if (size == 0)
/* Default size is what GNU malloc can fit in a 4096-byte block. */
{
@@ -176,13 +181,13 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
size = 4096 - extra;
}
#if defined (__STDC__) && __STDC__
# if defined (__STDC__) && __STDC__
h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
#else
# else
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
h->freefun = freefun;
#endif
# endif
h->chunk_size = size;
h->alignment_mask = alignment - 1;
h->use_extra_arg = 0;
@@ -205,19 +210,19 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
struct obstack *h;
int size;
int alignment;
#if defined (__STDC__) && __STDC__
# if defined (__STDC__) && __STDC__
POINTER (*chunkfun) (POINTER, long);
void (*freefun) (POINTER, POINTER);
#else
# else
POINTER (*chunkfun) ();
void (*freefun) ();
#endif
# endif
POINTER arg;
{
register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0)
alignment = DEFAULT_ALIGNMENT;
alignment = (int) DEFAULT_ALIGNMENT;
if (size == 0)
/* Default size is what GNU malloc can fit in a 4096-byte block. */
{
@@ -235,13 +240,13 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
size = 4096 - extra;
}
#if defined(__STDC__) && __STDC__
# if defined(__STDC__) && __STDC__
h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
#else
# else
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
h->freefun = freefun;
#endif
# endif
h->chunk_size = size;
h->alignment_mask = alignment - 1;
h->extra_arg = arg;
@@ -274,9 +279,9 @@ _obstack_newchunk (h, length)
register struct _obstack_chunk *old_chunk = h->chunk;
register struct _obstack_chunk *new_chunk;
register long new_size;
register int obj_size = h->next_free - h->object_base;
register int i;
int already;
register long obj_size = h->next_free - h->object_base;
register long i;
long already;
/* Compute size for new chunk. */
new_size = (obj_size + length) + (obj_size >> 3) + 100;
@@ -330,11 +335,11 @@ _obstack_newchunk (h, length)
This is here for debugging.
If you use it in a program, you are probably losing. */
#if defined (__STDC__) && __STDC__
# if defined (__STDC__) && __STDC__
/* Suppress -Wmissing-prototypes warning. We don't want to declare this in
obstack.h because it is just for debugging. */
int _obstack_allocated_p (struct obstack *h, POINTER obj);
#endif
# endif
int
_obstack_allocated_p (h, obj)
@@ -359,7 +364,7 @@ _obstack_allocated_p (h, obj)
/* Free objects in obstack H, including OBJ and everything allocate
more recently than OBJ. If OBJ is zero, free everything in H. */
#undef obstack_free
# undef obstack_free
/* This function has two names with identical definitions.
This is the first one, called from non-ANSI code. */
@@ -445,32 +450,37 @@ _obstack_memory_used (h)
}
/* Define the error handler. */
#ifndef _
# ifdef HAVE_LIBINTL_H
# include <libintl.h>
# ifndef _
# define _(Str) gettext (Str)
# ifndef _
# ifdef HAVE_LIBINTL_H
# include <libintl.h>
# ifndef _
# define _(Str) gettext (Str)
# endif
# else
# define _(Str) (Str)
# endif
# else
# define _(Str) (Str)
# endif
#endif
# if defined _LIBC && defined USE_IN_LIBIO
# include <libio/iolibio.h>
# define fputs(s, f) _IO_fputs (s, f)
# endif
static void
print_and_abort ()
{
fputs (_("memory exhausted\n"), stderr);
fputs (_("memory exhausted"), stderr);
fputc ('\n', stderr);
exit (obstack_exit_failure);
}
#if 0
# if 0
/* These are now turned off because the applications do not use it
and it uses bcopy via obstack_grow, which causes trouble on sysV. */
/* Now define the functional versions of the obstack macros.
Define them to simply use the corresponding macros to do the job. */
#if defined (__STDC__) && __STDC__
# if defined (__STDC__) && __STDC__
/* These function definitions do not work with non-ANSI preprocessors;
they won't pass through the macro names in parentheses. */
@@ -581,8 +591,8 @@ POINTER (obstack_copy0) (obstack, pointer, length)
return obstack_copy0 (obstack, pointer, length);
}
#endif /* __STDC__ */
# endif /* __STDC__ */
#endif /* 0 */
# endif /* 0 */
#endif /* !ELIDE_CODE */

View File

@@ -1,5 +1,5 @@
/* obstack.h - object stack macros
Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
the C library, however. The master source lives in /gd/gnu/lib.
@@ -118,45 +118,39 @@ extern "C" {
may ignore the byte-within-word field of the pointer. */
#ifndef __PTR_TO_INT
#define __PTR_TO_INT(P) ((P) - (char *) 0)
# define __PTR_TO_INT(P) ((P) - (char *) 0)
#endif
#ifndef __INT_TO_PTR
#define __INT_TO_PTR(P) ((P) + (char *) 0)
# define __INT_TO_PTR(P) ((P) + (char *) 0)
#endif
/* We need the type of the resulting object. In ANSI C it is ptrdiff_t
but in traditional C it is usually long. If we are in ANSI C and
don't already have ptrdiff_t get it. */
/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is
defined, as with GNU C, use that; that way we don't pollute the
namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is
available, include it and use ptrdiff_t. In traditional C, long is
the best that we can do. */
#if defined (__STDC__) && __STDC__ && ! defined (offsetof)
#if defined (__GNUC__) && defined (IN_GCC)
/* On Next machine, the system's stddef.h screws up if included
after we have defined just ptrdiff_t, so include all of stddef.h.
Otherwise, define just ptrdiff_t, which is all we need. */
#ifndef __NeXT__
#define __need_ptrdiff_t
#endif
#endif
#include <stddef.h>
#endif
#if defined (__STDC__) && __STDC__
#define PTR_INT_TYPE ptrdiff_t
#ifdef __PTRDIFF_TYPE__
# define PTR_INT_TYPE __PTRDIFF_TYPE__
#else
#define PTR_INT_TYPE long
# ifdef HAVE_STDDEF_H
# include <stddef.h>
# define PTR_INT_TYPE ptrdiff_t
# else
# define PTR_INT_TYPE long
# endif
#endif
#if defined (_LIBC) || defined (HAVE_STRING_H)
#include <string.h>
#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
#if defined _LIBC || defined HAVE_STRING_H
# include <string.h>
# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
#else
#ifdef memcpy
#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
#else
#define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
#endif
# ifdef memcpy
# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
# else
# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
# endif
#endif
struct _obstack_chunk /* Lives at front of each chunk. */
@@ -175,7 +169,7 @@ struct obstack /* control current object in current chunk */
char *chunk_limit; /* address of char after current chunk */
PTR_INT_TYPE temp; /* Temporary for some macros. */
int alignment_mask; /* Mask of alignment for each object. */
#if defined (__STDC__) && __STDC__
#if defined __STDC__ && __STDC__
/* These prototypes vary based on `use_extra_arg', and we use
casts to the prototypeless function type in all assignments,
but having prototypes here quiets -Wstrict-prototypes. */
@@ -199,7 +193,7 @@ struct obstack /* control current object in current chunk */
/* Declare the external functions we use; they are in obstack.c. */
#if defined (__STDC__) && __STDC__
#if defined __STDC__ && __STDC__
extern void _obstack_newchunk (struct obstack *, int);
extern void _obstack_free (struct obstack *, void *);
extern int _obstack_begin (struct obstack *, int, int,
@@ -216,7 +210,7 @@ extern int _obstack_begin_1 ();
extern int _obstack_memory_used ();
#endif
#if defined (__STDC__) && __STDC__
#if defined __STDC__ && __STDC__
/* Do the function-declarations after the structs
but before defining the macros. */
@@ -262,9 +256,10 @@ int obstack_memory_used (struct obstack *obstack);
so we do not declare them. */
/* Error handler called when `obstack_chunk_alloc' failed to allocate
more memory. This can be set to a user defined function. The
default action is to print a message and abort. */
#if defined (__STDC__) && __STDC__
more memory. This can be set to a user defined function which
should either abort gracefully or use longjump - but shouldn't
return. The default action is to print a message and abort. */
#if defined __STDC__ && __STDC__
extern void (*obstack_alloc_failed_handler) (void);
#else
extern void (*obstack_alloc_failed_handler) ();
@@ -293,53 +288,53 @@ extern int obstack_exit_failure;
/* To prevent prototype warnings provide complete argument list in
standard C version. */
#if defined (__STDC__) && __STDC__
#if defined __STDC__ && __STDC__
#define obstack_init(h) \
# define obstack_init(h) \
_obstack_begin ((h), 0, 0, \
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
#define obstack_begin(h, size) \
# define obstack_begin(h, size) \
_obstack_begin ((h), (size), 0, \
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
_obstack_begin ((h), (size), (alignment), \
(void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun))
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
_obstack_begin_1 ((h), (size), (alignment), \
(void *(*) (void *, long)) (chunkfun), \
(void (*) (void *, void *)) (freefun), (arg))
#define obstack_chunkfun(h, newchunkfun) \
# define obstack_chunkfun(h, newchunkfun) \
((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
#define obstack_freefun(h, newfreefun) \
# define obstack_freefun(h, newfreefun) \
((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
#else
#define obstack_init(h) \
# define obstack_init(h) \
_obstack_begin ((h), 0, 0, \
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
#define obstack_begin(h, size) \
# define obstack_begin(h, size) \
_obstack_begin ((h), (size), 0, \
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
_obstack_begin ((h), (size), (alignment), \
(void *(*) ()) (chunkfun), (void (*) ()) (freefun))
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
_obstack_begin_1 ((h), (size), (alignment), \
(void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg))
#define obstack_chunkfun(h, newchunkfun) \
# define obstack_chunkfun(h, newchunkfun) \
((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
#define obstack_freefun(h, newfreefun) \
# define obstack_freefun(h, newfreefun) \
((h) -> freefun = (void (*)()) (newfreefun))
#endif
@@ -350,30 +345,30 @@ extern int obstack_exit_failure;
#define obstack_memory_used(h) _obstack_memory_used (h)
#if defined (__GNUC__) && defined (__STDC__) && __STDC__
#if defined __GNUC__ && defined __STDC__ && __STDC__
/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
does not implement __extension__. But that compiler doesn't define
__GNUC_MINOR__. */
#if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
#define __extension__
#endif
# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
# define __extension__
# endif
/* For GNU C, if not -traditional,
we can define these macros to compute all args only once
without using a global variable.
Also, we can avoid using the `temp' slot, to make faster code. */
#define obstack_object_size(OBSTACK) \
# define obstack_object_size(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
(unsigned) (__o->next_free - __o->object_base); })
#define obstack_room(OBSTACK) \
# define obstack_room(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
(unsigned) (__o->chunk_limit - __o->next_free); })
#define obstack_make_room(OBSTACK,length) \
# define obstack_make_room(OBSTACK,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
@@ -381,12 +376,12 @@ __extension__ \
_obstack_newchunk (__o, __len); \
(void) 0; })
#define obstack_empty_p(OBSTACK) \
# define obstack_empty_p(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
(__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
#define obstack_grow(OBSTACK,where,length) \
# define obstack_grow(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
@@ -396,7 +391,7 @@ __extension__ \
__o->next_free += __len; \
(void) 0; })
#define obstack_grow0(OBSTACK,where,length) \
# define obstack_grow0(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
@@ -407,7 +402,7 @@ __extension__ \
*(__o->next_free)++ = 0; \
(void) 0; })
#define obstack_1grow(OBSTACK,datum) \
# define obstack_1grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + 1 > __o->chunk_limit) \
@@ -419,7 +414,7 @@ __extension__ \
and that the data added so far to the current object
shares that much alignment. */
#define obstack_ptr_grow(OBSTACK,datum) \
# define obstack_ptr_grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
@@ -427,7 +422,7 @@ __extension__ \
*((void **)__o->next_free)++ = ((void *)datum); \
(void) 0; })
#define obstack_int_grow(OBSTACK,datum) \
# define obstack_int_grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (int) > __o->chunk_limit) \
@@ -435,10 +430,10 @@ __extension__ \
*((int *)__o->next_free)++ = ((int)datum); \
(void) 0; })
#define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr)
#define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr)
# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
#define obstack_blank(OBSTACK,length) \
# define obstack_blank(OBSTACK,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
@@ -447,19 +442,19 @@ __extension__ \
__o->next_free += __len; \
(void) 0; })
#define obstack_alloc(OBSTACK,length) \
# define obstack_alloc(OBSTACK,length) \
__extension__ \
({ struct obstack *__h = (OBSTACK); \
obstack_blank (__h, (length)); \
obstack_finish (__h); })
#define obstack_copy(OBSTACK,where,length) \
# define obstack_copy(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__h = (OBSTACK); \
obstack_grow (__h, (where), (length)); \
obstack_finish (__h); })
#define obstack_copy0(OBSTACK,where,length) \
# define obstack_copy0(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__h = (OBSTACK); \
obstack_grow0 (__h, (where), (length)); \
@@ -467,7 +462,7 @@ __extension__ \
/* The local variable is named __o1 to avoid a name conflict
when obstack_blank is called. */
#define obstack_finish(OBSTACK) \
# define obstack_finish(OBSTACK) \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
void *value; \
@@ -483,23 +478,23 @@ __extension__ \
__o1->object_base = __o1->next_free; \
value; })
#define obstack_free(OBSTACK, OBJ) \
# define obstack_free(OBSTACK, OBJ) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
void *__obj = (OBJ); \
if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
__o->next_free = __o->object_base = __obj; \
__o->next_free = __o->object_base = (char *)__obj; \
else (obstack_free) (__o, __obj); })
#else /* not __GNUC__ or not __STDC__ */
#define obstack_object_size(h) \
# define obstack_object_size(h) \
(unsigned) ((h)->next_free - (h)->object_base)
#define obstack_room(h) \
# define obstack_room(h) \
(unsigned) ((h)->chunk_limit - (h)->next_free)
#define obstack_empty_p(h) \
# define obstack_empty_p(h) \
((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
@@ -508,19 +503,19 @@ __extension__ \
Casting the third operand to void was tried before,
but some compilers won't accept it. */
#define obstack_make_room(h,length) \
# define obstack_make_room(h,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0))
#define obstack_grow(h,where,length) \
# define obstack_grow(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
_obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
(h)->next_free += (h)->temp)
#define obstack_grow0(h,where,length) \
# define obstack_grow0(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
@@ -528,40 +523,40 @@ __extension__ \
(h)->next_free += (h)->temp, \
*((h)->next_free)++ = 0)
#define obstack_1grow(h,datum) \
# define obstack_1grow(h,datum) \
( (((h)->next_free + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), 1), 0) : 0), \
(*((h)->next_free)++ = (datum)))
#define obstack_ptr_grow(h,datum) \
# define obstack_ptr_grow(h,datum) \
( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
(*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum)))
#define obstack_int_grow(h,datum) \
# define obstack_int_grow(h,datum) \
( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
(*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum)))
#define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr)
#define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
# define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr)
# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
#define obstack_blank(h,length) \
# define obstack_blank(h,length) \
( (h)->temp = (length), \
(((h)->chunk_limit - (h)->next_free < (h)->temp) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
((h)->next_free += (h)->temp))
#define obstack_alloc(h,length) \
# define obstack_alloc(h,length) \
(obstack_blank ((h), (length)), obstack_finish ((h)))
#define obstack_copy(h,where,length) \
# define obstack_copy(h,where,length) \
(obstack_grow ((h), (where), (length)), obstack_finish ((h)))
#define obstack_copy0(h,where,length) \
# define obstack_copy0(h,where,length) \
(obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
#define obstack_finish(h) \
# define obstack_finish(h) \
( ((h)->next_free == (h)->object_base \
? (((h)->maybe_empty_object = 1), 0) \
: 0), \
@@ -575,21 +570,21 @@ __extension__ \
(h)->object_base = (h)->next_free, \
__INT_TO_PTR ((h)->temp))
#if defined (__STDC__) && __STDC__
#define obstack_free(h,obj) \
# if defined __STDC__ && __STDC__
# define obstack_free(h,obj) \
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
? (int) ((h)->next_free = (h)->object_base \
= (h)->temp + (char *) (h)->chunk) \
: (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
#else
#define obstack_free(h,obj) \
# else
# define obstack_free(h,obj) \
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
? (int) ((h)->next_free = (h)->object_base \
= (h)->temp + (char *) (h)->chunk) \
: (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0)))
#endif
# endif
#endif /* not __GNUC__ or not __STDC__ */

View File

@@ -1,5 +1,5 @@
/* path-concat.c -- concatenate two arbitrary pathnames
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,22 +32,53 @@
#include <sys/types.h>
char *malloc ();
#ifndef strdup
char *strdup ();
#endif
/* Concatenate two pathname components, DIR and BASE, in newly-allocated
storage and return the result. Return 0 if out of memory. Add a slash
between DIR and BASE in the result if neither would contribute one.
If each would contribute at least one, elide one from the end of DIR.
Otherwise, simply concatenate DIR and BASE. In any case, if
BASE_IN_RESULT is non-NULL, set *BASE_IN_RESULT to point to the copy of
BASE in the returned concatenation. */
#ifndef DIRECTORY_SEPARATOR
# define DIRECTORY_SEPARATOR '/'
#endif
#ifndef ISSLASH
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
#endif
#include "xalloc.h"
#include "path-concat.h"
/* Concatenate two pathname components, DIR and BASE, in
newly-allocated storage and return the result. Return 0 if out of
memory. Add a slash between DIR and BASE in the result if neither
would contribute one. If each would contribute at least one, elide
one from the end of DIR. Otherwise, simply concatenate DIR and
BASE. In any case, if BASE_IN_RESULT is non-NULL, set
*BASE_IN_RESULT to point to the copy of BASE in the returned
concatenation.
DIR may be NULL, BASE must not be.
Return NULL if memory is exhausted. */
char *
path_concat (const char *dir, const char *base, char **base_in_result)
{
char *p;
char *p_concat;
size_t base_len = strlen (base);
size_t dir_len = strlen (dir);
size_t base_len;
size_t dir_len;
if (!dir)
{
p_concat = strdup (base);
if (base_in_result)
*base_in_result = p_concat;
return p_concat;
}
/* DIR is not empty. */
base_len = strlen (base);
dir_len = strlen (dir);
p_concat = malloc (dir_len + base_len + 2);
if (!p_concat)
@@ -55,10 +86,13 @@ path_concat (const char *dir, const char *base, char **base_in_result)
p = mempcpy (p_concat, dir, dir_len);
if (*(p - 1) == '/' && *base == '/')
--p;
else if (*(p - 1) != '/' && *base != '/')
*p++ = '/';
if (dir_len > 0)
{
if (ISSLASH (*(p - 1)) && ISSLASH(*base))
--p;
else if (!ISSLASH (*(p - 1)) && !ISSLASH(*base))
*p++ = DIRECTORY_SEPARATOR;
}
if (base_in_result)
*base_in_result = p;
@@ -67,3 +101,14 @@ path_concat (const char *dir, const char *base, char **base_in_result)
return p_concat;
}
/* Same, but die when memory is exhausted. */
char *
xpath_concat (const char *dir, const char *base, char **base_in_result)
{
char *res = path_concat (dir, base, base_in_result);
if (res)
return res;
xalloc_die ();
}

View File

@@ -1,5 +1,5 @@
/* Define PATH_MAX somehow. Requires sys/types.h.
Copyright (C) 1992 Free Software Foundation, Inc.
Copyright (C) 1992, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,38 +16,39 @@
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _PATHMAX_H
#define _PATHMAX_H
# define _PATHMAX_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
PATH_MAX but might cause redefinition warnings when sys/param.h is
later included (as on MORE/BSD 4.3). */
#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__))
#include <limits.h>
#endif
# if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__))
# include <limits.h>
# endif
#ifndef _POSIX_PATH_MAX
#define _POSIX_PATH_MAX 255
#endif
# ifndef _POSIX_PATH_MAX
# define _POSIX_PATH_MAX 255
# endif
#if !defined(PATH_MAX) && defined(_PC_PATH_MAX)
#define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
#endif
# if !defined(PATH_MAX) && defined(_PC_PATH_MAX)
# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \
: pathconf ("/", _PC_PATH_MAX))
# endif
/* Don't include sys/param.h if it already has been. */
#if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN)
#include <sys/param.h>
#endif
# if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN)
# include <sys/param.h>
# endif
#if !defined(PATH_MAX) && defined(MAXPATHLEN)
#define PATH_MAX MAXPATHLEN
#endif
# if !defined(PATH_MAX) && defined(MAXPATHLEN)
# define PATH_MAX MAXPATHLEN
# endif
#ifndef PATH_MAX
#define PATH_MAX _POSIX_PATH_MAX
#endif
# ifndef PATH_MAX
# define PATH_MAX _POSIX_PATH_MAX
# endif
#endif /* _PATHMAX_H */

View File

@@ -1,5 +1,5 @@
/* Parse dates for touch and date.
Copyright (C) 1989, 1990, 1991, 1998 Free Software Foundation Inc.
Copyright (C) 1989, 1990, 1991, 1998, 2000 Free Software Foundation Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,6 +23,9 @@
#endif
#include <stdio.h>
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include <sys/types.h>
#if HAVE_STRING_H
# include <string.h>

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1994, 1997, 1998 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1994, 1997, 1998, 2000 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -17,14 +17,16 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <errno.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
/* Include errno.h *after* sys/types.h to work around header problems
on AIX 3.2.5. */
#include <errno.h>
/* Don't include stdlib.h because some (e.g., Solaris 2.7) declare putenv
with a non-const argument. That would conflict with the declaration of
rpl_putenv below (due to the #define putenv rpl_putenv from config.h). */

View File

@@ -1,5 +1,5 @@
/* quotearg.c - quote arguments for output
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,15 +26,12 @@
#include <xalloc.h>
#include <ctype.h>
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define ISASCII(c) 1
#if ENABLE_NLS
# include <libintl.h>
# define _(text) gettext (text)
#else
# define ISASCII(c) isascii (c)
#endif
#ifdef isgraph
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
#else
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
# define _(text) text
#endif
#if HAVE_LIMITS_H
@@ -47,6 +44,12 @@
# define UCHAR_MAX ((unsigned char) -1)
#endif
#if HAVE_C_BACKSLASH_A
# define ALERT_CHAR '\a'
#else
# define ALERT_CHAR '\7'
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
@@ -55,14 +58,44 @@
# include <string.h>
#endif
#if HAVE_MBRTOWC && HAVE_WCHAR_H
# include <wchar.h>
# if !HAVE_MBSTATE_T_OBJECT
# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
# define mbstate_t int
# endif
#else
# define mbrtowc(pwc, s, n, ps) 1
# define mbsinit(ps) 1
# define mbstate_t int
#endif
#if HAVE_WCTYPE_H
# include <wctype.h>
#endif
#if !defined iswprint && !HAVE_ISWPRINT
# define iswprint(wc) 1
#endif
#define INT_BITS (sizeof (int) * CHAR_BIT)
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
# undef ISASCII
# define ISASCII(c) 1
#else
# define ISASCII(c) isascii (c)
#endif
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
#undef ISPRINT
#define ISPRINT(c) (ISASCII (c) && isprint (c))
struct quoting_options
{
/* Basic quoting style. */
enum quoting_style style;
/* Quote the chararacters indicated by this bit vector even if the
/* Quote the characters indicated by this bit vector even if the
quoting style would not normally require them to be quoted. */
int quote_these_too[((UCHAR_MAX + 1) / INT_BITS
+ ((UCHAR_MAX + 1) % INT_BITS != 0))];
@@ -76,17 +109,19 @@ char const *const quoting_style_args[] =
"shell-always",
"c",
"escape",
"locale",
0
};
/* Correspondances to quoting style names. */
/* Correspondences to quoting style names. */
enum quoting_style const quoting_style_vals[] =
{
literal_quoting_style,
shell_quoting_style,
shell_always_quoting_style,
c_quoting_style,
escape_quoting_style
escape_quoting_style,
locale_quoting_style
};
/* The default quoting options. */
@@ -135,6 +170,291 @@ set_char_quoting (struct quoting_options *o, char c, int i)
return r;
}
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using QUOTING_STYLE and the
non-quoting-style part of O to control quoting.
Terminate the output with a null character, and return the written
size of the output, not counting the terminating null.
If BUFFERSIZE is too small to store the output string, return the
value that would have been returned had BUFFERSIZE been large enough.
If ARGSIZE is -1, use the string length of the argument for ARGSIZE.
This function acts like quotearg_buffer (BUFFER, BUFFERSIZE, ARG,
ARGSIZE, O), except it uses QUOTING_STYLE instead of the quoting
style specified by O, and O may not be null. */
static size_t
quotearg_buffer_restyled (char *buffer, size_t buffersize,
char const *arg, size_t argsize,
enum quoting_style quoting_style,
struct quoting_options const *o)
{
size_t i;
size_t len = 0;
char const *quote_string = 0;
size_t quote_string_len = 0;
int backslash_escapes = 0;
#define STORE(c) \
do \
{ \
if (len < buffersize) \
buffer[len] = (c); \
len++; \
} \
while (0)
switch (quoting_style)
{
case c_quoting_style:
STORE ('"');
backslash_escapes = 1;
quote_string = "\"";
quote_string_len = 1;
break;
case escape_quoting_style:
backslash_escapes = 1;
break;
case locale_quoting_style:
for (quote_string = _("`"); *quote_string; quote_string++)
STORE (*quote_string);
backslash_escapes = 1;
quote_string = _("'");
quote_string_len = strlen (quote_string);
break;
case shell_always_quoting_style:
STORE ('\'');
quote_string = "'";
quote_string_len = 1;
break;
default:
break;
}
for (i = 0; ! (argsize == (size_t) -1 ? arg[i] == '\0' : i == argsize); i++)
{
unsigned char c;
unsigned char esc;
if (backslash_escapes
&& quote_string_len
&& i + quote_string_len <= argsize
&& memcmp (arg + i, quote_string, quote_string_len) == 0)
STORE ('\\');
c = arg[i];
switch (c)
{
case '?':
switch (quoting_style)
{
case shell_quoting_style:
goto use_shell_always_quoting_style;
case c_quoting_style:
if (i + 2 < argsize && arg[i + 1] == '?')
switch (arg[i + 2])
{
case '!': case '\'':
case '(': case ')': case '-': case '/':
case '<': case '=': case '>':
/* Escape the second '?' in what would otherwise be
a trigraph. */
i += 2;
c = arg[i + 2];
STORE ('?');
STORE ('\\');
STORE ('?');
break;
}
break;
default:
break;
}
break;
case ALERT_CHAR: esc = 'a'; goto c_escape;
case '\b': esc = 'b'; goto c_escape;
case '\f': esc = 'f'; goto c_escape;
case '\n': esc = 'n'; goto c_and_shell_escape;
case '\r': esc = 'r'; goto c_and_shell_escape;
case '\t': esc = 't'; goto c_and_shell_escape;
case '\v': esc = 'v'; goto c_escape;
case '\\': esc = c; goto c_and_shell_escape;
c_and_shell_escape:
if (quoting_style == shell_quoting_style)
goto use_shell_always_quoting_style;
c_escape:
if (backslash_escapes)
{
c = esc;
goto store_escape;
}
break;
case '#': case '~':
if (i != 0)
break;
/* Fall through. */
case ' ':
case '!': /* special in bash */
case '"': case '$': case '&':
case '(': case ')': case '*': case ';':
case '<': case '>': case '[':
case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
case '`': case '|':
/* A shell special character. In theory, '$' and '`' could
be the first bytes of multibyte characters, which means
we should check them with mbrtowc, but in practice this
doesn't happen so it's not worth worrying about. */
if (quoting_style == shell_quoting_style)
goto use_shell_always_quoting_style;
break;
case '\'':
switch (quoting_style)
{
case shell_quoting_style:
goto use_shell_always_quoting_style;
case shell_always_quoting_style:
STORE ('\'');
STORE ('\\');
STORE ('\'');
break;
default:
break;
}
break;
case '%': case '+': case ',': case '-': case '.': case '/':
case '0': case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9': case ':': case '=':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
case 'Y': case 'Z': case ']': case '_': case 'a': case 'b':
case 'c': case 'd': case 'e': case 'f': case 'g': case 'h':
case 'i': case 'j': case 'k': case 'l': case 'm': case 'n':
case 'o': case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y': case 'z':
case '{': case '}':
/* These characters don't cause problems, no matter what the
quoting style is. They cannot start multibyte sequences. */
break;
default:
/* If we have a multibyte sequence, copy it until we reach
its end, find an error, or come back to the initial shift
state. For C-like styles, if the sequence has
unprintable characters, escape the whole sequence, since
we can't easily escape single characters within it. */
{
/* Length of multibyte sequence found so far. */
size_t m = 0;
int printable = 1;
mbstate_t mbstate;
memset (&mbstate, 0, sizeof mbstate);
if (argsize == (size_t) -1)
argsize = strlen (arg);
do
{
wchar_t w;
size_t bytes = mbrtowc (&w, &arg[i + m],
argsize - (i + m), &mbstate);
if (bytes == 0)
break;
else if (bytes == (size_t) -1)
{
printable = 0;
break;
}
else if (bytes == (size_t) -2)
{
printable = 0;
while (i + m < argsize && arg[i + m])
m++;
break;
}
else
{
if (! iswprint (w))
printable = 0;
m += bytes;
}
}
while (! mbsinit (&mbstate));
if (m <= 1)
{
/* Escape a unibyte character like a multibyte
sequence if using backslash escapes, and if the
character is not printable. */
m = backslash_escapes && ! ISPRINT (c);
printable = 0;
}
if (m)
{
/* Output a multibyte sequence, or an escaped
unprintable unibyte character. */
size_t imax = i + m - 1;
for (;;)
{
if (backslash_escapes && ! printable)
{
STORE ('\\');
STORE ('0' + (c >> 6));
STORE ('0' + ((c >> 3) & 7));
c = '0' + (c & 7);
}
if (i == imax)
break;
STORE (c);
c = arg[++i];
}
goto store_c;
}
}
}
if (! (backslash_escapes
&& o->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
goto store_c;
store_escape:
STORE ('\\');
store_c:
STORE (c);
}
if (quote_string)
for (; *quote_string; quote_string++)
STORE (*quote_string);
if (len < buffersize)
buffer[len] = '\0';
return len;
use_shell_always_quoting_style:
return quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
shell_always_quoting_style, o);
}
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using O to control quoting.
If O is null, use the default.
@@ -148,151 +468,9 @@ quotearg_buffer (char *buffer, size_t buffersize,
char const *arg, size_t argsize,
struct quoting_options const *o)
{
unsigned char c;
size_t i;
size_t len;
int quote_mark;
struct quoting_options const *p = o ? o : &default_quoting_options;
enum quoting_style quoting_style = p->style;
#define STORE(c) \
do \
{ \
if (len < buffersize) \
buffer[len] = (c); \
len++; \
} \
while (0)
switch (quoting_style)
{
case shell_quoting_style:
if (! (argsize == (size_t) -1 ? arg[0] == '\0' : argsize == 0))
{
switch (arg[0])
{
case '#': case '~':
break;
default:
len = 0;
for (i = 0; ; i++)
{
if (argsize == (size_t) -1 ? arg[i] == '\0' : i == argsize)
goto done;
c = arg[i];
switch (c)
{
case '\t': case '\n': case ' ':
case '!': /* special in csh */
case '"': case '$': case '&': case '\'':
case '(': case ')': case '*': case ';':
case '<': case '>': case '?': case '[': case '\\':
case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
case '`': case '|':
goto needs_quoting;
}
if (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))
goto needs_quoting;
STORE (c);
}
needs_quoting:;
break;
}
}
/* Fall through. */
case shell_always_quoting_style:
quote_mark = '\'';
break;
case c_quoting_style:
quote_mark = '"';
break;
default:
quote_mark = 0;
break;
}
len = 0;
if (quote_mark)
STORE (quote_mark);
for (i = 0; ! (argsize == (size_t) -1 ? arg[i] == '\0' : i == argsize); i++)
{
c = arg[i];
switch (quoting_style)
{
case literal_quoting_style:
break;
case shell_quoting_style:
case shell_always_quoting_style:
if (c == '\'')
{
STORE ('\'');
STORE ('\\');
STORE ('\'');
}
break;
case c_quoting_style:
case escape_quoting_style:
switch (c)
{
case '?': /* Do not generate trigraphs. */
case '\\': goto store_escape;
/* Not all C compilers know what \a means. */
case 7 : c = 'a'; goto store_escape;
case '\b': c = 'b'; goto store_escape;
case '\f': c = 'f'; goto store_escape;
case '\n': c = 'n'; goto store_escape;
case '\r': c = 'r'; goto store_escape;
case '\t': c = 't'; goto store_escape;
case '\v': c = 'v'; goto store_escape;
case '"':
if (quoting_style == c_quoting_style)
goto store_escape;
break;
default:
if (!ISGRAPH (c))
{
STORE ('\\');
STORE ('0' + (c >> 6));
STORE ('0' + ((c >> 3) & 7));
c = '0' + (c & 7);
goto store_c;
}
break;
}
if (! (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
goto store_c;
store_escape:
STORE ('\\');
}
store_c:
STORE (c);
}
if (quote_mark)
STORE (quote_mark);
done:
if (len < buffersize)
buffer[len] = '\0';
return len;
return quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
p->style, p);
}
/* Use storage slot N to return a quoted version of the string ARG.
@@ -351,6 +529,21 @@ quotearg (char const *arg)
return quotearg_n (0, arg);
}
char *
quotearg_n_style (unsigned int n, enum quoting_style s, char const *arg)
{
struct quoting_options o;
o.style = s;
memset (o.quote_these_too, 0, sizeof o.quote_these_too);
return quotearg_n_options (n, arg, &o);
}
char *
quotearg_style (enum quoting_style s, char const *arg)
{
return quotearg_n_style (0, s, arg);
}
char *
quotearg_char (char const *arg, char ch)
{

View File

@@ -24,11 +24,11 @@ enum quoting_style
shell_quoting_style, /* --quoting-style=shell */
shell_always_quoting_style, /* --quoting-style=shell-always */
c_quoting_style, /* --quoting-style=c */
escape_quoting_style /* --quoting-style=escape */
escape_quoting_style, /* --quoting-style=escape */
locale_quoting_style /* --quoting-style=locale */
};
/* For now, --quoting-style=literal is the default, but
this is planned to change to --quoting-style=shell in the future. */
/* For now, --quoting-style=literal is the default, but this may change. */
#ifndef DEFAULT_QUOTING_STYLE
# define DEFAULT_QUOTING_STYLE literal_quoting_style
#endif
@@ -93,6 +93,15 @@ char *quotearg_n PARAMS ((unsigned int n, char const *arg));
/* Equivalent to quotearg_n (0, ARG). */
char *quotearg PARAMS ((char const *arg));
/* Use style S and storage slot N to return a quoted version of the string ARG.
This is like quotearg_n (N, ARG), except that it uses S with no other
options to specify the quoting method. */
char *quotearg_n_style PARAMS ((unsigned int n, enum quoting_style s,
char const *arg));
/* Equivalent to quotearg_n_style (0, S, ARG). */
char *quotearg_style PARAMS ((enum quoting_style s, char const *arg));
/* Like quotearg (ARG), except also quote any instances of CH. */
char *quotearg_char PARAMS ((char const *arg, char ch));

View File

@@ -1,5 +1,5 @@
/* GNU's read utmp module.
Copyright (C) 1992-1999 Free Software Foundation, Inc.
Copyright (C) 1992-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
# include <string.h>
@@ -41,11 +42,11 @@ extract_trimmed_name (const STRUCT_UTMP *ut)
{
char *p, *trimmed_name;
trimmed_name = xmalloc (sizeof (ut->ut_name) + 1);
strncpy (trimmed_name, ut->ut_name, sizeof (ut->ut_name));
trimmed_name = xmalloc (sizeof (UT_USER (ut)) + 1);
strncpy (trimmed_name, UT_USER (ut), sizeof (UT_USER (ut)));
/* Append a trailing space character. Some systems pad names shorter than
the maximum with spaces, others pad with NULs. Remove any spaces. */
trimmed_name[sizeof (ut->ut_name)] = ' ';
trimmed_name[sizeof (UT_USER (ut))] = ' ';
p = strchr (trimmed_name, ' ');
if (p != NULL)
*p = '\0';
@@ -57,7 +58,7 @@ extract_trimmed_name (const STRUCT_UTMP *ut)
the number of entries, and return zero. If there is any error,
return non-zero and don't modify the parameters. */
#if HAVE_UTMPNAME
#ifdef UTMP_NAME_FUNCTION
int
read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
@@ -66,13 +67,16 @@ read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
STRUCT_UTMP *u;
STRUCT_UTMP *utmp = NULL;
if (utmpname (filename))
return 1;
/* Ignore the return value for now.
Solaris' utmpname returns 1 upon success -- which is contrary
to what the GNU libc version does. In addition, older GNU libc
versions are actually void. */
UTMP_NAME_FUNCTION (filename);
setutent ();
SET_UTMP_ENT ();
n_read = 0;
while ((u = getutent ()) != NULL)
while ((u = GET_UTMP_ENT ()) != NULL)
{
++n_read;
utmp = (STRUCT_UTMP *) realloc (utmp, n_read * sizeof (STRUCT_UTMP));
@@ -81,7 +85,7 @@ read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
utmp[n_read - 1] = *u;
}
endutent ();
END_UTMP_ENT ();
*n_entries = n_read;
*utmp_buf = utmp;
@@ -126,4 +130,4 @@ read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
return 0;
}
#endif /* HAVE_UTMPNAME */
#endif

View File

@@ -1,5 +1,5 @@
/* Declarations for GNU's read utmp module.
Copyright (C) 1992-1999 Free Software Foundation, Inc.
Copyright (C) 1992-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,10 +34,48 @@
# include <utmpx.h>
# define UTMP_STRUCT_NAME utmpx
# define UT_TIME_MEMBER(UT_PTR) ((UT_PTR)->ut_tv.tv_sec)
# define SET_UTMP_ENT setutxent
# define GET_UTMP_ENT getutxent
# define END_UTMP_ENT endutxent
# ifdef HAVE_UTMPXNAME
# define UTMP_NAME_FUNCTION utmpxname
# endif
# else
# include <utmp.h>
# if !HAVE_DECL_GETUTENT
struct utmp *getutent();
# endif
# define UTMP_STRUCT_NAME utmp
# define UT_TIME_MEMBER(UT_PTR) ((UT_PTR)->ut_time)
# define SET_UTMP_ENT setutent
# define GET_UTMP_ENT getutent
# define END_UTMP_ENT endutent
# ifdef HAVE_UTMPNAME
# define UTMP_NAME_FUNCTION utmpname
# endif
# endif
/* Accessor macro for the member named ut_user or ut_name. */
# ifdef HAVE_UTMPX_H
# if HAVE_STRUCT_UTMPX_UT_USER
# define UT_USER(Utmp) ((Utmp)->ut_user)
# endif
# if HAVE_STRUCT_UTMPX_UT_NAME
# undef UT_USER
# define UT_USER(Utmp) ((Utmp)->ut_name)
# endif
# else
# if HAVE_STRUCT_UTMP_UT_USER
# define UT_USER(Utmp) Utmp->ut_user
# endif
# if HAVE_STRUCT_UTMP_UT_NAME
# undef UT_USER
# define UT_USER(Utmp) Utmp->ut_name
# endif
# endif
typedef struct UTMP_STRUCT_NAME STRUCT_UTMP;

31
lib/ref-add.sin Normal file
View File

@@ -0,0 +1,31 @@
# Add this package to a list of references stored in a text file.
#
# Copyright (C) 2000 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
# Written by Bruno Haible <haible@clisp.cons.org>.
#
/^# Packages using this file: / {
s/# Packages using this file://
ta
:a
s/ @PACKAGE@ / @PACKAGE@ /
tb
s/ $/ @PACKAGE@ /
:b
s/^/# Packages using this file:/
}

26
lib/ref-del.sin Normal file
View File

@@ -0,0 +1,26 @@
# Remove this package from a list of references stored in a text file.
#
# Copyright (C) 2000 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
# Written by Bruno Haible <haible@clisp.cons.org>.
#
/^# Packages using this file: / {
s/# Packages using this file://
s/ @PACKAGE@ / /
s/^/# Packages using this file:/
}

View File

@@ -2,7 +2,7 @@
version 0.12.
(Implements POSIX draft P1003.2/D11.2, except for some of the
internationalization features.)
Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
Copyright (C) 1993-1999, 2000 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
@@ -78,7 +78,12 @@
__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
#define btowc __btowc
# define btowc __btowc
/* We are also using some library internals. */
# include <locale/localeinfo.h>
# include <locale/elem-hash.h>
# include <langinfo.h>
#endif
/* This is for other GNU distributions with internationalized messages. */
@@ -164,47 +169,15 @@ char *realloc ();
# define SWITCH_ENUM_CAST(x) (x)
# endif
/* How many characters in the character set. */
# define CHAR_SET_SIZE 256
# ifdef SYNTAX_TABLE
extern char *re_syntax_table;
# else /* not SYNTAX_TABLE */
static char re_syntax_table[CHAR_SET_SIZE];
static void
init_syntax_once ()
{
register int c;
static int done = 0;
if (done)
return;
bzero (re_syntax_table, sizeof re_syntax_table);
for (c = 'a'; c <= 'z'; c++)
re_syntax_table[c] = Sword;
for (c = 'A'; c <= 'Z'; c++)
re_syntax_table[c] = Sword;
for (c = '0'; c <= '9'; c++)
re_syntax_table[c] = Sword;
re_syntax_table['_'] = Sword;
done = 1;
}
# endif /* not SYNTAX_TABLE */
# define SYNTAX(c) re_syntax_table[c]
#endif /* not emacs */
#if defined _LIBC || HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef MB_LEN_MAX
# define MB_LEN_MAX 1
#endif
/* Get the interface, including the syntax bits. */
#include <regex.h>
@@ -254,6 +227,12 @@ init_syntax_once ()
#define ISUPPER(c) (ISASCII (c) && isupper (c))
#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
#ifdef _tolower
# define TOLOWER(c) _tolower(c)
#else
# define TOLOWER(c) tolower(c)
#endif
#ifndef NULL
# define NULL (void *)0
#endif
@@ -270,6 +249,43 @@ init_syntax_once ()
# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
#endif
#ifndef emacs
/* How many characters in the character set. */
# define CHAR_SET_SIZE 256
# ifdef SYNTAX_TABLE
extern char *re_syntax_table;
# else /* not SYNTAX_TABLE */
static char re_syntax_table[CHAR_SET_SIZE];
static void
init_syntax_once ()
{
register int c;
static int done = 0;
if (done)
return;
bzero (re_syntax_table, sizeof re_syntax_table);
for (c = 0; c < CHAR_SET_SIZE; ++c)
if (ISALNUM (c))
re_syntax_table[c] = Sword;
re_syntax_table['_'] = Sword;
done = 1;
}
# endif /* not SYNTAX_TABLE */
# define SYNTAX(c) re_syntax_table[(unsigned char) (c)]
#endif /* emacs */
/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
use `alloca' instead of `malloc'. This is because using malloc in
re_search* or re_match* could cause memory leaks when C-g is used in
@@ -609,7 +625,7 @@ extract_number_and_incr (destination, source)
/* It is useful to test things that ``must'' be true when debugging. */
# include <assert.h>
static int debug = 0;
static int debug;
# define DEBUG_STATEMENT(e) e
# define DEBUG_PRINT1(x) if (debug) printf (x)
@@ -675,7 +691,11 @@ print_partial_compiled_pattern (start, end)
/* Loop over pattern commands. */
while (p < pend)
{
printf ("%d:\t", p - start);
#ifdef _LIBC
printf ("%t:\t", p - start);
#else
printf ("%ld:\t", (long int) (p - start));
#endif
switch ((re_opcode_t) *p++)
{
@@ -765,17 +785,30 @@ print_partial_compiled_pattern (start, end)
case on_failure_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/on_failure_jump to %d", p + mcnt - start);
#ifdef _LIBC
printf ("/on_failure_jump to %t", p + mcnt - start);
#else
printf ("/on_failure_jump to %ld", (long int) (p + mcnt - start));
#endif
break;
case on_failure_keep_string_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/on_failure_keep_string_jump to %d", p + mcnt - start);
#ifdef _LIBC
printf ("/on_failure_keep_string_jump to %t", p + mcnt - start);
#else
printf ("/on_failure_keep_string_jump to %ld",
(long int) (p + mcnt - start));
#endif
break;
case dummy_failure_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/dummy_failure_jump to %d", p + mcnt - start);
#ifdef _LIBC
printf ("/dummy_failure_jump to %t", p + mcnt - start);
#else
printf ("/dummy_failure_jump to %ld", (long int) (p + mcnt - start));
#endif
break;
case push_dummy_failure:
@@ -784,29 +817,50 @@ print_partial_compiled_pattern (start, end)
case maybe_pop_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/maybe_pop_jump to %d", p + mcnt - start);
#ifdef _LIBC
printf ("/maybe_pop_jump to %t", p + mcnt - start);
#else
printf ("/maybe_pop_jump to %ld", (long int) (p + mcnt - start));
#endif
break;
case pop_failure_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/pop_failure_jump to %d", p + mcnt - start);
#ifdef _LIBC
printf ("/pop_failure_jump to %t", p + mcnt - start);
#else
printf ("/pop_failure_jump to %ld", (long int) (p + mcnt - start));
#endif
break;
case jump_past_alt:
extract_number_and_incr (&mcnt, &p);
printf ("/jump_past_alt to %d", p + mcnt - start);
#ifdef _LIBC
printf ("/jump_past_alt to %t", p + mcnt - start);
#else
printf ("/jump_past_alt to %ld", (long int) (p + mcnt - start));
#endif
break;
case jump:
extract_number_and_incr (&mcnt, &p);
printf ("/jump to %d", p + mcnt - start);
#ifdef _LIBC
printf ("/jump to %t", p + mcnt - start);
#else
printf ("/jump to %ld", (long int) (p + mcnt - start));
#endif
break;
case succeed_n:
extract_number_and_incr (&mcnt, &p);
p1 = p + mcnt;
extract_number_and_incr (&mcnt2, &p);
printf ("/succeed_n to %d, %d times", p1 - start, mcnt2);
#ifdef _LIBC
printf ("/succeed_n to %t, %d times", p1 - start, mcnt2);
#else
printf ("/succeed_n to %ld, %d times",
(long int) (p1 - start), mcnt2);
#endif
break;
case jump_n:
@@ -820,7 +874,12 @@ print_partial_compiled_pattern (start, end)
extract_number_and_incr (&mcnt, &p);
p1 = p + mcnt;
extract_number_and_incr (&mcnt2, &p);
printf ("/set_number_at location %d to %d", p1 - start, mcnt2);
#ifdef _LIBC
printf ("/set_number_at location %t to %d", p1 - start, mcnt2);
#else
printf ("/set_number_at location %ld to %d",
(long int) (p1 - start), mcnt2);
#endif
break;
case wordbound:
@@ -887,7 +946,11 @@ print_partial_compiled_pattern (start, end)
putchar ('\n');
}
printf ("%d:\tend of pattern.\n", p - start);
#ifdef _LIBC
printf ("%t:\tend of pattern.\n", p - start);
#else
printf ("%ld:\tend of pattern.\n", (long int) (p - start));
#endif
}
@@ -907,7 +970,11 @@ print_compiled_pattern (bufp)
print_fastmap (bufp->fastmap);
}
printf ("re_nsub: %d\t", bufp->re_nsub);
#ifdef _LIBC
printf ("re_nsub: %Zd\t", bufp->re_nsub);
#else
printf ("re_nsub: %ld\t", (long int) bufp->re_nsub);
#endif
printf ("regs_alloc: %d\t", bufp->regs_allocated);
printf ("can_be_null: %d\t", bufp->can_be_null);
printf ("newline_anchor: %d\n", bufp->newline_anchor);
@@ -1007,25 +1074,79 @@ weak_alias (__re_set_syntax, re_set_syntax)
POSIX doesn't require that we do anything for REG_NOERROR,
but why not be nice? */
static const char *re_error_msgid[] =
static const char re_error_msgid[] =
{
gettext_noop ("Success"), /* REG_NOERROR */
gettext_noop ("No match"), /* REG_NOMATCH */
gettext_noop ("Invalid regular expression"), /* REG_BADPAT */
gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */
gettext_noop ("Invalid character class name"), /* REG_ECTYPE */
gettext_noop ("Trailing backslash"), /* REG_EESCAPE */
gettext_noop ("Invalid back reference"), /* REG_ESUBREG */
gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */
gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */
gettext_noop ("Unmatched \\{"), /* REG_EBRACE */
gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */
gettext_noop ("Invalid range end"), /* REG_ERANGE */
gettext_noop ("Memory exhausted"), /* REG_ESPACE */
gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */
gettext_noop ("Premature end of regular expression"), /* REG_EEND */
gettext_noop ("Regular expression too big"), /* REG_ESIZE */
gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */
#define REG_NOERROR_IDX 0
gettext_noop ("Success") /* REG_NOERROR */
"\0"
#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success")
gettext_noop ("No match") /* REG_NOMATCH */
"\0"
#define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match")
gettext_noop ("Invalid regular expression") /* REG_BADPAT */
"\0"
#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression")
gettext_noop ("Invalid collation character") /* REG_ECOLLATE */
"\0"
#define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character")
gettext_noop ("Invalid character class name") /* REG_ECTYPE */
"\0"
#define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name")
gettext_noop ("Trailing backslash") /* REG_EESCAPE */
"\0"
#define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash")
gettext_noop ("Invalid back reference") /* REG_ESUBREG */
"\0"
#define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference")
gettext_noop ("Unmatched [ or [^") /* REG_EBRACK */
"\0"
#define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [ or [^")
gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */
"\0"
#define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(")
gettext_noop ("Unmatched \\{") /* REG_EBRACE */
"\0"
#define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{")
gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */
"\0"
#define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}")
gettext_noop ("Invalid range end") /* REG_ERANGE */
"\0"
#define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end")
gettext_noop ("Memory exhausted") /* REG_ESPACE */
"\0"
#define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted")
gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */
"\0"
#define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression")
gettext_noop ("Premature end of regular expression") /* REG_EEND */
"\0"
#define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression")
gettext_noop ("Regular expression too big") /* REG_ESIZE */
"\0"
#define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big")
gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
};
static const size_t re_error_msgid_idx[] =
{
REG_NOERROR_IDX,
REG_NOMATCH_IDX,
REG_BADPAT_IDX,
REG_ECOLLATE_IDX,
REG_ECTYPE_IDX,
REG_EESCAPE_IDX,
REG_ESUBREG_IDX,
REG_EBRACK_IDX,
REG_EPAREN_IDX,
REG_EBRACE_IDX,
REG_BADBR_IDX,
REG_ERANGE_IDX,
REG_ESPACE_IDX,
REG_BADRPT_IDX,
REG_EEND_IDX,
REG_ESIZE_IDX,
REG_ERPAREN_IDX
};
/* Avoiding alloca during matching, to placate r_alloc. */
@@ -1508,7 +1629,8 @@ static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p,
reg_syntax_t syntax));
static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend,
reg_syntax_t syntax));
static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
static reg_errcode_t compile_range _RE_ARGS ((unsigned int range_start,
const char **p_ptr,
const char *pend,
char *translate,
reg_syntax_t syntax,
@@ -1706,7 +1828,7 @@ typedef struct
{ if (p != pend) \
{ \
PATFETCH (c); \
while (ISDIGIT (c)) \
while ('0' <= c && c <= '9') \
{ \
if (num < 0) \
num = 0; \
@@ -2112,6 +2234,7 @@ regex_compile (pattern, size, syntax, bufp)
case '[':
{
boolean had_char_class = false;
unsigned int range_start = 0xffffffff;
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
@@ -2155,6 +2278,7 @@ regex_compile (pattern, size, syntax, bufp)
PATFETCH (c1);
SET_LIST_BIT (c1);
range_start = c1;
continue;
}
@@ -2179,8 +2303,10 @@ regex_compile (pattern, size, syntax, bufp)
&& *p != ']')
{
reg_errcode_t ret
= compile_range (&p, pend, translate, syntax, b);
= compile_range (range_start, &p, pend, translate,
syntax, b);
if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
range_start = 0xffffffff;
}
else if (p[0] == '-' && p[1] != ']')
@@ -2190,8 +2316,9 @@ regex_compile (pattern, size, syntax, bufp)
/* Move past the `-'. */
PATFETCH (c1);
ret = compile_range (&p, pend, translate, syntax, b);
ret = compile_range (c, &p, pend, translate, syntax, b);
if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
range_start = 0xffffffff;
}
/* See if we're at the beginning of a possible character
@@ -2314,13 +2441,289 @@ regex_compile (pattern, size, syntax, bufp)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT (':');
range_start = ':';
had_char_class = false;
}
}
else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '=')
{
unsigned char str[MB_LEN_MAX + 1];
#ifdef _LIBC
uint32_t nrules =
_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
#endif
PATFETCH (c);
c1 = 0;
/* If pattern is `[[='. */
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
for (;;)
{
PATFETCH (c);
if ((c == '=' && *p == ']') || p == pend)
break;
if (c1 < MB_LEN_MAX)
str[c1++] = c;
else
/* This is in any case an invalid class name. */
str[0] = '\0';
}
str[c1] = '\0';
if (c == '=' && *p == ']' && str[0] != '\0')
{
/* If we have no collation data we use the default
collation in which each character is in a class
by itself. It also means that ASCII is the
character set and therefore we cannot have character
with more than one byte in the multibyte
representation. */
#ifdef _LIBC
if (nrules == 0)
#endif
{
if (c1 != 1)
FREE_STACK_RETURN (REG_ECOLLATE);
/* Throw away the ] at the end of the equivalence
class. */
PATFETCH (c);
/* Set the bit for the character. */
SET_LIST_BIT (str[0]);
}
#ifdef _LIBC
else
{
/* Try to match the byte sequence in `str' against
those known to the collate implementation.
First find out whether the bytes in `str' are
actually from exactly one character. */
const int32_t *table;
const unsigned char *weights;
const unsigned char *extra;
const int32_t *indirect;
int32_t idx;
const unsigned char *cp = str;
int ch;
/* This #include defines a local function! */
# include <locale/weight.h>
table = (const int32_t *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
weights = (const unsigned char *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB);
extra = (const unsigned char *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
indirect = (const int32_t *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
idx = findidx (&cp);
if (idx == 0 || cp < str + c1)
/* This is no valid character. */
FREE_STACK_RETURN (REG_ECOLLATE);
/* Throw away the ] at the end of the equivalence
class. */
PATFETCH (c);
/* Now we have to go throught the whole table
and find all characters which have the same
first level weight.
XXX Note that this is not entirely correct.
we would have to match multibyte sequences
but this is not possible with the current
implementation. */
for (ch = 1; ch < 256; ++ch)
/* XXX This test would have to be changed if we
would allow matching multibyte sequences. */
if (table[ch] > 0)
{
int32_t idx2 = table[ch];
size_t len = weights[idx2];
/* Test whether the lenghts match. */
if (weights[idx] == len)
{
/* They do. New compare the bytes of
the weight. */
size_t cnt = 0;
while (cnt < len
&& (weights[idx + 1 + cnt]
== weights[idx2 + 1 + cnt]))
++len;
if (cnt == len)
/* They match. Mark the character as
acceptable. */
SET_LIST_BIT (ch);
}
}
}
#endif
had_char_class = true;
}
else
{
c1++;
while (c1--)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT ('=');
range_start = '=';
had_char_class = false;
}
}
else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '.')
{
unsigned char str[128]; /* Should be large enough. */
#ifdef _LIBC
uint32_t nrules =
_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
#endif
PATFETCH (c);
c1 = 0;
/* If pattern is `[[='. */
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
for (;;)
{
PATFETCH (c);
if ((c == '.' && *p == ']') || p == pend)
break;
if (c1 < sizeof (str))
str[c1++] = c;
else
/* This is in any case an invalid class name. */
str[0] = '\0';
}
str[c1] = '\0';
if (c == '.' && *p == ']' && str[0] != '\0')
{
/* If we have no collation data we use the default
collation in which each character is the name
for its own class which contains only the one
character. It also means that ASCII is the
character set and therefore we cannot have character
with more than one byte in the multibyte
representation. */
#ifdef _LIBC
if (nrules == 0)
#endif
{
if (c1 != 1)
FREE_STACK_RETURN (REG_ECOLLATE);
/* Throw away the ] at the end of the equivalence
class. */
PATFETCH (c);
/* Set the bit for the character. */
SET_LIST_BIT (str[0]);
range_start = ((const unsigned char *) str)[0];
}
#ifdef _LIBC
else
{
/* Try to match the byte sequence in `str' against
those known to the collate implementation.
First find out whether the bytes in `str' are
actually from exactly one character. */
int32_t table_size;
const int32_t *symb_table;
const unsigned char *extra;
int32_t idx;
int32_t elem;
int32_t second;
int32_t hash;
table_size =
_NL_CURRENT_WORD (LC_COLLATE,
_NL_COLLATE_SYMB_HASH_SIZEMB);
symb_table = (const int32_t *)
_NL_CURRENT (LC_COLLATE,
_NL_COLLATE_SYMB_TABLEMB);
extra = (const unsigned char *)
_NL_CURRENT (LC_COLLATE,
_NL_COLLATE_SYMB_EXTRAMB);
/* Locate the character in the hashing table. */
hash = elem_hash (str, c1);
idx = 0;
elem = hash % table_size;
second = hash % (table_size - 2);
while (symb_table[2 * elem] != 0)
{
/* First compare the hashing value. */
if (symb_table[2 * elem] == hash
&& c1 == extra[symb_table[2 * elem + 1]]
&& memcmp (str,
&extra[symb_table[2 * elem + 1]
+ 1],
c1) == 0)
{
/* Yep, this is the entry. */
idx = symb_table[2 * elem + 1];
idx += 1 + extra[idx];
break;
}
/* Next entry. */
elem += second;
}
if (symb_table[2 * elem] == 0)
/* This is no valid character. */
FREE_STACK_RETURN (REG_ECOLLATE);
/* Throw away the ] at the end of the equivalence
class. */
PATFETCH (c);
/* Now add the multibyte character(s) we found
to the acceptabed list.
XXX Note that this is not entirely correct.
we would have to match multibyte sequences
but this is not possible with the current
implementation. Also, we have to match
collating symbols, which expand to more than
one file, as a whole and not allow the
individual bytes. */
c1 = extra[idx++];
if (c1 == 1)
range_start = extra[idx];
while (c1-- > 0)
SET_LIST_BIT (extra[idx++]);
}
#endif
had_char_class = false;
}
else
{
c1++;
while (c1--)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT ('.');
range_start = '.';
had_char_class = false;
}
}
else
{
had_char_class = false;
SET_LIST_BIT (c);
range_start = c;
}
}
@@ -2547,8 +2950,7 @@ regex_compile (pattern, size, syntax, bufp)
if (!(syntax & RE_INTERVALS)
/* If we're at `\{' and it's not the open-interval
operator. */
|| ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|| (p - 2 == pattern && p == pend))
|| (syntax & RE_NO_BK_BRACES))
goto normal_backslash;
handle_interval:
@@ -2562,7 +2964,7 @@ regex_compile (pattern, size, syntax, bufp)
if (p == pend)
{
if (syntax & RE_NO_BK_BRACES)
if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
goto unfetch_interval;
else
FREE_STACK_RETURN (REG_EBRACE);
@@ -2573,7 +2975,12 @@ regex_compile (pattern, size, syntax, bufp)
if (c == ',')
{
GET_UNSIGNED_NUMBER (upper_bound);
if (upper_bound < 0) upper_bound = RE_DUP_MAX;
if ((!(syntax & RE_NO_BK_BRACES) && c != '\\')
|| ((syntax & RE_NO_BK_BRACES) && c != '}'))
FREE_STACK_RETURN (REG_BADBR);
if (upper_bound < 0)
upper_bound = RE_DUP_MAX;
}
else
/* Interval such as `{1}' => match exactly once. */
@@ -2582,7 +2989,7 @@ regex_compile (pattern, size, syntax, bufp)
if (lower_bound < 0 || upper_bound > RE_DUP_MAX
|| lower_bound > upper_bound)
{
if (syntax & RE_NO_BK_BRACES)
if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
goto unfetch_interval;
else
FREE_STACK_RETURN (REG_BADBR);
@@ -2597,7 +3004,7 @@ regex_compile (pattern, size, syntax, bufp)
if (c != '}')
{
if (syntax & RE_NO_BK_BRACES)
if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
goto unfetch_interval;
else
FREE_STACK_RETURN (REG_BADBR);
@@ -3070,49 +3477,53 @@ group_in_compile_stack (compile_stack, regnum)
`regex_compile' itself. */
static reg_errcode_t
compile_range (p_ptr, pend, translate, syntax, b)
const char **p_ptr, *pend;
RE_TRANSLATE_TYPE translate;
reg_syntax_t syntax;
unsigned char *b;
compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
unsigned int range_start_char;
const char **p_ptr, *pend;
RE_TRANSLATE_TYPE translate;
reg_syntax_t syntax;
unsigned char *b;
{
unsigned this_char;
const char *p = *p_ptr;
unsigned int range_start, range_end;
reg_errcode_t ret;
char range_start[2];
char range_end[2];
char ch[2];
if (p == pend)
return REG_ERANGE;
/* Even though the pattern is a signed `char *', we need to fetch
with unsigned char *'s; if the high bit of the pattern character
is set, the range endpoints will be negative if we fetch using a
signed char *.
We also want to fetch the endpoints without translating them; the
/* Fetch the endpoints without translating them; the
appropriate translation is done in the bit-setting loop below. */
/* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */
range_start = ((const unsigned char *) p)[-2];
range_end = ((const unsigned char *) p)[0];
range_start[0] = range_start_char;
range_start[1] = '\0';
range_end[0] = p[0];
range_end[1] = '\0';
/* Have to increment the pointer into the pattern string, so the
caller isn't still at the ending character. */
(*p_ptr)++;
/* If the start is after the end, the range is empty. */
if (range_start > range_end)
return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
/* Report an error if the range is empty and the syntax prohibits this. */
ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
/* Here we see why `this_char' has to be larger than an `unsigned
char' -- the range is inclusive, so if `range_end' == 0xff
(assuming 8-bit characters), we would otherwise go into an infinite
loop, since all characters <= 0xff. */
for (this_char = range_start; this_char <= range_end; this_char++)
char' -- we would otherwise go into an infinite loop, since all
characters <= 0xff. */
ch[1] = '\0';
for (this_char = 0; this_char <= (unsigned char) -1; ++this_char)
{
SET_LIST_BIT (TRANSLATE (this_char));
ch[0] = this_char;
if (strcoll (range_start, ch) <= 0 && strcoll (ch, range_end) <= 0)
{
SET_LIST_BIT (TRANSLATE (this_char));
ret = REG_NOERROR;
}
}
return REG_NOERROR;
return ret;
}
/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
@@ -3842,7 +4253,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
fail_stack_type fail_stack;
#endif
#ifdef DEBUG
static unsigned failure_id = 0;
static unsigned failure_id;
unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
#endif
@@ -4773,26 +5184,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
}
else if ((re_opcode_t) *p2 == charset)
{
#ifdef DEBUG
register unsigned char c
= *p2 == (unsigned char) endline ? '\n' : p2[2];
#endif
#if 0
/* We win if the first character of the loop is not part
of the charset. */
if ((re_opcode_t) p1[3] == exactn
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
&& (p2[2 + p1[5] / BYTEWIDTH]
& (1 << (p1[5] % BYTEWIDTH)))))
#else
if ((re_opcode_t) p1[3] == exactn
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[4]
&& (p2[2 + p1[4] / BYTEWIDTH]
& (1 << (p1[4] % BYTEWIDTH)))))
#endif
{
p[-3] = (unsigned char) pop_failure_jump;
DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
c, p1[5]);
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
&& (p2[2 + p1[5] / BYTEWIDTH]
& (1 << (p1[5] % BYTEWIDTH)))))
{
p[-3] = (unsigned char) pop_failure_jump;
DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
}
else if ((re_opcode_t) p1[3] == charset_not)
@@ -5483,7 +5883,7 @@ re_compile_pattern (pattern, length, bufp)
if (!ret)
return NULL;
return gettext (re_error_msgid[(int) ret]);
return gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
}
#ifdef _LIBC
weak_alias (__re_compile_pattern, re_compile_pattern)
@@ -5520,12 +5920,14 @@ re_comp (s)
{
re_comp_buf.buffer = (unsigned char *) malloc (200);
if (re_comp_buf.buffer == NULL)
return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
return (char *) gettext (re_error_msgid
+ re_error_msgid_idx[(int) REG_ESPACE]);
re_comp_buf.allocated = 200;
re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
if (re_comp_buf.fastmap == NULL)
return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
return (char *) gettext (re_error_msgid
+ re_error_msgid_idx[(int) REG_ESPACE]);
}
/* Since `re_exec' always passes NULL for the `regs' argument, we
@@ -5540,7 +5942,7 @@ re_comp (s)
return NULL;
/* Yes, we're discarding `const' here if !HAVE_LIBINTL. */
return (char *) gettext (re_error_msgid[(int) ret]);
return (char *) gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
}
@@ -5628,7 +6030,7 @@ regcomp (preg, pattern, cflags)
/* Map uppercase characters to corresponding lowercase ones. */
for (i = 0; i < CHAR_SET_SIZE; i++)
preg->translate[i] = ISUPPER (i) ? tolower (i) : i;
preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : i;
}
else
preg->translate = NULL;
@@ -5660,7 +6062,7 @@ regcomp (preg, pattern, cflags)
buffer. */
if (re_compile_fastmap (preg) == -2)
{
/* Some error occured while computing the fastmap, just forget
/* Some error occurred while computing the fastmap, just forget
about it. */
free (preg->fastmap);
preg->fastmap = NULL;
@@ -5766,15 +6168,15 @@ regerror (errcode, preg, errbuf, errbuf_size)
size_t msg_size;
if (errcode < 0
|| errcode >= (int) (sizeof (re_error_msgid)
/ sizeof (re_error_msgid[0])))
|| errcode >= (int) (sizeof (re_error_msgid_idx)
/ sizeof (re_error_msgid_idx[0])))
/* Only error codes returned by the rest of the code should be passed
to this routine. If we are given anything else, or if other regex
code generates an invalid error code, then the program has a bug.
Dump core so we can fix it. */
abort ();
msg = gettext (re_error_msgid[errcode]);
msg = gettext (re_error_msgid + re_error_msgid_idx[errcode]);
msg_size = strlen (msg) + 1; /* Includes the null. */

View File

@@ -1,6 +1,6 @@
/* Definitions for data structures and routines for the regular
expression library, version 0.12.
Copyright (C) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc.
Copyright (C) 1985,1989-1993,1995-1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
@@ -221,13 +221,13 @@ extern reg_syntax_t re_syntax_options;
(_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
#define RE_SYNTAX_POSIX_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
| RE_UNMATCHED_RIGHT_PAREN_ORD)
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
| RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
removed and RE_NO_BK_REFS is added. */
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \

View File

@@ -1,113 +0,0 @@
/* BSD compatible rename and directory rename function for System V.
Copyright (C) 1988, 1990 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#if STAT_MACROS_BROKEN
# undef S_ISDIR
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
/* Rename file FROM to file TO.
Return 0 if successful, -1 if not. */
int
rename (char *from, char *to)
{
struct stat from_stats, to_stats;
if (stat (from, &from_stats))
return -1;
/* Be careful not to unlink `from' if it happens to be equal to `to' or
(on filesystems that silently truncate filenames after 14 characters)
if `from' and `to' share the significant characters. */
if (stat (to, &to_stats))
{
if (errno != ENOENT)
return -1;
}
else
{
if ((from_stats.st_dev == to_stats.st_dev)
&& (from_stats.st_ino == to_stats.st_ino))
/* `from' and `to' designate the same file on that filesystem. */
return 0;
if (unlink (to) && errno != ENOENT)
return -1;
}
#ifdef MVDIR
/* If MVDIR is defined, it should be the full filename of a setuid root
program able to link and unlink directories. If MVDIR is not defined,
then the capability of renaming directories may be missing. */
if (S_ISDIR (from_stats.st_mode))
{
/* Need a setuid root process to link and unlink directories. */
int status;
pid_t pid = fork ();
switch (pid)
{
case -1: /* Error. */
return -1; /* errno already set */
case 0: /* Child. */
execl (MVDIR, "mvdir", from, to, (char *) 0);
_exit (1);
default: /* Parent. */
while (wait (&status) != pid)
/* Do nothing. */ ;
if (status)
{
/* MVDIR failed. */
errno = EIO;
return -1;
}
}
}
else
#endif /* MVDIR */
{
if (link (from, to))
return -1;
if (unlink (from) && errno != ENOENT)
{
unlink (to);
return -1;
}
}
return 0;
}

View File

@@ -1,6 +1,6 @@
/* Determine whether string value is affirmation or negative response
according to current locale's data.
Copyright (C) 1996, 1998 Free Software Foundation, Inc.
Copyright (C) 1996, 1998, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,6 +31,9 @@
#if ENABLE_NLS
# include <sys/types.h>
# if HAVE_LIMITS_H
# include <limits.h>
# endif
# include <regex.h>
# include <libintl.h>
# define _(Text) gettext (Text)

7185
lib/rx.c

File diff suppressed because it is too large Load Diff

3732
lib/rx.h

File diff suppressed because it is too large Load Diff

103
lib/same.c Normal file
View File

@@ -0,0 +1,103 @@
/* Determine whether two file names refer to the same file.
Copyright (C) 1997-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* written by Jim Meyering */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#include "same.h"
#include "dirname.h"
#include "error.h"
#if ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
#else
# define _(Text) Text
#endif
#define STREQ(a, b) (strcmp ((a), (b)) == 0)
#ifndef HAVE_DECL_FREE
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_FREE
void free ();
#endif
char *base_name PARAMS ((char const *));
#define SAME_INODE(Stat_buf_1, Stat_buf_2) \
((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
&& (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
/* Return nonzero if SOURCE and DEST point to the same name in the same
directory. */
int
same_name (const char *source, const char *dest)
{
struct stat source_dir_stats;
struct stat dest_dir_stats;
char *source_dirname, *dest_dirname;
source_dirname = dir_name (source);
dest_dirname = dir_name (dest);
if (source_dirname == NULL || dest_dirname == NULL)
error (1, 0, _("virtual memory exhausted"));
if (stat (source_dirname, &source_dir_stats))
{
/* Shouldn't happen. */
error (1, errno, "%s", source_dirname);
}
if (stat (dest_dirname, &dest_dir_stats))
{
/* Shouldn't happen. */
error (1, errno, "%s", dest_dirname);
}
free (source_dirname);
free (dest_dirname);
return (SAME_INODE (source_dir_stats, dest_dir_stats)
&& STREQ (base_name (source), base_name (dest)));
}

36
lib/same.h Normal file
View File

@@ -0,0 +1,36 @@
/* Determine whether two file names refer to the same file.
Copyright (C) 1997-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef SAME_H_
# define SAME_H_ 1
# if HAVE_CONFIG_H
# include <config.h>
# endif
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
int
same_name PARAMS ((const char *source, const char *dest));
#endif /* SAME_H_ */

View File

@@ -1,5 +1,5 @@
/* savedir.c -- save the list of files in a directory in a string
Copyright (C) 1990, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1990, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,16 +23,15 @@
#include <sys/types.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#if HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
# define dirent direct
# define NAMLEN(dirent) (dirent)->d_namlen
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
@@ -54,79 +53,84 @@
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <string.h>
#else
char *malloc ();
char *realloc ();
#endif
#ifndef NULL
# define NULL 0
#endif
#ifndef stpcpy
char *stpcpy ();
#endif
#include "savedir.h"
#include "xalloc.h"
/* Return a freshly allocated string containing the filenames
in directory DIR, separated by '\0' characters;
the end is marked by two '\0' characters in a row.
NAME_SIZE is the number of bytes to initially allocate
for the string; it will be enlarged as needed.
Return NULL if DIR cannot be opened or if out of memory. */
Use NAME_SIZE == -1 if you do not know the size.
Return NULL (setting errno) if DIR cannot be opened, read, or closed. */
#ifndef NAME_SIZE_DEFAULT
# define NAME_SIZE_DEFAULT 512
#endif
char *
savedir (const char *dir, unsigned int name_size)
savedir (const char *dir, off_t name_size)
{
DIR *dirp;
struct dirent *dp;
char *name_space;
char *namep;
size_t allocated = name_size; /* Overflow is checked indirectly below. */
size_t used = 0;
int save_errno;
dirp = opendir (dir);
if (dirp == NULL)
return NULL;
name_space = (char *) malloc (name_size);
if (name_space == NULL)
{
closedir (dirp);
return NULL;
}
namep = name_space;
/* Use the default if the size is not known. Be sure "allocated"
is at least `1' so there's room for the final NUL byte.
Do not simply test name_size <= 0, because the initialization
of "allocated" might have overflowed. */
if (name_size < 0 || allocated == 0)
allocated = NAME_SIZE_DEFAULT;
name_space = xmalloc (allocated);
errno = 0;
while ((dp = readdir (dirp)) != NULL)
{
/* Skip "." and ".." (some NFS filesystems' directories lack them). */
if (dp->d_name[0] != '.'
|| (dp->d_name[1] != '\0'
&& (dp->d_name[1] != '.' || dp->d_name[2] != '\0')))
/* Skip "", ".", and "..". "" is returned by at least one buggy
implementation: Solaris 2.4 readdir on NFS filesystems. */
char const *entry = dp->d_name;
if (entry[entry[0] != '.' ? 0 : entry[1] != '.' ? 1 : 2] != '\0')
{
unsigned size_needed = (namep - name_space) + NAMLEN (dp) + 2;
if (size_needed > name_size)
size_t entry_size = strlen (entry) + 1;
if (used + entry_size < used)
xalloc_die ();
if (allocated <= used + entry_size)
{
char *new_name_space;
while (size_needed > name_size)
name_size += 1024;
new_name_space = realloc (name_space, name_size);
if (new_name_space == NULL)
do
{
closedir (dirp);
return NULL;
if (2 * allocated < allocated)
xalloc_die ();
allocated *= 2;
}
namep += new_name_space - name_space;
name_space = new_name_space;
while (allocated <= used + entry_size);
name_space = xrealloc (name_space, allocated);
}
namep = stpcpy (namep, dp->d_name) + 1;
memcpy (name_space + used, entry, entry_size);
used += entry_size;
}
}
*namep = '\0';
if (CLOSEDIR (dirp))
name_space[used] = '\0';
save_errno = errno;
if (CLOSEDIR (dirp) != 0)
save_errno = errno;
if (save_errno != 0)
{
free (name_space);
errno = save_errno;
return NULL;
}
return name_space;

View File

@@ -10,6 +10,6 @@
# endif
char *
savedir PARAMS ((const char *dir, unsigned int name_size));
savedir PARAMS ((const char *dir, off_t name_size));
#endif

Some files were not shown because too many files have changed in this diff Show More